A digital twin model loading optimization method and system based on heterogeneous positioning data correction
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-25
- Publication Date
- 2026-08-11
AI Technical Summary
[0007]本发明要解决的技术问题在于,针对现有数字孪生模型加载与空间对齐方法中,多源异构定位数据未经系统性修正导致虚拟模型与现实世界之间出现空间错位和碰撞干涉的缺陷,提供一种能够从数据源头、坐标转换、方位修正、碰撞检测及碰撞响应多个层面,系统性地优化动态模型加载与碰撞处理机制的方法及系统
1.通过将多源异构定位数据统一转换至同一平面坐标系,并基于预设场地分区信息与目标物体姿态对模型朝向进行自适应修正,有效消除了因定位数据偏差和人工测量误差导致的虚拟模型空间错位,避免了视觉上的空间穿透或碰撞干涉。
Smart Images

Figure CN122549008A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital twin and 3D simulation technology, specifically to a method and system for loading and optimizing digital twin models based on heterogeneous positioning data correction. Background Technology
[0002] Digital twin technology, by constructing high-fidelity virtual mappings of physical entities and integrating multi-source data to drive collaborative model operation, has become a core support for achieving full-element visualization and efficient management in fields such as intelligent manufacturing and smart ports. In the application of digital twins for heavy equipment such as port terminals, ships, and floating cranes, it is usually necessary to accurately map the real-time positions and attitudes of multiple movable target objects and fixed facilities onto a three-dimensional virtual scene to support business needs such as operation monitoring, interactive simulation, and collision warning.
[0003] However, existing methods for loading and spatially aligning digital twin models face the following technical challenges: First, the real-time positioning data of moving targets mostly comes from WGS-84 latitude and longitude coordinates provided by the Global Navigation Satellite System. Affected by factors such as signal blockage and multipath effects, the positioning data is subject to drift and accuracy loss. Meanwhile, the location of static facilities often relies on manual measurement or design drawings, which also have on-site deviations. Directly driving the 3D model with multi-source heterogeneous positioning data without systematic correction can easily lead to spatial misalignment between the virtual model and the real world, resulting in visual spatial penetration or collision interference.
[0004] Secondly, different types of target objects have different geometric features and motion characteristics. For example, floating cranes usually have outward-extending booms, and their spatial footprint is much larger than that of the ship itself. If a uniform simplified bounding body is used for collision detection, it is difficult to accurately describe the actual spatial area occupied by such special equipment. In dynamic scenes, the problem of models intersecting each other frequently occurs, which seriously affects the scene reproduction accuracy and simulation credibility.
[0005] Furthermore, as the number of dynamic models increases, the computational overhead for real-time collision detection and attitude correction increases dramatically. Simply increasing the refresh rate or using a complex physics simulation engine makes it difficult to balance high fidelity and high real-time performance with limited computing resources, easily leading to system response delays and screen stuttering, failing to meet the stringent stability and real-time requirements of industrial environments.
[0006] Therefore, how to systematically correct the spatial deviation caused by heterogeneous positioning data from multiple levels such as data source, coordinate transformation, collision detection and business rules, optimize the loading and collision handling mechanism of dynamic models, and achieve high-precision spatial alignment between virtual models and the real world has become a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0007] The technical problem to be solved by this invention is to address the shortcomings of existing digital twin model loading and spatial alignment methods, which suffer from spatial misalignment and collision interference between the virtual model and the real world due to the lack of systematic correction of multi-source heterogeneous positioning data. This invention provides a method and system that can systematically optimize the dynamic model loading and collision handling mechanism from multiple levels, including data source, coordinate transformation, orientation correction, collision detection and collision response.
[0008] To address the aforementioned technical problems, this invention provides a digital twin model loading optimization method based on heterogeneous positioning data correction, comprising: S1) Acquire real-time positioning data of multiple target objects, wherein the real-time positioning data includes at least position information and attitude parameters; S2) Convert the location information from the geographic coordinate system to planar coordinates in a preset planar coordinate system; S3) Load the original 3D model corresponding to the target object type, and dynamically generate a model instance based on the planar coordinates and the posture parameters: clone the original 3D model to obtain model components, construct a bounding volume hierarchy for the geometry of the model components, and combine the model components into the model instance and place it in the digital twin scene; S4) Based on the preset site partition information, determine the partition to which the model instance currently belongs, and adjust the display orientation of the model instance in the scene according to the relationship between the motion direction reflected by the posture parameters and the reference orientation corresponding to the partition; S5) For at least one type of target object, attach at least one extended collision detection body to the corresponding model instance, wherein the spatial dimensions and offset of the extended collision detection body relative to the model origin are configured to cover the range of motion of the extended working parts of the target object. S6) Perform collision detection on model instances in the digital twin scenario, including: calculating the relative transformation matrix between two model instances, and using the bounding volume hierarchy to determine whether there is an intersection in the local coordinate system; S7) In response to the detection of a collision, determine the model instance to be moved according to the preset selection rules, and apply displacement to the planar coordinates of the model instance in at least two directions to eliminate spatial overlap.
[0009] Furthermore, the geographic coordinate system is the WGS-84 coordinate system, and the preset planar coordinate system is the Mercator projection coordinate system. By projecting latitude and longitude coordinates into two-dimensional planar coordinates and setting the height value as a constant, the multiple target objects are located on the same horizontal reference plane.
[0010] Furthermore, determining the current partition to which the model instance belongs based on preset site partitioning information includes: Calculate the spatial distance between the current position of the model instance in the planar coordinate system and the coordinates of each preset partition, and select the partition with the smallest spatial distance as the partition to which the model instance belongs; The attitude parameters include the heading angle; adjusting the display orientation of the model instance in the scene based on the relationship between the motion direction reflected by the attitude parameters and the reference orientation corresponding to the partition includes: Obtain the preset reference orientation angle corresponding to the partition; The heading angle is compared with a preset angle range corresponding to different motion direction types to determine the motion direction type of the model instance, the motion direction type including a first type and a second type; When the motion direction type is the first type, the display orientation is set to the reference orientation angle; when the motion direction type is the second type, the display orientation is set to the reference orientation angle minus 180°.
[0011] Further, the at least one type of target object is a floating crane; the step of attaching at least one extended collision detector to the corresponding model instance includes: Create a cuboid geometry as the extended collision detection body, the size of which corresponds to the working space range of the outrigger of the floating crane; A corresponding mesh object is generated based on the cuboid geometry, and the mesh object is configured to be invisible in the scene; Set the offset of the mesh object relative to the local coordinate system of the model instance, the offset being along the extension direction of the cantilever boom; Add the mesh object as a child node of the model instance.
[0012] Further, calculating the relative transformation matrix between the two model instances includes: Obtain the world matrix of the first model instance, and invert the world matrix of the first model instance to obtain the first inverse matrix; Obtain the world matrix of the second model instance; Multiply the first inverse matrix with the world matrix of the second model instance to obtain the relative transformation matrix of the second model instance relative to the local coordinate system of the first model instance.
[0013] Furthermore, the preset planar coordinate system is composed of a first coordinate axis and a second coordinate axis that are perpendicular to each other, and the preset selection rules include: Obtain the position values of the two model instances that collided along the first coordinate axis in the planar coordinate system; The model instance with the larger position value along the first coordinate axis among the two model instances is determined as the model instance to be moved; The displacement includes: moving the model instance to be moved along the positive direction of the first coordinate axis by a first preset value, and moving it along the positive direction of the second coordinate axis by a second preset value.
[0014] Further, the process of cloning the original 3D model to obtain model components, constructing a bounding volume hierarchy for the geometry of the model components, and assembling the model components into the model instance includes: Traverse the sub-objects of the original 3D model and filter out the mesh objects; For each of the mesh objects, copy its geometry and construct a bounding volume hierarchy for the copied geometry; The material of the mesh object is copied, and a new mesh object is generated based on the copied geometry and the copied material, which serves as the model component; Add the generated model components to a newly created group, and use that group as the model instance.
[0015] Furthermore, acquiring real-time positioning data of multiple target objects includes: At preset time intervals, the real-time positioning data is periodically acquired from the data interface, and based on each acquired real-time positioning data, the position, orientation, and status of the model instance in the digital twin scene are dynamically updated.
[0016] This invention also provides a digital twin model loading optimization system based on heterogeneous positioning data correction, comprising: The data acquisition module is used to acquire real-time positioning data of multiple target objects, wherein the real-time positioning data includes at least position information and attitude parameters; The coordinate transformation module is used to convert the location information from a geographic coordinate system to planar coordinates in a preset planar coordinate system; The model generation module is used to load the original 3D model corresponding to the target object type, dynamically generate model instances based on the planar coordinates and the pose parameters, including cloning the original 3D model to obtain model components, constructing a bounding volume hierarchy for the geometry of the model components, and combining the model components into the model instance and placing it in the digital twin scene; The orientation correction module is used to determine the current partition to which the model instance belongs based on preset site partition information, and adjust the display orientation of the model instance in the scene according to the relationship between the motion direction reflected by the posture parameters and the reference orientation corresponding to the partition. The collision body extension module is used to attach at least one extended collision detection body to the corresponding model instance for at least one type of target object. The spatial dimensions and offset of the extended collision detection body relative to the model origin are configured to cover the range of motion of the extended working parts of the target object. The collision detection module is used to perform collision detection on model instances in a digital twin scenario, including calculating the relative transformation matrix between two model instances and using the bounding volume hierarchy to determine whether there is an intersection in the local coordinate system. The collision response module is used to respond to the detection of a collision, determine the model instance to be moved according to a preset selection rule, and apply displacement to the planar coordinates of the model instance in at least two directions to eliminate spatial overlap.
[0017] The present invention has the following beneficial effects: 1. By uniformly converting multi-source heterogeneous positioning data to the same plane coordinate system, and adaptively correcting the model orientation based on preset site zoning information and target object posture, the spatial misalignment of the virtual model caused by positioning data deviation and manual measurement error is effectively eliminated, avoiding visual spatial penetration or collision interference.
[0018] 2. By attaching a dedicated extended collision detection body to specific types of target objects with extended working parts, the actual space occupied by the object can be accurately described. This solves the problem that the unified simplified bounding body cannot cover the blind spots of special equipment operations and avoids the intermingling of models in dynamic scenes due to inaccurate bounding body descriptions.
[0019] 3. By pre-constructing a bounding volume hierarchy during the model generation stage and performing collision detection in the local coordinate system in conjunction with the relative transformation matrix, the complex spatial intersection judgment is transformed into an efficient query in the local coordinate system. While ensuring the accuracy of collision detection, the computational overhead is significantly reduced, and the high scene fidelity and real-time response capability can be balanced under limited computing resources.
[0020] Furthermore, by automatically avoiding displacement based on preset rules, instant repair of collision penetration is achieved, further improving the visual stability and simulation credibility of digital twin scenes. Attached Figure Description
[0021] Figure 1 This is a flowchart illustrating the digital twin model loading optimization method based on heterogeneous positioning data correction in an embodiment of the present invention.
[0022] Figure 2 This is a flowchart illustrating the specific implementation of model loading optimization in this embodiment of the invention.
[0023] Figure 3This is a schematic diagram of the process for determining the ship's heading and rotating the model in an embodiment of the present invention.
[0024] Figure 4 This is a schematic diagram of the ship collision detection and avoidance process in an embodiment of the present invention. Detailed Implementation
[0025] Reference Figure 1 This invention provides a method for optimizing the loading of a digital twin model based on heterogeneous positioning data correction, comprising: S1) Acquire real-time positioning data of multiple target objects, wherein the real-time positioning data includes at least position information and attitude parameters; S2) Convert the location information from the geographic coordinate system to planar coordinates in a preset planar coordinate system; S3) Load the original 3D model corresponding to the target object type, and dynamically generate a model instance based on the planar coordinates and the posture parameters: clone the original 3D model to obtain model components, construct a bounding volume hierarchy for the geometry of the model components, and combine the model components into the model instance and place it in the digital twin scene; S4) Based on the preset site partition information, determine the partition to which the model instance currently belongs, and adjust the display orientation of the model instance in the scene according to the relationship between the motion direction reflected by the posture parameters and the reference orientation corresponding to the partition; S5) For at least one type of target object, attach at least one extended collision detection body to the corresponding model instance, wherein the spatial dimensions and offset of the extended collision detection body relative to the model origin are configured to cover the range of motion of the extended working parts of the target object. S6) Perform collision detection on model instances in the digital twin scenario, including: calculating the relative transformation matrix between two model instances, and using the bounding volume hierarchy to determine whether there is an intersection in the local coordinate system; S7) In response to the detection of a collision, determine the model instance to be moved according to the preset selection rules, and apply displacement to the planar coordinates of the model instance in at least two directions to eliminate spatial overlap.
[0026] Furthermore, the geographic coordinate system is the WGS-84 coordinate system, and the preset planar coordinate system is the Mercator projection coordinate system. By projecting latitude and longitude coordinates into two-dimensional planar coordinates and setting the height value as a constant, the multiple target objects are located on the same horizontal reference plane.
[0027] Furthermore, determining the current partition to which the model instance belongs based on preset site partitioning information includes: Calculate the spatial distance between the current position of the model instance in the planar coordinate system and the coordinates of each preset partition, and select the partition with the smallest spatial distance as the partition to which the model instance belongs; The attitude parameters include the heading angle; adjusting the display orientation of the model instance in the scene based on the relationship between the motion direction reflected by the attitude parameters and the reference orientation corresponding to the partition includes: Obtain the preset reference orientation angle corresponding to the partition; The heading angle is compared with a preset angle range corresponding to different motion direction types to determine the motion direction type of the model instance, the motion direction type including a first type and a second type; When the motion direction type is the first type, the display orientation is set to the reference orientation angle; when the motion direction type is the second type, the display orientation is set to the reference orientation angle minus 180°.
[0028] Further, the at least one type of target object is a floating crane; the step of attaching at least one extended collision detector to the corresponding model instance includes: Create a cuboid geometry as the extended collision detection body, the size of which corresponds to the working space range of the outrigger of the floating crane; A corresponding mesh object is generated based on the cuboid geometry, and the mesh object is configured to be invisible in the scene; Set the offset of the mesh object relative to the local coordinate system of the model instance, the offset being along the extension direction of the cantilever boom; Add the mesh object as a child node of the model instance.
[0029] Further, calculating the relative transformation matrix between the two model instances includes: Obtain the world matrix of the first model instance, and invert the world matrix of the first model instance to obtain the first inverse matrix; Obtain the world matrix of the second model instance; Multiply the first inverse matrix with the world matrix of the second model instance to obtain the relative transformation matrix of the second model instance relative to the local coordinate system of the first model instance.
[0030] Furthermore, the preset planar coordinate system is composed of a first coordinate axis and a second coordinate axis that are perpendicular to each other, and the preset selection rules include: Obtain the position values of the two model instances that collided along the first coordinate axis in the planar coordinate system; The model instance with the larger position value along the first coordinate axis among the two model instances is determined as the model instance to be moved; The displacement includes: moving the model instance to be moved along the positive direction of the first coordinate axis by a first preset value, and moving it along the positive direction of the second coordinate axis by a second preset value.
[0031] Further, the process of cloning the original 3D model to obtain model components, constructing a bounding volume hierarchy for the geometry of the model components, and assembling the model components into the model instance includes: Traverse the sub-objects of the original 3D model and filter out the mesh objects; For each of the mesh objects, copy its geometry and construct a bounding volume hierarchy for the copied geometry; The material of the mesh object is copied, and a new mesh object is generated based on the copied geometry and the copied material, which serves as the model component; Add the generated model components to a newly created group, and use that group as the model instance.
[0032] Furthermore, acquiring real-time positioning data of multiple target objects includes: At preset time intervals, the real-time positioning data is periodically acquired from the data interface, and based on each acquired real-time positioning data, the position, orientation, and status of the model instance in the digital twin scene are dynamically updated.
[0033] This invention also provides a digital twin model loading optimization system based on heterogeneous positioning data correction, comprising: The data acquisition module is used to acquire real-time positioning data of multiple target objects, wherein the real-time positioning data includes at least position information and attitude parameters; The coordinate transformation module is used to convert the location information from a geographic coordinate system to planar coordinates in a preset planar coordinate system; The model generation module is used to load the original 3D model corresponding to the target object type, dynamically generate model instances based on the planar coordinates and the pose parameters, including cloning the original 3D model to obtain model components, constructing a bounding volume hierarchy for the geometry of the model components, and combining the model components into the model instance and placing it in the digital twin scene; The orientation correction module is used to determine the current partition to which the model instance belongs based on preset site partition information, and adjust the display orientation of the model instance in the scene according to the relationship between the motion direction reflected by the posture parameters and the reference orientation corresponding to the partition. The collision body extension module is used to attach at least one extended collision detection body to the corresponding model instance for at least one type of target object. The spatial dimensions and offset of the extended collision detection body relative to the model origin are configured to cover the range of motion of the extended working parts of the target object. The collision detection module is used to perform collision detection on model instances in a digital twin scenario, including calculating the relative transformation matrix between two model instances and using the bounding volume hierarchy to determine whether there is an intersection in the local coordinate system. The collision response module is used to respond to the detection of a collision, determine the model instance to be moved according to a preset selection rule, and apply displacement to the planar coordinates of the model instance in at least two directions to eliminate spatial overlap.
[0034] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention.
[0035] Reference Figure 1 This invention provides a digital twin model loading optimization method based on heterogeneous positioning data correction. This method systematically optimizes the dynamic model loading mechanism from multiple levels, including data source, coordinate transformation, orientation correction, collision detection, and collision response, to eliminate spatial misalignment and collision interference in the virtual model caused by positioning data deviations and human measurement errors. The method specifically includes the following steps: S1) Obtain real-time positioning data of multiple target objects, wherein the real-time positioning data includes at least position information and attitude parameters.
[0036] Specifically, real-time positioning data of target objects (such as ships, floating cranes, and other heavy equipment) are periodically retrieved from the data backend interface at preset time intervals (e.g., every 5 minutes). The data returned by the interface can be in the form of a nested JSON dataset. By parsing this dataset, the core attributes of each target object are extracted, including but not limited to the target object number, the heading angle as an attitude parameter, and the longitude and latitude as location information. This establishes a dynamic mapping relationship between the target object number and the 3D model, providing basic data-driven support for digital twin scenarios.
[0037] S2) Convert the location information from the geographic coordinate system to planar coordinates in a preset planar coordinate system.
[0038] Since multi-source positioning data is typically in the WGS-84 geographic coordinate system, it suffers from drift and accuracy loss, necessitating a unified conversion to the Mercator projection coordinate system. The Earth's radius constant is defined as the value of the semi-major axis of the WGS-84 ellipsoid. A coordinate transformation algorithm is used to convert the input latitude and longitude coordinates to Mercator plane coordinates. The specific transformation rules are as follows: the X-axis coordinate of the plane coordinate system is obtained by multiplying longitude by pi, dividing by 180, and then multiplying by the Earth's radius constant; the Y-axis coordinate of the plane coordinate system is obtained by mapping latitude through specific tangent and natural logarithm operations; simultaneously, the Z-axis coordinate (i.e., altitude value) of the plane coordinate system is fixed as a constant (e.g., 0). This step ensures that all target objects are projected onto the same horizontal reference plane, eliminating heterogeneous errors in the elevation dimension.
[0039] S3) Load the original 3D model corresponding to the target object type, dynamically generate a model instance based on the planar coordinates and the posture parameters: clone the original 3D model to obtain model components, construct a bounding volume hierarchy for the geometry of the model components, and combine the model components into the model instance and place it in the digital twin scene.
[0040] In a 3D rendering engine (such as Three.js), a new grouping object is created to hold the cloned model mesh. All child objects of the original 3D model are traversed, and the mesh objects are selected. A geometry cloning operation is performed on each selected mesh object to avoid sharing underlying geometric data with the original model. A bounding volume hierarchy (BVH tree) is pre-constructed for the cloned geometry. This structure divides space through a tree-like hierarchy, significantly accelerating the efficiency of collision space lookup in subsequent stages. Then, the materials of the original mesh objects are copied, and new model components are generated based on the cloned geometry and materials. These components are added to the grouping object to form a complete model instance. Finally, the position of this model instance is set to the planar coordinates calculated in step S2, completing the loading and mounting of the model in the scene.
[0041] S4) Based on the preset site zoning information, determine the zoning to which the model instance currently belongs, and adjust the display orientation of the model instance in the scene according to the relationship between the motion direction reflected by the posture parameters and the reference orientation corresponding to the zoning.
[0042] Combined with appendix Figure 2 and Figure 3 This step includes two parts: region matching and heading determination. First, extract multiple preset set of site partition coordinates from the digital twin scene. Calculate the three-dimensional Euclidean distance between the current planar coordinates of the model instance and the coordinates of each preset partition. Select the partition with the smallest Euclidean distance as the current partition to which the model instance belongs, and obtain the preset reference orientation angle corresponding to this partition in the preset mapping table.
[0043] Secondly, the real-time acquired heading angle is compared with a preset angle range corresponding to different motion direction types to determine the motion direction type of the model instance. The motion direction types include a first type and a second type. In a specific implementation scenario, the preset angle range is set to 40 degrees to 200 degrees. When the heading angle is within this preset angle range, the motion direction type is determined to be the first type (e.g., downstream direction); when the heading angle is outside this preset angle range, the motion direction type is determined to be the second type (e.g., upstream direction). When determined to be the first type, the display orientation (rotation angle around the Y-axis) of the model instance is set to the reference orientation angle minus 180 degrees (i.e., minus the radians corresponding to pi); when determined to be the second type, the display orientation of the model instance is directly set to the reference orientation angle, thereby achieving automatic compensation and alignment for abnormal deflection of the physical target due to positioning drift.
[0044] S5) For at least one type of target object, attach at least one extended collision detection body to the corresponding model instance, wherein the spatial dimensions and offset relative to the model origin of the extended collision detection body are configured to cover the range of motion of the extended working parts of the target object.
[0045] For specific equipment with an extended boom (such as a floating crane), its spatial footprint is much larger than that of the basic backbone model. In this step, the equipment type of the target object is first verified. If it is confirmed to be a floating crane, a cuboid geometry is generated by the 3D engine as an extended collision detection body. The spatial dimensions of this cuboid geometry are preset to cover the working space of the extended boom (e.g., X-axis length 90, Y-axis height 20, Z-axis width 30). Subsequently, an invisible mesh object is generated based on this geometry, and its offset relative to the local coordinate system of the model instance is set to a preset value (e.g., X-axis offset along the extension direction of the extended boom is set to 60, Y and Z-axis offsets are zero). Finally, this mesh object is added as a child node to the model instance to compensate for the inability of a conventional bounding box to cover the blind spots of special equipment operations.
[0046] S6) Perform collision detection on model instances in the digital twin scenario, including: calculating the relative transformation matrix between two model instances, and using the bounding volume hierarchy to determine whether there is an intersection in the local coordinate system.
[0047] Reference Figure 4To accurately determine spatial interference, the relative transformation matrix between the first and second model instances in the scene needs to be calculated. Specifically, the world matrix of the first model instance is obtained and inverted to obtain the first inverse matrix; then, this first inverse matrix is multiplied by the world matrix of the second model instance. This operation essentially transforms the second model instance from the world coordinate system to the local coordinate system of the first model instance. Relying on this relative transformation matrix and the pre-built bounding volume hierarchy in S3, an efficient spatial intersection query operation is performed within the local coordinate system, thereby outputting an accurate collision detection result.
[0048] S7) In response to the detection of a collision, determine the model instance to be moved according to the preset selection rules, and apply displacement to the planar coordinates of the model instance in at least two directions to eliminate spatial overlap.
[0049] Reference Figure 4 When the collision detection result output by S6 is true, the automatic avoidance logic for anti-penetration is triggered. The preset planar coordinate system consists of a first coordinate axis (e.g., the X-axis) and a second coordinate axis (e.g., the Z-axis) that are perpendicular to each other. The position values of the two model instances that collided are obtained along the first coordinate axis in the planar coordinate system, and the model instance with the larger position value is determined as the model instance to be moved. A fixed-proportion coordinate correction is performed on the model instance to be moved, that is, the model instance is moved by a first preset value (e.g., 1.3 spatial units) along the positive direction of the first coordinate axis and by a second preset value (e.g., 1 spatial unit) along the positive direction of the second coordinate axis. By performing the above preset displacement operation, the instantaneous spatial stripping of collision overlap is achieved. If no collision is detected, the current coordinate state is maintained without avoidance, and the scene rendering update of this cycle is finally completed. The above embodiments are only further illustrations of the present invention and are not intended to limit the present invention in other ways. The present invention may have other various embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art can make various corresponding modifications and changes according to the present invention, but these corresponding modifications and changes should all fall within the protection scope of the present invention.
Claims
1. A method for correcting digital twin model loading optimization based on heterogeneous positioning data, characterized in that, include: S1) Acquire real-time positioning data of multiple target objects, wherein the real-time positioning data includes at least position information and attitude parameters; S2) Convert the location information from the geographic coordinate system to planar coordinates in a preset planar coordinate system; S3) Load the original 3D model corresponding to the target object type, and dynamically generate a model instance based on the planar coordinates and the posture parameters: clone the original 3D model to obtain model components, construct a bounding volume hierarchy for the geometry of the model components, and combine the model components into the model instance and place it in the digital twin scene; S4) Based on the preset site partition information, determine the partition to which the model instance currently belongs, and adjust the display orientation of the model instance in the scene according to the relationship between the motion direction reflected by the posture parameters and the reference orientation corresponding to the partition; S5) For at least one type of target object, attach at least one extended collision detection body to the corresponding model instance, wherein the spatial dimensions and offset of the extended collision detection body relative to the model origin are configured to cover the range of motion of the extended working parts of the target object. S6) Perform collision detection on model instances in the digital twin scenario, including: calculating the relative transformation matrix between two model instances, and using the bounding volume hierarchy to determine whether there is an intersection in the local coordinate system; S7) In response to the detection of a collision, determine the model instance to be moved according to the preset selection rules, and apply displacement to the planar coordinates of the model instance in at least two directions to eliminate spatial overlap.
2. The method of claim 1, wherein, The geographic coordinate system is the WGS-84 coordinate system, and the preset planar coordinate system is the Mercator projection coordinate system. By projecting latitude and longitude coordinates into two-dimensional planar coordinates and setting the height value as a constant, the multiple target objects are located on the same horizontal reference plane.
3. The method of claim 1, wherein, The process of determining the current partition to which the model instance belongs based on preset site partition information includes: Calculate the spatial distance between the current position of the model instance in the planar coordinate system and the coordinates of each preset partition, and select the partition with the smallest spatial distance as the partition to which the model instance belongs; The attitude parameters include the heading angle; adjusting the display orientation of the model instance in the scene based on the relationship between the motion direction reflected by the attitude parameters and the reference orientation corresponding to the partition includes: Obtain the preset reference orientation angle corresponding to the partition; The heading angle is compared with a preset angle range corresponding to different motion direction types to determine the motion direction type of the model instance, the motion direction type including a first type and a second type; When the motion direction type is the first type, the display orientation is set to the reference orientation angle; when the motion direction type is the second type, the display orientation is set to the reference orientation angle minus 180°.
4. The method of claim 1, wherein, The at least one type of target object is a floating crane; the addition of at least one extended collision detector to the corresponding model instance includes: Create a cuboid geometry as the extended collision detection body, the size of which corresponds to the working space range of the outrigger of the floating crane; A corresponding mesh object is generated based on the cuboid geometry, and the mesh object is configured to be invisible in the scene; Set the offset of the mesh object relative to the local coordinate system of the model instance, the offset being along the extension direction of the cantilever boom; Add the mesh object as a child node of the model instance.
5. The method according to claim 1, characterized in that, The calculation of the relative transformation matrix between the two model instances includes: Obtain the world matrix of the first model instance, and invert the world matrix of the first model instance to obtain the first inverse matrix; Obtain the world matrix of the second model instance; Multiply the first inverse matrix with the world matrix of the second model instance to obtain the relative transformation matrix of the second model instance relative to the local coordinate system of the first model instance.
6. The method of claim 1, wherein, The preset planar coordinate system consists of a first coordinate axis and a second coordinate axis that are perpendicular to each other. The preset selection rules include: Obtain the position values of the two model instances that collided along the first coordinate axis in the planar coordinate system; The model instance with the larger position value along the first coordinate axis among the two model instances is determined as the model instance to be moved; The displacement includes: moving the model instance to be moved along the positive direction of the first coordinate axis by a first preset value, and moving it along the positive direction of the second coordinate axis by a second preset value.
7. The method of claim 1, wherein, The process of cloning the original 3D model to obtain model components, constructing a bounding volume hierarchy for the geometry of the model components, and assembling the model components into the model instance includes: Traverse the sub-objects of the original 3D model and filter out the mesh objects; For each of the mesh objects, copy its geometry and construct a bounding volume hierarchy for the copied geometry; The material of the mesh object is copied, and a new mesh object is generated based on the copied geometry and the copied material, which serves as the model component; Add the generated model components to a newly created group, and use that group as the model instance.
8. The method of claim 1, wherein, The acquisition of real-time positioning data for multiple target objects includes: At preset time intervals, the real-time positioning data is periodically acquired from the data interface, and based on each acquired real-time positioning data, the position, orientation, and status of the model instance in the digital twin scene are dynamically updated.
9. A digital twin model loading optimization system based on heterogeneous positioning data correction, characterized in that, include: The data acquisition module is used to acquire real-time positioning data of multiple target objects, wherein the real-time positioning data includes at least position information and attitude parameters; The coordinate transformation module is used to convert the location information from a geographic coordinate system to planar coordinates in a preset planar coordinate system; The model generation module is used to load the original 3D model corresponding to the target object type, dynamically generate model instances based on the planar coordinates and the pose parameters, including cloning the original 3D model to obtain model components, constructing a bounding volume hierarchy for the geometry of the model components, and combining the model components into the model instance and placing it in the digital twin scene; The orientation correction module is used to determine the current partition to which the model instance belongs based on preset site partition information, and adjust the display orientation of the model instance in the scene according to the relationship between the motion direction reflected by the posture parameters and the reference orientation corresponding to the partition. The collision body extension module is used to attach at least one extended collision detection body to the corresponding model instance for at least one type of target object. The spatial dimensions and offset of the extended collision detection body relative to the model origin are configured to cover the range of motion of the extended working parts of the target object. The collision detection module is used to perform collision detection on model instances in a digital twin scenario, including calculating the relative transformation matrix between two model instances and using the bounding volume hierarchy to determine whether there is an intersection in the local coordinate system. The collision response module is used to respond to the detection of a collision, determine the model instance to be moved according to a preset selection rule, and apply displacement to the planar coordinates of the model instance in at least two directions to eliminate spatial overlap.