Simulation model construction method and system
By converting electrical control logic into a mixed-integer nonlinear programming problem and combining it with tensor network decomposition and hierarchical optimization strategies, the problem of separation between logical control and physical field modeling in traditional methods is solved, and efficient and accurate simulation of industrial equipment is achieved.
Patent Information
- Application Number
- CN202510765275.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-06-10
AI Technical Summary
In traditional industrial equipment simulation methods, the separation of logical control and physical field modeling leads to insufficient simulation accuracy, making it difficult to achieve deep integration of discrete decision-making and continuous dynamics, limiting the credibility of simulation results and optimization efficiency.
The electrical control logic is converted into a mixed-integer nonlinear programming problem, physical field modeling is performed based on the tensor network decomposition algorithm, hierarchical optimization strategy and heterogeneous computing system are used for parameter optimization, and model parameters are adjusted in real time to improve simulation accuracy.
It has achieved a deep integration of logical control and physical fields, improved simulation accuracy in complex industrial scenarios, broken through the exponential growth of computing power, shortened the model training cycle, and improved computing efficiency.
Smart Images

Figure CN120277926B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent simulation of industrial equipment, and in particular to a simulation model construction method and system. Background Art
[0002] In the field of industrial equipment simulation, traditional methods typically treat electrical control logic and physical field modeling as independent modules. For control logic analysis, existing technologies often use finite state machines or discrete event models, which can only describe Boolean logic behaviors such as device on / off state transitions. Physical field simulation, on the other hand, relies on the discretization or gridding of partial differential equations, focusing on the numerical solution of continuous variables such as temperature and stress. This separate modeling approach weakens the interaction between logical control instructions and the dynamic response of the physical field, making it difficult to accurately characterize the real-time impact of control decisions on the evolution of the physical field.
[0003] Especially in complex industrial scenarios, equipment operation often involves multi-mode switching (such as startup, steady-state, and shutdown), and the physical field equations corresponding to different control states vary significantly. Traditional methods require constructing a separate physical field model for each control mode and triggering model switching through external signals. This not only introduces artificial model splicing errors, but also causes simulation results to deviate from actual operating conditions by ignoring the coupling relationship between control variables and physical parameters. In addition, during the parameter optimization process, the separation of discrete control logic and continuous physical fields makes joint optimization difficult to implement, often requiring step-by-step iteration of the two types of variables, which greatly limits optimization efficiency and accuracy.
[0004] These issues severely limit the application value of industrial simulation models in scenarios such as real-time control and fault prediction. Therefore, there is an urgent need for a joint modeling approach that can unify description logic control and physical field behavior, achieve a deep integration of discrete decision-making and continuous dynamics, and thus enhance the simulation credibility and optimization capabilities of complex industrial systems. Summary of the Invention
[0005] The purpose of the present invention is to provide a simulation model construction method and system, which solves the problem of insufficient simulation accuracy caused by the separation of logical control and physical field modeling in the prior art.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: A simulation model construction method includes the following steps:
[0007] Step 1: Analyze the electrical control logic of industrial equipment and convert it into a mixed integer nonlinear programming problem containing discrete Boolean variables and continuous variables;
[0008] Step 2: Model the physical field based on the tensor network decomposition algorithm to generate a compressed low-rank tensor network model;
[0009] Step 3: Dynamically adjust the parameters of the tensor network model using a hierarchical optimization strategy, wherein the hierarchical optimization strategy switches between global search and local optimization algorithms according to the error convergence state;
[0010] Step 4: Allocate and execute symbolic computation, tensor network operations, and parameter optimization tasks through heterogeneous computing systems;
[0011] Step 5: Collect production line sensor data in real time, calculate the error between the simulation model output and the real data, and trigger parameter re-optimization based on the error threshold.
[0012] Preferably, the generation of the mixed integer nonlinear programming problem includes:
[0013] Extract conditional branches, loop structures, and state jump instructions from control programs to generate discrete Boolean variable sets ;
[0014] Equipment physical parameters as continuous variables , and impose constraints ;
[0015] The objective function of the mixed integer nonlinear programming problem is:
[0016] ;
[0017] in: For Boolean variables associated continuous functions;
[0018] To depend only on continuous variables function.
[0019] Preferably, the modeling of the physical field based on the tensor network decomposition algorithm includes:
[0020] Modeling the physical field as an N-th order tensor , where each dimension corresponds to a spatial or temporal discretization parameter of the physical field;
[0021] Perform tensor chain decomposition on the N-order tensor to obtain the core tensor chain , where each core tensor The rank of , and satisfy .
[0022] Preferably, generating the compressed low-rank tensor network model includes constructing a hybrid tensor structure:
[0023] Discretize Boolean variables The core tensor after embedding the tensor chain decomposition as an additional dimension;
[0024] Construct Boolean logic associated core tensor , whose dimensions are associated with Boolean variable states and compressed dimensions ;
[0025] Constructing core tensors associated with continuous physical fields , whose dimensions are associated with the compressed dimensions Parameters related to the spatial or temporal discretization of the physical field;
[0026] Generate a mixed tensor model through tensor contraction operations:
[0027] ;
[0028] in: is a discrete Boolean variable;
[0029] is the discretized grid index of the physical field;
[0030] is the compressed dimension index;
[0031] is the size of the compressed dimension.
[0032] Preferably, the hierarchical optimization strategy includes:
[0033] When the error function The rate of decline When , it switches from the global search algorithm to the local gradient optimization algorithm;
[0034] The global search algorithm traverses the parameter space to generate a set of candidate solutions;
[0035] The local gradient optimization algorithm is based on the partial derivatives of the error function Update parameters ;
[0036] Dynamically adjust the learning rate for local optimization ,satisfy:
[0037] ;
[0038] in: is the parameter to be optimized of the tensor network model;
[0039] is the error function between the simulation output and the target data;
[0040] is the initial learning rate;
[0041] is the preset error reduction rate threshold.
[0042] Preferably, allocating and executing tasks through heterogeneous computing systems includes:
[0043] According to parameter sensitivity Hardware queue waiting time Calculate task priority:
[0044] ;
[0045] Assign parameter optimization tasks with a priority higher than the set threshold to the GPU accelerator card for execution;
[0046] Assign parameter optimization tasks with a priority lower than the set threshold to the CPU cluster for execution;
[0047] in: is the first Parameters to be optimized;
[0048] is the error function between the simulation output and the target data;
[0049] The estimated waiting time of the current queue for hardware resources.
[0050] Preferably, executing tensor network operations in the heterogeneous computing system includes:
[0051] The core tensor after decomposing the tensor chain Load into GPU memory;
[0052] Perform tensor contraction operations based on the mixed tensor structure:
[0053] ;
[0054] The sum of each dimension in the tensor contraction operation is calculated in parallel by using a CUDA kernel function;
[0055] in: is the kth core tensor obtained by decomposition;
[0056] The Boolean logic association core for the construction;
[0057] is the discretized grid index of the k-th dimension of the physical field;
[0058] is the compression dimension index between adjacent core tensors.
[0059] Preferably, the error between the calculation simulation model output and the real data includes:
[0060] Real-time collection of production line sensor time series data, recorded as real data set ;
[0061] Get the output of the simulation model at the corresponding time step, recorded as the simulation data set ;
[0062] Calculate the mean squared error:
[0063] ;
[0064] when Parameter re-optimization is triggered when
[0065] in: For the Sensor measurements at time steps;
[0066] For the simulation model The output value of each time step;
[0067] It is the error tolerance threshold set according to the equipment process requirements.
[0068] Preferably, triggering parameter re-optimization according to the error threshold includes:
[0069] When continuous The mean square error of the time steps When , it is determined that the system parameters are mismatched;
[0070] Dynamically adjust the threshold based on the degree of mismatch ;
[0071] The conditions for triggering parameter re-optimization are updated as follows:
[0072] ;
[0073] in: is the length of the set time window;
[0074] For the The mean square error of the time steps;
[0075] is the error threshold after dynamic adjustment;
[0076] is the initial error threshold.
[0077] The present invention also provides a simulation model construction system, comprising:
[0078] Logic parsing module, used to convert electrical control logic into mixed integer nonlinear programming problems;
[0079] A tensor modeling module that performs tensor network decomposition and generates hybrid tensor structures;
[0080] Optimization decision module, used to implement hierarchical optimization strategies and dynamically adjust parameters;
[0081] Heterogeneous scheduling module, used to allocate computing tasks to CPU and GPU hardware resources;
[0082] Verification feedback module, used to collect production line data and trigger parameter re-optimization.
[0083] In summary, the present invention includes at least one of the following beneficial technical effects:
[0084] 1. This invention solves the traditional disconnect between logic control and physical field modeling by transforming electrical control logic into a mixed-integer nonlinear programming problem and deeply integrating discrete Boolean variables with continuous physical field variables within the mathematical model. Dynamically activating different physical field sub-models through Boolean variables significantly improves the accuracy of co-simulation in complex industrial scenarios.
[0085] 2. This invention uses a tensor network decomposition algorithm to perform low-rank compression modeling of high-dimensional physical fields. Through tensor chain decomposition and hybrid structure design, it transforms exponentially growing computational complexity into linear complexity. This technological breakthrough enables real-time simulation of large-scale industrial equipment while avoiding the memory bottlenecks of traditional grid-based methods.
[0086] 3. This invention adopts a hierarchical optimization strategy, dynamically switching between global search and local optimization algorithms based on the error convergence state, balancing the exploration breadth of the parameter space and the convergence speed. Through adaptive adjustment of the learning rate driven by gradient sensitivity, it effectively avoids local optimal traps and significantly shortens the model training cycle.
[0087] 4. This invention intelligently allocates symbolic computation, tensor operations, and optimization tasks to the CPU and GPU through a task priority scheduling mechanism and hardware affinity design. This solution fully leverages the parallel computing capabilities of the GPU and the multi-core processing advantages of the CPU to achieve efficient execution of computationally intensive tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] Figure 1 Schematic diagram of the method flow of the present invention;
[0089] Figure 2 It is the main framework flow chart of the present invention. DETAILED DESCRIPTION
[0090] The following is combined with Figure 1 , the present invention is described in further detail.
[0091] The present invention provides a simulation model construction method, comprising the following steps:
[0092] Step 1: Analyze the electrical control logic of industrial equipment and convert it into a mixed integer nonlinear programming problem containing discrete Boolean variables and continuous variables;
[0093] Step 2: Model the physical field based on the tensor network decomposition algorithm to generate a compressed low-rank tensor network model;
[0094] Step 3: Dynamically adjust the parameters of the tensor network model using a hierarchical optimization strategy, where the hierarchical optimization strategy switches between global search and local optimization algorithms according to the error convergence state;
[0095] Step 4: Allocate and execute symbolic computation, tensor network operations, and parameter optimization tasks through heterogeneous computing systems;
[0096] Step 5: Collect production line sensor data in real time, calculate the error between the simulation model output and the real data, and trigger parameter re-optimization based on the error threshold.
[0097] The generation of mixed-integer nonlinear programming problems involves:
[0098] Extract conditional branches, loop structures, and state jump instructions from control programs to generate discrete Boolean variable sets ;
[0099] Equipment physical parameters as continuous variables , and impose constraints ;
[0100] The objective function of the mixed integer nonlinear programming problem is:
[0101] ;
[0102] in: For Boolean variables associated continuous functions;
[0103] To depend only on continuous variables function.
[0104] Modeling of physical fields based on tensor network decomposition algorithms includes:
[0105] Modeling the physical field as an N-th order tensor , where each dimension corresponds to a spatial or temporal discretization parameter of the physical field;
[0106] Perform tensor chain decomposition on the N-order tensor to obtain the core tensor chain , where each core tensor The rank of , and satisfy .
[0107] Generating a compressed low-rank tensor network model involves constructing a hybrid tensor structure:
[0108] Discretize Boolean variables The core tensor after embedding the tensor chain decomposition as an additional dimension;
[0109] Construct Boolean logic associated core tensor , whose dimensions are associated with Boolean variable states and compressed dimensions ;
[0110] Constructing core tensors associated with continuous physical fields , whose dimensions are associated with the compressed dimensions Parameters related to the spatial or temporal discretization of the physical field;
[0111] Generate a mixed tensor model through tensor contraction operations:
[0112] ;
[0113] in: is a discrete Boolean variable;
[0114] is the discretized grid index of the physical field;
[0115] is the compressed dimension index;
[0116] is the size of the compressed dimension.
[0117] Layered optimization strategies include:
[0118] When the error function The rate of decline When , it switches from the global search algorithm to the local gradient optimization algorithm;
[0119] The global search algorithm traverses the parameter space to generate a set of candidate solutions;
[0120] Local gradient optimization algorithm based on partial derivatives of error function Update parameters ;
[0121] Dynamically adjust the learning rate for local optimization ,satisfy:
[0122] ;
[0123] in: are the parameters to be optimized of the tensor network model;
[0124] is the error function between the simulation output and the target data;
[0125] is the initial learning rate;
[0126] is the preset error reduction rate threshold.
[0127] Distributing and executing tasks across heterogeneous computing systems includes:
[0128] According to parameter sensitivity Hardware queue waiting time Calculate task priority:
[0129] ;
[0130] Assign parameter optimization tasks with a priority higher than the set threshold to the GPU accelerator card for execution;
[0131] Assign parameter optimization tasks with a priority lower than the set threshold to the CPU cluster for execution;
[0132] in: The first Parameters to be optimized;
[0133] is the error function between the simulation output and the target data;
[0134] The estimated waiting time of the current queue for hardware resources.
[0135] Executing tensor network operations in heterogeneous computing systems includes:
[0136] The core tensor after decomposing the tensor chain Load into GPU memory;
[0137] Perform tensor contraction operations based on the mixed tensor structure:
[0138] ;
[0139] Use CUDA kernel functions to parallelize the sum of each dimension in tensor contraction operations;
[0140] in: is the kth core tensor obtained by decomposition;
[0141] The Boolean logic association core for the construction;
[0142] is the discretized grid index of the k-th dimension of the physical field;
[0143] is the compression dimension index between adjacent core tensors.
[0144] The errors between the simulation model output and the real data include:
[0145] Real-time collection of production line sensor time series data, recorded as real data set ;
[0146] Get the output of the simulation model at the corresponding time step, recorded as the simulation data set ;
[0147] Calculate the mean squared error:
[0148] ;
[0149] when Parameter re-optimization is triggered when
[0150] in: For the Sensor measurements at time steps;
[0151] For the simulation model The output value of each time step;
[0152] It is the error tolerance threshold set according to the equipment process requirements.
[0153] Triggering parameter re-optimization based on error thresholds includes:
[0154] When continuous The mean square error of the time steps When , it is determined that the system parameters are mismatched;
[0155] Dynamically adjust the threshold based on the degree of mismatch ;
[0156] The conditions for triggering parameter re-optimization are updated as follows:
[0157] ;
[0158] in: is the length of the set time window;
[0159] For the The mean square error of the time steps;
[0160] is the error threshold after dynamic adjustment;
[0161] is the initial error threshold.
[0162] In this embodiment, we first perform structured parsing on the electrical control logic of industrial equipment. We read the control program code in the equipment's programmable logic controller (PLC) and identify logical control instructions, including but not limited to conditional branch statements, loop control structures, and state jump instructions. Specifically, we use a syntax parser to perform lexical analysis and construct a syntax tree on the control program to extract the implicit discrete decision logic.
[0163] After completing the logic instruction parsing, the discrete decision logic is mapped into a set of Boolean variables. Specifically, a discrete Boolean variable set is generated. , where each Boolean variable Corresponds to an independent decision state in the control logic. Preferably, the number of Boolean variables Determined by the complexity of conditional branches and state jumps in the control program. For example, when the control program contains When there are mutually exclusive conditional branches, Boolean variables, each representing the activation state of the corresponding branch.
[0164] At the same time, the physical parameters involved in the operation of the equipment are extracted as continuous variables. Definition of continuous variables ,in is the dimension of the physical field parameters. Preferably, continuous variables include but are not limited to physical quantities such as temperature, pressure, flow rate, etc., and constraints are imposed according to the safe operation requirements of the equipment. Constraints are determined by the equipment process manual or sensor range and are used to limit the feasible domain of parameters in the optimization process.
[0165] Furthermore, discrete Boolean variables are coupled with continuous variables to construct a mixed integer nonlinear programming (MINLP) problem. The objective function of MINLP is defined as:
[0166] ;
[0167] The technical meaning of each component is as follows:
[0168] For Boolean variables The mathematical form of the associated continuous function is determined by the interaction between the control logic and the physical field. For example, when the Boolean variable When a certain device working mode is activated, The corresponding energy consumption function or efficiency function in this mode can be represented;
[0169] To depend only on continuous variables The physical field steady-state function, whose specific expression is generated after discretization of the physical field control equations (such as heat conduction equations and fluid mechanics equations).
[0170] Preferably, the design of the objective function realizes the unified modeling of discrete control logic and continuous physical field. Through the product term Dynamically control the activation status of different physics sub-models, and This ensures the continuity of the physical field when there is no logical state switching. The composite structure of the objective function provides a mathematical basis for subsequent tensor network modeling, allowing logical control and physical field variables to be jointly optimized in the same tensor space.
[0171] In the implementation process, the generation of MINLP problems also includes the verification of variable association relationships. Specifically, the Boolean variables are checked by symbolic calculations. With continuous functions dimensional consistency, ensuring that each Boolean variable affects only its corresponding physical field sub-model. Preferably, the objective function is Perform differentiability verification to meet the computational requirements of subsequent gradient optimization algorithms.
[0172] In this embodiment, first, a high-dimensional discretization model is performed on the physical field of the industrial equipment. Based on the mixed integer nonlinear programming problem generated in step 1, the physical field described by the continuous variables (such as the temperature field, stress field or electromagnetic field) is gridded in the space or time dimension to generate an N-order tensor representation. Specifically, the N-order tensor Each dimension of The number of discretized grid nodes corresponding to the physical field. For example, in a three-dimensional heat conduction scenario, the three orders of the tensor correspond to the spatial coordinate system Then, the tensor chain decomposition (TensorTrainDecomposition, TT) is performed on the N-order tensor to compress it into a low-rank core tensor chain. Specifically, the tensor chain decomposition process converts the original tensor Decompose into Core Tensors , among which Core Tensors The rank satisfies . Preferably, the rank constraint is determined by cross-validation to strike a balance between model accuracy and computational complexity. The decomposed core tensor chain reconstructs the original tensor through the following relationship:
[0173] ;
[0174] in, is the compressed dimension index between adjacent core tensors, and its size Characterize the low-rank properties of the model after compression.
[0175] Furthermore, the discrete Boolean variable obtained in step 1 is Embed the core tensor chain to build a hybrid tensor structure. Specifically, based on the tensor chain decomposition, the Boolean variable dimension is expanded to generate a unified tensor representation containing logical control states and physical field parameters. The hybrid tensor structure is defined by the following formula:
[0176] ;
[0177] The technical meaning of each component is as follows:
[0178] It is a Boolean logic associated core tensor, whose dimensions are associated with the Boolean variable state With compressed dimensions . Preferably, the tensor Each element of represents the weight coefficient of the compression dimension under a specific Boolean state, which is dynamically updated through the training process;
[0179] It is the core tensor associated with the continuous physical field, and its dimension is associated with the compressed dimension Discretization parameters of the physical field. Tensor Encodes the low-rank approximation properties of the physical field for efficient reconstruction of the original physical field data;
[0180] is the compressed dimension size of the mixed tensor structure, and its value is determined by the rank parameter of the tensor chain decomposition Joint decision.
[0181] During implementation, the construction of the hybrid tensor structure is completed through the following steps:
[0182] Boolean dimension expansion: In the core tensor chain after tensor chain decomposition, for each core tensor Add a Boolean variable dimension to expand it from three-dimensional to four-dimensional tensor ;
[0183] Tensor reduction operation: The expanded core tensor chain is associated with Boolean logic core tensors through the Einstein summation convention. Perform a contraction operation to generate the final hybrid tensor structure. Preferably, the dimension matching rule of the contraction operation ensures the dynamic coupling between the Boolean variable state and the physical field parameters;
[0184] Parameter initialization and optimization: core tensors and The initial value of is generated through random distribution and is iteratively updated based on the error function in the subsequent hierarchical optimization process of step 3.
[0185] In this embodiment, a hierarchical optimization strategy is first implemented based on the hybrid tensor model constructed in step 2 to dynamically adjust model parameters. The core of the hierarchical optimization strategy is to adaptively switch between global search and local optimization algorithms based on the convergence state of the error function, thereby balancing the exploration efficiency of the parameter space with the local convergence accuracy.
[0186] Specifically, define the error function ,in Represents the set of parameters to be optimized in the hybrid tensor model, including Boolean logic associated core tensors Correlating Core Tensors with Continuum Physics The error function quantifies the simulation output With real sensor data The degree of deviation provides a target orientation for the optimization process.
[0187] During the optimization iteration process, the error reduction rate is calculated in real time , used to determine the current convergence state. (in is the preset error reduction rate threshold), the model is judged to enter the local convergence region, and the algorithm switching mechanism is triggered. Preferably, the threshold A decimal value close to zero is empirically set to distinguish the global exploration phase from the local refinement phase.
[0188] Global search phase: When the error reduction rate does not meet the switching condition, a global optimization algorithm is used to traverse the parameter space. Preferably, the global search algorithm includes but is not limited to genetic algorithm or particle swarm optimization. Specifically, a candidate parameter solution set is randomly generated. , and calculate the error value of each candidate solution The candidate solution set is iteratively updated through selection, crossover and mutation operations, gradually approaching the global optimal solution region.
[0189] Local optimization stage: When the error reduction rate triggers the switching condition, the local gradient optimization algorithm is enabled. Specifically, a gradient-based optimizer (such as Adam or quasi-Newton method) is used to calculate the partial derivative of the error function with respect to the parameter. Update parameters:
[0190] ;
[0191] Among them, the learning rate Dynamic adjustment based on parameter gradient amplitude, the specific rules are:
[0192] ;
[0193] The dynamic adjustment mechanism makes the parameters with larger gradient amplitude (i.e. the key parameters that have a significant impact on the error) use a larger learning rate to update, while the parameters with smaller gradient amplitude use a smaller learning rate, thereby avoiding oscillation or stagnation during the optimization process. Preferably, the initial learning rate It is preset according to the order of magnitude of the parameters and adaptively scaled according to the convergence status during the iteration process.
[0194] Furthermore, the layered optimization strategy enhances robustness through the following technical details:
[0195] Gradient smoothing: partial derivatives Perform sliding average filtering to suppress gradient oscillation caused by noise interference;
[0196] Parameter constraint projection: After each parameter update, Project to the physical constraint range defined in step 1 , ensuring the feasibility of the solution;
[0197] Early stopping mechanism: When the error does not decrease significantly in multiple consecutive iterations of the local optimization phase, the current phase is terminated early and the global search is reactivated to avoid falling into invalid optimization.
[0198] Preferably, the error function and gradient calculations are implemented using automatic differentiation techniques to ensure high efficiency and numerical stability. Furthermore, the intermediate parameters and gradient data generated during the optimization process are accelerated by the heterogeneous computing system in step 4, further shortening the iteration cycle.
[0199] In this embodiment, first, based on the computing task queue generated by the hierarchical optimization strategy in step three, efficient task allocation and execution are achieved through a heterogeneous computing system. The heterogeneous computing system integrates the parallel computing capabilities of the CPU cluster and the GPU accelerator card, implements differentiated scheduling based on the characteristics of symbolic computing, tensor network computing, and parameter optimization tasks, and maximizes hardware resource utilization. Specifically, for each parameter optimization task k to be executed, its dynamic priority is calculated to determine the hardware allocation strategy. The priority calculation formula is:
[0200] ;
[0201] The technical meanings of each parameter are as follows:
[0202] is the error function for the kth parameter The partial derivative of , which represents the influence of this parameter on the accuracy of the model;
[0203] The estimated waiting time of task k in the current queue of the target hardware resource (GPU or CPU), which is fed back in real time by the resource monitoring module;
[0204] The parameters to be optimized in the hybrid tensor model constructed in step 2 include the elements of the Boolean logic-related core tensor A and the physical field-related core tensor B. Priority calculation and task allocation rules:
[0205] GPU accelerator card allocation: Priority is higher than the preset threshold (such as ) tasks to the GPU. Preferably, such tasks typically involve large-scale tensor contraction operations or high-dimensional gradient calculations, which are accelerated by the GPU's parallel computing units;
[0206] CPU cluster allocation: Tasks with a priority lower than the threshold (such as data preprocessing, logging, or low-dimensional parameter updates) are allocated to the CPU cluster and executed in parallel through multi-threading.
[0207] On the GPU side, the specific execution process of tensor network operations includes:
[0208] Video memory data loading: the core tensor chain decomposed in step 2 and Boolean logic association core tensor A is loaded into GPU memory to reduce data transmission latency;
[0209] Hybrid tensor reduction and merging operations: Execute the following tensor reduction and merging operations in parallel based on CUDA kernel functions:
[0210] ;
[0211] Each thread block is responsible for calculating a specific compression dimension or discrete index The local summation term optimizes data reuse through shared memory;
[0212] Gradient synchronization and update: After completing the tensor operation, the gradient data The data is transferred back from the GPU memory to the main memory for the optimizer in step 3 to update the parameters.
[0213] On the CPU side, key technologies for task execution include:
[0214] Task slicing: Divide low-priority tasks into multiple subtasks and implement multi-core parallel computing through OpenMP or MPI libraries;
[0215] Resource load balancing: Dynamically monitor the queue length and computing load of each CPU node, and avoid local overload through task migration mechanism.
[0216] Preferably, the heterogeneous computing system ensures the real-time performance of task scheduling through the following mechanisms:
[0217] Queue status prediction: Build a time series model prediction based on historical execution time data , improve the accuracy of priority calculation;
[0218] Hardware affinity binding: Assigns frequently interacting task groups (such as the reduction and merging of adjacent core tensors) to the same GPU device or CPU node, reducing cross-device communication overhead.
[0219] In this embodiment, first, the real-time data of the production line sensors is collected to generate a real data set to verify the output accuracy of the simulation model. Specifically, the temperature, pressure, and displacement sensors are connected via an industrial bus (such as OPC UA or Modbus) and the data is sent at fixed time intervals. Synchronously collect the measurement values of key positions in the physical field and record them as real data sets . Preferably, the time interval Keep the time step consistent with the simulation model to ensure data alignment. Synchronously obtain the output results of the simulation model at the corresponding time step to generate a simulation data set . Simulation output value The heterogeneous computing system in step 4 calculates the data in real time, including the result of the combined operation of the mixed tensor model and the Boolean variable activation weight of the logic control state. Preferably, the zero-copy transmission of sensor data and simulation output is achieved through memory mapping technology to reduce I / O latency. Based on the real data and simulation data sets, the mean square error is calculated to quantify the model deviation:
[0220] ;
[0221] in, For the The sensor measurements for each time step, For the simulation model The output value of the time step. Reflects the simulation model in the time window The overall degree of deviation within.
[0222] Furthermore, the parameter re-optimization mechanism is triggered according to the error threshold. When , the current model parameters are determined to be mismatched, and the hierarchical optimization process in step 3 needs to be triggered. It is set according to the equipment process requirements, such as the maximum allowable deviation range provided by the equipment manufacturer or the statistical characteristics of historical operating data. Preferably, the threshold setting needs to meet ( is the sensor noise variance) to avoid false triggering.
[0223] In order to enhance the robustness of the trigger mechanism, a dynamic threshold adjustment strategy is introduced. Mean squared WWW error of time steps Exceeding the initial threshold When , it is determined to be a systematic parameter mismatch. At this time, the threshold is dynamically updated according to the degree of mismatch:
[0224] ;
[0225] And reset the trigger condition to:
[0226] ;
[0227] in, It is the preset time window length, used to smooth the impact of instantaneous noise; The dynamically adjusted error threshold is adaptively scaled by the square root of the historical error mean. Preferably, the square root operation is used to balance the error amplitude with the sensitivity of the threshold adjustment to avoid sharp fluctuations in the threshold due to sudden noise.
[0228] During implementation, error calculation and triggering logic ensure real-time performance through the following technical details:
[0229] Data flow pipeline: A double buffer mechanism is used to process data acquisition, error calculation and trigger judgment in parallel, eliminating pipeline blockage;
[0230] Threshold state machine management: defines the three-state state machine of "normal", "warning" and "mismatch", dynamically switches the state according to the number of consecutive triggers and error trends, and suppresses occasional abnormal interference;
[0231] Parameter optimization signal synchronization: When the trigger condition is met, an interrupt signal is sent to the optimization decision module in step 3, and the current error distribution data is passed to guide the direction of parameter re-optimization.
[0232] The simulation model construction system described below and the simulation model construction method described above can be referred to in correspondence with each other.
[0233] Please see the attached Figure 2 , simulation model building system, including:
[0234] Logic parsing module, used to convert electrical control logic into mixed integer nonlinear programming problems;
[0235] A tensor modeling module that performs tensor network decomposition and generates hybrid tensor structures;
[0236] Optimization decision module, used to implement hierarchical optimization strategies and dynamically adjust parameters;
[0237] Heterogeneous scheduling module, used to allocate computing tasks to CPU and GPU hardware resources;
[0238] Verification feedback module, used to collect production line data and trigger parameter re-optimization.
[0239] The system of this embodiment can be used to execute the above method embodiments, and its principles and technical effects are similar, so they will not be repeated here.
[0240] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A simulation model construction method, characterized in that: The following steps are involved: Step 1: Analyze the electrical control logic of industrial equipment and convert it into a mixed integer nonlinear programming problem containing discrete Boolean variables and continuous variables; Step 2: Model the physical field based on the tensor network decomposition algorithm to generate a compressed low-rank tensor network model; Step 3: Dynamically adjust the parameters of the tensor network model using a hierarchical optimization strategy, wherein the hierarchical optimization strategy switches between global search and local optimization algorithms according to the error convergence state; Step 4: Allocate and execute symbolic computation, tensor network operations, and parameter optimization tasks through heterogeneous computing systems; Based on the hybrid tensor model constructed in step 2, a hierarchical optimization strategy is implemented to dynamically adjust the model parameters. The core of the hierarchical optimization strategy is to adaptively switch between the global search and local optimization algorithms according to the convergence state of the error function. Define the error function Where θ represents the set of parameters to be optimized in the hybrid tensor model, including the elements of the Boolean logic association core tensor A and the continuous physical field association core tensor B, and the error function quantifies the simulation output y sim,i Compared with the real sensor data y real,i the degree of deviation; During the optimization iteration process, the error reduction rate is calculated in real time Used to determine the current convergence state. When δ<β in multiple consecutive iterations, where β is the preset error reduction rate threshold, the model is determined to have entered the local convergence region and the algorithm switching mechanism is triggered. The threshold β is set to a decimal close to zero based on experience to distinguish between the global exploration phase and the local fine optimization phase. Global search stage: When the error reduction rate does not meet the switching condition, a global optimization algorithm is used to traverse the parameter space. The global search algorithm includes but is not limited to genetic algorithm or particle swarm optimization, and a candidate parameter solution set {θ1, θ2, ..., θ M }, and calculate the error value E(θ i ); Local optimization stage: When the error reduction rate triggers the switching condition, the local gradient optimization algorithm is enabled, and the gradient-based optimizer is used to calculate the partial derivative of the error function with respect to the parameter. Update parameters: Among them, the learning rate η i Dynamic adjustment according to parameter gradient amplitude, specifically: The dynamic adjustment mechanism makes the parameters with larger gradient amplitudes adopt larger learning rates, while the parameters with smaller gradients adopt smaller learning rates. The initial learning rate η0 is preset according to the order of magnitude of the parameters and is adaptively scaled according to the convergence state during the iteration process. The layered optimization strategy enhances robustness through the following technical details: Gradient smoothing: partial derivatives Perform sliding average filtering; Parameter constraint projection: After each parameter update, θ i Projected to the physical constraint range defined in step 1 [X min , X max ]; Early stopping mechanism: When the error in the local optimization phase does not decrease significantly over multiple consecutive iterations, the current phase is terminated early and the global search is reactivated; The error function and gradient calculation are realized through automatic differentiation technology. The intermediate parameters and gradient data generated during the optimization process are accelerated by heterogeneous computing systems. Based on the computing task queue generated by the hierarchical optimization strategy, efficient task allocation and execution are achieved through heterogeneous computing systems. Differentiated scheduling rates are implemented based on the characteristics of symbolic computing, tensor network operations, and parameter optimization tasks. For each parameter optimization task k to be executed, its dynamic priority is calculated to determine the hardware allocation strategy. The priority calculation formula is: in, is the error function for the kth parameter θ k The partial derivative of , which represents the influence of this parameter on the accuracy of the model; τ queue,k is the estimated waiting time of task k in the current queue of the target hardware resource, which is fed back in real time by the resource monitoring module; Step 5: Collect production line sensor data in real time, calculate the error between the simulation model output and the real data, and trigger parameter re-optimization based on the error threshold.
2. The simulation model construction method according to claim 1, characterized in that: The generation of the mixed integer nonlinear programming problem includes: Extract the conditional branches, loop structures and state jump instructions in the control program and generate a discrete Boolean variable set B = {b1, b2, ..., b k }; Equipment physical parameters as continuous variables and impose the constraint x min ≤x i ≤x max ; The objective function of the mixed integer nonlinear programming problem is: Where: c j (x) is the same as the Boolean variable b j associated continuous functions; d(x) is a function that depends only on the continuous variable x.
3. The simulation model construction method according to claim 1, characterized in that: The modeling of the physical field based on the tensor network decomposition algorithm includes: Modeling the physical field as an N-th order tensor Each dimension corresponds to a spatial or temporal discretization parameter of the physical field; Perform tensor chain decomposition on the N-order tensor to obtain core tensor chains G1, G2, ..., G N , where each core tensor G k The rank is r k , and satisfies r k ≤5.
4. The simulation model construction method according to claim 3, characterized in that: Generating the compressed low-rank tensor network model includes constructing a hybrid tensor structure: The discrete Boolean variable b j The core tensor after embedding the tensor chain decomposition as an additional dimension; Construct a Boolean logic association core tensor A, whose dimensions are associated with the Boolean variable state and the compression dimension α respectively; Construct a continuous physical field-related core tensor B, whose dimensions are respectively related to the compression dimension α and the spatial or temporal discretization parameters of the physical field; Generate a mixed tensor model through tensor contraction operations: Where: b j is a discrete Boolean variable; i1,...,i N is the discretized grid index of the physical field; α is the compression dimension index; r is the size of the compressed dimension.
5. The simulation model construction method according to claim 1, characterized in that: Executing tensor network operations in the heterogeneous computing system includes: The core tensors G1, G2, ..., G after decomposing the tensor chain N Load into GPU memory; Perform tensor contraction operations based on the mixed tensor structure: The sum of each dimension in the tensor contraction operation is calculated in parallel by using a CUDA kernel function; Among them: G k is the kth core tensor obtained by decomposition; A(b j ,α) is the constructed Boolean logic association core; i k is the discretized grid index of the k-th dimension of the physical field; α k-1 , α k is the compressed dimension index between adjacent core tensors.
6. The simulation model construction method according to claim 1, characterized in that: The error between the output of the simulation model and the real data includes: Real-time collection of production line sensor time series data, recorded as real data set Get the output of the simulation model at the corresponding time step, recorded as the simulation data set Calculate the mean squared error: When ∈>∈ threshold Parameter re-optimization is triggered when Where: y real,i is the sensor measurement value at the i-th time step; y sim,i is the output value of the simulation model at the i-th time step; ∈ threshold It is the error tolerance threshold set according to the equipment process requirements.
7. The simulation model construction method according to claim 1, characterized in that: Triggering parameter re-optimization according to the error threshold includes: When the mean square error of m consecutive time steps ∈ t >∈ threshold When , it is determined that the system parameters are mismatched; Dynamically adjust the threshold based on the degree of mismatch The conditions for triggering parameter re-optimization are updated as follows: Where: m is the set time window length; ∈ t is the mean square error at the tth time step; is the error threshold after dynamic adjustment; ∈ threshold is the initial error threshold.
8. A simulation model construction system according to the simulation model construction method according to any one of claims 1 to 7, characterized in that: include: Logic parsing module, used to convert electrical control logic into mixed integer nonlinear programming problems; A tensor modeling module that performs tensor network decomposition and generates hybrid tensor structures; Optimization decision module, used to implement hierarchical optimization strategies and dynamically adjust parameters; Heterogeneous scheduling module, used to allocate computing tasks to CPU and GPU hardware resources; Verification feedback module, used to collect production line data and trigger parameter re-optimization.
Citation Information
Patent Citations
Comprehensive optimization method for clean circulating cooling water system based on hierarchical nested algorithm
CN104573882A
Controllable gain RCS active enhancement method and device
CN119203786A