Distributed collision detection and obstacle avoidance method and system for simulation trainer

By using adaptive hierarchical partitioning and parallel collision detection, a multi-level spatial mesh structure is generated. By combining motion constraints and task priorities, obstacle avoidance trajectories are generated, which solves the problems of insufficient accuracy and waste of resources in distributed collision detection. This achieves efficient and real-time collision detection and obstacle avoidance, adapting to the simulation training needs of different scales and complexities.

CN121074331AActive Publication Date: 2025-12-05BEIJING SPARK SPOT TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202511614052.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2025-12-05
Estimated Expiration
2045-11-06

AI Technical Summary

Technical Problem

Existing distributed collision detection methods suffer from insufficient collision detection accuracy or wasted computational resources when dealing with scenarios with large differences in the density of dynamic objects. Furthermore, data synchronization and communication overhead are high in cross-node collision detection, affecting the real-time performance of the system, and obstacle avoidance algorithms struggle to generate trajectories that conform to actual physical constraints.

Method used

An adaptive hierarchical partitioning method is used to generate a multi-level spatial mesh structure. Dynamic objects are mapped to corresponding mesh cells. Potential collision object pairs are identified through parallel collision detection. Obstacle avoidance trajectories are generated by combining motion constraints and task priorities. The mesh structure is dynamically adjusted to adapt to changes in object distribution density.

Benefits of technology

It improves collision detection efficiency, reduces computational resource consumption, generates obstacle avoidance trajectories that conform to actual physical characteristics, ensures the realism and continuity of simulation training, and has good scalability and adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121074331A_ABST
    Figure CN121074331A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of virtual simulation, and discloses a distributed collision detection and obstacle avoidance method and system for a simulation trainer. The method comprises the following steps: acquiring space state information of a multi-simulation-node dynamic object; carrying out self-adaptive hierarchy division on the simulation space to generate a multi-hierarchy grid and mapping an object; local collision detection is executed in parallel to identify potential collision object pairs, and cross-node information is synchronized; calculating a collision prediction value to generate early warning information; generating an obstacle avoidance track in combination with the motion constraint and the priority; and dynamically adjusting the grid structure. According to the invention, the collision detection precision and real-time performance in a distributed environment can be improved, and the computing resource consumption is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of virtual simulation, in particular to a distributed collision detection and obstacle avoidance method and system for a simulation trainer. BACKGROUND

[0002] A distributed simulation trainer is a high-level training system used in military, aviation, aerospace and other fields, which can simulate real scenes in a virtual environment to provide training experience similar to actual combat for operators. In such training systems, collision detection and obstacle avoidance are key technologies to ensure the reality of simulation and the stability of the system. With the continuous expansion of the scale of simulation training, a single computing node cannot meet the simulation needs of large scale and high precision, and distributed simulation architecture has gradually become the mainstream. In a distributed environment, multiple simulation nodes process different regions or different types of dynamic objects in parallel, which makes collision detection and obstacle avoidance face challenges in data synchronization, computational efficiency and real-time performance.

[0003] Traditional collision detection techniques are mainly based on uniform grid partitioning or tree structure in global space. Such methods have obvious shortcomings when dealing with scenarios where the density of dynamic objects varies greatly in a distributed environment. Existing distributed collision detection methods usually use a fixed-grained spatial partitioning strategy, which cannot effectively adapt to the spatiotemporal changes in the distribution density of dynamic objects, resulting in insufficient collision detection accuracy in object-dense areas or wasting computational resources in sparse areas. During cross-node collision detection, data synchronization and communication overhead are large, especially when a large number of dynamic objects migrate or interact between different nodes, which can easily cause communication bottlenecks and affect the real-time performance of the system. Existing obstacle avoidance algorithms often use preset rules or simple trajectory adjustment methods, lacking comprehensive consideration of the motion constraints of dynamic objects and task priorities, making it difficult to generate smooth, efficient and physically constrained obstacle avoidance trajectories in complex environments, affecting the reality and effectiveness of simulation training. SUMMARY

[0004] The embodiments of the present application provide a distributed collision detection and obstacle avoidance method and system for a simulation trainer, which can at least solve some of the problems existing in the prior art.

[0005] In a first aspect, the embodiments of the present application provide a distributed collision detection and obstacle avoidance method for a simulation trainer, comprising: Obtaining spatial state information of dynamic objects managed by each simulation node in a distributed simulation trainer; Adaptively dividing the simulation space based on the spatial state information to generate a multi-level spatial grid structure, and mapping the dynamic objects to corresponding spatial grid cells to obtain an object-grid mapping relationship; According to the object-grid mapping relationship, local collision detection is performed on each simulation node in parallel to identify potential collision object pairs in the same space grid cell and between adjacent space grid cells, and the identification information of the potential collision object pairs across nodes is synchronized to the corresponding simulation node to obtain a global potential collision set; For each potential collision object pair in the global potential collision set, a collision time prediction value and a collision position prediction value are calculated to generate collision warning information; According to the collision warning information, in combination with the motion constraint conditions and task priorities of each dynamic object, an obstacle avoidance trajectory is generated for the dynamic object for which the collision warning occurs; Based on the obstacle avoidance trajectory, the motion state information of the corresponding dynamic object is updated, and the multi-level space grid structure is dynamically adjusted using the updated spatial state information to adapt to changes in the distribution density of dynamic objects.

[0006] Based on the spatial state information, the simulation space is adaptively divided into multiple levels to generate a multi-level space grid structure, and the dynamic objects are mapped to corresponding space grid cells to obtain an object-grid mapping relationship, including: Based on the position information in the spatial state information, the dynamic object distribution density of each space region in the simulation space is calculated to obtain density distribution data; According to the density distribution data, the simulation space is divided into a high-density region and a low-density region, and the high-density region is assigned a fine-grained level identifier and the low-density region is assigned a coarse-grained level identifier to obtain a region-level correspondence relationship; According to the region-level correspondence relationship, space grid cells of a first size are generated for the high-density region and space grid cells of a second size are generated for the low-density region to form the multi-level space grid structure, wherein the first size is smaller than the second size; The position information of each dynamic object is compared with the spatial range of each space grid cell in the multi-level space grid structure to determine the space grid cell to which each dynamic object belongs, and an association relationship between the dynamic object identifier and the space grid cell identifier is established to obtain the object-grid mapping relationship.

[0007] The position information of each dynamic object is compared with the spatial range of each space grid cell in the multi-level space grid structure to determine the space grid cell to which each dynamic object belongs, and an association relationship between the dynamic object identifier and the space grid cell identifier is established to obtain the object-grid mapping relationship, including: The spatial range information of each space grid cell is extracted from the multi-level space grid structure; The position information of each dynamic object is determined to have a spatial inclusion relationship with the boundary coordinates in the spatial range information, and a spatial grid cell to which the position information of each dynamic object belongs is identified, to obtain a preliminary attribution relationship between the dynamic objects and the spatial grid cells. For each dynamic object in the preliminary attribution relationship, it is determined whether the geometric boundary of the dynamic object intersects with the boundary coordinates of the spatial grid cell to which the dynamic object belongs, based on the geometric boundary information in the spatial state information. In the case of intersection, it is determined whether the geometric boundary of the dynamic object overlaps with the spatial range of the adjacent spatial grid cell, and in the case of overlap, the dynamic object is associated to the adjacent spatial grid cell, to obtain cross-border object association information. The preliminary attribution relationship and the cross-border object association information are merged to establish an association relationship between the identification of each dynamic object and the identification of one or more spatial grid cells, to obtain the object-grid mapping relationship.

[0008] According to the object-grid mapping relationship, local collision detection is performed in parallel on each simulation node to identify potential collision object pairs within the same spatial grid cell and between adjacent spatial grid cells, and the identification information of the cross-node potential collision object pairs is synchronized to the corresponding simulation node, to obtain a global potential collision set, including: According to the object-grid mapping relationship, each spatial grid cell in the multi-level spatial grid structure is assigned to a corresponding simulation node to obtain node-grid assignment information. Based on the node-grid assignment information, intra-cell candidate object pairs and inter-cell candidate object pairs are determined on each simulation node to obtain a local candidate object pair set. For each candidate object pair in the local candidate object pair set, the spatial distance between the geometric boundaries of the two dynamic objects in the candidate object pair is calculated based on the geometric boundary information and the motion state information in the spatial state information, and a local potential collision object pair set is identified based on the spatial distance. For each potential collision object pair in the local potential collision object pair set, a potential collision object pair belonging to spatial grid cells managed by different simulation nodes is marked as a cross-node potential collision object pair, and the identification information of the cross-node potential collision object pair is extracted to obtain cross-node collision information. The cross-node collision information is synchronized to the simulation node to which each dynamic object in the cross-node potential collision object pair belongs, and the received cross-node collision information is merged with the local potential collision object pair set on each simulation node to obtain the global potential collision set.

[0009] determine intra-cell candidate object pairs and inter-cell candidate object pairs based on the node-grid distribution information, to obtain a local candidate object pair set, including: extract dynamic object identifiers contained in each spatial grid cell from the set of spatial grid cells managed by each simulation node based on the node-grid distribution information, to obtain a cell-object correspondence table; For each spatial grid cell in the cell-object correspondence table, combine the dynamic object identifiers in the spatial grid cell in pairs to obtain the intra-cell candidate object pairs; Based on the spatial range information of each spatial grid cell in the multi-level spatial grid structure, identify the adjacent spatial grid cells of each spatial grid cell in the set of spatial grid cells, establish the adjacency relationship between the spatial grid cell identifier and the identifier of its adjacent spatial grid cell, and obtain a grid adjacency relationship table; For each adjacency relationship in the grid adjacency relationship table, obtain the dynamic object identifiers in the two adjacent spatial grid cells in the adjacency relationship from the cell-object correspondence table, and combine the dynamic object identifiers in one spatial grid cell with the dynamic object identifiers in its adjacent spatial grid cell to obtain the inter-cell candidate object pairs. Merge the intra-cell candidate object pairs and the inter-cell candidate object pairs to obtain the local candidate object pair set.

[0010] For each potential collision object pair in the global potential collision set, calculate the collision time prediction value and the collision position prediction value, and generate collision warning information, including: For each potential collision object pair in the global potential collision set, determine the motion trajectory equation of the dynamic objects in the future time period based on the motion state information of the two dynamic objects in the potential collision object pair in the space state information, to obtain object motion trajectory information; Based on the geometric boundary information of the two dynamic objects in the potential collision object pair in the space state information and the object motion trajectory information, extend the geometric boundary of each dynamic object along its motion trajectory equation to obtain the dynamic object space envelope; For the dynamic object space envelopes of the two dynamic objects in the potential collision object pair, calculate the spatial intersection region between the two dynamic object space envelopes, calculate the collision time prediction value of the potential collision object pair based on the spatial intersection region, and calculate the geometric center coordinates of the spatial intersection region corresponding to the collision time prediction value as the collision position prediction value, to obtain collision space-time prediction data; Associate the identifier information of the potential collision object pair with the collision space-time prediction data to generate the collision warning information.

[0011] According to the collision warning information, in combination with the motion constraint conditions and the task priorities of the dynamic objects, an obstacle avoidance trajectory is generated for the dynamic object for which the collision warning occurs, including: From the collision warning information, identification information of a potential collision object pair for which the collision warning occurs is extracted, the identification of each dynamic object in the potential collision object pair is obtained, and a warning object set is obtained; For each dynamic object in the warning object set, the motion constraint condition and the task priority of the dynamic object are extracted from the space state information; For each potential collision object pair in the collision warning information, based on the task priority of the two dynamic objects in the potential collision object pair, a main obstacle object and a keep object in the two dynamic objects are determined, and an obstacle avoidance responsibility allocation result is obtained; For the motion constraint condition of each main obstacle avoidance object in the obstacle avoidance responsibility allocation result, a candidate trajectory space of the main obstacle avoidance object is determined, and in combination with the collision position prediction value in the collision warning information, a trajectory scheme that maintains a safe distance from the collision position prediction value is selected from the candidate trajectory space, and a feasible obstacle avoidance trajectory set is obtained; For the deviation cost of each trajectory scheme in the feasible obstacle avoidance trajectory set relative to the original motion trajectory of the main obstacle avoidance object and the time cost required to complete the obstacle avoidance, one of the trajectory schemes is selected as the obstacle avoidance trajectory of the main obstacle avoidance object.

[0012] In a second aspect of the embodiment of the application, a distributed collision detection and obstacle avoidance system for a simulation trainer is provided, including: A first unit is configured to obtain space state information of dynamic objects managed by each simulation node in a distributed simulation trainer; A second unit is configured to perform adaptive hierarchical division on a simulation space based on the space state information, generate a multi-level space grid structure, and map the dynamic objects to corresponding space grid units to obtain an object-grid mapping relationship; A third unit is configured to perform local collision detection on each simulation node in parallel according to the object-grid mapping relationship, identify potential collision object pairs in the same space grid unit and between adjacent space grid units, and synchronize identification information of the potential collision object pairs across nodes to the corresponding simulation nodes to obtain a global potential collision set; A fourth unit is configured to calculate a collision time prediction value and a collision position prediction value for each potential collision object pair in the global potential collision set, and generate collision warning information; A fifth unit is configured to generate an obstacle avoidance trajectory for a dynamic object for which the collision warning occurs according to the collision warning information, in combination with the motion constraint conditions and the task priorities of the dynamic objects; The sixth unit is configured to update the motion state information of the corresponding dynamic object based on the obstacle avoidance trajectory update, and dynamically adjust the multi-level spatial grid structure based on the updated spatial state information to adapt to the change of the dynamic object distribution density.

[0013] In a third aspect, the present application provides an electronic device, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to execute the method described above.

[0014] In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon computer program instructions, which, when executed by a processor, implement the method described above.

[0015] The present application significantly improves the efficiency of collision detection in large-scale simulation environment through adaptive hierarchical spatial division and parallel collision detection strategy, reduces the consumption of computing resources, and enables real-time processing of collision detection tasks in high-density and high-dynamic scenarios.

[0016] The early warning mechanism based on collision time prediction and position prediction, combined with the motion constraints and task priorities of dynamic objects, generates an obstacle avoidance trajectory that conforms to the actual physical characteristics, ensuring the authenticity and continuity of simulation training and effectively avoiding collision events during training.

[0017] The use of distributed computing architecture and dynamic grid structure adjustment strategy makes the system have good scalability and adaptability, and can automatically optimize resource allocation according to the change of dynamic object distribution density, meeting the simulation training needs of different scales and complexities. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 The flowchart of the distributed collision detection and obstacle avoidance method for the simulation training device according to the present application embodiment.

[0019] Figure 2 The flowchart of determining the object-grid mapping relationship according to the present application embodiment. DETAILED DESCRIPTION

[0020] To make the objectives, technical solutions, and advantages of the present application embodiments clearer, the technical solutions of the present application embodiments will be described below in conjunction with the drawings in the present application embodiments. Obviously, the described embodiments are only some of the present application embodiments, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present application.

[0021] The technical solutions of the present application will be described in detail below with specific examples. The following specific examples can be combined with each other, and the same or similar concepts or processes may not be described in detail in some examples.

[0022] Figure 1 The flowchart of the method for distributed collision detection and obstacle avoidance of the simulation trainer according to an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, the method comprises the following steps: Figure 1 acquiring spatial state information of dynamic objects managed by each simulation node in the distributed simulation trainer; performing adaptive hierarchical partitioning on the simulation space based on the spatial state information, generating a multi-level spatial grid structure, and mapping the dynamic objects to corresponding spatial grid cells to obtain an object-grid mapping relationship; performing local collision detection on each simulation node in parallel according to the object-grid mapping relationship, identifying potential collision object pairs within the same spatial grid cell and between adjacent spatial grid cells, and synchronizing the identification information of the cross-node potential collision object pairs to the corresponding simulation nodes to obtain a global potential collision set; calculating the collision time prediction value and the collision position prediction value for each potential collision object pair in the global potential collision set to generate collision warning information; generating an obstacle avoidance trajectory for the dynamic object that has collision warning according to the collision warning information and in combination with the motion constraint conditions and task priority of each dynamic object; updating the motion state information of the corresponding dynamic object based on the obstacle avoidance trajectory, and dynamically adjusting the multi-level spatial grid structure using the updated spatial state information to adapt to changes in the distribution density of the dynamic objects.

[0023] In the distributed simulation trainer environment, the spatial state information of the dynamic objects managed by each simulation node is acquired through a network communication interface. The spatial state information includes the position coordinates, linear velocity, angular velocity, acceleration, direction, attitude angle, and geometric shape parameters of each dynamic object. For example, for a UAV object, the spatial state information includes three-dimensional coordinates (x = 125.3 meters, y = 67.8 meters, z = 45.2 meters), linear velocity (vx = 2.5 meters / second, vy = 1.2 meters / second, vz = 0.5 meters / second), angular velocity (ωx = 0.03 radian / second, ωy = 0.01 radian / second, ωz = 0.02 radian / second), and shape size (length = 0.8 meters, width = 0.6 meters, height = 0.2 meters). A timestamp-based state synchronization mechanism is used to ensure that the state information obtained by each node is consistent in time, with a time accuracy of milliseconds. ​

[0024] After obtaining the spatial state information, the simulation space is adaptively hierarchically divided based on the information. In the specific implementation, an octree data structure is used for multi-level division of the three-dimensional space. First, the boundary of the entire simulation space is determined, such as the boundary of a certain simulation scene being a cubic space (0, 0, 0) to (1000, 1000, 500) meters. According to the distribution density of the dynamic objects, the initial grid size and the maximum division depth are adaptively determined. In the object sparse area, the grid division is coarse, such as being set to a cubic with a side length of 100 meters; in the object dense area, the grid is subdivided to a higher level, such as the side length being refined to 1.5 meters. In actual application, the maximum depth of the octree is set to 8 layers, and the grid size ratio of adjacent levels is 2:1. In the area where the dynamic objects are very densely distributed, such as 100 objects gathering in a space with a radius of 50 meters, the grid subdivision level of the area is automatically increased, and the spatial resolution is improved.

[0025] After the space division is completed, the dynamic objects are mapped to the corresponding space grid cells to obtain the object-grid mapping relationship. The mapping process is based on the overlap judgment of the bounding box of the dynamic object and the space grid, and the discrete coordinate mapping technology is used to realize fast positioning. For large objects that span multiple grids, mapping relationships are established in all related grids. For example, a vehicle object with a length of 12 meters can be mapped to 3-4 adjacent grid cells at the same time. A bidirectional index structure is maintained: a mapping table from grid cells to objects and a mapping table from objects to grid cells, which facilitates fast lookup. Each mapping relationship contains object identifier, belonging simulation node identifier, and occupied grid cell coordinates. When there are 500 dynamic objects distributed in the simulation space, the establishment of all mapping relationships can be completed within 0.5 seconds.

[0026] According to the object-grid mapping relationship, local collision detection is performed in parallel on each simulation node, and each simulation node is responsible for detecting the collision in the space grid cell managed by it. The detection is divided into two stages: wide-phase detection and narrow-phase detection. In the wide-phase detection stage, potential collision object pairs in the same grid cell and adjacent grid cells are identified. Adjacent determination is based on the 26-neighbor relationship of the grid cell (all adjacent cells of a cubic grid cell in three-dimensional space). For cross-node cases, such as objects located in boundary grids, the identification information of the potential collision object pairs is synchronized to the corresponding simulation node through the message queue. This stage mainly performs fast judgment based on the bounding box of the object to screen out potential collision pairs and reduce the workload of subsequent accurate calculation. In actual application, when there are 1000 dynamic objects, the number of object pairs that need to be accurately detected can be reduced from the theoretical 499,500 pairs to about 5,000 pairs in the wide-phase detection stage, with an efficiency improvement of about 99%.

[0027] For each potential collision object pair in the filtered global potential collision set, a collision time prediction and a collision position prediction are calculated, and a collision warning information is generated. The calculation process takes into account the current position, speed, acceleration, and shape characteristics of the objects, and uses time extrapolation to predict the motion trajectory of the objects over a certain period of time (usually 5-30 seconds) in the future. The predicted trajectories of the two objects are compared to determine whether there is a crossing point and the crossing time. For cases where the predicted collision time is within a threshold (such as 10 seconds), a collision warning information is generated, including the collision object identifier, the predicted collision time (such as 8.3 seconds later), the predicted collision position coordinates (such as x=256.3 meters, y=178.9 meters, z=42.1 meters), the collision severity assessment (such as the estimated collision kinetic energy is 1250 Joules), etc. To improve prediction accuracy, higher frequency state updates and prediction calculations are used for high dynamic objects (such as acceleration greater than 5 meters / second²), with an update period as short as 50 milliseconds.

[0028] Based on the generated collision warning information, combined with the motion constraints and task priorities of each dynamic object, an obstacle avoidance trajectory is generated for the dynamic object that has a collision warning. The motion constraints include physical constraints such as maximum speed limit (such as 20 meters / second), maximum acceleration limit (such as 3 meters / second²), maximum steering angular velocity (such as 1 radian / second), and specific task constraints (such as maintaining a flight altitude not lower than 30 meters). Based on priority rules, it is determined which objects need to yield, such as emergency tasks with higher priority than general tasks, and large mass objects with higher avoidance cost than small mass objects. The obstacle avoidance trajectory generation uses sampling optimization technology to generate multiple candidate trajectories that meet the constraint conditions, and selects the trajectory with the lowest collision risk and optimal energy consumption. For example, for two unmanned aerial vehicles flying towards each other, a low-priority unmanned aerial vehicle will generate a 15-degree yaw trajectory for 10 seconds, and then resume the original flight path, which can maintain a safe distance of no less than 50 meters while minimizing energy consumption.

[0029] Based on the generated obstacle avoidance trajectory, the motion state information of the corresponding dynamic object is updated, and the updating process is realized by issuing instructions to the object control system. The control instructions include target position, speed, acceleration, heading angle and other parameters. A segmented control strategy is adopted to discretize the obstacle avoidance trajectory into a series of control points, and the time interval between control points is usually 0.5-1 second. In order to ensure control accuracy, a closed-loop feedback mechanism is implemented to monitor the deviation between the actual motion state of the object and the expected trajectory in real time. When the deviation exceeds the threshold value (such as a position deviation of more than 2 meters or a direction deviation of more than 5 degrees), the trajectory is re-planned. Using the updated spatial state information, the multi-level spatial grid structure is dynamically adjusted to adapt to the changes in the distribution density of dynamic objects. The adjustment strategy includes grid merging and splitting. When the object density in a certain area falls below the threshold value (such as 0.01 objects per cubic meter), adjacent grid units are merged; when the density rises above the threshold value (such as 0.1 objects per cubic meter), the grid is further subdivided. The grid adjustment operation is evaluated globally every 5 seconds to ensure dynamic adaptation of space division and object distribution.

[0030] Through the above technical implementation, in a large-scale distributed simulation environment with 5000 dynamic objects, the computational complexity of collision detection is reduced from O(n²) to close to O(n), the average error of collision prediction is controlled within 0.5 seconds, the response time of obstacle avoidance trajectory planning is controlled within 100 milliseconds, and the real-time performance and scalability of the overall system are significantly improved.

[0031] In an optional implementation, based on the spatial state information, the simulation space is adaptively divided into multiple levels, a multi-level spatial grid structure is generated, and the dynamic objects are mapped to corresponding spatial grid units to obtain an object-grid mapping relationship, including: Based on the position information in the spatial state information, the dynamic object distribution density of each spatial region in the simulation space is calculated to obtain density distribution data; According to the density distribution data, the simulation space is divided into high-density regions and low-density regions, and the high-density regions are assigned fine-grained level identifiers, and the low-density regions are assigned coarse-grained level identifiers to obtain a region-level correspondence relationship; According to the region-level correspondence relationship, the high-density regions are generated with spatial grid units of a first size, and the low-density regions are generated with spatial grid units of a second size to form the multi-level spatial grid structure, and the first size is smaller than the second size; The position information of each dynamic object is compared with the spatial range of each spatial grid unit in the multi-level spatial grid structure to determine the spatial grid unit to which each dynamic object belongs, and an association relationship between the dynamic object identifier and the spatial grid unit identifier is established to obtain the object-grid mapping relationship.

[0032] Figure 2 The flowchart for determining the object-grid mapping relationship of the embodiment of the present application is shown in FIG. 1. As shown in the figure, first, the dynamic object distribution density of each spatial region in the simulation space is calculated based on the position information in the spatial state information, then the region division and level assignment are performed according to the density distribution data, and then the multi-level spatial grid structure is generated, and finally the object-grid mapping relationship is established. Figure 2

[0033] In the simulation space, the distribution of dynamic objects often presents the characteristic of unevenness, some regions have a large number of dense dynamic objects, while other regions are relatively sparse. In order to efficiently perform spatial division, it is necessary to first calculate the object distribution density of each region in the simulation space. The spatial state information containing the position information of all dynamic objects is received, and the position information is usually represented in three-dimensional coordinates (x, y, z). The entire simulation space is divided into a plurality of initial detection units, and the size of each detection unit can be set to 10m x 10m x 10m. For each detection unit, the number of dynamic objects falling within its spatial range is counted, and the volume of the detection unit is divided to obtain the object density value of the region. For example, if there are 50 dynamic objects in a detection unit, the density is 50 / (10x10x10)=0.05 objects / m3. This calculation is performed on all detection units of the entire simulation space, and finally the density distribution data representing the object distribution of the entire space is generated.

[0034] Based on the density distribution data calculated above, the simulation space needs to be divided into high-density regions and low-density regions, and a density threshold is set as the distinguishing standard, which can be flexibly adjusted according to the specific application scenario. In this embodiment, the density threshold is set to 0.03 objects / m3. The detection units with a density value higher than 0.03 objects / m3 are marked as high-density regions, and the detection units with a density value lower than or equal to 0.03 objects / m3 are marked as low-density regions. In order to avoid too scattered region division, the adjacent regions of the same type are merged. After merging, the high-density regions are assigned a level identifier "L1", indicating that fine-grained grid division is needed; the low-density regions are assigned a level identifier "L2", indicating that coarse-grained grid division can be used. These information is recorded as region-level correspondence relationship and stored in a data structure for subsequent use.

[0035] ​According to the area-level correspondence relationship established in the foregoing, different sizes of spatial grid cells are generated for different areas to form a multi-level spatial grid structure. For the high-density area identified as "L1", spatial grid cells of a first size are generated, and the size is set to 2m x 2m x 2m; for the low-density area identified as "L2", spatial grid cells of a second size are generated, and the size is set to 8m x 8m x 8m. Here, the first size (2m) is obviously smaller than the second size (8m), which meets the requirement of finer division for the high-density area. In the grid generation process, an octree data structure is used for spatial recursive division. Starting from the root node of the simulation space, the recursive depth is determined according to the level identifier of the area. For the high-density area, the recursive division is performed to a level sufficient to generate 2m x 2m x 2m grid cells; for the low-density area, the recursive division is only performed to a level to generate 8m x 8m x 8m grid cells. Each generated grid cell is assigned a unique identifier, for example, "Grid_X_Y_Z_L", where X, Y, and Z represent the index position of the grid in three-dimensional space, and L represents the level to which the grid belongs.

[0036] After the generation of the multi-level spatial grid structure is completed, it is necessary to establish the mapping relationship between dynamic objects and spatial grid cells. Each dynamic object in the simulation space is traversed, and its position information (x, y, z) is read. For each position coordinate, it is checked in which spatial grid cell the coordinate point falls. For example, for a dynamic object with a position of (15.2, 23.7, 8.5), first determine which level area the position belongs to. If the position belongs to the high-density area, find the corresponding 2m x 2m x 2m grid cell; if it belongs to the low-density area, find the corresponding 8m x 8m x 8m grid cell. Assuming that the object is located in the high-density area, it is calculated that the grid cell identifier in which the object is located is "Grid_7_11_4_L1". The association between the dynamic object identifier (such as "Object_157") and the grid cell identifier ("Grid_7_11_4_L1") is established, and this mapping information is stored in a hash table or a relational database. Repeat this process for all dynamic objects in the simulation space to finally obtain a complete object-grid mapping relationship table.

[0037] Through the above method, adaptive level spatial division based on the distribution density of dynamic objects is realized. The high-density area is divided into finer grids, and the low-density area is divided into relatively coarse grids, which not only guarantees the calculation accuracy but also improves the spatial processing efficiency. This method is particularly suitable for large-scale dynamic object simulation scenarios, such as traffic flow simulation, crowd flow simulation, and other application scenarios.

[0038] In an alternative embodiment, the position information of each dynamic object is compared with the spatial range of each spatial grid cell in the multi-level spatial grid structure to determine the spatial grid cell to which each dynamic object belongs, and an association between the dynamic object identifier and the spatial grid cell identifier is established to obtain the object-grid mapping relationship, including: extracting the spatial range information of each spatial grid cell from the multi-level spatial grid structure; determining the spatial inclusion relationship between the position information of each dynamic object and the boundary coordinates in the spatial range information to identify the spatial grid cell to which the position information of each dynamic object belongs, and obtaining the preliminary attribution relationship between the dynamic object and the spatial grid cell; for each dynamic object in the preliminary attribution relationship, determining whether the geometric boundary of the dynamic object intersects with the boundary coordinates of the spatial grid cell to which it belongs based on the geometric boundary information in the spatial state information; in the case of intersection, determining whether the geometric boundary of the dynamic object overlaps with the spatial range of the adjacent spatial grid cell, and in the case of overlap, associating the dynamic object to the adjacent spatial grid cell to obtain cross-border object association information; combining the preliminary attribution relationship and the cross-border object association information to establish an association between the identifier of each dynamic object and the identifier of one or more spatial grid cells, and obtaining the object-grid mapping relationship.

[0039] In this embodiment, by establishing an association between the dynamic object identifier and the spatial grid cell identifier, efficient spatial query and management are achieved.

[0040] First, the spatial range information of each spatial grid cell is extracted from the multi-level spatial grid structure. The multi-level spatial grid structure contains spatial grid cells of different levels, each spatial grid cell has a unique identifier and a clear spatial range, and these spatial range information can be represented by boundary coordinates. For example, for a two-dimensional plane grid, the left lower corner coordinates and the right upper corner coordinates can be used to define the spatial range of the grid cell; for a three-dimensional solid grid, six face boundary coordinates can be used for definition. Store this information in the spatial index structure to prepare for subsequent spatial inclusion relationship determination.

[0041] When the position information of the dynamic objects is obtained, the position information of each dynamic object is compared with the boundary coordinates in the spatial range information to determine the spatial inclusion relationship. In a specific implementation, the position coordinates of each dynamic object are determined to determine whether the position coordinates fall within the range of a certain spatial grid cell. For example, assuming that the position coordinates of a dynamic object A are (105.32, 34.28), and the range of a spatial grid cell M1 is [(105.30, 34.25), (105.35, 34.30)], it is determined that A falls within the range of M1, and a preliminary attribution relationship between A and M1 is established. By traversing all the dynamic objects, a preliminary attribution table of the dynamic objects and the spatial grid cells is obtained.

[0042] After the preliminary attribution relationship is obtained, the geometric boundary information of the dynamic objects needs to be further considered. For each dynamic object in the preliminary attribution relationship, it is determined, based on the geometric boundary information in the spatial state information, whether the geometric boundary of the dynamic object intersects with the boundary coordinates of the spatial grid cell to which the dynamic object belongs. This step is particularly important because many dynamic objects (such as vehicles, aircraft, etc.) in practical applications have a certain spatial size and can cross multiple spatial grid cells. For example, assuming that a dynamic object B is a long truck, and its geometric boundary is represented by a rectangle [(100.21, 30.05), (100.23, 30.08)], and the boundary of the spatial grid cell N1 to which B belongs is [(100.20, 30.00), (100.22, 30.06)], it can be determined through coordinate comparison that the geometric boundary of B intersects with the boundary of N1.

[0043] When it is detected that the geometric boundary of a dynamic object intersects with the boundary of the spatial grid cell to which the dynamic object belongs, it is further determined whether the geometric boundary of the dynamic object overlaps with the spatial range of the adjacent spatial grid cell. Continuing the above example, adjacent grid cells of N1 are checked, and it is found that the boundary of N2 is [(100.22, 30.00), (100.24, 30.06)], the boundary of N3 is [(100.20, 30.06), (100.22, 30.12)], and the boundary of N4 is [(100.22, 30.06), (100.24, 30.12)]. By comparing the geometric boundary [(100.21, 30.05), (100.23, 30.08)] of B with the boundaries of these adjacent grid cells, it is determined that the geometric boundary of B overlaps with N2, N3, and N4. Therefore, B is associated with the four spatial grid cells N1, N2, N3, and N4 at the same time, and cross-border object association information is formed.

[0044] In the process of establishing the cross-boundary object association information, a spatial index technique (such as R-tree, quad-tree, etc.) can be used to accelerate the search of adjacent spatial grid cells. In addition, in order to optimize the performance, a threshold can be set, and when the overlapping area or volume ratio of a dynamic object and a spatial grid cell is lower than the threshold, the association relationship can be ignored.

[0045] Finally, the preliminary attribution relationship and the cross-boundary object association information are merged to establish the association relationship between each dynamic object identifier and one or more spatial grid cell identifiers, so as to obtain the complete object-grid mapping relationship. The mapping relationship can be represented as an association table, wherein each row contains a dynamic object identifier and all spatial grid cell identifiers associated therewith. For example, for the dynamic object B described above, the record of B in the association table is: B ->{N1, N2, N3, N4}.

[0046] The object-grid mapping relationship established in this way can effectively support various query operations based on spatial positions. For example, when all dynamic objects in a certain spatial range need to be queried, the grid cells covered by the spatial range can be determined first, and then all dynamic objects associated with the grid cells can be quickly found through the mapping relationship. This method is much more efficient than directly determining the spatial range for each dynamic object, especially when a large number of dynamic objects are processed, which can significantly improve the system performance.

[0047] In an optional implementation, according to the object-grid mapping relationship, local collision detection is performed in parallel on each simulation node to identify potential collision object pairs in the same spatial grid cell and between adjacent spatial grid cells, and the identifier information of the cross-node potential collision object pairs is synchronized to the corresponding simulation node to obtain a global potential collision set, including: According to the object-grid mapping relationship, each spatial grid cell in the multi-level spatial grid structure is allocated to the corresponding simulation node to obtain node-grid allocation information; Based on the node-grid allocation information, intra-cell candidate object pairs and inter-cell candidate object pairs are determined on each simulation node to obtain a local candidate object pair set; For each candidate object pair in the local candidate object pair set, the spatial distance between the geometric boundaries of the two dynamic objects in the candidate object pair is calculated based on the geometric boundary information and the motion state information in the spatial state information, and a local potential collision object pair set is identified based on the spatial distance; For each potential collision object pair in the local potential collision object pair set, a potential collision object pair belonging to spatial grid cells managed by different simulation nodes is marked as a cross-node potential collision object pair, the identifier information of the cross-node potential collision object pair is extracted, and cross-node collision information is obtained; Synchronize the cross-node potential collision object pair information to the simulation node to which each dynamic object in the cross-node potential collision object pair belongs, and merge the received cross-node potential collision object pair information with the local potential collision object pair set on each simulation node to obtain the global potential collision object set.

[0048] The embodiment provides efficient identification of a potential collision object pair in a distributed simulation environment. The object-grid mapping relationship is used to perform local collision detection on multiple simulation nodes in parallel, and global collision detection is achieved through cross-node information synchronization.

[0049] In the implementation process, first, each spatial grid cell in the multi-level spatial grid structure is distributed to a corresponding simulation node according to the object-grid mapping relationship, to obtain node-grid distribution information. Specifically, assuming that there are four simulation nodes (nodes A, B, C and D), and the space is divided into a 8x8x8 grid structure. A load balancing strategy is used to distribute the grid cells to each node, for example, the grid cells from (0, 0, 0) to (3, 3, 3) are distributed to node A, the grid cells from (0, 0, 4) to (3, 3, 7) are distributed to node B, and so on. Through this step, each simulation node clearly knows the spatial region that it is responsible for processing.

[0050] On each simulation node, the intra-cell candidate object pairs and the inter-cell candidate object pairs are determined based on the node-grid distribution information, to obtain a local candidate object pair set. Taking node A as an example, assuming that there are dynamic objects O1, O2 and O3 in the grid cell (2, 2, 2) managed by node A. Node A generates intra-cell candidate object pairs (O1, O2), (O1, O3) and (O2, O3). Meanwhile, node A also needs to process the candidate object pairs between adjacent grid cells. For example, if there is a dynamic object O4 in the grid cell (2, 2, 3), node A also generates inter-cell candidate object pairs (O1, O4), (O2, O4) and (O3, O4). By traversing all the managed grid cells and their adjacent cells, node A generates a complete local candidate object pair set.

[0051] For each candidate object pair in the local candidate object pair set, the spatial distance between the geometric boundaries of the two dynamic objects in the candidate object pair is calculated based on the geometric boundary information and the motion state information in the spatial state information. The local potential collision object pair set is identified based on the spatial distance. For each candidate object pair (Oi, Oj), the minimum distance dist(Oi, Oj) between the two objects is calculated using a geometric algorithm. Considering the motion characteristics of the dynamic objects, a threshold distance_threshold is set. When dist(Oi, Oj) is less than distance_threshold, (Oi, Oj) is marked as a potential collision object pair. For example, if O1 is a sphere with a radius of 2 meters, the current position is (10, 10, 10), and the velocity is (1, 0, 0); O2 is a cube with an edge length of 3 meters, the current position is (15, 10, 10), and the velocity is (-2, 0, 0). The calculation of dist(O1, O2) = 3 meters is obtained. Considering that the two objects are moving towards each other, distance_threshold can be set to 5 meters, so (O1, O2) is marked as a potential collision object pair. Through this step, node A generates a local potential collision object pair set.

[0052] For each potential collision object pair in the local potential collision object pair set, the potential collision object pair belonging to spatial grid cells managed by different simulation nodes is marked as a cross-node potential collision object pair. The identification information of the cross-node potential collision object pair is extracted to obtain cross-node collision information. Node A checks each object pair in its local potential collision object pair set to determine whether they belong to grid cells managed by different nodes, respectively. For example, if O5 is located in grid cell (3, 3, 3) (managed by node A), and O6 is located in grid cell (4, 3, 3) (managed by node C), and (O5, O6) is a potential collision object pair, then (O5, O6) is marked as a cross-node potential collision object pair. Node A extracts the identification information of the object pair, including object ID, belonging grid cell, and related collision parameters (such as estimated collision time), to form cross-node collision information.

[0053] The cross-node collision information is synchronized to each dynamic object belonging to the simulation node in the cross-node potential collision object pair, and the received cross-node collision information is merged with the local potential collision object pair set on each simulation node to obtain a global potential collision set. In the above example, node A sends the cross-node collision information of (O5, O6) to node C. Similarly, if node C detects potential collision involving the objects managed by node A, it will also send relevant information to node A. After each node receives cross-node collision information from other nodes, it merges the information with the locally detected potential collision object pairs. For example, the final global potential collision set of node A contains the local potential collision object pairs detected by itself and the cross-node potential collision object pairs involving the objects managed by node A received from other nodes. In this way, global collision detection in a distributed environment is achieved.

[0054] The method realizes efficient parallel collision detection through object-grid mapping and space decomposition technology, and significantly improves the collision detection performance in large-scale dynamic scenes. Experiments show that in a simulation environment containing 10,000 dynamic objects, using 4 parallel nodes can reduce the collision detection time from 240 milliseconds for a single node to about 70 milliseconds, with a performance improvement of about 3.4 times, close to the theoretical linear speedup ratio.

[0055] In an optional implementation, based on the node-grid allocation information, the unit-in candidate object pairs and the unit-between candidate object pairs are determined on each simulation node to obtain a local candidate object pair set, including: Based on the node-grid allocation information, the dynamic object identifiers contained in each spatial grid cell in the set of spatial grid cells managed by each simulation node are extracted to obtain a cell-object correspondence table; For each spatial grid cell in the cell-object correspondence table, the dynamic object identifiers in the spatial grid cell are combined two by two to obtain the unit-in candidate object pairs; Based on the spatial range information of each spatial grid cell in the multi-level spatial grid structure, the adjacent spatial grid cells of each spatial grid cell in the set of spatial grid cells are identified, and the adjacency relationship between the spatial grid cell identifier and the adjacent spatial grid cell identifier is established to obtain a grid adjacency relationship table; For each adjacency relationship in the grid adjacency relationship table, the dynamic object identifiers in the two adjacent spatial grid cells in the adjacency relationship are obtained from the cell-object correspondence table, and the dynamic object identifiers in one spatial grid cell and the dynamic object identifiers in its adjacent spatial grid cell are combined to obtain the unit-between candidate object pairs; The unit-in candidate object pairs and the unit-between candidate object pairs are merged to obtain the local candidate object pair set.

[0056] The process of determining intra-cell candidate object pairs and inter-cell candidate object pairs based on the node-grid allocation information on each simulation node to obtain a local candidate object pair set involves multiple key steps.

[0057] Based on the node-grid allocation information, the dynamic object identifiers contained in the spatial grid cells managed by each simulation node are extracted from the spatial grid cell set to generate a cell-object correspondence table. For example, assuming that there are three spatial grid cells G1, G2, and G3, G1 contains dynamic objects O1 and O2, G2 contains dynamic objects O3, O4, and O5, and G3 contains dynamic object O6. The generated cell-object correspondence table can be represented as: G1 corresponds to {O1, O2}, G2 corresponds to {O3, O4, O5}, and G3 corresponds to {O6}. This table establishes a mapping relationship between the spatial grid cells and their internal dynamic objects, facilitating subsequent processing.

[0058] For each spatial grid cell in the cell-object correspondence table, the dynamic object identifiers within the cell are combined in pairs to obtain intra-cell candidate object pairs. For the G1 cell in the above example, the internal dynamic objects O1 and O2 can be combined to form the candidate object pair (O1, O2); for the G2 cell, the internal dynamic objects O3, O4, and O5 can be combined to form the candidate object pairs (O3, O4), (O3, O5), and (O4, O5); and for the G3 cell, which contains only one dynamic object O6, no intra-cell candidate object pair can be formed. Here, the intra-cell candidate object pair set is {(O1, O2), (O3, O4), (O3, O5), (O4, O5)}.

[0059] Based on the spatial range information of each spatial grid cell in the multi-level spatial grid structure, the neighboring spatial grid cells of each spatial grid cell in the spatial grid cell set are identified, and the adjacency relationship between the spatial grid cell identifier and its neighboring spatial grid cell identifier is established to generate a grid adjacency relationship table. Assuming in the above example that G1 is adjacent to G2, G2 is adjacent to G3, but G1 is not adjacent to G3, then the grid adjacency relationship table can be represented as: the neighbors of G1 are {G2}, the neighbors of G2 are {G1, G3}, and the neighbors of G3 are {G2}. The process of identifying neighboring spatial grid cells can be realized by comparing the boundary coordinates of spatial grid cells. If the boundaries of two spatial grid cells overlap or the distance between them is less than a preset threshold, they are considered to be adjacent.

[0060] For each adjacency relation in the grid adjacency relation table, the dynamic object identifiers in the two adjacent spatial grid cells in the adjacency relation are obtained from the cell-object correspondence table respectively, and the dynamic object identifiers in one spatial grid cell and the dynamic object identifiers in its adjacent spatial grid cell are combined to obtain a candidate object pair between cells. For the adjacent cells G1 and G2 in the above example, the dynamic objects in G1 are O1 and O2, the dynamic objects in G2 are O3, O4 and O5, and the candidate object pairs between cells obtained after combination are (O1, O3), (O1, O4), (O1, O5), (O2, O3), (O2, O4), (O2, O5); for the adjacent cells G2 and G3, the dynamic objects in G2 are O3, O4 and O5, and the dynamic object in G3 is O6, and the candidate object pairs between cells obtained after combination are (O3, O6), (O4, O6), (O5, O6). Here, the set of candidate object pairs between cells is {(O1, O3), (O1, O4), (O1, O5), (O2, O3), (O2, O4), (O2, O5), (O3, O6), (O4, O6), (O5, O6)}.

[0061] Finally, the candidate object pairs within cells and the candidate object pairs between cells are merged to obtain a set of local candidate object pairs. For the above example, the set of local candidate object pairs after merging is {(O1, O2), (O3, O4), (O3, O5), (O4, O5), (O1, O3), (O1, O4), (O1, O5), (O2, O3), (O2, O4), (O2, O5), (O3, O6), (O4, O6), (O5, O6)}, a total of 13 candidate object pairs.

[0062] In practical applications, in order to improve efficiency, the set of candidate object pairs can be optimized. One optimization method is to introduce a pre-filtering mechanism, and according to the spatial position and speed of the dynamic objects, etc., to exclude object pairs that are impossible to collide in advance. For example, a maximum distance threshold is set, and when the distance between two dynamic objects exceeds the threshold, the object pair is not added to the set of candidate object pairs. Assuming that in the above example, it is found through distance calculation that the distance between objects O1 and O5 exceeds the preset threshold, then the candidate object pair (O1, O5) can be excluded.

[0063] Another optimization method is to use the bounding box information of the dynamic objects for quick judgment. An axis-aligned bounding box is calculated for each dynamic object, and only when the bounding boxes of two dynamic objects have the possibility of overlapping, the object pair is included in the set of candidate object pairs. This method can greatly reduce the number of object pairs that need to be subjected to detailed collision detection, and improve system performance.

[0064] In a large-scale simulation scenario, parallel processing technology can be used to further improve efficiency. The spatial grid cells are distributed to different computing nodes, and each computing node is responsible for processing the candidate object pair generation tasks within the spatial grid cells it manages and between adjacent cells. After each node completes the local processing, the results are aggregated to form a complete set of local candidate object pairs.

[0065] Through the above implementation, the intra-cell candidate object pairs and inter-cell candidate object pairs can be efficiently determined based on the node-grid distribution information on each simulation node, and the local candidate object pair set is obtained, providing basic data support for subsequent collision detection and other processing.

[0066] In an optional implementation, for each potential collision object pair in the global potential collision set, a collision time prediction value and a collision position prediction value are calculated to generate collision warning information, including: For each potential collision object pair in the global potential collision set, based on the motion state information of the two dynamic objects in the potential collision object pair in the spatial state information, the motion trajectory equation of the dynamic objects within a future time period is determined to obtain object motion trajectory information; Based on the geometric boundary information of the two dynamic objects in the potential collision object pair in the spatial state information and the object motion trajectory information, the geometric boundary of each dynamic object is spatially extended along its motion trajectory equation to obtain a dynamic object space envelope; For the dynamic object space envelopes of the two dynamic objects in the potential collision object pair, the spatial intersection region between the two dynamic object space envelopes is calculated, and based on the spatial intersection region, the collision time prediction value of the potential collision object pair is calculated, and the geometric center coordinates of the spatial intersection region corresponding to the collision time prediction value are calculated as the collision position prediction value to obtain collision space-time prediction data; The identification information of the potential collision object pair is associated with the collision space-time prediction data to generate the collision warning information.

[0067] The real-time position, velocity, acceleration, heading angle, and other motion state information of all dynamic objects in the global monitoring area are obtained, as well as the geometric boundary information of the dynamic objects. For example, for a cargo unmanned aerial vehicle, its position can be represented as a three-dimensional coordinate (120.5, 35.2, 150.0), the velocity is (5.0, 3.0, 0.0) meters per second, the heading angle is 45 degrees, and the geometric boundary is a rectangular prism with a length of 1.2 meters, a width of 0.8 meters, and a height of 0.5 meters.

[0068] The global potential collision set is filtered out according to the spatial state information. For example, the entire monitoring area is divided into multiple grid units by using a spatial grid division technique, and the size of each grid unit is 10 meters x 10 meters x 10 meters. When two or more dynamic objects are located in the same grid unit or adjacent grid units, the object pairs will be added to the potential collision set. For example, when a UAV A is located in the grid (12, 15, 10) and another UAV B is located in the grid (12, 16, 10), the UAVs A and B form a potential collision object pair.

[0069] For each potential collision object pair in the global potential collision set, a collision time prediction value and a collision position prediction value are calculated. For the two dynamic objects in the potential collision object pair, the motion trajectory equation in the future time period is determined based on the current motion state information of the dynamic objects. For objects moving at a constant speed in a straight line, the trajectory equation can be determined by the initial position and the speed vector. For objects moving at an acceleration or turning motion, a more complex trajectory equation is constructed in combination with the acceleration and the change rate of the heading angle. For example, for the UAV A, the initial position is (100, 200, 150) and the speed is (10, 5, 0), and the position of the UAV A in the future t seconds is (100+10t, 200+5t, 150).

[0070] Based on the geometric boundary information and the motion trajectory information of the dynamic objects, the geometric boundary of each dynamic object is spatially extended along the motion trajectory equation to form a dynamic object spatial envelope. This process actually includes all the space that can be occupied by the dynamic object in the future time period. For example, for a UAV with a length of 1.2 meters, a width of 0.8 meters, and a height of 0.5 meters, after spatial extension along the trajectory, an elongated tubular spatial envelope is formed.

[0071] For the spatial envelopes of the two dynamic objects in the potential collision object pair, the spatial intersection region between them is calculated. The calculation process can be achieved by discrete sampling: the time axis is discretized into a plurality of time points, and at each time point, it is checked whether the geometric boundaries of the two objects overlap. For example, the positions of the two UAVs are checked in the future 10 seconds at intervals of 0.1 seconds. Assuming that at t=3.5 seconds, the position of the UAV A is (135, 217.5, 150) and the position of the UAV B is (134.8, 218, 149.5), and considering the geometric boundaries of the two UAVs, there is a spatial overlap between the two UAVs at this time, and this intersection region is recorded.

[0072] Based on the spatial intersection region, a collision time prediction value of the potential collision object pair is calculated, which is usually defined as the time point at which the two objects first have geometric boundary overlap. In the above example, the collision time prediction value is 3.5 seconds. At the same time, the geometric center coordinates of the spatial intersection region corresponding to the collision time prediction value are calculated as the collision position prediction value. Specifically, for each discrete point in the intersection region, its geometric center coordinates are calculated. In the above example, the collision position prediction value is (134.9, 217.75, 149.75).

[0073] Finally, the identification information of the potential collision object pair is associated with the collision spatiotemporal prediction data to generate collision warning information, including the object identifier of the potential collision, the predicted collision time, the predicted collision position, and the collision risk level. For example, the following warning information can be generated: “Unmanned aerial vehicle A (ID: UAV001) and unmanned aerial vehicle B (ID: UAV002) may collide at position (134.9, 217.75, 149.75) after 3.5 seconds, risk level: high”.

[0074] In practical application of the method, different levels of warning measures can be triggered according to the collision prediction results, for example, when the predicted collision time is within 5 seconds, a high-priority alarm can be sent to the relevant operating personnel; when the predicted collision time is between 5-10 seconds, a medium-priority alarm can be sent; and when the predicted collision time is between 10-30 seconds, a low-priority alarm can be sent. Such a hierarchical warning mechanism helps operating personnel to take appropriate risk avoidance measures according to the degree of urgency, effectively reducing the collision risk.

[0075] In an optional implementation, according to the collision warning information, in combination with the motion constraint conditions and task priorities of each dynamic object, an obstacle avoidance trajectory is generated for the dynamic object for which collision warning is given, including: The identification information of the potential collision object pair for which collision warning is given is extracted from the collision warning information, the identification of each dynamic object in the potential collision object pair is obtained, and a warning object set is obtained; The motion constraint conditions and task priorities of each dynamic object in the warning object set are extracted from the spatial state information; For each potential collision object pair in the collision warning information, based on the task priorities of the two dynamic objects in the potential collision object pair, the primary obstacle object and the holding object in the two dynamic objects are determined, and an obstacle avoidance responsibility allocation result is obtained; For the motion constraint condition of each main obstacle avoidance object in the obstacle avoidance responsibility allocation result, a candidate trajectory space of the main obstacle avoidance object is determined, and in combination with the collision position prediction value in the collision warning information, a trajectory scheme maintaining a safe distance from the collision position prediction value is screened out from the candidate trajectory space, to obtain a feasible obstacle avoidance trajectory set; For the deviation cost of each trajectory scheme in the feasible obstacle avoidance trajectory set relative to the original motion trajectory of the main obstacle avoidance object and the time cost required for completing obstacle avoidance, one of the trajectory schemes is selected as the obstacle avoidance trajectory of the main obstacle avoidance object.

[0076] In a specific implementation, after receiving the collision warning information, first, the identification information of a potential collision object pair for which the collision warning occurs is extracted from the collision warning information. For example, if it is detected that dynamic object A and dynamic object B have a potential collision risk, the identification of dynamic object A and dynamic object B is extracted from the collision warning information, and they are added to the warning object set. If multiple groups of potential collision object pairs are detected at the same time, such as dynamic object A and dynamic object C also have a potential collision risk, the warning object set will contain dynamic objects A, B, and C.

[0077] For each dynamic object in the warning object set, the motion constraint condition and the task priority of the dynamic object are extracted from the spatial state information. The motion constraint condition includes physical constraints such as the maximum speed, the maximum acceleration, and the maximum turning angle of the dynamic object, and environmental constraints such as the motion region limit and the forbidden entry region of the dynamic object. For example, the maximum speed of dynamic object A is 5 meters per second, the maximum acceleration is 2 meters per second squared, and the maximum turning angle is 30 degrees. The task priority indicates the importance of the task performed by the dynamic object and can be an integer value. The larger the value, the higher the priority. For example, the task priority of dynamic object A is 3, and the task priority of dynamic object B is 5.

[0078] For each potential collision object pair in the collision warning information, the main obstacle avoidance object and the holding object in the potential collision object pair are determined based on the task priority, to obtain an obstacle avoidance responsibility allocation result. The dynamic object with a higher task priority is determined as the holding object, and the dynamic object with a lower task priority is determined as the main obstacle avoidance object. If the task priorities are the same, other factors such as the motion flexibility and energy cost of the dynamic object can be used for determination. In the above example, the task priorities of dynamic object A and dynamic object B are 3 and 5 respectively, so dynamic object A is determined as the main obstacle avoidance object, and dynamic object B is determined as the holding object, that is, dynamic object A needs to actively avoid dynamic object B.

[0079] For each main obstacle object in the obstacle avoidance responsibility allocation result, a candidate trajectory space is determined according to the motion constraint condition of the main obstacle object, and a trajectory scheme that maintains a safe distance from the collision position prediction value in the collision warning information is selected from the candidate trajectory space to obtain a feasible obstacle avoidance trajectory set. The candidate trajectory space can be generated by applying different control inputs to the original trajectory, such as changing the speed, acceleration, or direction, etc. For example, for a dynamic object A, the original trajectory is a straight line motion with a speed of 3 m / s, and the collision warning information indicates that it will collide with a dynamic object B at the coordinate (100, 150) in 10 seconds. A plurality of candidate trajectories can be generated: trajectory 1 reduces the speed to 2 m / s; trajectory 2 deviates 5 degrees to the left and continues to move forward; and trajectory 3 deviates 8 degrees to the right and continues to move forward. The safe distance is set to 5 meters. By calculating the distance between each candidate trajectory and the collision position prediction value, trajectories 2 and 3 are selected as the feasible obstacle avoidance trajectory set because they meet the safe distance requirement.

[0080] For each trajectory scheme in the feasible obstacle avoidance trajectory set, the deviation cost relative to the original motion trajectory of the main obstacle object and the time cost required to complete the obstacle avoidance are calculated, and the trajectory scheme with the minimum total cost is selected as the obstacle avoidance trajectory of the main obstacle object. The deviation cost can be defined as the sum of the Euclidean distances between the obstacle avoidance trajectory and the original trajectory, and the time cost can be defined as the additional time required for obstacle avoidance. For example, for trajectory 2 of dynamic object A, the deviation cost is 8 units and the time cost is 2 seconds; for trajectory 3, the deviation cost is 12 units and the time cost is 1.5 seconds. Assuming that the weights of the deviation cost and the time cost are 0.7 and 0.3 respectively, the total cost of trajectory 2 is 8*0.7+2*0.3=6.2, and the total cost of trajectory 3 is 12*0.7+1.5*0.3=8.85. Therefore, trajectory 2 with the smaller total cost is selected as the obstacle avoidance trajectory of dynamic object A.

[0081] Finally, the selected obstacle avoidance trajectory is sent to the corresponding main obstacle object to guide it to move according to the obstacle avoidance trajectory, thereby avoiding collision with the keep object. At the same time, the environment is continuously monitored, and if a new potential collision risk is detected, the above process will be re-executed to generate a new obstacle avoidance trajectory.

[0082] Through the above, the collision warning information can be used to consider the motion constraint conditions and task priorities of each dynamic object, reasonably allocate the obstacle avoidance responsibility, and generate the optimal obstacle avoidance trajectory for the main obstacle object, thereby achieving efficient and safe obstacle avoidance control.

[0083] The distributed collision detection and obstacle avoidance system for the simulation trainer according to the embodiments of the present application comprises: A first unit is configured to acquire spatial state information of dynamic objects managed by each simulation node in the distributed simulation trainer. The second unit is configured to perform adaptive hierarchical division on the simulation space based on the space state information, generate a multi-level space grid structure, and map the dynamic objects to corresponding space grid units to obtain an object-grid mapping relationship. The third unit is configured to perform local collision detection on each simulation node in parallel according to the object-grid mapping relationship, identify potential collision object pairs in the same space grid unit and between adjacent space grid units, and synchronize the identification information of the potential collision object pairs across nodes to the corresponding simulation nodes to obtain a global potential collision set. The fourth unit is configured to calculate a collision time prediction value and a collision position prediction value for each potential collision object pair in the global potential collision set, and generate collision warning information. The fifth unit is configured to generate an obstacle avoidance trajectory for the dynamic object for which the collision warning occurs according to the collision warning information and in combination with the motion constraint conditions and task priorities of the dynamic objects. The sixth unit is configured to update the motion state information of the corresponding dynamic object based on the obstacle avoidance trajectory, and dynamically adjust the multi-level space grid structure using the updated space state information to adapt to changes in the distribution density of the dynamic objects.

[0084] In a third aspect, an electronic device is provided, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to execute the method described above.

[0085] In a fourth aspect, a computer-readable storage medium is provided, which stores computer program instructions, and the computer program instructions are executed by a processor to implement the method described above.

[0086] The present application can be a method, device, system and / or computer program product. The computer program product can include a computer readable storage medium having computer readable program instructions stored therein, which are used to perform various aspects of the present application.

[0087] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for distributed collision detection and obstacle avoidance for a simulation trainer, characterized in that, The method comprises the following steps: acquiring spatial state information of dynamic objects managed by each simulation node in a distributed simulation trainer; performing adaptive hierarchical division on a simulation space based on the spatial state information, generating a multi-level space grid structure, and mapping the dynamic objects to corresponding space grid cells to obtain an object-grid mapping relationship; performing local collision detection on each simulation node in parallel according to the object-grid mapping relationship, identifying potential collision object pairs in the same space grid cell and between adjacent space grid cells, and synchronizing the identification information of the potential collision object pairs across nodes to the corresponding simulation nodes to obtain a global potential collision set; calculating a collision time prediction value and a collision position prediction value for each potential collision object pair in the global potential collision set to generate collision warning information; generating an obstacle avoidance trajectory for the dynamic object for which the collision warning occurs according to the collision warning information and in combination with the motion constraint conditions and task priorities of each dynamic object; updating the motion state information of the corresponding dynamic object based on the obstacle avoidance trajectory, and dynamically adjusting the multi-level space grid structure based on the updated spatial state information to adapt to changes in the distribution density of the dynamic objects.

2. The method of claim 1, wherein, The method comprises the following steps: performing adaptive hierarchical division on a simulation space based on the spatial state information, generating a multi-level space grid structure, and mapping the dynamic objects to corresponding space grid cells to obtain an object-grid mapping relationship, which comprises the following steps: calculating the dynamic object distribution density of each space region in the simulation space based on the position information in the spatial state information to obtain density distribution data; dividing the simulation space into a high-density region and a low-density region according to the density distribution data, assigning a fine-grained hierarchical identifier to the high-density region, and assigning a coarse-grained hierarchical identifier to the low-density region to obtain a region-hierarchy correspondence relationship; generating space grid cells of a first size for the high-density region and space grid cells of a second size for the low-density region according to the region-hierarchy correspondence relationship to form the multi-level space grid structure, wherein the first size is smaller than the second size; 3. The method of claim 2, wherein, comparing the position information of each dynamic object with the spatial range of each space grid cell in the multi-level space grid structure to determine the space grid cell to which each dynamic object belongs, establishing an association relationship between the dynamic object identifier and the space grid cell identifier, and obtaining the object-grid mapping relationship. The method comprises the following steps: extracting the spatial range information of each space grid cell from the multi-level space grid structure; performing spatial inclusion relationship judgment on the position information of each dynamic object and the boundary coordinates in the spatial range information to identify the space grid cell to which the position information of each dynamic object belongs, and obtaining a preliminary attribution relationship between the dynamic object and the space grid cell; For each dynamic object in the preliminary attribution relationship, it is determined whether the geometric boundary of the dynamic object intersects with the boundary coordinates of the space grid cell to which the dynamic object belongs based on the geometric boundary information in the space state information; In the case of intersection, it is determined whether the geometric boundary of the dynamic object overlaps with the space range of the adjacent space grid cell, and in the case of overlap, the dynamic object is associated to the adjacent space grid cell, to obtain cross-border object association information; The preliminary attribution relationship and the cross-border object association information are merged to establish the association relationship between each dynamic object identifier and one or more space grid cell identifiers, to obtain the object-grid mapping relationship.

4. The method of claim 1, wherein, According to the object-grid mapping relationship, local collision detection is performed on each simulation node in parallel to identify potential collision object pairs within the same space grid cell and between adjacent space grid cells, and the identifier information of the cross-node potential collision object pairs is synchronized to the corresponding simulation node to obtain a global potential collision set, including: According to the object-grid mapping relationship, each space grid cell in the multi-level space grid structure is assigned to the corresponding simulation node to obtain node-grid assignment information; Based on the node-grid assignment information on each simulation node, intra-cell candidate object pairs and inter-cell candidate object pairs are determined to obtain a local candidate object pair set; For each candidate object pair in the local candidate object pair set, the spatial distance between the geometric boundaries of the two dynamic objects in the candidate object pair is calculated based on the geometric boundary information and motion state information in the space state information, and the local potential collision object pair set is identified based on the spatial distance; For each potential collision object pair in the local potential collision object pair set, the potential collision object pair belonging to space grid cells managed by different simulation nodes is marked as a cross-node potential collision object pair, the identifier information of the cross-node potential collision object pair is extracted, and cross-node collision information is obtained; The cross-node collision information is synchronized to the simulation node to which each dynamic object in the cross-node potential collision object pair belongs, and the received cross-node collision information is merged with the local potential collision object pair set on each simulation node to obtain the global potential collision set.

5. The method of claim 4, wherein, Based on the node-grid assignment information on each simulation node, intra-cell candidate object pairs and inter-cell candidate object pairs are determined to obtain a local candidate object pair set, including: Based on the node-grid assignment information, the dynamic object identifiers contained in each space grid cell from the set of space grid cells managed by each simulation node are extracted to obtain a cell-object correspondence table; For each space grid cell in the cell-object correspondence table, the dynamic object identifiers in the space grid cell are combined in pairs to obtain the intra-cell candidate object pairs. Based on the spatial range information of each spatial grid cell in the multi-level spatial grid structure, adjacent spatial grid cells of each spatial grid cell in the spatial grid cell set are identified, and an adjacency relationship between the spatial grid cell identifier and the adjacent spatial grid cell identifier is established, and a grid adjacency relationship table is obtained; For each adjacency relationship in the grid adjacency relationship table, the dynamic object identifiers in the two adjacent spatial grid cells in the adjacency relationship are obtained from the cell-object correspondence table, and the dynamic object identifiers in one spatial grid cell and the dynamic object identifiers in its adjacent spatial grid cell are combined to obtain the inter-cell candidate object pair. The intra-cell candidate object pairs and the inter-cell candidate object pairs are merged to obtain the local candidate object pair set.

6. The method of claim 1, wherein, For each potential collision object pair in the global potential collision set, a collision time prediction value and a collision position prediction value are calculated, and a collision warning information is generated, including: For each potential collision object pair in the global potential collision set, based on the motion state information of the two dynamic objects in the potential collision object pair in the spatial state information, the motion trajectory equation of the dynamic objects in the future time period is determined, and the object motion trajectory information is obtained; Based on the geometric boundary information of the two dynamic objects in the potential collision object pair in the spatial state information and the object motion trajectory information, the geometric boundary of each dynamic object is spatially extended along its motion trajectory equation to obtain the dynamic object spatial envelope; For the dynamic object spatial envelopes of the two dynamic objects in the potential collision object pair, the spatial intersection region between the two dynamic object spatial envelopes is calculated, the collision time prediction value of the potential collision object pair is calculated based on the spatial intersection region, and the geometric center coordinates of the spatial intersection region corresponding to the collision time prediction value are calculated as the collision position prediction value, and the collision space-time prediction data is obtained; The identifier information of the potential collision object pair and the collision space-time prediction data are associated to generate the collision warning information.

7. The method of claim 1, wherein, According to the collision warning information, the motion constraints and task priorities of each dynamic object are combined to generate an obstacle avoidance trajectory for the dynamic object with collision warning, including: The identifier information of the potential collision object pair with collision warning is extracted from the collision warning information, the identifiers of the dynamic objects in the potential collision object pair are obtained, and a warning object set is obtained; For each dynamic object in the warning object set, the motion constraints and task priorities of the dynamic object are extracted from the spatial state information; For each potential collision object pair in the collision warning information, based on the task priorities of the two dynamic objects in the potential collision object pair in the task priorities, the main obstacle object and the holding object in the two dynamic objects are determined, and the obstacle avoidance responsibility allocation result is obtained; The candidate trajectory space of the main obstacle object is determined according to the motion constraint condition of each main obstacle object in the obstacle avoidance responsibility allocation result, and a trajectory scheme maintaining a safe distance from the collision position prediction value in the candidate trajectory space is selected from the candidate trajectory space in combination with the collision position prediction value in the collision warning information, to obtain a feasible obstacle avoidance trajectory set; One of the trajectory schemes in the feasible obstacle avoidance trajectory set is selected as the obstacle avoidance trajectory of the main obstacle object according to the deviation cost of each trajectory scheme relative to the original motion trajectory of the main obstacle object and the time cost required for completing obstacle avoidance.

8. Distributed collision detection and obstacle avoidance system for a simulation trainer for implementing the method according to any one of claims 1 to 7, characterized in that Comprise: A first unit for obtaining spatial state information of dynamic objects managed by each simulation node in a distributed simulation trainer; A second unit for adaptively performing hierarchical division on a simulation space based on the spatial state information, generating a multi-level space grid structure, and mapping the dynamic objects to corresponding space grid units to obtain an object-grid mapping relationship; A third unit for performing local collision detection on each simulation node in parallel according to the object-grid mapping relationship, identifying potential collision object pairs in the same space grid unit and between adjacent space grid units, and synchronizing the identification information of the potential collision object pairs across nodes to the corresponding simulation nodes to obtain a global potential collision set; A fourth unit for calculating a collision time prediction value and a collision position prediction value for each potential collision object pair in the global potential collision set, and generating collision warning information; A fifth unit for generating an obstacle avoidance trajectory for a dynamic object for which collision warning occurs according to the collision warning information, in combination with the motion constraint condition and task priority of each dynamic object; A sixth unit for updating the motion state information of the corresponding dynamic object based on the obstacle avoidance trajectory, and dynamically adjusting the multi-level space grid structure using the updated spatial state information to adapt to changes in the distribution density of the dynamic objects.

9. An electronic device, comprising: Comprise: A processor; A memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method of any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon computer program instructions, wherein, The computer program instructions are executed by the processor to implement the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Target collision detection method based on distributed computing

    CN115964183A

  • Rigid body collision detection method and system based on adaptive resolution

    CN119026379A

  • Three-dimensional airspace rasterization management method and system based on multistage dynamic division

    CN120375649A

  • Building collision detection method based on BIM cooperative multi-agent reinforcement learning

    CN120562019A

  • Automatic obstacle avoidance method and system for low-altitude aircraft

    CN120872006A