Process management system, method and equipment and storage medium
By configuring registers in the command processing unit to trigger process cleanup signals, the problem of slow process startup caused by hardware reset is solved, enabling fast and efficient process termination and resource reclamation, and improving the flexibility and efficiency of process management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI BIREN TECH CO LTD
- Filing Date
- 2026-03-24
- Publication Date
- 2026-04-21
AI Technical Summary
In complex computing scenarios, existing technologies require hardware reset to terminate computing device processes, which slows down the startup and execution of subsequent processes. Furthermore, the hardware reset operation is complex and affects other processes.
By configuring the first register in the command processing unit, a process cleanup signal is triggered, and the control device stops acquiring command messages and sends cleanup tasks without relying on hardware reset, thereby releasing computing resources and realizing process termination and resource reclamation.
It achieves fast and efficient process termination and resource reclamation, avoiding repeated initialization processes caused by hardware reset, and greatly reducing the time for secondary startup.
Smart Images

Figure CN121900979A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of chip technology, and more specifically, to a process management system, method, apparatus, and storage medium. Background Technology
[0002] Computing devices, represented by Graphics Processing Units (GPUs), have been widely used in general computing and have become core hardware in complex scenarios such as Artificial Intelligence (AI) and scientific computing. In these complex scenarios, a single process on a computing device typically contains a large number of tasks. During development, debugging, or operation, various reasons, such as program exceptions or user intervention, may necessitate terminating the current process.
[0003] In related technologies, computing devices typically terminate processes by resetting the hardware associated with the process to restore it to its initial state. However, this method usually requires reconfiguration after a hardware reset, affecting the rapid startup and execution of subsequent processes. Therefore, how to stop a process without relying on a hardware reset has become a pressing technical problem. Summary of the Invention
[0004] In view of this, the present disclosure proposes a new technical solution for process management.
[0005] According to a first aspect of the present disclosure, a process management system is provided, the process management system including a control device and a computing device, the computing device including a command processing unit and a computing unit, the command processing unit including a first register; wherein: The control device is configured to configure a first register in the command processing unit when it is determined that the target process needs to be terminated, so as to trigger a process cleanup signal corresponding to the target process through the first register. The command processing unit is configured to, when the first register does not trigger the process cleanup signal, acquire a command message corresponding to the target process, generate a target task corresponding to the target process based on the command message, and send the target task to the computing unit; or, when the first register triggers the process cleanup signal, stop acquiring the command message corresponding to the target process and send a target cleanup task for the target process to the computing unit, so that the computing unit releases the computing resources corresponding to the target process.
[0006] Optionally, the command processing unit further includes a command acquisition module, a task management module, and a process management module; wherein: The command acquisition module is configured to acquire and store the command message corresponding to the target process when the first register does not trigger a process cleanup signal; or, when the first register triggers a process cleanup signal, stop acquiring the command message corresponding to the target process. The task management module is used to extract the command message stored in the command acquisition module, generate one or more target tasks corresponding to the target process according to the command message, and send the target task to the computing unit through the process management module so that the computing unit executes the target task in the target process. The process management module is configured to send the target task of the task management module to the computing unit when the first register does not trigger a process cleanup signal; or, when the first register triggers a process cleanup signal, send the target cleanup task to the computing unit and discard the target task sent by the task management module.
[0007] Optionally, the process management module includes a process cleanup task generation module and a process cleanup task monitoring module; wherein: The process cleanup task generation module is used to generate the target cleanup task when the process cleanup signal is triggered by the first register. The process cleanup task monitoring module is used to send the target cleanup task to the computing unit when the target cleanup task is detected to be generated, and to discard the target task sent to the computing unit by the task management module.
[0008] Optionally, the first register includes a process identifier register, a command acquisition control register corresponding to the command acquisition module, and a process cleanup control register corresponding to the process management module; The control device is specifically configured, when determining that a target process needs to be terminated, to configure the value of the process identifier register to the process identifier of the target process, configure the value of the command acquisition control register to a first target value to trigger a first cleanup signal in the process cleanup signals, and configure the value of the process cleanup control register to a second target value to trigger a second cleanup signal in the process cleanup signals; wherein, the first cleanup signal is used to instruct the command acquisition module to stop acquiring command messages corresponding to the target process, and the second cleanup signal is used to instruct the process management module to send a target cleanup task to the computing unit and discard the target task sent by the task management module.
[0009] Optionally, the command acquisition module includes multiple command queues, and the command acquisition control register includes a queue mask register corresponding to each of the command queues; each command queue stops acquiring the command message based on the first cleanup signal triggered by its corresponding queue mask register.
[0010] Optionally, the command processing unit further includes a second register; wherein, The control device is further configured to configure the value of the second register in the command processing unit to trigger a process cleanup end signal when it is determined that the computing resources of the target process have been cleaned up. The command processing unit is configured to restore the value of the first register to its initial value when the second register triggers a process cleanup termination signal, so as to receive a new process start instruction and a command message for obtaining a new process sent by the control device.
[0011] Optionally, the command processing unit further includes a command acquisition module and a queue status register corresponding to the command acquisition module, wherein the queue status register is used to characterize whether there are command messages in the command acquisition module that have not been completed. The control device is used to determine whether the computing resources of the target process have been cleared based on the value of the queue status register.
[0012] According to a second aspect of the present disclosure, a process management method is provided, executed by a control device in a process management system, the process management system further comprising a computing device, the computing device including a command processing unit and a computing unit, the command processing unit including a first register; the method includes: If it is determined that the target process needs to be terminated, the first register in the command processing unit is configured to trigger a process cleanup signal; wherein, the process cleanup signal is used to instruct the command processing unit in the computing device to stop acquiring command messages corresponding to the target process, and to send a target cleanup task to the computing unit so that the computing unit cleans up the computing resources in the target process.
[0013] Optionally, the command processing unit further includes a second register, a command acquisition module, a task management module, and a queue status register corresponding to the command acquisition module, wherein the queue status register is used to indicate whether there are unprocessed command messages in the command acquisition module; the method further includes: The value of the queue status register is used to determine whether the computing resources of the target process have been cleaned up. If it is determined that the computing resources of the target process have been cleaned up, the second register in the command processing unit is configured to trigger a process cleanup end signal; wherein, the process cleanup end signal is used to instruct the command processing unit to restore the value of the first register to its initial value, so as to receive the new process start instruction sent by the control device and the command message for obtaining the new process.
[0014] According to a third aspect of the present disclosure, a computing device is provided, the computing device being connected to a control device, the computing device including a command processing unit and a computing unit, the command processing unit including a first register; wherein: The first register is provided for configuration by the control device, so that when the control device determines that the target process needs to be terminated, it configures the first register in the command processing unit to trigger a process cleanup signal corresponding to the target process through the first register. The command processing unit is configured to stop acquiring command messages corresponding to the target process when the first register triggers a process cleanup signal, and to send a target cleanup task to the computing unit so that the computing unit cleans up the computing resources in the target process.
[0015] According to a fourth aspect of the present disclosure, a control device is provided, including a memory and a processor, the memory being configured to store computer instructions, and the processor being configured to invoke the computer instructions from the memory to perform the method described in the second aspect.
[0016] According to a fifth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, the computer program implementing the method described in the second aspect when executed by a processor.
[0017] The process management system of this embodiment triggers a process cleanup signal by configuring the first register in the command processing unit. This allows the system to flexibly and quickly trigger the termination of the target process by the control device without hardware reset. According to the indication of the first register, the command processing unit can stop acquiring new command messages and send the target cleanup task to the computing unit when the process cleanup is triggered, so that the computing unit releases the corresponding resources. This achieves fast and efficient process termination and resource reclamation, avoids repeated initialization processes, and greatly reduces the time for secondary startup.
[0018] Other features and advantages of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the disclosure.
[0020] Figure 1 This is a schematic diagram of a process management system provided in an embodiment of this disclosure.
[0021] Figure 2 This is a schematic diagram of a computing device provided in an embodiment of this disclosure.
[0022] Figure 3 This is a schematic diagram of another process management system provided in an embodiment of this disclosure.
[0023] Figure 4 This is a flowchart illustrating a process management method provided in an embodiment of this disclosure. Detailed Implementation
[0024] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.
[0025] The following description of at least one exemplary embodiment is merely illustrative and is not intended to limit the scope of this disclosure or its application or use.
[0026] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0027] In all the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0028] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0029] Figure 1 This is a schematic diagram of a process management system provided in an embodiment of this disclosure. Figure 1 As shown, the process management system 1000 may include a computing device 1100, a control device 1200, and a storage device 1300. The computing device, the control device, and the storage device may be connected to each other via a bus or other means. For example, the bus may include a network on chip (NOC).
[0030] In some examples, the storage device can be used to store instructions and / or data that can be accessed and used by a control device or a computing device. For example, the storage device can store program instructions executed by the control device or computing device, as well as data such as text, images, audio, and configuration parameters. The control device can control the computing device to execute related processes or tasks to achieve related system functions, such as artificial intelligence, scientific computing, or image processing functions based on user needs. For example, the control device may be a central processing unit (CPU); the computing device may be a graphics processing unit (GPU), a general-purpose graphics processing unit (GPGPU), a neural network processing unit (NPU), or a tensor processing unit (TPU); and the storage device may be a static random access memory (SRAM), a read-only memory (ROM), or an erasable programmable read-only memory (EPROM).
[0031] It should be noted that, Figure 1 The structure of the process management system shown is illustrative. The process management system in this embodiment is not limited to the above structure and may include more or fewer devices as needed, and the devices may be combined or split. For example, the process management system may include only one or a combination of any two of the above-mentioned computing devices, control devices, and storage devices; for another example, the process management system may also include other devices, such as display devices, input / output devices, etc.; for yet another example, the related functions involved in the control devices and computing devices in the process management system may be performed by the same devices; for yet another example, the control devices, computing devices, and storage devices in the process management system may each be one or more. Furthermore, the computing device may also be called a chip, processor, or artificial intelligence chip, etc., the control device may also be called a main control device or host, and the storage device may also be called memory.
[0032] When computing devices are used in complex functional scenarios such as artificial intelligence, scientific computing, and graphics processing, a single process executed by the device can contain a large number of tasks. During the execution of a particular process, the device may encounter situations where it wants to stop the entire process.
[0033] In related technologies, computing devices typically terminate processes by resetting the hardware associated with the process to restore it to its initial state. However, this method usually requires reconfiguration after a hardware reset, affecting the rapid startup and execution of subsequent processes. Furthermore, directly resetting hardware necessitates unified reset operations on upstream and downstream hardware, requiring a clear definition of the hardware scope; otherwise, it may affect other processes. Therefore, how to stop a process without relying on a hardware reset has become a pressing technical problem.
[0034] To address the problems in related technologies, embodiments of this disclosure provide a method such as... Figure 1 The process management system 1000 shown may include a control device 1200 and a computing device 1100. The computing device 1100 may include a computing unit 1110 and a command processing unit 1120. The computing unit may also be referred to as a computing core, a computational core, or a processing core. A computing device may contain one or more computing units. For example, the computing device may include N computing units, which may jointly or individually execute a process or task. The computing unit may also be referred to as a computing core, a computational core, or a processing core. Taking a GPU as an example, the computing unit may be a GPU Core, and a GPU may include one or more GPU Cores.
[0035] The control device can control the computing device to execute a target process in the following ways: instructing the computing device to perform hardware initialization, configuring the process identifier of the target process to be executed by the computing device, which may be an address space identifier (ASID), and after the computing device is initialized, the control device can send a process start instruction to the computing device to instruct the computing device to obtain the command message corresponding to the target process.
[0036] The command processing unit can acquire command messages (e.g., packets) from the target process from the bus, and parse, reassemble, and distribute these messages. For example, it can decompose command messages into one or more tasks that the computing units can directly recognize and execute, and then allocate and distribute these tasks to the appropriate computing units.
[0037] The computing unit is the core component in a computing device that actually performs computing tasks. After receiving tasks broken down by the command processing unit, the computing unit is responsible for completing the specific arithmetic operations specified by these tasks, such as addition, subtraction, multiplication, division, matrix operations, etc., thereby enabling the normal execution of the target process.
[0038] In some embodiments of this disclosure, the command processing unit may include a set of registers consisting of one or more registers. The command processing unit can receive configuration instructions from the control device through the registers to control the internal operating logic or data flow of the computing device.
[0039] For example, the command processing unit may include a first register, which may be a register used to trigger the cleanup of the target process. The control device can, when needed, configure the first register to trigger the command processing unit to clean up the target process, thereby stopping the execution of the target process and releasing the computing resources occupied by the target process. This achieves process termination without relying on hardware reset. Compared to the hardware reset method in related technologies, this method can achieve process termination more flexibly and quickly, reduces hardware initialization configuration, and facilitates the rapid startup and execution of subsequent processes.
[0040] In some examples, the aforementioned control device can be used to configure a first register in the command processing unit to trigger a process cleanup signal corresponding to the target process when it is determined that the target process needs to be terminated. This process cleanup signal can be used to instruct the command processing unit to stop the target process, for example, to stop acquiring command messages corresponding to the target process, and to send a target cleanup task to the computing unit, so that the computing unit cleans up the computing resources in the target process. The cleaned-up computing resources can then be reallocated to other processes.
[0041] For example, software can run on the control device. When the software determines that a target process needs to be terminated, it can configure a first register in the command processing unit to a target value (e.g., 1), thereby triggering a process cleanup signal corresponding to the target process through this first register. The target value can be a value different from the initial value of the first register; for example, if the initial value is 0, the target value can be 1, indicating that the first register is pulled high. The value of the first register can be set to the initial value during the initialization of the process management system or computing device. Optionally, when the control device determines that a target process needs to be terminated, it can delete the command message of the target process or release the storage resources corresponding to the command message.
[0042] In this example, the control device can determine that the target process needs to be terminated in several ways: for example, the control device can receive a process termination command input by the user and determine that the target process needs to be terminated based on the command; another example is that the control device can receive an abnormal interrupt signal from the computing unit, which can indicate an internal execution abnormality in the computing unit, requiring the current process to be terminated. In this case, the control device can determine that the target process running in the computing unit needs to be terminated based on the abnormal interrupt signal. It should be noted that the termination of the target process in this example can be an abnormal process termination, such as a process termination triggered manually or by a fault during normal process operation.
[0043] In some examples, the command processing unit can be used to acquire a command message corresponding to the target process when the first register does not trigger a process cleanup signal, generate a target task corresponding to the target process based on the command message, and send the target task to the computing unit. For example, the command processing unit can receive a process start instruction (e.g., a packet retrieval instruction) sent by a control device, determine the target process to be processed based on the process start instruction, acquire a command message corresponding to the target process from the bus, decompose the command message to generate multiple target tasks, and send the target tasks to the computing unit. The computing unit can then use the computing resources allocated to the target process to execute the received target tasks.
[0044] In other examples, the command processing unit can be used to stop acquiring command messages corresponding to the target process when the first register triggers a process cleanup signal, and to send a target cleanup task for the target process to the computing unit so that the computing unit releases the computing resources corresponding to the target process.
[0045] For example, when the control device determines that a target process needs to be terminated, it can trigger a process cleanup signal by configuring the first register in the command processing unit. Upon triggering the process cleanup signal in the first register, the command processing unit can generate a target cleanup task for the target process and send the task to the computing unit. After receiving the cleanup task, the computing unit can stop executing the target task corresponding to the target process and release the computing resources associated with that process. The priority of this cleanup task can be the highest priority within the target process, taking precedence over other target tasks within the process.
[0046] The process management system of this embodiment triggers a process cleanup signal by configuring the first register in the command processing unit. This allows the system to flexibly and quickly trigger the termination of the target process by the control device without hardware reset. According to the indication of the first register, the command processing unit can stop acquiring new command messages and send the target cleanup task to the computing unit when the process cleanup is triggered, so that the computing unit releases the corresponding resources. This achieves fast and efficient process termination and resource reclamation, avoids repeated initialization processes, and greatly reduces the time for secondary startup.
[0047] In other examples, the command processing unit can also be used to discard target tasks that the command processing unit has not sent to the computing unit when the first register triggers a process cleanup signal. For example, target tasks belonging to the target process that have been generated but not yet sent to the computing unit can be discarded. This prevents the computing unit from continuing to execute invalid tasks and stops the target process more efficiently.
[0048] For example, when the first register triggers a process cleanup signal, the command processing unit can perform the following three actions: stop acquiring command messages corresponding to the target process, discard target tasks that the command processing unit has not sent to the computing unit, and send a target cleanup task for the target process to the computing unit. The coordination of the above three actions can cause the upstream to stop acquiring packets, the downstream to continue dropping packets, and the computing unit to quickly execute the cleanup task, so as to avoid the command processing unit and the computing unit from having command messages or tasks of the target process remaining inside, and to stop the target process and complete resource cleanup in a timely and rapid manner, so as to ensure the rapid and normal execution of the remaining processes.
[0049] Figure 2 This is a schematic diagram of a computing device provided in an embodiment of this disclosure. Figure 2 As shown, the computing device 1100 may include a computing unit 1110 and a command processing unit 1120. The command processing unit 1120 may include at least one of a command acquisition module 1121, a task management module 1122, a process management module 1123, and a register set 20. All of the above modules can be implemented based on logic circuits to achieve efficient process processing. The register set 20 may include at least one of a first register 21, a second register 22, and a queue status register 23. For example, the register set 20 may include only the first register 21, or only the first register 21 and the second register 22.
[0050] Different registers in the above register set can have different functions. For example, the first register can be a register used to trigger the cleanup of the target process; the second register can be a register used to trigger the cleanup of the terminated process; and the queue status register can be used to indicate whether there are still command messages that have not been executed in the command acquisition module.
[0051] This command acquisition module can be used to acquire and store the command message corresponding to the target process when the first register does not trigger a process cleanup signal; or, when the first register triggers a process cleanup signal, to stop acquiring the command message corresponding to the target process.
[0052] This task management module can be used to extract command messages stored in the command acquisition module, generate one or more target tasks corresponding to the target process based on the command messages, and send the target tasks to the computing unit through the process management module so that the computing unit can execute the target tasks in the target process.
[0053] This process management module can be used to send the target task from the task management module to the computing unit when the first register does not trigger a process cleanup signal; or, when the first register triggers a process cleanup signal, to send the target cleanup task to the computing unit. Furthermore, this computing process management module can also be used to discard the target task sent by the task management module when the first register triggers a process cleanup signal, to prevent the computing unit from continuing to execute invalid tasks and to quickly stop the target process.
[0054] In this way, by dividing the work and cooperating between the command acquisition module, task management module and process management module in the command processing unit in the two states of normal process execution and process cleanup, the execution and termination of the target process are realized, further improving the reliability of process termination.
[0055] Figure 3 This is a schematic diagram of another process management system provided in an embodiment of this disclosure. For example... Figure 3 As shown, in this embodiment, the command processing unit 1120 can set one or more registers related to process management in the register set 20, so that the software can control the hardware to perform functions related to process cleanup and termination by configuring the registers. For example, a first register for triggering the start of target process cleanup and a second register for triggering the termination of process cleanup can be added. Exemplarily, software can be deployed on the control device, and the software can configure the registers in the command processing unit based on the configuration interface.
[0056] In some examples, the first register may include a process identification register (e.g., clean_asid), a command retrieval control register corresponding to the command retrieval module (e.g., clean_hcqd_mask), and a process cleanup control register corresponding to the process management module (e.g., clean_trig).
[0057] When the control device determines that a target process needs to be terminated, it can configure the value of the process identifier register to the process identifier of the target process, configure the value of the command acquisition control register to a first target value to trigger the first cleanup signal in the process cleanup signals, and configure the value of the process cleanup control register to a second target value to trigger the second cleanup signal in the process cleanup signals. The first cleanup signal is used to instruct the command acquisition module to stop acquiring command messages corresponding to the target process, and the second cleanup signal is used to instruct the process management module to send the target cleanup task to the computing unit. The second cleanup signal can also be used to instruct the process management module to discard the target task sent by the task management module, thereby intercepting the transmission. It should be noted that the first target value and the second target value can be the same, for example, both can be 1 (indicating that the register is pulled high), and the initial values of the command acquisition control register and the process cleanup control register can both be 0 (indicating that the register is pulled low), and the target value and the initial value can be different.
[0058] In this way, the control function of the first register is decomposed into three independent registers. The process identifier register enables accurate control of the process, and the command acquisition control register and process management control register enable independent control of command acquisition, stopping, and cleanup task issuance. This fine-grained register implementation mechanism improves the flexibility and reliability of the software's process cleanup process control.
[0059] It should be noted that the first register may include one or more of the process identifier register, command fetch control register and process management control register mentioned above. For example, it may include only the process identifier register, or only the command fetch control register and the process management control register.
[0060] In some examples, when the control device determines that a target process needs to be terminated, it can first configure the process identifier register to inform the hardware of the process number to be terminated; then configure the command acquisition control register to instruct the command acquisition module to stop acquiring command messages corresponding to the target process; and finally configure the process management control register to trigger the hardware to start process cleanup.
[0061] In this way, by coordinating the timing of multiple registers, the accuracy of the cleanup signal is improved, erroneous operations are prevented, and process cleanup instructions can be strictly bound to a specific process context.
[0062] In some examples, the command retrieval module described above may include one or more command queues, such as Figure 3 The command queues 1 and 2 shown can be Hardware CommandQueue Descriptors (HCQDs). Different command queues can independently acquire and buffer command messages from the target process. If the command acquisition module includes one command queue, there can be one command acquisition control register; if the command acquisition module includes multiple command queues, there can be multiple command acquisition control registers to control each command queue separately. For example, if the command acquisition module includes multiple command queues, the command acquisition control register can include a queue mask register corresponding to each command queue. Each command queue stops acquiring command messages based on a first cleanup signal triggered by its corresponding queue mask register.
[0063] In this way, by configuring an independent queue mask register for each command queue, the control device can flexibly and accurately select the command message acquisition of the command queue corresponding to the target process to be stopped, thereby improving the flexibility and reliability of command queue management.
[0064] Further as Figure 3 As shown, the process management module 1123 in the command processing unit 1120 may include a process cleanup task generation module and a process cleanup task monitoring module; wherein: This process cleanup task generation module can be used to generate a target cleanup task when a process cleanup signal is triggered by the first register.
[0065] The process cleanup task monitoring module can be used to send the target cleanup task to the computing unit when the generation of the target cleanup task is detected.
[0066] Furthermore, the process cleanup task monitoring module can also discard target tasks sent by the task management module to the computing unit to prevent the computing unit from continuing to execute invalid tasks and quickly stop the target process.
[0067] In this way, by adding a dedicated process cleanup task generation module and a monitoring module, it is ensured that cleanup tasks can be reliably generated and prioritized for distribution. The monitoring module actively discards subsequent ordinary tasks after the cleanup task is generated, which ensures that cleanup instructions can be executed in a timely manner and effectively avoids residual tasks of the target process from interfering with the cleanup process or subsequent processes.
[0068] In some examples, the command processing unit may also include a second register; wherein, the control device may configure the value of the second register in the command processing unit to trigger a process cleanup end signal when it is determined that the computing resources of the target process have been cleaned up; the command processing unit may restore the value of the first register to its initial value when the second register triggers the process cleanup end signal, so as to receive a new process start instruction sent by the control device and obtain a command message for the new process.
[0069] In this way, by triggering the process cleanup end signal through the second register, the first register can be restored to its initial value, thus forming a complete closed-loop management process of triggering cleanup, executing cleanup, and ending cleanup. This allows the computing device to safely and reliably restore to a ready state to receive new processes after the resource release of the target process is completed, thereby improving the reliability of process management.
[0070] It should be noted that when the process cleanup signal is triggered by the first register, the command processing unit can also ignore the process start command sent by the control device. Even if a new process start command is received, it will be discarded, and the command message for the corresponding process will not be acquired. This improves the reliability of process cleanup, avoids inter-process conflicts, ensures the release of all computing resources occupied by the target process, and provides a clean and deterministic hardware environment for the stable execution of subsequent new processes.
[0071] In some examples, the command processing unit also includes a command acquisition module and a queue status register corresponding to the command acquisition module. The queue status register is used to indicate whether there are command messages in the command acquisition module that have not been completed, such as whether there are command messages in the command acquisition module that have not been retrieved by the task management module.
[0072] The control device can be used to determine whether the computing resources of the target process have been cleaned up based on the value of the queue status register.
[0073] For example, the command acquisition module can configure the value of the queue status register according to the status of the command queue (empty or not empty). When there are no unexecuted (or unfetched) command messages in the command queue (i.e., the command queue is empty), it indicates that the command queue is empty, and the value of the queue status register corresponding to the command queue can be configured to the initial value (e.g., 0). Alternatively, when there are unexecuted (or unfetched) command messages in the command acquisition module, it indicates that the command queue is not empty, and the value of the queue status register corresponding to the command acquisition module can be configured to the target value (e.g., 1).
[0074] It should be noted that in this example, the command acquisition module can also include multiple command queues, each corresponding to its own queue status register.
[0075] In this way, by using the queue status register to determine whether there are still residual command messages in the command queue of the command acquisition module, the control device can accurately determine when the cleanup of computing resources is completed, thereby triggering the cleanup termination process, which enhances the determinism and reliability of the entire process control process.
[0076] based on Figures 1 to 3 The illustrated embodiment adds registers related to process cleanup to the command control unit, such as clean_asid, clean_hcqd_mask, clean_trig, and clean_end registers, to control the hardware's process cleanup process. For example, clean_hcqd_mask and clean_trig can be used together to control the command queue in the command acquisition module to stop acquiring command messages and to ignore process start instructions (such as HCQD packet retrieval instructions) issued by the software. Furthermore, a process cleanup task generation module and a process cleanup task monitoring module can be added. The process cleanup task generation module can generate target cleanup tasks (such as process_clean task), which can participate in round-robin arbitration with other target tasks. By setting the target cleanup task higher than other target tasks of the target process, the target cleanup task can be prioritized for execution. The process cleanup task monitoring module can send the target cleanup task to the computing unit, and after sending it and detecting the process cleanup signal triggered by the first register, discard the target task sent by the task management module, for example, discarding target tasks in the job pool queue that have not been sent to the computing unit. In this way, the termination of the target process can be flexibly and quickly triggered through registers without hardware reset, so that the computing unit can release the corresponding resources. This achieves fast and efficient process termination and resource reclamation, avoids repeated initialization processes, and greatly reduces the time for secondary startup.
[0077] Figure 4 This is a flowchart illustrating a process management method provided in an embodiment of this disclosure. The process management method can be... Figure 1 or Figure 3 The process management system shown executes the commands, for example, it can be executed by the control device and / or computing device in the process management system. For example... Figure 4 As shown, the process management method of this embodiment may include one or more of the following steps S410 to S490.
[0078] Step S410, system initialization.
[0079] After the process management system starts, the system can perform hardware initialization, configure the command acquisition module to acquire the size and location of command messages, and the process identifier of the target process to be executed by the current command acquisition module.
[0080] For example, the command acquisition module may include multiple command queues (e.g., HCQD), and the control device may configure each command queue to acquire the size and position of the command message, as well as information such as the process identifier of the target process to be executed by each command queue.
[0081] Step S420: The control device issues a process start command for the target process.
[0082] For example, the control device can run software that can issue a process start command to instruct the command processing unit to start the execution of the target process. For instance, it can specify a specific command queue in the command acquisition module to acquire command messages.
[0083] Step S430: The computing device executes the target process.
[0084] In some examples, such as Figure 3 As shown, the computing device includes a command processing unit (e.g., CP) and a computing unit (e.g., GPU CORE). The command processing unit may include a command acquisition module, a task management module, and a process management module. The command acquisition module may include one or more command queues. The task management module may include a command processing engine (CPE), a command processing decomposer (CPD), and a task queue (e.g., Jobpool-fifo).
[0085] During the normal execution of the target process by the computing device, the command acquisition module can acquire command messages (e.g., packets) from external sources through one or more command queues and store them in the queues. Multiple command queues can execute the same command processing engine within the task management module. The command processing engine can actively read command messages from each command queue using a round-robin arbitration method and send them to the command processing decomposer (CPD). The CPD splits the command message process into target tasks and places them into task queues. Each target task can carry a process identifier of the target process to identify the corresponding target process. The task queues can send target tasks to the computing unit for execution. For example, the task queues can send target tasks directly to the computing unit, or they can send target tasks to the computing unit through a round-robin arbitration and process management module. That is, the task queues first arbitrate the target tasks with other tasks in a round-robin manner, then send the high-priority tasks to the process management module, which then sends the target tasks to the computing unit.
[0086] In some examples, a single process ID can be used within a computing device, meaning that all hardware resources of the computing device can execute different command messages under the same process.
[0087] In some examples, the computing unit does not report any abnormal interruption signals when it is executing the target task normally, indicating that the execution within the computing unit is normal, and the command processing unit can obtain and process the command messages normally.
[0088] In other examples, when a computing unit encounters an abnormal execution, it can report an exception interrupt signal to the software on the control device, indicating that the internal execution of the computing unit is malfunctioning and the control device needs to trigger a process cleanup action to terminate the currently executing target process. The control device can determine the target process that needs to be terminated based on the exception interrupt signal reported by the computing unit.
[0089] In other examples, the user can actively initiate the termination of the target process. For instance, the user can input a process termination command into the control device, so that the control device can determine the target process that needs to be terminated.
[0090] In step S440, when the control device determines that the target process needs to be terminated, it configures the first register in the command processing unit to trigger a process cleanup signal.
[0091] The process cleanup signal is used to instruct the command processing unit in the computing device to stop acquiring command messages corresponding to the target process and to send a target cleanup task to the computing unit so that the computing unit cleans up the computing resources in the target process.
[0092] For example, the first register may include a process identification register (e.g., clean_asid), a command retrieval control register corresponding to the command retrieval module (e.g., clean_hcqd_mask), and a process cleanup control register corresponding to the process management module (e.g., clean_trig).
[0093] The specific methods by which the control device configures the first register when it determines that the target process needs to be terminated may include: First, configure the value of the process identifier register (e.g., clean_asid) to the process identifier of the target process to inform the hardware of the process identifier of the target process to be terminated.
[0094] Secondly, configure the command acquisition control register (e.g., clean_hcqd_mask[n-1:0]) to inform the hardware which command objects in the command acquisition module need to be operated on, that is, to notify these command objects to stop acquiring command messages.
[0095] Next, configure the process cleanup control register (e.g., clean_trig). For example, the process cleanup control register can be configured to a target value, which can be 1, indicating that pulling the process cleanup control register high will trigger the hardware to perform process cleanup. In this way, the process cleanup signal can be triggered through the first register, that is, the hardware of the computing device can be triggered to perform process cleanup.
[0096] It should be noted that the register configuration method in this embodiment can be to pull the register signal high to 1 or low to 0. For example, to configure the value of a register to a target value (e.g., 1), the register signal can be pulled high to 1; to configure the value of a register to an initial value (e.g., 0), the register signal can be pulled low to 0.
[0097] Step S450: The computing device terminates the target process.
[0098] For example, when the first register triggers a process cleanup signal, the command processing unit in the computing device stops acquiring command messages corresponding to the target process and sends a target cleanup task for the target process to the computing unit so that the computing unit releases the computing resources corresponding to the target process.
[0099] For example, the command processing unit can send a bitline with a target value (e.g., 1) in the command acquisition control register (e.g., clean_hcqd_mask[n-1:0]) to each command queue in each command acquisition module. The corresponding command queue, upon detecting that its own register value is the target value (e.g., the signal is high), will stop acquiring command messages. Furthermore, even if the command processing unit receives a new process start instruction from the control device software at this time, it will not execute it.
[0100] After the process cleanup control register (e.g., clean_trig) is configured with a target value (e.g., 1), the process cleanup task generation module in the command processing unit can obtain the process identifier of the target process from the process identifier register based on the indication of the register, and generate a target cleanup task (proce_clean_task) for that target process. This target cleanup task can participate in the polling arbitration with the highest priority. For example, if the arbitration priority of this target cleanup task is higher than that of the target task in the task queue, the polling arbitration will preferentially select this target cleanup task for issuance.
[0101] When the process cleanup task monitoring module in the command processing unit detects the generation of the target cleanup task, it sends the target cleanup task to the computing unit. After the target cleanup task is sent and it is detected that the value of the process cleanup control register is configured to the target value, the target task in the normal task queue will not be sent again, but will be directly retrieved and discarded, that is, the target task sent by the task management module to the computing unit will be discarded.
[0102] In step S460, the control device determines whether the computing resources of the target process have been cleared based on the value of the queue status register.
[0103] In step S470, when the control device determines that the computing resources of the target process have been cleaned up, it configures the second register in the command processing unit to trigger a process cleanup end signal.
[0104] The process cleanup end signal is used to instruct the command processing unit to restore the value of the first register to its initial value so as to receive the new process start instruction and the command message for obtaining the new process sent by the control device.
[0105] For example, the software controlling the device can read the queue status register. When it finds that the values of the queue status registers corresponding to the command queue to be cleaned are all initial values (e.g., 0 indicating an empty queue), it means that there are no command messages that have not been executed (or have not been retrieved) in the command queue. At this time, it can be determined that the computing resources of the target process have been cleaned up, that is, the process cleanup has been completed.
[0106] At this time, the control device can configure a second register (e.g., clean-end) to inform the hardware to end the current clean-up lock state on the hardware. For example, the hardware can restore the value of the first register to its initial value based on the indication of the second register in order to receive the new process start instruction and the command message for obtaining the new process sent by the control device.
[0107] Step S480: The control device issues a new process start command.
[0108] In step S490, the computing device executes a new process based on the new process startup instruction.
[0109] The process management method of this embodiment triggers a process cleanup signal by configuring the first register in the command processing unit. This allows the system to flexibly and quickly trigger the termination of the target process by the control device without hardware reset. When the process cleanup is triggered, the command processing unit can stop acquiring new command messages and send the target cleanup task to the computing unit according to the indication of the first register, so that the computing unit releases the corresponding resources. This achieves fast and efficient process termination and resource reclamation, avoids repeated initialization processes, and greatly reduces the time for secondary startup.
[0110] Furthermore, using the process management method of this embodiment, the software can directly terminate the current process without hardware reset, avoiding repeated initialization processes and significantly reducing the time for secondary startup. The command processing unit sends a specific target cleanup task to the computing unit (e.g., an operation), which is simply a task for the computing unit and does not change the normal task distribution process. The computing unit simply performs the process cleanup action for this specific target cleanup task. By stopping packet capture upstream and continuously dropping packets downstream, command message residue within the command processing unit is avoided, ensuring the normal execution of subsequent processes. Furthermore, this process management method allows the software of the control device to dynamically configure and implement the process termination function, increasing the flexibility of software development and facilitating development and debugging.
[0111] It should be noted that the process management method provided in this disclosure may include one or more of the steps S410 to S490 described above. That is, any one of the steps S410 to S490 can be used as an independent embodiment, and any combination of multiple steps can also be used as an independent embodiment. For example, steps S440 or S470 can be used as independent embodiments, steps S460 and S470 can be combined as independent embodiments, and steps S440, S460 and S470 can be combined as independent embodiments, and so on. Further examples will not be repeated here.
[0112] This disclosure also provides a computing device, such as... Figures 1 to 3As shown, the computing device is connected to a control device. The computing device may include a command processing unit and a computing unit. The command processing unit may include a first register. The first register can be configured by the control device so that, when the control device determines that a target process needs to be terminated, it can configure the first register in the command processing unit to trigger a process cleanup signal corresponding to the target process. The command processing unit can stop acquiring command messages corresponding to the target process and send a target cleanup task to the computing unit when the process cleanup signal is triggered by the first register, so that the computing unit cleans up the computing resources in the target process.
[0113] This disclosure also provides a control device, which may include a memory and a processor. The memory may be used to store computer instructions, and the processor may be used to retrieve computer instructions from the memory to execute all or part of the steps of any of the methods in the foregoing embodiments of this disclosure. The processor may be one or more processors, which may execute instructions individually or jointly. Similarly, the memory may be one or more memories, which may store the aforementioned computer instructions individually or jointly. The control device may be a CPU, or a chip in the form of an Application Specific Integrated Circuit (ASIC), System on Chip (SOC), Field Programmable Gate Array (FPGA), Programmable Logic Array (PLA), etc., and this embodiment does not limit this to any particular type.
[0114] This disclosure also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements all or part of the steps of any of the methods in the foregoing embodiments of this disclosure. Optionally, the computer-readable storage medium may be a non-transitory storage medium, but is not limited thereto, and may also be a temporary storage medium.
[0115] This disclosure also provides a computer program product that may include a computer program that, when executed by a processor, can implement all or part of the steps of any of the methods in the foregoing embodiments of this disclosure.
[0116] This disclosure may be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement any of the methods in the foregoing embodiments of this disclosure.
[0117] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media may include, for example, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), compact disc-read-only memory (CD-ROM), digital versatile disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any combination thereof. The computer-readable storage medium used herein is not to be interpreted as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0118] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0119] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages (e.g., Smalltalk, C++, etc.) and conventional procedural programming languages (e.g., the "C" language or similar programming languages). The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network (e.g., a local area network or a wide area network), or it may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays, or programmable logic arrays, may execute computer-readable program instructions to implement various aspects of the embodiments of this disclosure by utilizing state information from the computer-readable program instructions.
[0120] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0121] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0122] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0123] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. Each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should be noted that embodiments of the present disclosure may include some or all of the functions marked in the multiple blocks in the drawings, and may also include other functions not shown in the blocks in the drawings. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It should be noted that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are all equivalent.
[0124] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of this disclosure is defined by the appended claims.
Claims
1. A process management system, characterized in that, The process management system includes a control device and a computing device. The computing device includes a command processing unit and a computing unit. The command processing unit includes a first register. Wherein: The control device is configured to configure a first register in the command processing unit when it is determined that the target process needs to be terminated, so as to trigger a process cleanup signal corresponding to the target process through the first register. The command processing unit is configured to, when the first register does not trigger the process cleanup signal, acquire a command message corresponding to the target process, generate a target task corresponding to the target process based on the command message, and send the target task to the computing unit; or, when the first register triggers the process cleanup signal, stop acquiring the command message corresponding to the target process and send a target cleanup task for the target process to the computing unit, so that the computing unit releases the computing resources corresponding to the target process.
2. The process management system according to claim 1, characterized in that, The command processing unit further includes a command acquisition module, a task management module, and a process management module; wherein: The command acquisition module is configured to acquire and store the command message corresponding to the target process when the first register does not trigger a process cleanup signal; or, when the first register triggers a process cleanup signal, stop acquiring the command message corresponding to the target process. The task management module is used to extract the command message stored in the command acquisition module, generate one or more target tasks corresponding to the target process according to the command message, and send the target task to the computing unit through the process management module so that the computing unit executes the target task in the target process. The process management module is configured to send the target task of the task management module to the computing unit when the first register does not trigger a process cleanup signal; or, when the first register triggers a process cleanup signal, send the target cleanup task to the computing unit and discard the target task sent by the task management module.
3. The process management system according to claim 2, characterized in that, The process management module includes a process cleanup task generation module and a process cleanup task monitoring module; wherein: The process cleanup task generation module is used to generate the target cleanup task when the process cleanup signal is triggered by the first register. The process cleanup task monitoring module is used to send the target cleanup task to the computing unit when the target cleanup task is detected to be generated, and to discard the target task sent to the computing unit by the task management module.
4. The process management system according to claim 2, characterized in that, The first register includes a process identifier register, a command acquisition control register corresponding to the command acquisition module, and a process cleanup control register corresponding to the process management module; The control device is specifically configured, when determining that a target process needs to be terminated, to configure the value of the process identifier register to the process identifier of the target process, configure the value of the command acquisition control register to a first target value to trigger a first cleanup signal in the process cleanup signals, and configure the value of the process cleanup control register to a second target value to trigger a second cleanup signal in the process cleanup signals; wherein, the first cleanup signal is used to instruct the command acquisition module to stop acquiring command messages corresponding to the target process, and the second cleanup signal is used to instruct the process management module to send a target cleanup task to the computing unit and discard the target task sent by the task management module.
5. The process management system according to claim 4, characterized in that, The command acquisition module includes multiple command queues, and the command acquisition control register includes a queue mask register that corresponds one-to-one with each of the command queues; each command queue stops acquiring the command message based on the first cleanup signal triggered by its corresponding queue mask register.
6. The process management system according to any one of claims 1 to 5, characterized in that, The command processing unit further includes a second register; wherein... The control device is further configured to configure the value of the second register in the command processing unit to trigger a process cleanup end signal when it is determined that the computing resources of the target process have been cleaned up. The command processing unit is configured to restore the value of the first register to its initial value when the second register triggers a process cleanup termination signal, so as to receive a new process start instruction and a command message for obtaining a new process sent by the control device.
7. The process management system according to claim 6, characterized in that, The command processing unit further includes a command acquisition module and a queue status register corresponding to the command acquisition module. The queue status register is used to indicate whether there are command messages in the command acquisition module that have not been completed. The control device is used to determine whether the computing resources of the target process have been cleared based on the value of the queue status register.
8. A process management method, characterized in that, The method is executed by a control device in a process management system, the process management system further comprising a computing device, the computing device including a command processing unit and a computing unit, the command processing unit including a first register; the method includes: If it is determined that the target process needs to be terminated, the first register in the command processing unit is configured to trigger a process cleanup signal; wherein, the process cleanup signal is used to instruct the command processing unit in the computing device to stop acquiring command messages corresponding to the target process, and to send a target cleanup task to the computing unit so that the computing unit cleans up the computing resources in the target process.
9. The method according to claim 8, characterized in that, The command processing unit further includes a second register, a command acquisition module, and a queue status register corresponding to the command acquisition module. The queue status register is used to indicate whether there are unprocessed command messages in the command acquisition module. The method further includes: The value of the queue status register is used to determine whether the computing resources of the target process have been cleaned up. If it is determined that the computing resources of the target process have been cleaned up, the second register in the command processing unit is configured to trigger a process cleanup end signal; wherein, the process cleanup end signal is used to instruct the command processing unit to restore the value of the first register to its initial value, so as to receive the new process start instruction sent by the control device and the command message for obtaining the new process.
10. A computing device, characterized in that, The computing device is connected to the control device, and the computing device includes a command processing unit and a computing unit. The command processing unit includes a first register; wherein: The first register is provided for configuration by the control device, so that when the control device determines that the target process needs to be terminated, it configures the first register in the command processing unit to trigger a process cleanup signal corresponding to the target process through the first register. The command processing unit is configured to stop acquiring command messages corresponding to the target process when the first register triggers a process cleanup signal, and to send a target cleanup task to the computing unit so that the computing unit cleans up the computing resources in the target process.
11. A control device, characterized in that, It includes a memory and a processor, the memory being used to store computer instructions, and the processor being used to retrieve the computer instructions from the memory to perform the method of claim 8 or 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of claim 8 or 9.
Citation Information
Patent Citations
Access control method and device, equipment and medium
CN119065845A
Register control method, processor, system on chip and computing equipment
CN120122993A
Register management method and device, electronic equipment and storage medium
CN121116394A
Process management method and device, storage medium and electronic equipment
CN121143966A
Vehicle control method and vehicle
CN121515892A