Method and device for automatically solving system resource contention conflict based on AI algorithm
By applying AI algorithms and random game five-tuple model in the computing system, combining heuristic search algorithms, dynamically adjusting resource allocation and task scheduling, the problem of resource competition conflict in the computing system is solved, and the efficient operation and performance of the system is achieved optimization.
Patent Information
- Application Number
- CN202411104059.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-12-31
AI Technical Summary
Resource competition conflicts are frequent in modern computing systems, and existing technologies cannot quickly and flexibly respond to dynamically changing resource requirements and conflicts, resulting in system performance degradation.
Using an AI algorithm-based method, monitoring the system status and event triggering mechanism, a five-tuple model of random game and intelligent planning is used, combined with a heuristic search algorithm, dynamically adjusting resource allocation and task scheduling, and generating execution instructions to resolve resource contention conflict.
It realizes the efficient operation of the system in complex environments, can accurately respond to resource conflicts and changes, and quickly find the optimal solution through learning and adapting to continuous optimization of resource management strategies.
Smart Images

Figure CN119225951A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of system computing, and in particular to a method and device for automatically resolving system resource contention conflicts based on an AI algorithm. Background Art
[0002] Modern computing systems, including cloud computing platforms, data centers, and enterprise information systems, are becoming increasingly complex. These systems need to process a large number of user requests and tasks simultaneously, resulting in frequent resource contention conflicts. Existing resource management methods usually rely on preset static rules or manual intervention, and cannot quickly and flexibly respond to dynamically changing resource demands and conflicts.
[0003] With the development of technology, AI has shown great advantages in dealing with complex decision-making and optimization problems. With its autonomous decision-making ability, it can analyze system status in real time, dynamically adjust resource allocation and task scheduling, and optimize system performance. By introducing algorithms such as reinforcement learning and heuristic search, AI can continuously optimize resource management strategies in continuous learning and adaptation to ensure that the system is always in the best operating state. Summary of the invention
[0004] In order to solve the problems existing in the prior art, the present invention provides a method and device for automatically resolving system resource contention conflicts based on an AI algorithm, which can respond to resource conflicts and changes in real time by monitoring system status and event triggering mechanisms.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] In one embodiment of the present invention, a method for automatically resolving system resource contention conflicts based on an AI algorithm is proposed, the method comprising:
[0007] S01, information collection, running resource monitoring process, monitoring the usage of core resources such as CPU, memory and storage;
[0008] Further, the S01 includes:
[0009] S011. When the resource monitoring process detects that the core resources exceed the preset threshold, the process will automatically start a child process, which is an information collection process responsible for collecting detailed information of all processes, including process ID, parent process ID, user ID, priority, status, and resource usage;
[0010] S012. The collected information will be transmitted to the autonomous decision-making functional module through the communication protocol in accordance with the pre-defined interface format, and activated to make further decisions and responses.
[0011] S02, autonomous decision-making, detect the status of the information collection process, the status is running, start the autonomous decision-making process and receive detailed information on all resources, and generate a series of execution instructions through the built-in AI algorithm.
[0012] Furthermore, the AI algorithm built into S02 includes:
[0013] S021. Based on the unified modeling of random game and intelligent planning, the model is represented by a five-tuple: M = (S, A, T, R, γ),
[0014] S indicates the current system resource usage, task status, and user needs. The status includes CPU, memory, and storage usage, currently running tasks, and the priority of each task.
[0015] A represents the specific operations taken by the process to allocate resources and schedule tasks, such as allocating more CPU resources to a task, adjusting the order of task execution, suspending low-priority tasks, etc.
[0016] T represents the state transition function, which is the probability of transitioning to state S′ after taking action a in state S. For example, in a certain state, allocating more CPU resources to task A may cause the system to transition to a new state with higher resource utilization.
[0017] R represents the reward function, which is the immediate reward or cost obtained after taking action a in state S. For example, if allocating resources reduces the task completion time and improves system efficiency, a positive reward will be given; if it causes resource contention conflicts, a negative reward will be given;
[0018] γ represents the discount factor, which is a constant between 0 and 1 and is used to discount future rewards. For example, when the discount factor is large, the system will focus more on long-term benefits; when the discount factor is small, it will focus more on immediate benefits.
[0019] S022. Solution: Heuristic search, by evaluating the cost and potential benefit of each state, select the optimal action to minimize the total cumulative cost.
[0020] Furthermore, S022 includes: designing a heuristic function h(S), calculating the minimum cost from state S to the target state, and adopting a multi-factor conforming heuristic function: h(S) = w1*current resource utilization + w2*priority of the highest priority task, where w1 and w2 are weights used to balance the influence of resource utilization and task priority in the estimation. By adjusting the weights, the performance of the search algorithm can be optimized according to the specific application scenarios and system characteristics.
[0021] S03, command execution, through the inotify mechanism in Liunx, monitor the generation of command files in the specified directory, and immediately capture the event when a new command file is generated; through the administrator account, execute operations one by one in the order in which the command files are generated.
[0022] In one embodiment of the present invention, a device for automatically resolving system resource contention conflicts based on an AI algorithm is also proposed, the device comprising:
[0023] Information collection module, running resource monitoring process, monitoring the usage of CPU, memory and storage core resources;
[0024] The autonomous decision-making module detects the status of the information collection process. If the status is running, it starts the autonomous decision-making process and receives detailed information about all resources, and generates a series of execution instructions through the built-in AI algorithm;
[0025] The command execution module uses the inotify mechanism in Liunx to monitor the generation of command files in the specified directory. When a new command file is generated, it immediately captures the event; through the administrator account, it executes operations one by one in the order in which the command files are generated.
[0026] Furthermore, the information collection module includes:
[0027] Subprocess module: When the resource monitoring process detects that the core resources exceed the preset threshold, the process will automatically start the subprocess, which is the information collection process responsible for collecting detailed information of all processes, including process ID, parent process ID, user ID, priority, status, and resource usage;
[0028] In the information transmission module, the collected information will be transmitted to the autonomous decision-making function through the communication protocol in a pre-defined interface format, and activated for further decision-making and response.
[0029] Furthermore, the AI algorithms built into the autonomous decision-making module include:
[0030] AI algorithm building module, based on random game and intelligent planning unified modeling, the model is represented by a five-tuple: M = (S, A, T, R, γ),
[0031] S indicates the current system resource usage, task status, and user needs. The status includes CPU, memory, and storage usage, currently running tasks, and the priority of each task.
[0032] A represents the specific operations taken by the process to allocate resources, schedule tasks, etc.;
[0033] T represents the state transition function, the probability of taking action a in state S and transferring to state S′;
[0034] R represents the reward function, which is the immediate reward or cost obtained after taking action a in state S;
[0035] γ represents the discount factor, which is a constant between 0 and 1 and is used to discount future rewards;
[0036] The solution module, heuristic search, selects the optimal action to minimize the total cumulative cost by evaluating the cost and potential benefit of each state.
[0037] Furthermore, the solution module includes: designing a heuristic function h(S), calculating the minimum cost from state S to the target state, and adopting a multi-factor conforming heuristic function: h(S)=w1*current resource utilization+w2*priority of the highest priority task, where w1 and w2 are weights used to balance the influence of resource utilization and task priority in the estimation.
[0038] In one embodiment of the present invention, a computer device is also proposed, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the aforementioned method for automatically resolving system resource contention conflicts based on an AI algorithm is implemented.
[0039] In one embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program for executing a method for automatically resolving system resource contention conflicts based on an AI algorithm.
[0040] Beneficial effects:
[0041] The present invention discloses a method and device for automatically resolving system resource contention conflicts based on an AI algorithm, which applies a random game five-tuple model to system resource contention conflicts and can accurately reflect various unpredictable factors that may occur in the resource allocation process, such as a sudden increase in resource requests, a delay in resource release, etc.
[0042] The present invention has the ability to make decisions autonomously and continuously optimize resource management strategies through learning and adaptation. The introduction of algorithms such as heuristic search can quickly find the optimal solution and ensure that the system can still operate efficiently in complex environments;
[0043] The present invention can respond to resource conflicts and changes in real time by monitoring system status and event triggering mechanisms. For example, the inotify mechanism monitors the generation of instruction files and performs resource adjustment operations in real time to ensure that the system responds quickly and accurately. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1It is a flow chart of a method for automatically resolving system resource contention conflicts based on an AI algorithm of the present invention;
[0045] Figure 2 It is a schematic diagram of the structure of a device for automatically resolving system resource contention conflicts based on an AI algorithm of the present invention;
[0046] Figure 3 is a schematic diagram of the system architecture of the present invention;
[0047] Figure 4 It is a schematic diagram of the interaction process of the present invention;
[0048] Figure 5 It is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0050] Those skilled in the art will appreciate that the embodiments of the present invention may be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0051] According to an embodiment of the present invention, a method and device for automatically resolving system resource contention conflicts based on an AI algorithm are proposed, which can respond to resource conflicts and changes in real time by monitoring system status and event triggering mechanisms.
[0052] The principle and spirit of the present invention are explained in detail below with reference to several representative embodiments of the present invention.
[0053] like Figure 1 , Figure 2 As shown, the present invention relates to a method for automatically resolving system resource contention conflicts based on an AI algorithm, the method comprising:
[0054] S01, information collection, running resource monitoring process, monitoring the usage of core resources such as CPU, memory and storage;
[0055] The S01 includes:
[0056] S011. When the resource monitoring process detects that the core resources exceed the preset threshold, the process will automatically start a child process, which is an information collection process responsible for collecting detailed information of all processes, including process ID, parent process ID, user ID, priority, status, and resource usage;
[0057] S012. The collected information will be transmitted to the autonomous decision-making functional module through the communication protocol in accordance with the pre-defined interface format, and activated to make further decisions and responses.
[0058] S02, autonomous decision-making, detect the status of the information collection process, the status is running, start the autonomous decision-making process and receive detailed information on all resources, and generate a series of execution instructions through the built-in AI algorithm.
[0059] The AI algorithms built into the S02 include:
[0060] S021. Based on the unified modeling of random game and intelligent planning, the model is represented by a five-tuple: M = (S, A, T, R, γ),
[0061] S indicates the current system resource usage, task status, and user needs. The status includes CPU, memory, and storage usage, currently running tasks, and the priority of each task.
[0062] A represents the specific operations taken by the process to allocate resources and schedule tasks, such as allocating more CPU resources to a task, adjusting the order of task execution, suspending low-priority tasks, etc.
[0063] T represents the state transition function, which is the probability of transitioning to state S′ after taking action a in state S. For example, in a certain state, allocating more CPU resources to task A may cause the system to transition to a new state with higher resource utilization.
[0064] R represents the reward function, which is the immediate reward or cost obtained after taking action a in state S. For example, if allocating resources reduces the task completion time and improves system efficiency, a positive reward will be given; if it causes resource contention conflicts, a negative reward will be given;
[0065] γ represents the discount factor, which is a constant between 0 and 1 and is used to discount future rewards. For example, when the discount factor is large, the system will focus more on long-term benefits; when the discount factor is small, it will focus more on immediate benefits.
[0066] S022. Solution: Heuristic search, by evaluating the cost and potential benefit of each state, select the optimal action to minimize the total cumulative cost.
[0067] The S022 includes: designing a heuristic function h(S), calculating the minimum cost from state S to the target state, and adopting a multi-factor conforming heuristic function: h(S)=w1*current resource utilization+w2*priority of the highest priority task, where w1 and w2 are weights used to balance the influence of resource utilization and task priority in the estimation. By adjusting the weights, the performance of the search algorithm can be optimized according to the specific application scenarios and system characteristics.
[0068] S03, command execution, through the inotify mechanism in Liunx, monitor the generation of command files in the specified directory, and immediately capture the event when a new command file is generated; through the administrator account, execute operations one by one in the order in which the command files are generated.
[0069] It should be noted that, although the operations of the method of the present invention are described in a specific order in the above embodiments and the accompanying drawings, this does not require or imply that the operations must be performed in the specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0070] In order to explain more clearly the above-mentioned method for automatically resolving system resource contention conflicts based on AI algorithm, it is described below in conjunction with a specific embodiment. However, it is worth noting that this embodiment is only for better illustrating the present invention and does not constitute an improper limitation to the present invention.
[0071] S01, information collection, running resource monitoring process, monitoring the usage of core resources such as CPU, memory and storage;
[0072] The S01 includes:
[0073] S011. When the resource monitoring process detects that the core resources exceed the preset threshold, the process will automatically start a child process, which is an information collection process responsible for collecting detailed information of all processes, including process ID, parent process ID, user ID, priority, status, and resource usage;
[0074] S012. The collected information will be transmitted to the autonomous decision-making functional module through the communication protocol in accordance with the pre-defined interface format, and activated to make further decisions and responses.
[0075] S02, autonomous decision-making, detect the status of the information collection process, the status is running, start the autonomous decision-making process and receive detailed information on all resources, and generate a series of execution instructions through the built-in AI algorithm.
[0076] The AI algorithms built into the S02 include:
[0077] S021. Based on the unified modeling of random game and intelligent planning, the model is represented by a five-tuple: M = (S, A, T, R, γ),
[0078] S indicates the current system resource usage, task status, and user needs. The status includes CPU, memory, and storage usage, currently running tasks, and the priority of each task.
[0079] A represents the specific operations taken by the process to allocate resources and schedule tasks, such as allocating more CPU resources to a task, adjusting the order of task execution, suspending low-priority tasks, etc.
[0080] T represents the state transition function, which is the probability of transitioning to state S′ after taking action a in state S. For example, in a certain state, allocating more CPU resources to task A may cause the system to transition to a new state with higher resource utilization.
[0081] R represents the reward function, which is the immediate reward or cost obtained after taking action a in state S. For example, if allocating resources reduces the task completion time and improves system efficiency, a positive reward will be given; if it causes resource contention conflicts, a negative reward will be given;
[0082] γ represents the discount factor, which is a constant between 0 and 1 and is used to discount future rewards. For example, when the discount factor is large, the system will focus more on long-term benefits; when the discount factor is small, it will focus more on immediate benefits.
[0083] S022. Solution: Heuristic search, by evaluating the cost and potential benefit of each state, select the optimal action to minimize the total cumulative cost.
[0084] The S022 includes: designing a heuristic function h(S), calculating the minimum cost from state S to the target state, and adopting a multi-factor conforming heuristic function: h(S)=w1*current resource utilization+w2*priority of the highest priority task, where w1 and w2 are weights used to balance the influence of resource utilization and task priority in the estimation. By adjusting the weights, the performance of the search algorithm can be optimized according to the specific application scenarios and system characteristics.
[0085] Assume that we use CPU utilization and task priority as two factors of the heuristic function. Here is a simplified Python example showing how to design a heuristic function based on these two factors:
[0086] def heuristic_function(current_state):
[0087] #Assume that the current state contains information about CPU utilization and the highest priority task
[0088] current_cpu_usage=current_state['cpu_usage']
[0089] highest_priority_task_priority=current_state['highest_priority_task']['priority']
[0090] remaining_tasks=len(current_state['tasks'])
[0091] #Heuristic function h(S) = w1*current_cpu_usage+w2*highest_priority_task_priority*remaining_tasks
[0092] w1=0.5#CPU utilization weight
[0093] w2=1.0#priority weight
[0094] h_estimate=w1*current_cpu_usage+w2*highest_priority_task_priority*remaining_tasks return h_estimate
[0095] Use the heuristic A* search algorithm to find the path with the minimum cost in the state space;
[0096] A* algorithm, one of the heuristic search algorithms;
[0097] This path will consist of a series of execution actions, each of which is designed to resolve the current resource conflict;
[0098] During the search process, according to the heuristic function h(S) and the cumulative cost evaluation, the action that can minimize the resource conflict cost in the current state S is selected as follows:
[0099] Adjust task priorities;
[0100] Resource release;
[0101] Dynamic resource allocation;
[0102] Task scheduling optimization.
[0103] S03, command execution, through the inotify mechanism in Liunx, monitor the generation of command files in the specified directory, and immediately capture the event when a new command file is generated; through the administrator account, execute operations one by one in the order in which the command files are generated.
[0104] This sequential execution can generate events through the inotify listening file, and after capturing the events, read and execute the operation instructions in the instruction file.
[0105] The following is a simplified Python example that demonstrates how to use the inotify mechanism to monitor and execute command files:
[0106] import os
[0107] import subprocess
[0108] import pyinotify
[0109] #Monitor the command file generation in the specified directory
[0110] class EventHandler(pyinotify.ProcessEvent):
[0111] def process_IN_CREATE(self,event):
[0112] if event.pathname.endswith('.txt'):#Assume the instruction file ends with .txt execute_instructions(event.pathname)
[0113] #Execute the operation instructions in the command file
[0114] def execute_instructions(file_path):
[0115] with open(file_path,'r')as f:
[0116] for line in f:
[0117] #Execute each instruction, such as executing system commands through subprocess
[0118] subprocess.run(line,shell=True,check=True)
[0119] #Set inotify listener
[0120] watch_manager=pyinotify.WatchManager()
[0121] event_handler=EventHandler()
[0122] notifier=pyinotify.Notifier(watch_manager,event_handler)
[0123] watch_manager.add_watch(' / opt / instructions',pyinotify.IN_CREATE)
[0124] #Start monitoring
[0125] notifier.loop()
[0126] Based on the same inventive concept, the present invention also proposes a device for automatically resolving system resource contention conflicts based on an AI algorithm. The implementation of the device can refer to the implementation of the above method, and the repeated parts will not be repeated. The term "module" used below can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0127] Figure 5 Schematic diagram of the structure of the device for automatically resolving system resource contention conflicts based on AI algorithm of the present invention. Figure 5 As shown, the device comprises:
[0128] The information collection module 110 runs a resource monitoring process to monitor the usage of CPU, memory and storage core resources;
[0129] The autonomous decision-making module 120 detects the status of the information collection process, and if the status is running, starts the autonomous decision-making process and receives detailed information of all resources, and generates a series of execution instructions through a built-in AI algorithm;
[0130] The instruction execution module 130 monitors the generation of instruction files in the specified directory through the inotify mechanism in Liunx, and immediately captures the event when a new instruction file is generated; and executes operations one by one in the order in which the instruction files are generated through the administrator account.
[0131] The information collection module 110 includes:
[0132] Subprocess module: When the resource monitoring process detects that the core resources exceed the preset threshold, the process will automatically start the subprocess, which is the information collection process responsible for collecting detailed information of all processes, including process ID, parent process ID, user ID, priority, status, and resource usage;
[0133] In the information transmission module, the collected information will be transmitted to the autonomous decision-making function through the communication protocol in a pre-defined interface format, and activated for further decision-making and response.
[0134] The AI algorithms built into the autonomous decision-making module 120 include:
[0135] AI algorithm building module, based on random game and intelligent planning unified modeling, the model is represented by a five-tuple: M = (S, A, T, R, γ),
[0136] S indicates the current system resource usage, task status, and user needs. The status includes CPU, memory, and storage usage, currently running tasks, and the priority of each task.
[0137] A represents the specific operations taken by the process to allocate resources, schedule tasks, etc.;
[0138] T represents the state transition function, the probability of taking action a in state S and transferring to state S′;
[0139] R represents the reward function, which is the immediate reward or cost obtained after taking action a in state S;
[0140] γ represents the discount factor, which is a constant between 0 and 1 and is used to discount future rewards;
[0141] The solution module, heuristic search, selects the optimal action to minimize the total cumulative cost by evaluating the cost and potential benefit of each state.
[0142] The solution module includes: designing a heuristic function h(S), calculating the minimum cost from state S to the target state, and adopting a multi-factor conforming heuristic function: h(S)=w1*current resource utilization+w2*priority of the highest priority task, where w1 and w2 are weights used to balance the influence of resource utilization and task priority in the estimation.
[0143] It should be noted that although several modules of the device for automatically resolving system resource contention conflicts based on the AI algorithm are mentioned in the above detailed description, this division is only exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules described above can be concretized in one module. Conversely, the features and functions of one module described above can be further divided into multiple modules to be concretized.
[0144] Based on the above invention concept, Figure 5 As shown, the present invention also proposes a computer device 200, including a memory 210, a processor 220, and a computer program 230 stored in the memory 210 and executable on the processor 220. When the processor 220 executes the computer program 230, the aforementioned method for automatically resolving system resource contention conflicts based on an AI algorithm is implemented.
[0145] Based on the aforementioned inventive concept, the present invention further proposes a computer-readable storage medium, which stores a computer program for executing the aforementioned method for automatically resolving system resource contention conflicts based on an AI algorithm.
[0146] The present invention discloses a method and device for automatically resolving system resource contention conflicts based on an AI algorithm, which applies a random game five-tuple model to system resource contention conflicts and can accurately reflect various unpredictable factors that may occur in the resource allocation process, such as a sudden increase in resource requests, a delay in resource release, etc.
[0147] The present invention has the ability to make decisions autonomously and continuously optimize resource management strategies through learning and adaptation. The introduction of algorithms such as heuristic search can quickly find the optimal solution and ensure that the system can still operate efficiently in complex environments;
[0148] The present invention can respond to resource conflicts and changes in real time by monitoring system status and event triggering mechanisms. For example, the inotify mechanism monitors the generation of instruction files and performs resource adjustment operations in real time to ensure that the system responds quickly and accurately.
[0149] Although the spirit and principle of the present invention have been described with reference to several specific embodiments, it should be understood that the present invention is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present invention is intended to cover various modifications and equivalent arrangements contained in the spirit and scope of the attached claims.
[0150] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0151] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0152] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0153] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0154] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0155] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0156] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0157] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
[0158] Regarding the limitation of the protection scope of the present invention, those skilled in the art should understand that, based on the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative work are still within the protection scope of the present invention.
Claims
1. A method for automatically resolving system resource contention conflicts based on an AI algorithm, characterized in that: The method includes: S01, information collection, running resource monitoring process, monitoring the usage of CPU, memory and storage core resources; S02, autonomous decision-making, detect the status of the information collection process, the status is running, start the autonomous decision-making process and receive detailed information of all resources, and generate a series of execution instructions through the built-in AI algorithm; S03, command execution, through the inotify mechanism in Liunx, monitor the generation of command files in the specified directory, and immediately capture the event when a new command file is generated; through the administrator account, execute operations one by one in the order in which the command files are generated.
2. The method for automatically resolving system resource contention conflicts based on an AI algorithm according to claim 1, characterized in that: The S01 includes: S011. When the resource monitoring process detects that the core resources exceed the preset threshold, the process will automatically start a child process, which is an information collection process responsible for collecting detailed information of all processes, including process ID, parent process ID, user ID, priority, status, and resource usage; S012. The collected information will be transmitted to the autonomous decision-making function through the communication protocol in a pre-defined interface format, and activated to make further decisions and responses.
3. According to the method for automatically resolving system resource contention conflicts based on AI algorithm according to claim 1, the AI algorithm built in S02 comprises: S021. Based on the unified modeling of random game and intelligent planning, the model is represented by a five-tuple: M = (S, A, T, R, γ), S indicates the current system resource usage, task status, and user needs. The status includes CPU, memory, and storage usage, currently running tasks, and the priority of each task. A represents the specific operations taken by the process to allocate resources, schedule tasks, etc.; T represents the state transition function, the probability of taking action a in state S and then transferring to state S′; R represents the reward function, which is the immediate reward or cost obtained after taking action a in state S; γ represents the discount factor, which is a constant between 0 and 1 and is used to discount future rewards; S022. Solution: Heuristic search, by evaluating the cost and potential benefit of each state, select the optimal action to minimize the total cumulative cost.
4. According to the method for automatically resolving system resource contention conflicts based on an AI algorithm according to claim 3, the S022 comprises: Design a heuristic function h(S) to calculate the minimum cost from state S to the target state, and use a multi-factor conforming heuristic function: h(S) = w1*current resource utilization + w2*priority of the highest priority task, where w1 and w2 are weights used to balance the influence of resource utilization and task priority in the estimation.
5. A device for automatically resolving system resource contention conflicts based on an AI algorithm, characterized in that: The device includes: Information collection module, running resource monitoring process, monitoring the usage of CPU, memory and storage core resources; The autonomous decision-making module detects the status of the information collection process. If the status is running, it starts the autonomous decision-making process and receives detailed information about all resources, and generates a series of execution instructions through the built-in AI algorithm; The command execution module uses the inotify mechanism in Liunx to monitor the generation of command files in the specified directory. When a new command file is generated, it immediately captures the event; through the administrator account, it executes operations one by one in the order in which the command files are generated.
6. The device for automatically resolving system resource contention conflicts based on AI algorithm according to claim 5, characterized in that: The information collection module includes: Subprocess module: When the resource monitoring process detects that the core resources exceed the preset threshold, the process will automatically start the subprocess, which is the information collection process responsible for collecting detailed information of all processes, including process ID, parent process ID, user ID, priority, status, and resource usage; In the information transmission module, the collected information will be transmitted to the autonomous decision-making function through the communication protocol in a pre-defined interface format, and activated for further decision-making and response.
7. The device for automatically resolving system resource contention conflicts based on AI algorithm according to claim 5, characterized in that: The AI algorithms built into the autonomous decision-making module include: AI algorithm building module, based on random game and intelligent planning unified modeling, the model is represented by a five-tuple: M = (S, A, T, R, γ), S indicates the current system resource usage, task status, and user needs. The status includes CPU, memory, and storage usage, currently running tasks, and the priority of each task. A represents the specific operations taken by the process to allocate resources, schedule tasks, etc.; T represents the state transition function, the probability of taking action a in state S and then transferring to state S′; R represents the reward function, which is the immediate reward or cost obtained after taking action a in state S; γ represents the discount factor, which is a constant between 0 and 1 and is used to discount future rewards; The solution module, heuristic search, selects the optimal action to minimize the total cumulative cost by evaluating the cost and potential benefit of each state.
8. The device for automatically resolving system resource contention conflicts based on AI algorithm according to claim 7, characterized in that: The solution module includes: designing a heuristic function h(S), calculating the minimum cost from state S to the target state, and adopting a multi-factor conforming heuristic function: h(S)=w1*current resource utilization+w2*priority of the highest priority task, where w1 and w2 are weights used to balance the influence of resource utilization and task priority in the estimation.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the method according to any one of claims 1 to 4.
