Search

CN-122008182-A - Hierarchical real-time scheduling robot operation control and perception system resource isolation method

CN122008182ACN 122008182 ACN122008182 ACN 122008182ACN-122008182-A

Abstract

The invention discloses a method for isolating resources of a robot operation control and sensing system with hierarchical real-time scheduling, which relates to the technical field of robot control, and aims at setting the resources of a robot system to isolate the targets, and initializing parameters of a particle swarm algorithm, including particle position, speed and fitness function; and defining the resource occupancy rate and the task completion time of the operation control system as resource isolation evaluation indexes for evaluating the fitness of the particle swarm by combining with the real-time requirements. According to the invention, the CPU core allocation strategy is optimized through the particle swarm algorithm, the control system is ensured to monopolize the high-priority core, the core allocation of the non-real-time thread is dynamically adjusted by combining the resource occupancy rate and the adaptability evaluation of the task completion time, the resource competition is avoided, the control task delay is stabilized at the millisecond level, the high-real-time requirement is met, meanwhile, the perception system and the user program stably run on the non-isolated core, and the response speed and the stability of the robot motion control are obviously improved.

Inventors

  • Request for anonymity
  • Request for anonymity

Assignees

  • 北京加速进化科技有限公司

Dates

Publication Date
20260512
Application Date
20251212

Claims (10)

  1. 1. The method for isolating the robot operation control and perception system resources in the hierarchical real-time scheduling is characterized by comprising the following steps: S1, setting a robot system resource isolation target, and initializing particle swarm algorithm parameters including particle position, speed and fitness function; s2, defining the resource occupancy rate and task completion time of the operation control system as resource isolation evaluation indexes for evaluating the fitness of the particle swarm by combining with the real-time requirements; S3, encoding the position of each particle into a CPU core allocation scheme, wherein the CPU core allocation scheme comprises the division of an isolated core and a non-isolated core; S4, calculating the adaptability of the resource allocation scheme corresponding to each particle according to the defined resource isolation evaluation index; s5, updating particle speed and position according to an individual and group optimal solution by using an iteration rule of a particle swarm algorithm, and optimizing a CPU core allocation strategy; S6, continuously monitoring the use state of the isolated core resources in the iterative process of the particle swarm algorithm, dynamically adjusting the CPU core allocation of the non-real-time thread, and preventing and resolving the potential resource conflict and deadlock risks; And S7, outputting a resource allocation scheme corresponding to the particle with the highest fitness after the iteration is finished, and implementing the resource allocation scheme in the robot system.
  2. 2. The method for isolating resources of a hierarchical real-time dispatching robot control and sensing system according to claim 1, wherein the step S1 specifically comprises the following steps: Defining a resource isolation target of the operation control system and the perception system in the robot system, namely enabling the operation control system to monopolize a high-priority CPU core and simultaneously guaranteeing stable operation of the perception system and a user program; initializing particle swarm algorithm parameters on the basis of a resource isolation target, defining particle positions as a CPU core allocation scheme, setting the speed as an iterative adjustment step length, and constructing a fitness function to evaluate the real-time guaranteeing capability of resource isolation; And setting the particle swarm scale, the maximum iteration number and the inertia weight, and determining the update rule of the speed and the position.
  3. 3. The method for isolating resources of a hierarchical real-time dispatch robot control and awareness system of claim 1, wherein S2 comprises: defining real-time requirements of the operation control system, and defining resource occupancy rate and task completion time of the operation control system as resource isolation evaluation indexes, wherein the resource occupancy rate reflects the utilization rate of the operation control system to the distributed CPU cores, and the task completion time measures the response speed of the operation control system task; And analyzing the operation control system, and setting a standard threshold range of the resource occupancy rate and the task completion time according to the analysis result to serve as a resource isolation evaluation base frame for constructing the adaptability evaluation.
  4. 4. The method for isolating resources of a hierarchical real-time dispatch robot control and awareness system of claim 1, wherein S3 comprises: the method comprises the steps of encoding the position of each particle into a CPU core allocation scheme, randomly allocating CPU cores as isolated cores or non-isolated cores, wherein high-priority dimensions correspond to isolated core numbers, and low-priority dimensions allocate non-isolated cores; checking whether the generated CPU core allocation scheme meets the hardware constraint and real-time requirements, eliminating conflict schemes, and correcting out-of-limit allocation.
  5. 5. The method for isolating resources of a hierarchical real-time dispatch robot control and awareness system of claim 1, wherein S4 comprises: Under the CPU core allocation scheme corresponding to the particles, operating the operation control system, and collecting the actual values of the resource occupancy rate and the task completion time of the operation control system as basic data for evaluation; Comparing the acquired actual values of the resource occupancy rate and the task completion time with a preset standard threshold range respectively, and judging whether the requirements are met; according to the fitness function, the fitness value of the particles is calculated by combining the actual values of the resource occupancy rate and the task completion time with the comparison result of the standard threshold value, and the real-time guaranteeing capability of the operation control system is evaluated.
  6. 6. The method for isolating resources of the hierarchical real-time scheduling robot control and perception system according to claim 5, wherein the calculation process for calculating the fitness value of the particle is as follows: The real-time monitoring tool is used for collecting the resource occupancy rate and the task completion time of the operation control system under the resource isolation scheme, the actual running values of the operation control system are recorded respectively, the actual values are compared with a preset standard threshold range, if the actual values exceed the standard threshold range, the operation control system is marked as illegal, otherwise, the operation control system is considered as legal; quantifying the advantages and disadvantages of the resource isolation scheme by adopting a punishment fitness function according to a threshold comparison result, wherein for the qualified resource isolation scheme, the fitness value is obtained by weighting and summing the normalized values of the resource occupancy rate and the task completion time, the weight is determined according to the system priority, the resource occupancy rate is 60%, and the task completion time is 40%; And sorting all the resource isolation schemes based on the fitness value, preferentially reserving the resource isolation schemes with low fitness value, eliminating the resource isolation schemes with high fitness value or violating rules, and gradually converging to the optimal resource isolation scheme by iteratively optimizing and adjusting the resource allocation strategy.
  7. 7. The method for isolating resources of the hierarchical real-time dispatching robot control and sensing system of claim 1, wherein the step S5 specifically comprises the following steps: Setting the particle swarm scale, iteration times and a search space of a CPU core allocation strategy, initializing the particle position and speed, calculating the fitness value of each particle, and determining an individual optimal solution and a global optimal solution; dynamically adjusting particle speed, namely strategy adjustment direction and amplitude, according to the individual optimal solution and the global optimal solution, and combining inertia weight, cognitive factor and social factor, updating particle position, generating a new allocation scheme, recalculating fitness value, and updating the individual and the global optimal solution; if the maximum iteration times or the adaptability value is converged, the iteration is terminated and the CPU core allocation strategy corresponding to the global optimal solution is output continuously for multiple rounds without obvious improvement.
  8. 8. The method for isolating resources of a hierarchical real-time dispatch robot control and awareness system of claim 1, wherein S6 comprises: In the iterative process of the particle swarm algorithm, the occupancy rate of each CPU core resource and the running state of the thread are collected in real time, the isolated core resource is marked, and potential resource conflict and deadlock risks of a non-real-time thread and a real-time task are identified; based on the conflict identification result, dynamically adjusting CPU core allocation of the non-real-time threads by combining with a particle swarm global optimal solution, generating an optimized CPU core allocation scheme, and preferentially releasing threads competing for resources with real-time tasks; And (3) operating the adjusted CPU core allocation scheme, verifying whether the resource conflict is eliminated and the deadlock risk is solved, and if the resource conflict is not up to standard, continuing iterative optimization until the real-time constraint is met or the maximum iterative times are reached.
  9. 9. The method for isolating resources of a hierarchical real-time scheduling robot control and awareness system according to claim 8, wherein the steps of verifying whether resource conflicts are eliminated and whether deadlock risks are resolved are as follows: starting an optimized CPU core allocation scheme, and acquiring key indexes in real time through an operating system interface, wherein the key indexes comprise delay time of a real-time task, resource occupancy rate of a non-real-time thread, competition frequency of a shared cache/bus, thread waiting queue length and lock holding state, and monitoring deadlock characteristics, namely a cyclic waiting chain or priority reversing event, so as to cover normal load and extreme scenes; based on the collected data, quantifying the resource conflict degree and the deadlock risk, judging whether the real-time task delay is stable within a threshold value and has no deadlock feature, otherwise marking conflict types and positions which are not up to standard, and generating an adjustment requirement as the input of the next iteration; If the non-real-time thread does not reach the standard, updating the fitness function of the particle swarm algorithm according to the conflict analysis result, adjusting the migration strategy or priority setting of the non-real-time thread, and generating a new allocation scheme, returning to key index acquisition and deadlock feature monitoring, and if the real-time constraint meets or reaches the maximum iteration number after continuous iteration, terminating optimization and outputting the current optimal CPU core allocation scheme.
  10. 10. The method for isolating resources of a hierarchical real-time dispatch robot control and awareness system of claim 1, wherein S7 comprises: after iteration is finished, screening out global optimal particles based on a fitness function of a particle swarm algorithm, wherein a corresponding resource allocation scheme comprises core binding, priority configuration and a shared resource isolation strategy; deploying an optimal resource allocation scheme to a robot system, realizing that a control thread monopolizes a high-priority core group through an operating system interface, perceiving that the thread binds a low-priority core group, and starting a buffer partition and bus isolation mechanism; And (3) operating the robot system, monitoring operation control delay, perceived throughput and resource competition indexes in real time, triggering dynamic fine adjustment if the expected delay is not reached, and outputting a stable and isolated resource allocation scheme.

Description

Hierarchical real-time scheduling robot operation control and perception system resource isolation method Technical Field The invention relates to the technical field of robot control, in particular to a method for isolating resources of a robot operation control and sensing system in hierarchical real-time scheduling. Background With the rapid development of robot technology, a robot system needs to bear multi-level functions such as high-instantaneity motion control, perception decision making and user interaction, a motion control system (operation control system) is used as a cerebellum of the robot and is responsible for balancing and walking control, the real-time requirement is extremely high, any delay can cause unstable operation, a perception system needs to process data such as cameras and radars and generate decisions, the real-time requirement is relatively low, the requirements on the real-time are minimum, the coexisting functions of voice interaction, network entertainment and the like need to ensure that the operation control system monopolizes key CPU resources to maintain high real-time, the stability of the performance of the perception system is ensured, and flexible space is reserved for secondary development of users, but the mode of single equipment operation multi-system cannot meet the grading real-time requirement. In the prior art, the resource isolation is realized mainly by means of a Namespace+ cgroup or a container scheme, and the method has obvious defects that cgroup can plan system resources, but is difficult to completely isolate kernel interruption and a subsequently started process, and a high-real-time operation control system is easily blocked; although the container technology can isolate the file system and the process space, the problem of system-level resource competition still cannot be thoroughly solved, in addition, the existing scheme has limited control capability for the third party user development program, the user program possibly occupies the resource required by the operation control system, unpredictable performance reduction is caused, while the dynamic kernel binding operation can partially relieve the problem, but a large number of rules need to be modified and driven or configured, and all unknown processes cannot be covered, so that the system complexity is high and the real-time performance is not enough. Disclosure of Invention In order to solve the technical problems, the invention is realized by the following technical scheme that the method for isolating the resources of the robot operation control and sensing system for hierarchical real-time scheduling comprises the following steps: S1, setting a robot system resource isolation target, and initializing particle swarm algorithm parameters including particle position, speed and fitness function; s2, defining the resource occupancy rate and task completion time of the operation control system as resource isolation evaluation indexes for evaluating the fitness of the particle swarm by combining with the real-time requirements; S3, encoding the position of each particle into a CPU core allocation scheme, including division of an isolated core and a non-isolated core, and ensuring that the operation control system monopolizes the high-priority core; S4, calculating the adaptability of the resource allocation scheme corresponding to each particle according to the defined resource isolation evaluation index, and evaluating the real-time guaranteeing capability of the resource allocation scheme to the operation control system; s5, updating particle speed and position according to an individual and group optimal solution by using an iteration rule of a particle swarm algorithm, and optimizing a CPU core allocation strategy; S6, continuously monitoring the use state of the isolated core resources in the iterative process of the particle swarm algorithm, dynamically adjusting the CPU core allocation of the non-real-time thread, and preventing and resolving the potential resource conflict and deadlock risks; And S7, outputting a resource allocation scheme corresponding to the particle with the highest fitness after the iteration is finished, and implementing the resource allocation scheme in the robot system. Preferably, the S1 specifically includes: Defining a resource isolation target of the operation control system and the perception system in the robot system, namely enabling the operation control system to monopolize a high-priority CPU core and simultaneously guaranteeing stable operation of the perception system and a user program; Initializing particle swarm algorithm parameters on the basis of a resource isolation target, defining particle positions as CPU core allocation schemes (isolation/non-isolation), setting the speed as an iterative adjustment step length, and constructing a fitness function to evaluate the guarantee capability of resource isolation on real-time performance; And setting