Container arrangement resource utilization rate optimization method and device, equipment and storage medium
By collecting resource and service quality index data in a container orchestration system, designing a reinforcement learning model to generate scheduling strategies, and dynamically adjusting resource configuration, the problem of not being able to balance resource utilization and service quality in traditional methods is solved, and resource optimization in high-concurrency scenarios is achieved.
Patent Information
- Application Number
- CN202511291373.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-10
- Publication Date
- 2025-12-26
AI Technical Summary
Traditional container orchestration and resource scheduling methods cannot combine resource cost and service quality metrics, resulting in low resource utilization and decreased service quality in high-concurrency scenarios, making them unsuitable for complex business scenarios.
By collecting data on node resource usage and service quality metrics, a state space and action space are designed. A reinforcement learning model is used to generate resource scheduling strategies, dynamically adjust the number of Pod replicas, node allocation, and resource quotas, monitor the scheduling effect in real time, generate early warning information and related business feedback data, and optimize the scheduling strategy.
It significantly improves resource utilization and service quality, is suitable for various high-concurrency scenarios, and enhances the applicability of scheduling strategies and resource utilization efficiency.
Smart Images

Figure CN121210102A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information processing technology, and in particular to a method, apparatus, device and storage medium for optimizing container orchestration resource utilization. Background Technology
[0002] Currently, with the widespread application of cloud computing, Kubernetes (K8s) has become the mainstream platform for container orchestration. However, traditional resource scheduling methods are usually based on fixed thresholds or simple rules, which cannot combine resource cost and service quality indicators for resource scheduling, cannot balance resource utilization and service quality, and cannot dynamically adapt to complex business scenarios. That is, they are not suitable for high-concurrency scenarios such as e-commerce promotions and live streaming flash sales, resulting in low resource utilization and reduced service quality. Summary of the Invention
[0003] To overcome the shortcomings of the prior art, the present invention aims to provide a container orchestration resource utilization optimization method, apparatus, device, and storage medium that combines resource cost and service quality indicators, dynamically balances resource utilization and service quality, can adjust scheduling strategies in real time according to business changes, is applicable to various high-concurrency scenarios, improves applicability, and significantly improves resource utilization.
[0004] The first aspect of this invention provides a method for optimizing container orchestration resource utilization, comprising: collecting CPU utilization, memory utilization, and network bandwidth utilization of each node as resource usage data; collecting order processing response time, logistics trajectory update reporting time interval, and sorting system task queue length as service quality indicator data; designing a state space and action space using the resource cost of the resource usage data as a reward function in combination with the service quality indicator data; generating a resource scheduling strategy based on the state space and the action space through a preset reinforcement learning model; dynamically adjusting the number of Pod replicas, node allocation, and resource quota according to the resource scheduling strategy, and monitoring the scheduling effect in real time; generating an early warning message and sending the early warning message to a management terminal when the scheduling effect does not meet the business indicators; collecting business result feedback data, and associating the business result feedback data with the scheduling log to obtain association information.
[0005] Optionally, in a first implementation of the first aspect of the present invention, the step of collecting the CPU utilization, memory utilization, and network bandwidth utilization of each node as resource usage data, and collecting the order processing response time, logistics trajectory update reporting interval, and sorting system task queue length as service quality indicator data, includes: continuously collecting the CPU utilization, memory utilization, and network bandwidth utilization of each node through a Metrics-Server and a custom Exporter deployed in a Kubernetes cluster; merging the CPU utilization, memory utilization, and network bandwidth utilization into resource usage data; collecting the order processing response time of the order processing API through an application performance monitoring tool, collecting the logistics trajectory update reporting interval through database logs or IoT platform interfaces, and collecting the sorting system task queue length through a message queue monitoring component; merging the order processing response time, the logistics trajectory update reporting interval, and the sorting system task queue length into service quality indicator data; and uniformly storing the resource usage data and the service quality indicator data in a time-series database.
[0006] Optionally, in a second implementation of the first aspect of the present invention, the step of designing a state space and an action space using the resource cost of the resource usage data as a reward function and the service quality index data, and generating a resource scheduling strategy based on the state space and the action space through a preset reinforcement learning model, includes: designing a state space and an action space using the resource cost of the resource usage data as a reward function and the service quality index data; the state space including the current number of online nodes, the real-time load of each Pod type, and the predicted value of regional express delivery orders; the action space including the Pod migration direction and resource allocation weight; constructing the reinforcement learning model using a near-end policy optimization algorithm; using the reinforcement learning model with the state space as input, outputting the probability distribution of each action in the action space; selecting the action with the highest probability as the current strategy, and predicting the new state after the current strategy is executed; updating the current strategy according to the new state and the calculated reward value to obtain the final resource scheduling strategy.
[0007] Optionally, in a third implementation of the first aspect of the present invention, the step of dynamically adjusting the number of Pod replicas, node allocation, and resource quota according to the resource scheduling strategy, and monitoring the scheduling effect in real time, includes: dynamically adjusting the number of Pod replicas, node allocation, and resource quota according to the resource scheduling strategy; monitoring the overall resource utilization of the cluster, the Pod startup success rate, scheduling latency, and service quality changes after adjustment in real time; and combining the overall resource utilization, the Pod startup success rate, the scheduling latency, and the service quality changes into the scheduling effect.
[0008] Optionally, in the fourth implementation of the first aspect of the present invention, the step of generating an early warning message and sending the early warning message to the management terminal when the scheduling effect does not meet the business indicators includes: defining a business indicator threshold, continuously comparing the scheduling effect with the business indicator threshold to obtain a comparison result; when the comparison result determines that the scheduling effect does not meet the business indicators, generating an early warning message, the early warning message including the abnormal indicator name, the current indicator value, the indicator threshold, the occurrence time, and the specific Pod affected; and sending the early warning message to the management terminal.
[0009] Optionally, in the fifth implementation of the first aspect of the present invention, the step of collecting business result feedback data and associating the business result feedback data with scheduling logs to obtain association information includes: collecting business result feedback data from a business database or data warehouse, the business result feedback data including daily order processing volume, order processing failure rate, average parcel sorting time, and average transit time for inter-provincial parcels; collecting scheduling logs from a cluster monitoring system and scheduler logs, the scheduling logs including resource adjustment operation records and adjusted resource indicator sequences; associating the business result feedback data and scheduling logs within the same time period using an association key to obtain association information; analyzing the impact of resource adjustment operations on business indicators based on the association information, evaluating the effectiveness of the resource scheduling strategy based on the impact level to obtain evaluation information; and using the evaluation information to iteratively optimize the reinforcement learning model.
[0010] Optionally, in the sixth implementation of the first aspect of the present invention, after collecting business result feedback data and associating the business result feedback data with scheduling logs to obtain association information, the method further includes: sending the association information to a management terminal so that the management terminal generates and displays a visualization interface based on the association information, consisting of a historical curve of resource utilization, a trend of service quality indicators, and a cost saving report; periodically generating a resource optimization effect report based on the association information, the resource optimization effect report including the number of nodes saved within the period, the estimated cost saving amount, and a comparison of SLO compliance rate; and uploading the resource optimization effect report to the blockchain.
[0011] A second aspect of the present invention provides a container orchestration resource utilization optimization device, comprising: a data acquisition module, used to collect CPU utilization, memory utilization, and network bandwidth utilization of each node as resource usage data, and to collect order processing response time, logistics trajectory update reporting time interval, and sorting system task queue length as service quality indicator data; a design generation module, used to design a state space and action space using the resource cost of the resource usage data as a reward function combined with the service quality indicator data, and to generate a resource scheduling strategy based on the state space and the action space through a preset reinforcement learning model; an adjustment and monitoring module, used to dynamically adjust the number of Pod replicas, node allocation, and resource quota according to the resource scheduling strategy, and to monitor the scheduling effect in real time; a generation and sending module, used to generate early warning information and send the early warning information to a management terminal when the scheduling effect does not meet the business indicators; and a collection and association module, used to collect business result feedback data, and associate the business result feedback data with the scheduling log to obtain association information.
[0012] Optionally, in the first implementation of the second aspect of the present invention, the acquisition module includes: a first acquisition unit, used to continuously acquire the CPU utilization, memory utilization, and network bandwidth utilization of each node through a Metrics-Server and a custom Exporter deployed in a Kubernetes cluster; a first merging unit, used to merge the CPU utilization, memory utilization, and network bandwidth utilization into resource usage data; a second acquisition unit, used to acquire the order processing response time of the order processing API through an application performance monitoring tool, the logistics trajectory update reporting time interval through database logs or IoT platform interfaces, and the sorting system task queue length through a message queue monitoring component; a second merging unit, used to merge the order processing response time, the logistics trajectory update reporting time interval, and the sorting system task queue length into service quality indicator data; and a storage unit, used to uniformly store the resource usage data and the service quality indicator data in a time-series database.
[0013] Optionally, in a second implementation of the second aspect of the present invention, the design generation module includes: a design unit, configured to design a state space and an action space using the resource cost of the resource usage data as a reward function and the service quality index data, wherein the state space includes the current number of online nodes, the real-time load of each Pod type, and the predicted value of regional express delivery orders, and the action space includes the Pod migration direction and resource allocation weight; a construction unit, configured to construct the reinforcement learning model using a near-end policy optimization algorithm; an output unit, configured to use the reinforcement learning model with the state space as input to output the probability distribution of each action in the action space; a selection and prediction unit, configured to select the action with the highest probability as the current policy and predict the new state after the current policy is executed; and an update unit, configured to update the current policy according to the new state and the calculated reward value to obtain the final resource scheduling policy.
[0014] Optionally, in a third implementation of the second aspect of the present invention, the adjustment monitoring module includes: an adjustment unit, used to dynamically adjust the number of Pod replicas, node allocation, and resource quota according to the resource scheduling strategy; a monitoring unit, used to monitor in real time the overall resource utilization of the cluster, the Pod startup success rate, scheduling latency, and service quality changes after the adjustment; and a third merging unit, used to merge the overall resource utilization, the Pod startup success rate, the scheduling latency, and the service quality changes into a scheduling effect.
[0015] Optionally, in a fourth implementation of the second aspect of the present invention, the generation and sending module includes: a comparison definition unit, used to define a business indicator threshold and continuously compare the scheduling effect with the business indicator threshold to obtain a comparison result; a generation unit, used to generate warning information when the comparison result determines that the business indicator does not meet the requirements, the warning information including the abnormal indicator name, the current indicator value, the indicator threshold, the occurrence time, and the specific Pod affected; and a sending unit, used to send the warning information to a management terminal.
[0016] Optionally, in a fifth implementation of the second aspect of the present invention, the collection and association module includes: a first collection unit, used to collect business result feedback data from a business database or data warehouse, the business result feedback data including daily order processing volume, order processing failure rate, average parcel sorting time, and average transit time for inter-provincial parcels; a second collection unit, used to collect scheduling logs from a cluster monitoring system and scheduler logs, the scheduling logs including resource adjustment operation records and adjusted resource indicator sequences; an association unit, used to associate the business result feedback data and the scheduling logs within the same time period using an association key to obtain association information; an analysis and evaluation unit, used to analyze the impact of resource adjustment operations on business indicators based on the association information, evaluate the effectiveness of the resource scheduling strategy based on the impact level, and obtain evaluation information; and an optimization unit, used to iteratively optimize the reinforcement learning model using the evaluation information.
[0017] Optionally, in the sixth implementation of the second aspect of the present invention, it further includes: a sending module, used to send the associated information to a management terminal, so that the management terminal generates and displays a visual interface composed of a historical curve of resource utilization, a trend of service quality indicators, and a cost saving report based on the associated information; a generation module, used to periodically generate a resource optimization effect report based on the associated information, the resource optimization effect report including the number of nodes saved within the period, the estimated cost saving amount, and a comparison of SLO compliance rate; and an uploading module, used to upload the resource optimization effect report to the blockchain.
[0018] A third aspect of the present invention provides a container orchestration resource utilization optimization device, the container orchestration resource utilization optimization device comprising: a memory and at least one processor, the memory storing instructions; the at least one processor calling the instructions in the memory to cause the container orchestration resource utilization optimization device to perform the various steps of the container orchestration resource utilization optimization method described in any of the preceding claims.
[0019] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed by a processor, implement the steps of the container orchestration resource utilization optimization method described in any of the preceding claims.
[0020] In the technical solution of this invention, a state space and action space are designed by combining resource cost data based on resource usage data with service quality index data. Based on the state space and action space, a resource scheduling strategy is generated through a preset reinforcement learning model. The number of Pod replicas, node allocation, and resource quotas are dynamically adjusted according to the resource scheduling strategy, and the scheduling effect is monitored in real time. When the scheduling effect does not meet the business indicators, an early warning message is generated and sent to the management terminal. Business result feedback data is collected and correlated with scheduling logs to obtain correlation information. By combining resource cost with service quality indicators, resource utilization and service quality are dynamically balanced. The scheduling strategy can be adjusted in real time according to business changes, which is applicable to various high-concurrency scenarios, improves applicability, and significantly improves resource utilization. Attached Figure Description
[0021] Figure 1 This is a first flowchart of a container orchestration resource utilization optimization method provided in an embodiment of the present invention;
[0022] Figure 2 This is a second flowchart of the container orchestration resource utilization optimization method provided in an embodiment of the present invention;
[0023] Figure 3 This is a third flowchart of the container orchestration resource utilization optimization method provided in the embodiments of the present invention;
[0024] Figure 4 This is a fourth flowchart of the container orchestration resource utilization optimization method provided in the embodiments of the present invention;
[0025] Figure 5 A schematic diagram of a container orchestration resource utilization optimization device provided in an embodiment of the present invention;
[0026] Figure 6 This is another structural schematic diagram of the container orchestration resource utilization optimization device provided in an embodiment of the present invention;
[0027] Figure 7 This is a schematic diagram of the structure of a container orchestration resource utilization optimization device provided in an embodiment of the present invention. Detailed Implementation
[0028] This invention provides a method, apparatus, device, and storage medium for optimizing container orchestration resource utilization. It combines resource cost with service quality indicators, dynamically balances resource utilization and service quality, and can adjust scheduling strategies in real time according to business changes. It is applicable to a variety of high-concurrency scenarios, improves applicability, and significantly enhances resource utilization.
[0029] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0030] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 One embodiment of the container orchestration resource utilization optimization method in this invention includes:
[0031] 101. Collect CPU utilization, memory utilization, and network bandwidth utilization of each node as resource usage data; collect order processing response time, logistics trajectory update and reporting interval, and sorting system task queue length as service quality indicator data.
[0032] In this embodiment, the Metrics-Server component deployed in the Kubernetes cluster periodically collects basic resource metrics such as CPU utilization, memory usage, and network I / O rate of each worker node. Simultaneously, a custom Exporter is used to supplement the collection of detailed network bandwidth usage. Regarding service quality metrics, APM tools (such as SkyWalking or Pinpoint) are integrated to capture the response time of the order processing API. The logistics trajectory reporting interval is extracted by subscribing to the Binlog database or the MQTT message stream of the IoT platform. The length of the sorting system's task queue is obtained by monitoring the consumer backlog of message middleware (such as Kafka or RocketMQ). All collected data, after being formatted and labeled, is pushed to a time-series database (such as Prometheus or InfluxDB) for persistent storage.
[0033] 102. Using resource cost from resource usage data as the reward function and combining it with service quality index data, design a state space and action space. Based on the state space and action space, generate a resource scheduling strategy through a pre-set reinforcement learning model.
[0034] In this embodiment, the resource cost reward function comprehensively considers the unit time cost of CPU, memory, and network bandwidth (e.g., according to cloud service provider pricing models) and their actual utilization rate. The service quality index is normalized to a satisfaction score (e.g., the shorter the response time, the higher the score). The state space is designed as a multi-dimensional vector, including: the number of active nodes in the cluster, the real-time load of each type of Pod (e.g., request QPS, CPU utilization), and the regional order volume predicted based on historical data (using time series models such as Prophet or LSTM for prediction). The action space includes the migration direction of Pods between nodes (e.g., from node A to node B) and the adjustment of the allocation weight of various resources (e.g., the increase or decrease ratio of CPU quota). A reinforcement learning model is constructed using the Proximity Policy Optimization (PPO) algorithm. This model takes the current state as input, outputs the probability distribution of each action, selects the action with the highest probability as the scheduling policy, and predicts the new state and reward value after execution through an environment simulator to iteratively optimize the policy.
[0035] 103. Dynamically adjust the number of Pod replicas, node allocation, and resource quotas according to the resource scheduling strategy, and monitor the scheduling effect in real time;
[0036] In this embodiment, the scheduling strategy dynamically adjusts the number of Deployment replicas, modifies the nodeSelector or affinity rules of Pods to achieve node reallocation, and updates the resourcerequests / limits of Pods to adjust resource quotas through the Kubernetes API. At the same time, the cluster monitoring system collects data in real time, such as the overall cluster resource utilization, Pod startup success rate, scheduler decision latency, and service quality indicators (such as whether the order response time meets the standard), to comprehensively evaluate the immediate effect of this scheduling.
[0037] 104. When the scheduling effect does not meet the business indicators, an early warning message is generated and sent to the management terminal;
[0038] In this embodiment, the system predefines a series of business indicator thresholds (such as order response time not exceeding 200ms, resource utilization not less than 70%), and continuously compares the real-time monitored scheduling effect with the thresholds. Once an abnormal indicator is detected (such as response time exceeding the limit or resource utilization being too low), a structured early warning message is automatically generated. The early warning message includes: the name of the abnormal indicator, the current value, the threshold, the timestamp of occurrence, the list of affected Pods and their nodes. This early warning message is sent to the operation and maintenance management terminal in real time through integrated message push services (such as email, Slack, DingTalk Webhook) so that manual intervention can be carried out in a timely manner.
[0039] 105. Collect business result feedback data, and correlate the business result feedback data with the scheduling log to obtain correlation information;
[0040] In this embodiment, daily business result data is extracted from business databases (such as MySQL, TiDB) or data warehouses (such as Hive, BigQuery), including total order processing volume, number of failed orders, average sorting time, and cross-province parcel transit time. At the same time, scheduling operation records and subsequent resource indicator sequences are extracted from Kubernetes Event logs, scheduler audit logs, and resource monitoring logs. The business data is associated with the scheduling logs through time window association (such as alignment by hourly or minute granularity) to form a complete link data of "scheduling operation - resource change - business impact", which is used for subsequent strategy effect analysis and model iteration.
[0041] In this embodiment of the invention, by collecting multi-dimensional resource usage data and key business service quality index data, a reward function centered on resource cost and service quality is constructed, and a dynamic resource scheduling strategy is generated based on a reinforcement learning model. This achieves refined and intelligent management of Kubernetes cluster resources. The method can automatically adjust the number of Pod replicas, node allocation, and resource quotas according to real-time business load, and provide timely warnings when the scheduling effect deviates from business indicators. At the same time, by continuously optimizing the strategy by associating business feedback data and scheduling logs, it effectively solves the pain point that traditional scheduling methods cannot take into account both resource utilization and service quality, and significantly improves resource utilization efficiency and system stability in high-concurrency scenarios.
[0042] Please see Figure 2 The second embodiment of the container orchestration resource utilization optimization method in this invention includes:
[0043] 201. Continuously collect CPU utilization, memory utilization, and network bandwidth utilization of each node by deploying Metrics-Server and a custom Exporter in the Kubernetes cluster;
[0044] In this embodiment, Metrics-Server is responsible for collecting CPU and memory usage at the node and Pod levels, while the custom Exporter collects detailed network bandwidth usage data by reading nodes, calling CNI plugin interfaces, or listening to iptables rules. All data is exposed in Metrics format and captured by Prometheus.
[0045] 202. Combine CPU utilization, memory utilization, and network bandwidth utilization into a single resource usage data set;
[0046] In this embodiment, the collected multi-dimensional resource metrics are aligned by timestamp and merged into a single structured record, which includes fields such as node ID, timestamp, CPU utilization, memory usage, and network inflow / outflow bandwidth, facilitating subsequent unified processing.
[0047] 203. Collect the order processing response time of the order processing API through application performance monitoring tools, collect the logistics trajectory update reporting time interval through database logs or IoT platform interfaces, and collect the task queue length of the sorting system through message queue monitoring components.
[0048] In this embodiment, the APM tool collects the P99 response time of the order processing interface without loss through Java Agent or Sidecar injection, obtains the logistics trajectory reporting time difference by parsing the database Binlog or subscribing to IoT platform Topic messages, and obtains the number of sorting tasks piling up by monitoring the Consumer Lag of the message queue.
[0049] 204. Merge order processing response time, logistics trajectory update reporting interval, and sorting system task queue length into service quality indicator data;
[0050] In this embodiment, the three types of service quality indicators are aggregated by time window (e.g., 1-minute granularity) to form timestamped service quality records, which are used for correlation analysis with resource data.
[0051] 205. Store resource usage data and service quality indicator data in a unified time-series database;
[0052] In this embodiment, all indicator data are written into the same time-series database and are associated and managed through a unified tag system.
[0053] 206. Using the resource cost of resource usage data as the reward function and combining it with service quality index data, design the state space and action space. The state space includes the number of currently online nodes, the real-time load of each Pod type, and the predicted value of regional express delivery volume. The action space includes the Pod migration direction and resource allocation weight.
[0054] In this embodiment, the reward function is designed as Reward = α * (resource cost saving rate) + β * (service quality satisfaction), where α and β are adjustable hyperparameters, the state space vector includes the number of nodes, the CPU / memory utilization of each Pod, the regional order prediction value (predicted in real time through the ARIMA model), and the action space is a discrete action set.
[0055] 207. Construct reinforcement learning models using the proximal policy optimization algorithm;
[0056] In this embodiment, the PPO algorithm is used to construct an Actor-Critic architecture reinforcement learning model. The Actor network outputs action probabilities, the Critic network evaluates state values, and the training process is stabilized through the Clip mechanism.
[0057] 208. Using a reinforcement learning model, take the state space as input and output the probability distribution of each action in the action space;
[0058] In this embodiment, the current state vector is input into the neural network of the reinforcement learning model. After being processed by a multi-layer fully connected network, the probability distribution of each action is output through the Softmax layer.
[0059] 209. Select the action with the highest probability as the current strategy, and predict the new state after the current strategy is executed;
[0060] In this embodiment, the action with the highest probability is selected as the scheduling instruction for this time, and the changes in resource status and service indicators after the execution of the action are predicted through a cluster simulation environment (such as a Kubernetes cluster replica).
[0061] 210. Update the current strategy based on the new state and the calculated reward value to obtain the final resource scheduling strategy;
[0062] In this embodiment, the advantage function is calculated based on the predicted new state and reward value, the network parameters are updated through gradient descent, the strategy is iteratively optimized, and finally the current optimal resource scheduling strategy is output.
[0063] In this embodiment of the invention, comprehensive collection of basic cluster resource metrics is achieved through Metrics-Server and a custom Exporter. Service quality metrics reflecting business health are accurately obtained with the help of APM tools, database logs, and message queue monitoring. By designing an objective function that integrates resource cost and service quality, and using the Proximal Policy Optimization (PPO) algorithm to build a reinforcement learning model, a resource scheduling strategy that can dynamically adapt to business changes is generated. This process realizes an automated pipeline from data collection, preprocessing, model training to strategy generation, providing a solid data foundation and algorithm core for building an efficient and adaptive container orchestration resource scheduling system.
[0064] Please see Figure 3 The third embodiment of the container orchestration resource utilization optimization method in this invention includes:
[0065] 301. Dynamically adjust the number of Pod replicas, node allocation, and resource quotas according to the resource scheduling strategy;
[0066] In this embodiment, horizontal scaling of Pods, node rescheduling, and resource limit adjustment are implemented through Kubernetes API calls, responding to policy changes in real time.
[0067] 302. Monitor the overall resource utilization of the cluster, the success rate of Pod startup, scheduling latency, and changes in service quality in real time after the adjustment;
[0068] In this embodiment, Prometheus is used to pull cluster monitoring metrics in real time to calculate the overall resource utilization, Pod lifecycle events are monitored to calculate the startup success rate, scheduling latency is obtained through scheduler metrics, and service quality metrics changes are obtained through APM tools.
[0069] 303. Combine overall resource utilization, Pod startup success rate, scheduling latency, and service quality changes into a single scheduling effect;
[0070] In this embodiment, the four types of indicators are aggregated into a single scheduling effect record according to a time window, which is used for correlation analysis with business indicators.
[0071] 304. Define business indicator thresholds and continuously compare the scheduling effect with the business indicator thresholds to obtain the comparison results;
[0072] In this embodiment, thresholds for each business indicator are set according to SLA requirements, and the scheduling effect is continuously compared with the business indicator thresholds to generate a Boolean comparison result, thereby monitoring whether the scheduling effect meets the standards.
[0073] 305. When the comparison result determines that the business indicator does not meet the requirements, an early warning message is generated. The early warning message includes the name of the abnormal indicator, the current indicator value, the indicator threshold, the time of occurrence, and the specific Pod affected.
[0074] In this embodiment, when the comparison result determines that the business indicator does not meet the requirement, a structured warning message is immediately generated. The warning message includes the indicator name, current value, threshold, timestamp, and a list of associated Pods.
[0075] 306. Send the warning information to the management terminal;
[0076] In this embodiment, alert information is pushed to the management terminal by integrating Alertmanager or a custom Webhook.
[0077] In this embodiment of the invention, the automatic execution of resource scheduling policies is achieved through the Kubernetes API. This enables dynamic and lossless scaling, migration, and resource quota adjustment of Pods. By establishing a comprehensive monitoring system, the status and service indicators of the cluster after scheduling are tracked in real time. Based on predefined business indicator thresholds, automatic comparison and judgment are performed. Once an anomaly is detected, accurate early warning information is generated and notified to the management terminal. This process realizes closed-loop management of scheduling, monitoring, and early warning, ensuring the real-time performance, effectiveness, and reliability of cluster resource scheduling, and greatly reducing the burden of manual intervention for operation and maintenance personnel.
[0078] Please see Figure 4 The fourth embodiment of the container orchestration resource utilization optimization method in this invention includes:
[0079] 401. Collect business result feedback data from business databases or data warehouses. Business result feedback data includes daily order processing volume, order processing failure rate, average parcel sorting time, and average transit time for inter-provincial parcels.
[0080] In this embodiment, by using ETL tools or directly querying the business database, indicators such as total daily order volume, number of failed orders, average sorting time, and cross-province transit time are aggregated.
[0081] 402. Collect scheduling logs from the cluster monitoring system and scheduler logs. The scheduling logs include resource adjustment operation records and adjusted resource indicator sequences.
[0082] In this embodiment, the scheduling logs are from Kubernetes Audit Logs, Scheduler Logs, and operation records of the custom Operator, and the resource metric sequence is from Prometheus query results.
[0083] 403. Use association keys to associate business result feedback data and scheduling logs within the same time period to obtain association information;
[0084] In this embodiment, the business data and scheduling logs are aligned at the hourly or minute level using the timestamp as the association key to form an associated dataset.
[0085] 404. Analyze the impact of resource adjustment operations on business indicators based on the relevant information, evaluate the effectiveness of resource scheduling strategies based on the degree of impact, and obtain evaluation information;
[0086] In this embodiment, statistical analysis (such as correlation analysis and regression analysis) is used to calculate the correlation strength between resource adjustments and changes in business indicators, assess whether the strategy brings positive benefits, generate a strategy effectiveness score, and quantify the effectiveness of the strategy.
[0087] 405. Use evaluation information to iteratively optimize the reinforcement learning model;
[0088] In this embodiment, the evaluation information is used as part of the reward signal to retrain the reinforcement learning model, optimize its policy network and value network, and improve the quality of subsequent scheduling decisions.
[0089] 406. Send the associated information to the management terminal so that the management terminal can generate and display a visual interface consisting of historical resource utilization curves, service quality indicator compliance trends, and cost saving reports based on the associated information;
[0090] In this embodiment, the associated information is sent to the management terminal so that the management terminal can display resource utilization curves, SLO achievement trend charts, cost savings statistics tables, etc. through Grafana or a custom dashboard, supporting multi-dimensional drill-down analysis.
[0091] 407. Regularly generate resource optimization effect reports based on related information. The resource optimization effect reports include the number of nodes saved within the period, the estimated cost savings, and a comparison of SLO achievement rates.
[0092] In this embodiment, a resource optimization effect report is generated weekly / monthly. The resource optimization effect report includes the number of nodes saved, the amount of cost savings (calculated based on the cloud vendor's unit price), and the month-on-month change in SLO compliance rate.
[0093] 408. Upload the resource optimization effect report to the blockchain;
[0094] In this embodiment, the IPFS storage resource optimization effect report is used, and its hash value is written to the blockchain (such as Ethereum private chain or Hyperledger Fabric) to ensure that the report is tamper-proof and auditable.
[0095] In this embodiment of the invention, by collecting business result data and scheduling logs and performing spatiotemporal correlation analysis, the actual impact of each resource adjustment on business indicators can be clearly quantified, thereby scientifically evaluating the effectiveness of the scheduling strategy. The evaluation results are used to iteratively optimize the reinforcement learning model, making it continuously approach the optimal scheduling strategy. At the same time, the analysis results are presented in the form of visual reports and blockchain evidence, which not only provides managers with intuitive decision support, but also ensures the transparency and auditability of the optimization process. Ultimately, a complete intelligent operation and maintenance closed loop is formed from execution, monitoring, analysis to feedback optimization, driving the continuous improvement of the resource utilization and service quality of the container cluster.
[0096] The container orchestration resource utilization optimization method in the embodiments of the present invention has been described above. The container orchestration resource utilization optimization device in the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 5 One embodiment of the container orchestration resource utilization optimization device in this invention includes:
[0097] The data acquisition module 501 is used to collect CPU utilization, memory utilization, and network bandwidth utilization of each node as resource usage data, and to collect order processing response time, logistics trajectory update and reporting interval, and sorting system task queue length as service quality indicator data.
[0098] The design generation module 502 is used to design the state space and action space by combining the resource cost of resource usage data as the reward function with service quality index data, and to generate resource scheduling strategies based on the state space and action space through a preset reinforcement learning model.
[0099] Adjust monitoring module 503 to dynamically adjust the number of Pod replicas, node allocation, and resource quotas according to resource scheduling policies, and monitor the scheduling effect in real time;
[0100] The generation and sending module 504 is used to generate early warning information and send it to the management terminal when the scheduling effect does not meet the business indicators.
[0101] The collection and association module 505 is used to collect business result feedback data, associate the business result feedback data with the scheduling log, and obtain the association information.
[0102] In this embodiment, a state space and action space are designed by combining resource cost data based on resource usage data with service quality index data. Based on the state space and action space, a resource scheduling strategy is generated through a preset reinforcement learning model. The number of Pod replicas, node allocation, and resource quotas are dynamically adjusted according to the resource scheduling strategy, and the scheduling effect is monitored in real time. When the scheduling effect does not meet the business indicators, an early warning message is generated and sent to the management terminal. Business result feedback data is collected and correlated with scheduling logs to obtain correlation information. By combining resource cost with service quality indicators, resource utilization and service quality are dynamically balanced. The scheduling strategy can be adjusted in real time according to business changes, which is applicable to a variety of high-concurrency scenarios, improves applicability, and significantly improves resource utilization.
[0103] Please see Figure 6 Another embodiment of the container orchestration resource utilization optimization device in this invention includes:
[0104] The data acquisition module 501 is used to collect CPU utilization, memory utilization, and network bandwidth utilization of each node as resource usage data, and to collect order processing response time, logistics trajectory update and reporting interval, and sorting system task queue length as service quality indicator data.
[0105] The design generation module 502 is used to design the state space and action space by combining the resource cost of resource usage data as the reward function with service quality index data, and to generate resource scheduling strategies based on the state space and action space through a preset reinforcement learning model.
[0106] Adjust monitoring module 503 to dynamically adjust the number of Pod replicas, node allocation, and resource quotas according to resource scheduling policies, and monitor the scheduling effect in real time;
[0107] The generation and sending module 504 is used to generate early warning information and send it to the management terminal when the scheduling effect does not meet the business indicators.
[0108] The association module 505 is used to collect business result feedback data and associate the business result feedback data with the scheduling log to obtain association information;
[0109] In this embodiment, the acquisition module 501 includes: a first acquisition unit 5011, used to continuously acquire the CPU utilization, memory utilization, and network bandwidth utilization of each node through Metrics-Server and a custom Exporter deployed in the Kubernetes cluster; a first merging unit 5012, used to merge the CPU utilization, memory utilization, and network bandwidth utilization into resource usage data; a second acquisition unit 5013, used to acquire the order processing response time of the order processing API through application performance monitoring tools, the logistics trajectory update reporting interval through database logs or IoT platform interfaces, and the sorting system task queue length through message queue monitoring components; a second merging unit 5014, used to merge the order processing response time, the logistics trajectory update reporting interval, and the sorting system task queue length into service quality indicator data; and a storage unit 5015, used to uniformly store the resource usage data and service quality indicator data in a time-series database.
[0110] In this embodiment, the design generation module 502 includes: a design unit 5021, used to design a state space and an action space by combining the resource cost of resource usage data as the reward function with service quality index data. The state space includes the current number of online nodes, the real-time load of each Pod type, and the predicted value of regional express delivery orders. The action space includes the Pod migration direction and resource allocation weight. A construction unit 5022 is used to construct a reinforcement learning model using a near-end policy optimization algorithm. An output unit 5023 is used to use the reinforcement learning model with the state space as input to output the probability distribution of each action in the action space. A selection and prediction unit 5024 is used to select the action with the highest probability as the current policy and predict the new state after the current policy is executed. An update unit 5025 is used to update the current policy according to the new state and the calculated reward value to obtain the final resource scheduling policy.
[0111] In this embodiment, the adjustment monitoring module 503 includes: an adjustment unit 5031, used to dynamically adjust the number of Pod replicas, node allocation, and resource quotas according to the resource scheduling strategy; a monitoring unit 5032, used to monitor the overall resource utilization of the cluster, the Pod startup success rate, scheduling latency, and service quality changes in real time after the adjustment; and a third merging unit 5033, used to merge the overall resource utilization, Pod startup success rate, scheduling latency, and service quality changes into a scheduling effect.
[0112] In this embodiment, the generation and sending module 504 includes: a definition comparison unit 5041, used to define a business indicator threshold and continuously compare the scheduling effect with the business indicator threshold to obtain a comparison result; a generation unit 5042, used to generate warning information when the comparison result determines that the business indicator does not meet the requirements, the warning information including the abnormal indicator name, the current indicator value, the indicator threshold, the occurrence time, and the specific Pod affected; and a sending unit 5043, used to send the warning information to the management terminal.
[0113] In this embodiment, the collection and association module 505 includes: a first collection unit 5051, used to collect business result feedback data from a business database or data warehouse, including daily order processing volume, order processing failure rate, average parcel sorting time, and average transit time for inter-provincial parcels; a second collection unit 5052, used to collect scheduling logs from a cluster monitoring system and scheduler logs, including resource adjustment operation records and adjusted resource indicator sequences; an association unit 5053, used to associate business result feedback data and scheduling logs within the same time period using an association key to obtain association information; an analysis and evaluation unit 5054, used to analyze the impact of resource adjustment operations on business indicators based on the association information, evaluate the effectiveness of resource scheduling strategies based on the impact level, and obtain evaluation information; and an optimization unit 5055, used to iteratively optimize the reinforcement learning model using the evaluation information.
[0114] In this embodiment, it further includes: a sending module 506, used to send the associated information to the management terminal, so that the management terminal can generate and display a visual interface consisting of historical resource utilization curves, service quality indicator compliance trends, and cost saving reports based on the associated information; a generation module 507, used to periodically generate resource optimization effect reports based on the associated information, the resource optimization effect reports including the number of nodes saved within the period, the estimated cost savings amount, and the comparison of SLO compliance rate; and an uploading module 508, used to upload the resource optimization effect reports to the blockchain.
[0115] above Figure 5 and Figure 6 The container orchestration resource utilization optimization device in this embodiment of the invention is described in detail from the perspective of modular functional entities. The container orchestration resource utilization optimization device in this embodiment of the invention is described in detail from the perspective of hardware processing.
[0116] Figure 7This is a schematic diagram of a container orchestration resource utilization optimization device 600 provided in an embodiment of the present invention. The container orchestration resource utilization optimization device 600 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 610 (e.g., one or more processors) and a memory 620, and one or more storage media 630 (e.g., one or more mass storage devices) for storing application programs 633 or data 632. The memory 620 and storage media 630 can be temporary or persistent storage. The program stored in the storage media 630 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the container orchestration resource utilization optimization device 600. Furthermore, the processor 610 may be configured to communicate with the storage media 630 and execute a series of instruction operations on the storage media 630 on the container orchestration resource utilization optimization device 600 to implement the steps of the container orchestration resource utilization optimization method provided in the above-described method embodiments.
[0117] The container orchestration resource utilization optimization device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input / output interfaces 660, and / or one or more operating systems 631, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 7 The illustrated container orchestration resource utilization optimization device structure does not constitute a limitation on container orchestration resource utilization optimization devices, which may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0118] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of a container orchestration resource utilization optimization method.
[0119] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0120] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0121] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for optimizing container orchestration resource utilization, characterized in that, include: Collect CPU utilization, memory utilization, and network bandwidth utilization of each node as resource usage data, and collect order processing response time, logistics trajectory update and reporting interval, and sorting system task queue length as service quality indicator data. Using the resource cost of the resource usage data as the reward function and combining it with the service quality index data, a state space and an action space are designed. Based on the state space and the action space, a resource scheduling strategy is generated through a preset reinforcement learning model. The number of Pod replicas, node allocation, and resource quotas are dynamically adjusted according to the resource scheduling strategy, and the scheduling effect is monitored in real time. When the scheduling effect does not meet the business indicators, an early warning message is generated and sent to the management terminal; Collect business result feedback data, and associate the business result feedback data with the scheduling log to obtain association information.
2. The container orchestration resource utilization optimization method according to claim 1, characterized in that, The system collects CPU utilization, memory utilization, and network bandwidth utilization of each node as resource usage data, and collects order processing response time, logistics trajectory update reporting interval, and sorting system task queue length as service quality indicator data, including: The CPU utilization, memory utilization, and network bandwidth utilization of each node are continuously collected by Metrics-Server and custom Exporter deployed in the Kubernetes cluster. The CPU utilization rate, the memory utilization rate, and the network bandwidth utilization rate are combined into resource usage data; The order processing response time of the order processing API is collected by application performance monitoring tools, the logistics trajectory update reporting interval is collected by database logs or IoT platform interfaces, and the task queue length of the sorting system is collected by message queue monitoring components. The order processing response time, the logistics trajectory update reporting time interval, and the sorting system task queue length are combined into service quality indicator data. The resource usage data and the service quality index data are stored together in a time-series database.
3. The container orchestration resource utilization optimization method according to claim 1, characterized in that, The step of designing a state space and action space using the resource cost of the resource usage data as a reward function and combining it with the service quality index data, and generating a resource scheduling strategy based on the state space and the action space through a preset reinforcement learning model, includes: Using the resource cost of the resource usage data as the reward function and combining it with the service quality index data, a state space and an action space are designed. The state space includes the number of currently online nodes, the real-time load of each Pod type, and the predicted value of regional express delivery orders. The action space includes the Pod migration direction and resource allocation weight. The reinforcement learning model is constructed using a proximal policy optimization algorithm. Using the state space as input, the reinforcement learning model outputs the probability distribution of each action in the action space; Select the action with the highest probability as the current strategy, and predict the new state after the current strategy is executed; The current strategy is updated based on the new state and the calculated reward value to obtain the final resource scheduling strategy.
4. The container orchestration resource utilization optimization method according to claim 1, characterized in that, The process of dynamically adjusting the number of Pod replicas, node allocation, and resource quotas according to the resource scheduling strategy, and monitoring the scheduling effect in real time, includes: The number of Pod replicas, node allocation, and resource quotas are dynamically adjusted according to the resource scheduling strategy. Real-time monitoring of the overall resource utilization of the cluster, Pod startup success rate, scheduling latency, and changes in service quality after adjustments; The overall resource utilization, the Pod startup success rate, the scheduling latency, and the service quality changes are combined into a scheduling effect.
5. The container orchestration resource utilization optimization method according to claim 1, characterized in that, When the scheduling effect does not meet the business indicators, an early warning message is generated and sent to the management terminal, including: Define business indicator thresholds, continuously compare the scheduling effect with the business indicator thresholds, and obtain the comparison results; When the comparison result determines that the business indicator does not meet the requirements, an early warning message is generated. The early warning message includes the name of the abnormal indicator, the current indicator value, the indicator threshold, the time of occurrence, and the specific Pod affected. The warning information is sent to the management terminal.
6. The container orchestration resource utilization optimization method according to claim 1, characterized in that, The process of collecting business result feedback data and associating it with scheduling logs to obtain association information includes: Collect business result feedback data from business databases or data warehouses. The business result feedback data includes the daily total number of orders processed, the order processing failure rate, the average parcel sorting time, and the average transit time for inter-provincial parcels. The scheduling logs are collected from the cluster monitoring system and scheduler logs. The scheduling logs include resource adjustment operation records and adjusted resource indicator sequences. By using a correlation key, the business result feedback data and the scheduling log within the same time period are correlated to obtain correlation information; The impact of resource adjustment operations on business indicators is analyzed based on the associated information, and the effectiveness of the resource scheduling strategy is evaluated based on the impact, thus obtaining evaluation information. The reinforcement learning model is iteratively optimized using the evaluation information.
7. The container orchestration resource utilization optimization method according to claim 1, characterized in that, After collecting business result feedback data and associating it with scheduling logs to obtain the association information, the process further includes: The associated information is sent to the management terminal, so that the management terminal can generate and display a visual interface consisting of historical resource utilization curves, service quality indicator compliance trends, and cost saving reports based on the associated information. Periodically generate resource optimization effect reports based on the associated information. The resource optimization effect reports include the number of nodes saved within the period, the estimated cost savings, and a comparison of SLO achievement rates. The resource optimization effect report will be uploaded to the blockchain.
8. A container orchestration resource utilization optimization device, characterized in that, include: The data acquisition module is used to collect CPU utilization, memory utilization, and network bandwidth utilization of each node as resource usage data, and to collect order processing response time, logistics trajectory update and reporting interval, and sorting system task queue length as service quality indicator data. The design generation module is used to design a state space and an action space by combining the resource cost of the resource usage data as a reward function with the service quality index data, and to generate a resource scheduling strategy based on the state space and the action space through a preset reinforcement learning model. The monitoring module is used to dynamically adjust the number of Pod replicas, node allocation, and resource quotas according to the resource scheduling strategy, and to monitor the scheduling effect in real time. The generation and sending module is used to generate early warning information and send the early warning information to the management terminal when the scheduling effect does not meet the business indicators. The association module is used to collect business result feedback data and associate the business result feedback data with the scheduling log to obtain association information.
9. A container orchestration resource utilization optimization device, characterized in that, The container orchestration resource utilization optimization device includes: a memory and at least one processor, wherein the memory stores instructions; At least one of the processors invokes the instructions in the memory to cause the container orchestration resource utilization optimization device to perform the steps of the container orchestration resource utilization optimization method as claimed in any one of claims 1-7.
10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the steps of the container orchestration resource utilization optimization method as described in any one of claims 1-7.