Self-adaptive important application performance optimization method and system during operation of operating system
By acquiring the performance, interaction, and resource characteristics of the operating system, and utilizing deep neural networks and reinforcement learning algorithms to optimize resource allocation, this approach solves the problems of contradiction between static resource allocation and dynamic requirements in the operating system, lack of critical application identification capabilities, and insufficient cross-dimensional resource collaborative optimization, thereby achieving efficient performance optimization for critical applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-03-13
AI Technical Summary
Existing operating systems suffer from contradictions between static resource allocation and dynamic requirements, lack of critical application identification capabilities, and insufficient cross-dimensional resource collaborative optimization when handling various types of applications, resulting in the inability to guarantee the performance of critical applications.
By acquiring the performance, interaction, and resource characteristics of the operating system during runtime, a pre-trained deep neural network model is used to evaluate the category and importance of applications, construct a resource dependency graph and perform load prediction, and a reinforcement learning algorithm is used for resource allocation to optimize the performance of critical applications.
It significantly improves the performance of critical applications, reduces average response time by 30% to 50%, increases overall system resource utilization by 15% to 20%, reduces resource contention, and improves system smoothness.
Smart Images

Figure CN121658331A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of operating system performance optimization technology, specifically to an adaptive method and system for optimizing the performance of critical applications during operating system runtime. Background Technology
[0002] With the diversification of computer applications, operating systems need to handle various types of applications simultaneously, including applications with high real-time requirements, computationally intensive applications, and general applications. Traditional operating systems use static resource allocation strategies, which cannot dynamically adjust based on the actual importance of the application and the current system state, resulting in the inability to guarantee the performance of critical applications. In existing technologies, the Euler open-source community and some commercial companies have developed some automatic operating system performance optimization techniques, such as the A-Tune tool for resource scheduling algorithms and I / O throttling adaptive control. However, these technologies lack the ability to intelligently identify and differentiate application importance, making it difficult to provide stable performance guarantees for critical applications in complex and ever-changing operating environments. In summary, existing technologies have the following problems: 1) The contradiction between static resource allocation and dynamic requirements: Traditional operating systems use fixed resource allocation strategies (such as pre-allocation mode), which cannot dynamically adjust based on the real-time importance of applications and changes in system load. For example, when high-priority applications (such as real-time video processing) run concurrently with background tasks, static allocation can lead to critical resources (such as CPU cores and memory bandwidth) being occupied by low-priority processes, causing response delays. Rigid allocation modes may result in 15% to 30% resource waste. 2) Lack of critical application identification capability: Existing systems lack intelligent assessment mechanisms for application importance, failing to distinguish between critical business processes (such as financial trading systems) and ordinary applications. Traditional scheduling algorithms are based solely on simple priority queues, neglecting multi-dimensional characteristics such as user interaction frequency and service quality requirements, leading to high-value applications frequently competing for resources with ordinary tasks. For example, a securities trading system sharing an I / O channel with a backend log service causes transaction delays. 3) Insufficient cross-dimensional resource collaborative optimization: Local optimization of a single resource (such as CPU or memory) is unlikely to achieve optimal global performance. When CPU scheduling weight adjustments are not synchronized with memory prefetching strategies, cache thrashing issues may occur. Test data shows that memory optimization lacking I / O bandwidth control can reduce disk throughput by approximately 40%, and storage contention between virtual machines can reduce overall throughput by approximately 25%. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide an adaptive performance optimization method and system for critical applications during operating system runtime, which addresses the above-mentioned problems in the existing operating system, such as the contradiction between static resource allocation and dynamic requirements, the lack of critical application identification capabilities, and the insufficient cross-dimensional resource collaborative optimization.
[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: An adaptive performance optimization method for critical applications during operating system runtime includes the following steps: S101: Obtain the three types of features of each application during the operation of the operating system: performance, interaction, and resources, and construct a feature vector containing the three types of features. S102, the application's feature vector is used to obtain the application's category and importance score using a pre-trained deep neural network model. The deep neural network model is trained to establish the mapping relationship between the feature vector, its category, and the importance score; applications of a specified category whose importance score exceeds a preset threshold are designated as key applications. S103, construct a resource dependency graph based on the resource class characteristics of all key applications. The nodes in the resource dependency graph include key applications and resources, and the edges represent the dependency or occupation relationship between key applications and resources. Determine the key applications competing for the same resource based on the resource dependency graph. Perform load prediction based on the resource usage and select the resources that are predicted to have high load as target resources. S104 optimizes the performance of critical applications competing for target resources.
[0005] Optionally, when taking the three categories of performance, interaction, and resource characteristics of each application during operating system runtime in step S101, the performance characteristics include response time and frame rate. The response time is collected from the operating system performance counters, and the frame rate is obtained through the GPU driver interface. The interaction characteristics include window focus time and click frequency. The window focus time is the duration for which the window of the application is switched to focus, and the click frequency is the number of times the user clicks. The resource characteristics include the application's CPU characteristics, memory characteristics, IO characteristics, and network characteristics. The CPU characteristics include part or all of the application's overall CPU utilization, the utilization of each CPU core, and the length of the ready queue. The memory characteristics include part or all of the application's memory usage, page miss rate per second, and the ratio of cached pages to anonymous pages in memory. The IO characteristics include part or all of the application's disk access volume, the number of disk read / write operations per second, and the application process read / write bandwidth. The network characteristics include part or all of the application's network traffic, TCP packet retransmission rate, and network bandwidth utilization.
[0006] Optionally, the construction of a feature vector containing three types of features—performance, interaction, and resources—in step S101 includes: normalizing the frame rate using a sliding window to smooth out instantaneous fluctuations, and multiplying the window focus time and click frequency to obtain the interaction heat, thereby obtaining a feature vector containing three types of features—performance, interaction, and resources—composed of response time, normalized frame rate, interaction heat, CPU features, memory features, IO features, and network features.
[0007] Optionally, in step S102, the deep neural network model consists of an input layer, a feature extraction layer, and a classification output layer. The input layer is used to input the feature vector of the application, the feature extraction layer is used to extract the spatiotemporal feature representation of the feature vector, and the classification output layer is used to output the importance score of the application. The feature extraction layer consists of a one-dimensional convolutional layer and a bidirectional LSTM layer connected in sequence. The one-dimensional convolutional layer is used to extract local temporal pattern features in the feature vector of the application, and the bidirectional LSTM layer is used to capture the time span dependency of the input local temporal pattern features to obtain the spatiotemporal feature representation of the feature vector. The classification output layer includes two branches: one branch is composed of a Softmax function to generate the category of the application, and the other branch is composed of a Sigmoid activation function to generate the importance score of the application.
[0008] Optionally, after obtaining the application's category and importance score in step S102, the method further includes periodically calculating the difference between the application's importance score predicted by the deep neural network model and the actual importance score calculated based on the application's performance, interaction, and resource features. If the difference exceeds a preset threshold, the method collects the application's performance, interaction, and resource features and their calculated actual importance scores, and uses the collected data to incrementally train the deep neural network model to update its model parameters.
[0009] Optionally, in step S103, load prediction based on resource usage includes short-term prediction and long-term prediction. The prediction periods for short-term and long-term predictions are different. Their inputs are both time series of resource usage within a window of time prior to the current time; the output is the load size of this type of resource within the prediction period, and a load exceeding a preset threshold is determined as a high load.
[0010] Optionally, the performance optimization of critical applications competing for target resources in step S104 is implemented using a reinforcement learning algorithm model. The "system state" used in the reinforcement learning algorithm model includes some or all of the following: CPU utilization in the operating system, memory pressure, importance score of the currently highest priority critical application, global I / O wait time, average response latency, and number of active processes. The "action" used in the reinforcement learning algorithm model is one of a set of resource allocation actions. This set of resource allocation actions includes some or all of the following: increasing the CPU scheduling weight of critical application processes, reserving more memory for critical applications, limiting the I / O bandwidth of critical applications, and adjusting the cache refresh frequency of critical applications. The resource allocation actions in this set are implemented through a system interface or using an eBPF program. The function expression for the "instant reward" used in the reinforcement learning algorithm model is: ; in, The reward at time t, , and These are the weighting coefficients. This indicates the increase in system throughput after the action is performed. For a specified percentile of latency for a specified critical application, This is an indicator of the degree of fragmentation of memory resources.
[0011] The present invention also provides an adaptive critical application performance optimization system for operating system runtime, comprising a microprocessor and a memory interconnected thereto, wherein the microprocessor is programmed or configured to execute the adaptive critical application performance optimization method for operating system runtime.
[0012] The present invention also provides a computer-readable storage medium storing a computer program or instructions that are programmed or configured to execute an adaptive critical application performance optimization method by means of a processor during the operation of the operating system.
[0013] The present invention also provides a computer program product, including a computer program or instructions, which are programmed or configured to execute an adaptive critical application performance optimization method by means of a processor during the operation of the operating system.
[0014] Compared with existing technologies, the present invention mainly achieves the following beneficial effects: The method of the present invention includes acquiring three types of features of each application during the operation of the operating system: performance, interaction, and resources, and constructing feature vectors for the applications; using a pre-trained deep neural network model to obtain the category and importance score of the application using the feature vectors of the applications, and designating applications of a specified category whose importance score exceeds a preset threshold as key applications; constructing a resource dependency graph based on the resource category features of all key applications and identifying key applications competing for the same resource; performing load prediction based on resource usage, and designating resources predicted to have high load as target resources; optimizing the performance of key applications competing for target resources, the present invention can significantly improve the performance of key applications, reducing the average response time by about 30% to 50%; the method of the present invention can improve the overall resource utilization of the system by about 15% to 20% and reduce resource contention; the method of the present invention has strong adaptability and can cope with different types of workload changes; after adopting the method of the present invention, the user-perceived system smoothness is significantly improved, especially in multi-task concurrent scenarios. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the basic process of the method in an embodiment of the present invention.
[0016] Figure 2 This is a schematic diagram of the entry flow of the method in an embodiment of the present invention.
[0017] Figure 3 This is a schematic diagram illustrating the category structure applied in embodiments of the present invention. Detailed Implementation
[0018] To enable those skilled in the art to better understand the technical solution of the present invention, the technical solution of the present invention will be further described in detail below with reference to the accompanying drawings in the embodiments of the present invention.
[0019] like Figure 1 As shown, the adaptive performance optimization method for critical applications during operating system runtime in this embodiment includes the following steps: S101: Obtain the three types of features of each application during the operation of the operating system: performance, interaction, and resources, and construct a feature vector containing the three types of features. S102, the application's feature vector is used to obtain the application's category and importance score using a pre-trained deep neural network model. The deep neural network model is trained to establish the mapping relationship between the feature vector, its category, and the importance score; applications of a specified category whose importance score exceeds a preset threshold are designated as key applications. S103, construct a resource dependency graph based on the resource class characteristics of all key applications. The nodes in the resource dependency graph include key applications and resources, and the edges represent the dependency or occupation relationship between key applications and resources. Determine the key applications competing for the same resource based on the resource dependency graph. Perform load prediction based on the resource usage and select the resources that are predicted to have high load as target resources. S104 optimizes the performance of critical applications competing for target resources.
[0020] like Figure 2 As shown, the adaptive performance optimization method for critical applications during operating system runtime (hereinafter referred to as the optimization method) in this embodiment has two entry points: 1) the optimization method is started when the OS boots up; 2) the conditions that trigger the operation of the optimization method during operating system operation. For example, resource bottleneck judgment is performed. If the CPU utilization rate is greater than 85% and the CPU run queue length is greater than 3 × the number of cores, it is judged as a CPU bottleneck; if the memory page miss rate is greater than a threshold, it is judged as a memory bottleneck; if the IO queue depth is greater than a set value, it is judged as an I / O bottleneck; if the TCP retransmission rate is greater than 5%, it is judged as a network bottleneck. If any of the above resource bottlenecks exist, the optimization method is triggered.
[0021] In this embodiment, the system continuously monitors the operating status of various operating system resources and constructs a resource usage model based on the monitoring data to characterize the application's resource consumption relationship. The application characteristics in step S101 of this embodiment include three categories: application performance, interaction, and resources.
[0022] Performance characteristics include response time and frame rate. Response time is measured from operating system performance counters (such as Linuxperf_event) ( / proc / <pid> / schedstat), the frame rate is obtained through the GPU driver interface; Interactive features include window focus time and click frequency. The window focus time is the duration during which the window of the application is switched to focus, and the click frequency is the number of times the user clicks. In this embodiment, the user interface events are monitored through a window manager (such as X11 or Wayland), and the frequency and intensity of the application's interactions are recorded. For example, the focus window switching event and its duration are captured, and input device events (such as / dev / input) are parsed to count the number of user clicks.
[0023] Resource-related characteristics include the application's CPU characteristics, memory characteristics, I / O characteristics, and network characteristics.
[0024] In this embodiment, CPU characteristics include the overall CPU utilization of the application (which can be viewed via / proc / ). <pid>The metrics include data obtained by parsing the / stat file, the utilization of each CPU core (e.g., using the mpstat tool), and the length of the ready queue (e.g., reading / proc / loadavg). These metrics reflect the processor's load and scheduling pressure.
[0025] In this embodiment, memory characteristics include the application's internal usage (obtainable through parsing the smaps file), the page miss rate per second (obtainable through sar-B), and the ratio of cached pages to anonymous pages in memory (obtainable through parsing / proc / meminfo), to reflect memory pressure and usage patterns.
[0026] In this embodiment, IO characteristics include the application's disk access volume (which can be accessed via / proc / ). <pid>The data includes data from / io file parsing, disk read / write operations per second (IOPS, which can be obtained via iostat), and application process read / write bandwidth (which can be measured using tools such as iotop).
[0027] In this embodiment, network characteristics include application network traffic, TCP packet retransmission rate (e.g., viewed using ss -ti) and network bandwidth utilization (e.g., monitored in real time via nload) to assess whether there are bottlenecks in network communication.
[0028] In step S101 of this embodiment, constructing a feature vector containing three categories of features—performance, interaction, and resources—involves: normalizing the frame rate using a sliding window to smooth out instantaneous fluctuations; multiplying the window focus time and click frequency to obtain the interaction heat, thus obtaining a feature vector composed of response time, normalized frame rate, interaction heat, CPU features, memory features, IO features, and network features, encompassing the three categories of features—performance, interaction, and resources. In this embodiment, highly volatile time-series indicators (such as frame rate) are normalized using a sliding window (e.g., a 500-millisecond window) to smooth out instantaneous fluctuations; then, an interaction heat score is calculated based on user interaction data, for example, by combining window focus time and click frequency into a single interaction feature according to the formula (heat = number of clicks × focus duration). After cleaning and normalization, various heterogeneous data are fused to form a unified feature representation. Finally, the system constructs a feature vector V containing the three categories of features—performance, interaction, and resources.
[0029] In step S102 of this embodiment, a machine learning model is used to analyze the feature vector, evaluate the relative importance of the application, and provide a quantitative score. The deep neural network model consists of an input layer, a feature extraction layer, and a classification output layer. The input layer is used to input the application's feature vector. The feature extraction layer is used to extract the spatiotemporal feature representation of the feature vector. The classification output layer is used to output the application's importance score. The feature extraction layer consists of a sequentially connected one-dimensional convolutional layer (e.g., a convolutional kernel size of 3) and a bidirectional LSTM (Long Short-Term Memory) layer. The one-dimensional convolutional layer is used to extract local temporal pattern features from the application's feature vector. The bidirectional LSTM layer is used to capture the time-span dependencies of the input local temporal pattern features to obtain the spatiotemporal feature representation of the feature vector. The classification output layer includes two branches. One branch consists of a Softmax function to generate the application's category. As an optional implementation, the categories in this embodiment include four types: DB (database) transactions, real-time APIs, batch jobs, and background services, with the following distribution: Figure 3 As shown; another branch is constructed using the Sigmoid activation function to generate an application importance score, with a value ranging from 0 to 1. Applications of a specified category whose importance score exceeds a preset threshold are designated as critical applications. As an optional implementation, this embodiment divides applications into 6 levels (0-5) based on their importance scores. For example, level 5 has an importance score greater than or equal to 0.9, and level 1 has an importance score ≤ 0.3 (such as log compression tasks), thereby allowing certain levels and categories of applications to be designated as critical applications.
[0030] As an optional implementation, after obtaining the application category and importance score in step S102 of this embodiment, the method further includes periodically calculating the difference between the application importance score predicted by the deep neural network model and the actual importance score calculated based on the application's performance, interaction, and resource features. If this difference exceeds a preset threshold, the system collects the application's performance, interaction, and resource features and their calculated actual importance scores, and uses the collected data to incrementally train the deep neural network model to update its parameters. It should be noted that the actual importance score calculated based on the application's performance, interaction, and resource features is exactly the same as the label generation method used during deep neural network model training. Through this method, if a significant deviation is found between the actual performance of an application and the model prediction, the system will trigger adaptive adjustments to the model. For example, when the score of a key application's actual response time and other performance indicators differs from the importance score assigned by the model (the deviation exceeds a preset threshold, such as 20%), the system automatically uses newly collected data to incrementally train the model and update its parameters, making it more accurately reflect the true importance of each application under the current workload. This online learning mechanism ensures that the model continuously improves itself as the environment changes.
[0031] Based on the data of all application characteristics, in step S103 of this embodiment, a Resource Dependency Graph (RDG) is constructed according to the resource class characteristics of all key applications. The RDG is a directed graph structure describing the relationship between processes and resources. Nodes in the RDG include key applications and resources, and edges represent the dependencies or occupancy relationships of key applications on resources. Each dependency edge can be appended with weight or frequency information to characterize the intensity of the process's use of the corresponding resource. For example, if process A frequently accesses disk D and performs large amounts of data transmission through network port P, then an edge is established in the RDG pointing from node "process A" to nodes "disk D" and "network P," and the corresponding I / O frequency or bandwidth occupancy information is labeled. Through the RDG, the system can intuitively identify whether multiple key applications are competing for the same resource and which resources become performance bottlenecks. The resource usage model reflected in the RDG will serve as an important basis for subsequent resource status prediction and optimization decisions. In this embodiment, key applications competing for the same resource are determined based on the RDG; load prediction is performed based on resource usage, and resources predicted to have high load are selected as target resources. As an optional implementation, step S103 of this embodiment includes short-term and long-term prediction based on resource usage. The prediction periods for short-term and long-term predictions are different. Their input is a time series of resource usage within a window preceding the current time; the output is the load size of that type of resource within the prediction period, and a load exceeding a preset threshold is considered a high load. In this embodiment, short-term prediction (0-5 seconds) targets immediate resource fluctuations. The system uses a Temporal Convolutional Network (TCN) model to analyze and predict recently monitored resource indicators. TCN can extract trends from short time series and extrapolate changes in the next few seconds. For example, using memory page miss rate or I / O queue length data from recent monitoring periods, the system can predict the possible changes in these indicators in the next few seconds to promptly detect instantaneous resource demand peaks. Long-term prediction (5-60 seconds) targets slightly longer time scales and periodic patterns, using time series analysis methods (such as the Prophet algorithm) to mine the periodic patterns of resource usage. Through historical monitoring data, the Prophet algorithm can identify periodic peak behaviors of resource usage and predict whether similar patterns will appear in the future. For example, when the database performs backups every hour, causing disk I / O throughput to spike periodically, the Prophet model can predict in advance when the next backup operation will occur and the high I / O load it may cause.
[0032] In step S104 of this embodiment, when optimizing the performance of critical applications for competing target resources, the system needs to comprehensively apply the importance assessment results and resource status information to generate an optimized resource allocation strategy for the current situation. As an optional implementation, the performance optimization of critical applications for competing target resources in step S104 of this embodiment is implemented using a reinforcement learning algorithm model. The core is to introduce a reinforcement learning (RL) algorithm to continuously adjust the strategy based on real-time feedback, thereby optimizing the overall system efficiency while ensuring the performance of critical applications. Specifically, the reinforcement learning algorithm model defines "system state," "action," and "immediate reward" within the reinforcement learning framework.
[0033] In this embodiment, the "system state" adopted by the reinforcement learning algorithm model includes CPU utilization, memory pressure, importance score of the current highest priority critical application, global I / O latency, average response latency, and number of active processes in the operating system. It can comprehensively characterize the system load and the operating status of critical applications. A multi-dimensional state vector can be constructed, and through appropriate normalization and transformation (such as taking the logarithm of some nonlinear indicators), the numerical values of each dimension can be ensured to be comparable on the comparison scale.
[0034] In this embodiment, the "action" used by the reinforcement learning algorithm model is one of a set of resource allocation actions. This set of actions includes increasing the CPU scheduling weight of critical application processes, reserving more memory for critical applications, limiting the I / O bandwidth of critical applications, and adjusting the cache refresh frequency of critical applications. A predefined set of possible resource allocation actions that the system may take constitutes an optimization strategy candidate set. Each action corresponds to a resource allocation scheme or optimization measure. Actions can target a single resource or be a combination of multiple measures. The reinforcement learning algorithm model can select the best action for the current state from the discrete set of actions.
[0035] To guide reinforcement learning towards improving the performance of key applications and system efficiency, this embodiment uses a reinforcement learning algorithm model that comprehensively considers factors such as throughput, latency, and fragmented resource utilization when calculating the "instant reward." Specifically, the function expression for the "instant reward" is: ; in, The reward at time t, , and These are the weighting coefficients. This indicates the increase in system throughput after the action is performed. This represents the change in latency at a specified percentile for a given critical application (this is a measure of latency penalty; it becomes negative as latency increases). This is an indicator of the degree of fragmentation of memory resources. The weighting coefficients of the above three items... , and The values can be adjusted according to the optimization focus. In this embodiment, the values are 0.6, 0.3, and 0.1, indicating a greater emphasis on improving throughput and reducing latency, while moderately controlling resource fragmentation. Through such a reward function, the reinforcement learning agent will balance the improvement of overall system performance and the key application experience when evaluating the merits of actions, avoiding a decline in overall performance for the sake of local gains.
[0036] In the training phase, reinforcement learning algorithm models include, based on System state at time 1 choose Moment of action ,implement Moment of action And calculate based on the execution results Momentary Rewards Then observe System state at time 1 And update the Q value according to the following formula: ; in, For the updated Q value, In order to be in System state at time 1 Downward Moment of action Q value, For learning rate, As a reward, As a discount factor, In order to be in System state at time 1 Downward Moment of action The Q-value is calculated. Through continuous training, the Q-table gradually converges, forming a policy mapping from states to optimal actions. In other words, after sufficient iterations, for each typical system state, the algorithm can provide the optimal action selection that maximizes long-term rewards. Using the above reinforcement learning algorithm model, resource allocation strategies can be dynamically optimized during operation. When the system is in a specific state (e.g., a critical application is consuming a large amount of CPU and the disk is about to saturate), the algorithm will select the corresponding optimal action plan (e.g., increasing the CPU weight of the application and temporarily reducing the I / O priority of other non-critical processes). This optimal strategy, as the output of this step, is sent to the execution module of the next step in the form of action instructions for implementation. Through continuous learning and adjustment, the reinforcement learning algorithm model can continuously update its strategy according to environmental changes, thereby achieving adaptive optimization of resource allocation. The Pareto optimal resource strategy is transformed into specific deployment parameters, and a traceable knowledge base record is generated, enabling the immediate application and continuous reuse of optimization results. This embodiment constructs a full-process operation mechanism—a dynamic collaborative framework. Through a self-evolving closed-loop control system, it organically connects the perception, decision-making, execution, and learning modules to achieve fully automatic real-time collaboration from resource status perception to the implementation of optimization strategies, continuously approaching the Pareto optimal system state.
[0037] The resource allocation actions in the resource allocation action set can adjust the operating system's resource allocation parameters in real time, implementing differentiated performance optimization measures for different applications. The execution module receives the action instructions output by the decision (e.g., specifying a particular resource quota adjustment for a process) and calls the underlying interface to implement the corresponding configuration changes. Resource adjustment involves several aspects: a. CPU scheduling: For example, increasing the proportion of CPU time slices obtained by critical applications by adjusting the scheduler's weight or priority. In specific implementation, a larger weight value can be set for the scheduling group to which a high-priority application belongs (e.g., increasing the CPU share of the group by writing to the / sys / fs / cgroup / cpu / <group> / weight file), thereby ensuring its advantage in scheduling contention. b. Memory management: For example, reserving or locking dedicated memory areas for critical applications to prevent their important data pages from being swapped out of memory. From an implementation perspective, the system call mlock2 can be called to lock specified memory pages (e.g., using the MLOCK_ONFAULT flag for on-demand locking), ensuring that high-priority processes always have enough available physical memory when accessing memory, reducing latency caused by memory contention. cI / O bandwidth: For example, leveraging the I / O subsystem of a cgroup to guarantee disk bandwidth for critical applications or imposing I / O throttling on background tasks. In implementation, this can be achieved by configuring the cgroup v2 interface to limit / guarantee I / O throughput for specific devices. For instance, executing the command `echo "8:0 rbps=100M wbps=50M"> / sys / fs / cgroup / io.max` sets a read / write bandwidth limit for device 8:0 (assuming it's the system disk), ensuring critical I / O operations receive sufficient bandwidth without being preempted by low-priority tasks. d. Caching and prefetching: For example, customizing caching strategies and prefetching mechanisms for critical applications. Page cache management strategies can be adjusted based on memory access patterns, prefetching the necessary data pages to reduce read / write latency. In implementation, the `posix_madvise` system call can be used to set a prefetching intention flag (e.g., using `POSIX_MADV_WILLNEED`) for the memory regions of critical applications, prompting the kernel to load data in advance, thereby improving the smoothness of the application's operation.
[0038] In this embodiment, the resource adjustment operations selected by the reinforcement learning algorithm model can directly act at the operating system kernel level, enabling the optimization strategy to take effect immediately. It should be noted that the resource allocation actions in the resource allocation action set can be implemented through system interfaces or using eBPF programs. Besides using conventional system interfaces for resource configuration, deeper dynamic optimization can be implemented using mechanisms such as eBPF (extended Berkeley Packet Filter). For example, an eBPF program can be mounted within the kernel to intercept memory allocation functions (such as instrumenting the Linux kernel's __alloc_pages function). When a process requests memory page allocation, the eBPF program checks whether the process belongs to a high-priority application (e.g., by comparing its PID with a list of critical applications). If so, the bpf_override_return function redirects the allocation operation to a reserved high-speed memory pool, providing dedicated memory resources for critical processes; otherwise, allocation is performed using the default path. In this way, the system can ensure the priority access of critical applications to critical resources at a lower level, avoiding performance overhead that traditional scheduling cannot cover. Through the aforementioned multi-layered dynamic execution mechanism, this invention effectively applies the optimization scheme determined by the decision-making module to the system operation, thereby improving the performance of key applications in real time.
[0039] The adaptive optimization decision-making process of the reinforcement learning algorithm model in this embodiment includes a core decision-making engine, execution and feedback, learning and optimization, and output. The core decision-making engine uses reinforcement learning algorithms to integrate real-time resource status and application importance assessment data to autonomously generate an optimal resource allocation strategy that balances system throughput and critical application performance. The execution and feedback process translates the decision strategy into operating system-level resource control actions and quantifies the optimization effect in real time through millisecond-level monitoring, constructing a dynamic feedback loop for strategy iteration. The learning and optimization process, based on resource allocation effect feedback data, dynamically updates the strategy model parameters through reinforcement learning, autonomously evolving an optimal decision path that better adapts to the system state. The output process translates the Pareto optimal resource strategy into specific deployment parameters and generates traceable knowledge base records, enabling the immediate application and continuous reuse of optimization results.
[0040] To verify the effectiveness of the adaptive critical application performance optimization method during operating system runtime in this embodiment, the following experimental setup was adopted: Environment configuration: Linux (cgroupv2 enabled), kernel supporting eBPF; dual-socket 16-core CPU, 64GB RAM, NVMe SSD; monitoring sampling window 500ms. Workloads (mixed) included: video conferencing (interactive, critical application), database (transactional, critical application), and log compression (background, non-critical). The baseline was: without the method of this embodiment (no deep learning model, no RDG (resource dependency graph) / load prediction, no RL (reinforcement learning algorithm model), only static priority + conventional cgroup quotas). Metrics used included: system throughput, average response time, P99 latency, and SLA violation rate. Each group underwent n=30 independent measurements, and the average was taken. The final performance comparison results with and without the method of this embodiment are shown in Table 1, and the ablation experiment results are shown in Table 2.
[0041] Table 1: Performance comparison results using / not using the method of this embodiment
[0042] As shown in Table 1, compared with the baseline, the method in this embodiment achieves a 36% to 41% reduction in P99 / average latency, an approximately 85% reduction in SLA violation rate, an approximately 16% increase in overall system throughput, and an approximately 17% increase in effective CPU utilization in key applications; background tasks will be controlled to slow down (approximately 9%) under high load.
[0043] Table 2: Ablation Experiment Results of the Method in this Embodiment
[0044] As shown in Table 2, deep importance assessment, RDG, (TCN / Prophet), Q-learning, eBPF, and online feedback are all indispensable. Among them, deep importance assessment and RL decision-making contribute the most, RDG / TCN is key to tail delay, eBPF ensures low-overhead execution, and online feedback ensures continuous adaptation.
[0045] Furthermore, this embodiment also provides an adaptive critical application performance optimization system for operating system runtime, including a microprocessor and a memory interconnected, wherein the microprocessor is programmed or configured to execute the adaptive critical application performance optimization method for operating system runtime. This embodiment also provides a computer-readable storage medium storing a computer program or instructions programmed or configured to execute the adaptive critical application performance optimization method for operating system runtime via a processor. This embodiment also provides a computer program product including a computer program or instructions programmed or configured to execute the adaptive critical application performance optimization method for operating system runtime via a processor.
[0046] Those skilled in the art will understand that the technical solutions provided by this invention may take the form of a method, system, or computer program product. Therefore, this invention may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this invention may take the form of a computer program product embodied on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, produce an implementation of the flowchart... Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0047] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.< / pid> < / pid> < / pid>
Claims
1. An adaptive performance optimization method for critical applications during operating system runtime, characterized in that, Includes the following steps: S101: Obtain the three types of features of each application during the operation of the operating system: performance, interaction, and resources, and construct a feature vector containing the three types of features. S102, the application's feature vectors are used to obtain the application's category and importance score using a pre-trained deep neural network model, wherein the deep neural network model is trained to establish the feature vectors and the mapping relationship between their categories and importance scores; Applications in a specified category whose importance score exceeds a preset threshold will be designated as key applications; S103, construct a resource dependency graph based on the resource class characteristics of all key applications. The nodes in the resource dependency graph include key applications and resources, and the edges represent the dependency or occupation relationship between key applications and resources. Determine the key applications competing for the same resource based on the resource dependency graph. Perform load prediction based on the resource usage and select the resources that are predicted to have high load as target resources. S104 optimizes the performance of critical applications competing for target resources.
2. The adaptive performance optimization method for critical applications during operating system runtime according to claim 1, characterized in that, In step S101, when retrieving the performance, interaction, and resource characteristics of each application during operating system runtime, the performance characteristics include response time and frame rate. The response time is collected from the operating system performance counters, and the frame rate is obtained through the GPU driver interface. The interaction characteristics include window focus time and click frequency. The window focus time is the duration for which the window of the application is switched to focus, and the click frequency is the number of clicks by the user. The resource characteristics include the application's CPU characteristics, memory characteristics, IO characteristics, and network characteristics. The CPU characteristics include part or all of the application's overall CPU utilization, the utilization of each CPU core, and the length of the ready queue. The memory characteristics include part or all of the application's internal memory usage, page miss rate per second, and the ratio of cached pages to anonymous pages in memory. The IO characteristics include part or all of the application's disk access volume, the number of disk read / write operations per second, and the application process read / write bandwidth. The network characteristics include part or all of the application's network traffic, TCP packet retransmission rate, and network bandwidth utilization.
3. The adaptive performance optimization method for critical applications during operating system runtime according to claim 2, characterized in that, Step S101 involves constructing a feature vector that includes three types of features: performance, interaction, and resources. This includes normalizing the frame rate using a sliding window to smooth out instantaneous fluctuations, and multiplying the window focus time and click frequency to obtain the interaction heat. This results in a feature vector that includes three types of features: performance, interaction, and resources, composed of response time, normalized frame rate, interaction heat, CPU features, memory features, IO features, and network features.
4. The adaptive performance optimization method for critical applications during operating system runtime according to claim 1, characterized in that, In step S102, the deep neural network model consists of an input layer, a feature extraction layer, and a classification output layer. The input layer is used to input the feature vector of the application. The feature extraction layer is used to extract the spatiotemporal feature representation of the feature vector. The classification output layer is used to output the importance score of the application. The feature extraction layer consists of a one-dimensional convolutional layer and a bidirectional LSTM layer connected in sequence. The one-dimensional convolutional layer is used to extract local temporal pattern features in the feature vector of the application. The bidirectional LSTM layer is used to capture the time span dependency of the input local temporal pattern features to obtain the spatiotemporal feature representation of the feature vector. The classification output layer includes two branches: one branch is composed of a Softmax function to generate the category of the application, and the other branch is composed of a Sigmoid activation function to generate the importance score of the application.
5. The adaptive performance optimization method for critical applications during operating system runtime according to claim 1, characterized in that, After obtaining the application category and importance score in step S102, the method further includes periodically calculating the difference between the application importance score predicted by the deep neural network model and the actual importance score calculated based on the application's performance, interaction, and resource features. If the difference exceeds a preset threshold, the application's performance, interaction, and resource features and their calculated actual importance scores are collected, and the collected data is used to incrementally train the deep neural network model to update the model parameters of the deep neural network model.
6. The adaptive performance optimization method for critical applications during operating system runtime according to claim 1, characterized in that, In step S103, load prediction based on resource usage includes short-term prediction and long-term prediction. The prediction periods for short-term and long-term predictions are different. Their inputs are the time series of resource usage within a window of time prior to the current time. The output is the load size of this type of resource within the prediction period, and a load exceeding a preset threshold is determined as a high load.
7. The adaptive performance optimization method for critical applications during operating system runtime according to claim 1, characterized in that, In step S104, performance optimization for critical applications competing for target resources is implemented using a reinforcement learning algorithm model. The "system state" used in this reinforcement learning algorithm model includes some or all of the following: CPU utilization in the operating system, memory pressure, importance score of the currently highest-priority critical application, global I / O wait time, average response latency, and number of active processes. The "action" used in this reinforcement learning algorithm model is one of a set of resource allocation actions. This set of resource allocation actions includes some or all of the following: increasing the CPU scheduling weight of critical application processes, reserving more memory for critical applications, limiting the I / O bandwidth of critical applications, and adjusting the cache refresh frequency of critical applications. The resource allocation actions in this set are implemented through system interfaces or using eBPF programs. The function expression for the "instant reward" used in this reinforcement learning algorithm model is: ; in, The reward at time t, , and These are the weighting coefficients. This indicates the increase in system throughput after the action is performed. For a specified percentile of latency for a specified critical application, This is an indicator of the degree of fragmentation of memory resources.
8. An adaptive performance optimization system for critical applications during operating system runtime, comprising interconnected microprocessors and memory, characterized in that, The microprocessor is programmed or configured to execute an adaptive critical application performance optimization method for the operation of any one of claims 1 to 7.
9. A computer-readable storage medium storing a computer program or instructions, characterized in that, The computer program or instructions are programmed or configured to execute, via a processor, the adaptive critical application performance optimization method for the operation of any one of claims 1 to 7.
10. A computer program product, comprising a computer program or instructions, characterized in that, The computer program or instructions are programmed or configured to execute, via a processor, the adaptive critical application performance optimization method for the operation of any one of claims 1 to 7.