Resource management method and system for server operating system

Through dual-layer graph modeling and graph neural network feature extraction, combined with multi-layer perceptron and reinforcement learning, an adaptive strategy for server operating system resource management is realized, resource competition and deadlock problems are solved, and system performance and stability are improved.

CN119621359BActive Publication Date: 2025-04-22NOON TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510170822.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-17
Publication Date
2025-04-22
Estimated Expiration
2045-02-17

AI Technical Summary

Technical Problem

Existing server operating systems face complex resource competition relationships, deadlock problems, and difficulty in preventing and detecting resource allocation strategies. The lack of adaptability of resource allocation strategies, resulting in low resource utilization and degradation of system performance.

Method used

By performing two-layer graph modeling of process and resource data in the server operating system, node feature vectors are extracted using graph neural network, deadlock probability is calculated through multi-layer perceptrons, resource allocation strategy learning is carried out in combination with process priority adjustment scheme, and multi-level queue allocation mechanism is used for dynamic scheduling.

Benefits of technology

Quantitative evaluation and prevention of system deadlock risks is realized, flexibility and accuracy of resource allocation decisions are improved, and a hierarchical scheduling architecture based on priority is established, which improves the performance and operation stability of the server operating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621359B_ABST
    Figure CN119621359B_ABST
Patent Text Reader

Abstract

The present application provides a resource management method and system for a server operating system, the method comprising: performing double-layer graph modeling on process and resource data in the server operating system to obtain a process competition layer and a resource dependency layer; using a preset graph neural network to perform feature extraction on node information of the process competition layer and node information of the resource dependency layer to obtain a node feature vector containing a competition relationship and an allocation state; performing deadlock probability calculation using a multi-layer perceptron based on the node feature vector to obtain a process priority adjustment scheme; performing resource allocation strategy learning based on the node feature vector and the process priority adjustment scheme to obtain a first resource allocation scheme; performing multi-level queue allocation on the process based on the first resource allocation scheme to obtain a second resource allocation scheme; and performing resource management on the server based on the second resource allocation scheme.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of server technology, and in particular to a resource management method and system for a server operating system. Background Art

[0002] With the rapid development of cloud computing and large-scale distributed systems, server operating systems need to handle a large number of concurrent tasks and complex resource allocation requirements at the same time. Traditional resource management methods mainly rely on static priorities and fixed allocation strategies, which are difficult to cope with dynamic and changing workloads and complex resource competition scenarios, and easily lead to low resource utilization and system performance degradation.

[0003] Current server operating systems face several key challenges when managing resources: 1. Resource competition relationships are complex, and dependencies and competition states between processes are difficult to accurately model and predict; 2. Deadlock problems are difficult to effectively prevent and detect, and traditional deadlock handling methods often adopt conservative strategies, affecting the overall efficiency of the system; 3. Resource allocation strategies lack adaptive capabilities and are difficult to make dynamic adjustments based on real-time load conditions, resulting in unbalanced resource allocation.

[0004] Although some studies have attempted to use machine learning methods to optimize resource management, most methods are still limited to single-dimensional optimization and fail to fully consider multiple key factors such as process competition, resource dependence, and deadlock prevention. At the same time, existing methods are not scalable enough when dealing with large-scale concurrent scenarios, and it is difficult to meet the needs of modern server operating systems for efficient and accurate resource management. The existence of these problems has seriously restricted the performance improvement and stable operation of server operating systems. Summary of the invention

[0005] The present application provides a resource management method and system for a server operating system, which are used to improve the performance and operation stability of the server operating system.

[0006] In a first aspect, an embodiment of the present application provides a resource management method for a server operating system, the method comprising:

[0007] Conduct double-layer graph modeling on the process and resource data in the server operating system to obtain the process competition layer and resource dependency layer;

[0008] Using a preset graph neural network, feature extraction is performed on the node information of the process competition layer and the node information of the resource dependency layer to obtain a node feature vector including competition relations and allocation states;

[0009] According to the node feature vector, a deadlock probability is calculated by a multi-layer perceptron to obtain a process priority adjustment scheme;

[0010] Perform resource allocation strategy learning according to the node feature vector and the process priority adjustment scheme to obtain a first resource allocation scheme;

[0011] According to the first resource allocation scheme, the process is allocated to a multi-level queue to obtain a second resource allocation scheme;

[0012] Resources of the server are managed according to the second resource allocation scheme.

[0013] In a second aspect, an embodiment of the present application provides a resource management system for a server operating system, the device comprising:

[0014] The layer modeling module is used to perform double-layer graph modeling on the process and resource data in the server operating system to obtain the process competition layer and the resource dependency layer;

[0015] A feature extraction module, used to extract features from the node information of the process competition layer and the node information of the resource dependency layer using a preset graph neural network, to obtain a node feature vector including a competition relationship and an allocation state;

[0016] A process foolproofing module is used to calculate the deadlock probability through a multi-layer perceptron according to the node feature vector to obtain a process priority adjustment plan;

[0017] An allocation calculation module, configured to learn a resource allocation strategy based on the node feature vector and the process priority adjustment scheme to obtain a first resource allocation scheme;

[0018] A resource allocation module, configured to perform multi-level queue allocation on the process according to the first resource allocation scheme to obtain a second resource allocation scheme;

[0019] A policy execution module is used to manage resources of the server according to the second resource allocation scheme.

[0020] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor;

[0021] The memory is used to store computer programs;

[0022] The processor is used to execute the computer program and implement the resource management method of the server operating system as described in any one of the embodiments of the present application when executing the computer program.

[0023] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor enables the processor to implement a resource management method for a server operating system as described in any one of the embodiments of the present application.

[0024] An embodiment of the present application provides a resource management method for a server operating system, the method comprising: performing two-layer graph modeling on process and resource data in the server operating system to obtain a process competition layer and a resource dependency layer; using a preset graph neural network to perform feature extraction on node information of the process competition layer and node information of the resource dependency layer to obtain a node feature vector containing a competition relationship and an allocation status; performing deadlock probability calculation using a multi-layer perceptron based on the node feature vector to obtain a process priority adjustment scheme; performing resource allocation strategy learning based on the node feature vector and the process priority adjustment scheme to obtain a first resource allocation scheme; performing multi-level queue allocation on the process based on the first resource allocation scheme to obtain a second resource allocation scheme; and performing resource management on the server based on the second resource allocation scheme. In the above method, the process competition relationship and resource dependency relationship are hierarchically represented through double-layer graph modeling, and the process competition layer and resource dependency layer are constructed to comprehensively capture the competition status and resource allocation status between concurrent processes. The graph neural network is used to extract the features of the node information in the double-layer graph structure, and the complex competition relationship and allocation status are encoded into feature vectors. The deadlock probability of the node feature vector is calculated based on the multi-layer perceptron. Combined with the process priority adjustment scheme, the quantitative assessment and prevention of the system deadlock risk is realized. Through the resource allocation strategy learning mechanism, the resource allocation strategy is automatically adjusted according to the node feature vector and the deadlock probability value, making the resource allocation decision more flexible and accurate. The multi-level queue allocation mechanism is used to dynamically schedule the process, and a priority-based hierarchical scheduling architecture is established, so that the operating system can flexibly adjust the scheduling strategy according to the process characteristics and resource requirements, thereby improving the performance and operation stability of the server operating system. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0026] Figure 1 A schematic flow chart of a resource management method for a server operating system provided in an embodiment of the present application;

[0027] Figure 2 A schematic block diagram of a resource management system of a server operating system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0030] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0031] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0032] See also Figure 1 , Figure 1 This is a schematic flow chart of a resource management method for a server operating system provided by an embodiment of the present application. The specific steps of the method include: S101-S106.

[0033] S101. Perform double-layer graph modeling on the process and resource data in the server operating system to obtain a process competition layer and a resource dependency layer.

[0034] Exemplarily, the two-layer graph modeling includes: a first layer and a second layer. At the first layer, each process in the server operating system is taken as a node, and the resource competition relationship between processes is taken as an edge to form a process competition graph. At the second layer, various types of resources (such as CPU, memory, I / O, etc.) are taken as nodes, and the dependency relationship between resources is taken as an edge to form a resource dependency graph. The two layers are connected through the resource allocation relationship, that is, if a process is using or requesting a resource, a connection edge is established between the corresponding process node and the resource node. The nodes in the process competition layer are assigned process control block information, the nodes in the resource dependency layer are assigned resource attribute information, and the inter-layer connection edges are assigned resource usage information. This two-layer graph structure can not only express the competition relationship between processes, but also express the dependency relationship between resources, providing more comprehensive system status information for subsequent resource allocation decisions. For each process node, record its process control block (PCB) information, including process ID, priority, current state (ready, running, blocked), etc. For each resource node, record its type, total amount, allocated amount and other attribute information; for the connection edge, record the weight information such as resource usage or request amount. Through the above two-layer graph model, the limitation of traditional resource graph that only focuses on the relationship at a single level is avoided, and the multi-dimensional relationship in the system can be simultaneously portrayed.

[0035] S102. Using a preset graph neural network, feature extraction is performed on the node information of the process competition layer and the node information of the resource dependency layer to obtain a node feature vector including competition relations and allocation states.

[0036] Exemplarily, for each node in the process competition layer, the information of its adjacent nodes is aggregated, and an attention mechanism is introduced to distinguish the importance of different neighbor nodes, that is, important neighbor nodes obtain higher weights when information is aggregated; the aggregated neighbor information is fused with the node's own feature information, and a new feature representation of the node is obtained through nonlinear transformation. In this process, special feature extraction modules are designed for the process layer and the resource layer respectively to process the features of different types of nodes. When information is transmitted between the two layers, a cross-layer attention mechanism is designed so that the server operating system can adaptively learn the strength of the association between processes and resources. After multi-layer feature extraction, the feature vector of each node will contain rich contextual information, reflecting both the local competition relationship and the global resource allocation status.

[0037] S103. According to the node feature vector, the deadlock probability is calculated by a multi-layer perceptron to obtain a system deadlock probability value and a process priority adjustment plan.

[0038] Exemplarily, the features are input into a multi-layer perceptron, which consists of multiple fully connected layers and is used to learn the nonlinear relationship between features. The output of the multi-layer perceptron is a probability value, which indicates the possibility of a deadlock in the system. When the predicted deadlock probability exceeds the preset threshold, the dynamic priority adjustment mechanism is triggered: for each process participating in resource competition, a comprehensive score is calculated based on factors such as the number of resources currently occupied, the type of resources requested, and the running time. Processes with lower scores will have their priorities reduced and may be temporarily suspended if necessary. At the same time, in order to avoid long-term non-execution of processes, an aging mechanism is introduced, that is, processes with reduced priority will gradually restore their priorities over time. Compared with traditional passive deadlock handling methods, this prediction-based active adjustment mechanism can detect potential deadlock risks earlier and take preventive measures.

[0039] S104: Perform resource allocation strategy learning according to the node feature vector and the deadlock probability value to obtain a first resource allocation solution.

[0040] Exemplarily, based on the feature extraction results of S102 and the deadlock prediction results of S103, a resource allocation strategy generator is designed. The generator adopts a reinforcement learning framework to model the resource allocation problem as a sequential decision-making process. Specifically, the system state is represented by the features extracted by GNN, the action space is all possible resource allocation schemes, and the reward function comprehensively considers factors such as system throughput, resource utilization, and deadlock risk. By interacting with the environment, the policy network gradually learns the optimal resource allocation strategy. In order to improve the reliability of decision-making, the Monte Carlo Tree Search (MCTS) method is introduced. Before making an allocation decision, multiple possible allocation sequences and their results are simulated to select the scheme with the highest expected return. This method that combines reinforcement learning and tree search can significantly reduce the computational complexity while ensuring the quality of decision-making.

[0041] S105. Perform multi-level queue allocation on the process according to the first resource allocation plan to obtain a second resource allocation plan.

[0042] Exemplarily, the adaptive scheduling queue constructs a first resource allocation scheme generated based on step four, constructs a multi-level adaptive scheduling queue system, and finally obtains a second resource allocation scheme. Specifically, the process is dynamically allocated to different scheduling queues according to the priority and resource demand characteristics of the process. Each queue in the first resource allocation scheme adopts a different scheduling strategy and time slice length. The queue with a higher priority is allocated a shorter time slice to ensure the response speed, and the queue with a lower priority is allocated a longer time slice to improve the throughput. In particular, a queue-level adaptive mechanism is introduced to periodically evaluate the performance indicators of each queue (such as average waiting time, completion time, etc.), and dynamically adjust the scheduling parameters of the queue according to the evaluation results. For example, when the average waiting time of a queue is too long, the time slice length of the queue is appropriately increased or its scheduling priority is increased. This adaptive mechanism can automatically adjust the scheduling strategy according to the system load condition to maintain the overall balance of the system.

[0043] S106: Perform resource management on the server according to the second resource allocation scheme.

[0044] For example, resource allocation and scheduling management are performed on scheduling queues at all levels, queue rotation time slices and preemption thresholds are set, and the running status of processes in the queues is monitored and counted, including monitoring resource usage, response time and other indicators. The scheduling strategy is dynamically adjusted according to the monitoring data, such as adjusting the time slice size, priority weight, etc., and cross-queue process migration is performed to achieve load balancing. Deadlock detection and processing are performed based on resource occupancy. A feedback control mechanism is constructed to optimize the management strategy based on system performance evaluation indicators.

[0045] An embodiment of the present application provides a resource management method for a server operating system, the method comprising: performing two-layer graph modeling on process and resource data in the server operating system to obtain a process competition layer and a resource dependency layer; using a preset graph neural network to perform feature extraction on node information of the process competition layer and node information of the resource dependency layer to obtain a node feature vector containing a competition relationship and an allocation status; performing deadlock probability calculation using a multi-layer perceptron based on the node feature vector to obtain a process priority adjustment scheme; performing resource allocation strategy learning based on the node feature vector and the process priority adjustment scheme to obtain a first resource allocation scheme; performing multi-level queue allocation on the process based on the first resource allocation scheme to obtain a second resource allocation scheme; and performing resource management on the server based on the second resource allocation scheme. In the above method, the process competition relationship and resource dependency relationship are hierarchically represented through double-layer graph modeling, and the process competition layer and resource dependency layer are constructed to comprehensively capture the competition status and resource allocation status between concurrent processes. The graph neural network is used to extract the features of the node information in the double-layer graph structure, and the complex competition relationship and allocation status are encoded into feature vectors. The deadlock probability of the node feature vector is calculated based on the multi-layer perceptron. Combined with the process priority adjustment scheme, the quantitative assessment and prevention of the system deadlock risk is realized. Through the resource allocation strategy learning mechanism, the resource allocation strategy is automatically adjusted according to the node feature vector and the deadlock probability value, making the resource allocation decision more flexible and accurate. The multi-level queue allocation mechanism is used to dynamically schedule the process, and a priority-based hierarchical scheduling architecture is established, so that the operating system can flexibly adjust the scheduling strategy according to the process characteristics and resource requirements, thereby improving the performance and operation stability of the server operating system.

[0046] In order to more clearly introduce the technical solution of the present application, the technical solution of the present application will be introduced through specific embodiments below. It should be noted that the specific embodiments are used to expand the technical solution of the present application, but are not intended to limit the present application.

[0047] In some embodiments, a two-layer graph modeling is performed on the process and resource data in the server operating system to obtain a process competition layer and a resource dependency layer, including:

[0048] Perform feature vector encoding on process and resource data to obtain a first node feature matrix and a second node feature matrix. Specifically, feature encoding of the process includes: converting the process name into a unique digital ID, normalizing the CPU usage, converting the memory usage into a proportional value, numerically mapping the process priority, and generating a one-hot encoding of the process status. Feature encoding of resource data includes: classifying and numbering various types of system resources, converting resource usage into percentages, numerating resource access rights, generating category codes for resource types, and constructing a numerical representation of resource dependencies. Combine all process features into a first node feature matrix, and combine all resource features into a second node feature matrix, ensure that the feature dimensions of the two matrices are consistent, and verify the integrity and correctness of the encoding results.

[0049] The correlation between nodes is calculated according to the first node feature matrix and the second node feature matrix to obtain the first node correlation matrix and the second node correlation matrix. Specifically, the analysis items corresponding to the correlation include: resource competition, communication frequency, dependency strength and shared resources. The correlation score between processes is generated by weighted calculation through the above analysis items. Take process P1, process P2 and process P3, as well as resource R1 and resource R2 as examples. The correlation is calculated based on four dimensions, and the weight distribution of each dimension is as follows: resource competition (0.3), communication frequency (0.3), dependency (0.2), and shared resources (0.2). Calculate the process correlation: The correlation between process P1 and process P2 is that they often compete for CPU resources (score 0.8), communicate 5 times per minute (normalized score 0.6), process P1 depends on the output of process P2 (score 0.7), and share the same configuration file (score 0.5). Then the process correlation between process P1 and process P2 is: 0.8×0.3+0.6×0.3+0.7×0.2+0.5×0.2=0.66. Calculate resource correlation: Assume that the correlation between resource R1 (CPU) and resource R2 (memory) is: when a process uses a large amount of CPU, it often occupies a lot of memory (competition score 0.7), resource scheduling often needs to consider both CPU and memory (communication score 0.8), memory allocation depends on CPU scheduling results (dependency score 0.6), and they serve the same group of processes together (sharing score 0.7). Then the resource correlation between resource R1 and resource R2 is: 0.7×0.3+0.8×0.3+0.6×0.2+0.7×0.2=0.71. Integrate process correlation to form the first node correlation matrix, and integrate resource correlation to form the second node correlation matrix.

[0050] According to the first node association matrix and the first node association matrix, an asymmetric matrix is ​​constructed for the process competition relationship and resource dependency relationship to obtain the initial adjacency matrix of the two-layer graph. Specifically, the competitive resources between processes are identified, the asymmetry of the competition intensity is calculated, the process competition relationship matrix is ​​constructed, the asymmetric characteristics of the matrix are ensured, and the rationality of the competition relationship is verified. The dependency direction between resources is analyzed, the asymmetry of the dependency intensity is calculated, the resource dependency relationship matrix is ​​constructed, the transitivity of the dependency relationship is maintained, and the integrity of the dependency relationship is verified. The two relationship matrices are combined into the initial adjacency matrix to ensure the correctness of the matrix structure, verify the validity of the matrix elements, and check the connectivity of the matrix. The initial adjacency matrix is ​​sparsely processed and ReLU activated to obtain the optimized sparse adjacency matrix. Specifically, the association threshold is set, weak association relationships are filtered, important structural information is retained, the matrix storage space is reduced, and the calculation efficiency is improved. The ReLU function is applied to the matrix elements to eliminate the influence of negative values, highlight strong association relationships, improve the nonlinear expression ability of the model, and ensure the numerical stability after activation. Check whether the sparsity is appropriate, verify whether important relationships are retained, and ensure that the optimization does not affect the model effect.

[0051] The two-layer graph structure is standardized according to the optimized sparse adjacency matrix and node feature matrix to obtain the process competition layer and resource dependency layer. Specifically, the node features are normalized to ensure the consistency of feature scales, eliminate dimensionality effects, improve the stability of the model, and facilitate subsequent analysis and processing. The optimized adjacency matrix is ​​normalized to maintain the topological characteristics of the graph structure, ensure reasonable weight distribution, improve the expression ability of the layer, and facilitate graph convolution operations. Generate the process competition layer and the resource dependency layer, verify the correctness of the layer structure, ensure the reasonable association between the layers, and provide a basis for subsequent analysis.

[0052] In some embodiments, a preset graph neural network is used to extract features from node information of a process competition layer and node information of a resource dependency layer to obtain a node feature vector containing a competition relationship and an allocation status, including: performing 1×1 standard convolution kernel projection on the node information of the process competition layer and the node information of the resource dependency layer to obtain an initial feature representation of the latent space; based on the initial feature representation, adaptively learning the hidden relationships between nodes to obtain a graph adjacency matrix, the graph adjacency matrix including graph inflow relationships and graph outflow relationships; based on the graph inflow relationships and graph outflow relationships, performing hybrid jump propagation on the graph adjacency matrix to obtain spatial dependency features of the nodes; performing temporal feature extraction on the spatial dependency features through an expanded convolution filter and a gating mechanism to obtain time dependency features of the nodes; performing residual connections and jump connections on the spatial dependency features and the time dependency features to obtain fused multi-level features; performing feature dimensionality reduction based on the fused multi-level features to obtain a node feature vector containing a competition relationship and an allocation status.

[0053] For example, the initial features are obtained by performing standard convolution projection on the two layers of process competition and resource dependence, and the spatial dependency features are captured by hybrid jump propagation combined with the adaptively learned adjacency matrix, while the temporal features are extracted by using dilated convolution and gating mechanisms. The multi-level feature fusion mechanism of residual connection and jump connection is used to effectively model the node competition relationship and resource allocation status. This structural design can simultaneously consider the feature dependencies in the spatial and temporal dimensions, improving the comprehensiveness and accuracy of feature extraction.

[0054] In some embodiments, according to the graph inflow relationship and the graph outflow relationship, the graph adjacency matrix is ​​propagated through hybrid jump to obtain the spatial dependency features of the nodes, including:

[0055] Normalize the graph inflow relationship and graph outflow relationship respectively to obtain the in-degree normalized adjacency matrix and the out-degree normalized adjacency matrix. Specifically, for the in-degree relationship of a node v, it is necessary to divide the weights of all incoming edges connected to it by the sum of the in-degree of the node, so that the sum of all in-edge weights is 1. Similarly, for the out-degree relationship, divide the out-edge weight by the sum of the out-degree. This treatment can avoid the gradient explosion or vanishing problem during numerical calculation. For example, a node has three in-edges with weights of 2, 3, and 5, which become 0.2, 0.3, and 0.5 after normalization. Formula D is usually used. (-1) A is used to calculate, where D is the degree matrix and A is the adjacency matrix.

[0056] According to the in-degree standardized adjacency matrix, the node features are aggregated with K-order neighborhood information to obtain the node's inflow feature sequence. Specifically, the K-order neighborhood represents the set of all nodes that can be reached from the central node after K steps. By iteratively aggregating the information of K-order neighbors, a wider range of contextual information can be obtained. For example, when K=2, not only directly connected nodes are considered, but also indirectly connected second-order neighbor nodes. In specific implementation, an iterative algorithm similar to PageRank can be used to update the feature representation of the node at each step.

[0057] According to the out-degree standardized adjacency matrix, the node features are aggregated in K-order neighborhood information to obtain the node's outflow feature sequence. Specifically, this step is similar to the previous step, but focuses on the outbound direction of the node. By analyzing the out-degree relationship of the node, we can understand the influence of the node on other nodes. For example, in a resource allocation scenario, if a process node has many outbound edges pointing to different resource nodes, it means that the process requires multiple resources. This information is important for preventing deadlocks.

[0058] The inflow feature sequence and the outflow feature sequence are weighted averaged to obtain the initial spatial dependency feature. Specifically, a gating mechanism (such as GRU or LSTM) can be used to dynamically adjust the weights of the inflow feature sequence and the outflow feature sequence, so that information in different directions can be flexibly emphasized in different scenarios. Initial spatial dependency feature H initial The specific calculation formula of the weighted average is: initial =αH in +(1-α)H out , where α is a learnable weight parameter and H in is the inflow feature of the inflow feature sequence, H out is the outflow feature of the outflow feature sequence.

[0059] According to the initial spatial dependency features, feature fusion processing is performed through a nonlinear transformation layer to obtain the spatial dependency features of the node. Specifically, a multi-layer perceptron (MLP) or other neural network structures are usually used as nonlinear transformation layers. For example, ReLU can be used as an activation function to build a multi-layer fully connected network. In this way, the complex interaction relationship between features can be learned to obtain a more expressive spatial dependency feature H of the node. Specifically, it can be expressed as: H=MLP(H initial) , where MLP can be a multi-layer neural network structure.

[0060] By standardizing the in-degree and out-degree relationships and performing K-order neighborhood aggregation, we can obtain multi-scale feature representations of nodes in different directions, taking into account both the local topological structure and the global information in a wider range. By fusing bidirectional features by weighted average and introducing nonlinear transformations, we further enhance the expressiveness of features, so that the obtained spatial dependency features can more comprehensively describe the location information and connection patterns of nodes in the graph structure, and effectively capture the bidirectional spatial dependency relationship between nodes.

[0061] In some embodiments, according to the node feature vector, the deadlock probability is calculated by a multi-layer perceptron to obtain a system deadlock probability value and a process priority adjustment scheme, including:

[0062] The node feature vectors are normalized and dimensionally reduced. The feature dimension is compressed to 50% of the original dimension through principal component analysis to obtain a compressed feature vector. Specifically, the collected node feature vectors are normalized to uniformly map all feature values ​​to the same numerical range (usually between 0 and 1), which can eliminate the dimensional differences between different features. For example, if the original features include the number of processes (range 1-100) and memory usage (range 0-100%), they will be converted to the same scale after normalization. Then, principal component analysis (PCA) is used for dimension reduction. This method can reduce the feature dimension while retaining the main information of the data. Assuming that the original feature vector has 20 dimensions, it will be compressed to 10 dimensions after PCA dimension reduction. This not only reduces the complexity of subsequent calculations, but also removes redundant information and noise between features and improves the generalization ability of the model. The importance of each feature is quantified through PCA, and the most important feature combinations are retained.

[0063] The three-layer perceptron network structure is constructed based on the compressed feature vector, the connection weights between the input layer and the hidden layer are randomly initialized, and the connection weights between the hidden layer and the output layer are initialized using the Xavier method to obtain the initialized weight matrix. Specifically, the three-layer perceptron includes an input layer, a hidden layer, and an output layer, where the number of neurons in the input layer is equal to the number of features after dimensionality reduction, such as 10 neurons. The number of neurons in the hidden layer usually needs to be determined experimentally and may be set to 1.5 times that of the input layer, that is, 15 neurons. The output layer contains neurons representing different deadlock probabilities, which may be 2 (representing the probabilities of deadlock and non-deadlock). Weight initialization is very important for model training: the connection from the input layer to the hidden layer is randomly initialized, which may range from -0.5 to 0.5; while the connection from the hidden layer to the output layer uses the Xavier initialization method, which automatically adjusts the weight range according to the size of the layer to ensure that the signal can be reasonably propagated in the network.

[0064] The initial weight matrix is ​​forward propagated and calculated, and the output of the hidden layer neurons is nonlinearly transformed using the ReLU activation function. The output layer results are probabilistically normalized using the Softmax function to obtain the system deadlock probability value. Specifically, the data first passes through the input layer, then multiplies by the weight of the first layer and passes to the hidden layer. In the hidden layer, the data is processed using the ReLU activation function, which sets negative values ​​to 0 and keeps positive values ​​unchanged, which increases the nonlinear expression ability of the model. The data then continues to propagate forward to the output layer, and finally the output is converted into a probability distribution through the Softmax function. For example, if the output obtained after the characteristics of a system state are calculated is [0.8, 0.2], it means that the probability that the system is in a deadlock state is 80%, and the probability of a non-deadlock state is 20%.

[0065] According to the system deadlock probability value and process resource dependency, the deadlock risk factor of each process is determined. Specifically, the calculation of the risk factor needs to consider the resource dependency graph between processes and evaluate the position and role of each process in the possible deadlock loop. Therefore, it is necessary to extract the current process resource dependency from the system. The process resource dependency includes: the current resource occupancy of each process, the resource request relationship and the waiting time of the process. Combined with the system deadlock probability value and the process resource dependency, a specific deadlock risk factor is calculated for each process. For example, if the system deadlock probability is 80%, a process occupies multiple key resources at the same time, and other processes are waiting for these resources, then the key resources of this process will be set as the deadlock risk factor.

[0066] The deadlock risk factor, the resource usage of each process, and the waiting time of each process are used as scoring parameters, and the process priority scoring sequence is obtained through weighted summation. Specifically, the deadlock risk factor obtained in the previous step is used as the main scoring parameter. The higher the risk factor, the lower the score may be. At the same time, the resource usage of the process is considered. The process that occupies more key resources may have a lower score to encourage it to release resources as soon as possible. In addition, the waiting time of the process is also considered. The longer the waiting time, the higher the score may be to prevent starvation. These parameters are weighted and summed by setting different weight coefficients to obtain the final score of each process. For example, the possible weight distribution is: deadlock risk factor 50%, resource usage 30%, waiting time 20%. According to the above scoring process, the priority of each process is scored, and the process priority scoring sequence is obtained by scoring according to the priority of each process.

[0067] The process priority score sequence is sorted and segmented, and the score values ​​are mapped to discrete priority level intervals using a piecewise linear mapping method to obtain an initial priority adjustment plan. Specifically, the processes in the process priority score sequence are sorted to determine the relative positions of all processes. Priority level intervals are set, for example, they can be divided into 5 levels: highest priority, high priority, medium priority, low priority, and lowest priority. The continuous score values ​​are mapped to these discrete priority levels using a piecewise linear mapping method. For example, the top 20% of processes may be mapped to the highest priority, the next 20% to high priority, and so on. This mapping method ensures the balance of priority allocation and prevents a large number of processes from being concentrated at a certain priority level.

[0068] According to the initial priority adjustment plan and historical adjustment records, the compensation factor is calculated for the processes whose priorities have been lowered for many consecutive times, and the compensation factor is superimposed on the current priority level to obtain the process priority adjustment plan. Specifically, it is necessary to first check the historical priority adjustment records of each process in the initial priority adjustment plan to identify those processes whose priorities have been lowered for many consecutive times. For example, a time window (such as the last 10 scheduling cycles) can be set to count the number of times the priority of the process is lowered in this window. If the number of times a process is lowered in priority for more than a preset threshold (such as 3 times) in this time window, it is necessary to calculate the compensation factor for it. The calculation of the compensation factor can adopt an exponential growth method, that is, the more times it is lowered continuously, the larger the compensation factor. The specific formula can be: compensation factor = basic compensation value * (1 + number of times of downgrade * 0.2). For example, if the basic compensation value is 1, and a process is downgraded 4 times in a row, its compensation factor is 1*(1+4*0.2)=1.8.

[0069] When adding the calculated compensation factor to the current priority level, the overall balance of the system needs to be considered. This can be done by multiplying the compensation factor by the current priority score, or by converting the compensation factor into an additional priority level increase. For example, if the compensation factor is 1.8 and the current process is at the lowest priority (level 1), it can be increased to medium priority (level 3). In order to prevent the compensation mechanism from over-raising the priority of some processes, a maximum increase limit needs to be set, such as a maximum increase of 2 priority levels.

[0070] Through the above mechanism, it is possible to avoid some processes from not getting execution opportunities for a long time due to continuous priority reduction, thus ensuring the fairness of the system. At the same time, the calculation of the compensation factor also needs to consider the current load of the system and the risk of deadlock. When the system pressure is high, the compensation intensity can be appropriately reduced, and when the system is relatively idle, a larger compensation space can be provided to achieve dynamic adjustment of the compensation mechanism. In addition, when the compensated process obtains enough execution opportunities, its compensation factor should gradually decay until it returns to normal levels, which can prevent the long-term impact of the compensation mechanism on the system.

[0071] In some embodiments, resource allocation strategy learning is performed according to the node feature vector and the process priority adjustment scheme to obtain a first resource allocation scheme, including:

[0072] The node feature vector and the process priority adjustment scheme are fused to obtain a fused feature matrix. Specifically, the node feature vector contains information such as process competition relationship and resource usage. The node feature vector and the process priority adjustment scheme are mapped to the same dimensional space. In the same dimensional space, the attention mechanism is used to calculate the correlation weights between features, and important features are given higher weights. The residual connection structure is used to retain the original feature information, and a multi-layer perceptron is used for nonlinear transformation. The transformed features are spliced ​​with the priority information to obtain a fused feature matrix containing complete context information.

[0073] The resource allocation strategy is trained through reinforcement learning based on the fusion feature matrix to obtain the policy model parameters. Specifically, a deep reinforcement learning model based on the Actor-Critic architecture is constructed, in which the Actor network is responsible for generating resource allocation actions and the Critic network evaluates the action value. The reward function is defined to consider multiple indicators such as system throughput and resource utilization; the experience replay mechanism is used to store historical decision data; and the policy gradient algorithm is used to update the model parameters. The policy network is iteratively optimized through multiple rounds of training, and the trained policy model parameters are output.

[0074] The policy model parameters are iteratively optimized to obtain the optimized resource allocation strategy. Specifically, the model is pruned to remove redundant parameters to reduce the model complexity; then the model parameter width is compressed using quantization technology; the hyperparameters are tuned using the Bayesian optimization method; the model generalization performance is evaluated through cross-validation; and the model output is constrained in combination with expert rules to ensure the reliability of the strategy. The entire process is continuously optimized in an iterative manner until the policy performance meets the requirements.

[0075] According to the optimized resource allocation strategy, the action evaluation is performed to obtain the resource allocation sequence. Specifically, a simulation environment is constructed to simulate the real system state; the current system state is input to obtain the allocation action of the policy network; the expected return and risk of the action are calculated; a Monte Carlo tree search is performed on multiple candidate actions to evaluate the long-term benefits; the optimal resource allocation action sequence is screened out; and the action sequence is converted into specific resource allocation instructions.

[0076] Perform constraint checks on the resource allocation sequence to obtain a preliminary allocation plan. Specifically, check the total resource constraints required by the resource allocation sequence to ensure that the allocated resources do not exceed the system capacity; verify mutually exclusive resource constraints to avoid resource conflicts; check priority constraints to ensure that high-priority processes get resources first; analyze timing constraints to ensure that the allocation order is reasonable; evaluate load balancing constraints to avoid uneven resource allocation; and generate a preliminary allocation plan that meets all constraints.

[0077] According to the preliminary allocation plan, security verification is performed to obtain the first resource allocation plan. Specifically, formal verification methods are used to analyze deadlock risks, detect resource leakage risks, evaluate system stability, verify real-time requirements, and analyze the fault tolerance of the plan. Through comprehensive security verification, it is ensured that the final resource allocation plan can not only meet performance requirements, but also ensure safe and stable operation of the system.

[0078] In some embodiments, according to the first resource allocation scheme, multi-level queue allocation is performed on the process to obtain a second resource allocation scheme, including:

[0079] The resource allocation sequence is grouped, a multi-dimensional resource vector is constructed according to the resource type and the resource quantity corresponding to the resource allocation sequence, and the resource vector is quantified to obtain a resource weight matrix;

[0080] According to the resource weight matrix and the process priority adjustment scheme, the process queue is hierarchically constructed, and the process is divided into multiple priority queues using a hierarchical tree structure. A time slice quota is allocated to each queue node to obtain the initial queue structure model.

[0081] Dynamic load calculation is performed on the processes in the initial queue structure model. CPU usage, memory occupancy and IO request frequency are used as load parameters. The process load index sequence is obtained by exponential weighted average method.

[0082] According to the process load indicator sequence, the processes in the queue are quantitatively sorted, and the position of the process in the queue is locally adjusted using a multi-objective optimization algorithm to obtain an optimized queue sorting solution;

[0083] Feedback control is performed on the optimized queue sorting scheme. The queue scheduling cycle and time slice allocation are dynamically adjusted through the proportional integral differential controller. The compensation coefficient is calculated based on the historical execution records to obtain the queue scheduling parameter set.

[0084] According to the queue scheduling parameter set, the multi-level queue system is globally coordinated, processor time is allocated in a hierarchical round-robin manner, and a resource yielding and preempting mechanism is established between queues to obtain a second resource allocation scheme.

[0085] In the above method, resources are quantitatively evaluated and grouped, and a hierarchical tree queue structure based on priority is established. Then, dynamic load calculation is performed through parameters such as CPU usage, memory occupancy and IO request frequency, and the position of processes in the queue is adjusted using a multi-objective optimization algorithm. Finally, a PID controller is used to dynamically adjust scheduling parameters, combined with hierarchical rotation and resource preemption mechanisms between queues, thereby achieving dynamic optimization of resource allocation, which can significantly improve the resource utilization efficiency and task processing performance of the server system.

[0086] See also Figure 2 , Figure 2 1 is a schematic block diagram of a resource management system for a server operating system provided in an embodiment of the present application, wherein the resource management system 200 for the server operating system is used to execute the resource management method for the server operating system described above, wherein the resource management system 200 for the server operating system can be configured in a server.

[0087] Among them, the server can be an independent server or a server cluster, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN) and big data and artificial intelligence platforms.

[0088] like Figure 2 As shown, the resource management system 200 of the server operating system includes: a layer modeling module 201, a feature extraction module 202, a process foolproofing module 203, an allocation calculation module 204, a resource allocation module 205 and a policy execution module 206.

[0089] The layer modeling module 201 is used to perform double-layer graph modeling on the process and resource data in the server operating system to obtain a process competition layer and a resource dependency layer;

[0090] A feature extraction module 202 is used to extract features from the node information of the process competition layer and the node information of the resource dependency layer using a preset graph neural network to obtain a node feature vector including a competition relationship and an allocation state;

[0091] The process foolproofing module 203 is used to calculate the deadlock probability through a multi-layer perceptron according to the node feature vector to obtain a process priority adjustment scheme;

[0092] An allocation calculation module 204 is used to perform resource allocation strategy learning according to the node feature vector and the process priority adjustment scheme to obtain a first resource allocation scheme;

[0093] The resource allocation module 205 is used to perform multi-level queue allocation on the process according to the first resource allocation scheme to obtain a second resource allocation scheme;

[0094] The policy execution module 206 is used to manage resources of the server according to the second resource allocation scheme.

[0095] An embodiment of the present application provides an electronic device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement a resource management method for a server operating system such as any one of the embodiments of the present application when executing the computer program.

[0096] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements a resource management method for a server operating system as described in any one of the embodiments of the present application.

[0097] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A resource management method for a server operating system, characterized in that: The method comprises: Perform feature vector encoding on the process and resource data in the server operating system to obtain a first node feature matrix and a second node feature matrix; calculate the degree of association between nodes according to the first node feature matrix and the second node feature matrix to obtain a first node association degree matrix and a second node association degree matrix; construct an asymmetric matrix of process competition relationship and resource dependency relationship according to the first node association degree matrix and the first node association degree matrix to obtain an initial adjacency matrix of a two-layer graph; perform sparseness and ReLU activation on the initial adjacency matrix to obtain an optimized sparse adjacency matrix; standardize the two-layer graph structure according to the optimized sparse adjacency matrix and the node feature matrix to obtain a process competition layer and a resource dependency layer; Using a preset graph neural network, feature extraction is performed on the node information of the process competition layer and the node information of the resource dependency layer to obtain a node feature vector including competition relations and allocation states; The node feature vector is normalized and dimensionally reduced, and the feature dimension is compressed to 50% of the original dimension by principal component analysis to obtain a compressed feature vector; a three-layer perceptron network structure is constructed according to the compressed feature vector, the connection weights between the input layer and the hidden layer are randomly initialized, and the connection weights between the hidden layer and the output layer are initialized by the Xavier method to obtain an initialized weight matrix; forward propagation calculation is performed on the initialized weight matrix, the output of the hidden layer neurons is nonlinearly transformed by the ReLU activation function, and the output layer result is probability normalized by the Softmax function to obtain a system deadlock probability value; according to the The deadlock risk factor of each process is determined based on the system deadlock probability value and the preset process resource dependency relationship; the deadlock risk factor, the resource usage of each process and the waiting time of each process are used as scoring parameters, and a process priority scoring sequence is obtained through a weighted sum operation; the process priority scoring sequence is sorted and segmented, and the scoring value is mapped to a discrete priority level interval using a piecewise linear mapping method to obtain an initial priority adjustment plan; according to the initial priority adjustment plan and historical adjustment records, a compensation factor is calculated for the process whose priority is lowered for multiple consecutive times, and the compensation factor is superimposed on the current priority level to obtain a process priority adjustment plan; Perform resource allocation strategy learning according to the node feature vector and the process priority adjustment scheme to obtain a first resource allocation scheme; According to the first resource allocation scheme, the process is allocated to a multi-level queue to obtain a second resource allocation scheme; Resources of the server are managed according to the second resource allocation scheme.

2. The resource management method of the server operating system according to claim 1, characterized in that: The preset graph neural network is used to extract features from the node information of the process competition layer and the node information of the resource dependency layer to obtain a node feature vector containing competition relations and allocation states, including: Performing 1×1 standard convolution kernel projection on the node information of the process competition layer and the node information of the resource dependency layer to obtain an initial feature representation of the latent space; According to the initial feature representation, the hidden relationship between nodes is adaptively learned to obtain a graph adjacency matrix, wherein the graph adjacency matrix includes graph inflow relationships and graph outflow relationships; According to the graph inflow relationship and the graph outflow relationship, the graph adjacency matrix is ​​propagated through hybrid jump to obtain the spatial dependency characteristics of the nodes; By using a dilated convolution filter and a gating mechanism, the spatial dependency feature is subjected to temporal feature extraction to obtain a time dependency feature of the node; Performing residual connection and skip connection on the spatial dependent features and the temporal dependent features to obtain fused multi-level features; Feature dimension reduction is performed based on the fused multi-level features to obtain a node feature vector including competition relationship and allocation status.

3. The resource management method of the server operating system according to claim 2, characterized in that: The step of obtaining the spatial dependency features of nodes by performing mixed jump propagation on the graph adjacency matrix according to the graph inflow relationship and the graph outflow relationship includes: Normalizing the graph inflow relationship and the graph outflow relationship respectively to obtain an in-degree standardized adjacency matrix and an out-degree standardized adjacency matrix; Performing K-order neighborhood information aggregation processing on node features according to the in-degree standardized adjacency matrix to obtain an inflow feature sequence of the node; Performing K-order neighborhood information aggregation processing on node features according to the out-degree standardized adjacency matrix to obtain an outflow feature sequence of the node; Performing weighted average processing on the inflow feature sequence and the outflow feature sequence to obtain initial spatial dependency features; Feature fusion processing is performed through a nonlinear transformation layer according to the initial spatial dependency features to obtain spatial dependency features of the nodes.

4. The resource management method of the server operating system according to claim 1, characterized in that: The step of performing resource allocation strategy learning according to the node feature vector and the process priority adjustment scheme to obtain a first resource allocation scheme includes: Performing feature fusion on the node feature vector and the process priority adjustment scheme to obtain a fusion feature matrix; Perform reinforcement learning training on the resource allocation strategy according to the fusion feature matrix to obtain strategy model parameters; Iteratively optimizing the policy model parameters to obtain an optimized resource allocation policy; Perform action evaluation according to the optimized resource allocation strategy to obtain a resource allocation sequence; Performing constraint checking on the resource allocation sequence to obtain a preliminary allocation plan; Security verification is performed according to the preliminary allocation plan to obtain the first resource allocation plan.

5. The resource management method of the server operating system according to claim 4, characterized in that: The step of performing multi-level queue allocation on the process according to the first resource allocation scheme to obtain a second resource allocation scheme includes: The resource allocation sequence is grouped, a multi-dimensional resource vector is constructed according to the resource type corresponding to the resource allocation sequence and the resource quantity corresponding to the resource allocation sequence, and the resource vector is quantified to obtain a resource weight matrix; According to the resource weight matrix and the process priority adjustment scheme, the process queue is hierarchically constructed, the process is divided into multiple priority queues using a hierarchical tree structure, and a time slice quota is allocated to each queue node to obtain an initial queue structure model; Dynamically calculate the load of the processes in the initial queue structure model, use CPU usage, memory occupancy and IO request frequency as load parameters, and obtain a process load indicator sequence through an exponential weighted average method; According to the process load indicator sequence, the processes in the queue are quantitatively sorted, and the positions of the processes in the queue are locally adjusted using a multi-objective optimization algorithm to obtain an optimized queue sorting scheme; Feedback control is performed on the optimized queue sorting scheme, the scheduling cycle and time slice allocation of the queue are dynamically adjusted through a proportional integral differential controller, and a compensation coefficient is calculated in combination with historical execution records to obtain a queue scheduling parameter set; According to the queue scheduling parameter set, the multi-level queue system is globally coordinated, processor time is allocated in a hierarchical round-robin manner, and a resource yielding and preempting mechanism is established between queues to obtain the second resource allocation scheme.

6. A resource management system for a server operating system, characterized in that: The resource management system of the server operating system includes: A layer modeling module is used to perform feature vector encoding on the process and resource data in the server operating system to obtain a first node feature matrix and a second node feature matrix; calculate the degree of association between nodes according to the first node feature matrix and the second node feature matrix to obtain a first node association degree matrix and a second node association degree matrix; construct an asymmetric matrix for process competition relationship and resource dependency relationship according to the first node association degree matrix and the first node association degree matrix to obtain an initial adjacency matrix of a two-layer graph; perform sparseness and ReLU activation on the initial adjacency matrix to obtain an optimized sparse adjacency matrix; standardize the two-layer graph structure according to the optimized sparse adjacency matrix and the node feature matrix to obtain a process competition layer and a resource dependency layer; A feature extraction module, used to extract features from the node information of the process competition layer and the node information of the resource dependency layer using a preset graph neural network, to obtain a node feature vector including a competition relationship and an allocation state; The process foolproofing module is used to normalize and reduce the dimension of the node feature vector, compress the feature dimension to 50% of the original dimension through the principal component analysis method, and obtain a compressed feature vector; construct a three-layer perceptron network structure according to the compressed feature vector, randomly initialize the connection weights between the input layer and the hidden layer, and use the Xavier method to initialize the connection weights between the hidden layer and the output layer to obtain an initialized weight matrix; perform forward propagation calculation on the initialized weight matrix, use the ReLU activation function to perform nonlinear transformation on the output of the hidden layer neurons, and perform probability normalization on the output layer results through the Softmax function to obtain a system deadlock probability value; According to the system deadlock probability value and the preset process resource dependency, the deadlock risk factor of each process is determined; the deadlock risk factor, the resource usage of each process and the waiting time of each process are used as scoring parameters, and a process priority scoring sequence is obtained through a weighted sum operation; the process priority scoring sequence is sorted and segmented, and the scoring value is mapped to a discrete priority level interval using a piecewise linear mapping method to obtain an initial priority adjustment plan; according to the initial priority adjustment plan and historical adjustment records, a compensation factor is calculated for the process whose priority is lowered for multiple consecutive times, and the compensation factor is superimposed on the current priority level to obtain a process priority adjustment plan; An allocation calculation module, configured to perform resource allocation strategy learning according to the node feature vector and the process priority adjustment scheme to obtain a first resource allocation scheme; A resource allocation module, configured to perform multi-level queue allocation on the process according to the first resource allocation scheme to obtain a second resource allocation scheme; A policy execution module is used to manage resources of the server according to the second resource allocation scheme.

Citation Information

Patent Citations

  • Task deployment method and device, electronic equipment and storage medium

    CN113407305A

  • Process scheduling method and device, equipment, medium and computer program product

    CN119225933A