A construction method and system based on digital twin full-scenario

By improving the particle swarm optimization algorithm and the ICP algorithm, the problems of lag in dynamic updates and insufficient entity mapping accuracy in the construction of digital twin full-scenes were solved, realizing efficient and real-time construction of digital twin full-scenes, supporting real-time monitoring of production lines and high-precision fault diagnosis.

CN121121008BActive Publication Date: 2026-03-13SHANDONG THRESHOLD TECHNOLOGY DEVELOPMENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

The existing construction of digital twin full-scenario systems suffers from problems such as lagging dynamic updates of scenarios and insufficient accuracy of entity mapping, which makes it impossible to meet the needs of real-time monitoring and high-precision fault diagnosis of production lines.

Method used

An improved particle swarm optimization algorithm is used for dynamic scene updates, and an improved ICP algorithm is used for high-precision entity mapping. Multiple types of sensors are combined for data acquisition and preprocessing. 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 mapping 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, and meets the needs of real-time monitoring and high-precision fault diagnosis of production lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121121008B_ABST
    Figure CN121121008B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for constructing a full-scene digital twin, belonging to the field of digital twin technology, aiming to solve the problems of lagging dynamic scene updates and insufficient entity mapping accuracy in existing technologies. The method includes: collecting device status, environmental, and geometric data from multiple types of sensors; after preprocessing, dynamically optimizing update parameters using an improved particle swarm optimization algorithm to determine the priority and frequency of dynamic element updates, thus solving the update lag problem; registering geometric data with the digital twin model using an improved ICP algorithm, combining KD-tree indexing and M-estimation to improve accuracy; calculating the transformation matrix to complete high-precision mapping; and finally rendering and generating a visualized full scene. The system includes modules for data acquisition, preprocessing, dynamic updating, and high-precision mapping. This invention improves the real-time performance and accuracy of scenes, is suitable for fields such as intelligent manufacturing, reduces operation and maintenance costs, and facilitates industrial applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital twins, specifically to a method and system for constructing digital twins across all scenarios. Background Technology

[0002] In the process of building a full-scenario digital twin, especially for the full-scenario construction of production lines in the field of intelligent manufacturing, there are two key and specific problems that seriously affect the practicality and accuracy of the digital twin scenario.

[0003] The first problem is the lag in dynamic scene updates. Equipment in a production line (such as robotic arms and conveyor belts) is in continuous motion, and its position, posture, and working status change in real time. Existing digital twin scene update methods typically employ a fixed time interval update strategy, that is, updating all dynamic elements uniformly every certain period of time (e.g., 1 second). This approach has significant drawbacks: when the equipment moves quickly, the amount of equipment state change within the fixed time interval is large, leading to a significant deviation between the equipment state in the digital twin scene and the actual state of the physical equipment. For example, the robotic arm may have actually completed the grasping action, but in the digital twin scene, the robotic arm may still be in the position it was in before grasping, 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 equipment moves slowly, frequent fixed-interval updates cause data redundancy and waste of computing resources, increasing system operating costs.

[0004] The second problem is insufficient entity mapping accuracy. Equipment in production lines has complex geometries and may undergo slight deformations during long-term operation (such as minor dimensional changes due to wear on robotic arm joints). Existing digital twin entity mapping methods mostly employ the traditional ICP (Iterative Closest Point) algorithm for point cloud registration to map physical entities to digital twin models. However, the traditional ICP algorithm suffers a significant drop in registration accuracy when dealing with point cloud data containing noise and erroneous point pairs. In actual production line data acquisition, due to factors such as ambient light interference and sensor errors, the acquired 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 registered digital twin model and the physical entity. This fails to meet the entity mapping accuracy requirements of high-precision production scenarios (such as precision component assembly monitoring), thus affecting the accuracy of subsequent applications based on digital twin scenarios such as fault diagnosis and process optimization.

[0005] In the existing technology, there is no effective solution to the two specific problems of lagging dynamic updates and insufficient entity mapping accuracy in the above-mentioned scenarios. Therefore, there is an urgent need for a digital twin full-scene construction method and system that can achieve efficient dynamic scene updates and ensure high-precision entity mapping. Summary of the Invention

[0006] The purpose of this invention is to provide a construction method and system based on digital twin full-scenario, so as to solve the problems mentioned in the background art.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a method for constructing a full-scenario digital twin, comprising the following steps:

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

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

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

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

[0012] Preferably, the specific implementation logic of the dynamic scene update in step 2 is as follows:

[0013] 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 dimensions, 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 ;

[0014] 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 index, 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 errors of each dynamic element, with the weights set according to the importance of the dynamic element in the scene.

[0015] Step 2.3: Initialize particle position and velocity:

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

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

[0018] Step 2.4, Calculation of particle fitness value and recording of optimal position:

[0019] 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;

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

[0021] 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:

[0022] 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. The minimum fitness value of the current particle swarm is used. This strategy ensures that the inertial weight is large in the early stage of the iteration to enhance the global search capability, and that the inertial weight is small in the later stage of the iteration to improve the local convergence accuracy. At the same time, the fitness value deviation is fine-tuned to avoid particles getting stuck in local optima.

[0023] 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;

[0024] Particle position update: Based on the updated particle velocity, adjust the position of each particle using the following formula: ;

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

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

[0027] Preferably, the specific steps for constructing the particle fitness function in step 2.2 are as follows:

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

[0029] 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;

[0030] 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;

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

[0032] Preferably, the specific implementation logic of the high-precision entity mapping step in step 3 is as follows:

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

[0034] 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;

[0035] 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;

[0036] Step 3.3: Initialize the transformation matrix as the identity matrix and set the iteration threshold:

[0037] 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;

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

[0039] 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;

[0040] Step 3.5: Introduce the M-estimation method to construct a robust estimation function and remove erroneous point pairs from the initial point pairs:

[0041] 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;

[0042] Step 3.6: Calculate the optimal transformation matrix using the singular value decomposition method:

[0043] 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 ;

[0044] 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:

[0045] 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. ;

[0046] 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 3.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.

[0047] 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;

[0048] 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;

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

[0050] High-precision entity mapping module: Connected to the data preprocessing unit, it uses an improved ICP algorithm to register the geometric data of physical entities with the entity models in the digital twin model, thus completing high-precision mapping;

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

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

[0053] Preferably, the multi-type sensors include a temperature sensor, a humidity sensor, a vibration sensor, a laser scanner, and a camera, which are used to collect temperature data, humidity data, vibration data, geometric shape data, and appearance image data of the physical entity, respectively.

[0054] Compared with the prior art, the beneficial effects of the present invention are:

[0055] To address the lag in dynamic scene updates and improve real-time performance: Existing fixed-interval updates (e.g., 1 second / update) have a lag of 0.5-1 second. This invention improves the particle swarm optimization algorithm by dynamically adjusting the inertia weight through "iteration count + fitness value," automatically adapting to the device's motion state: the update frequency for high-speed moving devices such as robotic arms can be increased to 8Hz, reducing the lag to 0.1-0.2 seconds; the frequency for low-speed devices is reduced to 5Hz, reducing computational resource waste by 50%. Furthermore, the algorithm converges in just 100 iterations (compared to 150-200 iterations for traditional methods), reducing update errors by 40%-50%.

[0056] Breaking through the bottleneck of entity mapping accuracy and meeting high-precision requirements: The traditional ICP algorithm has a registration error of 5-10mm. This invention improves the ICP algorithm by introducing the M estimation method to remove 80% of noise points. Combined with KD tree indexing and point cloud downsampling, the mapping error is controlled within 0.5-1mm, and the accuracy 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 scenarios such as precision assembly monitoring and fault diagnosis.

[0057] Dual-algorithm collaboration and system adaptation expand application value: The dynamic update module and the high-precision mapping module work in a closed loop: the former provides high-quality point cloud data, while the latter provides accurate status feedback, resulting in comprehensive performance optimization. Modular system adaptability to fields such as intelligent manufacturing and smart cities eliminates the need for manual parameter debugging, lowering the technical threshold; efficient resource utilization and modular upgrade design reduce long-term operation and maintenance costs, facilitating industrialization and promotion. Attached Figure Description

[0058] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0059] Figure 2 This is a schematic diagram of the dynamic scene update process of the present invention;

[0060] Figure 3 This is a schematic diagram of the high-precision entity mapping process of the present invention;

[0061] Figure 4 This is a schematic diagram of the system structure of the present invention. Detailed Implementation

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

[0063] Example 1

[0064] Please see Figure 1-3 This invention provides a technical solution: a method for constructing a full-scenario digital twin, comprising the following steps:

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

[0066] Step 2, Dynamic Scene Update Step: Based on the preprocessed data, an improved particle swarm optimization algorithm is used to update and schedule dynamic elements in the digital twin scene, determining the update priority and frequency of each dynamic element to achieve dynamic scene updates; the specific implementation logic is as follows:

[0067] 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 dimensions, 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 ;

[0068] 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 index, 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 errors of each dynamic element, with the weights set according to the importance of the dynamic element in the scene.

[0069] Step 2.3: Initialize particle position and velocity:

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

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

[0072] The following is a further explanation of this step:

[0073] Based on the background of this invention, "Construction of a Full-Scenario Intelligent Manufacturing Production Line Based on Digital Twins," and the core objective of improving the particle swarm optimization algorithm to "optimize dynamic element update parameters" (particle position represents the combination of update parameters, and velocity represents the rate of parameter change), the specific implementation steps can be divided into three stages: "parameter definition - position initialization - velocity initialization." This ensures that the initialization results not only meet the scenario requirements but also lay the foundation for subsequent iterations.

[0074] Phase 1: Clarify the meaning of the update parameters corresponding to the particle position dimension

[0075] In the embodiments of the invention, determining "particle position dimension = 3" (corresponding to update frequency, update priority weight, and data sampling interval) requires further consideration of the characteristics of dynamic elements in the production line (robotic arm, conveyor belt) to define the physical meaning and function of each dimension parameter. This is a prerequisite for position initialization.

[0076] Dimension 1: Dynamic element update frequency ( )

[0077] Definition: The number of times the digital twin scene updates 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 consumption of computing resources.

[0078] The value selection logic for element differences is as follows: the robotic arm needs to be updated frequently (high precision is required for grasping action), and the basic value range is set to [5,10] Hz; the conveyor belt has lower update requirements (the workpiece transmission rhythm is relatively stable), and the basic value range is set to [2,7] Hz.

[0079] Dimension 2: Priority weight for dynamic element updates ( )

[0080] Definition: When system resources are limited, the priority of an element in the multi-element update queue (value range: [0,1]). The higher the weight, the more priority it has in obtaining computing resources.

[0081] The value selection logic for element differences is as follows: Robotic arm failure will directly lead to production interruption, and the priority weight base range is set to [0.7, 1.0]; conveyor belt failure has a relatively small impact, and the weight base range is set to [0.4, 0.8].

[0082] Dimension 3: Dynamic element data sampling interval ( )

[0083] Definition: The time interval (unit: s) at which the sensor collects physical data of an element, which is linked to the update frequency—the smaller the sampling interval, the more timely the data, but the heavier the burden on the sensor.

[0084] Regarding the value selection logic for element differences: the sampling interval of the robotic arm needs to match the update frequency (e.g., 8Hz update corresponds to 0.02-0.1s sampling), with the basic range set to [0.01, 0.08]s; the sampling interval of the conveyor belt can be slightly larger, with the basic range set to [0.03, 0.1]s.

[0085] Phase 2: Random initialization of particle positions (based on scene constraints)

[0086] The method of "interval random sampling + element adaptation adjustment" is used to generate initial positions for 50 particles (particle number = 50 in this example) (each particle corresponds to 1 set of robotic arm parameters + 1 set of conveyor belt parameters, for a total of 2 sets of position vectors), avoiding the iteration from getting trapped in local optima due to the concentration of initial parameters.

[0087] 1. Basic random sampling

[0088] For each particle's three-dimensional parameters, initial values ​​are generated using a uniform random distribution within the basic range of the corresponding elements, as shown in the formula: ,in The particles are numbered (1-50). For dynamic element types (1=robotic arm, 2=conveyor belt). For the location dimension (1=frequency, 2=weight, 3=sampling interval). For dimension The minimum value, The maximum value, The result is a uniformly random number in the interval [0, 1].

[0089] Example: Initializing the position of the robotic arm of particle 1 — (Frequency, such as 7.2Hz) (Weight, e.g., 0.85) (Sampling interval, e.g., 0.04s);

[0090] 2. Parameter linkage verification and adjustment

[0091] Because the "update frequency" and "sampling interval" are logically linked (the sampling interval must be ≤ 1 / update frequency, otherwise the data cannot support the update requirements), the initial position needs to be verified. If it does not meet the requirements, it needs to be adjusted.

[0092] Verification rules: If Then Adjusted to (Retain 20% redundancy to avoid data latency).

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

[0094] Phase 3: Random initialization of particle velocities (based on the range of position changes)

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

[0096] 1. Speed ​​range definition logic

[0097] 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):

[0098] 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).

[0099] Speed ​​2 ( (Corresponding priority weight): Weight range [0,1], speed range set to [-0.1,0.1] (±10%×1, to avoid sudden weight changes).

[0100] 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).

[0101] 2. Random velocity generation

[0102] 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).

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

[0104] Step 2.4, Calculation of particle fitness value and recording of optimal position:

[0105] 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;

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

[0107] The following is a detailed explanation of this step:

[0108] This process needs to revolve around four stages: "parameter activation - error acquisition - fitness calculation - optimal determination," to ensure that the results accurately reflect the quality of the updated parameters for each particle.

[0109] Step 1: Applying particle position parameters to the scene (parameter implementation)

[0110] The position of each particle represents a set of "dynamic element update parameter combinations" (e.g., robotic arm: update frequency 8Hz, priority weight 0.9, sampling interval 0.02s; conveyor belt: update frequency 5Hz, priority weight 0.7, sampling interval 0.05s). These parameters need to be imported into the digital twin system first to apply them to the scene update process, providing a "parameter activation environment" for error acquisition.

[0111] Parameter distribution: The particle position parameters are transmitted to the update control module of the digital twin scene through the system interface. The control module adjusts the update logic of dynamic elements according to the parameters. For example, for the "update frequency 8Hz" parameter of the robotic arm, the system triggers the robotic arm status update once every 0.125 seconds (1 / 8Hz); for the "priority weight 0.9" parameter, when the system needs to update both the robotic arm and the conveyor belt at the same time, the computing resources are allocated to the robotic arm first.

[0112] Data Synchronous Acquisition: Within 10 seconds of the parameters taking effect (ensuring coverage of multiple update cycles), two types of data are collected simultaneously:

[0113] Physical entity data: The joint angles and end-effector positions of the robotic arm, the running speed of the conveyor belt, and the position of the workpiece are collected by sensors (the sampling frequency is consistent with the "sampling interval" in the particle parameters, such as 0.02s / time for the robotic arm).

[0114] Digital twin scene data: Extract the status data of the robotic arm and conveyor belt at the corresponding time from the scene log (precisely aligned with the collection timestamp of the physical entity data, with an error of ≤1ms).

[0115] Data alignment verification: The collected physical and scene data are timestamped to remove misaligned data caused by transmission delays (e.g., physical data timestamp is 10:00:00.000, but scene data has no corresponding timestamp, so it is removed), ensuring that subsequent error calculations are based on data pairs from the same time. In this example, after the single particle parameter takes effect, an average of 1000 sets of valid data pairs are collected (80 sets for the robotic arm at 8Hz × 10s, and 50 sets for the conveyor belt at 5Hz × 10s, including multi-dimensional data).

[0116] Step 2: Calculation of state error based on Euclidean distance (error quantification)

[0117] Based on the definition in the invention that "the fitness function aims to minimize the error after the scene's dynamic element updates," Euclidean distance is used to calculate the single-element error and the overall scene error, quantifying the effect of particle parameter updates.

[0118] 1. Single dynamic element error calculation: Robotic arm error ( Select "Joint Angle Deviation" ( ) and "end position deviation" The two core dimensions are calculated using weighted Euclidean distance, as shown in the formula: ,in (Joint angle has a secondary impact on grasping accuracy). (The position of the end directly determines the success or failure of the grab). The difference between the scene and the physical robot arm joint angle (unit: degrees); This represents the 3D coordinate difference between the scene and the physical end-effector position (unit: mm, Euclidean distance).

[0119] Example: Deviation of the joint angle of the robotic arm at a certain moment End position deviation ,but ;

[0120] Conveyor belt error ( Select "Running speed deviation" ( ) and "workpiece position deviation" Both dimensions are calculated using weighted Euclidean distance, as shown in the formula: ,in (Speed ​​deviation has a relatively small impact on production rhythm) (Workpiece position deviation may lead to assembly misalignment); This represents the speed difference between the scene and the physical conveyor belt (unit: m / s). The difference in two-dimensional coordinates between the scene and the position of the workpiece on the physical conveyor belt (unit: mm);

[0121] 2. Comprehensive Error Calculation Across All Scenarios: Considering the difference in importance between the robotic arm and the conveyor belt in the production line, scenario weights are introduced ( This integrates single-element errors into a comprehensive error across the entire scenario. The formula is: ;

[0122] Following the example above, if the conveyor belt has an error... ,but .

[0123] Step 3: Fitness Value Calculation (Excellence / Demerit Evaluation)

[0124] According to the fitness function defined in the invention The overall error across the entire scenario is converted into a fitness value, realizing the evaluation logic that "the smaller the error, the larger the fitness value":

[0125] The fitness value range is: :when (When there is no theoretical error) ;when When it increases, Approaching 0;

[0126] Example calculation of the embodiment: If ,but If the other particle's ,but This indicates that the former has a better combination of update parameters.

[0127] Step 4: Recording Individual and Global Optimal Positions (Optimal Determination)

[0128] Based on the fitness value, the "individual optimal position" of each particle is determined. ) and the "global optimal position" of the entire particle swarm ( This provides direction for subsequent iterations and updates:

[0129] 1. Individual optimal position record (general logic for initial calculation and iterative update)

[0130] First calculation (number of iterations) Each particle has no historical fitness value; the current particle position is directly set as the individual's optimal position. , ( (Assign particle numbers) and store the corresponding fitness values. For example, particle 1's current position is (8Hz, 0.9, 0.02s). ,but , ;

[0131] During the iteration process ( ): Set the fitness value of the current particle best fitness value of historical individuals contrast:

[0132] like Update the individual's optimal position Update synchronously for the current particle position. ;

[0133] like Maintain the original and constant.

[0134] 2. Recording the global optimal position (general logic for initial calculation and iterative update)

[0135] First calculation ( ): The individual optimal fitness value of all particles Find the maximum value The corresponding particle position is the global optimal position. In this embodiment, after the initial calculation of 50 particles, Corresponding The value is (7Hz, 0.85, 0.03s).

[0136] During the iteration process ( ): After traversing all particles and updating , with the historical global optimal fitness value contrast:

[0137] If it exists :renew For this particle Synchronous updates ;

[0138] If it exists Maintain the original and constant.

[0139] 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:

[0140] 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. The minimum fitness value of the current particle swarm is used. This strategy ensures that the inertial weight is large in the early stage of the iteration to enhance the global search capability, and that the inertial weight is small in the later stage of the iteration to improve the local convergence accuracy. At the same time, the fitness value deviation is fine-tuned to avoid particles getting stuck in local optima.

[0141] 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;

[0142] Particle position update: Based on the updated particle velocity, adjust the position of each particle using the following formula: ;

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

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

[0145] The specific steps for constructing the particle fitness function in step 2.2 are as follows:

[0146] 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:

[0147] 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:

[0148] Error dimensions of robotic arms include "joint angle deviation" (the difference between the joint angle of the robotic arm in the digital twin scenario and the actual joint angle of the physical robotic arm, in degrees) and "end position deviation" (the coordinate deviation of the end effector of the robotic arm in three-dimensional space, in mm).

[0149] The error dimensions of the conveyor belt include "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, in m / s) and "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, in mm).

[0150] The system collects physical entity data in these dimensions in real time using sensors (such as the joint angle of the robotic arm being collected by an angle sensor and the speed of the conveyor belt being collected by a speed sensor), and records the corresponding data after the digital twin scene is updated, providing a data source for error calculation.

[0151] 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;

[0152] For example, at a certain moment, the position deviation of the robotic arm's end effector is... The joint angle deviation is 0.1 degrees. Then the single-element error of the robotic arm ;

[0153] 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;

[0154] Following the example in step 2.2.2, if the error of a single element of the conveyor belt is 0.12, then the overall error for the entire scenario is... ;

[0155] 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 refers to the overall error across all scenarios.

[0156] Following the example in step 2.2.3, Then the fitness value of the particle is... This indicates that the combination of update parameters (such as a robotic arm update frequency of 8Hz and a conveyor belt update frequency of 5Hz) can minimize scene errors and improve adaptability.

[0157] Step 3, High-Precision Entity Mapping Step: Using the improved ICP algorithm, the geometric data of the device from Step 1 is registered with the entity model in the digital twin model. The transformation matrix between the two is calculated to complete the high-precision mapping between the physical entity and the digital twin model. The specific implementation logic is as follows:

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

[0159] The following explains this step: Source point cloud: This is the geometric point cloud of the equipment. It is collected by a laser scanner from the geometric shape data of the production line equipment (such as robotic arms and conveyor belts). After the data preprocessing unit completes noise reduction (wavelet threshold noise reduction) and format conversion (PLY to XYZ), it is output. It contains the three-dimensional coordinate information of the equipment surface. The data volume is usually in the millions (such as the source point cloud of a conveyor belt, which has about 1 million points).

[0160] Target point cloud: This is the point cloud of the entity model of the digital twin model. It is exported from the model library of the digital twin system, built based on the equipment design drawings, and contains the standard geometric coordinate information of the equipment. The amount of data is slightly less than that of the source point cloud (such as about 800,000 points in the target point cloud of the conveyor belt). It is free from environmental noise interference, but it needs to be consistent with the coordinate system of the source point cloud (such as being unified with the global coordinate system of the production line).

[0161] To address the data redundancy issue between the source and target point clouds (e.g., the coordinate difference between adjacent points is less than 0.1 mm, or the same surface is repeatedly represented), a "voxel mesh downsampling" method is used to remove redundant data points.

[0162] Set the voxel grid size (0.5mm in this invention, depending on the device's accuracy requirements) to divide the point cloud space into several cubic voxels with a side length of 0.5mm.

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

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

[0165] 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;

[0166] 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;

[0167] Step 3.3: Initialize the transformation matrix as the identity matrix and set the iteration threshold:

[0168] 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;

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

[0170] 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;

[0171] Step 3.5: Introduce the M-estimation method to construct a robust estimation function and remove erroneous point pairs from the initial point pairs:

[0172] 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;

[0173] Step 3.6: Calculate the optimal transformation matrix using the singular value decomposition method:

[0174] 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 ;

[0175] 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:

[0176] 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. ;

[0177] 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 3.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.

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

[0179] Example 2

[0180] Please see Figure 4 A construction system based on digital twin full-scene includes: a data acquisition module: composed of multiple types of sensors, used to collect the state data, environmental data and geometric data of physical entities in real time, and transmit the collected data to the data preprocessing unit; the multiple types of sensors include temperature sensors, humidity sensors, vibration sensors, laser scanners and cameras, which are used to collect the temperature data, humidity data, vibration data, geometric shape data and appearance image data of physical entities, respectively.

[0181] 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;

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

[0183] High-precision entity mapping module: Connected to the data preprocessing unit, it uses an improved ICP algorithm to register the geometric data of physical entities with the entity models in the digital twin model, thus completing high-precision mapping;

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

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

[0186] In summary, the core improvements of this invention compared to existing particle swarm optimization (PSO) algorithms are as follows: Existing traditional PSO algorithms have two major limitations in the dynamic update scheduling of digital twin scenarios: First, the inertia weight is fixed, usually adopting a linear decreasing strategy (such as decreasing from 0.9 to 0.4), which cannot be flexibly adjusted according to the particle iteration state and actual scenario requirements, easily leading to slow convergence in the early stage and getting stuck in local optima in the later stage; Second, the fitness function is singular, mostly aiming at "minimizing the number of iterations" or "parameter range constraints", without combining the core requirement of "state error" of dynamic elements of digital twins, resulting in the optimization results being out of touch with the practicality of the scenario.

[0187] To address the aforementioned limitations, the improved particle swarm optimization algorithm of this invention makes two core improvements:

[0188] 1. Dynamic Inertia Weight Adjustment Strategy: Breaking through the traditional fixed pattern of linearly decreasing weights, a dual-dimensional adjustment mechanism of "iteration number + particle fitness value" is introduced. The weights can be dynamically fine-tuned according to the gap between the current particle and the optimal fitness of the population. When the particle fitness is close to the global optimum, the weights are slightly reduced to avoid excessive oscillations; when the particle fitness is poor, the weights are slightly increased to enhance the global search capability.

[0189] 2. Scenario-based fitness function design: Abandoning the generalized objective function, a fitness function is constructed with "minimizing the dynamic element update error of the digital twin" as its core: The Euclidean distance is used to calculate the state deviation between digital twin scene elements and physical entities. This function is directly related to the practicality of the scene, ensuring that the algorithm optimization goal is fully aligned with the core requirement of "reducing update lag".

[0190] The practical effects of the improvements:

[0191] Addressing the issue of lag in dynamic scene updates: Traditional fixed-time interval update strategies (e.g., 1 second / update) can have a lag time of 0.5-1 second. However, the improved particle swarm optimization algorithm can dynamically adjust the update frequency according to the movement state of the equipment. When the equipment, such as the robotic arm, moves quickly (with large changes in state), the update frequency is automatically increased to 8Hz, and the lag time is shortened to 0.1-0.2 seconds (e.g., in the embodiment, the update lag of the robotic arm is controlled within 0.15 seconds), meeting the needs of real-time monitoring and collaborative control of the production line. When the equipment moves slowly (with small changes in state), the update frequency is reduced to 5Hz, reducing the waste of computing resources.

[0192] Improve the convergence efficiency and stability of the algorithm: By adjusting the dynamic inertia weight, the algorithm can converge to the global optimum in 100 iterations (traditional PSO requires 150-200 iterations), and avoid the local optimum trap. In the embodiment, the final output update parameters of the particle swarm (such as the robotic arm sampling interval of 0.02s and the conveyor belt priority weight of 0.7) can achieve a balance between "minimum error and optimal resources".

[0193] The core improvement of this invention compared to the traditional ICP algorithm is as follows: The traditional ICP (Iterative Nearest Point) algorithm faces two major problems in digital twin entity mapping: First, interference from erroneous point pairs. Due to factors such as ambient light on the production line and sensor errors, the collected point cloud data contains noisy points (such as noise points generated by dust interference in laser scanners). Traditional ICP directly uses all point pairs to calculate the transformation matrix, which easily leads to a decrease in registration accuracy. Second, low matching efficiency. When searching for nearest neighbors in millions of point cloud data, a brute-force search method is used, and a single search can take several seconds, which cannot meet the requirements of real-time mapping.

[0194] The improved ICP algorithm of this invention addresses the above problems by making three key improvements:

[0195] Introduction of robust estimation function: The M-estimation method is used to construct a robust estimation function, which effectively removes erroneous point pairs;

[0196] KD-tree index accelerates matching: a balanced KD-tree index is constructed on the target point cloud (digital twin model point cloud) to improve the efficiency of the time complexity of nearest neighbor point search;

[0197] Point cloud downsampling preprocessing: Voxel mesh downsampling (voxel size 0.5mm) is adopted. While preserving the geometric features of the point cloud, the amount of source point cloud data is reduced from 1 million points to 100,000 points, and the amount of target point cloud data is reduced from 800,000 points to 80,000 points, reducing data redundancy. Compared with traditional ICP, the amount of data processing is reduced by 90%, and the number of iterations is reduced from 50 to 20, further improving the registration efficiency.

[0198] The practical effects of the improvements:

[0199] Addressing the issue of insufficient entity mapping accuracy: Traditional ICP can have a registration error of 5-10mm in noisy point cloud scenarios, which cannot meet the needs of precision component assembly monitoring; the improved ICP controls the positional error between the physical entity and the digital twin model within the range of 0.5-1mm through error point pair removal and downsampling optimization (e.g., the conveyor belt mapping error is 0.8mm in the example), improving accuracy by 80%-90%, and fully adapting to high-precision production scenarios.

[0200] Meeting real-time mapping requirements: The improved ICP algorithm reduces the registration time from the traditional 5-8 seconds to 1-1.5 seconds (including the entire process of downsampling, index building, and iterative calculation). Combined with the efficient scheduling of the dynamic scene update module, it can achieve end-to-end real-time response of "physical entity state change - digital twin model mapping update", providing accurate entity mapping data support for subsequent fault diagnosis and process optimization.

[0201] The two improved algorithms in this invention do not work independently, but rather form a collaborative closed loop of "dynamic update - high-precision mapping":

[0202] The dynamic scene update module provides "high-frequency, low-redundancy" point cloud data to the high-precision entity mapping module by improving the update parameters of PSO output (such as a sampling interval of 0.02s), thus avoiding mapping deviations caused by data sampling lag.

[0203] The high-precision entity mapping module provides "real and reliable" entity status feedback to the dynamic scene update module by improving the accurate transformation matrix output by ICP (error 0.5-1mm), ensuring the accuracy of the error calculation benchmark for update scheduling.

[0204] The synergistic effect of the two technologies simultaneously improves the "real-time performance" and "accuracy" of digital twins across all scenarios, effectively enhancing the overall performance of scenario construction compared to existing technical solutions.

[0205] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, 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 dimensions, 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 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 number + 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 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.

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, 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 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 3.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 a full-scene digital twin, applied to the construction method based on a full-scene digital twin 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, 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 to the data preprocessing unit, it uses an improved ICP algorithm to register the geometric data of physical entities with the entity models in the digital twin model, thus completing 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