Hierarchical real-time scheduling robot operation control and sensing system resource isolation method
By optimizing CPU core allocation through particle swarm optimization, the motion control system is ensured to exclusively use high-priority cores. Combined with the fitness evaluation of resource utilization and task completion time, the core allocation of non-real-time threads is dynamically adjusted, which solves the problem of resource isolation between motion control and perception in robot systems and achieves high real-time performance and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING ACCELERATED EVOLUTION TECH CO LTD
- Filing Date
- 2025-12-12
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies cannot effectively solve the resource isolation problem of high real-time motion control and perception decision-making in robot systems, resulting in the blockage of the motion control system and limited ability to manage programs developed by third-party users. The system is complex and lacks real-time guarantee.
A hierarchical real-time scheduling method for resource isolation in robot motion control and perception systems is adopted. The CPU core allocation strategy is optimized through particle swarm optimization to ensure that the motion control system has exclusive access to high-priority cores. Combined with the fitness evaluation of resource utilization and task completion time, the core allocation of non-real-time threads is dynamically adjusted to avoid resource contention.
It significantly improves the response speed and stability of robot motion control, meets high real-time requirements, reduces the probability of resource contention, achieves hardware-level resource isolation, and avoids process-level contention problems that traditional solutions cannot completely solve.
Smart Images

Figure CN122008182A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robot control technology, specifically a method for resource isolation of robot motion control and perception systems with hierarchical real-time scheduling. Background Technology
[0002] With the rapid development of robotics technology, robot systems need to simultaneously support multiple levels of functions, including high real-time motion control, perception and decision-making, and user interaction. The motion control system (motor control system), as the cerebellum of the robot, is responsible for balance and walking control and has extremely high real-time requirements. Any delay may lead to unstable operation. The perception system needs to process data from cameras, radar, etc., and generate decisions, with relatively lower real-time requirements. On the other hand, functions such as voice interaction and online entertainment have the lowest real-time requirements. In such scenarios where multiple systems coexist, it is necessary to ensure that the motion control system has exclusive access to key CPU resources to maintain high real-time performance, while ensuring the stability of the perception system and reserving flexible space for users' secondary development. However, the mode of a single device running multiple systems can no longer meet the hierarchical real-time requirements.
[0003] Existing technologies mainly rely on namespace+cgroup or container solutions to achieve resource isolation, which has significant drawbacks. Although cgroup can plan system resources, it is difficult to completely isolate kernel interrupts and subsequent processes, which can easily lead to the blocking of high real-time operation and control systems. Although container technology can isolate file systems and process spaces, it still cannot completely solve the problem of system-level resource contention. In addition, existing solutions have limited control over third-party user-developed programs, which may occupy the resources required by the operation and control system, causing unpredictable performance degradation. While dynamic kernel binding can partially alleviate the problem, it requires modification of drivers or configuration of a large number of rules and cannot cover all unknown processes, resulting in high system complexity and insufficient real-time guarantee. To address these issues, a hierarchical real-time scheduling method for resource isolation in robot operation and control and perception systems is proposed. Summary of the Invention
[0004] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a hierarchical real-time scheduling method for isolating resources in robot motion control and perception systems, comprising the following steps:
[0005] S1. Set the resource isolation target for the robot system and initialize the particle swarm algorithm parameters, including particle position, velocity and fitness function;
[0006] S2. In combination with real-time requirements, the resource utilization rate of the operation and control system and the task completion time are defined as resource isolation evaluation indicators for particle swarm fitness evaluation.
[0007] S3. Encode the position of each particle into a CPU core allocation scheme, including the division of isolated cores and non-isolated cores, to ensure that the operation and control system has exclusive access to high-priority cores;
[0008] S4. Based on the defined resource isolation evaluation index, calculate the fitness of the resource allocation scheme corresponding to each particle and evaluate its ability to ensure the real-time performance of the operation and control system.
[0009] S5. Utilize the iterative rules of the particle swarm optimization algorithm to update particle velocity and position based on the optimal solutions for individuals and the swarm, and optimize the CPU core allocation strategy.
[0010] S6. During the iteration of the particle swarm optimization algorithm, continuously monitor the usage status of isolated core resources, dynamically adjust the CPU core allocation of non-real-time threads, and prevent and resolve potential resource conflicts and deadlock risks.
[0011] S7. After the iteration is completed, the resource allocation scheme corresponding to the particle with the highest fitness is output and implemented in the robot system.
[0012] Preferably, S1 specifically includes:
[0013] Clearly define the resource isolation goal between the motion control system and the perception system in the robot system, that is, to enable the motion control system to exclusively use high-priority CPU cores, while ensuring the stable operation of the perception system and user programs;
[0014] Based on the goal of resource isolation, the particle swarm algorithm parameters are initialized, the particle position is defined as the CPU core allocation scheme (isolation / non-isolation), the velocity is set as the iteration adjustment step size, and the fitness function is constructed to evaluate the ability of resource isolation to guarantee real-time performance.
[0015] Set the particle swarm size, maximum number of iterations, and inertia weight, and determine the update rules for velocity and position.
[0016] Preferably, S2 specifically includes:
[0017] The real-time requirements of the operation and control system are clearly defined, and the resource utilization rate and task completion time of the operation and control system are defined as resource isolation evaluation indicators. The resource utilization rate reflects the utilization rate of the allocated CPU cores of the operation and control system, and the task completion time measures the response speed of the operation and control system tasks. The two together evaluate the merits of the resource isolation scheme.
[0018] The operation and control system is analyzed, and standard threshold ranges for resource utilization and task completion time are set accordingly, serving as the basic framework for constructing a resource isolation assessment for fitness evaluation.
[0019] Preferably, S3 specifically includes:
[0020] The position of each particle is encoded as a CPU core allocation scheme, and CPU cores are randomly assigned as isolated cores or non-isolated cores. Among them, the high priority dimension corresponds to the isolated core number, and the low priority dimension is assigned a non-isolated core.
[0021] Verify whether the generated CPU core allocation scheme meets hardware constraints and real-time requirements, eliminate conflicting schemes, correct out-of-bounds allocations, and ensure that the scheme is physically feasible and complies with resource isolation rules.
[0022] Preferably, S4 specifically includes:
[0023] Under the CPU core allocation scheme corresponding to the particle, the operation and control system is run to collect the actual values of its resource utilization and task completion time as the basis for evaluation.
[0024] The actual values of the collected resource utilization rate and task completion time are compared with the preset standard threshold range to determine whether the requirements are met.
[0025] Based on the fitness function, and by comparing the actual values of resource utilization and task completion time with the standard threshold, the fitness value of the particle is calculated to evaluate its ability to ensure the real-time performance of the operation and control system.
[0026] Preferably, the calculation process for the fitness value of the calculated particle is as follows:
[0027] The resource utilization rate and task completion time of the operation and control system under the resource isolation scheme are collected by real-time monitoring tools. The actual operating values are recorded and compared with the preset standard threshold range. The resource utilization rate must meet the balance between efficiency and stability, and the task completion time must ensure real-time performance. If the actual value exceeds the standard threshold range, it is marked as a violation; otherwise, it is considered compliant.
[0028] Based on the threshold comparison results, a penalty-type fitness function is used to quantify the merits of resource isolation schemes. For compliant resource isolation schemes, the fitness value is obtained by weighted summation of the normalized values of resource utilization and task completion time (the lower the value, the better). The weights are determined according to the system priority, with resource utilization accounting for 60% and task completion time accounting for 40%.
[0029] All resource isolation schemes are ranked based on their fitness values. The lower the fitness value, the stronger the scheme's ability to guarantee the real-time performance of the operation and control system. Resource isolation schemes with low fitness values are retained first, while resource isolation schemes with high fitness values or those that violate regulations are eliminated. By iteratively optimizing and adjusting the resource allocation strategy, the scheme gradually converges to the optimal resource isolation scheme, ensuring that the final selected resource isolation scheme can achieve the best balance between resource utilization efficiency and task response speed.
[0030] Preferably, S5 specifically includes:
[0031] Set the search space for particle swarm size, number of iterations, and CPU core allocation strategy; initialize particle positions (candidate allocation schemes) and velocities; calculate the fitness value of each particle (weighted based on resource utilization and task completion time); and determine the individual optimal solution and the global optimal solution.
[0032] Based on the individual optimal solution and the global optimal solution, combined with inertia weight, cognitive factors and social factors, the particle velocity is dynamically adjusted, that is, the direction and magnitude of the strategy adjustment are adjusted, the particle position is updated, a new allocation scheme is generated, and the fitness value is recalculated to update the individual and global optimal solutions.
[0033] If the maximum number of iterations or the fitness value converges and there is no significant improvement after multiple rounds, the iteration is terminated, and the CPU core allocation strategy corresponding to the global optimal solution is output to ensure that resource utilization and task real-time performance are optimally balanced and to meet the stability requirements of the operation and control system.
[0034] Preferably, S6 specifically includes:
[0035] During the iteration of the particle swarm optimization algorithm, the resource utilization of each CPU core and the running status of threads are collected in real time, isolated core resources are marked, and potential resource conflicts and deadlock risks between non-real-time threads and real-time tasks are identified.
[0036] Based on the conflict identification results, the CPU core allocation of non-real-time threads is dynamically adjusted in conjunction with the global optimal solution of particle swarm optimization, generating an optimized CPU core allocation scheme. Threads that compete for resources with real-time tasks are released first, ensuring the exclusive use of critical path resources.
[0037] Run the adjusted CPU core allocation scheme to verify whether resource conflicts have been eliminated and deadlock risks have been resolved. If the targets are not met, continue iterative optimization until the real-time constraints are met or the maximum number of iterations is reached.
[0038] Preferably, the process of verifying whether resource conflicts have been eliminated and whether deadlock risks have been mitigated is as follows:
[0039] The optimized CPU core allocation scheme is launched, and key indicators are collected in real time through the operating system interface, including the latency of real-time tasks, the resource utilization of non-real-time threads, the contention frequency of shared cache / bus, and the length of thread waiting queues and lock holding status. At the same time, deadlock characteristics, namely circular wait chains or priority inversion events, are monitored, covering normal loads and extreme scenarios to ensure the comprehensiveness of the verification.
[0040] Based on the collected data, the degree of resource conflict (whether the real-time task delay exceeds the threshold, the shared resource contention rate) and the risk of deadlock (whether there are unresolved circular waits or priority inversions) are quantified. If the real-time task delay is stable within the threshold and there are no deadlock characteristics, it is determined to meet the standard; otherwise, the conflict type and location that do not meet the standard are marked, and adjustment requirements are generated as input for the next iteration.
[0041] If the target is not met, update the fitness function of the particle swarm optimization algorithm based on the conflict analysis results (increase the conflict penalty weight), adjust the migration strategy or priority setting of non-real-time threads, generate a new allocation scheme and return key indicator collection and deadlock feature monitoring. If the real-time constraint is met or the maximum number of iterations is reached after continuous iteration, the optimization is terminated, and the current optimal CPU core allocation scheme is output to ensure that the system runs stably without resource contention under high real-time requirements.
[0042] Preferably, S7 specifically includes:
[0043] After the iteration, the global optimal particle is selected based on the fitness function of the particle swarm algorithm. The corresponding resource allocation scheme includes kernel binding, priority configuration and shared resource isolation strategy.
[0044] The optimal resource allocation scheme is deployed to the robot system. Through the operating system interface, the operation and control thread is given exclusive access to the high-priority core group, the perception thread is bound to the low-priority core group, and the cache partitioning and bus isolation mechanism is enabled.
[0045] Run the robot system and monitor the operation and control latency, perception throughput and resource contention indicators in real time. If the expected results are not met, trigger dynamic fine-tuning (migrate threads or adjust priorities) and output a stable and isolated resource allocation scheme.
[0046] This invention provides a hierarchical real-time scheduling method for resource isolation in robot motion control and perception systems. It offers the following advantages:
[0047] (i) The hierarchical real-time scheduling method for isolating resources between the robot motion control and perception systems optimizes the CPU core allocation strategy through the particle swarm optimization algorithm, ensuring that the motion control system has exclusive access to high-priority cores. Combined with the fitness evaluation of resource occupancy rate and task completion time, the core allocation of non-real-time threads is dynamically adjusted to avoid resource contention, so that the latency of motion control tasks is stabilized at the millisecond level, meeting the high real-time requirements. At the same time, the perception system and user programs run stably on non-isolated cores, significantly improving the response speed and stability of robot motion control.
[0048] (ii) The resource isolation method for the robot motion control and perception system of this hierarchical real-time scheduling adopts a binary-coded CPU core allocation scheme, clearly distinguishes between isolated and non-isolated cores, and combines hardware constraint verification and real-time verification to ensure that the motion control system has exclusive access to key resources. Through cache partitioning and bus isolation mechanisms, it restricts the occupation of shared resources by non-real-time threads, reduces the probability of resource contention, achieves hardware-level resource isolation, avoids the process-level contention problem that traditional container or cgroup solutions cannot completely solve, and improves the overall stability of the system. Attached Figure Description
[0049] Figure 1 This is a schematic diagram illustrating the workflow of the robot motion control and perception system resource isolation method for hierarchical real-time scheduling according to the present invention.
[0050] Figure 2 This is a schematic diagram of the method flow for the hierarchical real-time scheduling of robot motion control and perception system resource isolation method of the present invention. Detailed Implementation
[0051] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] Example 1, please refer to Figure 1 , Figure 2 This invention provides a technical solution: a hierarchical real-time scheduling method for isolating resources in robot motion control and perception systems, comprising the following steps:
[0053] S1. Set the resource isolation target for the robot system, initialize the particle swarm optimization (PSO) algorithm parameters, including particle position, velocity, and fitness function, and clarify the resource isolation target between the motion control system and the perception system in the robot system. That is, enable the motion control system to exclusively use high-priority CPU cores, while ensuring the stable operation of the perception system and user program. Based on the resource isolation target, initialize the PSO algorithm parameters, define the particle position as the CPU core allocation scheme (isolated / non-isolated), set the velocity as the iteration adjustment step size, construct the fitness function to evaluate the ability of resource isolation to guarantee real-time performance, set the particle swarm size, maximum number of iterations, and inertia weight, and determine the update rules for velocity and position.
[0054] The specific work involves: In the robot system, determining the resource isolation objective between the motion control system and the perception system. This means ensuring the motion control system exclusively uses high-priority CPU cores to achieve millisecond-level real-time performance, while simultaneously ensuring the stable operation of the perception system and user programs on non-isolated cores to avoid performance degradation caused by resource contention. The motion control system, as the robot's core control unit, needs to complete tasks within millisecond-level response times, ensuring it receives stable computing resources. The perception system processes sensor data and provides decision support to the motion control system; its performance directly affects the robot's behavior. The user program needs to run normally without affecting the motion control and perception systems. Resource isolation effectively avoids resource contention between different systems. Based on the resource isolation objective… The parameters of the particle swarm optimization algorithm are initialized. The positions of the particles are defined as CPU core allocation schemes, where the position of each particle represents a possible CPU core allocation strategy, including cores isolated for the operation and control system and cores used for the perception system and user programs. The particle velocity represents the adjustment step size of the CPU core allocation scheme during iteration, which is used to control the exploration and development capabilities during the search process. The fitness function evaluates the ability of the resource isolation scheme to guarantee real-time performance. At the same time, the particle swarm size, maximum number of iterations, and inertia weight are set, and the update rules for velocity and position are determined. The update rules for velocity and position follow the standard process of particle swarm optimization, that is, they are dynamically adjusted according to the individual optimal solution, the swarm optimal solution, and the current state to ensure that each iteration moves towards a better direction.
[0055] S2. In conjunction with real-time requirements, the resource utilization rate and task completion time of the operation and control system are defined as resource isolation evaluation indicators for particle swarm fitness evaluation. The real-time requirements of the operation and control system are clarified, and the resource utilization rate and task completion time of the operation and control system are defined as resource isolation evaluation indicators. Among them, the resource utilization rate reflects the utilization rate of the allocated CPU cores of the operation and control system, and the task completion time measures the response speed of the operation and control system tasks. The two are used to evaluate the merits of the resource isolation scheme. The operation and control system is analyzed, and the standard threshold range of resource utilization rate and task completion time is set accordingly, which serves as the basic framework for constructing the resource isolation evaluation for fitness evaluation.
[0056] The specific work involves: based on the real-time requirements of the operation and control system, namely the system's ability to complete specified tasks within a specified time, using resource utilization and task completion time as resource isolation evaluation indicators. Resource utilization reflects the actual utilization of allocated CPU cores by the operation and control system, demonstrating the rationality of resource allocation; task completion time directly measures the system's task response speed and is a direct reflection of real-time requirements. Together, these two constitute the core criteria for evaluating the merits of resource isolation schemes. A thorough analysis of the operation and control system is conducted, considering its operating environment, task types, and performance requirements. Through theoretical derivation combined with actual operating data, standard threshold ranges for resource utilization and task completion time are established. Among these, the resource utilization threshold needs to balance system efficiency and stability, avoiding excessively high thresholds that lead to resource contention or excessively low thresholds that cause resource waste; the task completion time threshold needs to ensure system real-time performance and timely response to control commands. Based on the determined standard threshold ranges for resource utilization and task completion time, a resource isolation evaluation framework for fitness assessment is constructed. Specifically, the actual values of resource utilization and task completion time are calculated, and it is determined whether they are within the standard threshold range. If the actual value exceeds the standard threshold, it indicates that the resource isolation scheme may be insufficient and needs further optimization; if the actual value is within the standard threshold range, it indicates that the scheme is effective and can guarantee the real-time performance and stability of the operation and control system.
[0057] S3. Encode the position of each particle into a CPU core allocation scheme, including the division of isolated cores and non-isolated cores, to ensure that the operation and control system exclusively uses high-priority cores. Encode the position of each particle into a CPU core allocation scheme, and randomly allocate CPU cores as isolated cores or non-isolated cores. Among them, the high-priority dimension corresponds to the isolated core number, and the low-priority dimension is allocated non-isolated cores. Through binary encoding, ensure that the operation and control system exclusively uses the designated isolated cores, and the remaining cores are dynamically allocated according to task priority. Verify whether the generated CPU core allocation scheme meets the hardware constraints (total number of cores limit) and real-time requirements (isolation core exclusivity), eliminate conflicting schemes, correct out-of-bounds allocations (duplicate cores or unallocated cores), and ensure that the scheme is physically feasible and complies with resource isolation rules.
[0058] The specific work involves the following steps: In the particle swarm optimization algorithm, the position of each particle is encoded as a CPU core allocation scheme to define the resource allocation for each task in the robot system. Specifically, the particle position is implemented using binary encoding, where high-priority dimensions correspond to isolated core numbers, ensuring that the motion control system can exclusively use these high-priority CPU cores. Low-priority dimensions are allocated to non-isolated cores for the perception system and user program operation. During initial allocation, CPU cores are randomly assigned as isolated or non-isolated cores, enabling dynamic allocation of appropriate CPU core resources for different tasks while meeting real-time requirements. The generated CPU core allocation scheme needs to be verified to meet hardware constraints and real-time requirements, checking whether the scheme complies with the total number of cores in the hardware to avoid allocations exceeding hardware capabilities. The exclusivity of isolated cores is verified to ensure that the motion control system can exclusively use the designated high-priority CPU cores, guaranteeing its real-time performance. Schemes that do not meet the requirements, such as those with conflicts (multiple tasks allocated to the same core) or out-of-bounds allocations (duplicate cores or unallocated cores), will be discarded to ensure that all schemes entering the optimization process are physically feasible and strictly adhere to resource isolation rules.
[0059] S4. Based on the defined resource isolation evaluation index, calculate the fitness of the resource allocation scheme corresponding to each particle, evaluate its ability to guarantee the real-time performance of the operation and control system, run the operation and control system under the CPU core allocation scheme corresponding to the particle, collect the actual values of its resource utilization rate and task completion time as the basis for evaluation, compare the collected actual values of resource utilization rate and task completion time with the preset standard threshold range to determine whether the requirements are met, calculate the fitness value of the particle based on the fitness function and the comparison results of the actual values of resource utilization rate and task completion time with the standard threshold, evaluate its ability to guarantee the real-time performance of the operation and control system, the lower the fitness value, the stronger the resource isolation scheme's ability to guarantee the real-time performance of the operation and control system;
[0060] Furthermore, the calculation process for the fitness value of particles is as follows: Real-time monitoring tools are used to collect the resource utilization rate and task completion time of the operation and control system under the resource isolation scheme. The actual operating values are recorded and compared with a preset standard threshold range. The resource utilization rate must balance efficiency and stability, and the task completion time must ensure real-time performance. If the actual value exceeds the standard threshold range, it is marked as a violation; otherwise, it is considered compliant. Based on the threshold comparison results, a penalty-type fitness function is used to quantify the merits of the resource isolation scheme. For compliant resource isolation schemes, the fitness value is obtained by a weighted sum of the normalized values of resource utilization rate and task completion time (lower values are better), with the weights determined according to system priority. Resource utilization accounts for 60%, and task completion time accounts for 40%. For non-compliant resource isolation schemes, a significant penalty is imposed to make the fitness value of non-compliant resource isolation schemes significantly higher than that of compliant resource isolation schemes. All resource isolation schemes are ranked based on their fitness values. The lower the fitness value, the stronger the scheme's ability to guarantee the real-time performance of the operation and control system. Resource isolation schemes with low fitness values are retained first, while resource isolation schemes with high fitness values or non-compliant resource isolation values are eliminated. Through iterative optimization and adjustment of resource allocation strategies, the scheme is gradually converged to the optimal resource isolation scheme, ensuring that the final selected resource isolation scheme can achieve the best balance between resource utilization efficiency and task response speed, and meet the stable operation requirements of high real-time systems.
[0061] The fitness value of a compliant resource isolation scheme is expressed as follows:
[0062] ;
[0063] ;
[0064] ;
[0065] In the formula: The fitness value for a compliant resource isolation scheme. As a weight for resource utilization rate, , Weighting of task completion time , This is the normalized value of CPU utilization. This represents the actual CPU utilization rate. This is the lower limit threshold for CPU utilization. This is the upper limit threshold for CPU utilization. This is the normalized value for task completion time. This refers to the actual time it took to complete the task. This is the upper limit threshold for task completion time; When the value is close to 0, it indicates that both resource utilization and task completion time are close to ideal values. When the value is close to 1, it indicates that the resource utilization rate or task completion time is approaching the upper limit of the threshold.
[0066] The fitness value of a non-compliant resource isolation scheme is expressed as follows:
[0067] ;
[0068] ;
[0069] ;
[0070] In the formula: The fitness value of the non-compliant resource isolation scheme. To significantly increase the penalty multiplier and ensure that the fitness value of the non-compliant solution is much higher than that of the compliant solution, , This is a quantification value for CPU utilization violations. This is a quantifiable value for violations related to task completion time; the more serious the violation, the higher the score. The higher the value;
[0071] The specific work involves: running the operation and control system under the CPU core allocation scheme corresponding to the particles, collecting the actual values of resource utilization and task completion time. These values serve as the basis for evaluating the resource isolation scheme's ability to guarantee the real-time performance of the operation and control system. Resource utilization reflects the actual utilization of the allocated CPU cores by the operation and control system, while task completion time directly measures the system's task response speed. The collected actual values of resource utilization and task completion time are compared with preset standard threshold ranges to determine whether they meet the requirements. The standard threshold range for resource utilization needs to balance system efficiency and stability, avoiding being too high or too low. The threshold for task completion time needs to ensure system real-time performance and timely response to control commands. This is achieved through comparison... The process clarifies whether the performance of the resource isolation scheme in actual operation meets the expected goals. Based on the fitness function, and combining the comparison results of the actual values of resource utilization and task completion time with the standard threshold, the fitness value of the particles is calculated. The fitness function is designed as a penalty model: when the actual value exceeds the standard threshold, the fitness value decreases significantly, reflecting the negative impact of the scheme on real-time performance; when the actual value is within the standard threshold, the fitness value remains at a high level. The fitness function comprehensively considers resource utilization and task completion time, and through quantitative evaluation of the merits of the resource isolation scheme, the lower the fitness value, the stronger the scheme's ability to guarantee the real-time performance of the operation and control system, and the better it can meet the stable operation requirements of the system under high real-time requirements.
[0072] S5. Utilize the iterative rules of the particle swarm optimization algorithm to update particle velocity and position based on the optimal solutions for individuals and the swarm, and optimize the CPU core allocation strategy.
[0073] S6. During the iteration of the particle swarm optimization algorithm, continuously monitor the usage status of isolated core resources, dynamically adjust the CPU core allocation of non-real-time threads, and prevent and resolve potential resource conflicts and deadlock risks.
[0074] S7. After the iteration is completed, the resource allocation scheme corresponding to the particle with the highest fitness is output and implemented in the robot system to achieve effective isolation between the motion control and perception systems.
[0075] Example 2, as Figure 1 , Figure 2 As shown, based on Embodiment 1, the present invention provides a technical solution: S5 specifically includes: setting the particle swarm size, number of iterations, and search space for CPU core allocation strategy; initializing particle positions (candidate allocation schemes) and velocities; calculating the fitness value of each particle (weighted based on resource utilization and task completion time); determining the individual optimal solution and the global optimal solution; dynamically adjusting particle velocity (i.e., the direction and magnitude of strategy adjustment) based on the individual optimal solution and the global optimal solution, combined with inertia weight, cognitive factor, and social factor; updating particle positions; generating new allocation schemes; recalculating fitness values; updating individual and global optimal solutions; if the maximum number of iterations is reached or the fitness value converges, and there is no significant improvement after multiple consecutive rounds, terminating the iteration; and outputting the CPU core allocation strategy corresponding to the global optimal solution, ensuring that resource utilization and task real-time performance achieve optimal balance and meeting the stability requirements of the operation and control system.
[0076] The specific work involves: setting parameters for the particle swarm optimization algorithm, including particle swarm size, number of iterations, and the search space for the CPU core allocation strategy; randomly initializing the position (candidate allocation scheme) and velocity of each particle within the search space; using binary encoding to represent the CPU core allocation state of the particle position, and velocity representing the direction and magnitude of strategy adjustment; calculating the fitness value of each particle based on preset resource utilization and task completion time thresholds; obtaining the fitness value through a weighted sum of resource utilization and task completion time, with weights set according to system priority (60% for resource utilization and 40% for task completion time) to quantify the scheme's ability to guarantee the real-time performance of the operation and control system; determining the individual optimal solution and the global optimal solution for each particle based on the fitness value; and dynamically adjusting the velocity of each particle based on the individual and global optimal solutions, combined with inertia weights, cognitive factors (individual learning factors), and social factors (group learning factors), by updating the velocity formula. Each particle's strategy adjusts its direction and magnitude, thereby updating its position and generating a new CPU core allocation scheme. Under the new position, the operation and control system is restarted, collecting actual values of resource utilization and task completion time, and calculating new fitness values. Based on these new fitness values, the individual optimal solution and the global optimal solution are updated. This process is repeated continuously, allowing the particle swarm to gradually explore better resource allocation schemes in the search space. Through iterative updates, it gradually approaches the optimal solution, optimizing the real-time performance and resource utilization efficiency of the operation and control system. During the iterative optimization process, the changes in fitness values are continuously monitored. If the preset maximum number of iterations is reached, or if the fitness value shows no significant improvement in multiple consecutive iterations (i.e., fitness value convergence), the iteration is terminated, and the CPU core allocation strategy corresponding to the global optimal solution is output. This achieves an optimal balance between resource utilization and task real-time performance, effectively meeting the stability requirements of the operation and control system and ensuring the effective utilization and allocation of resources during high real-time task execution.
[0077] S6 specifically includes: during the iteration process of the particle swarm optimization algorithm, real-time collection of CPU core resource utilization and thread running status, marking of isolated core resources, identification of potential resource conflicts and deadlock risks between non-real-time threads and real-time tasks, dynamic adjustment of CPU core allocation for non-real-time threads based on conflict identification results and combined with the global optimal solution of particle swarm optimization, generation of optimized CPU core allocation scheme, priority release of threads competing for resources with real-time tasks, ensuring the exclusive use of critical path resources, running the adjusted CPU core allocation scheme, verifying whether resource conflicts have been eliminated and deadlock risks have been resolved, and continuing iterative optimization if the targets are not met until the real-time constraints are met or the maximum number of iterations is reached;
[0078] Furthermore, the process of verifying whether resource conflicts have been eliminated and deadlock risks have been mitigated involves: activating the optimized CPU core allocation scheme; collecting key metrics in real time through the operating system interface, including the latency of real-time tasks, resource utilization of non-real-time threads, contention frequency of shared cache / bus, and thread wait queue length and lock holding status; simultaneously monitoring deadlock characteristics, namely circular wait chains or priority inversion events, covering both normal loads and extreme scenarios to ensure comprehensive verification; and quantifying the degree of resource conflicts (whether real-time task latency exceeds thresholds, shared resource contention rate) and deadlock risks (whether unresolved circular waits or lock holding status exist). (Priority inversion) If the real-time task latency is stable within the threshold and there are no deadlock characteristics, the target is considered met; otherwise, the conflict type and location that did not meet the target are marked, adjustment requirements are generated as input for the next iteration. If the target is not met, the fitness function of the particle swarm algorithm is updated according to the conflict analysis results (increasing the conflict penalty weight), the migration strategy or priority setting of non-real-time threads is adjusted, a new allocation scheme is generated and key indicator collection and deadlock characteristic monitoring are returned. If the real-time constraint is met or the maximum number of iterations is reached after continuous iterations, the optimization is terminated, and the current optimal CPU core allocation scheme is output to ensure that the system runs stably without resource contention under high real-time requirements.
[0079] The specific tasks are as follows: During the iteration of the particle swarm optimization algorithm, continuously collect the resource utilization rate of each CPU core and the thread running status. Data is acquired in real time through the operating system interface, and isolated core resources are marked. Based on the resource utilization time slice distribution and thread scheduling logs, potential resource conflicts between non-real-time threads and real-time tasks on shared caches, buses, or memory controllers are identified. Simultaneously, deadlock risks (circular waits or priority inversion) are detected by analyzing thread waiting queues, semaphore holding states, and lock dependencies. Based on the conflict identification results and the global optimal solution of the particle swarm optimization algorithm, the CPU core allocation of non-real-time threads is dynamically adjusted. Adjustment strategies include: prioritizing the migration or suspension of non-real-time threads competing for shared resources with real-time tasks; implementing exclusive core resource allocation for high-priority real-time tasks by forcibly isolating competing cores through hardware affinity settings or the operating system scheduler; and adjusting thread priorities or time slices. To reduce the interference of non-real-time threads on the response time of real-time tasks, the allocation of CPU cores is adjusted to ensure system stability and avoid performance fluctuations caused by excessive migration. After adjustment, the critical path resources of real-time tasks must meet the exclusive constraint, meaning that non-real-time threads cannot occupy or compete for these resources. The adjusted CPU core allocation scheme is then run and stress-tested to verify whether resource conflicts are eliminated (whether the latency of real-time tasks is reduced to within the threshold) and whether deadlock risks are mitigated (whether thread waiting times converge). The verification must cover extreme scenarios and long-term operational stability. If the standards are not met, the particle swarm fitness function is updated based on the verification results, and the core allocation strategy is iteratively optimized. The iteration termination conditions include: real-time constraints are met, deadlock risks are completely eliminated, or the maximum number of iterations is reached. Finally, the core allocation scheme corresponding to the globally optimal solution is output to ensure that the operation and control system utilizes resources efficiently and without contention under high real-time requirements.
[0080] S7 specifically includes: After the iteration, the global optimal particle is selected based on the fitness function of the particle swarm optimization algorithm. The corresponding resource allocation scheme includes core binding, priority configuration and shared resource isolation strategy. The optimal resource allocation scheme is deployed to the robot system. Through the operating system interface, the operation and control thread exclusively occupies the high-priority core group, the perception thread is bound to the low-priority core group, and the cache partition and bus isolation mechanism is enabled. The robot system is run, and the operation and control latency, perception throughput and resource contention indicators are monitored in real time. If the expected results are not met, dynamic fine-tuning (migrating threads or adjusting priorities) is triggered, and a stable and isolated resource allocation scheme is output.
[0081] The specific work involves: After iteration, a comprehensive evaluation of all particles is performed based on the fitness function of the particle swarm optimization algorithm to select the globally optimal particle. The resource allocation scheme corresponding to the globally optimal particle covers three aspects: a core binding strategy that exclusively binds the operation and control thread to a high-priority physical core group through the operating system interface to avoid cache invalidation caused by cross-core migration; a real-time scheduling strategy for priority configuration that ensures the operation and control thread has a higher priority than the perception thread, while allocating a low-priority core group to the perception thread to reduce interference; and a shared resource isolation strategy that limits the occupation of shared cache and bus by non-real-time threads through cache partitioning and bus isolation mechanisms, thereby reducing the probability of resource contention. The final resource allocation scheme is output in the form of a structured configuration file, specifying the core affinity, priority, and resource isolation parameters of each thread. The selected optimal resource allocation scheme is deployed to the robot system, and hardware-level resource isolation is implemented through the operating system interface. The operation and control thread is bound to a dedicated core group using sched_setaffinity and set to a high priority to ensure it obtains absolute execution rights. The perception thread is bound to the remaining core group and configured with a lower priority to avoid preempting operation and control resources. This enables the cache partitioning function and, through r The `esctrl` module allocates independent cache lines to the motion control thread to prevent cache pollution from the perception thread. Simultaneously, it configures isolated data transmission channels between motion control and perception via the bus controller to reduce bus contention. After deployment, the system initialization phase verifies the configuration's effectiveness, including core utilization, priority lookup, and resource isolation status, ensuring the solution is loaded into the runtime environment without conflicts. During robot system operation, key metrics are continuously collected through a real-time monitoring module: motion control latency (measured by a high-precision timer for task response time), perception throughput (the number of data frames processed per unit time), and resource contention metrics (such as cache miss rate and bus conflict count). If motion control latency exceeds a threshold or perception throughput drops by more than 10%, a dynamic fine-tuning mechanism is triggered: non-real-time threads are migrated to idle core groups based on the source of contention (re-bound via `taskset`), or thread priorities are adjusted. If shared resource contention persists, the cache partitioning strategy is further tightened (reducing the available cache for perception threads). After fine-tuning, the system status is reassessed until all metrics stabilize within the expected range. Finally, a dynamically optimized stable resource allocation scheme is output to ensure the robot system operates reliably for a long time under high real-time requirements.
[0082] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0083] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A hierarchical real-time scheduling method for resource isolation in robot motion control and perception systems, characterized in that, Includes the following steps: S1. Set the resource isolation target for the robot system and initialize the particle swarm algorithm parameters, including particle position, velocity and fitness function; S2. In combination with real-time requirements, the resource utilization rate of the operation and control system and the task completion time are defined as resource isolation evaluation indicators for particle swarm fitness evaluation. S3. Encode the position of each particle into a CPU core allocation scheme, including the division between isolated cores and non-isolated cores; S4. Calculate the fitness of the resource allocation scheme for each particle based on the defined resource isolation evaluation index. S5. Utilize the iterative rules of the particle swarm optimization algorithm to update particle velocity and position based on the optimal solutions for individuals and the swarm, and optimize the CPU core allocation strategy. S6. During the iteration of the particle swarm optimization algorithm, continuously monitor the usage status of isolated core resources, dynamically adjust the CPU core allocation of non-real-time threads, and prevent and resolve potential resource conflicts and deadlock risks. S7. After the iteration is completed, the resource allocation scheme corresponding to the particle with the highest fitness is output and implemented in the robot system.
2. The hierarchical real-time scheduling method for resource isolation in robot motion control and perception systems according to claim 1, characterized in that: S1 specifically includes: Clearly define the resource isolation goal between the motion control system and the perception system in the robot system, that is, to enable the motion control system to exclusively use high-priority CPU cores, while ensuring the stable operation of the perception system and user programs; Based on the goal of resource isolation, the particle swarm algorithm parameters are initialized, the particle position is defined as the CPU core allocation scheme, the velocity is set as the iteration adjustment step size, and the fitness function is constructed to evaluate the ability of resource isolation to guarantee real-time performance. Set the particle swarm size, maximum number of iterations, and inertia weight, and determine the update rules for velocity and position.
3. The hierarchical real-time scheduling method for resource isolation in robot motion control and perception systems according to claim 1, characterized in that: S2 specifically includes: The real-time requirements of the operation and control system are clearly defined, and the resource utilization rate and task completion time of the operation and control system are defined as resource isolation evaluation indicators. Among them, the resource utilization rate reflects the utilization rate of the allocated CPU cores of the operation and control system, and the task completion time measures the response speed of the operation and control system tasks. The operation and control system is analyzed, and standard threshold ranges for resource utilization and task completion time are set accordingly, serving as the basic framework for constructing a resource isolation assessment for fitness evaluation.
4. The hierarchical real-time scheduling method for resource isolation in robot motion control and perception systems according to claim 1, characterized in that: S3 specifically includes: The position of each particle is encoded as a CPU core allocation scheme, and CPU cores are randomly assigned as isolated cores or non-isolated cores. Among them, the high priority dimension corresponds to the isolated core number, and the low priority dimension is assigned a non-isolated core. Verify whether the generated CPU core allocation scheme meets hardware constraints and real-time requirements, eliminate conflicting schemes, and correct out-of-bounds allocations.
5. The hierarchical real-time scheduling method for resource isolation in robot motion control and perception systems according to claim 1, characterized in that: S4 specifically includes: Under the CPU core allocation scheme corresponding to the particle, the operation and control system is run to collect the actual values of its resource utilization and task completion time as the basis for evaluation. The actual values of the collected resource utilization rate and task completion time are compared with the preset standard threshold range to determine whether the requirements are met. Based on the fitness function, and by comparing the actual values of resource utilization and task completion time with the standard threshold, the fitness value of the particle is calculated to evaluate its ability to ensure the real-time performance of the operation and control system.
6. The hierarchical real-time scheduling method for resource isolation in robot motion control and perception systems according to claim 5, characterized in that: The calculation process for the fitness value of the calculated particle is as follows: The resource utilization rate and task completion time of the operation and control system under the resource isolation scheme are collected by real-time monitoring tools. The actual operating values are recorded and compared with the preset standard threshold range. If the actual value exceeds the standard threshold range, it is marked as a violation; otherwise, it is considered compliant. Based on the threshold comparison results, a penalty-type fitness function is used to quantify the merits of resource isolation schemes. For compliant resource isolation schemes, the fitness value is obtained by weighted summation of the normalized values of resource utilization and task completion time. The weights are determined according to the system priority, with resource utilization accounting for 60% and task completion time accounting for 40%. All resource isolation schemes are sorted based on fitness values. Schemes with low fitness values are retained first, while schemes with high fitness values or those that violate regulations are eliminated. The resource allocation strategy is adjusted through iterative optimization to gradually converge to the optimal resource isolation scheme.
7. The hierarchical real-time scheduling method for resource isolation in robot motion control and perception systems according to claim 1, characterized in that: S5 specifically includes: The search space is defined by setting the particle swarm size, number of iterations, and CPU core allocation strategy. The particle positions and velocities are initialized, the fitness values of each particle are calculated, and the individual optimal solution and the global optimal solution are determined. Based on the individual optimal solution and the global optimal solution, combined with inertia weight, cognitive factors and social factors, the particle velocity is dynamically adjusted, that is, the direction and magnitude of the strategy adjustment are adjusted, the particle position is updated, a new allocation scheme is generated, and the fitness value is recalculated to update the individual and global optimal solutions. If the maximum number of iterations or the fitness value converges, and there is no significant improvement after multiple consecutive rounds, the iteration is terminated, and the CPU core allocation strategy corresponding to the global optimal solution is output.
8. The method for resource isolation of robot motion control and perception system with hierarchical real-time scheduling according to claim 1, characterized in that: S6 specifically includes: During the iteration of the particle swarm optimization algorithm, the resource utilization of each CPU core and the running status of threads are collected in real time, isolated core resources are marked, and potential resource conflicts and deadlock risks between non-real-time threads and real-time tasks are identified. Based on the conflict identification results, the CPU core allocation of non-real-time threads is dynamically adjusted in conjunction with the global optimal solution of particle swarm optimization, generating an optimized CPU core allocation scheme that prioritizes the release of threads that compete for resources with real-time tasks. Run the adjusted CPU core allocation scheme to verify whether resource conflicts have been eliminated and deadlock risks have been resolved. If the targets are not met, continue iterative optimization until the real-time constraints are met or the maximum number of iterations is reached.
9. The hierarchical real-time scheduling method for resource isolation in robot motion control and perception systems according to claim 8, characterized in that: The process for verifying whether resource conflicts have been eliminated and whether deadlock risks have been mitigated is as follows: The optimized CPU core allocation scheme is launched, and key indicators are collected in real time through the operating system interface, including the latency of real-time tasks, the resource utilization of non-real-time threads, the contention frequency of shared cache / bus, and the length of thread waiting queues and lock holding status. At the same time, deadlock characteristics, namely circular wait chains or priority inversion events, are monitored, covering normal load and extreme scenarios. Based on the collected data, the degree of resource conflict and deadlock risk are quantified. If the real-time task latency is stable within the threshold and there are no deadlock characteristics, the target is considered met. Otherwise, mark the types and locations of the non-compliant conflicts, generate adjustment requirements, and use them as input for the next iteration; If the target is not met, update the fitness function of the particle swarm optimization algorithm based on the conflict analysis results, adjust the migration strategy or priority setting of non-real-time threads, generate a new allocation scheme and return key indicator collection and deadlock feature monitoring. If the real-time constraint is met or the maximum number of iterations is reached after continuous iterations, the optimization is terminated and the current optimal CPU core allocation scheme is output.
10. The hierarchical real-time scheduling method for resource isolation in robot motion control and perception systems according to claim 1, characterized in that: Specifically, S7 includes: After the iteration, the global optimal particle is selected based on the fitness function of the particle swarm algorithm. The corresponding resource allocation scheme includes kernel binding, priority configuration and shared resource isolation strategy. The optimal resource allocation scheme is deployed to the robot system. Through the operating system interface, the operation and control thread is given exclusive access to the high-priority core group, the perception thread is bound to the low-priority core group, and the cache partitioning and bus isolation mechanism is enabled. The robot system is operated to monitor operational delays, perception throughput, and resource contention indicators in real time. If these indicators do not meet expectations, dynamic fine-tuning is triggered, and a stable and isolated resource allocation scheme is output.