Resource management method and device, computer equipment and storage medium
By configuring and allocating resources on different CPU cores, the problem of resource competition in the autonomous driving system is solved, and efficient resource utilization and system stability and responsiveness are improved.
Patent Information
- Application Number
- CN202510551706.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-15
AI Technical Summary
In the existing autonomous driving system, multiple node service processes share CPU resources on the same domain controller, resulting in resource competition problems, affecting task processing delays with high real-time requirements, and degrading the overall system performance.
The service process of the first link node is configured in the first CPU core among the multiple CPU cores, the service process of the second link node is configured in the second CPU core among the multiple CPU cores, and CPU resources are allocated in each CPU core according to real-time priority to ensure that critical tasks are given priority to resources.
Through resource isolation and priority management, resource competition is avoided, latency processing is reduced, the overall performance and stability of the system are improved, and real-time response to critical tasks is ensured.
Smart Images

Figure CN120492148A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of autonomous driving operating systems, and specifically to a resource management method, a resource management device, a computer device, and a computer storage medium. Background Art
[0002] With the rapid development of computer technology, the demands placed on central processing unit (CPU) resources by various tasks are becoming increasingly complex and diverse. For example, in the field of autonomous driving, the Robot Operating System (ROS), a widely used middleware in robotics and autonomous driving, is crucial for the reliability of the entire system. The ROS system executes complex tasks through multiple node service processes, which require efficient coordination to ensure real-time responsiveness and safe operation of autonomous vehicles.
[0003] In existing application control systems, multiple node service processes usually run on the same domain controller and share CPU resources. This causes tasks with high real-time requirements to be delayed due to resource competition, making it difficult to meet the requirements of tasks with high real-time requirements, thereby affecting the overall performance of the system.
[0004] Therefore, there is an urgent need for a technical solution that can efficiently utilize CPU resources to improve the overall performance of the system. Summary of the Invention
[0005] In the embodiments of the present application, a resource management method, a resource management method apparatus, a computer device, and a computer storage medium are provided, thereby overcoming, at least to a certain extent, the technical problems of the overall system performance caused by resource competition among multiple processes in existing application control systems due to the limitations and defects of related technologies, resulting in delayed processing of tasks with high real-time requirements.
[0006] A first aspect of an embodiment of the present application provides a resource management method, which is applied to an application control system, wherein the application control system includes multiple link nodes, and the multiple link nodes include at least a first link node and a second link node. The method includes: pre-configuring a first service process of the first link node on a first CPU core among multiple central processing unit CPU cores, and configuring a second service process of the second link node on a second CPU core among multiple CPU cores; determining a real-time priority configured for the first service process in response to receiving service requests from multiple link nodes; allocating CPU resources to the first service process in the first CPU core according to the real-time priority of the first service process, so as to process a first task of the first service process based on the CPU resources allocated to the first CPU core, and allocating CPU resources to the second service process in the second CPU core, so as to process a second task of the second service process based on the CPU resources allocated to the second CPU core.
[0007] According to a second aspect of an embodiment of the present application, a resource management device is provided, which is applied to an application control system, wherein the application control system includes multiple link nodes, and the multiple link nodes include at least a first link node and a second link node. The device includes: a process configuration module, which is used to pre-configure a first service process of the first link node in a first CPU core among multiple central processing unit CPU cores, and to configure a second service process of the second link node in a second CPU core among multiple CPU cores; a priority determination module, which is used to determine a real-time priority configured for the first service process in response to receiving service requests from multiple link nodes; and a resource allocation module, which is used to allocate CPU resources to the first service process in the first CPU core according to the real-time priority of the first service process, so as to process the first task of the first service process based on the CPU resources allocated to the first CPU core, and to allocate CPU resources to the second service process in the second CPU core, so as to process the second task of the second service process based on the CPU resources allocated to the second CPU core.
[0008] According to a third aspect of an embodiment of the present application, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any of the above resource management methods are implemented.
[0009] According to a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above resource management methods are implemented.
[0010] A fifth aspect of the embodiments of the present application provides a computer program product, including a computer program, which is executed by a processor to implement the steps of any one of the above resource management methods.
[0011] The technical solution of this application has the following beneficial effects:
[0012] This resource management method pre-configures a first service process of a first link node on a first CPU core among multiple central processing unit (CPU) cores, and a second service process of a second link node on a second CPU core among multiple CPU cores; in response to receiving service requests from multiple link nodes, determines a real-time priority configured for the first service process; allocates CPU resources to the first service process in the first CPU core based on the real-time priority of the first service process, so that the first task of the first service process is processed based on the CPU resources allocated to the first CPU core; and allocates CPU resources to the second service process in the second CPU core, so that the second task of the second service process is processed based on the CPU resources allocated to the second CPU core. On the one hand, this method configures the first service process of the first link node and the second service process of the second link node on different CPU cores, thereby avoiding resource competition between different service processes and reducing the problem of delayed processing caused by the first service process's inability to obtain resources in a timely manner, thereby improving the overall performance of the system. On the other hand, by pre-setting the real-time priority of the first service process, this method ensures that the first service process with higher real-time requirements can obtain CPU resources first, thereby reducing the problem of difficulty in coordinating multiple processes and improving the stability and responsiveness of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0014] Figure 1 An application architecture diagram of a resource management system provided in one embodiment of the present application;
[0015] Figure 2 A flowchart of a resource management method provided in one embodiment of the present application;
[0016] Figure 3 A flowchart of a method for allocating CPU resources in this exemplary embodiment is schematically shown;
[0017] Figure 4 A flowchart of another method for allocating CPU resources provided in one embodiment of the present application;
[0018] Figure 5 A schematic diagram of the structure of a resource management device provided in one embodiment of the present application;
[0019] Figure 6 A schematic diagram of the computer device structure provided for one embodiment of the present application. DETAILED DESCRIPTION
[0020] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present disclosure will be more comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or that other methods, components, devices, steps, etc. may be employed. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0021] In addition, the accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0022] The flowcharts shown in the accompanying drawings are merely exemplary and do not necessarily include all steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to actual circumstances.
[0023] In the relevant technical context, with the rapid development of autonomous driving technology, the Robot Operating System (ROS), a widely used middleware in the robotics and autonomous driving fields, has become increasingly important. Its performance and stability are crucial to the reliability of the entire system. The ROS system executes complex tasks through multiple node service processes, which require efficient coordination to ensure real-time responsiveness and safe driving for autonomous vehicles.
[0024] The existing ROS autonomous driving system has the following technical problems:
[0025] 1) Multi-process coordination problem: In the ROS autonomous driving system, multiple node service processes may run simultaneously on the same domain controller (DC), allowing multiple node service processes to share central processing unit (CPU) resources. Due to the real-time nature of the ROS system and the diversity of tasks, the demand for CPU resources by different node service processes may fluctuate greatly, making it difficult to balance resources.
[0026] 2) Resource competition and priority issues: Under high load conditions, some node service processes may not be processed in a timely manner due to resource competition, which can easily lead to delays in critical tasks and affect the safety and efficiency of autonomous driving.
[0027] 3) System stability and responsiveness issues: Autonomous driving systems require high stability and fast response, and any abnormality in the node service process will affect the stability of the entire autonomous driving system. Especially in emergency situations, the responsiveness of key links is directly related to the safety of passengers and vehicles.
[0028] 4) Complexity of resource management: With the development of autonomous driving technology, the system becomes more complex and the number of sensors and actuators involved increases, resulting in more diverse and complex demands on CPU resources.
[0029] 5) Real-time and deterministic issues: Autonomous driving systems need to meet real-time and deterministic requirements, which means that the system must respond to external events within a specified time without being interfered with by other processes.
[0030] 6) System monitoring and fault diagnosis: When a system anomaly occurs, it is necessary to quickly locate the source of the problem so that timely measures can be taken. Existing monitoring tools may not provide enough information to help quickly diagnose and solve the problem.
[0031] 7) Full utilization of hardware resources: While ensuring system stability and security, it is also necessary to maximize the utilization efficiency of hardware resources to avoid resource waste.
[0032] 8) Software and hardware compatibility issues: Autonomous driving systems may need to run on different hardware platforms, which requires resource management solutions to have good compatibility and portability.
[0033] Taking the above-mentioned problems into consideration, the exemplary embodiment of the present disclosure proposes a resource management method, which pre-configures the first service process of the first link node in the first CPU core of multiple central processing unit CPU cores, and configures the second service process of the second link node in the second CPU core of multiple CPU cores; in response to receiving service requests from multiple link nodes, determines the real-time priority configured for the first service process; allocates CPU resources to the first service process in the first CPU core according to the real-time priority of the first service process, and allocates CPU resources to the second service process in the second CPU core. On the one hand, the method configures the first service process of the first link node and the second service process of the second link node in different CPU cores, which can avoid resource competition between different service processes, reduce the delay processing problem caused by the first service process's inability to obtain resources in a timely manner, and thus improve the overall performance of the system. On the other hand, the method ensures that the first service process with higher real-time requirements for tasks can obtain CPU resources first by pre-setting the real-time priority of the first service process, thereby reducing the problem of difficulty in coordinating multiple processes and improving the stability and responsiveness of the system.
[0034] The following will be combined Figure 1 , a resource management method and device proposed in this disclosure is applied to Figure 1 The embodiments are described in the system architecture of the exemplary application environment shown.
[0035] like Figure 1 As shown, it is a schematic diagram of an application scenario provided by an embodiment of the present application, in which a terminal device 101 and a server 102 may be included.
[0036] The terminal device 101 can be, for example, a mobile phone, a tablet computer (PAD), a laptop computer, a desktop computer, a smart TV, a smart car device, a smart wearable device, a smart TV, an aircraft, or any other device involved in resource management. The terminal device 101 can be installed with a target application, and the target application can have the function of initiating task requests and displaying task processing results. The application involved in the embodiment of the present application can be a software client or a client such as a web page or a small program. The server 102 is a server corresponding to the software or web page, small program, etc., and does not limit the specific type of the client.
[0037] Server 102 may be a backend server for a target application, configured to provide corresponding backend services, such as resource management services, etc. It may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It may also 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 Network (CDN), and big data and artificial intelligence platforms, but is not limited thereto.
[0038] The server 102 and the terminal device 101 may each include one or more processors, memories, and interactive I / O interfaces. Furthermore, the server 102 may also be configured with a database that can be used to store configuration files added for resource management. The memories of the server 102 and the terminal device 101 may also store program instructions required for execution in the resource management method provided in the embodiments of the present application. These program instructions, when executed by the processor, can be used to implement the resource management process provided in the embodiments of the present application.
[0039] In the embodiment of the present application, the terminal device 101 and the server 102 can be directly or indirectly connected to each other through one or more networks 103. The network 103 can be a wired network or a wireless network. For example, the wireless network can be a mobile cellular network or a Wireless Fidelity (WIFI) network. Of course, it can also be other possible networks, which are not limited in the embodiment of the present application. It should be noted that Figure 1 The figures are only examples. In fact, the number of terminal devices and servers is not limited and is not specifically limited in the embodiments of this application.
[0040] Taking the application control system as the ROS autonomous driving system as an example, in an exemplary embodiment, a user may initiate an autonomous driving task through a terminal device 101 (such as an unmanned vehicle), and the above-mentioned server 102 may pre-configure the first service process of the first link node on the first CPU core among multiple central processing unit CPU cores, and configure the second service process of the second link node on the second CPU core among the multiple CPU cores; in response to receiving service requests from multiple link nodes, determine the real-time priority configured for the first service process; allocate CPU resources to the first service process in the first CPU core according to the real-time priority of the first service process, so as to process the first task of the first service process based on the CPU resources allocated to the first CPU core, and allocate CPU resources to the second service process in the second CPU core, so as to process the second task of the second service process based on the CPU resources allocated to the second CPU core.
[0041] Below, in combination with the application scenarios described above, the method provided by the exemplary embodiment of the present application is described with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation methods of the present application are not limited in this respect.
[0042] Figure 2 A flowchart schematically illustrates a resource management method in this exemplary embodiment. The method may be executed by a computer device, which may be Figure 1 The terminal device or server shown in FIG. 1 is used as the execution subject below to illustrate the resource management method applied to the server 102. The server 102 runs an application control system, which can be a control system that requires CPU resources in any scenario, and includes multiple link nodes, including at least a first link node and a second link node. Figure 2 The resource management method provided by the embodiment of the present disclosure includes the following steps 201 to 203:
[0043] Step 201: pre-configure a first service process of a first link node on a first CPU core among a plurality of central processing unit (CPU) cores, and pre-configure a second service process of a second link node on a second CPU core among a plurality of CPU cores.
[0044] Step 202: In response to receiving service requests from multiple link nodes, determine a real-time priority configured for a first service process.
[0045] Step S203: Allocate CPU resources to the first service process in the first CPU core according to the real-time priority of the first service process, so as to process the first task of the first service process based on the CPU resources allocated by the first CPU core, and allocate CPU resources to the second service process in the second CPU core, so as to process the second task of the second service process based on the CPU resources allocated by the second CPU core.
[0046] In the above Figure 2In the technical solution provided by the illustrated embodiment, a first service process of a first link node is pre-configured on a first CPU core among multiple central processing unit CPU cores, and a second service process of a second link node is pre-configured on a second CPU core among multiple CPU cores; in response to receiving service requests from multiple link nodes, a real-time priority configured for the first service process is determined; CPU resources are allocated to the first service process in the first CPU core based on the real-time priority of the first service process, so that the first task of the first service process is processed based on the CPU resources allocated to the first CPU core, and CPU resources are allocated to the second service process in the second CPU core, so that the second task of the second service process is processed based on the CPU resources allocated to the second CPU core. On the one hand, this method configures the first service process of the first link node and the second service process of the second link node in different CPU cores, which can avoid resource competition between different service processes, reduce the problem of delayed processing caused by the first service process's inability to obtain resources in a timely manner, and thus improve the overall performance of the system. On the other hand, by pre-setting the real-time priority of the first service process, this method ensures that the first service process with higher real-time requirements can obtain CPU resources first, thereby reducing the problem of difficulty in coordinating multiple processes and improving the stability and responsiveness of the system.
[0047] The following will be combined with specific embodiments to Figure 2 The specific implementation of each step in the embodiment shown is described in detail:
[0048] In step 201 , a first service process of a first link node is pre-configured in a first CPU core among a plurality of CPU cores, and a second service process of a second link node is pre-configured in a second CPU core among a plurality of CPU cores.
[0049] The first link node may be a key link node in the application control system, such as a link node with high real-time requirements, and the second link node may be an ordinary link node in the application control system. The first link node corresponds to one or more first service processes, and the second link node corresponds to one or more second service processes.
[0050] Exemplarily, the server pre-configures the first service process of the first link node and the second service process of the second link node in different CPU cores among the multiple CPU cores of the central processing unit. That is, the first service process of the first CPU core is configured in the first CPU core among the multiple CPU cores of the central processing unit, and the second service process of the second link node is configured in the second CPU core among the multiple CPU cores.
[0051] In this embodiment, the service process of the critical link node (i.e., the first service process of the first link node) is bound to a specific first CPU core, which can avoid competing for resources with the service process of the ordinary priority node (i.e., the second service process of the second link node) on the same CPU core. This approach can effectively reduce the overhead of context switching and improve the response speed and stability of the system.
[0052] In step 202, in response to receiving service requests from a plurality of link nodes, a real-time priority configured for a first service process is determined.
[0053] For example, upon receiving service requests from multiple link nodes, it is necessary to prioritize the real-time priority configured for the first service process. In this embodiment, determining the real-time priority of the first service process of the first link node can ensure that critical tasks receive priority CPU resources during application control, thereby reducing a series of issues caused by delayed processing of critical tasks due to resource competition. For example, in the field of autonomous driving, this can avoid technical issues such as delayed processing of critical tasks due to resource competition, which can affect the safety and efficiency of autonomous driving.
[0054] In an optional embodiment of the present disclosure, when executing step 202, a first configuration file may be pre-added for the first link node to determine the real-time priority of the first service process in the first link node based on the first configuration file.
[0055] Exemplarily, the system administrator may predetermine the real-time priority of the first service process corresponding to the first link node and generate a corresponding first configuration file. The server may determine the real-time priority of the first service process in the first link node by reading the first configuration file.
[0056] In this embodiment, management is performed through the first configuration file, which facilitates adjustments by the system administrator according to actual needs, thereby improving the flexibility of priority setting.
[0057] In step 203, CPU resources are allocated to the first service process in the first CPU core according to the real-time priority of the first service process, so that the first task of the first service process is processed based on the CPU resources allocated by the first CPU core, and CPU resources are allocated to the second service process in the second CPU core, so that the second task of the second service process is processed based on the CPU resources allocated by the second CPU core.
[0058] Exemplarily, the server may allocate CPU resources to the first service process in the first CPU core and allocate CPU resources to the second service process in the second CPU core according to the real-time priority of the first service process.
[0059] Multiple first service processes also have corresponding priorities, so CPU resources are allocated to first service processes with higher priorities in the first CPU core according to real-time priority, so as to ensure priority allocation of resources for critical tasks and reduce the negative impact of delayed processing.
[0060] In order to further ensure that high-priority tasks can be processed by CPU resources and to achieve isolation between resources, a specific CPU resource space may be divided for the multiple first service processes on a specific first CPU core.
[0061] In an optional embodiment of the present disclosure, when determining the number of service processes of multiple first service processes; based on the number of service processes of the first service processes, dividing multiple CPU resource spaces for the multiple first service processes in the first CPU core; according to the real-time priority of the first service process, allocating the multiple first service processes to the corresponding CPU resource space, so as to allocate CPU resources to the first service process based on the CPU resource space.
[0062] For example, when there are multiple first service processes in the first link node, the first CPU core can be divided into multiple CPU resource spaces according to the number of service processes of the multiple first service processes, and the multiple first service processes can be allocated to the corresponding CPU resource spaces, so that isolation between multiple CPU resources can be achieved.
[0063] In this embodiment, the first service process of the critical link node (i.e., the first link node) runs in a specific space on a specific first CPU core. When there are multiple first service processes, the multiple first service processes each run in their own specific space on a specific first CPU core, thereby achieving resource isolation and ensuring that high-priority tasks can be processed in a timely manner.
[0064] Furthermore, when the number of first service processes of key link nodes is large, there is inevitably a problem of CPU resource shortage, which can be exemplified with reference to the following embodiments.
[0065] Figure 3 A flowchart of a method for allocating CPU resources in this exemplary embodiment is schematically shown. Figure 3 In an optional embodiment of the present disclosure, step S203 allocates CPU resources to the first service process in the first CPU core and allocates CPU resources to the second service process in the second CPU core according to the real-time priority of the first service process, including the following steps 301 to 303:
[0066] Step 301: Determine whether the amount of idle CPU resources in a first CPU core is less than an idle resource threshold or less than the amount of CPU resources required by a first service process.
[0067] If the amount of idle CPU resources in the first CPU core is less than the idle resource threshold or less than the amount of CPU resources required by the first service process, step 302 is executed to convert the second CPU core into the first CPU core to obtain the converted first CPU core.
[0068] Then, step 303 is executed to allocate CPU resources to the first service process in the converted first CPU core.
[0069] On the contrary, if the amount of idle CPU resources in the first CPU core is greater than or equal to the idle resource threshold or less than the amount of CPU resources required by the first service process, no task scheduling is required, and only the amount of idle CPU resources in the first CPU core needs to be allocated to each service request.
[0070] Figure 4 A flowchart schematically illustrates another method for allocating CPU resources in this exemplary embodiment. Figure 4 In an optional embodiment of the present disclosure, when converting the second CPU core into the first CPU core in step 302 to obtain the converted first CPU core, the following steps 401 to 404 are included:
[0071] Step 401: Count the amount of idle resources in each second CPU core;
[0072] Step 402: Whether there is a CPU core in the second CPU core whose idle resources are greater than the CPU resources required by the first service process.
[0073] If the amount of idle resources in the second CPU core is greater than the amount of CPU resources required by the first service process, step 403 is executed to determine the second CPU core whose idle resources are greater than the amount of CPU resources required by the first service process as the first target CPU core, so as to convert the first target CPU core into the first CPU core and obtain the converted first CPU core.
[0074] On the contrary, if there is no idle resource amount in the second CPU core that is greater than the CPU resource amount required by the first service process, step 404 is executed to release the CPU resource amount occupied by the second target CPU core in the second CPU core, and convert the second target CPU core into the first CPU core to obtain the converted first CPU core.
[0075] In addition to the above embodiment, based on the real-time priority of the first service process, if there are currently fewer idle CPU resources, when the first CPU core receives a first service process with a higher priority, it can first interrupt the processing of the task in the lowest-priority service process and prioritize the allocation of CPU resources to the higher-priority first service process. After the task in the higher-priority first service process is completed, the processing of the task in the lowest-priority service process can be resumed from the point of interruption.
[0076] Furthermore, in an optional embodiment, the server may determine the maximum limit value of the CPU resources occupied by the service process corresponding to each link node based on a preset limit mechanism; and generate a second configuration file based on the maximum limit value corresponding to each link node.
[0077] Exemplarily, the server may determine the maximum limit value of the CPU resources occupied by the service process corresponding to each link node based on a preset limit mechanism, so as to control the maximum limit value of the CPU usage of the service process corresponding to each link node.
[0078] Exemplarily, storing the maximum limit value corresponding to each link node as the second configuration file can facilitate the system administrator to control resource allocation more specifically, thereby optimizing system performance.
[0079] In an optional embodiment, the preset limitation mechanism is a control group CGROUP mechanism based on the Linux kernel.
[0080] The Linux kernel-based control group CGROUP mechanism offers excellent cross-platform compatibility and can be applied to a variety of hardware platforms. Furthermore, the CGROUP mechanism simplifies resource management and provides an effective resource isolation method.
[0081] It's important to note that CGROUP not only limits CPU usage but also manages other resources like memory and network bandwidth, ensuring resource isolation and efficient utilization between different processes. Through the CGROUP mechanism, system administrators can more specifically control resource allocation and optimize system performance.
[0082] In another optional embodiment, only the CPU occupancy of the service process corresponding to the second link node can be managed, for example, by using the Linux system CGROUP mechanism to manage the CPU occupancy of the service process corresponding to the second link node to control the maximum limit value of the occupancy of the service process corresponding to the second link node.
[0083] In an optional embodiment, the amount of CPU resources occupied by each link node is periodically detected; for a target link node among multiple link nodes, if the amount of CPU resources currently occupied by the target link node is greater than a maximum limit, a warning prompt message is sent.
[0084] For example, periodic monitoring of the CPU usage of node service processes is implemented, and an alarm is issued when a set threshold is exceeded. This mechanism helps to locate and resolve problems in a timely manner, ensuring that the system can maintain stable operation under high load conditions.
[0085] It should be understood that, although the various steps in the flowchart are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps may be performed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. The execution order of these sub-steps or stages is not necessarily to be performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0086] To implement the above resource management methods, see Figure 5 An embodiment of the present application provides a resource management device, which is applied to an application control system. The application control system includes multiple link nodes, and the multiple link nodes include at least a first link node and a second link node. The device 500 may include: a process configuration module 501, a priority determination module 502 and a resource allocation module 503.
[0087] Among them, the process configuration module 501 is used to pre-configure the first service process of the first link node in the first CPU core among multiple central processing unit CPU cores, and to configure the second service process of the second link node in the second CPU core among multiple CPU cores; the priority determination module 502 is used to determine the real-time priority configured for the first service process in response to receiving service requests from multiple link nodes; the resource allocation module 503 is used to allocate CPU resources to the first service process in the first CPU core according to the real-time priority of the first service process, so as to process the first task of the first service process based on the CPU resources allocated by the first CPU core, and to allocate CPU resources to the second service process in the second CPU core, so as to process the second task of the second service process based on the CPU resources allocated by the second CPU core.
[0088] In an optional embodiment of the present disclosure, the priority determination module 502 is configured to pre-add a first configuration file for the first link node to determine the real-time priority of the first service process of the first link node based on the first configuration file.
[0089] In an optional embodiment of the present disclosure, the resource allocation module 503 is used to convert the second CPU core into the first CPU core to obtain a converted first CPU core if the amount of CPU resources in the first CPU core in an idle state is less than the idle resource threshold or less than the amount of CPU resources required to be occupied by the first service process; and allocate CPU resources to the first service process in the converted first CPU core.
[0090] In an optional embodiment of the present disclosure, the resource allocation module 503 is used to count the amount of idle resources in each second CPU core; if the amount of idle resources in the second CPU core is greater than the amount of CPU resources required to be occupied by the first service process, the second CPU core with the amount of idle resources greater than the amount of CPU resources required to be occupied by the first service process is determined as the first target CPU core, so as to convert the first target CPU core into the first CPU core to obtain the converted first CPU core; or, if the amount of idle resources in the second CPU core is not greater than the amount of CPU resources required to be occupied by the first service process, the amount of CPU resources occupied in the second target CPU core in the second CPU core is released, and the second target CPU core is converted into the first CPU core to obtain the converted first CPU core.
[0091] In an optional embodiment of the present disclosure, the first link node includes multiple first service processes, and the resource allocation module 503 is used to determine the number of service processes of the multiple first service processes; based on the number of service processes of the first service processes, multiple CPU resource spaces are divided for the multiple first service processes in the first CPU core; according to the real-time priority of the first service process, the multiple first service processes are allocated to the corresponding CPU resource space to allocate CPU resources to the first service process based on the CPU resource space.
[0092] In an optional embodiment of the present disclosure, the device may also include a numerical determination module and a configuration file generation module. The numerical determination module is used to determine the maximum limit value of the CPU resources occupied by the service process corresponding to each link node according to a preset limit mechanism; the configuration file generation module is used to generate a second configuration file according to the maximum limit value corresponding to each link node.
[0093] In an optional embodiment of the present disclosure, the device may also include a detection module and a prompt information sending module, the detection module is used to periodically detect the amount of CPU resources occupied by each link node; the prompt information sending module is used to send a warning prompt message to a target link node among multiple link nodes if the amount of CPU resources currently occupied by the target link node is greater than the maximum limit value.
[0094] In an optional embodiment of the present disclosure, the preset limitation mechanism is a control group CGROUP mechanism based on the Linux kernel.
[0095] For the specific definition of the resource management device, please refer to the definition of the resource management method above, which will not be repeated here. The various modules in the resource management device can be implemented in whole or in part by software, hardware, or a combination thereof. The modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the modules above.
[0096] In one embodiment, a computer device is provided. The internal structure diagram of the computer device can be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a resource management method as described above is implemented. It includes: a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, any step in the resource management method as described above is implemented.
[0097] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any step in the above resource management method can be implemented.
[0098] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0099] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0100] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0101] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0102] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0103] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A resource management method, characterized in that: Applied to an application control system, the application control system includes a plurality of link nodes, the plurality of link nodes including at least a first link node and a second link node, the method comprising: Pre-configuring a first service process of the first link node on a first CPU core among a plurality of central processing unit (CPU) cores, and pre-configuring a second service process of the second link node on a second CPU core among the plurality of CPU cores; In response to receiving service requests from a plurality of link nodes, determining a real-time priority configured for the first service process; Allocate CPU resources to the first service process in the first CPU core according to the real-time priority of the first service process, so as to process the first task of the first service process based on the CPU resources allocated by the first CPU core, and allocate CPU resources to the second service process in the second CPU core, so as to process the second task of the second service process based on the CPU resources allocated by the second CPU core.
2. The method according to claim 1, characterized in that The determining of the real-time priority configured for the first service process includes: A first configuration file is pre-added for the first link node to determine the real-time priority of the first service process of the first link node based on the first configuration file.
3. The method according to claim 1, characterized in that The allocating CPU resources to the first service process in the first CPU core according to the real-time priority of the first service process includes: If the amount of idle CPU resources in the first CPU core is less than an idle resource threshold or less than the amount of CPU resources required by the first service process, converting the second CPU core into a first CPU core to obtain a converted first CPU core; Allocate CPU resources to the first service process in the converted first CPU core.
4. The method according to claim 3, characterized in that Converting the second CPU core into a first CPU core to obtain a converted first CPU core includes: Count the amount of idle resources in each second CPU core; If the amount of idle resources in the second CPU core is greater than the amount of CPU resources required by the first service process, the second CPU core whose idle resources are greater than the amount of CPU resources required by the first service process is determined as the first target CPU core, so as to convert the first target CPU core into the first CPU core, thereby obtaining a converted first CPU core. Alternatively, if there is no idle resource in the second CPU core that is greater than the CPU resource required by the first service process, the CPU resource occupied in the second target CPU core in the second CPU core is released, and the second target CPU core is converted into the first CPU core to obtain the converted first CPU core.
5. The method according to claim 1, wherein The first link node includes a plurality of first service processes, and allocating CPU resources to the first service processes in the first CPU core according to the real-time priorities of the first service processes includes: determining the number of service processes of the plurality of first service processes; Based on the number of service processes of the first service process, allocating multiple CPU resource spaces for the multiple first service processes in the first CPU core; According to the real-time priority of the first service process, the multiple first service processes are allocated to corresponding CPU resource spaces, so as to allocate CPU resources to the first service processes based on the CPU resource spaces.
6. The method according to claim 1, characterized in that The method further comprises: Determine the maximum limit value of the CPU resources occupied by the service process corresponding to each link node based on a preset limit mechanism; A second configuration file is generated based on the maximum limit value corresponding to each link node.
7. The method according to claim 6, characterized in that The method further comprises: Periodically detecting the amount of CPU resources occupied by each link node; For a target link node among the multiple link nodes, if the amount of CPU resources currently occupied by the target link node is greater than the maximum limit value, a warning prompt message is sent.
8. The method according to claim 6, characterized in that The preset limitation mechanism is a control group CGROUP mechanism based on the Linux kernel.
9. A resource management device, characterized in that: Applied to an application control system, the application control system includes a plurality of link nodes, the plurality of link nodes including at least a first link node and a second link node, the device includes: a process configuration module, configured to pre-configure a first service process of the first link node on a first CPU core among a plurality of central processing unit (CPU) cores, and to pre-configure a second service process of the second link node on a second CPU core among the plurality of CPU cores; a priority determination module, configured to determine a real-time priority configured for the first service process in response to receiving service requests from a plurality of link nodes; a resource allocation module, configured to allocate CPU resources to the first service process in the first CPU core according to the real-time priority of the first service process, so as to process the first task of the first service process based on the CPU resources allocated by the first CPU core, and to allocate CPU resources to the second service process in the second CPU core, so as to process the second task of the second service process based on the CPU resources allocated by the second CPU core.
10. A computer device comprising: The method comprises a memory and a processor, wherein the memory stores a computer program, and is characterized in that the processor implements the steps of the resource management method according to any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the resource management method according to any one of claims 1 to 8 are implemented.