Dynamic resource scheduling system and method based on CPU and memory decoupling
By adopting a dynamic resource scheduling system based on CPU and memory decoupling in the cloud computing environment, the problems of low resource utilization and insufficient flexibility are solved, and more efficient and flexible resource management is achieved, which improves overall performance and economic benefits.
Patent Information
- Application Number
- CN202411995724.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The problem of low resource utilization and insufficient flexibility caused by fixed binding of CPU and memory resources in existing cloud computing resource management.
A dynamic resource scheduling system based on CPU decoupling and memory is adopted, including resource monitoring module, resource decoupling manager, dynamic scheduling engine and resource equalizer, to realize independent management and dynamic adjustment of CPU and memory resources.
Significantly improve resource utilization, CPU resource utilization can be increased by 20-30%, improve application performance, reduce performance degradation caused by insufficient resources, shorten the response time by 15% on average, reduce operational costs, and enhance system flexibility.
Smart Images

Figure BDA0005224490150000061 
Figure BDA0005224490150000121 
Figure BDA0005224490150000122
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud computing resource management, and in particular to a dynamic scheduling system and method based on decoupling of CPU and memory resources. Background Art
[0002] Cloud computing resource management technology has important applications in today's information technology field. With the popularity of cloud computing, how to efficiently manage and allocate computing resources, especially CPU and memory resources, has become a key factor in improving system performance and reducing operating costs. In large-scale data centers and cloud platforms, resource management technology directly affects service quality, user experience and economic benefits, and therefore occupies a core position in cloud computing, virtualization and container technology.
[0003] Currently, fixed-binding resource allocation solutions are mainly used to manage CPU and memory resources. This solution usually matches the number of CPU cores with a specific amount of memory to form a predefined resource package or virtual machine specification. For example, a common configuration may be 2 CPU cores bound to 8GB of memory. Another common solution is container-based resource limitation technology, which allows users to set CPU and memory usage limits for each container, but these limits are usually static and difficult to dynamically adjust according to real-time needs.
[0004] However, these solutions have problems such as low resource utilization and insufficient flexibility. Fixed binding resource allocation cannot meet the dynamic requirements of different applications for CPU and memory resources, resulting in wasted CPU resources in some cases and insufficient memory in other cases. This imbalance not only reduces overall resource utilization, but also may cause application performance fluctuations and affect user experience. At the same time, static resource restrictions are difficult to cope with sudden load changes, which can easily lead to unreasonable resource allocation and performance bottlenecks.
[0005] To solve the above problems, some studies have proposed dynamic resource scheduling algorithms and adaptive resource allocation mechanisms. These methods dynamically adjust resource allocation by monitoring application load and resource usage in real time. Although these methods have improved resource utilization to a certain extent, they still have problems such as slow response speed and insufficient scheduling accuracy. In addition, most existing dynamic scheduling schemes are still based on a fixed ratio between CPU and memory, which makes it difficult to meet application scenarios where the ratio of CPU and memory requirements varies greatly.
[0006] Therefore, there is an urgent need for a resource management system that can decouple CPU and memory resources and support refined dynamic scheduling. Such a system should be able to quickly respond to load changes, independently adjust CPU and memory quotas, and achieve global optimization of resources among multiple applications. Developing such an efficient and flexible resource scheduling system has become a research hotspot in the field of cloud computing resource management, and is of great significance to improving the resource utilization, performance, and cost-effectiveness of cloud platforms. Summary of the invention
[0007] The main purpose of the present invention is to solve the problem of low resource utilization and insufficient flexibility caused by the fixed binding of CPU and memory resources in existing cloud computing resource management. In addition, the present invention also aims to improve the accuracy and response speed of resource scheduling, achieve global optimization of resources among multiple applications, and reduce operating costs.
[0008] To achieve the above object, the present invention provides a dynamic resource scheduling system and method based on CPU and memory decoupling, characterized in that it includes a resource monitoring module, a resource decoupling manager, a dynamic scheduling engine and a resource balancer to achieve independent management and dynamic adjustment of CPU and memory resources. In some embodiments, the system also includes a resource billing module for achieving accurate billing based on actual usage.
[0009] Specifically, the resource monitoring module is used to monitor CPU usage and memory usage in real time, and collect application performance indicators such as response time and throughput.
[0010] Furthermore, the resource decoupling manager manages CPU and memory resources in a pooled manner, realizes independent allocation and adjustment of CPU quotas and memory quotas, and supports allocation of CPU resources at a granularity smaller than one core.
[0011] Preferably, the dynamic scheduling engine dynamically adjusts CPU quotas based on monitoring data and performance indicators, and uses machine learning algorithms (such as regression analysis, time series prediction, or neural network models) to predict resource requirements.
[0012] Optionally, the resource balancer balances resource allocation among multiple applications to achieve global optimization of resources, and can adjust the resource allocation ratio among multiple applications in real time to maximize the overall system performance.
[0013] In one embodiment, the present invention further provides a resource scheduling method based on the above system, including steps such as resource monitoring, independent resource management, dynamic scheduling and resource balancing.
[0014] In some embodiments, the minimum allocation granularity of CPU resources can reach 0.1 core, achieving more refined resource control.
[0015] In addition, the present invention can also perform accurate billing according to the actually used CPU quota through a resource billing module, thereby optimizing cost management.
[0016] In other embodiments, the system may be applied to a containerized environment to dynamically allocate and adjust resources for different containers.
[0017] In a preferred embodiment, the system analyzes application load characteristics in real time, predicts short-term resource requirements, and adjusts CPU quotas in advance while keeping memory allocation unchanged, thereby optimizing resource utilization.
[0018] In another preferred embodiment, the system can be applied in a multi-tenant cloud environment and dynamically adjust resource allocation strategies according to the service level agreements (SLAs) of different tenants.
[0019] By adopting the above scheme, the present invention has the following beneficial effects: 1. Significantly improve resource utilization, CPU resource utilization can be increased by 20-30 2. Improve application performance, reduce performance degradation caused by insufficient resources, and shorten response time by an average of 15 3. Reduce operating costs. Through more accurate resource allocation and billing models, user costs can be reduced by 10-20% 4. Enhance system flexibility, quickly respond to load changes, and adapt to the needs of different types of applications; 5. Realize refined resource management, support CPU allocation granularity less than one core, and meet diverse application needs.
[0020] In summary, the present invention provides a more efficient and flexible solution for resource management in a cloud computing environment by realizing the decoupling and dynamic scheduling of CPU and memory resources, effectively solving the problems of low resource utilization and large performance fluctuations in the prior art, and is of great significance to improving the overall performance and economic benefits of the cloud computing platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 It is a basic system architecture flow chart. It shows the interaction between the resource monitoring module, resource decoupling manager, dynamic scheduling engine and resource balancer.
[0023] Figure 2It is a component diagram of the resource monitoring module. It describes the structure of the data acquisition unit, data processing unit, and data storage unit, as well as the adaptive sampling mechanism.
[0024] Figure 3 It is a flowchart of the resource decoupling manager. It shows the relationship between the resource pool management unit, quota adjustment unit, and resource mapping unit, as well as the application of CPU micro-core and resource credit mechanism.
[0025] Figure 4 It is a timing diagram of the dynamic scheduling engine components. It describes the structure of the data analysis unit, prediction model unit, and decision generation unit, and highlights innovations such as resource pressure index, integrated learning prediction, and reinforcement learning.
[0026] Figure 5 It is a flow chart of the resource balancer. It shows the relationship between the global resource view generation unit, the priority management unit, and the balancing strategy execution unit, as well as the application of the resource affinity matrix and progressive resource adjustment.
[0027] Figure 6 It is a diagram of the resource billing module. It describes the structure of the resource usage statistics unit, dynamic pricing unit, and bill generation unit, and highlights the features of granular metering and elastic pricing.
[0028] Figure 7 It is a flow chart of the dynamic resource scheduling method. It shows the cyclic process of resource monitoring, demand forecasting, allocation decision and adjustment execution, as well as the core technology in each step.
[0029] Figure 8 It is a multi-tenant cloud environment application architecture diagram. It describes the relationship between the resource pool, tenant isolation layer, dynamic resource scheduling system and multiple tenant applications, and highlights innovations such as heterogeneous resources, dynamic isolation boundaries and tenant-aware scheduling. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] In the description of the present invention, it should be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention.
[0032] Example 1, basic system architecture example.
[0033] Figure 1 The basic architecture of the dynamic resource scheduling system based on CPU and memory decoupling of the present invention is shown. Figure 1 As shown, the system mainly includes a resource monitoring module 101, a resource decoupling manager 102, a dynamic scheduling engine 103 and a resource balancer 104. These modules work together to achieve independent management and dynamic adjustment of CPU and memory resources, thereby improving resource utilization and system performance.
[0034] The resource monitoring module 101 is responsible for real-time monitoring of the CPU usage, memory usage, and application performance indicators in the system. Specifically, the module regularly collects CPU and memory usage data through the system-level API (such as the procfs interface of Linux), and collects performance indicators such as application response time and throughput through the application program interface (API) or log analysis. These data are stored in a time series database in real time to provide a basis for subsequent resource scheduling decisions.
[0035] The resource decoupling manager 102 is one of the core innovations of this system. It breaks the limitation of fixed binding of CPU and memory resources in traditional cloud computing environment and realizes independent management of the two resources. The specific implementation method is to modify the underlying virtualization technology (such as KVM or Xen) to allow dynamic adjustment of the CPU quota of virtual machines or containers without affecting their memory allocation. This decoupling mechanism enables the system to respond to changes in resource requirements of different applications with extremely high flexibility.
[0036] For example, for a CPU-intensive application, the resource decoupling manager can dynamically increase its CPU quota while keeping the memory allocation unchanged. This kind of refined resource adjustment is not possible in a traditional fixed configuration environment. The minimum CPU allocation granularity supported by this system can reach 0.1 core, which makes it possible to manage resources in a refined manner.
[0037] The dynamic scheduling engine 103 is the decision-making center of the system. It uses machine learning algorithms to predict resource demand and dynamically schedule based on the data collected by the resource monitoring module. Specifically, the engine can use a time series prediction model, such as a long short-term memory network (LSTM) or other suitable algorithms. The prediction results are combined with the current resource usage to form a resource scheduling decision.
[0038] For example, when it is predicted that the CPU usage of an application will increase in the future, the dynamic scheduling engine will increase the CPU quota of the application in advance to prevent performance degradation. This forward-looking scheduling strategy helps improve the system's response speed to load changes.
[0039] The resource balancer 104 is responsible for achieving global optimization of resources among multiple applications. It dynamically adjusts the resource allocation ratio among applications based on the application priority, service level agreement (SLA) and current performance indicators. The resource balancer can adopt an improved fair sharing scheduling algorithm that not only considers resource usage but also the performance goals of the application.
[0040] For example, when it detects that the response time of a high-priority application exceeds the SLA, the resource balancer will reclaim some resources from other non-critical applications and allocate them to the high-priority application. This mechanism helps ensure the performance of key businesses while optimizing the resource utilization of the overall system.
[0041] The system works as follows: The resource monitoring module continuously collects system and application level performance data. The dynamic scheduling engine predicts resource demand based on this data. The resource decoupling manager independently adjusts CPU and memory quotas based on the prediction results and current resource status. The resource balancer optimizes resource allocation globally to ensure optimal overall system performance.
[0042] This dynamic, decoupled resource management approach has the potential to improve performance. Compared to traditional fixed configurations, this system may achieve improved CPU resource utilization, reduced application response time, and improved overall system throughput. The specific degree of improvement will depend on the actual application scenario and system configuration.
[0043] It should be noted that the above specific implementation is only a preferred embodiment of the present invention, and those skilled in the art may make various modifications to it under the guidance of the present invention. For example, the frequency of resource monitoring can be adjusted according to actual needs, and the prediction model can adopt other machine learning algorithms such as random forest or gradient boosting tree. These changes will not deviate from the protection scope of the present invention.
[0044] The dynamic resource scheduling system of the present invention is applicable to various cloud computing environments, including but not limited to public cloud, private cloud and hybrid cloud. It can effectively solve the fixed configuration problem in traditional resource management, and bring performance improvement and potential cost savings to cloud service providers and users.
[0045] Embodiment 2, resource monitoring module embodiment.
[0046] In this embodiment, the specific implementation of the resource monitoring module will be described in detail. Figure 2 As shown, the resource monitoring module 201 includes a data collection unit 202, a data processing unit 203 and a data storage unit 204. These units work together to achieve comprehensive monitoring of system resource usage and application performance.
[0047] The data collection unit 202 is responsible for collecting various performance indicators from the system and application levels. At the system level, it reads files such as / proc / stat and / proc / meminfo through the Linux procfs interface to obtain system-level indicators such as CPU usage and memory usage. Specifically, the calculation formula for CPU usage is as follows: CPU usage = (1-idle time / total CPU time)*100 The idle time and total CPU time can be obtained from the / proc / stat file. The data acquisition unit reads these files at a certain time interval (configurable, 1 second by default) to calculate the CPU usage.
[0048] For memory usage, the data collection unit reads the MemTotal, MemFree, Buffers, Cached and other fields from the / proc / meminfo file and calculates the actual memory usage:
[0049] Actual memory usage = MemTotal-MemFree-Buffers-Cached
[0050] At the application level, the data collection unit collects application performance indicators in a variety of ways. For Java applications that support JMX (Java Management Extensions), you can directly obtain application response time, throughput and other indicators through the JMX interface. For applications that do not support JMX, you can obtain these indicators by parsing application logs or using APM (Application Performance Monitoring) tools.
[0051] The data processing unit 203 is responsible for preprocessing and preliminary analysis of the collected raw data. It first cleans the raw data to remove outliers and noise. Then, the data is standardized so that different types of indicators can be compared and analyzed. The data processing unit also calculates some derived indicators, such as CPU load trends, memory usage growth rates, etc. These processed data provide more valuable information for subsequent resource scheduling decisions.
[0052] The data storage unit 204 is responsible for storing the processed data in a time series database. This embodiment uses InfluxDB as a time series database because it has high write performance and efficient time range query capabilities. Data is aggregated and stored at fixed time intervals (such as 1 minute) to reduce storage space and improve query efficiency. The stored data structure is designed as follows: -mem_usage: memory usage -response_time: application response time -throughput: application throughput timestamp: data collection time
[0053] This data structure design allows for quick querying of resource usage and performance metrics for a specific host or application within a certain time range.
[0054] The innovation of the resource monitoring module lies in its high scalability and accuracy. Through the pluggable data collection plug-in architecture, new data sources or monitoring indicators can be easily added without modifying the core code. At the same time, through intelligent sampling technology, while ensuring data accuracy, the cost of data collection and storage is significantly reduced.
[0055] For example, for CPU usage, an adaptive sampling frequency method is used. When the CPU usage changes dramatically, the system will automatically increase the sampling frequency (such as once every 0.1 seconds); when the CPU usage is relatively stable, the sampling frequency will be reduced (such as once every 5 seconds). This method not only ensures data accuracy at critical moments, but also reduces system overhead during stable periods.
[0056] The resource monitoring module interacts with other modules as follows: It provides real-time resource usage data to the resource decoupling manager, enabling it to adjust resource allocation in a timely manner. It provides historical performance data to the dynamic scheduling engine to support resource demand prediction. It also provides a global resource usage view to the resource balancer to assist in making resource balancing decisions.
[0057] It should be noted that the specific implementation of the resource monitoring module may vary depending on the actual deployment environment. For example, in a containerized environment, it may be necessary to use a cgroup file system to obtain resource usage at the container level. In a virtualized environment, it may be necessary to obtain resource usage data of a virtual machine through the API of the virtualization platform. These changes will not affect the core idea and protection scope of the present invention.
[0058] In short, the resource monitoring module, as the foundation of the entire dynamic resource scheduling system, provides accurate and timely resource usage and performance data, providing decision-making basis for other parts of the system. It is a key component for achieving precise resource management and optimization.
[0059] Embodiment 3, resource decoupling manager embodiment.
[0060] This embodiment describes in detail the specific implementation of the resource decoupling manager. Figure 3 As shown, the resource decoupling manager 301 includes a resource pool management unit 302, a quota adjustment unit 303 and a resource mapping unit 304. These units work together to achieve independent management and dynamic adjustment of CPU and memory resources, which is one of the core innovations of the present invention.
[0061] The resource pool management unit 302 is responsible for managing the CPU and memory resource pools in the system. In a traditional virtualization environment, CPU and memory resources are usually fixedly bound. For example, a virtual machine may be allocated 2 CPU cores and 4GB of memory. In this system, the resource pool management unit manages the CPU and memory resources separately to form independent resource pools. This design allows the system to independently adjust the allocation of CPU and memory according to actual needs, greatly improving the flexibility of resource utilization.
[0062] Specifically, the CPU resource pool is managed in units of cores, but supports finer-grained allocation. This system innovatively introduces the concept of "micro-cores", dividing a physical CPU core into multiple micro-cores. For example, a physical core can be divided into 10 micro-cores, each of which represents the computing power of 0.1 cores. This design enables the system to allocate CPU resources in units of 0.1 cores, greatly improving the accuracy of resource allocation.
[0063] The memory resource pool is managed in bytes, supporting dynamic memory allocation and recycling. The system uses an improved buddy allocation algorithm to manage memory, which can effectively reduce memory fragmentation and improve memory utilization.
[0064] The quota adjustment unit 303 is responsible for adjusting the CPU and memory quotas of each application in real time according to the decision of the dynamic scheduling engine. For the adjustment of CPU quota, the system implements it by modifying the cpu.shares or cpu.cfs_quota_us parameters of the cgroup. For example, to increase the CPU quota of an application from 1 core to 1.5 cores, you can do the following: echo 150000> / sys / fs / cgroup / cpu / app_group / cpu.cfs_quota_us
[0065] The 150,000 microseconds here means that the application can use 1.5 cores of CPU time in every 100 millisecond scheduling cycle.
[0066] The system adjusts the memory quota by modifying the memory.limit_in_bytes parameter of the cgroup. For example, to increase the memory limit of an application from 4GB to 6GB, you can execute: echo 6442450944> / sys / fs / cgroup / memory / app_group / memory.limit_in_bytes
[0067] The resource mapping unit 304 is responsible for mapping the logical resource quota to the physical resources. The innovation of this unit is that it implements "elastic resource mapping". Traditional resource mapping is usually static, while the elastic resource mapping of this system allows the dynamic migration of computing loads between different physical cores to balance the loads of each core and improve the overall performance.
[0068] The core algorithm of elastic resource mapping is as follows: function elasticMapping(vmCPU,physicalCPUs): loadBalanceFactor=calculateLoadBalance(physicalCPUs) for each pCPU in physicalCPUs: mappedLoad=vmCPU*(1+loadBalanceFactor*(avgLoad-pCPU.load)) pCPU.allocate(mappedLoad)
[0069] This algorithm takes into account the current load of the physical CPU and dynamically adjusts the mapping ratio of virtual CPU to physical CPU, thereby achieving a more balanced load distribution.
[0070] Another innovation of the resource decoupling manager is the introduction of a "resource credit" mechanism. When an application does not need to use all of its allocated resources temporarily, the excess resources will be converted into "resource credits". These credits can be used later when the application needs burst performance, allowing the application to use resources exceeding its normal quota for a short period of time. This mechanism ensures fairness in resource allocation and provides flexibility in dealing with load peaks.
[0071] The resource decoupling manager interacts with other modules as follows: it receives real-time resource usage data from the resource monitoring module and adjusts resource quotas based on this data and the decisions of the dynamic scheduling engine. It provides the current resource allocation status to the resource balancer to assist in global resource optimization decisions.
[0072] It should be noted that the specific implementation of the resource decoupling manager may vary slightly depending on the underlying virtualization or container technology. For example, in an environment using Kubernetes, it may be necessary to implement fine-grained resource management through custom resource definitions (CRDs) and controllers. In a bare metal environment, it may be necessary to directly manipulate CPU affinity and NUMA policies to achieve fine control of resources. These changes will not affect the core idea and scope of protection of the present invention.
[0073] In short, the resource decoupling manager provides a more sophisticated and flexible resource management capability for the cloud computing environment by decoupling CPU and memory resources, introducing innovative mechanisms such as micro-cores and elastic resource mapping. This not only improves resource utilization, but also provides applications with more stable and predictable performance, and is a key component for achieving efficient dynamic resource scheduling.
[0074] Embodiment 4, dynamic scheduling engine embodiment.
[0075] This embodiment describes in detail the specific implementation of the dynamic scheduling engine. Figure 4 As shown, the dynamic scheduling engine 401 includes a data analysis unit 402, a prediction model unit 403 and a decision generation unit 404. These units work together to achieve resource demand prediction and dynamic scheduling decisions based on historical data and real-time monitoring information, which is another core innovation of the present invention.
[0076] The data analysis unit 402 is responsible for processing and analyzing the historical data and real-time data received from the resource monitoring module. This unit first preprocesses the raw data, including data cleaning, outlier detection and feature extraction. During the data cleaning process, obvious outliers and noise data are removed. Outlier detection uses an improved Z-score method that takes into account the characteristics of time series data. During the feature extraction process, in addition to directly using the original features such as CPU usage and memory usage, some derived features are also calculated, such as the rate of change of resource usage, periodic patterns, etc.
[0077] A key innovation of feature extraction is the introduction of the concept of "Resource Pressure Index" (RPI). RPI takes into account multiple factors such as CPU usage, memory usage, I / O waiting time, etc., and obtains a comprehensive index through weighted summation: RPI = w1*CPU usage +w2*Mem usage +w3*IO wait +w4*Network usage (1) Among them, w1, w2, w3, and w4 are weight coefficients that can be dynamically adjusted according to specific application scenarios. This indicator can more comprehensively reflect the resource pressure status of the system and provide more valuable information for subsequent predictions and decisions.
[0078] The prediction model unit 403 is the core of the dynamic scheduling engine and is responsible for predicting future resource requirements based on historical data. This system innovatively uses an ensemble learning approach, combining multiple machine learning models to improve the accuracy and robustness of predictions. Specifically, the system uses the following models: 1. ARIMA (AutoRegressive Integrated Moving Average) model: suitable for capturing linear trends and seasonal patterns in time series data. 2. LSTM (Long Short-Term Memory) neural network: can effectively handle long-term dependencies and is suitable for capturing complex nonlinear patterns. 3. Prophet model: A time series forecasting model developed by Facebook that is particularly suitable for processing data with multiple seasonality. 4.XGBoost model: An efficient gradient boosting tree model that can handle complex relationships between multiple features.
[0079] These models run in parallel, each predicting future resource needs. The system then combines the predictions of each model using a weighted average method, with the weights dynamically adjusted based on the performance of each model on recent data. This ensemble learning method greatly improves the accuracy and stability of the predictions.
[0080] Another innovation of the forecasting model is the introduction of the "adaptive forecast window" mechanism. Traditional fixed forecast windows may not perform well in a rapidly changing environment. The adaptive forecast window dynamically adjusts the forecast time range according to the change in the forecast error. When the forecast error is small, the system increases the forecast window to provide longer-term resource planning; when the forecast error increases, the system reduces the forecast window to improve the accuracy of short-term forecasts.
[0081] The decision generation unit 404 is responsible for generating specific resource scheduling decisions based on the prediction results. This unit uses the reinforcement learning method to model the resource scheduling problem as a Markov decision process (MDP). The state space includes the current resource usage, predicted resource demand, etc.; the action space includes increasing or decreasing the number of CPU cores, adjusting memory quotas, etc.; the reward function comprehensively considers resource utilization, application performance, and scheduling overhead.
[0082] Specifically, the system uses the policy gradient-based REINFORCE algorithm, whose core idea is to optimize resource scheduling strategies through trial and error learning. The main steps of the algorithm are as follows: function REINFORCE(): Initialize the policy network parameters theta For each training cycle: Collect a batch of resource usage trajectories {state t, action t, reward t} Calculate the return t at each time step Update strategy parameters: Parameters = parameters + learning rate * gradient * log probability * reward t
[0083] This reinforcement learning-based approach enables the system to continuously learn and adapt to different workload patterns, gradually optimizing resource scheduling strategies over time.
[0084] The dynamic scheduling engine interacts with other modules as follows: It receives historical and real-time resource usage data from the resource monitoring module and makes predictions and decisions based on this data. It sends resource adjustment instructions to the resource decoupling manager to achieve dynamic resource allocation. It also works with the resource balancer to ensure that local resource adjustment decisions do not affect the global resource balance.
[0085] It should be noted that the specific implementation of the dynamic scheduling engine may be adjusted according to the application scenario. For example, in a highly dynamic microservice environment, a shorter prediction window and a faster decision cycle may be required. In a large-scale data center environment, more constraints may need to be considered, such as energy consumption and hardware heterogeneity. These changes will not affect the core idea and protection scope of the present invention.
[0086] In short, the dynamic scheduling engine achieves high-precision and highly adaptable resource demand prediction and scheduling decisions by innovatively combining multiple machine learning models, introducing resource pressure indexes and adaptive prediction windows, and using reinforcement learning methods for decision optimization. This not only improves resource utilization, but also provides applications with more stable and predictable performance, and is a key component for realizing intelligent dynamic resource management.
[0087] Embodiment 5, resource balancer embodiment.
[0088] This embodiment describes in detail the specific implementation of the resource balancer. Figure 5 As shown, the resource balancer 501 includes a global resource view generation unit 502, a priority management unit 503 and a balance strategy execution unit 504. These units work together to achieve global resource optimization among multiple applications, and are key components of the present invention for achieving efficient resource management.
[0089] The global resource view generation unit 502 is responsible for building and maintaining a panoramic view of resource usage for the entire system. It obtains resource usage data of each application from the resource monitoring module and integrates this data into a unified global view. This view not only contains current resource usage, but also historical trends and future forecasts. An innovative point of the global resource view is the introduction of the concept of "resource affinity matrix". This matrix describes the correlation and complementarity in resource usage between different applications. For example, if the CPU usage peak times of two applications are complementary, they have a higher resource affinity and can be arranged to share the same set of CPU resources. The calculation formula of the resource affinity matrix is as follows: Among them, A ij is the resource affinity between applications i and j, CPU i (t) and CPU j (t) are the CPU usage of the two applications at time t, and T is the length of the time window under investigation. This matrix provides an important decision-making basis for subsequent resource balancing.
[0090] The priority management unit 503 is responsible for managing the priority and quality of service (QoS) requirements of each application. This system innovatively adopts the "dynamic priority adjustment" mechanism. The traditional fixed priority method often cannot adapt to the dynamic changes in application load and importance. The dynamic priority adjustment mechanism adjusts the priority of the application in real time according to the current status, historical performance and predetermined service level agreement (SLA) of the application. The priority calculation formula is as follows: Among them, P i is the current priority of application i, SLA i is the scheduled service level, Current_Performance i and Target_Performance i They are current performance and target performance, Historical_Importance i It reflects the historical importance of the application. w1, w2, and w3 are weight coefficients that can be adjusted according to specific scenarios. This dynamic priority mechanism ensures that critical applications can obtain sufficient resources when competing for resources, while also giving appropriate resource guarantees to non-critical applications.
[0091] The balancing strategy execution unit 504 is the core of the resource balancer and is responsible for formulating and executing specific resource balancing strategies. This unit adopts a resource balancing algorithm based on graph theory. The system constructs all applications and available resources into a bipartite graph, and then uses the improved Hungarian algorithm to find the optimal resource allocation solution. The innovation of this algorithm lies in the introduction of the concept of "elastic edge weight". The weight of the edge not only takes into account the application's demand for resources, but also takes into account resource affinity and application priority. The weight calculation formula is as follows: W ij =D ij *(1+A ij )*P i (4) Among them, W ij is the edge weight from application i to resource j, D ij is the demand, A ij is the resource affinity, P i is the application priority. This method not only ensures the global optimality of resource allocation, but also takes into account the mutual influence and individual needs of applications.
[0092] Another innovation in the execution of the balancing strategy is the introduction of a "progressive resource adjustment" mechanism. To avoid the impact of resource adjustments on applications, the system does not complete large-scale resource adjustments at once, but instead breaks down the adjustments into multiple small steps and completes them gradually. After each adjustment, the system observes the response of the application and can quickly roll back if an abnormality occurs. This mechanism greatly improves the security and stability of resource adjustments.
[0093] The resource balancer interacts with other modules as follows: it obtains global resource usage data from the resource monitoring module, obtains resource demand forecasts from the dynamic scheduling engine, and then formulates a global balancing strategy. It sends resource reallocation instructions to the resource decoupling manager to achieve global optimization of resources.
[0094] It should be noted that the specific implementation of the resource balancer may vary depending on the scale and complexity of the system. For example, in a large-scale distributed system, it may be necessary to adopt a hierarchical balancing strategy, first balancing resources locally and then coordinating globally. In a heterogeneous computing environment, it may be necessary to consider the characteristics of different types of resources (such as GPUs, FPGAs, etc.). These changes will not affect the core idea and scope of protection of the present invention.
[0095] In short, the resource balancer achieves efficient, flexible and stable global resource balancing by innovatively introducing resource affinity matrix, dynamic priority adjustment, graph-based balancing algorithm and progressive resource adjustment. This not only improves the resource utilization of the overall system, but also ensures the performance of key applications, and is an important part of realizing intelligent dynamic resource management.
[0096] Embodiment 6, resource billing module embodiment.
[0097] This embodiment describes in detail the specific implementation of the resource billing module. Figure 6 As shown, the resource billing module 601 includes a resource usage statistics unit 602, a dynamic pricing unit 603 and a bill generation unit 604. These units work together to achieve accurate billing based on actual usage, which is an important innovation of the present invention in terms of resource management economy.
[0098] The resource usage statistics unit 602 is responsible for accurately recording and counting the resource usage of each application. Different from the traditional fixed configuration billing method, this system innovatively introduces the "granular resource metering" mechanism. This mechanism can record the actual usage of resources such as CPU, memory, storage and network at very small time intervals (such as 1 second). For CPU resources, the system not only records the usage duration, but also takes into account the usage intensity. The calculation formula for CPU usage is as follows: Among them, Core_Countt is the number of CPU cores allocated at time t, Utilization t is the CPU utilization at time t, and Δt is the statistical interval. This approach ensures accurate measurement of resource usage even when the CPU quota changes dynamically.
[0099] For memory resources, the system uses the "peak average method", that is, in each billing cycle, the weighted sum of the peak and average memory usage of multiple sampling points is taken as the memory usage of the cycle. The calculation formula is as follows: Memory_Usage=w1*Max(Mem t )+w2*Avg(Mem t ) (6) Among them, w1 and w2 are weight coefficients, Mem t is the memory usage at time t. This method takes into account both the peak memory usage and the average usage, which is more fair and reasonable.
[0100] The dynamic pricing unit 603 is the core innovation of this module, which is responsible for dynamically adjusting resource prices according to real-time supply and demand relationships. The traditional fixed price model often fails to reflect the actual value and scarcity of resources. This system uses an "elastic pricing algorithm" to dynamically adjust prices as resource utilization changes. The price calculation formula is as follows: P=P b ase*(1+k*(UU t hreshold) n ) (7) Among them, P is the current price, P b ase is the base price, U is the current resource utilization, and U t hreshold is the threshold utilization (usually set to 70%-80%), and k and n are adjustable parameters used to control the sensitivity of price changes and the shape of the curve. This pricing mechanism encourages users to use more when resources are sufficient and to use less when resources are scarce, which helps balance the overall load.
[0101] The dynamic pricing unit also introduces a "differentiated pricing" strategy. Different types of resources (such as high-performance CPUs, GPUs, etc.) have different base prices. At the same time, the system will provide different price discounts based on the user's service level agreement (SLA). For example, long-term contract users or key businesses may enjoy more favorable prices.
[0102] The bill generation unit 604 is responsible for generating detailed bills based on resource usage statistics and dynamic prices. An innovation of this unit is the introduction of "multi-dimensional billing reports". In addition to the overall cost, the report also includes the usage details of various resources, price change trends, cost optimization suggestions, etc. This detailed report helps users better understand their resource usage patterns and make more informed resource planning decisions.
[0103] The bill generation unit also implements a "real-time cost warning" mechanism. The system will issue a warning when the cost is about to exceed expectations based on the budget threshold set by the user. The warning information can notify the user through multiple channels (such as email, SMS, API callback, etc.) or directly trigger an automated resource adjustment strategy.
[0104] The resource billing module interacts with other modules as follows: it obtains detailed resource usage data from the resource monitoring module, obtains resource configuration change information from the resource decoupling manager, and obtains load forecast information from the dynamic scheduling engine for price adjustment. It provides real-time cost information to users and also provides economic factors for the resource balancer to assist in making more economical resource allocation decisions.
[0105] It should be noted that the specific implementation of the resource billing module may vary depending on the business model of the cloud service provider. For example, in a hybrid cloud environment, different billing strategies for private cloud and public cloud resources may need to be considered. In edge computing scenarios, network latency and data transmission costs may need to be considered. These changes will not affect the core idea and scope of protection of the present invention.
[0106] In short, the resource billing module has achieved more accurate, flexible and transparent resource billing by innovatively introducing mechanisms such as granular resource measurement, flexible pricing algorithms, differentiated pricing strategies and multi-dimensional billing reports. This not only improves the economic benefits of resource use, but also provides users with better cost visualization and control capabilities, which is an important supplement to the realization of intelligent dynamic resource management.
[0107] Example 7, dynamic resource scheduling method example.
[0108] This embodiment describes in detail the specific implementation process of the dynamic resource scheduling method based on the above system. Figure 7 As shown, the method includes a resource monitoring step 701, a resource demand prediction step 702, a resource allocation decision step 703, and a resource adjustment execution step 704. These steps are closely connected to form a closed-loop resource management process, which is the core method of the present invention to achieve efficient dynamic resource scheduling.
[0109] The resource monitoring step 701 is the basis of the entire method and is responsible for continuously collecting resource usage data and application performance indicators in the system. The innovation of this step is the adoption of a "multi-level monitoring strategy". At the system level, the usage of resources such as CPU, memory, and I / O is collected in real time through the Linux cgroup interface. At the application level, application-specific performance indicators such as response time and throughput are collected through embedded agents. At the network level, network traffic and latency information are collected through the SDN (software defined network) controller. This multi-level monitoring ensures the comprehensiveness and accuracy of the data.
[0110] The frequency of monitoring data collection uses an "adaptive sampling" mechanism. The system dynamically adjusts the sampling frequency based on the degree of fluctuation in resource usage. For example, when a dramatic change in resource usage is detected, the sampling frequency will automatically increase to multiple times per second; during a stable period, the sampling frequency may be reduced to once per minute to reduce monitoring overhead. The adjustment formula for the sampling frequency is as follows: Where f is the current sampling frequency, f base is the base frequency, σ is the standard deviation of resource utilization, μ is the average value, and k is the adjustment coefficient. This mechanism not only ensures the data accuracy at critical moments, but also reduces the overall monitoring overhead.
[0111] The resource demand prediction step 702 is one of the core innovations of this method, which is responsible for predicting future resource demand based on historical data and current status. This step adopts a "hybrid prediction model" that combines time series analysis and machine learning techniques. Specifically, the system first uses fast Fourier transform (FFT) to analyze the periodic pattern of resource usage, and then selects different prediction models based on the strength of the periodicity:
[0112] For workloads with strong periodicity, the system uses the seasonal ARIMA (SARIMA) model: SARIMA(p,d,q)(P,D,Q)m(9) Among them, p, d, q represent the orders of autoregression, difference and moving average respectively, P, D, Q represent the corresponding parameters of the seasonal part, and m is the seasonal period.
[0113] For weakly periodic or non-periodic workloads, the system uses the Long Short-Term Memory (LSTM) model. A key innovation of LSTM is the introduction of the "attention mechanism" that automatically identifies and focuses on important patterns in historical data. The core structure of the LSTM model is as follows: Among them, f t 、i t , ot They are forget gate, input gate and output gate, C t is the cell state, h t is a hidden state.
[0114] The resource allocation decision step 703 is responsible for formulating a resource allocation strategy based on the prediction results and the current state of the system. The innovation of this step is the use of a "multi-objective optimization" method. The system not only considers the maximization of resource utilization, but also considers multiple objectives such as application performance, energy efficiency, and cost. The decision problem is modeled as a multi-objective optimization problem: Among them, x represents the resource allocation plan, g i and h j represent inequality and equality constraints respectively.
[0115] In order to solve this multi-objective optimization problem, the system uses the improved NSGA-II (Non-dominated Sorting Genetic Algorithm II) algorithm. This algorithm can find a set of Pareto optimal solutions in a reasonable time by simulating the biological evolution process. The key steps of the algorithm include: initializing the population, non-dominated sorting, crowding calculation, selection, crossover and mutation.
[0116] The resource adjustment execution step 704 is responsible for converting the decision result into an actual resource configuration change. The innovation of this step is the adoption of the "gradual adjustment" strategy. The system will not complete a large-scale resource adjustment at one time, but will break down the adjustment into multiple small steps and complete it gradually. After each small adjustment, the system will observe the response of the application and can quickly roll back if an abnormality occurs. This strategy greatly improves the security and stability of the adjustment.
[0117] The implementation of progressive adjustment uses the "elastic step size" algorithm. The adjustment step size is dynamically calculated based on the difference between the target value and the current value: step=min(max(α*|target-current|,step min ),step max ) (12) Among them, α is the adjustment coefficient, step min and step max are the minimum and maximum step sizes respectively.
[0118] The execution process of the entire dynamic resource scheduling method is as follows: the system first collects comprehensive monitoring data through the resource monitoring step. Then, the resource demand prediction step predicts future resource demand based on this data. The resource allocation decision step combines the prediction results and system goals to formulate the optimal resource allocation plan. Finally, the resource adjustment execution step implements resource adjustments in a safe and stable manner.
[0119] This dynamic and adaptive resource scheduling method has significant advantages over the traditional static configuration method. In practical applications, this method can effectively improve resource utilization, improve application performance, and reduce energy consumption and costs.
[0120] It should be noted that the specific implementation of this method may be adjusted according to the actual deployment environment. For example, in edge computing scenarios, it may be necessary to consider network latency and bandwidth limitations more. In a hybrid cloud environment, it may be necessary to coordinate resource management strategies of different cloud platforms. These changes will not affect the core idea and protection scope of the present invention.
[0121] In summary, this dynamic resource scheduling method achieves efficient, flexible and stable resource management by innovatively combining multi-level monitoring, hybrid prediction models, multi-objective optimization decisions and progressive adjustment execution. This not only improves the overall performance and resource utilization of the system, but also provides a smarter and more economical resource scheduling solution for cloud computing environments.
[0122] Example 8, multi-tenant cloud environment application example.
[0123] This embodiment describes in detail the specific application of the present invention in a multi-tenant cloud environment. Figure 8 As shown, the multi-tenant cloud environment includes a resource pool 801, a tenant isolation layer 802, a dynamic resource scheduling system 803 and multiple tenant applications 804. This embodiment shows how to apply the aforementioned dynamic resource scheduling system to a complex multi-tenant environment to achieve efficient utilization and fair allocation of resources.
[0124] Resource pool 801 is the foundation of the cloud environment, and includes various physical resources such as computing, storage, and network. In this embodiment, the resource pool adopts the "heterogeneous resource integration" technology, which not only includes traditional CPU and memory resources, but also integrates special computing resources such as GPU and FPGA. This heterogeneous resource pool provides more choices for different types of tenant applications and can better meet diverse computing needs.
[0125] The tenant isolation layer 802 is a key component to ensure multi-tenant security and performance. This system innovatively adopts the "dynamic isolation boundary" technology. Unlike the traditional static isolation method, the dynamic isolation boundary can adjust the isolation strength in real time according to the tenant's resource usage and security requirements. The specific implementation uses improved lightweight virtualization technology, such as secure containers (such as gVisor) and micro virtual machines (such as Firecracker). The calculation formula for isolation strength is as follows: I=w1*S+w2*P+w3*R (13) Among them, I is the isolation strength, S is the security level, P is the performance sensitivity, R is the resource utilization, and w1, w2, and w3 are weight coefficients. This dynamic isolation mechanism maximizes the efficiency of resource sharing while ensuring security.
[0126] The dynamic resource scheduling system 803 is the core of this embodiment, which implements the aforementioned resource monitoring, prediction, decision-making and execution functions in a multi-tenant environment. In a multi-tenant scenario, the system introduces a "tenant awareness" mechanism, which can perform differentiated resource scheduling based on the service level agreements (SLAs) and resource usage patterns of different tenants. Specifically, the system adopts a "multi-level resource allocation" strategy: 1. Global layer: Coarse-grained allocation of resources among all tenants. 2. Tenant layer: fine-grained resource adjustment between different applications of a single tenant. 3. Application layer: fine-grained resource optimization of the internal components of a single application.
[0127] This multi-level strategy ensures fairness in global resource allocation while meeting the special needs of individual tenants and applications.
[0128] In terms of resource monitoring, the system uses "tenant-level resource profiling" technology. Through long-term observation and machine learning analysis, the system establishes a unique resource usage profile for each tenant, including the periodic pattern of resource usage, sudden behavior characteristics, etc. This profile information is used for more accurate resource demand forecasting. The generation of resource profiles uses time series clustering and pattern recognition algorithms. The core steps are as follows: function generateTenantProfile(usageData): patterns=extractSeasonalPatterns(usageData) burstFeatures=detectBurstBehavior(usageData) clusteredPatterns=timeSeriesClustering(patterns) return TenantProfile(clusteredPatterns,burstFeatures)
[0129] In terms of resource allocation decisions, the system introduces the principle of "fair utility maximization". Different from simple resource equalization, this principle takes into account the differences in utility functions of different tenants for resources. The decision problem is modeled as: Among them, U i is the utility function of tenant i, x i is the amount of resources allocated to tenant i, and C is the total resource capacity. This problem is solved by an improved convex optimization algorithm, which can maximize the overall utility while ensuring fairness.
[0130] In terms of resource adjustment execution, the system adopts a "tenant coordination" mechanism. When resources need to be adjusted across tenants, the system will start a negotiation process. For example, if resources need to be recovered from tenant A and allocated to tenant B, the system will evaluate the impact of this adjustment on tenant A and may provide compensatory measures (such as temporary performance improvements or fee discounts). This mechanism ensures smooth resource adjustments and reduces the negative impact on tenants.
[0131] Multiple tenant applications 804 run in this environment, and each application can enjoy dynamic and accurate resource scheduling services. The system provides tenants with visualization and control capabilities of resource usage through APIs and control panels. Tenants can view resource usage in real time, set resource usage policies, and even participate in resource scheduling decisions.
[0132] A key innovation of this embodiment is the "resource credit transaction" mechanism. When a tenant does not need all of its allocated resources temporarily, it can deposit the excess resources into the system as "credits". Other tenants who need additional resources can use these credits and return them in the future. This mechanism increases the flexibility of the system and improves overall resource utilization. The core algorithm of credit trading is as follows: function resourceCreditTrading(lender,borrower,amount): if lender.availableCredit>=amount: lender.availableCredit-=amount borrower.borrowedCredit+=amount adjustResourceAllocation(lender,-amount) adjustResourceAllocation(borrower,+amount) scheduleRepayment(borrower,lender,amount,dueTime) else: notifyInsufficientCredit()
[0133] In practical applications, this multi-tenant dynamic resource scheduling system has shown significant advantages.
[0134] It should be noted that the specific implementation of this embodiment may be adjusted due to the characteristics of the cloud platform. For example, in a hybrid cloud or multi-cloud environment, it may be necessary to consider the coordination and optimization of cross-cloud resources. In edge computing scenarios, it may be necessary to pay more attention to the impact of network latency and bandwidth limitations on resource scheduling. These changes will not affect the core idea and scope of protection of the present invention.
[0135] In summary, this multi-tenant cloud environment application embodiment realizes efficient, fair and flexible multi-tenant resource management by innovatively introducing technologies such as dynamic isolation boundaries, tenant perception mechanism, multi-level resource allocation strategy and resource credit transaction. This not only improves the resource utilization and performance of the cloud platform, but also provides tenants with better service quality and greater resource control flexibility, representing the future development direction of cloud computing resource management.
Claims
1. A dynamic resource scheduling system based on CPU and memory decoupling, characterized in that: include: (a) Resource monitoring module, which is used to monitor CPU usage and memory usage in real time and collect application performance indicators; (b) Resource decoupling manager, used to manage CPU and memory resources in a pooled manner, and to achieve independent allocation and adjustment of CPU quotas and memory quotas; (c) Dynamic scheduling engine, which is used to dynamically adjust CPU quotas based on monitoring data and performance indicators, and use machine learning algorithms to predict resource requirements; (d) Resource balancer, used to balance resource allocation among multiple applications and achieve global optimization of resources.
2. The dynamic resource scheduling system according to claim 1, characterized in that: The resource monitoring module is also used to collect performance indicators such as application response time and throughput.
3. The dynamic resource scheduling system according to claim 1, characterized in that: The resource decoupling manager supports allocating CPU resources at a granularity smaller than one core.
4. The dynamic resource scheduling system according to claim 3, characterized in that: The minimum allocation granularity of the CPU resources is 0.1 core.
5. The dynamic resource scheduling system according to claim 1, characterized in that: The machine learning algorithms used by the dynamic scheduling engine include but are not limited to regression analysis, time series prediction or neural network models.
6. The dynamic resource scheduling system according to claim 1, characterized in that: It also includes a resource billing module for accurate billing based on the actual CPU quota used.
7. The dynamic resource scheduling system according to claim 1, characterized in that: The resource balancer is also used to adjust the resource allocation ratio among multiple applications in real time to maximize the overall system performance.
8. A resource scheduling method based on the dynamic resource scheduling system according to any one of claims 1 to 7, characterized in that: The following steps are involved: (a) Real-time collection of CPU usage, memory usage, and application performance indicators through the resource monitoring module; (b) Use resource decoupling managers to independently manage CPU and memory resource pools; (c) The dynamic scheduling engine dynamically adjusts CPU quotas based on the collected data and predicts future resource requirements; (d) Optimize resource allocation among multiple applications through resource balancer.
9. The resource scheduling method according to claim 8, characterized in that: It also includes steps for accurate billing based on actual CPU quota used.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the resource scheduling method according to claim 8 or 9 is implemented.
Citation Information
Cited By
Application process monitoring method and device, medium and computer program product
CN120123186A
Application process monitoring method, device, medium and computer program product
CN120123186B