Operating system configuration optimization method and device for multi-resource joint scheduling
By employing a multi-resource joint scheduling operating system configuration optimization method, and utilizing DQN neural networks and decision tree models, the problems of blind spots in mobile resource correlation and high overhead are solved, achieving global user experience optimization and lightweight resource scheduling.
Patent Information
- Application Number
- CN202411864838.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-12-17
AI Technical Summary
Existing technologies face challenges when migrating to mobile devices, including blind spots in resource correlation and high runtime overhead in optimization methods, making it difficult to effectively optimize the multi-resource configuration of mobile operating systems.
An operating system configuration optimization method oriented towards multi-resource joint scheduling is adopted. By acquiring the current system status and historical resource allocation information, and using the DQN neural network model and decision tree model, the allocation target of system resources and the target resource allocation information are determined, so as to realize resource correlation identification and local lightweight adjustment under the global perspective.
It achieves global user experience optimization, effectively identifies the correlation between resources, provides fine-grained resource allocation metrics, reduces the runtime overhead of tuning methods, and supports lightweight resource scheduling on mobile devices.
Smart Images

Figure CN119967614B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of operating system tuning, and particularly relates to an operating system configuration tuning method and device for multi-resource joint scheduling. BACKGROUND
[0002] User experience is the touchstone of mobile devices, which often depends on the effective, fast and accurate supply of system resources (IO, memory, CPU, GPU, etc.). Many existing technologies have proven that system configurable parameters are the key knobs for resource allocation. This non-invasive adjustment method does not require modification and recompilation of system source code, and can quickly adjust to different workloads, bringing more possibilities for performance tuning and user experience optimization.
[0003] Therefore, more and more dynamic configuration tuning techniques are introduced into academic research and production environments to replace laborious and time-consuming manual tuning. The mainstream methods are as follows:
[0004] 1) Based on heuristic strategy: This method condenses expert experience summarized from practice through program language, and constructs configuration adjustment rules through setting threshold and condition judgment, etc. For example, adjusting the size of swappiness based on the number of anonymous pages, and adjusting the size of readahead pre-reading window based on the access mode of the application program. Heuristic strategy is simple and intuitive, but has great bias and limitation, and is difficult to cover all scenarios.
[0005] 2) Based on Bayesian optimization: Bayesian optimization is an iterative algorithm based on sequential models. It uses a substitute model to approximate the target optimization function, and sequentially updates this model through new data points observed by iteration. For example, OtterTune and ResTune methods use Gaussian process as a substitute model to optimize the configuration parameters of MySQL.
[0006] 3) Based on deep learning: Deep learning model defines the mapping from input to output, and learns how to use hidden layers to produce correct output. More and more researches guide configuration tuning work by constructing the mapping from configuration space to performance space, such as GIL+, Unicorn, etc. Recently, many methods transform the configuration tuning problem into the exploration process of reinforcement learning through the paradigm of deep reinforcement learning, in order to seek automatic solutions that maximize rewards.
[0007] Although these configuration tuning techniques have better application in cloud computing scenarios and server environments (such as MySQL, Hadoop, etc.), it is not easy to migrate to mobile operating systems, which mainly faces the following key problems:
[0008] 1) Complex correlation between resources: due to the scarcity of mobile terminal resources, the complex correlation between configurations and configurations is often difficult to be fully explored, and when multiple configurations are adjusted under the influence of different strategies, the user experience will be deteriorated due to the pressure transmission between resources. Taking memory and IO resources as examples, when the thread scheduling time of dirty page write-back is delayed (the value of dirty_ratio is increased) to avoid current IO competition, a large number of dirty pages will be accumulated at the tail of the Inactive File Lru chain table of the memory, and when kswapd tends to recover file pages (the value of swappiness is reduced), high IO delay will be caused due to immediate write-back of dirty pages, thereby significantly deteriorating the user experience. In addition, in the low power mode, the actual trigger IO D state time and the actual initiation IO time are obviously delayed due to the CPU frequency limiting, and this phenomenon is often identified as an IO bottleneck problem by traditional algorithms, but in fact, the root cause is the CPU frequency.
[0009] 2) Runtime overhead of tuning method: compared with the resource-rich server, the runtime overhead of the tuning method is more strictly limited on the mobile terminal, and the resource consumption of the method itself should be much smaller than the benefit brought by the method. For example, the online search and playback sampling process required by Bayesian optimization is not feasible on the mobile terminal. Therefore, a part of the work needs to be converted into offline operation, and the method should be as light and feasible as possible.
[0010] In view of the problems of the prior art that the resource correlation blind area and the large overhead are faced when migrating to the mobile terminal, it is necessary to propose a new operating system configuration tuning method for multi-resource joint scheduling. SUMMARY
[0011] The application provides an operating system configuration tuning method and device for multi-resource joint scheduling, which is used to solve the problems of the prior art that the resource correlation blind area and the large overhead are faced when migrating to the mobile terminal.
[0012] In order to solve the above technical problems, the first aspect of the application discloses an operating system configuration tuning method for multi-resource joint scheduling, and the method comprises:
[0013] obtaining current system state information of a target operating system in a current adjustment period, wherein the system state information comprises index information for describing each kind of main system resource in the target operating system;
[0014] obtaining historical resource allocation information in a previous adjustment period corresponding to the current adjustment period, wherein the resource allocation information comprises control information for scheduling each kind of system resource in the target operating system;
[0015] determine, according to the current system state information and the historical resource allocation information, an allocation target of each system resource of the target operating system in the current adjustment period, wherein the allocation target is used to represent a degree of adjustment required for each system resource of the target operating system;
[0016] determine, according to the allocation target of each system resource of the target operating system in the current adjustment period, target resource allocation information of the target operating system in the current adjustment period, wherein the target resource allocation information is used to indicate a control scheme executed on each system resource of the target operating system.
[0017] The second aspect of the present application discloses an operating system configuration optimization device for multi-resource joint scheduling, and the device comprises:
[0018] a first obtaining module, configured to obtain current system state information of a target operating system in a current adjustment period, wherein the system state information comprises index information used to describe each main system resource of the target operating system;
[0019] a second obtaining module, configured to obtain historical resource allocation information in a previous adjustment period corresponding to the current adjustment period, wherein the resource allocation information comprises control information used to schedule each system resource of the target operating system;
[0020] a global adjustment module, configured to determine, according to the current system state information and the historical resource allocation information, an allocation target of each system resource of the target operating system in the current adjustment period, wherein the allocation target is used to represent a degree of adjustment required for each system resource of the target operating system;
[0021] a local adjustment module, configured to determine, according to the allocation target of each system resource of the target operating system in the current adjustment period, target resource allocation information of the target operating system in the current adjustment period, wherein the target resource allocation information is used to indicate a control scheme executed on each system resource of the target operating system.
[0022] As an optional implementation, in the second aspect of the present application, the specific manner in which the global adjustment module determines the allocation target of each system resource of the target operating system in the current adjustment period according to the current system state information and the historical resource allocation information comprises:
[0023] inputting the current system state information and the historical resource allocation information into a pre-trained DQN neural network model, the DQN neural network model extracting a feature vector of each system resource, for each system resource, performing a reward exploration operation according to the feature vector corresponding to the system resource to obtain an allocation parameter corresponding to the system resource; and determining an allocation target of each system resource of the target operating system in the current adjustment period according to the allocation parameter corresponding to each system resource.
[0024] The state space of the DQN neural network model is the current system state information, the action space of the DQN neural network model is the pre-stored allocation parameter in the action space of the DQN neural network model, and the reward function of the DQN neural network model is the gain of the user experience index, wherein the user experience index is used to measure the user experience satisfaction degree of the target operating system.
[0025] As an optional implementation, in the second aspect of the present application, the pre-stored allocation parameter in the action space of the DQN neural network model includes a plurality of preset discrete values, wherein the positive or negative of each discrete value is used to represent the adjustment direction of the corresponding system resource, and the absolute value of each discrete value is used to represent the adjustment degree of the corresponding system resource.
[0026] As an optional implementation, in the second aspect of the present application, the local adjustment module determines the specific manner of the target resource allocation information of the target operating system in the current adjustment period according to the allocation target of each system resource of the target operating system in the current adjustment period, which includes:
[0027] For each system resource, a plurality of key parameters corresponding to the system resource are determined according to the allocation target of the system resource, and an adjustable range of each key parameter is determined, wherein the key parameter is used to represent the main influencing factor corresponding to the corresponding system resource.
[0028] For each system resource, an allocation state corresponding to the system resource is determined according to all the key parameters corresponding to the system resource, wherein there is a preset time sequence relationship between the allocation state and the key parameters.
[0029] For each system resource, a corresponding key parameter adjustment operation is performed, and when the absolute value of the difference between the allocation state adjustment value corresponding to the system resource in the current adjustment period and the allocation target corresponding to the system resource is the smallest, all the key parameters at this time are obtained as all the target key parameters corresponding to the system resource.
[0030] The target resource allocation information of the target operation system in the current adjustment period is determined according to all the target key parameters corresponding to all the system resources.
[0031] As an optional implementation, in the second aspect, the local adjustment module executes the corresponding key parameter adjustment operation for each system resource, and when the absolute value of the difference between the allocation state adjustment value of the system resource in the current adjustment period and the allocation target of the system resource is the smallest, the specific way of obtaining all the key parameters at this time as all the target key parameters corresponding to the system resource includes:
[0032] It is judged whether the time length of the current adjustment period is greater than a preset period threshold value; if it is judged that the time length of the current adjustment period is greater than the preset period threshold value, then:
[0033] For each system resource, the allocation target and the allocation state of the system resource are input into a pre-trained decision tree model, and an initial key parameter adjustment set output by the decision tree model is obtained, the initial key parameter adjustment set including a value subset of each key parameter;
[0034] For each system resource, all target key parameters are filtered from the initial key parameter adjustment set corresponding to the system resource, wherein the target key parameters can satisfy that the absolute value of the difference between the allocation state adjustment value of the system resource in the current adjustment period and the allocation target of the system resource is the smallest.
[0035] As an optional implementation, in the second aspect, the local adjustment module executes the corresponding key parameter adjustment operation for each system resource, and when the absolute value of the difference between the allocation state adjustment value of the system resource in the current adjustment period and the allocation target of the system resource is the smallest, the specific way of obtaining all the key parameters at this time as all the target key parameters corresponding to the system resource includes:
[0036] It is judged whether the time length of the current adjustment period is greater than a preset period threshold value; if it is judged that the time length of the current adjustment period is less than or equal to the preset period threshold value, then:
[0037] For each key parameter corresponding to each system resource, the corresponding key parameter adjustment operation is executed by the following formula:
[0038]
[0039] wherein, is the value of the key parameter in the current adjustment period, a value of a key parameter in a previous period of a current adjustment period, a difference between a historical allocation state and a historical allocation target of the system resource corresponding to the system resource in the current adjustment period, a reaction hyper-parameter that can be adjusted, a regression parameter;
[0040] The regression parameter is determined according to the following operation: According to the following operation:
[0041] The regression parameter is determined according to the following operation: :
[0042]
[0043] wherein, is a historical allocation state of the system resource in an adjustment period T, is a historical key parameter of the system resource in an adjustment period T-1 that is a previous adjustment period of the adjustment period T;
[0044] For each of the system resources, when the absolute value of the difference between the allocation state adjustment value corresponding to the system resource and the allocation target corresponding to the system resource is the smallest, the key parameters at this time are obtained as all target key parameters corresponding to the system resource by performing the key parameter adjustment operation.
[0045] As an optional implementation, in the second aspect of the present application, the device further comprises:
[0046] The feature selection module is configured to fix the application load of the target operating system unchanged, adjust the configuration parameters corresponding to the target operating system, and obtain index samples of system resources in a configuration parameter adjustment process before the current system state information of the target operating system in the current adjustment period is obtained; and the principal component analysis-based device is configured to perform coordinate reconstruction to obtain indexes of main system resources from the index samples of the system resources.
[0047] The feature selection module is further configured to fix the configuration parameters corresponding to the target operating system unchanged, adjust the application load of the target operating system, and obtain influence factor samples of system resources in an application load adjustment process; and the principal component analysis-based device is configured to perform coordinate reconstruction to obtain main influence factors from the influence factor samples of the system resources.
[0048] The third aspect of the present application discloses another operating system configuration optimization device for multi-resource joint scheduling, and the device comprises:
[0049] a memory storing executable program code;
[0050] a processor coupled with the memory;
[0051] The processor invokes the executable program code stored in the memory to execute the multi-resource joint scheduling oriented operating system configuration tuning method disclosed in the first aspect of the present application.
[0052] The fourth aspect of the present application discloses a computer storage medium storing computer instructions, which, when invoked, are used to execute the multi-resource joint scheduling oriented operating system configuration tuning method disclosed in the first aspect of the present application.
[0053] Compared with the prior art, the present application has the following beneficial effects:
[0054] The present application supports multi-resource joint scheduling to achieve global user experience optimization. Specifically, according to current system state information and historical resource allocation information, the allocation target of each system resource of the target operating system in the current adjustment period is determined, a global view is provided for the resource scheduling of the entire system, the correlation between resources is effectively identified, and appropriate allocation indicators are set for individual resources. According to the allocation target of each system resource of the target operating system in the current adjustment period, the target resource allocation information of the target operating system in the current adjustment period is determined, thereby adjusting the corresponding system configuration in a fine-grained manner so that the allocation of each resource meets the specified quota, and achieving local lightweight adjustment. BRIEF DESCRIPTION OF DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0056] Figure 1 is a flowchart of a multi-resource joint scheduling oriented operating system configuration tuning method disclosed by the embodiments of the present application;
[0057] Figure 2 is a branched DQN structure design disclosed by the embodiments of the present application;
[0058] Figure 3 is a two-dimensional feature dimension reduction diagram based on principal component analysis disclosed by the embodiments of the present application;
[0059] Figure 4 is an important parameter sorting diagram based on Latin hypercube sampling and random forest disclosed by the embodiments of the present application;
[0060] Figure 5 is a structural schematic view of an operating system configuration optimization device for multi-resource joint scheduling according to an embodiment of the present application;
[0061] Figure 6 is a structural schematic view of another operating system configuration optimization device for multi-resource joint scheduling according to an embodiment of the present application;
[0062] Figure 7 is a structural schematic view of still another operating system configuration optimization device for multi-resource joint scheduling according to an embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the personnel in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0064] The terms "first", "second", and the like in the specification of the present application and the above-described drawings are used to distinguish different objects, and are not used to describe a particular order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product, or end including a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed or can optionally include other steps or units inherent to the process, method, product, or end.
[0065] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily all refer to the same embodiment, nor is it necessarily mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0066] Embodiment One
[0067] Please refer to Figure 1 , Figure 1 is a structural schematic view of an operating system configuration optimization device for multi-resource joint scheduling according to an embodiment of the present application; Figure 1The described operation system configuration optimization method for multi-resource joint scheduling can be applied to an operation system configuration optimization device for multi-resource joint scheduling, which can be integrated in a cloud server or a local server, and the embodiments of the present application are not limited thereto. As shown in Figure 1 The operation system configuration optimization method for multi-resource joint scheduling can include the following operations:
[0068] In step 101, current system state information of the target operation system in a current adjustment period is acquired.
[0069] In the embodiments of the present application, the system state information includes index information for describing each kind of main system resource in the target operation system, and the system state information can reflect the running state of the operation system in an adjustment period, such as page fault, user touch screen frequency, etc.
[0070] In step 102, historical resource allocation information in a previous adjustment period corresponding to the current adjustment period is acquired.
[0071] In the embodiments of the present application, the resource allocation information includes control information for scheduling each kind of system resource in the target operation system, and the resource allocation information can reflect the resource configuration of the target operation system in an adjustment period, such as CPU usage rate, GPU usage rate, memory page swap ratio, and dirty page ratio, etc.
[0072] In step 103, according to the current system state information and the historical resource allocation information, the allocation target of each kind of system resource of the target operation system in the current adjustment period is determined.
[0073] For the operating system, due to the scarcity of resources, the complex association between the configuration and the configuration is often difficult to be fully excavated, and when multiple configurations are adjusted under the influence of different strategies, the user experience will be deteriorated due to the pressure transmission between resources. Taking memory and IO resources as examples, when the thread scheduling time of dirty page write-back is delayed (the value of dirty_ratio is increased) to avoid current IO competition, a large number of dirty pages will be accumulated at the tail of the Inactive File Lru chain table of the memory, and when kswapd tends to recover file pages (the value of swappiness is reduced), high IO delay will be caused due to immediate write-back of dirty pages, thereby significantly deteriorating the user experience. In addition, in the low power mode, due to the CPU frequency limiting, a significant delay is generated between the actual trigger IO D state time and the actual initiation IO time, which is often identified as an IO bottleneck problem by traditional algorithms, but in fact, the root cause is the CPU frequency. It can be seen that due to the scarcity of resources of the operating system corresponding to the device, the allocation of resources is often associated and influenced, and independent adjustment of a certain resource often cannot bring performance optimization. Therefore, a method for supporting joint scheduling of multiple resources is needed to solve the above problems.
[0074] In the embodiment of the present application, the allocation target is used to represent the degree of adjustment required for each system resource in the target operating system. In the embodiment of the present application, the allocation target of each system resource in the target operating system in the current adjustment period is determined according to the current system state information and the historical resource allocation information, instead of being limited to the analysis of a certain resource to make corresponding adjustment, thereby realizing joint scheduling of multiple resources.
[0075] In step 104, the target resource allocation information of the target operating system in the current adjustment period is determined according to the allocation target of each system resource in the target operating system in the current adjustment period.
[0076] If the allocation target of each system resource in the target operating system in the current adjustment period is determined according to the current system state information and the historical resource allocation information, the operation of the operating system is deconstructed from the system level, and then from the allocation target to the specific target resource allocation information, the operation of the operating system is deconstructed from the resource level. In the embodiment of the present application, the target resource allocation information is used to indicate the control scheme executed for each system resource in the target operating system. For example, for the CPU as a system resource, the allocation target is the specific usage rate of the CPU, and the corresponding target resource allocation information can be the frequency of the CPU large core, the temperature control threshold, etc. In step 104, for each system resource, the control scheme executed by each system resource can be determined to realize the optimization of local resource allocation.
[0077] The embodiment of the present application aims at the problems of resource correlation blind area, poor generalization and large overhead faced by the prior art, and proposes an innovative optimization framework. Through the design of a double-level architecture, a system parameter optimization method of resource perception and multi-resource joint scheduling is realized. Specifically, the influence of system parameters on user experience is deconstructed at the system level (System-Level) and the resource level (Resource-Level) respectively, and resource allocation targets (such as CPU usage, memory page swap ratio, etc.) are set in the entire system to meet the user experience indicators such as FPS and power consumption, while the relevant parameters are adjusted at each resource level (such as memory, IO, CPU, etc.) to make the local resource allocation meet the specified target. Therefore, the embodiment of the present application realizes global resource correlation perception and local lightweight adjustment.
[0078] That is, the embodiment of the present application supports multi-resource joint scheduling to realize global user experience optimization. Specifically, according to the current system state information and the historical resource allocation information, the allocation target of each system resource of the target operating system in the current adjustment period is determined, which provides a global view for the resource scheduling of the entire system, effectively identifies the correlation between resources and sets appropriate allocation indicators for a single resource. According to the allocation target of each system resource of the target operating system in the current adjustment period, the target resource allocation information of the target operating system in the current adjustment period is determined, so as to adjust the corresponding system configuration in a fine-grained manner to make the allocation of each resource meet the specified amount.
[0079] It should be particularly pointed out that the method in the embodiment of the present application is executed for the current adjustment period, and in actual operation, the above operation will be performed once in each adjustment period during the running of the operating system, and the adjustment result will be fed back to the next adjustment period. At the same time, the length of the adjustment period can also be set according to the specific use, so as to flexibly adjust the optimization frequency and realize the best optimization strategy.
[0080] In an optional embodiment, according to the current system state information and the historical resource allocation information, the allocation target of each system resource of the target operating system in the current adjustment period can include:
[0081] The current system state information and the historical resource allocation information are input into a pre-trained DQN neural network model, the DQN neural network model extracts a feature vector of each system resource, for each system resource, a reward exploration operation is performed according to the feature vector corresponding to the system resource to obtain the allocation parameter corresponding to the system resource, and the allocation target of each system resource of the target operating system in the current adjustment period is determined according to the allocation parameter corresponding to each system resource.
[0082] In the optional embodiment, the state space of the DQN neural network model is the current system state information, the action space of the DQN neural network model is the pre-stored allocation parameter of each system resource, and the reward function of the DQN neural network model is the gain of the user experience index, wherein the user experience index is used to measure the user experience satisfaction degree of the target operating system.
[0083] The optional embodiment is specifically illustrated as follows:
[0084] According to the current system state information and the historical resource allocation information, the allocation target of each system resource of the target operating system in the current adjustment period is determined, and the specific use of the allocation target is realized through a subsequent step, in which only the allocation target of each system resource is planned from the perspective of global optimization. For example, for CPU, GPU, memory and IO, four kinds of resources, we select CPU usage, GPU usage, memory page swap ratio and dirty page ratio as four kinds of system resources whose allocation targets need to be set.
[0085] At this time, the system-level optimization problem to be solved is defined as follows:
[0086]
[0087] Among them, the user experience index u(t) is a time sequence function related to system resource allocation, and the allocation target is to minimize the average of the difference between the actual user experience index u(t) and the predetermined standard user experience index in a certain time sequence range (from t=1 to t=T).
[0088] The problem P1 can be converted into a reinforcement learning problem to be solved, and the unique exploration-exploitation learning process can cleverly solve the unlabeled problem in system optimization, and has low runtime overhead. For the system-level optimization control to be solved, the state space can be understood as the state information of the current load of the entire system, the action space is the allocation target of each system resource, and the reward function is related to the actual user experience gain after the action. An action a can make the entire system change from the current state s to a new state s', and the probability p(s'|s, a) represents the possibility of this state transition. In reinforcement learning, the Q function is used to predict the possible reward r of this state transition to guide the selection of actions. Therefore, the key to the problem is to learn an optimal strategy Π* to automatically select the appropriate action a for each state s to maximize the expected reward of the entire decision-making process:
[0089]
[0090]
[0091] wherein, is the reward obtained at state s, and γ is the decay factor. In the actual parameter tuning scene, the state transition probability p(s'|s,a) is very difficult to obtain directly, so an optional way is to use the model-free reinforcement learning method DQN to simulate the Q function through the deep Q network, and to learn the best strategy end-to-end in the continuous interaction process.
[0092] It can be seen that in this optional embodiment, the allocation target of each system resource of the target operating system in the current adjustment period can be determined based on the DQN neural network model according to the current system state information and the historical resource allocation information.
[0093] In this optional embodiment, further optionally, the pre-stored allocation parameters in the action space of the DQN neural network model include a plurality of preset discrete values, wherein the positive and negative of each discrete value is used to represent the adjustment direction of the corresponding system resource, and the absolute value of each discrete value is used to represent the adjustment degree of the corresponding system resource.
[0094] In this optional embodiment, a branched DQN structure design is specifically disclosed to reduce the dimension of the action space of the task. Since DQN does not support continuous action output, the action space of the model needs to be discretized. Taking four resources (CPU, GPU, memory, and IO) as an example, the allocation target of each resource is divided into 10 discrete values, and the output action dimension is . Such a huge output dimension will lead to unpredictable training overhead and the risk of model divergence. Therefore, as shown in Figure 2 , the present patent separates the reward exploration of each type of resource after unified feature extraction based on a branched DQN structure design, so as to explore the action space from parallel feature extraction rather than increasing the output dimension. This method can reduce the output dimension from to , wherein M is the total number of resource types, is the total number of allocation targets of the i-th type of resource.
[0095] Assuming that there are ten choices for the usage rate of each of the four types of resources, if there is only one prediction head for output, there are actually 10*10*10*10=10 4 combinations; Figure 2 The benefit of this design is that it has a prediction head for each type of resource, and the output dimension of each head is 10, so the total of the four heads is 10+10+10+10=40, which is equivalent to changing the cumulative to cumulative. Figure 2The input in the figure is the system state state, and the output is the usage rate of each resource, that is, action. The ladder represents a fully connected layer, and the Feature block represents the feature vector output after the neural network layer. The difference from the traditional DQN is that it is equivalent to a head with multiple outputs, corresponding to the probabilities of different resources (CPU, GPU, etc.) and various actions, and then the one with the maximum probability is taken as the action.
[0096] Further, in order to avoid the sudden increase or decrease of resource allocation, the pre-stored allocation parameters in the action space of the DQN neural network model can be set to several preset discrete values, wherein the positive and negative of each discrete value is used to represent the adjustment direction of the corresponding system resource, and the absolute value of each discrete value is used to represent the adjustment degree of the corresponding system resource. For example, the action output of each step is further simplified to the change direction of resource allocation instead of the specific value. For example, the allocation target of each resource can be reduced to three dimensions of (-10%, 0, +10%). For the above tuning case, the dimension of the action space is reduced to 12, greatly reducing the training overhead of the model and improving the feasibility of the optional embodiment.
[0097] In yet another optional embodiment, according to the allocation target of each system resource of the target operating system in the current adjustment period, the target resource allocation information of the target operating system in the current adjustment period can be determined, which can include:
[0098] For each system resource, according to the allocation target of the system resource, determine a plurality of key parameters corresponding to the system resource, and determine the adjustable range of each key parameter, wherein the key parameter is used to represent the main influencing factor corresponding to the corresponding system resource;
[0099] For each system resource, determine the allocation state corresponding to the system resource according to all key parameters corresponding to the system resource, wherein there is a preset time sequence relationship between the allocation state and the key parameter;
[0100] For each system resource, perform a corresponding key parameter adjustment operation, and when the absolute value of the difference between the allocation state adjustment value of the system resource in the current adjustment period and the allocation target of the system resource is the smallest, obtain all key parameters at this time as all target key parameters corresponding to the system resource;
[0101] According to all target key parameters corresponding to all system resources, determine the target resource allocation information of the target operating system in the current adjustment period.
[0102] In the optional embodiment, for each type of system resource, the configuration of related parameters needs to be completed to realize the optimization of local resource allocation. For example, for CPU resources, the calculated CPU usage rate is issued as a resource allocation target, and then adjustment control is performed based on the target. The target key parameters for adjustment include CPU core frequency, temperature control threshold, etc.
[0103] According to the allocation target of each type of system resource of the target operating system in the current adjustment period, the target resource allocation information of the target operating system in the current adjustment period is determined. The resource-level optimization problem to be solved is defined as follows:
[0104]
[0105]
[0106] Among them, there is a preset time sequence relationship between the allocation state r and the key parameter p. The optimization target is to minimize the average of the difference between the actual resource allocation state r(t) and the resource allocation target in the current adjustment period (from t=1 to t=T), that is, the absolute value of the difference between the allocation state adjustment value corresponding to the system resource in the current adjustment period and the allocation target corresponding to the system resource is minimized. The limited range ensures that the adjustment of any key parameter p i is within the allowed range.
[0107] As can be seen, by adjusting the key parameters, when the absolute value of the difference between the allocation state adjustment value corresponding to the system resource in the current adjustment period and the allocation target corresponding to the system resource is minimized, all the key parameters at this time are obtained as all the target key parameters corresponding to the system resource. Finally, the target resource allocation information of the target operating system in the current adjustment period is determined, which can achieve the allocation target to the greatest extent.
[0108] In yet another optional embodiment, problem P2 can also be solved using the paradigm of reinforcement learning, but considering the complexity of the entire problem and the system runtime overhead, the embodiment of the present application proposes a relatively simple optimization method to realize lightweight local resource control:
[0109] For each type of system resource, perform the corresponding key parameter adjustment operation, when the absolute value of the difference between the allocation state adjustment value corresponding to the system resource in the current adjustment period and the allocation target corresponding to the system resource is minimized, all the key parameters at this time are obtained as all the target key parameters corresponding to the system resource, which can include:
[0110] determining whether the time length of the current adjustment period is greater than the preset period threshold; if it is determined that the time length of the current adjustment period is greater than the preset period threshold, then:
[0111] For each system resource, input the allocation target and the allocation state of the system resource into the pre-trained decision tree model, obtain an initial key parameter adjustment set output by the decision tree model, and the initial key parameter adjustment set includes a value sub-set of each key parameter;
[0112] For each system resource, all target key parameters are selected from the initial key parameter adjustment set corresponding to the system resource, and the target key parameter can satisfy that the absolute value of the difference between the allocation state adjustment value of the system resource in the current adjustment period and the allocation target of the system resource is the smallest.
[0113] In the optional embodiment, since part of the parameters in the system have a relatively intuitive resource allocation influence, for example, the size of swappiness determines the aggressiveness of the kswapd thread in recycling anonymous pages, therefore, the triplets As a data set, s and r respectively represent the system state information, the actual resource allocation state (such as the memory page swap ratio) and the key parameter (such as swappiness) at a certain time t. The decision tree is trained with s and r as data and p as a label, and the resource allocation target is planned Then the allocation state is input into the decision tree, and the appropriate target key parameter is inferred. In order to facilitate the training of the decision tree, the value of p can be discretized in the sampling stage, and representative p values are selected for testing.
[0114] It can be seen that the optional embodiment proposes a relatively simple optimization method based on the decision tree model to realize the lightweight local resource control.
[0115] In yet another optional embodiment, for problem P2, another relatively simple optimization method can also be proposed to realize the lightweight local resource control:
[0116] For each system resource, the corresponding key parameter adjustment operation is performed, when the absolute value of the difference between the allocation state adjustment value of the system resource in the current adjustment period and the allocation target of the system resource is the smallest, all key parameters at this time are obtained as all target key parameters corresponding to the system resource, which can include:
[0117] determining whether the time length of the current adjustment period is greater than the preset period threshold; if it is determined that the time length of the current adjustment period is greater than the preset period threshold, then:
[0118] For each key parameter corresponding to each system resource, the corresponding key parameter adjustment operation is performed by the following formula:
[0119]
[0120] wherein, is the key parameter value in the current adjustment period, is the key parameter value in the last period of the current adjustment period, is the difference between the historical allocation state and the historical allocation target of the system resource in the current adjustment period, is an adjustable reaction hyperparameter, which determines how aggressive the reaction to the current error is, is a regression parameter;
[0121] wherein, the regression parameter is determined according to the following operation:
[0122] The historical allocation state and the historical key parameter value of the system resource in multiple historical adjustment periods are obtained, and the regression parameter is determined according to the following formula:
[0123]
[0124] wherein, is the historical allocation state of the system resource in the adjustment period T, is the historical key parameter of the system resource in the last adjustment period T-1 of the adjustment period T;
[0125] For each system resource, by performing the above key parameter adjustment operation, when the absolute value of the difference between the allocation state adjustment value corresponding to the system resource in the current adjustment period and the allocation target corresponding to the system resource is the smallest, all the key parameters at this time are obtained as all the target key parameters corresponding to the system resource.
[0126] It is found in practice that the optional embodiment is simple and reliable, and has strong robustness in actual deployment environment and only consumes very low runtime overhead.
[0127] It should be particularly noted that, since the local resource control and the global system optimization are decoupled, the optimization models or methods of single resources are independent of each other, so the corresponding configuration adjustment method and adjustment frequency can be selected according to the actual application scenario, thereby maximizing the efficiency of the configuration tuning method in the embodiment of the application; at the same time, good scalability is a big advantage of the two-level architecture design in the embodiment of the application in actual deployment process.
[0128] In yet another optional embodiment, before acquiring the current system state information of the target operating system in the current adjustment period, the method further comprises:
[0129] The application load of the target operating system is fixed, the configuration parameter corresponding to the target operating system is adjusted, and the index sample of the system resource in the configuration parameter adjustment process is acquired; the coordinate reconstruction is performed based on the principal component analysis method, and the index of the main system resource is obtained from the index sample of the system resource;
[0130] The configuration parameter corresponding to the target operating system is fixed, the application load of the target operating system is adjusted, and the influence factor sample of the system resource in the application load adjustment process is acquired; the coordinate reconstruction is performed based on the principal component analysis method, and the main influence factor is obtained from the influence factor sample of the system resource.
[0131] In the prior art, the application load is very complex and variable, and the existing method is difficult to sample and train all load scenarios during model training. Therefore, the data during training and the data during actual deployment often present a non-independent and identically distributed characteristic, which leads to the generalization problem of the model. In the actual scene, the generalization problem mainly comes from two aspects. First, the QoE label of the application, different applications focus on different key QoE indicators (user experience quality indicators), for example, the FPS (frames per second) of the application is more concerned in the game scene, and the task execution delay is more concerned in the speech recognition scene. Therefore, the traditional end-to-end model training method will completely fail when the QoE of the application switches and needs to be retrained. Second, the data characteristics of the application itself, for example, the model trained for the short video scene of Kuaishou is difficult to generalize to the long video scene of Tencent Video.
[0132] In the embodiment of the application, the effective operation of the tuning method requires two key prerequisites, namely, reasonable selection of the index of the system resource and the influence factor of the system resource, which determine the selection of the respective characteristic values corresponding to the system state information and the key parameters. There are a large number of characteristic indicators and configuration parameters in the operating system, and the optional embodiment proposes an efficient key feature selection method to complete the selection of the features and the parameters offline.
[0133] The determination of the allocation target and the determination of the key parameters should meet different concerns, the former pays more attention to the change of the load scene, and the latter pays more attention to the change of the configuration state. Therefore, as Figure 3As shown, for feature selection of allocation targets, we perform dimensionality reduction at the workload-level, fix the application load, modify the configuration parameters and obtain sample samples, reconstruct the coordinates based on the principal component analysis method, and obtain the key features. For feature selection of key parameters, we perform dimensionality reduction at the workflow-level, fix the configuration parameters, transform the application load to obtain samples, and obtain the key features based on PCA.
[0134] In this optional embodiment, further optionally, the important parameter sorting operation based on Latin hypercube sampling and random forest can also be performed for the features of the key parameters:
[0135] Corresponding to the selection of key parameters, in order to determine which parameters have a high priority in local resource optimization control, the embodiment of the present application proposes a parameter sorting method with interpretability. As shown in Figure 4 As shown, first, the configuration selection is performed by Latin hypercube sampling and the system resource allocation is observed. This sampling method belongs to memory sampling, which can use fewer samples to reconstruct the probability distribution and improve the sampling efficiency. Subsequently, a random forest is constructed based on the (configuration i ,resource i ) dataset obtained by sampling to model the resource properties of the configuration. This model can better capture the non-linear relationship and parameter correlation, and has interpretability, which can sort the importance of the configuration parameters based on the constructed model. Finally, the first n important parameters are taken as control parameters for resource allocation optimization.
[0136] Embodiment two
[0137] To solve the problems of resource correlation blind area, poor generalization and large overhead when migrating to mobile terminal, the embodiment of the application proposes an innovative mobile terminal configuration optimization framework (Octopus). Octopus realizes the system parameter optimization method of resource perception and multi-resource joint scheduling through the design of a double-level architecture. Specifically, Octopus decomposes the influence of system parameters on user experience at the system level (System-Level) and the resource level (Resource-Level), sets resource allocation targets (such as CPU usage, memory page swap ratio, etc.) in the entire system range through a reinforcement learning-based controller to meet FPS, power consumption and other user experience indicators, and adjusts related parameters based on heuristic strategies or decision trees and other lightweight models at each resource level (such as memory, IO, CPU, etc.) to make local resource allocation meet the specified target. Therefore, Octopus realizes global resource correlation perception and local lightweight adjustment. In addition, Octopus supports offline feature selection and parameter ordering to adapt to different application scenarios and provide a basis for system configuration optimization.
[0138] Based on detailed research and testing of configuration parameters in the system, the embodiment of the application finds that the change from configuration adjustment to user experience is a two-stage process, that is, the configuration parameters further affect the user's use experience by directly or indirectly affecting the allocation of system resources. Due to the resource scarcity of mobile devices, the allocation of resources often correlates and affects each other, and independent adjustment of a certain resource often cannot bring performance optimization. The embodiment of the application designs a system configuration optimization framework Octopus supporting multi-resource joint scheduling, which supports global resource correlation perception and local lightweight adjustment, and the allocation target of a specific resource is the key bridge connecting system-level optimization control and resource-level optimization control.
[0139] Specifically, the system-level controller Brain obtains the system state at the current time and plans the allocation target (CPU usage, GPU usage, memory page swap ratio and dirty page ratio) of each type of resource based on the reinforcement learning model trained in the offline stage (every 1 minute) and assigns the allocation target to the corresponding resource Tentacle. Each Tentacle is independently managed by a different thread. After receiving the resource target, Tentacle calls the local heuristic strategy or lightweight machine learning model for configuration adjustment, and feeds back the adjusted local average resource index at the tail of the time window to Brain and requests the resource quota in the next time window.
[0140] Among them, the training and reasoning process of Brain is divided into two stages:
[0141] The first stage is imitation
[0142] Embodiments of the present application note that there are many heuristic resource allocation strategies in the existing mobile device, including kernel native strategies and Framework layer manufacturer customized strategies. These strategies come from years of expert tuning experience and can generally complete resource allocation well. In order to accelerate the model training process and gain experience from expert knowledge, embodiments of the present application learn expert strategies from system behavior data based on the idea of imitation learning, that is, pre-training the model using labeled data pairs (s t , a t ), where s t is the system state at a certain time (contains key system indicators such as pagefault, user touch frequency, etc., and the determination method of key features will be introduced in the feature selection chapter), and a t is the resource allocation target adopted by the mobile operating system under this state.
[0143] Second stage: improvement
[0144] The model has obtained certain expert prior knowledge in imitation learning, but since the heuristic strategies in the system are isolated from each other and cover fewer scenarios, the model needs to further interact with the environment to learn a better strategy and a global view of resource relevance perception. In the second stage of training, the model performs exploration and exploitation through the ε-greedy algorithm, that is, randomly selecting an unknown action with a probability of ε, and selecting the action with the maximum known value with a probability of 1-ε. It is worth noting that the action output of the model is the allocation target of each type of resource, and the specific execution of the action is completed by the Tentacles agent. Therefore, in addition to the key system indicators, the observation state of the second stage model should also include the actual resource allocation feedback by the Tentacle. In addition, the design of the reward function uses a piecewise function, which minimizes resource allocation to reduce resource occupation under the condition of meeting the pre-defined user experience indicators, and adjusts to minimize the absolute value of the difference between the actual indicators and the preset indicators under the condition of not meeting the pre-defined user experience indicators.
[0145] The runtime inference process of Brain is as follows:
[0146] A time window (e.g., 1 minute) is defined, and at the beginning of each time window, Brain plans the allocation targets for each resource based on the current system state (i.e., key system indicators for each type of resource) and the actual allocation of each resource in the previous time window. After the calculation is completed, the targets are issued to the Tentacle of the corresponding resource to complete the adjustment. At the end of the time window, Brain receives the resource allocation feedback from Tentacle and completes the next round of calculation. The size of the time window is a key hyperparameter of the method, and a smaller window setting can bring more fine-grained optimization effect, but at the same time, it will increase the optimization overhead.
[0147] Octopus uses Binder of Android as the communication backend. Among them, Brain obtains the current system state and plans the allocation targets (CPU usage, GPU usage, memory page swap ratio, and dirty page ratio) of each type of resource based on the reinforcement learning model trained offline at regular intervals (every 1 minute) and distributes the allocation targets to the Tentacle of the corresponding resource. Each Tentacle is independently managed by a different thread. After receiving the resource target, Tentacle calls the local heuristic strategy or lightweight machine learning model for configuration adjustment, and feeds back the adjusted local average resource indicators to Brain at the end of the time window and requests the resource quota in the next time window. The collection of indicators is realized through the octopus_monitor kernel module, and the reading of indicators and parameter updating are completed through the procfs virtual file system. Feature selection and parameter sorting are completed in the offline stage, and the target application and target scene are tested by using stressapptest, and the important parameters and key feature indicators of different resources are obtained by using simpleperf and octopus_monitor kernel module for data collection.
[0148] Taking the user experience optimization of a certain brand of mobile phone as an example, it is assumed that the mobile phone uses the CPU model of Snapdragon 8Gen3, which contains 2 high-frequency A720 cores and 3 low-frequency A720 cores, as well as 1 X4 big core and 2 A520 small cores, supporting individual core frequency adjustment and temperature threshold setting. The GPU renderer uses Adreno 750, which supports dynamic frequency adjustment. In addition, the memory of the device is 12GB, and the Android version is 15. The specific implementation steps are as follows:
[0149] Key feature selection: In the preparation stage, key features are extracted at the workload-level and workflow-level based on principal component analysis method.
[0150] Important parameter ranking: in the preparation phase, a resource allocation prediction model is built based on Latin hypercube sampling and random forest, and the top n important parameters are selected as the local resource optimization control parameters.
[0151] System architecture design: based on the screened features and parameters, the Brain-Tentacle framework is built, the resource types for joint scheduling and the corresponding resource allocation targets are determined, and the local resource control method suitable for each Tentacle is selected.
[0152] Model training and deployment: in the warm-up phase, ensure that the local resource control of Tentacle is effective; in the first stage, collect the resource allocation data in the system as expert experience to pre-train the Brain model; in the second stage, update the Brain model using the exploration-exploitation paradigm of reinforcement learning, and the specific action output is completed by the Tentacle agent.
[0153] Dynamic configuration optimization: after the deployment of the Brain-Tentacle architecture, as the application load changes continuously, the Brain can identify the bottleneck of system resources and plan the allocation target of each type of resource at the beginning of each time window. Tentacle completes resource allocation based on local resource controller after receiving the target, and feeds back the actual allocation effect at the end of the time window.
[0154] Method overhead optimization: in order to avoid the kernel-user space copy overhead of a large amount of system data, the Tentacle can be set as a kernel module, and the parameter adjustment can be completed based on the kernel strategy or a light kernel machine learning model.
[0155] Embodiment three
[0156] Please refer to Figure 5 , Figure 5 is a structural schematic diagram of an operating system configuration optimization device for multi-resource joint scheduling disclosed by the embodiments of the present application. As shown in Figure 5 , the operating system configuration optimization device for multi-resource joint scheduling can include:
[0157] The first acquisition module 201 is configured to acquire current system state information of the target operating system in the current adjustment period, wherein the system state information can include index information for describing each main system resource in the target operating system;
[0158] The second acquisition module 202 is configured to acquire historical resource allocation information in the previous adjustment period corresponding to the current adjustment period, wherein the resource allocation information can include control information for scheduling each system resource in the target operating system;
[0159] The global adjustment module 203 is configured to determine, according to the current system state information and the historical resource allocation information, an allocation target of each system resource of the target operating system in a current adjustment period, wherein the allocation target is used to represent a degree of adjustment of each system resource of the target operating system.
[0160] The local adjustment module 204 is configured to determine, according to the allocation target of each system resource of the target operating system in the current adjustment period, target resource allocation information of the target operating system in the current adjustment period, wherein the target resource allocation information is used to indicate a control scheme performed on each system resource of the target operating system.
[0161] The embodiment of the present application supports multi-resource joint scheduling to realize global user experience optimization. Specifically, according to the current system state information and the historical resource allocation information, the allocation target of each system resource of the target operating system in the current adjustment period is determined, which provides a global view for the resource scheduling of the entire system, effectively identifies the correlation between resources and sets appropriate allocation indicators for a single resource. According to the allocation target of each system resource of the target operating system in the current adjustment period, the target resource allocation information of the target operating system in the current adjustment period is determined, so as to adjust the corresponding system configuration in a fine-grained manner to make the allocation of each resource meet the specified amount.
[0162] In an optional embodiment, the specific manner in which the global adjustment module 203 determines the allocation target of each system resource of the target operating system in the current adjustment period according to the current system state information and the historical resource allocation information can include:
[0163] The current system state information and the historical resource allocation information are input into a pre-trained DQN neural network model, the DQN neural network model extracts a feature vector of each system resource, for each system resource, performs a reward exploration operation according to the feature vector corresponding to the system resource to obtain an allocation parameter corresponding to the system resource, and determines the allocation target of each system resource of the target operating system in the current adjustment period according to the allocation parameter corresponding to each system resource.
[0164] The state space of the DQN neural network model is the current system state information, the action space of the DQN neural network model is the pre-stored allocation parameter of each system resource, and the reward function of the DQN neural network model is the gain of the user experience index, wherein the user experience index is used to measure the user experience satisfaction degree of the target operating system.
[0165] It can be seen that, in this optional embodiment, the DQN neural network model can be used to determine the allocation target of each system resource of the target operating system in the current adjustment period according to the current system state information and the historical resource allocation information.
[0166] In yet another optional embodiment, the pre-stored allocation parameters in the action space of the DQN neural network model can include a plurality of preset discrete values, wherein each discrete value indicates the adjustment direction of the corresponding system resource, and the absolute value of each discrete value indicates the adjustment degree of the corresponding system resource.
[0167] In yet another optional embodiment, the specific manner in which the local adjustment module 204 determines the target resource allocation information of the target operating system in the current adjustment period according to the allocation target of each system resource of the target operating system in the current adjustment period can include:
[0168] For each system resource, a plurality of key parameters corresponding to the system resource are determined according to the allocation target of the system resource, and an adjustable range of each key parameter is determined, wherein the key parameters indicate the main influencing factors corresponding to the system resource.
[0169] For each system resource, the allocation state corresponding to the system resource is determined according to all the key parameters corresponding to the system resource, wherein a preset time sequence relationship exists between the allocation state and the key parameters.
[0170] For each system resource, the corresponding key parameter adjustment operation is performed, and when the absolute value of the difference between the allocation state adjustment value of the system resource in the current adjustment period and the allocation target of the system resource is the smallest, all the key parameters at this time are obtained as all the target key parameters corresponding to the system resource.
[0171] The target resource allocation information of the target operating system in the current adjustment period is determined according to all the target key parameters corresponding to all the system resources.
[0172] It can be seen that, in this optional embodiment, the key parameters are adjusted, when the absolute value of the difference between the allocation state adjustment value of the system resource in the current adjustment period and the allocation target of the system resource is the smallest, all the key parameters at this time are obtained as all the target key parameters corresponding to the system resource, and finally the target resource allocation information of the target operating system in the current adjustment period is determined, which can achieve the allocation target to the greatest extent.
[0173] In yet another optional embodiment, the specific manner in which the local adjustment module 204 performs the corresponding key parameter adjustment operation for each system resource, when the absolute value of the difference between the allocation state adjustment value of the system resource in the current adjustment period and the allocation target of the system resource is the smallest, all the key parameters at this time are obtained as all the target key parameters corresponding to the system resource can include:
[0174] determining whether the time length of the current adjustment period is greater than a preset period threshold; if it is determined that the time length of the current adjustment period is greater than the preset period threshold, then:
[0175] For each system resource, input the allocation target and the allocation state of the system resource into the pre-trained decision tree model, obtain an initial key parameter adjustment set output by the decision tree model, and the initial key parameter adjustment set can include a value sub-set of each key parameter;
[0176] For each system resource, from the initial key parameter adjustment set corresponding to the system resource, all target key parameters are selected, wherein the target key parameter can satisfy: the absolute value of the difference between the allocation state adjustment value of the system resource in the current adjustment period and the allocation target of the system resource is the smallest.
[0177] It can be seen that the optional embodiment proposes a relatively simple optimization method based on the decision tree model to realize the lightweight local resource control.
[0178] In yet another optional embodiment, the local adjustment module 204 performs a corresponding key parameter adjustment operation for each system resource, and when the absolute value of the difference between the allocation state adjustment value of the system resource in the current adjustment period and the allocation target of the system resource is the smallest, the specific way of obtaining all key parameters at this time as all target key parameters corresponding to the system resource can include:
[0179] determining whether the time length of the current adjustment period is greater than a preset period threshold; if it is determined that the time length of the current adjustment period is less than or equal to the preset period threshold, then:
[0180] For each key parameter corresponding to each system resource, a corresponding key parameter adjustment operation is performed through the following formula:
[0181]
[0182] wherein, is the value of the key parameter in the current adjustment period, is the value of the key parameter in the last period of the current adjustment period, is the difference between the historical allocation state and the historical allocation target of the system resource in the current adjustment period, is an adjustable reaction hyperparameter, is a regression parameter;
[0183] wherein the regression parameter is determined according to the following operation:
[0184] The historical allocation state and historical key parameter value of the system resource in a plurality of historical adjustment periods are acquired, and the regression parameter is determined according to the following formula :
[0185]
[0186] wherein, is the historical allocation state of the system resource in the adjustment period T, is the historical key parameter of the system resource in the last adjustment period T-1 of the adjustment period T;
[0187] For each system resource, when the absolute value of the difference between the allocation state adjustment value of the system resource in the current adjustment period and the allocation target of the system resource is the smallest, the all key parameters at this time are acquired as all target key parameters of the system resource by performing the key parameter adjustment operation.
[0188] It is found in practice that the optional embodiment is simple and reliable, has strong robustness in actual deployment environment, and only consumes very low runtime overhead.
[0189] In yet another optional embodiment, as shown in Figure 6 , the apparatus can further include:
[0190] The feature selection module 205 is configured to fix the application load of the target operating system unchanged, adjust the configuration parameters corresponding to the target operating system, and acquire index samples of system resources in the configuration parameter adjustment process before acquiring the current system state information of the target operating system in the current adjustment period; and the principal component analysis-based device performs coordinate reconstruction to obtain the index of the main system resource from the index samples of the system resources.
[0191] The feature selection module 205 is further configured to fix the configuration parameters corresponding to the target operating system unchanged, adjust the application load of the target operating system, and acquire influence factor samples of system resources in the application load adjustment process; and the principal component analysis-based device performs coordinate reconstruction to obtain the main influence factor from the influence factor samples of the system resources.
[0192] Embodiment Four
[0193] Please refer to Figure 7 , Figure 7 is another structure diagram of an operating system configuration tuning device for multi-resource joint scheduling disclosed by the embodiments of the present application. As shown in Figure 7 , the operating system configuration tuning device for multi-resource joint scheduling can include:
[0194] The memory 301 stores executable program codes;
[0195] a processor 302 coupled to the memory 301;
[0196] The processor 302 invokes the executable program code stored in the memory 301 to perform the steps in the operating system configuration tuning method for multi-resource joint scheduling described in embodiment one.
[0197] Embodiment five
[0198] The embodiment of the present application discloses a computer storage medium, which stores computer instructions, and the computer instructions are used to perform the steps in the operating system configuration tuning method for multi-resource joint scheduling described in embodiment one when invoked.
[0199] Embodiment six
[0200] The embodiment of the present application discloses a computer program product, which comprises a non-transitory computer readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform the steps in the operating system configuration tuning method for multi-resource joint scheduling described in embodiment one.
[0201] The above described device embodiments are only schematic, wherein the modules described as separate components can or can not be physically separate, and the components shown as modules can or can not be physical modules, i.e., can be located in one place, or can be distributed on multiple network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment scheme. Those skilled in the art can understand and implement without creative labor.
[0202] Those skilled in the art can clearly understand the implementation of the various embodiments by means of software and necessary general hardware platforms through the above specific description of the embodiments, and of course, the embodiments can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in other words, the part of the prior art that makes a contribution, can be embodied in the form of a software product. The computer software product can be stored in a computer readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, a magnetic disk storage, a magnetic tape storage, or any other computer readable medium that can be used to carry or store data.
[0203] Finally, it should be noted that: the operating system configuration optimization method and device for multi-resource joint scheduling disclosed by the embodiments of the present application are only the preferred embodiments of the present application, and are used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An operating system configuration optimization method for multi-resource joint scheduling, characterized in that, The method includes: Obtain the current system status information of the target operating system in the current adjustment cycle, wherein the system status information includes indicator information for describing each major system resource in the target operating system; Obtain historical resource allocation information from the previous adjustment period corresponding to the current adjustment period, wherein the resource allocation information includes control information for scheduling each type of system resource in the target operating system; Based on the current system status information and the historical resource allocation information, the allocation target of each system resource in the target operating system during the current adjustment cycle is determined, wherein the allocation target is used to indicate the degree to which each system resource in the target operating system needs to be adjusted; For each type of system resource, based on the allocation target of the system resource, several key parameters corresponding to the system resource are determined, and the adjustable range of each key parameter is determined, wherein the key parameters are used to represent the main influencing factors corresponding to the system resource. For each type of system resource, the allocation status of the system resource is determined based on all the key parameters corresponding to the system resource, wherein there is a preset timing relationship between the allocation status and the key parameters; Determine if the current adjustment period's duration is greater than a preset period threshold; if the current adjustment period's duration is less than or equal to the preset period threshold, then: For each key parameter corresponding to each type of system resource, the corresponding key parameter adjustment operation is performed using the following formula: in, To determine the values of key parameters in the current adjustment cycle, The values of key parameters in the previous cycle of the current adjustment cycle are taken. This represents the difference between the historical allocation status and the historical allocation target of the system resources in the current adjustment cycle. For adjustable reaction hyperparameters, As regression parameters, when the absolute value of the difference between the allocation status adjustment value corresponding to the system resource and the allocation target corresponding to the system resource is minimized within the current adjustment period, all key parameters at this time are obtained as all target key parameters corresponding to the system resource. The target resource allocation information of the target operating system in the current adjustment cycle is determined based on all the target key parameters corresponding to all the system resources. The target resource allocation information is used to indicate the control scheme to be executed for each system resource in the target operating system.
2. The operating system configuration optimization method for multi-resource joint scheduling according to claim 1, characterized in that, The step of determining the allocation target of each type of system resource for the target operating system in the current adjustment cycle based on the current system status information and the historical resource allocation information includes: The current system state information and the historical resource allocation information are input into a pre-trained DQN neural network model. The DQN neural network model extracts the feature vector of each system resource. For each system resource, a reward exploration operation is performed based on the feature vector corresponding to the system resource to obtain the allocation parameters corresponding to the system resource. Based on the allocation parameters corresponding to each system resource, the allocation target of each system resource of the target operating system in the current adjustment cycle is determined. Wherein, the state space of the DQN neural network model is the current system state information, the action space of the DQN neural network model is the pre-stored allocation parameters of each system resource, and the reward function of the DQN neural network model is the gain of the user experience index, wherein the user experience index is used to measure the user experience satisfaction of the target operating system.
3. The operating system configuration optimization method for multi-resource joint scheduling according to claim 2, characterized in that, The pre-stored allocation parameters in the action space of the DQN neural network model include several preset discrete values, wherein the sign of each discrete value is used to indicate the adjustment direction of the corresponding system resource, and the absolute value of each discrete value is used to indicate the adjustment degree of the corresponding system resource.
4. The operating system configuration optimization method for multi-resource joint scheduling according to claim 1, characterized in that, For each type of system resource, a corresponding key parameter adjustment operation is performed. When the absolute value of the difference between the allocation status adjustment value and the allocation target of the system resource within the current adjustment period is minimized, all key parameters at this time are obtained as all target key parameters of the system resource, including: Determine if the current adjustment period's duration is greater than a preset period threshold; if it is determined that the current adjustment period's duration is greater than the preset period threshold, then: For each of the system resources, the allocation target and allocation state of the system resource are input into a pre-trained decision tree model to obtain an initial key parameter adjustment set output by the decision tree model. The initial key parameter adjustment set includes a subset of possible values for each key parameter. For each type of system resource, all target key parameters are selected from the initial key parameter adjustment set corresponding to the system resource, wherein the target key parameters can satisfy the following: the absolute value of the difference between the allocation status adjustment value corresponding to the system resource and the allocation target corresponding to the system resource is minimized within the current adjustment period.
5. The operating system configuration optimization method for multi-resource joint scheduling according to claim 1, characterized in that, The regression parameters Determined according to the following formula: Obtain the historical allocation status and key parameter values of the system resources across multiple historical adjustment periods, and determine the regression parameters according to the following formula. : in, This represents the historical allocation status of the system resources within the adjustment period T. These are the historical key parameters of the system resources within the previous adjustment period T-1 of the adjustment period T.
6. The operating system configuration optimization method for multi-resource joint scheduling according to claim 1, characterized in that, Before obtaining the current system state information of the target operating system in the current adjustment cycle, the method further includes: With the application load of the target operating system remaining constant, the configuration parameters corresponding to the target operating system are adjusted, and a sample of system resource indicators is obtained during the adjustment of the configuration parameters. Coordinate reconstruction is performed based on principal component analysis, and the indicators of the main system resources are obtained from the sample of system resource indicators. With the configuration parameters corresponding to the target operating system unchanged, the application load of the target operating system is adjusted, and a sample of the influence factors of system resources during the application load adjustment process is obtained; coordinate reconstruction is performed based on the principal component analysis method, and the main influence factors are obtained from the sample of influence factors of system resources.
7. An operating system configuration optimization device for multi-resource joint scheduling, characterized in that, The device includes: The first acquisition module is used to acquire the current system status information of the target operating system in the current adjustment cycle, wherein the system status information includes indicator information for describing each major system resource in the target operating system; The second acquisition module is used to acquire historical resource allocation information in the previous adjustment period corresponding to the current adjustment period, wherein the resource allocation information includes control information for scheduling each type of system resource in the target operating system; A global adjustment module is used to determine the allocation target of each system resource of the target operating system in the current adjustment cycle based on the current system status information and the historical resource allocation information, wherein the allocation target is used to indicate the degree to which each system resource in the target operating system needs to be adjusted; The local adjustment module is used to perform the following operations: For each type of system resource, based on the allocation target of the system resource, several key parameters corresponding to the system resource are determined, and the adjustable range of each key parameter is determined, wherein the key parameters are used to represent the main influencing factors corresponding to the system resource. For each type of system resource, the allocation status of the system resource is determined based on all the key parameters corresponding to the system resource, wherein there is a preset timing relationship between the allocation status and the key parameters; Determine if the current adjustment period's duration is greater than a preset period threshold; if the current adjustment period's duration is less than or equal to the preset period threshold, then: For each key parameter corresponding to each type of system resource, the corresponding key parameter adjustment operation is performed using the following formula: in, To determine the values of key parameters in the current adjustment cycle, The values of key parameters in the previous cycle of the current adjustment cycle are taken. This represents the difference between the historical allocation status and the historical allocation target of the system resources in the current adjustment cycle. For adjustable reaction hyperparameters, As regression parameters, when the absolute value of the difference between the allocation status adjustment value corresponding to the system resource and the allocation target corresponding to the system resource is minimized within the current adjustment period, all key parameters at this time are obtained as all target key parameters corresponding to the system resource. The target resource allocation information of the target operating system in the current adjustment cycle is determined based on all the target key parameters corresponding to all the system resources. The target resource allocation information is used to indicate the control scheme to be executed for each system resource in the target operating system.
8. An operating system configuration optimization device for multi-resource joint scheduling, characterized in that, The apparatus includes: a memory storing executable program code; a processor coupled to the memory; the processor calling the executable program code stored in the memory to execute the operating system configuration tuning method for multi-resource joint scheduling as described in any one of claims 1-6.
9. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, which, when invoked by a processor, cause the processor to execute the operating system configuration tuning method for multi-resource joint scheduling as described in any one of claims 1-6.
Citation Information
Patent Citations
Resource dynamic adjustment method and device and multi-core operating system
CN104714845A
Resource scheduling method and device
CN115756852A