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

By adopting an adaptive hierarchical partitioning and parallel collision detection method, the problems of insufficient accuracy and resource waste in distributed collision detection are solved, and obstacle avoidance trajectories that conform to actual physical constraints are generated, thereby improving the realism of simulation training and the scalability of the system.

CN121074331BActive Publication Date: 2026-01-23BEIJING SPARK SPOT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511614052.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-01-23
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, obstacle avoidance algorithms struggle to generate trajectories that conform to actual physical constraints, affecting the realism and effectiveness of simulation training.

Method used

A multi-level spatial grid structure with adaptive hierarchical partitioning is adopted. Parallel collision detection is performed through object-grid mapping relationship. Obstacle avoidance trajectory is generated by combining the motion constraints of dynamic objects and task priorities. The grid 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 CN121074331B_ABST
    Figure CN121074331B_ABST
Patent Text Reader

Abstract

The application 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 dynamic object space state information of multiple simulation nodes; adaptively dividing a simulation space to generate a multilevel grid and mapping objects; performing local collision detection in parallel to identify potential collision object pairs and synchronizing cross-node information; calculating a collision prediction value to generate early warning information; combining motion constraints and priorities to generate an obstacle avoidance trajectory; and dynamically adjusting the grid structure. The present disclosure can improve the collision detection accuracy and real-time performance in a distributed environment and reduce the consumption of computing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of virtual simulation technology, and in particular to a distributed collision detection and obstacle avoidance method and system for a simulation trainer. Background Technology

[0002] Distributed simulation trainers are advanced training systems used in military, aviation, and aerospace fields. They simulate real-world scenarios in virtual environments, providing operators with a near-real-world training experience. In these systems, collision detection and obstacle avoidance are key technologies for ensuring the realism of the simulation and the stability of the system. As the scale of simulation training continues to expand, single computing nodes can no longer meet the demands of large-scale, high-precision simulations, leading to the increasing adoption of distributed simulation architectures. In a distributed environment, multiple simulation nodes process different regions or types of dynamic objects in parallel, posing challenges to collision detection and obstacle avoidance in areas such as data synchronization, computational efficiency, and real-time performance.

[0003] Traditional collision detection techniques are primarily based on uniform grid partitioning or tree structures in global space. These methods have significant limitations when handling scenarios with large variations in the density of dynamic objects in a distributed environment. Existing distributed collision detection methods typically employ fixed-granularity spatial partitioning strategies, which cannot effectively adapt to the spatiotemporal changes in the distribution density of dynamic objects. This results in insufficient collision detection accuracy in densely populated areas or wasted computational resources in sparse areas. During cross-node collision detection, data synchronization and communication overhead are substantial, especially when a large number of dynamic objects migrate or interact between different nodes, easily creating communication bottlenecks and impacting the system's real-time performance. Existing obstacle avoidance algorithms often rely on pre-defined rules or simple trajectory adjustment methods, lacking a comprehensive consideration of the motion constraints and task priorities of dynamic objects. This makes it difficult to generate smooth, efficient, and physically consistent obstacle avoidance trajectories in complex environments, affecting the realism and effectiveness of simulation training. Summary of the Invention

[0004] The embodiments of the present invention 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] A first aspect of the present invention provides a distributed collision detection and obstacle avoidance method for a simulation trainer, comprising:

[0006] Obtain spatial state information of dynamic objects managed by multiple simulation nodes in a distributed simulation trainer;

[0007] Based on the spatial state information, the simulation space is adaptively hierarchically divided to generate a multi-level spatial mesh structure, and the dynamic objects are mapped to the corresponding spatial mesh units to obtain the object-mesh mapping relationship;

[0008] Based on the object-mesh mapping relationship, local collision detection is performed in parallel on each simulation node to identify potential collision object pairs within the same spatial mesh cell and between adjacent spatial mesh cells. The identification information of potential collision object pairs across nodes is then synchronized to the corresponding simulation node to obtain a global potential collision set.

[0009] For each potential collision object pair in the global potential collision set, calculate the predicted collision time and the predicted collision location, and generate collision warning information;

[0010] Based on the collision warning information, and combined with the motion constraints and task priorities of each dynamic object, an obstacle avoidance trajectory is generated for the dynamic object that has triggered the collision warning.

[0011] Based on the obstacle avoidance trajectory, update the motion state information of the corresponding dynamic object, and use the updated spatial state information to dynamically adjust the multi-level spatial grid structure to adapt to changes in the distribution density of the dynamic object.

[0012] Based on the spatial state information, the simulation space is adaptively hierarchically divided to generate a multi-level spatial mesh structure, and the dynamic objects are mapped to the corresponding spatial mesh cells to obtain the object-mesh mapping relationship, including:

[0013] Based on the location information in the spatial state information, the dynamic object distribution density of each spatial region within the simulation space is calculated to obtain density distribution data;

[0014] Based on the density distribution data, the simulation space is divided into high-density regions and low-density regions. Fine-grained hierarchical identifiers are assigned to the high-density regions, and coarse-grained hierarchical identifiers are assigned to the low-density regions, thus obtaining the region-hierarchical correspondence.

[0015] Based on the region-level correspondence, spatial grid cells of a first size are generated for the high-density region, and spatial grid cells of a second size are generated for the low-density region, forming the multi-level spatial grid structure, wherein the first size is smaller than the second size;

[0016] The location 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 the association between the dynamic object identifier and the spatial grid unit identifier is established to obtain the object-grid mapping relationship.

[0017] The location 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. An association is established between the dynamic object identifier and the spatial grid unit identifier to obtain the object-grid mapping relationship, including:

[0018] Extract the spatial extent information of each spatial grid unit from the multi-level spatial grid structure;

[0019] The spatial inclusion relationship between the location information of each dynamic object and the boundary coordinates in the spatial range information is determined, and the spatial grid cell to which the location information of each dynamic object belongs is identified, thus obtaining the preliminary belonging relationship between the dynamic object and the spatial grid cell;

[0020] For each dynamic object in the preliminary attribution relationship, based on the geometric boundary information in the spatial state information, it is determined whether the geometric boundary of the dynamic object intersects with the boundary coordinates of the spatial grid cell to which it belongs;

[0021] 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. If there is overlap, the dynamic object is simultaneously associated with the adjacent spatial grid cell to obtain cross-boundary object association information.

[0022] The preliminary attribution relationship is merged with the cross-boundary object association information to establish an association relationship between each dynamic object identifier and one or more spatial grid unit identifiers, thus obtaining the object-grid mapping relationship.

[0023] Based on the object-mesh mapping relationship, local collision detection is performed in parallel on each simulation node to identify potential collision object pairs within the same spatial mesh cell and between adjacent spatial mesh cells. The identification information of potential collision object pairs across nodes is synchronized to the corresponding simulation node to obtain a global potential collision set, including:

[0024] Based on the object-mesh mapping relationship, each spatial mesh unit in the multi-level spatial mesh structure is assigned to the corresponding simulation node to obtain node-mesh allocation information;

[0025] Based on the node-mesh allocation information at each simulation node, candidate object pairs within a cell and candidate object pairs between cells are determined to obtain a local candidate object pair set;

[0026] For each candidate object pair in the local candidate object pair set, based on the geometric boundary information and motion state information in the spatial state information, the spatial distance between the geometric boundaries of the two dynamic objects in the candidate object pair is calculated, and the local potential collision object pair set is identified based on the spatial distance;

[0027] For each potential collision object pair in the local potential collision object pair set, potential collision object pairs belonging to spatial grid cells managed by different simulation nodes are marked as cross-node potential collision object pairs. The identification information of the cross-node potential collision object pairs is extracted to obtain cross-node collision information.

[0028] 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.

[0029] Based on the node-mesh allocation information at each simulation node, candidate object pairs within a cell and candidate object pairs between cells are determined, resulting in a local candidate object pair set, including:

[0030] Based on the node-mesh allocation information, the dynamic object identifiers contained in each spatial mesh cell are extracted from the set of spatial mesh cells managed by each simulation node to obtain a cell-object mapping table;

[0031] For each spatial grid cell in the cell-object correspondence table, the dynamic object identifiers within that spatial grid cell are combined in pairs to obtain candidate object pairs within the cell;

[0032] Based on the spatial extent information of each spatial grid unit in the multi-level spatial grid structure, the adjacent spatial grid units of each spatial grid unit in the spatial grid unit set are identified, and the adjacency relationship between the spatial grid unit identifier and its adjacent spatial grid unit identifier is established to obtain a grid adjacency relationship table;

[0033] For each adjacency in the grid adjacency table, the dynamic object identifiers within two adjacent spatial grid cells in that adjacency are obtained from the cell-object correspondence table. The dynamic object identifier within one spatial grid cell is combined with the dynamic object identifiers within its adjacent spatial grid cells to obtain the candidate object pair between cells.

[0034] The candidate object pairs within the unit and the candidate object pairs between units are merged to obtain the local candidate object pair set.

[0035] For each potential collision object pair in the global potential collision set, calculate the predicted collision time and the predicted collision location, and generate collision warning information, including:

[0036] For each potential collision object pair in the global potential collision set, based on the motion state information of the two dynamic objects within the potential collision object pair in the spatial state information, the motion trajectory equation of the dynamic object in the future time period is determined, and the object motion trajectory information is obtained;

[0037] Based on the geometric boundary information of the two dynamic objects within 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 spatial envelope of the dynamic object;

[0038] For the dynamic object spatial envelopes of the two dynamic objects within the potential collision object pair, the spatial intersection region between the two dynamic object spatial envelopes is calculated. 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, thus obtaining the collision spatiotemporal prediction data;

[0039] The identification information of the potential collision object pair is associated with the collision spatiotemporal prediction data to generate the collision warning information.

[0040] Based on the collision warning information, and combined with the motion constraints and task priorities of each dynamic object, an obstacle avoidance trajectory is generated for the dynamic object that has triggered the collision warning, including:

[0041] Extract the identification information of the potential collision object pairs that triggered the collision warning from the collision warning information, obtain the identification of each dynamic object in the potential collision object pair, and obtain the warning object set;

[0042] For each dynamic object in the aforementioned warning object set, the motion constraints and task priorities of the dynamic objects are extracted from the spatial state information.

[0043] For each potential collision object pair in the collision warning information, based on the task priorities of the two dynamic objects within the potential collision object pair in the task priorities, the primary obstacle object and the holding object among the two dynamic objects are determined to obtain the obstacle avoidance responsibility allocation result;

[0044] Based on the motion constraints of each primary obstacle avoidance object in the obstacle avoidance responsibility allocation result, the candidate trajectory space of the primary obstacle avoidance object is determined. Combined with the collision position prediction value in the collision warning information, trajectory schemes that maintain a safe distance from the collision position prediction value are selected from the candidate trajectory space to obtain a set of feasible obstacle avoidance trajectories.

[0045] For each trajectory scheme in the set of feasible obstacle avoidance trajectories, considering the deviation cost relative to the original motion trajectory of the main obstacle avoidance object and the time cost required to complete obstacle avoidance, one trajectory scheme is selected as the obstacle avoidance trajectory of the main obstacle avoidance object.

[0046] A second aspect of the present invention provides a distributed collision detection and obstacle avoidance system for a simulation trainer, comprising:

[0047] The first unit is used to obtain the spatial state information of the dynamic objects managed by multiple simulation nodes in the distributed simulation trainer.

[0048] The second unit is used to adaptively divide the simulation space into hierarchical parts based on the spatial state information, generate a multi-level spatial grid structure, and map the dynamic objects to the corresponding spatial grid units to obtain the object-grid mapping relationship.

[0049] The third unit is used to perform local collision detection in parallel on each simulation node according to the object-mesh mapping relationship, identify potential collision object pairs within the same spatial mesh cell and between adjacent spatial mesh cells, and synchronize the identification information of potential collision object pairs across nodes to the corresponding simulation nodes to obtain a global potential collision set;

[0050] The fourth unit is used to calculate the predicted collision time and the predicted collision location for each potential collision object pair in the global potential collision set, and generate collision warning information.

[0051] The fifth unit is used to generate obstacle avoidance trajectories for dynamic objects that have experienced collision warnings, based on the collision warning information and the motion constraints and task priorities of each dynamic object.

[0052] The sixth unit is used to update the motion state information of the corresponding dynamic object based on the obstacle avoidance trajectory, and to dynamically adjust the multi-level spatial grid structure using the updated spatial state information to adapt to changes in the distribution density of the dynamic object.

[0053] A third aspect of the present invention provides an electronic device, comprising:

[0054] processor;

[0055] Memory used to store processor-executable instructions;

[0056] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0057] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0058] This invention significantly improves the efficiency of collision detection in large-scale simulation environments and reduces computational resource consumption through adaptive hierarchical space partitioning and parallel collision detection strategies, enabling real-time processing of collision detection tasks in high-density, high-dynamic scenes.

[0059] An early warning mechanism based on collision time and location prediction, combined with the motion constraints of dynamic objects and task priorities, generates obstacle avoidance trajectories that conform to actual physical characteristics, ensuring the realism and continuity of simulation training and effectively avoiding collision events during the training process.

[0060] By adopting a distributed computing architecture and a dynamic grid structure adjustment strategy, the system has good scalability and adaptability, and can automatically optimize resource allocation according to changes in the distribution density of dynamic objects, so as to meet the simulation training needs of different scales and complexities. Attached Figure Description

[0061] Figure 1 This is a flowchart illustrating a distributed collision detection and obstacle avoidance method for a simulation trainer according to an embodiment of the present invention.

[0062] Figure 2 This is a schematic diagram illustrating the process of determining the object-mesh mapping relationship according to an embodiment of the present invention. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0064] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0065] Figure 1 This is a flowchart illustrating a distributed collision detection and obstacle avoidance method for a simulation trainer according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0066] Obtain spatial state information of dynamic objects managed by multiple simulation nodes in a distributed simulation trainer;

[0067] Based on the spatial state information, the simulation space is adaptively hierarchically divided to generate a multi-level spatial mesh structure, and the dynamic objects are mapped to the corresponding spatial mesh units to obtain the object-mesh mapping relationship;

[0068] Based on the object-mesh mapping relationship, local collision detection is performed in parallel on each simulation node to identify potential collision object pairs within the same spatial mesh cell and between adjacent spatial mesh cells. The identification information of potential collision object pairs across nodes is then synchronized to the corresponding simulation node to obtain a global potential collision set.

[0069] For each potential collision object pair in the global potential collision set, calculate the predicted collision time and the predicted collision location, and generate collision warning information;

[0070] Based on the collision warning information, and combined with the motion constraints and task priorities of each dynamic object, an obstacle avoidance trajectory is generated for the dynamic object that has triggered the collision warning.

[0071] Based on the obstacle avoidance trajectory, update the motion state information of the corresponding dynamic object, and use the updated spatial state information to dynamically adjust the multi-level spatial grid structure to adapt to changes in the distribution density of the dynamic object.

[0072] In a distributed simulation training environment, spatial state information of dynamic objects managed by multiple simulation nodes is acquired through a network communication interface. This spatial state information includes the position coordinates, linear velocity, angular velocity, acceleration, direction, attitude angle, and geometric parameters of each dynamic object. For example, for a UAV object, its spatial state information includes three-dimensional coordinates (x=125.3 m, y=67.8 m, z=45.2 m), linear velocity (vx=2.5 m / s, vy=1.2 m / s, vz=0.5 m / s), angular velocity (ωx=0.03 radians / s, ωy=0.01 radians / s, ωz=0.02 radians / s), and dimensions (length=0.8 m, width=0.6 m, height=0.2 m). A timestamp-based state synchronization mechanism is used to ensure the consistency of the state information acquired by each node in time, with time accuracy controlled at the millisecond level.

[0073] After acquiring spatial state information, the simulation space is adaptively partitioned hierarchically based on this information. Specifically, an octree data structure is used for multi-level partitioning of the 3D space. First, the boundary of the entire simulation space is determined; for example, the boundary of a simulation scene might be a cubic space from (0,0,0) to (1000,1000,500) meters. Based on the distribution density of dynamic objects, the initial mesh size and maximum partitioning depth are adaptively determined. In sparsely populated areas, the mesh is coarser, such as a cube with a side length of 100 meters; in densely populated areas, the mesh is subdivided to a higher level, such as a side length of 1.5 meters. In practical applications, the maximum octree depth is set to 8 levels, and the mesh size ratio between adjacent levels is 2:1. In areas with very dense distribution of dynamic objects, such as 100 objects clustered within a space with a radius of 50 meters, the mesh subdivision level for that area is automatically increased to improve spatial resolution.

[0074] After spatial partitioning, dynamic objects are mapped to corresponding spatial grid cells, resulting in object-grid mapping relationships. The mapping process is based on the overlap between the bounding box of the dynamic object and the spatial grid, employing discrete coordinate mapping technology for rapid positioning. For large objects spanning multiple grids, mapping relationships are established in all relevant grids. For example, a vehicle object with a length of 12 meters can be mapped to 3-4 adjacent grid cells simultaneously. A bidirectional index structure is maintained: a mapping table from grid cells to objects and a mapping table from objects to grid cells, facilitating rapid lookup. Each mapping relationship includes information such as object identifier, the identifier of the simulation node to which it belongs, and the coordinates of the occupied grid cell. When 500 dynamic objects are distributed in the simulation space, all mapping relationships can be established within 0.5 seconds.

[0075] Based on the object-mesh mapping relationship, local collision detection is performed in parallel on each simulation node. Each simulation node is responsible for detecting collisions within the spatial mesh cells it manages. Detection is divided into two stages: wide-phase detection and narrow-phase detection. In the wide-phase detection stage, potential collision object pairs are identified within the same mesh cell and between adjacent mesh cells. Adjacency determination is based on the 26-neighborhood relationship of mesh cells (all adjacent cells of a cubic mesh cell in 3D space). For cross-node cases, such as objects located on boundary meshes, the identification information of their potential collision object pairs is synchronized to the corresponding simulation node via a message queue. This stage mainly relies on the bounding boxes of objects for rapid judgment, filtering out potential collision pairs and reducing the workload of subsequent precise calculations. In practical applications, when there are 1000 dynamic objects, the wide-phase detection stage can reduce the number of object pairs that need to be precisely detected from the theoretical 499,500 pairs to approximately 5,000 pairs, improving efficiency by approximately 99%.

[0076] For each potential collision object pair in the selected global potential collision set, the predicted collision time and collision location are calculated to generate a collision warning. The calculation process considers the object's current position, velocity, acceleration, and shape characteristics, and uses time extrapolation to predict the object's trajectory over a future period (usually 5-30 seconds). The predicted trajectories of the two objects are compared to determine if there is an intersection and the intersection time. If the predicted collision time is within a threshold (e.g., 10 seconds), a collision warning is generated, including the collision object identifier, predicted collision time (e.g., after 8.3 seconds), predicted collision location coordinates (e.g., x=256.3 m, y=178.9 m, z=42.1 m), and collision severity assessment (e.g., collision kinetic energy estimate of 1250 joules). To improve prediction accuracy, higher frequency state updates and prediction calculations are used for highly dynamic objects (e.g., those with acceleration greater than 5 m / s²), with update cycles as short as 50 milliseconds.

[0077] Based on the generated collision warning information, and combined with the motion constraints and task priorities of each dynamic object, obstacle avoidance trajectories are generated for the dynamic objects that have triggered collision warnings. Motion constraints include physical constraints such as maximum speed limits (e.g., 20 m / s), maximum acceleration limits (e.g., 3 m / s²), and maximum turning angular velocity (e.g., 1 radian / s), as well as specific task constraints (e.g., maintaining a flight altitude of at least 30 meters). Priority rules determine which objects need to yield; for example, emergency tasks have higher priority than general tasks, and avoiding large-mass objects is more costly than avoiding small-mass objects. The obstacle avoidance trajectory generation employs a sampling optimization technique, generating multiple candidate trajectories while meeting the constraints, and selecting the trajectory with the lowest collision risk and optimal energy consumption. For example, for two drones flying towards each other, the lower-priority drone will generate a trajectory with a 15-degree yaw, lasting for 10 seconds, before resuming its original flight path. This maintains a safe distance of at least 50 meters while minimizing energy consumption.

[0078] Based on the generated obstacle avoidance trajectory, the motion state information of the corresponding dynamic objects is updated. This update process is achieved by issuing commands to the object control system, including parameters such as target position, velocity, acceleration, and heading angle. A segmented control strategy is adopted, discretizing the obstacle avoidance trajectory into a series of control points, with the time interval between control points typically between 0.5 and 1 second. 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 a threshold (e.g., a positional deviation greater than 2 meters or a directional deviation greater than 5 degrees), trajectory replanning is triggered. Using the updated spatial state information, the multi-level spatial grid structure is dynamically adjusted to adapt to changes in the distribution density of dynamic objects. The adjustment strategy includes grid merging and splitting. When the object density in a certain area drops below a threshold (e.g., 0.01 objects per cubic meter), adjacent grid cells are merged; when the density rises above the threshold (e.g., 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 between spatial partitioning and object distribution.

[0079] Through the above-mentioned technologies, this method can reduce the computational complexity of collision detection from O(n²) to close to O(n) in a large-scale distributed simulation environment with 5000 dynamic objects, control the average error of collision prediction to within 0.5 seconds, and control the response time of obstacle avoidance trajectory planning to within 100 milliseconds. The real-time performance and scalability of the overall system are significantly improved.

[0080] In one optional implementation, the simulation space is adaptively hierarchically divided based on the spatial state information to generate a multi-level spatial mesh structure, and the dynamic objects are mapped to corresponding spatial mesh cells to obtain object-mesh mapping relationships, including:

[0081] Based on the location information in the spatial state information, the dynamic object distribution density of each spatial region within the simulation space is calculated to obtain density distribution data;

[0082] Based on the density distribution data, the simulation space is divided into high-density regions and low-density regions. Fine-grained hierarchical identifiers are assigned to the high-density regions, and coarse-grained hierarchical identifiers are assigned to the low-density regions, thus obtaining the region-hierarchical correspondence.

[0083] Based on the region-level correspondence, spatial grid cells of a first size are generated for the high-density region, and spatial grid cells of a second size are generated for the low-density region, forming the multi-level spatial grid structure, wherein the first size is smaller than the second size;

[0084] The location 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 the association between the dynamic object identifier and the spatial grid unit identifier is established to obtain the object-grid mapping relationship.

[0085] Figure 2 This is a schematic diagram illustrating the process of determining the object-mesh mapping relationship according to an embodiment of the present invention. Figure 2 As shown, firstly, the dynamic object distribution density of each spatial region in the simulation space is calculated based on the location information in the spatial state information. Then, the region is divided and the hierarchy is allocated according to the density distribution data, and a multi-level spatial grid structure is generated. Finally, the object-grid mapping relationship is established.

[0086] In simulation space, the distribution of dynamic objects often exhibits uneven characteristics, with some areas having a large number of densely packed dynamic objects, while other areas are relatively sparse. To efficiently partition the space, it is first necessary to calculate the object distribution density in each region of the simulation space. This involves receiving spatial state information containing the location information of all dynamic objects, typically represented by three-dimensional coordinates (x, y, z). The entire simulation space is divided into several initial detection units, each with a size that can be set to 10 meters × 10 meters × 10 meters. For each detection unit, the number of dynamic objects falling within its spatial range is counted and divided by the volume of that detection unit to obtain the object density value for that region. For example, if a detection unit contains 50 dynamic objects, its density is 50 / (10 × 10 × 10) = 0.05 objects / cubic meter. This calculation is performed on all detection units in the entire simulation space, ultimately generating density distribution data representing the overall object distribution in the space.

[0087] Based on the density distribution data calculated above, the simulation space needs to be divided into high-density and low-density regions. A density threshold is set as the distinguishing criterion, which can be flexibly adjusted according to specific application scenarios. In this embodiment, the density threshold is set to 0.03 units / cubic meter. Detection units with a density value higher than 0.03 units / cubic meter are marked as high-density regions, and detection units with a density value lower than or equal to 0.03 units / cubic meter are marked as low-density regions. To avoid overly fragmented region division, adjacent regions of the same type are merged. After merging, a layer identifier "L1" is assigned to high-density regions, indicating that fine-grained meshing is required; a layer identifier "L2" is assigned to low-density regions, indicating that coarse-grained meshing can be used. This information is recorded as a region-layer correspondence and stored in a data structure for subsequent use.

[0088] Based on the established region-hierarchy correspondence, spatial grid cells of different sizes are generated for different regions, forming a multi-level spatial grid structure. For the high-density region labeled "L1", spatial grid cells of the first size are generated, with a size set to 2 meters × 2 meters × 2 meters; for the low-density region labeled "L2", spatial grid cells of the second size are generated, with a size set to 8 meters × 8 meters × 8 meters. Here, the first size (2 meters) is significantly smaller than the second size (8 meters), which meets the need for more refined subdivision of high-density regions. During the grid generation process, an octree data structure is used for recursive spatial partitioning, starting from the root node of the simulation space, and the recursion depth is determined according to the region's hierarchical label. For high-density regions, the recursion is performed until the depth is sufficient to generate 2-meter × 2-meter × 2-meter grid cells; for low-density regions, the recursion is performed only until the depth is sufficient to generate 8-meter × 8-meter × 8-meter grid cells. Each generated grid cell is assigned a unique identifier, such as "Grid_X_Y_Z_L", where X, Y, and Z represent the grid's index position in three-dimensional space, and L represents the grid's level.

[0089] After generating the multi-level spatial mesh structure, it is necessary to establish a mapping relationship between dynamic objects and spatial mesh cells. This involves traversing each dynamic object in the simulation space and reading its position information (x, y, z). For each position coordinate, it is checked which spatial mesh cell the point falls within. For example, for a dynamic object at position (15.2, 23.7, 8.5), first determine which level of region it belongs to. If the position belongs to a high-density region, find the corresponding 2m × 2m × 2m mesh cell; if it belongs to a low-density region, find the corresponding 8m × 8m × 8m mesh cell. Assuming the object is located in a high-density region, calculate its mesh cell identifier as "Grid_7_11_4_L1". Establish the association between the dynamic object identifier (e.g., "Object_157") and the mesh cell identifier ("Grid_7_11_4_L1"), and store this mapping information in a hash table or relational database. Repeat this process for all dynamic objects in the simulation space to obtain a complete object-mesh mapping table.

[0090] The above method achieves adaptive hierarchical spatial partitioning based on the distribution density of dynamic objects. High-density regions use finer meshes, while low-density regions use relatively coarser meshes, ensuring both computational accuracy and improved spatial processing efficiency. This method is particularly suitable for simulation scenarios involving large-scale dynamic objects, such as traffic flow simulation and crowd movement simulation.

[0091] In one optional implementation, the location 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 is established between the dynamic object identifier and the spatial grid unit identifier to obtain the object-grid mapping relationship, including:

[0092] Extract the spatial extent information of each spatial grid unit from the multi-level spatial grid structure;

[0093] The spatial inclusion relationship between the location information of each dynamic object and the boundary coordinates in the spatial range information is determined, and the spatial grid cell to which the location information of each dynamic object belongs is identified, thus obtaining the preliminary belonging relationship between the dynamic object and the spatial grid cell;

[0094] For each dynamic object in the preliminary attribution relationship, based on the geometric boundary information in the spatial state information, it is determined whether the geometric boundary of the dynamic object intersects with the boundary coordinates of the spatial grid cell to which it belongs;

[0095] 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. If there is overlap, the dynamic object is simultaneously associated with the adjacent spatial grid cell to obtain cross-boundary object association information.

[0096] The preliminary attribution relationship is merged with the cross-boundary object association information to establish an association relationship between each dynamic object identifier and one or more spatial grid unit identifiers, thus obtaining the object-grid mapping relationship.

[0097] In this embodiment, efficient spatial querying and management are achieved by establishing a relationship between dynamic object identifiers and spatial grid unit identifiers.

[0098] First, the spatial extent information of each spatial grid cell is extracted from the multi-level spatial grid structure. This structure contains spatial grid cells at different levels, each with a unique identifier and a defined spatial extent. This spatial extent information can be represented using boundary coordinates. For example, for a two-dimensional planar grid, the spatial extent of a grid cell can be defined using the coordinates of its lower left and upper right corners; for a three-dimensional solid grid, the boundary coordinates of its six faces can be used. This information is stored in a spatial index structure to prepare for subsequent determination of spatial inclusion relationships.

[0099] After obtaining the location information of dynamic objects, the spatial inclusion relationship between the location information of each dynamic object and the boundary coordinates in the spatial range information is determined. Specifically, the location coordinates of each dynamic object are checked to determine whether they fall within the range of a certain spatial grid cell. For example, assuming the location coordinates of dynamic object A are (105.32, 34.28), and the range of spatial grid cell M1 is [(105.30, 34.25), (105.35, 34.30)], then A is determined to fall within the range of M1, and a preliminary attribution relationship between A and M1 is established. By traversing all dynamic objects, a preliminary attribution relationship table between dynamic objects and spatial grid cells is obtained.

[0100] After obtaining the initial attribution relationship, it is necessary to further consider the geometric boundary information of the dynamic objects. For each dynamic object in the initial attribution relationship, based on the geometric boundary information in the spatial state information, it is determined whether the geometric boundary of the dynamic object intersects with the boundary coordinates of the spatial grid cell to which it belongs. This step is particularly important because many dynamic objects in practical applications (such as vehicles, aircraft, etc.) have a certain spatial size and will span multiple spatial grid cells. For example, suppose dynamic object B is a long truck, whose geometric boundary is represented as a rectangle [(100.21, 30.05), (100.23, 30.08)], while the boundary of the spatial grid cell N1 to which it belongs is [(100.20, 30.00), (100.22, 30.06)]. By comparing the coordinates, it can be determined that the geometric boundary of B intersects with the boundary of N1.

[0101] When the geometric boundary of a dynamic object is detected to intersect with the boundary of the spatial grid cell to which it belongs, it is necessary to further determine whether the geometric boundary of the dynamic object overlaps with the spatial extent of adjacent spatial grid cells. Continuing the example above, examining the grid cells adjacent to N1, we find 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 of B [(100.21, 30.05), (100.23, 30.08)] with the boundaries of these adjacent grid cells, it is determined that the geometric boundary of B overlaps with the boundaries of N2, N3, and N4. Therefore, B is simultaneously associated with the four spatial grid units N1, N2, N3, and N4, forming cross-boundary object association information.

[0102] In establishing cross-boundary object association information, spatial indexing techniques (such as R-trees and quadtrees) can be used to accelerate the search for adjacent spatial grid cells. Furthermore, to optimize performance, a threshold can be set; when the overlap area or volume ratio between a dynamic object and a spatial grid cell is below this threshold, the association can be ignored.

[0103] Finally, the initial attribution relationships and cross-boundary object association information are merged to establish an association between each dynamic object identifier and one or more spatial grid cell identifiers, thus obtaining a complete object-grid mapping relationship. This mapping relationship can be represented as an association table, where each row contains a dynamic object identifier and all spatial grid cell identifiers associated with it. For example, for the dynamic object B mentioned above, its record in the association table is: B -> {N1, N2, N3, N4}.

[0104] The object-mesh mapping established in this way can effectively support various query operations based on spatial location. For example, when querying all dynamic objects within a certain spatial range, one can first determine the mesh cells covered by that spatial range, and then quickly find all dynamic objects associated with these mesh cells through the mapping relationship. This method is much more efficient than directly determining the spatial range of each dynamic object, and can significantly improve system performance, especially when dealing with large-scale dynamic objects.

[0105] In one optional implementation, based on the object-mesh mapping relationship, local collision detection is performed in parallel on each simulation node to identify potential collision object pairs within the same spatial mesh cell and between adjacent spatial mesh cells. The identification information of potential collision object pairs across nodes is then synchronized to the corresponding simulation node to obtain a global potential collision set, including:

[0106] Based on the object-mesh mapping relationship, each spatial mesh unit in the multi-level spatial mesh structure is assigned to the corresponding simulation node to obtain node-mesh allocation information;

[0107] Based on the node-mesh allocation information at each simulation node, candidate object pairs within a cell and candidate object pairs between cells are determined to obtain a local candidate object pair set;

[0108] For each candidate object pair in the local candidate object pair set, based on the geometric boundary information and motion state information in the spatial state information, the spatial distance between the geometric boundaries of the two dynamic objects in the candidate object pair is calculated, and the local potential collision object pair set is identified based on the spatial distance;

[0109] For each potential collision object pair in the local potential collision object pair set, potential collision object pairs belonging to spatial grid cells managed by different simulation nodes are marked as cross-node potential collision object pairs. The identification information of the cross-node potential collision object pairs is extracted to obtain cross-node collision information.

[0110] 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.

[0111] This embodiment proposes an efficient method for identifying potential collision pairs in a distributed simulation environment. It utilizes object-mesh mapping to perform local collision detection in parallel across multiple simulation nodes, and achieves global collision detection through cross-node information synchronization.

[0112] During implementation, the spatial mesh elements in the multi-level spatial mesh structure are first assigned to the corresponding simulation nodes according to the object-mesh mapping relationship, thus obtaining node-mesh allocation information. Specifically, assume there are four simulation nodes (nodes A, B, C, and D), and the space is divided into an 8×8×8 mesh structure. A load balancing strategy is used to allocate mesh elements to each node; for example, mesh elements from (0,0,0) to (3,3,3) are assigned to node A, mesh elements from (0,0,4) to (3,3,7) are assigned to node B, and so on. Through this step, each simulation node clearly defines the spatial region it is responsible for processing.

[0113] Based on node-mesh allocation information at each simulation node, candidate object pairs within and between cells are determined, resulting in a local candidate object pair set. Taking node A as an example, assume there are dynamic objects O1, O2, and O3 in the managed mesh cell (2,2,2). Node A will generate intra-cell candidate object pairs (O1,O2), (O1,O3), and (O2,O3). Simultaneously, node A also needs to process candidate object pairs between adjacent mesh cells. For example, if there is a dynamic object O4 in mesh cell (2,2,3), node A will also generate inter-cell candidate object pairs (O1,O4), (O2,O4), and (O3,O4). By traversing all managed mesh cells and their adjacent cells, node A generates a complete local candidate object pair set.

[0114] For each candidate object pair in the local candidate object pair set, based on the geometric boundary information and motion state information in the spatial state information, the spatial distance between the geometric boundaries of the two dynamic objects in the candidate object pair is calculated. Based on the spatial distance, a set of local potential collision object pairs is identified. For each candidate object pair (Oi, Oj), a geometric algorithm is used to calculate the minimum distance dist(Oi, Oj) between the two objects. Considering the motion characteristics of 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, its current position is (10,10,10), and its velocity is (1,0,0); and O2 is a cube with a side length of 3 meters, its current position is (15,10,10), and its velocity is (-2,0,0). The calculated distance(O1,O2) is 3 meters. Considering that the two objects are moving towards each other, the distance_threshold can be set to 5 meters. Therefore, (O1,O2) is marked as a potential collision pair. Through this step, node A generates a local set of potential collision pairs.

[0115] For each potential collision object pair in the local potential collision object pair set, potential collision object pairs belonging to spatial mesh cells managed by different simulation nodes are marked as cross-node potential collision object pairs. The identification information of these cross-node potential collision object pairs is extracted to obtain cross-node collision information. Node A checks each pair of objects in its local potential collision object pair set to determine whether they belong to mesh cells managed by different nodes. For example, if O5 is located in mesh cell (3,3,3) (managed by node A), and O6 is located in mesh 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 this object pair, including the object ID, the mesh cell to which it belongs, and relevant collision parameters (such as estimated collision time), to form cross-node collision information.

[0116] Cross-node collision information is synchronized to the simulation nodes to which each dynamic object in the cross-node potential collision object pair belongs. On each simulation node, the received cross-node collision information is merged with the local potential collision object pair set to obtain the global potential collision set. Continuing the example, node A sends the cross-node collision information for (O5, O6) to node C. Similarly, if node C detects a potential collision involving objects managed by node A, it will also send the relevant information to node A. After receiving cross-node collision information from other nodes, each node merges this information with the potential collision object pairs detected locally. For example, node A's final global potential collision set includes its own detected local potential collision object pairs, as well as cross-node potential collision object pairs received from other nodes involving objects managed by node A. In this way, global collision detection in a distributed environment is achieved.

[0117] This method achieves efficient parallel collision detection through object-mesh mapping and spatial decomposition techniques, significantly improving collision detection performance in large-scale dynamic scenes. Experiments show that in a simulation environment containing 10,000 dynamic objects, using four parallel nodes can reduce the collision detection time from 240 milliseconds per node to approximately 70 milliseconds, a performance improvement of about 3.4 times, approaching the theoretical linear speedup.

[0118] In one optional implementation, based on the node-mesh allocation information at each simulation node, candidate object pairs within a cell and candidate object pairs between cells are determined to obtain a local candidate object pair set, including:

[0119] Based on the node-mesh allocation information, the dynamic object identifiers contained in each spatial mesh cell are extracted from the set of spatial mesh cells managed by each simulation node to obtain a cell-object mapping table;

[0120] For each spatial grid cell in the cell-object correspondence table, the dynamic object identifiers within that spatial grid cell are combined in pairs to obtain candidate object pairs within the cell;

[0121] Based on the spatial extent information of each spatial grid unit in the multi-level spatial grid structure, the adjacent spatial grid units of each spatial grid unit in the spatial grid unit set are identified, and the adjacency relationship between the spatial grid unit identifier and its adjacent spatial grid unit identifier is established to obtain a grid adjacency relationship table;

[0122] For each adjacency in the grid adjacency table, the dynamic object identifiers within two adjacent spatial grid cells in that adjacency are obtained from the cell-object correspondence table. The dynamic object identifier within one spatial grid cell is combined with the dynamic object identifiers within its adjacent spatial grid cells to obtain the candidate object pair between cells.

[0123] The candidate object pairs within the unit and the candidate object pairs between units are merged to obtain the local candidate object pair set.

[0124] The process of determining candidate object pairs within a cell and candidate object pairs between cells based on the node-mesh allocation information at each simulation node, and obtaining a set of local candidate object pairs, involves several key steps.

[0125] Based on node-mesh allocation information, the identifiers of dynamic objects contained within the spatial mesh cells are extracted from the set of spatial mesh cells managed by each simulation node, generating a cell-object mapping table. For example, assuming there are three spatial mesh 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 mapping table can be represented as follows: G1 corresponds to {O1, O2}, G2 corresponds to {O3, O4, O5}, and G3 corresponds to {O6}. This table establishes the mapping relationship between spatial mesh cells and their internal dynamic objects, facilitating subsequent processing.

[0126] For each spatial grid cell in the cell-object mapping table, the dynamic object identifiers within that cell are paired to obtain candidate object pairs. For cell G1 in the example above, its internal dynamic objects O1 and O2 can be combined to form the candidate object pair (O1, O2); for cell G2, its internal dynamic objects O3, O4, and O5 can be combined to form candidate object pairs (O3, O4), (O3, O5), and (O4, O5); while cell G3 contains only one dynamic object O6, which cannot form a candidate object pair within the cell. Here, the set of candidate object pairs within the cell is {(O1, O2), (O3, O4), (O3, O5), (O4, O5)}.

[0127] Based on the spatial extent information of each spatial grid cell in a 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 its adjacent spatial grid cell identifiers is established, generating a grid adjacency relationship table. Assuming that in the example above, G1 is adjacent to G2, G2 is adjacent to G3, but G1 and G3 are not adjacent, the grid adjacency relationship table can be represented as follows: G1's neighbor is {G2}, G2's neighbor is {G1,G3}, and G3's neighbor is {G2}. The process of identifying adjacent spatial grid cells can be achieved by comparing the boundary coordinates of the spatial grid cells. If the boundaries of two spatial grid cells overlap or the distance is less than a preset threshold, they are considered adjacent.

[0128] For each adjacency in the grid adjacency table, the dynamic object identifiers within two adjacent spatial grid cells are retrieved from the cell-object correspondence table. The dynamic object identifier within one spatial grid cell is then combined with the dynamic object identifiers within its adjacent spatial grid cells to obtain candidate object pairs between cells. For adjacent cells G1 and G2 in the example above, the dynamic objects within G1 are O1 and O2, and the dynamic objects within G2 are O3, O4, and O5. The resulting candidate object pairs are (O1,O3), (O1,O4), (O1,O5), (O2,O3), (O2,O4), and (O2,O5). For adjacent cells G2 and G3, the dynamic objects within G2 are O3, O4, and O5, and the dynamic object within G3 is O6. The resulting candidate object pairs are (O3,O6), (O4,O6), and (O5,O6). Here, the set of candidate pairs between units is {(O1,O3), (O1,O4), (O1,O5), (O2,O3), (O2,O4), (O2,O5), (O3,O6), (O4,O6), (O5,O6)}.

[0129] Finally, the candidate object pairs within the same cell and the candidate object pairs between cells are merged to obtain a local candidate object pair set. For the example above, the merged local candidate object pair set 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)}, with a total of 13 candidate object pairs.

[0130] In practical applications, to improve efficiency, the candidate object pair set can be optimized. One optimization method is to introduce a pre-filtering mechanism, which pre-excludes object pairs that are unlikely to collide based on information such as the spatial position and velocity of the dynamic objects. For example, a maximum distance threshold can be set; when the distance between two dynamic objects exceeds this threshold, they are not added to the candidate object pair set. Suppose that in the example above, distance calculations show that the distance between objects O1 and O5 exceeds the preset threshold, then the candidate object pair (O1, O5) can be excluded.

[0131] Another optimization method is to use the bounding box information of dynamic objects for rapid judgment. An axis-aligned bounding box is calculated for each dynamic object, and only objects whose bounding boxes may overlap are included in the candidate object pair set. This method can significantly reduce the number of object pairs requiring detailed collision detection, improving system performance.

[0132] In large-scale simulation scenarios, parallel processing techniques can be employed to further improve efficiency. Spatial grid cells are distributed across different computing nodes, with each node responsible for generating candidate object pairs within its managed grid cell and between it and adjacent cells. After each node completes its local processing, the results are aggregated to form a complete set of local candidate object pairs.

[0133] Through the above implementation method, candidate object pairs within a cell and candidate object pairs between cells can be efficiently determined on each simulation node based on node-mesh allocation information, resulting in a local candidate object pair set, which provides basic data support for subsequent collision detection and other processing.

[0134] In one optional implementation, for each potential collision object pair in the global potential collision set, a collision time prediction value and a collision location prediction value are calculated to generate collision warning information, including:

[0135] For each potential collision object pair in the global potential collision set, based on the motion state information of the two dynamic objects within the potential collision object pair in the spatial state information, the motion trajectory equation of the dynamic object in the future time period is determined, and the object motion trajectory information is obtained;

[0136] Based on the geometric boundary information of the two dynamic objects within 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 spatial envelope of the dynamic object;

[0137] For the dynamic object spatial envelopes of the two dynamic objects within the potential collision object pair, the spatial intersection region between the two dynamic object spatial envelopes is calculated. 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, thus obtaining the collision spatiotemporal prediction data;

[0138] The identification information of the potential collision object pair is associated with the collision spatiotemporal prediction data to generate the collision warning information.

[0139] It acquires real-time motion status information such as position, velocity, acceleration, and heading angle of all dynamic objects within the global monitoring area, as well as the geometric boundary information of the dynamic objects. For example, for a cargo drone, its position can be represented as three-dimensional coordinates (120.5, 35.2, 150.0), velocity as (5.0, 3.0, 0.0) meters per second, heading angle as 45 degrees, and geometric boundary as a cuboid with a length of 1.2 meters, a width of 0.8 meters, and a height of 0.5 meters.

[0140] A global potential collision set is selected based on spatial state information. For example, spatial grid partitioning technology is used to divide the entire monitoring area into multiple grid cells, each with a size of 10 meters × 10 meters × 10 meters. When two or more dynamic objects are located in the same or adjacent grid cells, these object pairs are added to the potential collision set. For example, when drone A is located in grid (12, 15, 10) and drone B is located in grid (12, 16, 10), drones A and B constitute a potential collision object pair.

[0141] For each potential collision object pair in the global potential collision set, the predicted collision time and collision position are calculated. For the two dynamic objects in the potential collision object pair, the trajectory equations for the future time period are determined based on their current motion state information. For objects moving in uniform linear motion, their trajectory equations can be determined by their initial position and velocity vector. For objects undergoing accelerated or turning motion, more complex trajectory equations are constructed by combining acceleration and the rate of change of heading angle. For example, for UAV A, whose initial position is (100, 200, 150) and velocity is (10, 5, 0), its position in the next t seconds can be obtained as (100+10t, 200+5t, 150).

[0142] Based on the geometric boundary and trajectory information of dynamic objects, the geometric boundaries of each dynamic object are spatially extended along its trajectory equation to form a spatial envelope of the dynamic object. This process essentially includes the entire spatial region that the dynamic object can occupy in the future. For example, for a drone that is 1.2 meters long, 0.8 meters wide, and 0.5 meters high, a slender tubular spatial envelope can be formed after spatial extension along its trajectory.

[0143] For the spatial envelopes of two dynamic objects within a potential collision pair, the spatial intersection region between them is calculated. This calculation can be achieved through discrete sampling: the time axis is discretized into several time points, and at each time point, the geometric boundaries of the two objects are checked for overlap. For example, the positions of two drones are checked at 0.1-second intervals over a 10-second time range. Assuming that at t=3.5 seconds, drone A's position is (135, 217.5, 150) and drone B's position is (134.8, 218, 149.5), considering their respective geometric boundaries, they have spatial overlap at this point, and this intersection region is recorded.

[0144] Based on the spatially intersecting region, the predicted collision time for potential colliding object pairs is calculated. The predicted collision time is typically defined as the time when the geometric boundaries of the two objects first overlap. In the example above, the predicted collision time is 3.5 seconds. Simultaneously, the geometric center coordinates of the spatially intersecting region corresponding to the predicted collision time are calculated as the predicted collision location. Specifically, for each discrete point in the intersecting region, its geometric center coordinates are calculated. In the example above, the predicted collision location is (134.9, 217.75, 149.75).

[0145] Finally, the identification information of potential collision pairs is associated with the spatiotemporal collision prediction data to generate collision warning information, which includes the object identifiers of potential collisions, the predicted collision time, the predicted collision location, and the collision risk level. For example, the following warning information can be generated: "UAV A (ID: UAV001) and UAV B (ID: UAV002) may collide in 3.5 seconds at location (134.9, 217.75, 149.75), risk level: high."

[0146] In practical applications, this method can trigger different levels of early warning measures based on collision prediction results. For example, a high-priority alarm can be sent to relevant operators when the predicted collision time is within 5 seconds; a medium-priority alarm can be sent when the predicted collision time is between 5 and 10 seconds; and a low-priority alarm can be sent when the predicted collision time is between 10 and 30 seconds. This tiered early warning mechanism helps operators take appropriate avoidance measures according to the level of urgency, effectively reducing the risk of collision.

[0147] In one optional implementation, based on the collision warning information and in conjunction with the motion constraints and task priorities of each dynamic object, an obstacle avoidance trajectory is generated for the dynamic object that has triggered the collision warning, including:

[0148] Extract the identification information of the potential collision object pairs that triggered the collision warning from the collision warning information, obtain the identification of each dynamic object in the potential collision object pair, and obtain the warning object set;

[0149] For each dynamic object in the aforementioned warning object set, the motion constraints and task priorities of the dynamic objects are extracted from the spatial state information.

[0150] For each potential collision object pair in the collision warning information, based on the task priorities of the two dynamic objects within the potential collision object pair in the task priorities, the primary obstacle object and the holding object among the two dynamic objects are determined to obtain the obstacle avoidance responsibility allocation result;

[0151] Based on the motion constraints of each primary obstacle avoidance object in the obstacle avoidance responsibility allocation result, the candidate trajectory space of the primary obstacle avoidance object is determined. Combined with the collision position prediction value in the collision warning information, trajectory schemes that maintain a safe distance from the collision position prediction value are selected from the candidate trajectory space to obtain a set of feasible obstacle avoidance trajectories.

[0152] For each trajectory scheme in the set of feasible obstacle avoidance trajectories, considering the deviation cost relative to the original motion trajectory of the main obstacle avoidance object and the time cost required to complete obstacle avoidance, one trajectory scheme is selected as the obstacle avoidance trajectory of the main obstacle avoidance object.

[0153] In the specific implementation, upon receiving a collision warning message, the identification information of the potential collision object pairs that triggered the warning is first extracted from the warning message. For example, if a potential collision risk is detected between dynamic object A and dynamic object B, the identifiers of dynamic object A and dynamic object B are extracted from the collision warning message and added to the warning object set. If multiple potential collision object pairs are detected simultaneously, such as dynamic object A and dynamic object C also having a potential collision risk, the warning object set will include dynamic objects A, B, and C.

[0154] For each dynamic object in the early warning object set, motion constraints and task priorities are extracted from spatial state information. Motion constraints include physical constraints such as the dynamic object's maximum speed, maximum acceleration, and maximum turning angle, as well as environmental constraints such as movement area restrictions and restricted areas. For example, dynamic object A has a maximum speed of 5 m / s, a maximum acceleration of 2 m / s², and a maximum turning angle of 30 degrees. Task priority indicates the importance of the task performed by the dynamic object and can be an integer value, with higher values ​​indicating higher priority. For example, dynamic object A has a task priority of 3, and dynamic object B has a task priority of 5.

[0155] For each potential collision object pair in the collision warning information, the primary obstacle avoidance object and the maintaining object are determined based on task priority, resulting in an obstacle avoidance responsibility allocation. The dynamic object with higher task priority is designated as the maintaining object, and the dynamic object with lower task priority is designated as the primary obstacle avoidance object. If the task priorities are the same, other factors such as the dynamic object's mobility and energy consumption can be used to determine the primary obstacle avoidance object. In the example above, dynamic object A and dynamic object B have task priorities of 3 and 5 respectively. Therefore, dynamic object A is designated as the primary obstacle avoidance object, and dynamic object B is designated as the maintaining object; that is, dynamic object A needs to actively avoid dynamic object B.

[0156] For each primary obstacle avoidance object in the obstacle avoidance responsibility allocation result, a candidate trajectory space is determined based on its motion constraints. Combined with the collision position prediction value from the collision warning information, trajectory schemes that maintain a safe distance from the predicted collision position value are selected from the candidate trajectory space, resulting in a set of feasible obstacle avoidance trajectories. The candidate trajectory space can be generated by applying different control inputs to the original trajectory, such as changing speed, acceleration, or direction. For example, for dynamic object A, its original trajectory is a straight line with a speed of 3 m / s. The collision warning information indicates that it will collide with dynamic object B at coordinates (100, 150) in 10 seconds. Multiple candidate trajectories can be generated: Trajectory 1 reduces speed to 2 m / s; Trajectory 2 shifts 5 degrees to the left and continues moving; Trajectory 3 shifts 8 degrees to the right and continues moving. The safe distance is set to 5 meters. By calculating the distance between each candidate trajectory and the predicted collision position value, Trajectory 2 and Trajectory 3 are selected to meet the safe distance requirement, forming a set of feasible obstacle avoidance trajectories.

[0157] For each trajectory scheme in the set of feasible obstacle avoidance trajectories, calculate its deviation cost relative to the original trajectory of the primary obstacle avoidance object and the time cost required to complete the obstacle avoidance. Select the trajectory scheme with the minimum total cost as the obstacle avoidance trajectory for the primary obstacle avoidance 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 the weights for deviation cost and 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 for dynamic object A.

[0158] Finally, the selected obstacle avoidance trajectory is sent to the corresponding primary obstacle avoidance object, guiding it to move along the trajectory and thus avoid collisions with the object being avoided. Simultaneously, the environment is continuously monitored; if new potential collision risks are detected, the above process is repeated to generate a new obstacle avoidance trajectory.

[0159] Based on the above, the collision warning information can be used to consider the motion constraints and task priorities of each dynamic object, rationally allocate obstacle avoidance responsibilities, and generate the optimal obstacle avoidance trajectory for the main obstacle avoidance object, thereby achieving efficient and safe obstacle avoidance control.

[0160] The distributed collision detection and obstacle avoidance system for a simulation trainer according to an embodiment of the present invention includes:

[0161] The first unit is used to obtain the spatial state information of the dynamic objects managed by multiple simulation nodes in the distributed simulation trainer.

[0162] The second unit is used to adaptively divide the simulation space into hierarchical parts based on the spatial state information, generate a multi-level spatial grid structure, and map the dynamic objects to the corresponding spatial grid units to obtain the object-grid mapping relationship.

[0163] The third unit is used to perform local collision detection in parallel on each simulation node according to the object-mesh mapping relationship, identify potential collision object pairs within the same spatial mesh cell and between adjacent spatial mesh cells, and synchronize the identification information of potential collision object pairs across nodes to the corresponding simulation nodes to obtain a global potential collision set;

[0164] The fourth unit is used to calculate the predicted collision time and the predicted collision location for each potential collision object pair in the global potential collision set, and generate collision warning information.

[0165] The fifth unit is used to generate obstacle avoidance trajectories for dynamic objects that have experienced collision warnings, based on the collision warning information and the motion constraints and task priorities of each dynamic object.

[0166] The sixth unit is used to update the motion state information of the corresponding dynamic object based on the obstacle avoidance trajectory, and to dynamically adjust the multi-level spatial grid structure using the updated spatial state information to adapt to changes in the distribution density of the dynamic object.

[0167] A third aspect of the present invention provides an electronic device, comprising:

[0168] processor;

[0169] Memory used to store processor-executable instructions;

[0170] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0171] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0172] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0173] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A distributed collision detection and obstacle avoidance method for a simulation trainer, characterized in that, include: Obtain spatial state information of dynamic objects managed by multiple simulation nodes in a distributed simulation trainer; Based on the spatial state information, the simulation space is adaptively hierarchically divided to generate a multi-level spatial mesh structure, and the dynamic objects are mapped to the corresponding spatial mesh units to obtain the object-mesh mapping relationship; Based on the object-mesh mapping relationship, local collision detection is performed in parallel on each simulation node to identify potential collision object pairs within the same spatial mesh cell and between adjacent spatial mesh cells. The identification information of potential collision object pairs across nodes is then 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, calculate the predicted collision time and the predicted collision location, and generate collision warning information; Based on the collision warning information, and combined with the motion constraints and task priorities of each dynamic object, an obstacle avoidance trajectory is generated for the dynamic object that has triggered the collision warning. Based on the obstacle avoidance trajectory, update the motion state information of the corresponding dynamic object, and use the updated spatial state information to dynamically adjust the multi-level spatial grid structure to adapt to the changes in the distribution density of the dynamic object. Based on the spatial state information, the simulation space is adaptively hierarchically divided to generate a multi-level spatial mesh structure, and the dynamic objects are mapped to the corresponding spatial mesh cells to obtain the object-mesh mapping relationship, including: Based on the location information in the spatial state information, the dynamic object distribution density of each spatial region within the simulation space is calculated to obtain density distribution data; Based on the density distribution data, the simulation space is divided into high-density regions and low-density regions. Fine-grained hierarchical identifiers are assigned to the high-density regions, and coarse-grained hierarchical identifiers are assigned to the low-density regions, thus obtaining the region-hierarchical correspondence. Based on the region-level correspondence, spatial grid cells of a first size are generated for the high-density region, and spatial grid cells of a second size are generated for the low-density region, forming the multi-level spatial grid structure, wherein the first size is smaller than the second size; The location 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 the association between the dynamic object identifier and the spatial grid unit identifier is established to obtain the object-grid mapping relationship.

2. The method according to claim 1, characterized in that, The location 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. An association is established between the dynamic object identifier and the spatial grid unit identifier to obtain the object-grid mapping relationship, including: Extract the spatial extent information of each spatial grid unit from the multi-level spatial grid structure; The spatial inclusion relationship between the location information of each dynamic object and the boundary coordinates in the spatial range information is determined, and the spatial grid cell to which the location information of each dynamic object belongs is identified, thus obtaining the preliminary belonging relationship between the dynamic object and the spatial grid cell; For each dynamic object in the preliminary attribution relationship, based on the geometric boundary information in the spatial state information, it is determined whether the geometric boundary of the dynamic object intersects with the boundary coordinates of the spatial grid cell to which it belongs; 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. If there is overlap, the dynamic object is simultaneously associated with the adjacent spatial grid cell to obtain cross-boundary object association information. The preliminary attribution relationship is merged with the cross-boundary object association information to establish an association relationship between each dynamic object identifier and one or more spatial grid unit identifiers, thus obtaining the object-grid mapping relationship.

3. The method according to claim 1, characterized in that, Based on the object-mesh mapping relationship, local collision detection is performed in parallel on each simulation node to identify potential collision object pairs within the same spatial mesh cell and between adjacent spatial mesh cells. The identification information of potential collision object pairs across nodes is synchronized to the corresponding simulation node to obtain a global potential collision set, including: Based on the object-mesh mapping relationship, each spatial mesh unit in the multi-level spatial mesh structure is assigned to the corresponding simulation node to obtain node-mesh allocation information; Based on the node-mesh allocation information at each simulation node, candidate object pairs within a cell and candidate object pairs between cells are determined to obtain a local candidate object pair set; For each candidate object pair in the local candidate object pair set, based on the geometric boundary information and motion state information in the spatial state information, the spatial distance between the geometric boundaries of the two dynamic objects in the candidate object pair is calculated, 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, potential collision object pairs belonging to spatial grid cells managed by different simulation nodes are marked as cross-node potential collision object pairs. The identification information of the cross-node potential collision object pairs 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.

4. The method according to claim 3, characterized in that, Based on the node-mesh allocation information at each simulation node, candidate object pairs within a cell and candidate object pairs between cells are determined, resulting in a local candidate object pair set, including: Based on the node-mesh allocation information, the dynamic object identifiers contained in each spatial mesh cell are extracted from the set of spatial mesh cells managed by each simulation node to obtain a cell-object mapping table; For each spatial grid cell in the cell-object correspondence table, the dynamic object identifiers within that spatial grid cell are combined in pairs to obtain candidate object pairs within the cell; Based on the spatial extent information of each spatial grid unit in the multi-level spatial grid structure, the adjacent spatial grid units of each spatial grid unit in the spatial grid unit set are identified, and the adjacency relationship between the spatial grid unit identifier and its adjacent spatial grid unit identifier is established to obtain a grid adjacency relationship table; For each adjacency in the grid adjacency table, the dynamic object identifiers within two adjacent spatial grid cells in that adjacency are obtained from the cell-object correspondence table. The dynamic object identifier within one spatial grid cell is combined with the dynamic object identifiers within its adjacent spatial grid cells to obtain the candidate object pair between cells. The candidate object pairs within the unit and the candidate object pairs between units are merged to obtain the local candidate object pair set.

5. The method according to claim 1, characterized in that, For each potential collision object pair in the global potential collision set, calculate the predicted collision time and the predicted collision location, and 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 within the potential collision object pair in the spatial state information, the motion trajectory equation of the dynamic object 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 within 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 spatial envelope of the dynamic object; For the dynamic object spatial envelopes of the two dynamic objects within the potential collision object pair, the spatial intersection region between the two dynamic object spatial envelopes is calculated. 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, thus obtaining the collision spatiotemporal prediction data; The collision warning information is generated by associating the identification information of the potential collision object pairs with the collision spatiotemporal prediction data.

6. The method according to claim 1, characterized in that, Based on the collision warning information, and combined with the motion constraints and task priorities of each dynamic object, an obstacle avoidance trajectory is generated for the dynamic object that has triggered the collision warning, including: Extract the identification information of the potential collision object pairs that triggered the collision warning from the collision warning information, obtain the identification of each dynamic object in the potential collision object pair, and obtain the warning object set; For each dynamic object in the aforementioned warning object set, the motion constraints and task priorities of the dynamic objects 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 within the potential collision object pair in the task priorities, the primary obstacle object and the holding object among the two dynamic objects are determined to obtain the obstacle avoidance responsibility allocation result; Based on the motion constraints of each primary obstacle avoidance object in the obstacle avoidance responsibility allocation result, the candidate trajectory space of the primary obstacle avoidance object is determined. Combined with the collision position prediction value in the collision warning information, trajectory schemes that maintain a safe distance from the collision position prediction value are selected from the candidate trajectory space to obtain a set of feasible obstacle avoidance trajectories. For each trajectory scheme in the set of feasible obstacle avoidance trajectories, considering the deviation cost relative to the original motion trajectory of the main obstacle avoidance object and the time cost required to complete obstacle avoidance, one trajectory scheme is selected as the obstacle avoidance trajectory of the main obstacle avoidance object.

7. A distributed collision detection and obstacle avoidance system for a simulation trainer, used to implement the method as described in any one of claims 1-6, characterized in that, include: The first unit is used to obtain the spatial state information of the dynamic objects managed by multiple simulation nodes in the distributed simulation trainer. The second unit is used to adaptively divide the simulation space into hierarchical parts based on the spatial state information, generate a multi-level spatial grid structure, and map the dynamic objects to the corresponding spatial grid units to obtain the object-grid mapping relationship. The third unit is used to perform local collision detection in parallel on each simulation node according to the object-mesh mapping relationship, identify potential collision object pairs within the same spatial mesh cell and between adjacent spatial mesh cells, and synchronize the identification information of potential collision object pairs across nodes to the corresponding simulation nodes to obtain a global potential collision set; The fourth unit is used to calculate the predicted collision time and the predicted collision location for each potential collision object pair in the global potential collision set, and generate collision warning information. The fifth unit is used to generate obstacle avoidance trajectories for dynamic objects that have experienced collision warnings, based on the collision warning information and the motion constraints and task priorities of each dynamic object. The sixth unit is used to update the motion state information of the corresponding dynamic object based on the obstacle avoidance trajectory, and to dynamically adjust the multi-level spatial grid structure using the updated spatial state information to adapt to the changes in the distribution density of the dynamic object. Unit 2 is used for: Based on the location information in the spatial state information, the dynamic object distribution density of each spatial region within the simulation space is calculated to obtain density distribution data; Based on the density distribution data, the simulation space is divided into high-density regions and low-density regions. Fine-grained hierarchical identifiers are assigned to the high-density regions, and coarse-grained hierarchical identifiers are assigned to the low-density regions, thus obtaining the region-hierarchical correspondence. Based on the region-level correspondence, spatial grid cells of a first size are generated for the high-density region, and spatial grid cells of a second size are generated for the low-density region, forming the multi-level spatial grid structure, wherein the first size is smaller than the second size; The location 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 the association between the dynamic object identifier and the spatial grid unit identifier is established to obtain the object-grid mapping relationship.

8. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 6.

Citation Information

Patent Citations

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

    CN120375649A

  • Data processing method and apparatus, computer, and readable storage medium

    WO2024156218A1