Construction method and system based on digital twinborn full scene

By improving the particle swarm optimization (PSO) and integrated circuit (ICP) algorithms, dynamic and efficient updates and high-precision mapping of the entire digital twin scenario were achieved, solving the problems of lagging dynamic updates of the scenario and insufficient accuracy of entity mapping, and improving the real-time monitoring and fault diagnosis capabilities of the production line.

CN121121008AActive Publication Date: 2025-12-12SHANDONG THRESHOLD TECHNOLOGY DEVELOPMENT CO LTD

Patent Information

Application Number
CN202511280345.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2025-12-12
Estimated Expiration
2045-09-09

AI Technical Summary

Technical Problem

The construction of digital twins in a full-scenario environment suffers from problems such as lagging dynamic updates of the scenario and insufficient accuracy of entity mapping. This results in the inability to meet the needs of real-time monitoring and collaborative control of the production line, and serious waste of computing resources, failing to meet the application requirements of high-precision production scenarios.

Method used

An improved particle swarm optimization algorithm is used for dynamic scene updates, combined with an improved ICP algorithm for high-precision entity mapping. Data is collected in real time through multiple types of sensors. The improved particle swarm optimization algorithm is used to determine the update priority and frequency of dynamic elements, and the improved ICP algorithm is used for high-precision registration to generate a visualized digital twin full scene.

Benefits of technology

It enables efficient updates of dynamic scenarios, reduces waste of computing resources, improves real-time performance and accuracy, meets the monitoring and fault diagnosis needs of high-precision production lines, reduces errors, and improves the practicality and accuracy of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121121008A_ABST
    Figure CN121121008A_ABST
Patent Text Reader

Abstract

The invention discloses a construction method and system based on a digital twinning full scene, relates to the technical field of digital twinning, and aims to solve the problems of scene dynamic update lag and insufficient entity mapping precision in the prior art. The method comprises the steps that multiple types of sensors collect equipment state, environment and geometric data, after preprocessing, parameters are dynamically optimized and updated through an improved particle swarm optimization algorithm, the updating priority and frequency of dynamic elements are determined, and updating lagging is solved; geometric data and a digital twin model are registered by using an improved ICP algorithm, the precision is improved by combining a KD tree index and an M estimation method, and a transformation matrix is calculated to complete high-precision mapping; and finally, rendering to generate a visual full scene. The system comprises a data acquisition module, a preprocessing module, a dynamic updating module, a high-precision mapping module and the like. The real-time performance and accuracy of the scene are improved, the method is suitable for the fields of intelligent manufacturing and the like, the operation and maintenance cost is reduced, and industrial application is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of digital twin, in particular to a digital twin full-scene construction method and system. BACKGROUND

[0002] In the process of digital twin full-scene construction, especially for the production line full-scene construction in the field of intelligent manufacturing, there are two key and specific problems that seriously affect the practicality and accuracy of the digital twin scene. The first problem is the lag of scene dynamic update. The devices in the production line (such as mechanical arms, conveyors) are in a state of continuous motion, and their positions, postures and working states will change in real time. The existing digital twin scene update method usually adopts a fixed time interval update strategy, that is, all dynamic elements are updated uniformly every certain time (such as 1 second). This method has obvious defects: when the device moves at a high speed, the device state changes a lot within the fixed time interval, which will cause a significant deviation between the device state in the digital twin scene and the actual state of the physical device, for example, the mechanical arm has actually completed the grabbing action, but the mechanical arm in the digital twin scene is still in the position before grabbing, with a lag time of 0.5-1 second, which cannot meet the needs of real-time monitoring and collaborative control of the production line; when the device moves at a slow speed, frequent fixed interval updates will cause data redundancy and waste of computing resources, increasing the system operation cost. The second problem is the insufficient precision of entity mapping. The geometric shape of the devices in the production line is complex, and may be slightly deformed (such as slight changes in the size of the mechanical arm joints due to wear) during long-term operation. The existing digital twin entity mapping method usually uses the traditional ICP (Iterative Closest Point) algorithm for point cloud registration to realize the mapping between the physical entity and the digital twin model. However, the traditional ICP algorithm has a significant decline in registration accuracy when dealing with point cloud data with noise points and error points. In actual production line data collection, due to factors such as environmental light interference and sensor errors, the collected physical entity geometric data point cloud inevitably contains noise points. The traditional ICP algorithm cannot effectively remove the influence of these noise points, resulting in a positional error of 5-10 mm between the digital twin model after registration and the physical entity, which cannot meet the requirements of high-precision production scenes (such as precision part assembly monitoring) for entity mapping accuracy, and further affects the accuracy of subsequent applications based on the digital twin scene, such as fault diagnosis and process optimization. In the prior art, there is no effective solution to the two specific problems of scene dynamic update lag and insufficient entity mapping precision, therefore, there is an urgent need for a digital twin full-scene construction method and system that can realize efficient dynamic scene update and ensure high-precision entity mapping. SUMMARY

[0003] The present application aims to provide a digital twin full-scene construction method and system to solve the problems in the background art.

[0004] To achieve the above-mentioned purpose, the present application provides the following technical solution: a digital twin full-scene construction method, comprising the following steps: Step 1, data acquisition step: real-time acquisition of state data, environmental data and geometric data of the equipment by multiple types of sensors, and transmission of the acquired data to the data preprocessing unit for noise reduction, format conversion and data completion processing; Step 2, dynamic scene updating step: based on the preprocessed data, the improved particle swarm algorithm is used to update and schedule the dynamic elements in the digital twin scene, determine the update priority and update frequency of each dynamic element, and realize the dynamic update of the scene; Step 3, high-precision entity mapping step: using the improved ICP algorithm to register the geometric data of the equipment in step 1 and the entity model in the digital twin model, calculate the transformation matrix between the two, and complete the high-precision mapping of the physical entity and the digital twin model; Step 4, scene rendering step: importing the dynamically updated scene data and the high-precision mapped equipment data into the scene rendering engine, performing light rendering, texture mapping and special effect addition, and generating a visual digital twin full-scene.

[0005] Preferably, the dynamic scene updating of step 2 has the following specific implementation logic: Step 2.1, global parameter initialization of particle swarm: the global parameters include the total number of particles, the dimension of particle position, the maximum number of iterations, the initial range of inertia weight and the learning factor, the dimension of particle position is set to 3D, corresponding to the update frequency, update priority weight and data sampling interval of the dynamic element; the maximum inertia weight is set to and the minimum inertia weight is , which provides a basis for subsequent dynamic adjustment; the learning factor includes the individual learning factor and the global learning factor ; Step 2.2, construct a particle fitness function, the fitness function takes the minimization of the full-scene comprehensive state error of the updated dynamic elements in the digital twin scene as the goal, the state error is the deviation of the state data of the dynamic elements in the digital twin scene from the corresponding real-time state data of the physical entity; the fitness function maps the state error to a positive evaluation index, ensuring that the smaller the error, the larger the fitness value, and the formula is defined as where is the particle fitness value, The overall scene comprehensive state error is obtained by weighted summation of single-element errors of each dynamic element, and the weight is set according to the importance of the dynamic element in the scene; Step 2.3, initialization of particle position and velocity: Particle position initialization: each position dimension of the particle corresponds to a specific value of a set of dynamic element update parameters. According to the running characteristics of the dynamic elements in the digital twin scene and the system resource constraints, the preset value range of each dimension parameter is set. The initial position of each particle is generated by uniformly distributing in the value range, forming multiple sets of update parameter combinations to be optimized. Particle velocity initialization: the particle velocity corresponds to the change rate of the update parameter. According to the value range of each dimension position parameter, a reasonable range of velocity is set. The initial velocity of each particle is generated by uniformly distributing, providing an initial change trend for subsequent iterative updates. Step 2.4, calculation of particle fitness value and recording of optimal position: Fitness value calculation: for the initial position of each particle, the corresponding update parameter combination is imported into the digital twin scene update control module to drive the scene to complete a dynamic update. The state data of the updated scene dynamic elements and the real-time state data of the physical entity are collected, and the overall scene comprehensive state error is calculated The initial fitness value of each particle is obtained by substituting the fitness function. Optimal position recording: record the "individual optimal position" of each particle, that is, the position corresponding to the current fitness value of the particle, as the own goal of particle optimization in subsequent iterations. At the same time, the fitness values of all particles are traversed to determine the "global optimal position", that is, the position with the maximum fitness value among all particles, as the common optimization goal of the entire particle swarm. Step 2.5, iterative update of particle velocity and position: based on the iterative optimization logic of the particle swarm algorithm, combined with the dynamic inertia weight adjustment strategy, the velocity and position of each particle are updated, which includes: Dynamic inertia weight calculation: introduce a two-dimensional adjustment mechanism of "iteration number + particle fitness value". According to the current iteration progress and the deviation of the particle fitness value relative to the global optimal value, the inertia weight is dynamically adjusted, and the formula is: wherein is the current inertia weight, is the current iteration number, is the maximum iteration number, is the maximum fitness value of the current particle swarm, is the minimum fitness value of the current particle swarm; this strategy ensures that the inertia weight is larger in the early stage of iteration, enhancing the global search ability, and the inertia weight is smaller in the later stage of iteration, improving the local convergence precision. At the same time, the fitness value deviation is fine-tuned to avoid the particle falling into local optimum. Particle velocity update: Based on inertia weights, individual optimal positions, and global optimal positions, the velocity of each particle is adjusted using the particle swarm velocity update formula, which is as follows: ,in For the first During the nth iteration, the 1st The particle in the first The current velocity of the dimension; For the first During the nth iteration, the 1st The particle in the first The speed of the update after the dimension; For the first During the nth iteration, the 1st The particle in the first The current position of the dimension; For the first The particle in the first The optimal position of an individual in dimension. For the first The globally optimal position of dimension. and for Random numbers within the interval; Particle position update: Based on the updated particle velocity, adjust the position of each particle using the following formula: ; The current inertia weight is calculated using a two-dimensional dynamic inertia weight adjustment strategy that combines the number of iterations and the particle fitness value. Based on the inertia weight, the individual optimal position, and the global optimal position, the particle velocity and position are updated, and the updated particle position is checked for boundaries. Step 2.6: Repeat steps 2.4-2.5 until the maximum number of iterations is reached. Output the dynamic element update parameter combination corresponding to the globally optimal position. Apply this parameter combination to the dynamic update process of the digital twin scenario to complete the dynamic and efficient update of the scenario.

[0006] Preferably, the specific steps for constructing the particle fitness function in step 2.2 are as follows: Step 2.2.1: Clarify the core objects and dimensions of error calculation: First, determine the key elements that the device needs to update in Step 1. These key elements are pre-set, and determine the "state error dimension" of each element. The state error dimension directly reflects the deviation between the digital twin scene and the physical entity. Then, obtain the five-day entity preprocessing data of the state error dimension through Step 1, and record the corresponding data after the digital twin scene is updated to provide a data source for error calculation. Step 2.2.2: Define the single-element error calculation model: For each element in Step 2.2.1, calculate its single-element error using the "weighted Euclidean distance", as shown in the following formula: ,in This represents the update error for a single element. This represents the number of error dimensions for that element. For the first Weights for each error dimension, For this element in a digital twin scenario Updated data for each dimension For the physical entity, this element is the Real-time data collection across dimensions; Step 2.2.3: Construct a comprehensive error model for the entire scenario: Since the device updates multiple dynamic elements simultaneously, all single-element errors are integrated into a "comprehensive error for the entire scenario," which serves as the core input to the fitness function. The formula is as follows: ,in This represents the overall error after updating all dynamic elements across the entire scene. This represents the total number of elements that the device needs to dynamically update. For the first The scene weight of each element; For the first Single-element error of each element; Step 2.2.4: Design the fitness function: Since the particle swarm optimization algorithm needs to determine the quality of particles through the "fitness value," and the fitness value needs to be positively correlated with the objective of "minimizing the overall error," the fitness function is as follows: ,in This represents the fitness value of the particle. This represents the overall error across all scenarios.

[0007] Preferably, the specific implementation logic of the high-precision entity mapping step in step 3 is as follows: Step 3.1: Accept the preprocessed source point cloud and target point cloud of the equipment from Step 1, and perform voxel mesh downsampling processing; where the source point cloud is the geometric data point cloud of the equipment entity, which is collected by a laser scanner to obtain the geometric shape data of the production line equipment; the target point cloud is the entity model point cloud of the digital twin model, which is exported from the model library of the digital twin system, constructed based on the equipment design drawings, and contains the standard geometric coordinate information of the equipment. Step 3.2: Construct the KD-tree index structure of the target point cloud: Specifically, taking the target point cloud, i.e., the digital twin model point cloud, as the object, construct a balanced KD-tree: First, select the dimension with the largest variance in the target point cloud data as the splitting axis of the root node, and select the point corresponding to the median of this dimension as the root node; then recursively split the left subtree (i.e., points with coordinates less than the splitting axis of the root node) and the right subtree (i.e., points with coordinates greater than the splitting axis of the root node), and each split selects the dimension with the largest variance in the current subtree as the splitting axis until the number of target point clouds contained in the subtree is less than a preset threshold, forming a leaf node; Once constructed, the KD tree quickly locates the potential nearest neighbor region of the source point cloud data points in the target point cloud using "binary search", avoiding traversing all target points; Step 3.3: Initialize the transformation matrix as the identity matrix and set the iteration threshold: Specifically, based on the KD-tree index, an initial point pair correspondence is established between the source point cloud and the target point cloud to provide an initial benchmark for subsequent accurate registration: First, the transformation matrix is ​​initialized, set as identity matrix This indicates that the source point cloud and the target point cloud are in the same position in the initial state; Then, based on the high-precision requirements of the production line, an iteration threshold is set. That is, when the average distance difference between the point clouds in two iterations is less than the threshold, the registration is determined to be converged and the iteration is stopped. Step 3.4: Find the initial point pair correspondence between the source point cloud and the target point cloud based on the KD-tree index: For each data point in the source point cloud... , ,in Given the number of points in the source point cloud, use a KD-tree to find the nearest point in the target point cloud. , ,in Calculate the Euclidean distance between two points to represent the target point cloud number. ,Will As a set of initial point pairs, a total of Group initial point pair; Step 3.5: Introduce the M-estimation method to construct a robust estimation function and remove erroneous point pairs from the initial point pairs: First, we define a robust estimation function based on residuals. That is, the Euclidean distance between point pairs : ,in For the residual threshold, when When a pair of points is identified as a correct pair, the squared loss function is applied; when... When a pair of points is identified as an error, a linear loss function is applied; then the weight of each pair is calculated. ,in for The derivative, the correct point. Approaching 1, the error point is correct. Approaching 0; then filtering out correct point pairs: retaining weights. The point pairs (approximately 80% of the initial point pairs are retained in this invention, such as retaining 80,000 correct point pairs after screening 100,000 initial point pairs) are eliminated, and low-weight erroneous point pairs are removed to eliminate interference for subsequent accurate calculation of the transformation matrix; Step 3.6: Calculate the optimal transformation matrix using the singular value decomposition method: For the selected correct point pairs, the singular value decomposition method is used to calculate the optimal transformation matrix that minimizes the point cloud registration error. The specific steps are as follows: First, calculate the center points of the correct point pairs: ,in To ensure the correct number of points, the center point of the target point cloud is... Then calculate the covariance matrix. Subsequently, the covariance matrix was analyzed. Perform singular value decomposition: ,in and for Orthogonal matrix for A diagonal matrix with singular elements; finally, the rotation matrix is ​​calculated. Translation vector Then the optimal transformation matrix ; Step 3.7: Transform the source point cloud using the optimal transformation matrix: Specifically, transform the source point cloud based on the optimal transformation matrix and verify whether the registration error meets the iteration threshold. Specific steps are as follows: Source point cloud transformation: Transform all data points in the source point cloud Through the optimal transformation matrix Perform the transformation to obtain the transformed points. ; Calculate the registration error: Calculate the average distance between the source point cloud and the target point cloud after transformation. ; Convergence criterion: If If the value is less than the iteration threshold, the registration is considered converged, the iteration is stopped, and the current optimal transformation matrix is ​​output. ;like If the value is greater than the iteration threshold, then the transformed source point cloud will be... As the new source point cloud, return to step 4.4 and repeat the above registration process until the convergence condition is met, thus completing the high-precision mapping between the device and the digital twin model.

[0008] Preferably, a construction system based on a full-scenario digital twin includes: a data acquisition module composed of multiple types of sensors, used to collect real-time status data, environmental data and geometric data of physical entities, and transmit the collected data to a data preprocessing unit; Data preprocessing unit: Connected to the data acquisition module, it is used to perform noise reduction, format conversion, and data completion processing on the acquired data; Dynamic Scene Update Module: Connected to the data preprocessing unit, it uses an improved particle swarm optimization algorithm to update and schedule dynamic elements in the digital twin scene based on the preprocessed data, thereby achieving dynamic scene updates. High-precision entity mapping module: connected with the data preprocessing unit, an improved ICP algorithm is adopted, which is used for registering the geometric data of the physical entity and the entity model in the digital twin model, and completing high-precision mapping; Scene rendering module: connected with the dynamic scene updating module and the high-precision entity mapping module respectively, used for importing the dynamically updated scene data and the high-precision mapped entity data into a scene rendering engine to generate a visual digital twin full scene. Storage module: connected with the above-mentioned modules, used for storing the collected data, the preprocessed data, the updated scene data, the mapping data and the final full scene data.

[0009] Preferably, the multiple types of sensors include temperature sensors, humidity sensors, vibration sensors, laser scanners and cameras, which are respectively used for collecting temperature data, humidity data, vibration data, geometric shape data and appearance image data of the physical entity.

[0010] Compared with the prior art, the present application has the following advantages: Solve the scene dynamic updating lag and improve the real-time performance: the existing fixed interval updating (such as 1 second / time) lags by 0.5-1 second, the improved particle swarm algorithm of the present application dynamically adjusts the inertia weight through "iteration number + fitness value", and automatically adapts to the motion state of the device: the update frequency of high-speed motion devices such as mechanical arms can be increased to 8 Hz, and the lag is reduced to 0.1-0.2 second; the frequency of low-speed devices is reduced to 5 Hz, reducing 50% of the waste of computing resources. And the algorithm converges in 100 iterations (the traditional one needs 150-200 times), and the update error is reduced by 40%-50%.

[0011] Break through the entity mapping precision bottleneck and meet the high-precision demand: the registration error of the traditional ICP algorithm is 5-10 mm, the improved ICP algorithm of the present application introduces the M estimation method to remove 80% of the noise points, combines the KD tree index with the point cloud downsampling, and controls the mapping error to 0.5-1 mm, the precision is improved by 80%-90%; the registration time is reduced from 5-8 seconds to 1-1.5 seconds, realizing real-time mapping and supporting precise assembly monitoring, fault diagnosis and other scenes.

[0012] Dual-algorithm cooperation and system adaptation, expand application value: dynamic updating module and high-precision mapping module closed-loop cooperation: the former provides high-quality point cloud data, and the latter feedbacks accurate state, and the comprehensive performance is optimized. Modular system adaptation to intelligent manufacturing, smart city and other fields, without manual parameter adjustment, reducing the technical threshold; efficient use of resources and modular upgrade design, long-term operation and maintenance cost reduction, conducive to industrialization promotion. BRIEF DESCRIPTION OF DRAWINGS

[0013] Figure 1 The present application is a method flowchart; Figure 2 A dynamic scene updating flowchart of the present application; Figure 3 A high-precision entity mapping flowchart of the present application; Figure 4 A system structure schematic diagram of the present application. DETAILED DESCRIPTION

[0014] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0015] Embodiment 1 Please refer to Figures 1-3 The present application provides a technical solution: a construction method based on digital twin full scene, comprising the following steps: Step 1, data acquisition step: real-time acquisition of state data, environmental data and geometric data of the equipment by multiple types of sensors, and transmission of the collected data to the data preprocessing unit for noise reduction, format conversion and data completion processing; Step 2, dynamic scene updating step: based on the preprocessed data, the improved particle swarm algorithm is used to update and schedule the dynamic elements in the digital twin scene, to determine the update priority and update frequency of each dynamic element, and to realize the dynamic updating of the scene; the specific implementation logic is as follows: Step 2.1, global parameter initialization of particle swarm: the global parameters include the total number of particles, the dimension of particle position, the maximum number of iterations, the initial range of inertia weight and the learning factor, the dimension of particle position is set to 3D, corresponding to the update frequency, the update priority weight and the data sampling interval of the dynamic element; the maximum inertia weight of the initial range of inertia weight is set to , and the minimum inertia weight is , which provides a basis for subsequent dynamic adjustment; the learning factor includes the individual learning factor and the global learning factor . Step 2.2, construct the fitness function of the particle, the fitness function takes the minimization of the full scene comprehensive state error of the updated dynamic elements in the digital twin scene as the goal, the state error is the deviation of the state data of the dynamic elements in the digital twin scene from the corresponding real-time state data of the physical entity; the fitness function maps the state error to a positive evaluation index, ensuring that the smaller the error, the greater the fitness value, and the formula is defined as , wherein is the fitness value of the particle, The overall scene comprehensive state error is obtained by weighted summation of single-element errors of each dynamic element, and the weight is set according to the importance of the dynamic element in the scene; Step 2.3, initializing particle position and velocity: Particle position initialization: Each position dimension of the particle corresponds to a specific value of a set of dynamic element update parameters. According to the running characteristics of the dynamic elements in the digital twin scene and the system resource constraints, the preset value range of each dimension parameter is set. The initial position of each particle is generated by uniformly distributing in the value range, forming multiple sets of update parameter combinations to be optimized. Particle velocity initialization: The particle velocity corresponds to the change rate of the update parameter. According to the value range of each dimension position parameter, a reasonable range of velocity is set. The initial velocity of each particle is generated by uniformly distributing, providing an initial change trend for subsequent iteration update. The following further explains and describes this step: In combination with the background of the present application "intelligent manufacturing production line full scene construction based on digital twinning", and the core goal of improving the particle swarm optimization algorithm "optimizing dynamic element update parameters" (particle position represents update parameter combination, velocity represents parameter change rate), the specific implementation steps can be divided into "parameter definition-position initialization-velocity initialization" three stages, which ensures that the initialization result meets the scene requirements and lays a foundation for subsequent iteration: Stage 1: Define the meaning of the update parameter corresponding to the particle position dimension In the embodiment of the application, it is determined that "the particle position dimension=3" (corresponding to update frequency, update priority weight, data sampling interval), and the physical meaning and function of each dimension parameter need to be defined in combination with the characteristics of the production line dynamic elements (robot arm, conveyor belt), which is the premise of position initialization: Dimension 1: Dynamic element update frequency ( ) Definition: The number of updates of the digital twin scene to the dynamic element per unit time (unit: Hz), which directly affects the scene lag time - the higher the frequency, the smaller the lag, but the greater the calculation resource consumption. Value logic for element difference: The robot arm needs high-frequency update (high precision requirement for grabbing action), and the basic value range is set to [5, 10] Hz; the conveyor belt has lower update requirement (the workpiece transmission rhythm is relatively stable), and the basic value range is set to [2, 7] Hz. Dimension 2: Dynamic element update priority weight ( ) Definition: When the system resources are limited, the priority of the element in the multi-element update queue (value range: [0, 1]), the higher the weight, the more priority to obtain calculation resources. Value logic for element difference: Mechanical arm failure will directly lead to production interruption, priority weight basic range set to [0.7, 1.0]; conveyor belt failure has relatively small impact, weight basic range set to [0.4, 0.8]. Dimension 3: Dynamic element data sampling interval ( ) Definition: Time interval for sensor to collect physical data of this element (unit: s), linked with update frequency - the smaller the sampling interval, the stronger the data timeliness, but the heavier the sensor burden. Value logic for element difference: Mechanical arm sampling interval needs to match the update frequency (such as 8Hz update corresponding to 0.02-0.1s sampling), basic range set to [0.01, 0.08]s; conveyor belt sampling interval can be slightly larger, basic range set to [0.03, 0.1]s; Stage 2: Random initialization of particle position (based on scene constraints) "Interval random sampling + element adaptive adjustment" is adopted to generate initial positions for 50 particles (number of particles in the embodiment = 50) (each particle corresponds to 1 set of mechanical arm parameters + 1 set of conveyor belt parameters, a total of 2 position vectors), avoiding the initial parameter concentration leading to local optimal iteration: 1. Basic random sampling For the 3-dimensional parameters of each particle, within the basic value range of the corresponding element, the initial value is generated by uniform random distribution, the formula is: , where is the particle number (1-50), is the dynamic element type (1 = mechanical arm, 2 = conveyor belt), is the position dimension (1 = frequency, 2 = weight, 3 = sampling interval), is the minimum value of dimension , is the maximum value, is a uniform random number in the interval [0, 1].

[0016] Example: initialization of mechanical arm position of particle 1 - (frequency, such as 7.2Hz), (weight, such as 0.85), (sampling interval, such as 0.04s); 2. Parameter linkage verification and adjustment Since there is a logical linkage between "update frequency" and "sampling interval" (sampling interval needs to be ≤1 / update frequency, otherwise the data cannot support the update requirement), the initial position needs to be verified, and if it does not meet the requirements, it needs to be adjusted: Verification rule: if , then is adjusted to (Retain 20% redundancy to avoid data latency).

[0017] Example: If the initial frequency of the conveyor belt for particle 2 is... Sampling interval No adjustment is needed; if the frequency of particle 3's robotic arm... Sampling interval No adjustment is needed; if the frequency of particle 4's robotic arm... Sampling interval Then adjust to .

[0018] Phase 3: Random initialization of particle velocities (based on the range of position changes) Particle velocity represents the rate of change of position parameters in each iteration. A reasonable velocity range needs to be set in conjunction with the parameter characteristics of the position dimension to avoid either an initial velocity that is too large, causing parameter jumps (exceeding the physically meaningful range) or too small, resulting in slow iteration convergence. 1. Speed ​​range definition logic The velocity dimension corresponds one-to-one with the position dimension (3 velocity dimensions) The maximum velocity value for each dimension is set to 10%-20% of the corresponding position dimension's value range (to ensure that parameter changes are controllable in each iteration): Speed ​​1 ( (Corresponding update frequency): Robotic arm frequency range [5,10]Hz, speed range set to [-1,1]Hz (±20%×5Hz); conveyor belt frequency range [2,7]Hz, speed range set to [-0.7,0.7]Hz (±20%×3.5Hz). Speed ​​2 ( (Corresponding priority weight): Weight range [0,1], speed range set to [-0.1,0.1] (±10%×1, to avoid sudden weight changes). Speed ​​3 ( The corresponding sampling intervals are as follows: the robotic arm sampling interval is [0.01, 0.08] s, and the speed range is set to [-0.008, 0.008] s (±20%×0.04 s); the conveyor belt sampling interval is [0.03, 0.1] s, and the speed range is set to [-0.014, 0.014] s (±20%×0.07 s). 2. Random velocity generation The initial velocity is generated by uniformly and randomly distributing it within a velocity range, as shown in the formula: ,in For dimension The maximum speed (take a positive value).

[0019] Example: Initialization of the robotic arm velocity for particle 1 — (like 0.3 Hz), (like 0.05), (like 0.002 s).

[0020] Step 2.4, Particle Fitness Value Calculation and Optimal Position Recording: Fitness Value Calculation: For each particle's initial position, its corresponding update parameter combination is imported into the digital twin scene update control module, driving the scene to complete a dynamic update. The state data of the updated scene dynamic elements and the real-time state data of the physical entity are collected, and the overall scene comprehensive state error is calculated , and the initial fitness value of each particle is obtained by substituting the fitness function; Optimal Position Recording: Record the "individual optimal position" of each particle, i.e., the position corresponding to the current fitness value of the particle, as the particle's own optimization target in subsequent iterations. Meanwhile, traverse the fitness values of all particles to determine the "global optimal position", i.e., the position with the maximum fitness value among all particles, as the common optimization target of the entire particle swarm; The following is a detailed description of this step: This step needs to be carried out around the four links of "parameter taking effect - error collection - fitness calculation - optimal determination" to ensure that the results accurately reflect the pros and cons of the particle's corresponding update parameters: Link 1: Scene-based Effect of Particle Position Parameters (Parameter Landing) Each particle's position represents a set of "dynamic element update parameter combinations" (e.g., for the robot arm: update frequency 8 Hz, priority weight 0.9, sampling interval 0.02 s; for the conveyor belt: update frequency 5 Hz, priority weight 0.7, sampling interval 0.05 s). These parameters need to be imported into the digital twin system first, so that they can be applied to the scene update process and provide a "parameter effective environment" for error collection: Parameter Delivery: Transmit the particle position parameters to the digital twin scene update control module through the system interface. The control module adjusts the update logic of the dynamic elements according to the parameters - for example, for the "update frequency 8 Hz" parameter of the robot arm, the system triggers the robot arm state update every 0.125 seconds (1 / 8 Hz); for the "priority weight 0.9" parameter, when the system needs to update the robot arm and the conveyor belt simultaneously, the computing resources are preferentially allocated to the robot arm. Synchronous Data Collection: Within 10 seconds after the parameters take effect (to ensure coverage of multiple update cycles), collect the following two types of data: Physical Entity Data: Collect the joint angle and end position of the robot arm, the running speed and workpiece position of the conveyor belt through sensors (sampling frequency consistent with the "sampling interval" in the particle parameters, e.g., 0.02 s / once for the robot arm); Digital twin scene data: Extract the mechanical arm and conveyor state data at the corresponding time from the scene log (accurately aligned with the timestamp of the physical entity data collection, error ≤1 ms). Data alignment verification: Match the timestamps of the collected physical and scene data, eliminate misaligned data caused by transmission delay (such as physical data timestamp 10:00:00.000, scene data without corresponding timestamp is eliminated), and ensure that subsequent error calculation is based on "same time" data pairs. In the embodiment, after the single particle parameter takes effect, 1000 groups of valid data are collected on average (mechanical arm 8Hzx10s=80 groups, conveyor 5Hzx10s=50 groups, including multi-dimensional data).

[0021] Link 2: State error calculation based on Euclidean distance (error quantification) According to the definition of "error minimization of fitness function after updating scene dynamic elements" in the summary, the Euclidean distance is used to calculate the single element error and the overall scene error, and the update effect of the particle parameter is quantified: 1. Single dynamic element error calculation: Mechanical arm error ( ): Select "joint angle deviation" ( ) and "end position deviation" ( ) two core dimensions, use weighted Euclidean distance calculation, formula is: , wherein (joint angle has less impact on grabbing accuracy), (end position directly determines the success or failure of grabbing), is the difference between the scene and the physical mechanical arm joint angle (unit: degree); is the three-dimensional coordinate difference of the scene and the physical mechanical arm end position (unit: mm, take the Euclidean distance).

[0022] Example: At a certain time, the mechanical arm joint angle deviation , the end position deviation , then ; Conveyor error ( ): Select "running speed deviation" ( ) and "workpiece position deviation" ( ) two dimensions, also use weighted Euclidean distance calculation, formula is: , wherein (speed deviation has less impact on production rhythm), (workpiece position deviation may cause assembly misalignment); is the difference between the scene and the physical conveyor speed (unit: m / s), is the two-dimensional coordinate difference of the scene and the physical workpiece position on the conveyor (unit: mm). 2. Full-scene integrated error calculation: Considering the importance difference between the robot arm and the conveyor belt in the production line, introduce scene weight (w ), integrate single-element error into full-scene integrated error (E ), formula is: ; Based on the above example, if the conveyor belt error , .

[0023] Step 3: Fitness value calculation (evaluation of advantages and disadvantages) According to the fitness function defined in the invention , convert the full-scene integrated error into the fitness value, realize the evaluation logic of "the smaller the error, the larger the fitness value": The fitness value range is : when (theoretical error-free), the fitness value is 1; ; when increases, the fitness value tends to 0; Example calculation: if , then ; if the error of another particle is , then , which means that the former corresponds to a better parameter combination.

[0024] Step 4: Individual optimal and global optimal position recording (optimal determination) According to the size of the fitness value, determine the "individual optimal position" (P ) of each particle and the "global optimal position" (P ) of the entire particle swarm, provide direction for subsequent iteration update: 1. Individual optimal position recording (first calculation and iteration update general logic) First calculation (iteration number ): each particle has no historical fitness value, directly set the current particle position as the individual optimal position , (particle number), and store the corresponding fitness value . For example, the current position of particle 1 is (8Hz, 0.9, 0.02s), , ; ; ; In the iteration process (iteration number ): compare the current particle fitness value with the historical individual optimal fitness value : If​ : update individual optimal position for current particle position, update synchronously ; if : keep original unchanged.

[0025] 2. Global optimal position record (general logic for first calculation and iterative update) first calculation (: ): traverse all individual optimal fitness values of particles, find the maximum value , the corresponding particle position is the global optimal position . In the example, after the first calculation of 50 particles, , the corresponding is (7 Hz, 0.85, 0.03 s).

[0026] in the iteration process (: ): traverse all updated of particles and compare them with the historical global optimal fitness value : if there is : update to the of the particle, update synchronously ; if there is : keep original unchanged.

[0027] Step 2.5, iterative update of particle velocity and position: based on the iterative optimization logic of the particle swarm algorithm, combined with the dynamic inertia weight adjustment strategy, update the velocity and position of each particle, which specifically includes: dynamic inertia weight calculation: introduce a two-dimensional adjustment mechanism of "iteration number + particle fitness value", dynamically adjust the inertia weight according to the current iteration progress and the deviation of particle fitness value relative to the group optimal, the formula is: , where is the current inertia weight, is the current iteration number, is the maximum iteration number, is the maximum fitness value of the current particle swarm, is the minimum fitness value of the current particle swarm; this strategy ensures that the inertia weight is larger in the early iteration to enhance the global search ability, and smaller in the later iteration to improve the local convergence precision, while the fitness value deviation is fine-tuned to avoid the particle falling into local optimum; ​​​Particle velocity update: Based on inertia weights, individual optimal positions, and global optimal positions, the velocity of each particle is adjusted using the particle swarm velocity update formula, which is as follows: ,in For the first During the nth iteration, the 1st The particle in the first The current velocity of the dimension; For the first During the nth iteration, the 1st The particle in the first The speed of the update after the dimension; For the first During the nth iteration, the 1st The particle in the first The current position of the dimension; For the first The particle in the first The optimal position of an individual in dimension. For the first The globally optimal position of dimension. and for Random numbers within the interval; Particle position update: Based on the updated particle velocity, adjust the position of each particle using the following formula: ; The current inertia weight is calculated using a two-dimensional dynamic inertia weight adjustment strategy that combines the number of iterations and the particle fitness value. Based on the inertia weight, the individual optimal position, and the global optimal position, the particle velocity and position are updated, and the updated particle position is checked for boundaries. Step 2.6: Repeat steps 2.4-2.5 until the maximum number of iterations is reached. Output the dynamic element update parameter combination corresponding to the globally optimal position. Apply this parameter combination to the dynamic update process of the digital twin scenario to complete the dynamic and efficient update of the scenario.

[0028] The specific steps for constructing the particle fitness function in step 2.2 are as follows: Based on the "full-scenario construction of intelligent manufacturing production line based on digital twin" scenario (dynamic elements such as robotic arms and conveyor belts) in this invention, with the goal of "minimizing the error after updating the dynamic elements of the scenario", the specific implementation steps can be broken down into the following 5 steps to ensure that the function design is deeply bound to the actual scenario requirements: Step 2.2.1: First, identify the key elements in the production line that require dynamic updates (robotic arm, conveyor belt), and determine the "state error dimension" of each element—these dimensions directly reflect the deviation between the digital twin scenario and the physical entity, and are the basis for error calculation: Error dimensions of the robot arm: including "joint angle deviation" (the difference between the joint angle of the robot arm in the digital twin scene and the actual joint angle of the physical robot arm, unit: degree), "end position deviation" (the coordinate deviation of the end effector of the robot arm in three-dimensional space, unit: mm); Error dimensions of the conveyor belt: including "running speed deviation" (the difference between the speed of the conveyor belt in the digital twin scene and the actual speed of the physical conveyor belt, unit: m / s), "workpiece position deviation" (the difference between the coordinates of the workpiece on the conveyor belt in the scene and the actual coordinates of the physical workpiece, unit: mm); Real-time collection of physical entity data for these dimensions through sensors (such as collection of robot arm joint angle by angle sensor, collection of conveyor belt speed by speed sensor), while recording the updated corresponding data in the digital twin scene, providing data sources for error calculation; Step 2.2.2, define single-element error calculation model: for each element in step 2.2.1, use "weighted Euclidean distance" to calculate its single-element error, the formula is as follows: , where is the updated error of a single element; is the number of error dimensions of the element; is the weight of the th error dimension, is the updated data of the th dimension of the element in the digital twin scene, is the real-time collected data of the th dimension of the physical entity for this element; For example, at a certain moment, the end position deviation of the robot arm is , and the joint angle deviation is 0.1 degree , then the single-element error of the robot arm is ; Step 2.2.3, build a comprehensive error model for the whole scene: since the device updates multiple dynamic elements at the same time, integrate all single-element errors into "comprehensive error of the whole scene" as the core input of the fitness function, the formula is as follows: , where is the comprehensive error of the updated dynamic elements in the whole scene; is the total number of elements that need to be dynamically updated by the device; is the scene weight of the th element; is the single-element error of the th element; Following the example in step 2.2.2, if the single-element error of the conveyor belt is 0.12, then the comprehensive error of the whole scene is ; Step 2.2.4, design fitness function: since the particle swarm algorithm needs to judge the pros and cons of the particles through the "fitness value", and the fitness value needs to be positively correlated with the "minimum comprehensive error" target, that is, the fitness function is as follows: Wherein is the fitness value of the particle, is the overall scene comprehensive error; Based on the example of step 2.2.3, , the fitness value of the particle is , which indicates that the updated parameter combination (such as the mechanical arm update frequency 8Hz, the conveyor belt update frequency 5Hz) can make the scene error smaller, and the fitness is better.

[0029] Step 3, high-precision entity mapping step: using the improved ICP algorithm to register the geometric data of the equipment in step 1 and the entity model in the digital twin model, calculate the transformation matrix between the two, and complete the high-precision mapping of the physical entity and the digital twin model; The specific implementation logic is as follows: Step 3.1, accept the pre-processed source point cloud and cloud target point cloud of the equipment after step 1, and perform voxel grid downsampling processing; The source point cloud is the geometric data point cloud of the equipment entity, which is collected by the laser scanner to collect the geometric shape data of the production line equipment; The target point cloud is the entity model point cloud of the digital twin model, which is derived from the model library of the digital twin system, and is constructed based on the equipment design drawings, and contains the standard geometric coordinate information of the equipment; The following describes this step: source point cloud: that is, the geometric data point cloud of the equipment, which is collected by the laser scanner to collect the geometric shape data of the production line equipment (such as mechanical arm, conveyor belt), and is output after noise reduction (wavelet threshold denoising), format conversion (PLY to XYZ) by the data preprocessing unit, containing three-dimensional coordinate information of the equipment surface, usually with a data volume of millions (such as about 100 million points of conveyor belt source point cloud); Target point cloud: that is, the entity model point cloud of the digital twin model, which is derived from the model library of the digital twin system, and is constructed based on the equipment design drawings, and contains the standard geometric coordinate information of the equipment, with a data volume slightly lower than the source point cloud (such as about 800,000 points of conveyor belt target point cloud), without environmental noise interference, but needs to be consistent with the coordinate system of the source point cloud (such as unified into the global coordinate system of the production line); For the data redundancy problem of source point cloud and target point cloud (such as the coordinate difference of adjacent points is less than 0.1mm, which represents the same surface), the "voxel grid downsampling" method is used to remove redundant data points: Set the voxel grid size (according to the equipment accuracy requirement, set to 0.5mm in this invention), divide the point cloud space into several cubic voxels with edge length of 0.5mm; For all data points within each voxel, calculate the average of their three-dimensional coordinates, and use this average to represent the center point of the voxel, replacing the original multiple data points. After processing, the source point cloud data volume can be reduced from 1 million points to 100,000 points, and the target point cloud from 800,000 points to 80,000 points. While preserving the geometric features of the equipment (such as the joint curvature of the robotic arm and the edge contour of the conveyor belt), the amount of subsequent registration calculations is reduced, and the low registration efficiency caused by redundant data is avoided.

[0030] Step 3.2: Construct the KD-tree index structure of the target point cloud: Specifically, taking the target point cloud, i.e., the digital twin model point cloud, as the object, construct a balanced KD-tree: First, select the dimension with the largest variance in the target point cloud data as the splitting axis of the root node, and select the point corresponding to the median of this dimension as the root node; then recursively split the left subtree (i.e., points with coordinates less than the splitting axis of the root node) and the right subtree (i.e., points with coordinates greater than the splitting axis of the root node), and each split selects the dimension with the largest variance in the current subtree as the splitting axis until the number of target point clouds contained in the subtree is less than a preset threshold, forming a leaf node; Once constructed, the KD tree quickly locates the potential nearest neighbor region of the source point cloud data points in the target point cloud using "binary search", avoiding traversing all target points; Step 3.3: Initialize the transformation matrix as the identity matrix and set the iteration threshold: Specifically, based on the KD-tree index, an initial point pair correspondence is established between the source point cloud and the target point cloud to provide an initial benchmark for subsequent accurate registration: First, the transformation matrix is ​​initialized, set as identity matrix This indicates that the source point cloud and the target point cloud are in the same position in the initial state; Then, based on the high-precision requirements of the production line, an iteration threshold is set. That is, when the average distance difference between the point clouds in two iterations is less than the threshold, the registration is determined to be converged and the iteration is stopped. Step 3.4: Find the initial point pair correspondence between the source point cloud and the target point cloud based on the KD-tree index: For each data point in the source point cloud... , ,in Given the number of points in the source point cloud, use a KD-tree to find the nearest point in the target point cloud. , ,in Calculate the Euclidean distance between two points to represent the target point cloud number. ,Will As a set of initial point pairs, a total of Group initial point pair; Step 3.5: Introduce the M-estimation method to construct a robust estimation function and remove erroneous point pairs from the initial point pairs: First, a robust estimation function is defined, based on the residual. That is, the Euclidean distance between point pairs : ,in For the residual threshold, when When a pair of points is identified as a correct pair, the squared loss function is applied; when... When a pair of points is identified as an error, a linear loss function is applied; then the weight of each pair is calculated. ,in for The derivative, the correct point. Approaching 1, the error point is correct. Approaching 0; then filtering out correct point pairs: retaining weights. The point pairs (approximately 80% of the initial point pairs are retained in this invention, such as retaining 80,000 correct point pairs after screening 100,000 initial point pairs) are eliminated, and low-weight erroneous point pairs are removed to eliminate interference for subsequent accurate calculation of the transformation matrix; Step 3.6: Calculate the optimal transformation matrix using the singular value decomposition method: For the selected correct point pairs, the singular value decomposition method is used to calculate the optimal transformation matrix that minimizes the point cloud registration error. The specific steps are as follows: First, calculate the center points of the correct point pairs: ,in To ensure the correct number of points, the center point of the target point cloud is... Then calculate the covariance matrix. Subsequently, the covariance matrix was analyzed. Perform singular value decomposition: ,in and for Orthogonal matrix for A diagonal matrix with singular elements; finally, the rotation matrix is ​​calculated. Translation vector Then the optimal transformation matrix ; Step 3.7: Transform the source point cloud using the optimal transformation matrix: Specifically, transform the source point cloud based on the optimal transformation matrix and verify whether the registration error meets the iteration threshold. Specific steps are as follows: Source point cloud transformation: Transform all data points in the source point cloud Through the optimal transformation matrix Perform the transformation to obtain the transformed points. ; Calculate the registration error: Calculate the average distance between the source point cloud and the target point cloud after transformation. ; Convergence criterion: If If the value is less than the iteration threshold, the registration is considered converged, the iteration is stopped, and the current optimal transformation matrix is ​​output. ;like greater than the iteration threshold, the transformed source point cloud As a new source point cloud, return to step 4.4, repeat the above registration process until the convergence condition is met, and complete the high-precision mapping of the device and the digital twin model.

[0031] Step 4, scene rendering step: import the dynamically updated scene data and the high-precision mapped device data into the scene rendering engine, perform lighting rendering, texture mapping and special effect addition, and generate a visual digital twin full scene.

[0032] Embodiment 2 Please refer to Figure 4 A digital twin full scene construction system, comprising: a data acquisition module composed of multiple types of sensors for real-time acquisition of state data, environmental data and geometric data of physical entities, and transmission of the collected data to a data preprocessing unit; the multiple types of sensors include temperature sensors, humidity sensors, vibration sensors, laser scanners and cameras, which are used to collect temperature data, humidity data, vibration data, geometric shape data and appearance image data of physical entities, respectively.

[0033] A data preprocessing unit connected with the data acquisition module for noise reduction, format conversion and data completion processing of the collected data; A dynamic scene updating module connected with the data preprocessing unit, using an improved particle swarm algorithm, for updating and scheduling dynamic elements in the digital twin scene based on the preprocessed data, realizing dynamic scene updating; A high-precision entity mapping module connected with the data preprocessing unit, using an improved ICP algorithm, for registering the geometric data of the physical entity with the entity model in the digital twin model, and completing high-precision mapping; A scene rendering module connected with the dynamic scene updating module and the high-precision entity mapping module, for importing the dynamically updated scene data and the high-precision mapped entity data into the scene rendering engine to generate a visual digital twin full scene; A storage module connected with the above modules for storing the collected data, preprocessed data, updated scene data, mapping data and final full scene data.

[0034] The core improvements of the present application compared with the existing particle swarm algorithm are as follows: in the dynamic updating and scheduling of the digital twin scene, the existing traditional particle swarm algorithm (PSO) has two key limitations: one is that the inertia weight is fixed, usually adopting a linear decreasing strategy (such as from 0.9 to 0.4), which cannot be flexibly adjusted according to the particle iteration state and the actual scene demand, and is easy to cause slow convergence in the early stage and fall into local optimum in the later stage; the other is that the fitness function is single, usually taking "minimum iteration number" or "parameter range constraint" as the target, without combining the "state error" core demand of the digital twin dynamic element, resulting in the disconnection between the optimization result and the scene practicability. The improved particle swarm algorithm of the present application makes two core improvements aiming at the above limitations: 1. Dynamic inertia weight adjustment strategy: break through the fixed mode of traditional linear decreasing weight, introduce "iteration number + particle fitness value" two-dimensional adjustment mechanism, which can dynamically fine-tune the weight according to the difference between the current particle and the global optimal fitness value - when the particle fitness value is close to the global optimal value, the weight is slightly decreased to avoid excessive shock; when the particle fitness value is poor, the weight is slightly increased to enhance the global search ability. 2. Scene-based fitness function design: abandon the general target function, and construct a fitness function with "minimum updating error of digital twin dynamic element" as the core: For the state deviation of digital twin scene element and physical entity, the Euclidean distance is calculated. This function is directly related to the scene practicability, and ensures that the optimization target of the algorithm is completely aligned with the core demand of "reducing updating lag".

[0035] The actual effect brought by the improvement is: Solve the problem of scene dynamic updating lag: the lag time of traditional fixed time interval updating strategy (such as 1 second / time) can reach 0.5-1 second, while the improved particle swarm algorithm can dynamically adjust the updating frequency according to the motion state of the device - when the motion speed of the mechanical arm and other devices is fast (the state change is large), the updating frequency is automatically increased to 8 Hz, and the lag time is shortened to 0.1-0.2 second (such as the updating lag of the mechanical arm in the embodiment is controlled within 0.15 second), which meets the real-time monitoring and collaborative control demand of the production line; when the device moves slowly (the state changes little), the updating frequency is reduced to 5 Hz, reducing the waste of computing resources. Improve the convergence efficiency and stability of the algorithm: through dynamic inertia weight adjustment, the algorithm can converge to the global optimal solution within 100 iterations (the traditional PSO needs 150-200 iterations), and avoid local optimal trap - in the embodiment, the updating parameters output by the particle swarm (such as the sampling interval of the mechanical arm 0.02s, the priority weight of the conveyor belt 0.7) can realize the balance of "minimum error + optimal resource".

[0036] The core improvement of the present application compared with the traditional ICP algorithm: the traditional ICP (iterative closest point) algorithm in digital twin entity mapping faces two core problems: one is the interference of error points, due to factors such as production line environment light, sensor error, etc., the collected point cloud data contains noise points (such as the stray points generated by the laser scanner disturbed by dust), the traditional ICP directly uses all point pairs to calculate the transformation matrix, which easily leads to the decrease of registration accuracy; the second is the low matching efficiency, when searching for the nearest neighbor point of the million-level point cloud data, the brute force search method is adopted, and the time consumption of single search can reach several seconds, which cannot meet the real-time mapping requirements. The improved ICP algorithm of the present application makes three key improvements to solve the above problems: Robust estimation function is introduced: M estimation method is used to construct a robust estimation function, which effectively removes error points; KD tree index accelerates matching: a balanced KD tree index is constructed for the target point cloud (digital twin model point cloud), which improves the time complexity of the nearest neighbor point search efficiency; Point cloud downsampling preprocessing: voxel grid downsampling (voxel size 0.5mm) is adopted, which reduces the source point cloud data from 1 million points to 10 million points and the target point cloud from 80 million points to 8 million points under the premise of preserving the geometric features of the point cloud, reducing data redundancy - compared with the traditional ICP, the data processing amount is reduced by 90%, the iteration number is reduced from 50 times to 20 times, and the registration efficiency is further improved.

[0037] The actual effect brought by the improvement: Solve the problem of insufficient entity mapping accuracy: the registration error of traditional ICP in the presence of noise points can reach 5-10mm, which cannot meet the demand of precision parts assembly monitoring; the improved ICP removes error points and optimizes downsampling, which controls the position error of physical entity and digital twin model within 0.5-1mm (such as the mapping error of the conveyor belt in the embodiment is 0.8mm), the accuracy is improved by 80%-90%, which is fully suitable for high-precision production scenes. Meet the real-time mapping requirements: the registration time of the improved ICP algorithm is shortened from 5-8 seconds of the traditional method to 1-1.5 seconds (including the whole process of downsampling, index construction and iteration calculation), combined with the efficient scheduling of the dynamic scene update module, the end-to-end real-time response of "physical entity state change-digital twin model mapping update" can be realized, which provides accurate entity mapping data support for subsequent fault diagnosis and process optimization.

[0038] The two improved algorithms of the present application do not act independently, but form a synergistic closed loop of "dynamic update-high precision mapping": The dynamic scene update module provides "high frequency, low redundancy" point cloud data for the high-precision entity mapping module by improving the update parameters output by the improved PSO (such as sampling interval 0.02s), which avoids the mapping deviation caused by data sampling lag; The high-precision entity mapping module improves the accurate transformation matrix (error 0.5-1mm) output by ICP, provides "real and reliable" entity state feedback for the dynamic scene updating module, and ensures the accuracy of the error calculation benchmark of the updating scheduling. The two work together to simultaneously improve the "real-time" and "accuracy" of the digital twin full scene, and the comprehensive performance of scene construction can be effectively improved compared with the prior art.

[0039] Although embodiments of the present application have been shown and described, it is to be understood that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the present application, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for constructing a full-scenario digital twin, characterized in that, Includes the following steps: Step 1: Data Acquisition Step: Real-time acquisition of device status data, environmental data, and geometric data is performed using multiple types of sensors. The acquired data is then transmitted to the data preprocessing unit for noise reduction, format conversion, and data completion. Step 2, Dynamic Scene Update Step: Based on the preprocessed data, an improved particle swarm optimization algorithm is used to update and schedule the dynamic elements in the digital twin scene, determine the update priority and update frequency of each dynamic element, and realize the dynamic update of the scene. Step 3, High-precision entity mapping step: Use the improved ICP algorithm to register the geometric data of the device in Step 1 with the entity model in the digital twin model, calculate the transformation matrix between the two, and complete the high-precision mapping between the physical entity and the digital twin model. Step 4, Scene Rendering Step: Import the dynamically updated scene data and the high-precision mapped device data into the scene rendering engine, perform lighting rendering, texture mapping and special effects addition, and generate a visualized digital twin full scene.

2. The method for constructing a full-scenario digital twin according to claim 1, characterized in that: The specific implementation logic for the dynamic scene update in step 2 is as follows: Step 2.1, Particle Swarm Global Parameter Initialization: Global parameters include the total number of particles, particle position dimension, maximum number of iterations, initial range of inertia weight, and learning factor. The particle position dimension is set to 3-dimensional, corresponding to the update frequency, update priority weight, and data sampling interval of dynamic elements, respectively. The initial range of inertia weight is set to a maximum inertia weight of [value missing]. With minimum inertia weight This provides a basis for subsequent dynamic adjustments; The learning factors include individual learning factors. With global learning factor ; Step 2.2: Construct a particle fitness function. The fitness function aims to minimize the overall state error of the entire scene after the dynamic elements of the digital twin scene are updated. The state error is the deviation between the state data of the dynamic elements in the digital twin scene and the real-time state data of the corresponding physical entities. The fitness function maps the state error to a positive evaluation metric, ensuring that the smaller the error, the larger the fitness value. The formula is defined as follows: ,in This represents the particle fitness value. The overall state error for the entire scene is obtained by weighted summation of the individual element errors of each dynamic element, with the weights set according to the importance of the dynamic element in the scene. Step 2.3: Initialize particle position and velocity: Particle position initialization: Each position dimension of the particle corresponds to a specific value of a set of dynamic element update parameters. Based on the running characteristics of dynamic elements and system resource constraints in the digital twin scenario, a preset value range for each dimension parameter is set. The initial position of each particle is generated by uniformly and randomly distributing the parameters within the value range, forming multiple sets of update parameter combinations to be optimized. Particle velocity initialization: The particle velocity corresponds to the rate of change of the update parameters. A reasonable range of velocity is set according to the value range of the position parameters in each dimension. The initial velocity of each particle is generated by uniform random distribution to provide an initial trend of change for subsequent iterative updates. Step 2.4, Calculation of particle fitness value and recording of optimal position: Fitness value calculation: For the initial position of each particle, its corresponding update parameter combination is imported into the digital twin scene update control module to drive the scene to complete a dynamic update. After the update, the state data of the dynamic elements in the scene and the real-time state data of the physical entities are collected to calculate the comprehensive state error of the entire scene. Substitute these values ​​into the fitness function to obtain the initial fitness value for each particle; Optimal position recording: Record the "individual optimal position" of each particle, that is, the position corresponding to the current fitness value of the particle, which serves as the particle's own optimization target in subsequent iterations. At the same time, iterate through the fitness values ​​of all particles to determine the "global optimal position", that is, the position with the largest fitness value among all particles, which serves as the common optimization target of the entire particle swarm. Step 2.5: Iteratively update particle velocity and position: Based on the iterative optimization logic of the particle swarm optimization algorithm, combined with a dynamic inertia weight adjustment strategy, update the velocity and position of each particle, specifically including: Dynamic inertia weight calculation: A two-dimensional adjustment mechanism of "iteration count + particle fitness value" is introduced. The inertia weight is dynamically adjusted based on the deviation of the current iteration progress and the particle fitness value from the population optimum. The formula is as follows: ,in As the current inertia weight, This represents the current iteration number. The maximum number of iterations, This represents the maximum fitness value of the current particle swarm. This represents the minimum fitness value of the current particle swarm. Particle velocity update: Based on inertia weights, individual optimal positions, and global optimal positions, the velocity of each particle is adjusted using the particle swarm velocity update formula, which is as follows: ,in For the first During the nth iteration, the 1st The particle in the first The current velocity of the dimension; For the first During the nth iteration, the 1st The particle in the first The speed of the update after the dimension; For the first During the nth iteration, the 1st The particle in the first The current position of the dimension; For the first The particle in the first The optimal position of an individual in dimension. For the first The globally optimal position of dimension. and for Random numbers within the interval; Particle position update: Based on the updated particle velocity, adjust the position of each particle using the following formula: ; The current inertia weight is calculated using a two-dimensional dynamic inertia weight adjustment strategy that combines "iteration count + particle fitness value". Based on the inertia weight, the individual optimal position, and the global optimal position, the particle velocity and position are updated, and the updated particle position is checked for boundaries. Step 2.6: Repeat steps 2.4-2.5 until the maximum number of iterations is reached. Output the dynamic element update parameter combination corresponding to the globally optimal position. Apply this parameter combination to the dynamic update process of the digital twin scenario to complete the dynamic and efficient update of the scenario.

3. The method for constructing a full-scenario digital twin according to claim 2, characterized in that: The specific steps for constructing the particle fitness function in step 2.2 are as follows: Step 2.2.1: Clarify the core objects and dimensions of error calculation: First, determine the key elements that the device needs to update in Step 1. These key elements are pre-set, and determine the "state error dimension" of each element. The state error dimension directly reflects the deviation between the digital twin scene and the physical entity. Then, obtain the five-day entity preprocessing data of the state error dimension through Step 1, and record the corresponding data after the digital twin scene is updated to provide a data source for error calculation. Step 2.2.2: Define the single-element error calculation model: For each element in Step 2.2.1, calculate its single-element error using the "weighted Euclidean distance", as shown in the following formula: ,in This represents the update error for a single element. This represents the number of error dimensions for that element. For the first Weights for each error dimension, For this element in a digital twin scenario Updated data for dimensions For the physical entity, this element is the Real-time data collection across dimensions; Step 2.2.3: Construct a comprehensive error model for the entire scenario: Since the device updates multiple dynamic elements simultaneously, all single-element errors are integrated into a "comprehensive error for the entire scenario," which serves as the core input to the fitness function. The formula is as follows: ,in This represents the overall error after updating all dynamic elements across the entire scene. This represents the total number of elements that the device needs to dynamically update. For the first The scene weight of each element; For the first Single-element error of each element; Step 2.2.4: Design the fitness function: Since the particle swarm optimization algorithm needs to determine the quality of particles through the "fitness value," and the fitness value needs to be positively correlated with the objective of "minimizing the overall error," the fitness function is as follows: ,in This represents the fitness value of the particle. This represents the overall error across all scenarios.

4. The method for constructing a full-scenario digital twin according to claim 1, characterized in that: The specific implementation logic of the high-precision entity mapping step in step 3 is as follows: Step 3.1: Receive the preprocessed source point cloud and target point cloud from the equipment in Step 1, and perform voxel mesh downsampling processing; where the source point cloud is the geometric data point cloud of the equipment entity, which is collected by a laser scanner to obtain the geometric shape data of the production line equipment; The target point cloud is the point cloud of the entity model of the digital twin model, which is exported from the model library of the digital twin system, constructed based on the equipment design drawings, and contains the standard geometric coordinate information of the equipment; Step 3.2: Construct the KD-tree index structure of the target point cloud: Specifically, taking the target point cloud, i.e., the digital twin model point cloud, as the object, construct a balanced KD-tree: First, select the dimension with the largest variance in the target point cloud data as the splitting axis of the root node, and select the point corresponding to the median of this dimension as the root node; then recursively split the left subtree (i.e., points with coordinates less than the splitting axis of the root node) and the right subtree (i.e., points with coordinates greater than the splitting axis of the root node), and each split selects the dimension with the largest variance in the current subtree as the splitting axis until the number of target point clouds contained in the subtree is less than a preset threshold, forming a leaf node; Once constructed, the KD tree quickly locates the potential nearest neighbor region of the source point cloud data points in the target point cloud using "binary search", avoiding traversing all target points; Step 3.3: Initialize the transformation matrix as the identity matrix and set the iteration threshold: Specifically, based on the KD-tree index, an initial point pair correspondence is established between the source point cloud and the target point cloud to provide an initial benchmark for subsequent accurate registration: First, the transformation matrix is ​​initialized, set as identity matrix This indicates that the source point cloud and the target point cloud are in the same position in the initial state; Then, based on the high-precision requirements of the production line, an iteration threshold is set. That is, when the average distance difference between the point clouds in two iterations is less than the threshold, the registration is determined to be converged and the iteration is stopped. Step 3.4: Find the initial point pair correspondence between the source point cloud and the target point cloud based on the KD-tree index: For each data point in the source point cloud... , ,in Given the number of points in the source point cloud, use a KD-tree to find the nearest point in the target point cloud. , ,in Calculate the Euclidean distance between two points to represent the target point cloud number. ,Will As a set of initial point pairs, a total of Group initial point pair; Step 3.5: Introduce the M-estimation method to construct a robust estimation function and remove erroneous point pairs from the initial point pairs: First, a robust estimation function is defined, based on the residual. That is, the Euclidean distance between point pairs : ,in For the residual threshold, when When a pair of points is identified as a correct pair, the squared loss function is applied; when... When a pair of points is identified as an error, a linear loss function is applied; then the weight of each pair is calculated. ,in for The derivative, the correct point. Approaching 1, the error point is correct. Approaching 0; then filtering out correct point pairs: retaining weights. The point pairs are eliminated by removing low-weight erroneous point pairs to remove interference for subsequent accurate calculation of the transformation matrix; Step 3.6: Calculate the optimal transformation matrix using the singular value decomposition method: For the selected correct point pairs, the singular value decomposition method is used to calculate the optimal transformation matrix that minimizes the point cloud registration error. The specific steps are as follows: First, calculate the center points of the correct point pairs: ,in To ensure the correct number of points, the center point of the target point cloud is... Then calculate the covariance matrix. Subsequently, the covariance matrix was analyzed. Perform singular value decomposition: ,in and for Orthogonal matrix for A diagonal matrix with singular elements; finally, the rotation matrix is ​​calculated. Translation vector Then the optimal transformation matrix ; Step 3.7: Transform the source point cloud using the optimal transformation matrix: Specifically, transform the source point cloud based on the optimal transformation matrix and verify whether the registration error meets the iteration threshold. Specific steps are as follows: Source point cloud transformation: Transform all data points in the source point cloud Through the optimal transformation matrix Perform the transformation to obtain the transformed points. ; Calculate the registration error: Calculate the average distance between the source point cloud and the target point cloud after transformation. ; Convergence criterion: If If the value is less than the iteration threshold, the registration is considered converged, the iteration is stopped, and the current optimal transformation matrix is ​​output. ;like If the value is greater than the iteration threshold, then the transformed source point cloud will be... As the new source point cloud, return to step 4.4 and repeat the above registration process until the convergence condition is met, thus completing the high-precision mapping between the device and the digital twin model.

5. A construction system based on digital twin full-scenario as described in any one of claims 1-4, characterized in that, include: Data acquisition module: Composed of multiple types of sensors, used to collect real-time status data, environmental data and geometric data of physical entities, and transmit the collected data to the data preprocessing unit; Data preprocessing unit: Connected to the data acquisition module, it is used to perform noise reduction, format conversion, and data completion processing on the acquired data; Dynamic scene update module: connected to the data preprocessing unit, using the improved particle swarm algorithm as described in claim 2, used to update and schedule dynamic elements in the digital twin scene based on the preprocessed data, so as to realize dynamic scene update; High-precision entity mapping module: connected to the data preprocessing unit, using the improved ICP algorithm described in claim 3, to register the geometric data of the physical entity with the entity model in the digital twin model, and complete the high-precision mapping; Scene rendering module: It is connected to the dynamic scene update module and the high-precision entity mapping module respectively. It is used to import the dynamically updated scene data and the high-precision mapped entity data into the scene rendering engine to generate a visualized digital twin full scene. Storage module: Connected to the above modules, it is used to store the collected data, preprocessed data, updated scene data, mapping data, and the final full scene data.

6. The construction system based on digital twin full-scenario as described in claim 5, characterized in that: The various types of sensors include temperature sensors, humidity sensors, vibration sensors, laser scanners, and cameras, which are used to collect temperature data, humidity data, vibration data, geometric shape data, and appearance image data of physical entities, respectively.

Citation Information

Patent Citations

  • Orchard two-dimensional environment map accurate construction method and system based on improved Gmapping

    CN116203586A

  • Digital twin scene multi-level updating method and device based on explicit-implicit fusion model

    CN117611776A

  • Digital twin city construction and operation optimization method based on cloud computing and big data technology

    CN119129085A

  • Roof photovoltaic intelligent monitoring system based on BAPV and dynamic tuning method and device

    CN120074377A

  • Virtual power plant multi-level collaborative optimization control method based on digital twinning

    CN120150262A

Cited By

  • Building construction site comprehensive intelligent management method and system and storage medium

    CN121998243A

  • Construction site comprehensive intelligent management method and system, and storage medium

    CN121998243B