Workpiece clamping sequence intelligent optimization method and system based on state interleaving transformer

By using a state-interleaved Transformer-based intelligent optimization method for workpiece clamping sequence, the problem of elastic deformation caused by clamping force in machining of weak stiffness workpieces is solved. This achieves efficient multi-step clamping process control and millisecond-level dynamic decision-making, meeting the precision machining needs of aerospace and automotive manufacturing.

CN123047472APending Publication Date: 2026-11-06HUAZHONG UNIV OF SCI & TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202610888485.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-18
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

In fields such as aerospace and automotive manufacturing, the elastic deformation of weak stiffness workpieces caused by clamping forces during machining severely affects machining accuracy. Existing technologies have high computational costs and cannot meet the industrial demands for real-time force perception and millisecond-level dynamic decision-making.

Method used

A workpiece clamping sequence intelligent optimization method based on state-intertwined Transformer is adopted. By introducing a greedy path optimization strategy with trial-and-error rollback mechanism, combined with a finite element implicit mechanics solver and a decision Transformer model, global optimization control of the multi-step clamping process is achieved. The self-attention mechanism and causal mask matrix are used to implement dynamic anti-collision constraint logic, thereby improving computational efficiency and accuracy.

Benefits of technology

It significantly reduces the elastic deformation of weak stiffness workpieces, ensuring machining accuracy and product qualification rate, meeting the machining requirements of high-precision thin-walled structural parts, and realizing millisecond-level dynamic decision-making and absolute safety interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123047472A_ABST
    Figure CN123047472A_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of intelligent clamping, and particularly discloses a workpiece clamping sequence intelligent optimization method and system based on state interleaving Transformer. The method comprises: based on a greedy strategy with a "trial and error-rollback" mechanism, automatically simulating a high-quality process data set containing an optimal clamping path and corresponding physical state evolution; high-dimensional mapping of continuous physical stress state and discrete clamping action features, and zipper interleaving splicing according to physical time steps to construct a unified time sequence input tensor; constructing a decision Transformer model with a causal mask mechanism for self-attention training, and combining action legality mask when realizing online reasoning to output the next clamping instruction that meets the process specification and has the minimum deformation. The present application effectively improves the calculation efficiency of multi-point clamping sequence optimization, reduces the elastic deformation of weak stiffness workpieces during machining, and ensures the dimensional accuracy and product qualification rate after final machining and unloading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent clamping technology, and more specifically, relates to an intelligent optimization method and system for workpiece clamping sequence based on state interleaving Transformer. Background Technology

[0002] In high-end equipment manufacturing fields such as aerospace and automotive manufacturing, thin-walled parts and other low-stiffness workpieces are widely present. During machining, clamping forces must be applied to fix the workpiece. However, low-stiffness workpieces are highly susceptible to elastic deformation under the influence of clamping forces, causing the workpiece to spring back after unloading, severely affecting the final machining accuracy. In multi-point clamping scenarios, the sequence of clamping operations can significantly alter the stress redistribution state inside the workpiece, resulting in drastically different final deformation amounts. Therefore, how to plan the optimal clamping sequence before machining to minimize clamping deformation is a core issue that urgently needs to be addressed in the field of precision manufacturing.

[0003] To address the problem of clamping sequence and deformation control for workpieces with low stiffness, patent document CN113351891B presents a widely adopted high-precision process optimization approach in the industry: establishing a physical field model using finite element software (such as Abaqus) and combining iterative optimization algorithms (such as genetic algorithms) to optimize the clamping position sequence. This method belongs to the typical "online iterative simulation" paradigm. During the iterative optimization process of the algorithm (such as the population propagation of genetic algorithms), the finite element solver needs to be called hundreds or thousands of times for implicit mechanical calculations to obtain the deformation amount of each attempt as the fitness function. For complex processes involving multi-step clamping sequences, the computational time cost increases exponentially, with a single optimization often taking hours or even days. This extremely high computational cost limits this technology to the offline process planning stage, completely failing to meet the industrial demands of modern intelligent manufacturing for "real-time force perception and millisecond-level dynamic decision-making." Summary of the Invention

[0004] To address the aforementioned deficiencies or improvement needs of existing technologies, this invention provides an intelligent optimization method and system for workpiece clamping sequence based on state-interleaved Transformers. It employs a greedy path optimization strategy incorporating a "trial-and-error" mechanism, utilizes a finite element implicit mechanics solver to control the physical model and establish temporary analysis steps for numerical solutions, accurately capturing the displacement field and average deformation of each candidate clamping point. Combined with state anchor points and optimal action solidification technology, it packages high-quality time-series sample data. In the online inference control stage of actual production, it aligns continuous physical states with discrete clamping actions through high-dimensional heterogeneous feature mapping, and performs zipper-like interleaving and position encoding superposition according to physical time steps, utilizing an upper triangular causal mask. The matrix-based decision-making Transformer model strictly adheres to the physical temporal causality law, achieving global optimization and constant control for complex multi-step clamping processes. Simultaneously, based on dynamic anti-collision legality constraint logic using parallel matrix-level superposition operations, the algorithm traverses historically executed clamping sequences in real time, forcibly masking and correcting the probability scores of already operated points in the initial action probability distribution tensor to negative infinity. Through a maximum value retrieval model, it converts these into optimal legal action instructions within milliseconds, effectively improving the computational efficiency of multi-point clamping sequence optimization, significantly reducing the elastic deformation of weakly stiff workpieces during processing, and ensuring the dimensional accuracy and product qualification rate after final unloading. This meets the processing requirements of high-precision thin-walled structural parts in aerospace, automotive manufacturing, and other fields.

[0005] To achieve the above objectives, according to one aspect of the present invention, a method for intelligent optimization of workpiece clamping sequence based on state-interleaved Transformer is proposed, comprising the following steps: S100: Obtain the physical model of the workpiece under different clamping conditions, and use an optimization strategy with trial and error and state rollback mechanism to perform multiple rounds of path iteration evolution. At each decision, traverse the current unclamped target points and evaluate their deformation index, select the points that meet the requirements as the current optimal action, and perform state rollback after solidifying the physical state characteristics corresponding to the optimal action. Repeat until all points are allocated, and generate time-series sample data composed of alternating physical states and operation actions. S200: Map the physical state features and operation action features generated in step S100 to the hidden feature space of the same dimension respectively. Use the sequence interleaving algorithm to strictly interleave and splice the two according to the time step and superimpose the position encoding to construct a model input tensor that explicitly retains the temporal features of clamping sequence. S300, Construct a decision network model with a self-attention mechanism, and train the decision network model using the model input tensor; S400: Real-time acquisition of the current physical state characteristics of the workpiece and the historical clamping sequence in the operation record; construction of a real-time context tensor according to the sequence interleaving algorithm in step S200; input into the decision network model trained in step S300; calculation of the initial action probability distribution; based on the dynamic legality anti-collision constraint logic; traversal of the historical executed sequence; penalty masking correction of the probability scores of the already operated points in the initial action probability distribution; optimal retrieval of the corrected probability distribution; output of the legal action instruction with the highest score; control of the external clamping equipment to execute the next clamping decision.

[0006] As a further preferred embodiment, the step of constructing time-series sample data in step S100 specifically includes: S101, In the offline data generation stage, the physical model of the workpiece clamping is initialized, the geometric model is imported, the material properties are set and the mesh is generated, and the support reaction tensor in the initial unloaded state is extracted as the state anchor point. S102, using the state anchor point as a physical reference, randomly select and execute the first clamping action from all clamping points. The first clamping state is simulated by fixing the multi-axis displacement of the lower surface of the initial clamping position in the physical model and applying downward pressure to the corresponding upper surface. S103, For all remaining unclamped candidate points, establish a temporary analysis step for each candidate point in the physical model for trial purposes, and apply boundary conditions to solve the force equilibrium state of the workpiece. S104. After the solution is completed, the displacement field of the workpiece node set in each temporary analysis step is extracted, and the average deformation of the workpiece is calculated based on the displacement components of each node in different coordinate axis directions, which is used as the deformation index. S105. Compare the trial results of the average deformation corresponding to all candidate points, record the candidate point that minimizes the average deformation of the workpiece, and select it as the current optimal clamping action. S106, Execute state rollback operation, delete all temporary analysis steps used for trial to ensure the continuity of model state, then formally apply the optimal clamping action to the physical model, and extract the multi-axis support reaction matrix of each support point of the workpiece as the current solidified physical state. S107, Repeat steps S103 to S106 until all clamping points are assigned, and save the final generated time sequence action list and the corresponding physical state feature matrix list as a single time sequence sample data.

[0007] As a further preferred embodiment, the formula for calculating the average deformation includes: , The total number of nodes. , where i is a node This represents the average deformation.

[0008] As a further preferred embodiment, step S200 includes the following steps: S201 inputs the continuous physical state feature vectors from the time-series sample data into a linear fully connected network, and projects them onto a state hidden layer tensor of a set dimension. S202, before constructing the sequence interleaving, extract the state anchor points and perform all-zeroing or linear transformation processing to generate the state anchor point tensor at time zero, which is used as the starting head feature of the entire long sequence to explicitly characterize the initial boundary of the workpiece in the initial unstressed state. S203, construct a long sequence tensor, fill the zero-time state anchor point tensor into the zero index position of the long sequence tensor, then fill the state hidden layer tensor corresponding to each time step into the even index position of the long sequence in sequence, and fill the action hidden layer tensor corresponding to each time step into the odd index position of the long sequence in sequence, forming a causal context string tensor in which state and action strictly alternate and are interwoven in a zipper-like manner on the physical time axis; S204. Based on the absolute index position of each element in the long sequence, calculate and generate an aperiodic learnable position encoding matrix or a sine / cosine fixed position encoding matrix. Add the position encoding matrix to the causal context string tensor in an element-wise addition manner to give the model the ability to capture the absolute temporal sequence and relative spatial topological relationship of the process steps. Finally, construct a model input tensor that explicitly retains the temporal features of the clamping sequence.

[0009] As a further preferred embodiment, step S201 further includes: inputting the action ID label representing the discrete clamping action into the embedding network, and projecting it into an action hidden layer tensor of the same dimension as the state hidden layer tensor, thereby realizing the dimensionality reduction alignment and spatial representation of heterogeneous multimodal features.

[0010] As a further preferred option, in step S203, a unified long sequence tensor of length 2T is constructed using a two-pointer or index mapping algorithm, where T is the total number of clamping points on the workpiece.

[0011] As a further preferred option, step S300 includes: S301, Construct a decision Transformer model that includes multiple multi-head self-attention layers and feedforward neural network layers in cascade, and input the model input tensor as contextual clues for the current time step into the decision Transformer model; S302, extract the feature latent vectors of all corresponding physical state positions in the output sequence after calculation by the causal self-attention layer, input the feature latent vectors into the designed action prediction head network, and calculate the initial action probability distribution of all candidate clamping points in the next step through linear layer mapping and probabilistic activation. S303, extract the corresponding true optimal clamping action label from the time-series sample data, calculate the cross-entropy loss function between the initial action probability distribution output by the action prediction head network and the true optimal clamping action label, for the initial random exploration stage in the time-series sample data, use all-zero loss mask weights to eliminate the interference of random exploration error, configure all-one loss mask weights for the effective process stage, perform weighted correction on the cross-entropy loss function according to the loss mask weights, calculate the gradient of global network parameters through the gradient backpropagation algorithm, and use the optimizer to perform global iterative update and fixation of the weights of the entire decision network model.

[0012] As a further preferred embodiment, during the calculation of the weight matrix of the multi-head self-attention layer, a causal mask matrix is ​​constructed in which all elements in the upper triangular region are negative infinity and all elements in the lower triangular and diagonal regions are zero. The causal mask matrix is ​​then superimposed on the attention weight scoring matrix and subjected to Softmax normalization. This forcibly blocks the backward propagation of future time sequence information to the past or current time step, restricting the model to only capture the physical state and clamping action features that have occurred in the past and when predicting the action of the current step.

[0013] As a further preferred embodiment, in step S400, the step of traversing the historical executed sequence and applying a punitive masking correction to the probability scores of the already executed points in the initial action probability distribution includes: Based on the dynamic legality anti-collision constraint logic, the historical execution sequence of clamping points is traversed to retrieve the clamping point labels that have been operated in previous process steps. Then, in the initial action probability distribution tensor, the probability score values ​​corresponding to all the clamping point labels that have been operated are forcibly modified to negative infinity. The probability space shielding blocks the fixture interference and collision caused by repeated clamping. The optimal retrieval of the corrected probability distribution includes: using a maximum value retrieval algorithm to retrieve the probability distribution tensor after the dynamic anti-collision constraint correction, and outputting the legal action ID tag with the highest probability score as the dynamic optimal clamping instruction at the current moment.

[0014] According to another aspect of the present invention, a workpiece clamping sequence intelligent optimization system based on state-interleaved Transformer is also provided, comprising: The first main control module is used to acquire the physical model of the workpiece under different clamping conditions. It adopts an optimization strategy with trial and error and state rollback mechanism to carry out multiple rounds of path iteration evolution. At each decision, it traverses the current unclamped target points and evaluates their deformation index. It selects the points that meet the requirements as the current optimal action and executes state rollback after solidifying the physical state characteristics corresponding to the optimal action. The loop continues until all points are allocated, generating time-series sample data composed of alternating physical states and operation actions. The second main control module is used to map the physical state features and operation action features to the hidden feature space of the same dimension respectively. The sequence interleaving algorithm is used to strictly interleave and splice the two according to the time step and superimpose the position encoding to construct a model input tensor that explicitly retains the temporal features of clamping sequence. The third main control module is used to construct a decision network model with a self-attention mechanism and to train the decision network model using the model input tensor. The fourth main control module is used to collect the current physical state characteristics of the workpiece and the historical clamping sequence in the operation record in real time. It constructs a real-time context tensor according to the sequence interleaving algorithm of the second main control module and inputs it into the decision network model trained in the third main control module. The initial action probability distribution is calculated. Based on the dynamic legality anti-collision constraint logic, it traverses the historical executed sequence and performs a punitive masking correction on the probability score of the operation point in the initial action probability distribution. The corrected probability distribution is then optimized and the legal action instruction with the highest score is output to control the external clamping equipment to execute the next clamping decision.

[0015] In summary, compared with the prior art, the above-described technical solutions conceived by this invention mainly possess the following technical advantages: 1. This invention integrates finite element greedy physics field simulation data with decision-making Transformer sequence intelligent reasoning, which on the one hand effectively improves the computational efficiency of multi-point clamping sequence optimization; on the other hand, it significantly reduces the elastic deformation of weak stiffness workpieces during processing, ensuring the dimensional accuracy and product qualification rate after final unloading, and can meet the processing requirements of high-precision thin-walled structural parts in aerospace, automotive manufacturing and other fields.

[0016] 2. This invention introduces a greedy strategy with a "trial and error-rollback" mechanism for offline simulation data generation, which greatly reduces the computational complexity of finding the optimal clamping path from the exponential level of global traversal, greatly saving computing power and energy consumption and data construction time, and can significantly improve the efficiency of front-end process planning.

[0017] 3. This invention realizes end-to-end timing control of physical support reaction state perception and clamping decision command, which significantly improves the clamping deformation control accuracy and online response speed.

[0018] 4. This invention extracts the support reaction state of multiple points on the workpiece and splices it with discrete clamping actions in a time sequence, and uses a decision Transformer model with causal mask to obtain the hidden state vector, and infers the probability of the next processing action, thus realizing the global optimization constant control of complex multi-step clamping process.

[0019] 5. The online inference module of this invention compares the predicted action probability with the historically executed actions, transforms the anti-collision constraint into a dynamic probability mask, and corrects the output command by forcibly blocking the operated points, thereby guiding the action of the actual equipment, realizing the absolute safe interaction between the workpiece and the fixture, and completely avoiding on-site misoperation. Attached Figure Description

[0020] Figure 1 This is a diagram illustrating the overall logical architecture of a workpiece clamping sequence intelligent optimization method based on state interleaving Transformer, as described in an embodiment of the present invention. Figure 2 This is a schematic diagram of the simulation data generation and processing flow based on the greedy trial and error and rollback mechanism involved in the embodiments of the present invention; Figure 3 This is a schematic diagram of the initial finite element model involved in an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the setting of boundary conditions to simulate the clamping state in an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the principle of constructing interleaved sequences of multimodal physical quantities according to an embodiment of the present invention; Figure 6 This is a diagram of the decision Transformer model architecture involved in the embodiments of the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0022] like Figure 1As shown, this invention provides an intelligent optimization method for workpiece clamping sequence based on state-interleaved Transformers. It employs a deep learning paradigm of "offline enhanced data generation and online intelligent sequence reasoning," and achieves underlying decoupling between the physical simulation engine and the intelligent network model. The system first uses finite element simulation as the underlying engine, combined with a greedy strategy featuring a "trial-and-error" mechanism, to automatically generate a high-quality process dataset containing the optimal clamping path and corresponding physical state evolution. Then, it performs high-dimensional mapping between continuous physical force states and discrete clamping action features, and strictly interweaves them according to physical time steps to construct a unified temporal input tensor. Finally, it constructs a decision Transformer model with a causal masking mechanism for self-attention training, and combines action validity masks during online reasoning to output the next clamping instruction that conforms to process specifications and minimizes deformation. Taking a 4-point clamping scenario in structural component processing as an example, the specific steps include: S100: Obtain the physical model of the workpiece under different clamping conditions, and use an optimization strategy with trial and error and state rollback mechanism to perform multiple rounds of path iteration evolution. At each decision, traverse the current unclamped target points and evaluate their deformation index, select the points that meet the requirements as the current optimal action, and perform state rollback after solidifying the physical state characteristics corresponding to the optimal action. Repeat until all points are allocated, and generate time-series sample data composed of alternating physical states and operation actions.

[0023] Specifically, such as Figure 2 As shown, during the offline data generation stage, a greedy optimization algorithm for clamping operations is automatically controlled by a Python script using the Abaqus finite element solver. Before each clamping decision, the system first initializes the workpiece's clamping finite element model, including model import, material settings, and mesh generation, etc. Figure 3 As shown. The support reaction tensor under the initial unloaded state is extracted as the state anchor point, and the first clamping action is executed randomly. In Abaqus, the lower surface of the fixed clamping position... The displacement in the direction applies a certain downward pressure to the upper surface to simulate the clamped state, such as... Figure 4 As shown. The system then enters the iterative decision-making phase. For all remaining unclamped candidate points, the system establishes temporary analysis steps, applies boundary conditions, and submits the calculations in the finite element model. After the solution is completed, the system extracts the displacement field of the workpiece node set in each temporary analysis step. And calculate the average deformation: , in The total number of nodes. These are the displacement components of the node in the three coordinate axes.

[0024] The system compares all trial and error results and records the results. The smallest candidate point is selected as the current optimal clamping action. To ensure the continuity of the model state, the system then performs a core state rollback operation, which deletes all temporary analysis steps used for trial and error, and formally applies the selected optimal action to the model. The support reaction force matrix (including the amplitude after summing the multi-axis component forces) of each support point of the workpiece is extracted as the current solidified physical state. The above process of trial and error, evaluation, rollback, and solidification is repeated until all clamping points are assigned. Finally, the system saves the time sequence action list and the corresponding support reaction force matrix list as a single training sample.

[0025] As a preferred embodiment of the present invention, the construction steps of time-series sample data specifically include: in the offline data generation stage, initializing the workpiece clamping physical model, importing the geometric model, setting material properties and meshing, and extracting the support reaction tensor in the initial unloaded state as the state anchor point; using the state anchor point as the physical reference, randomly selecting and executing the first clamping action from all clamping points, simulating the first clamping state by fixing the multi-axis displacement of the lower surface of the initial clamping position in the physical model and applying a downward pressure on the corresponding upper surface; for all remaining unclamped candidate points, establishing a temporary analysis step for each candidate point in the physical model for trial, and applying boundary conditions to solve the force equilibrium state of the workpiece; after the solution is completed, extracting each temporary analysis step... The displacement field of the workpiece node set in the analysis step is analyzed, and the average deformation of the workpiece is calculated based on the displacement components of each node in different coordinate axis directions, which is used as the deformation index. The trial results of the average deformation corresponding to all candidate points are compared, and the candidate point that minimizes the average deformation of the workpiece is recorded and selected as the current optimal clamping action. The state rollback operation is performed to delete all temporary analysis steps used for trial to ensure the continuity of the model state. Then, the optimal clamping action is formally applied to the physical model, and the multi-axis support reaction matrix of each support point of the workpiece is extracted as the current solidified physical state. The above trial, evaluation, rollback and solidification process is repeated until all clamping points are assigned. The final generated time sequence action list and the corresponding physical state feature matrix list are saved as a single time sequence sample data.

[0026] S200: Map the physical state features and operation action features generated in step S100 to the hidden feature space of the same dimension respectively. Use the sequence interleaving algorithm to strictly interleave and splice the two according to the time step and superimpose the position encoding to construct a model input tensor that explicitly retains the temporal features of clamping sequence. In this step, continuous physical state feature vectors from time-series sample data are input into a linear fully connected network and projected onto a state hidden layer tensor of a set dimension. Action ID tags representing discrete clamping actions are input into an embedding network and similarly projected onto an action hidden layer tensor of the same dimension as the state hidden layer tensor, achieving dimensionality reduction, alignment, and spatial representation of heterogeneous multimodal features. Before sequence interleaving, state anchor points are extracted and subjected to zeroing or linear transformation to generate a state anchor point tensor at time zero. This tensor serves as the starting head feature of the entire long sequence, explicitly representing the initial boundary of the workpiece in its initial unforced state. A unified long sequence tensor with a total length of 2T is constructed using a dual-pointer or index mapping algorithm, where T is the total number of clamping points on the workpiece. The zero... The state anchor tensor at time step 0 is filled to the zero index position of the long sequence. Then, the state hidden tensors corresponding to each time step are sequentially filled to the even index positions of the long sequence, and the action hidden tensors corresponding to each time step are sequentially filled to the odd index positions of the long sequence, forming a causal context string tensor in which states and actions are strictly alternated and interwoven in a zipper-like manner on the physical time axis. Based on the absolute index position of each element in the long sequence, an aperiodic learnable position encoding matrix or a sine and cosine fixed position encoding matrix is ​​calculated and generated. The position encoding matrix is ​​superimposed on the causal context string tensor in an element-wise addition manner to give the model the ability to capture the absolute temporal sequence and relative spatial topological relationship of the process steps. Finally, a model input tensor that explicitly preserves the temporal features of the clamping sequence is constructed.

[0027] More specifically, such as Figure 5 As shown, in order to enable the deep learning model to understand the temporal causal relationship of physical quantities, multimodal interleaved features are constructed on the high-quality sample dataset generated in step (1). Assume the extracted multidimensional support reaction state sequence is... The clamping action sequence is as follows First, the 8-dimensional support reaction state vector is divided by a normalization factor to map it to a standard numerical range to eliminate the influence of dimensions, and then projected to a 128-dimensional hidden space through a linear network layer. Simultaneously, the ID tags representing discrete clamping actions are projected to a hidden space of the same dimension through an embedding layer. Based on this, the system uses a sequence interleaving algorithm to construct a hidden space of length... The long sequence tensor is constructed by filling physical state features at even-numbered index positions and operation action features at odd-numbered index positions, with all-zero state anchors inserted at the beginning and end of the sequence. Generate a form like The interleaved sequence is then processed. Finally, a learnable positional encoding matrix is ​​superimposed on this sequence to strictly preserve the temporal sequence of physical operations, forming an input tensor that can be directly read by the model.

[0028] S300, Construct a decision network model with a self-attention mechanism, and train the decision network model using the model's input tensor. In this step, a decision Transformer model is constructed, comprising multiple cascaded multi-head self-attention layers and feedforward neural network layers. More specifically, as... Figure 6 As shown, the decision Transformer model includes three encoders, each consisting of a cascaded multi-head attention layer with four heads and a feedforward neural network. The model input tensor is used as contextual cues for the current time step and input into the decision Transformer model. During the weight matrix calculation of the multi-head self-attention layer, a causal mask matrix is ​​constructed where all elements in the upper triangular region are negative infinity, and all elements in the lower triangular and diagonal regions are zero. This causal mask matrix is ​​then superimposed on the attention weight scoring matrix and subjected to Softmax normalization to forcibly block the backward propagation of future time-series information to the past or current time step, restricting the model to only capture the physical state and clamping action features of the current moment and past occurrences when predicting the current action. Feature latent vectors corresponding to all physical state positions are extracted from the output sequence after calculation by the causal self-attention layer. These feature latent vectors are then input into the designed action prediction algorithm. In the head network, the initial action probability distribution of all candidate clamping points for the next step is calculated through linear layer mapping and probabilistic activation. The corresponding true optimal clamping action label is extracted from a single time-series sample data, and the cross-entropy loss function between the initial action probability distribution output by the action prediction head network and the true optimal clamping action label is calculated. For the initial random exploration stage in the time-series sample data, all-zero loss mask weights are configured to eliminate the interference of random exploration error, and all-one loss mask weights are configured for the effective process stage. After weighted correction of the cross-entropy loss function using the loss mask weights, the gradient of the global network parameters is calculated through the gradient backpropagation algorithm, and the weights of the entire decision network model are globally iteratively updated and solidified using an optimizer.

[0029] More specifically, in this step, during the model training phase, the system inputs the constructed interleaved sequence into a decision transformer encoder containing multiple self-attention layers. To ensure the model strictly adheres to physical temporal causality, during multi-head self-attention computation, the system constructs a causal mask matrix with negative infinity elements in the upper triangular region and zero elements in the lower triangular region, and superimposes it on the attention weight matrix, forcing the model to predict the first... During the step action, only can be acquired The system completely blocks the transmission of future information by identifying the state and action features at and before a given moment. The model then extracts the latent vectors corresponding to all physical states in the output sequence, mapping them to the probability distribution of the next candidate action via the prediction head network. The system calculates the cross-entropy loss between the predicted distribution and the true optimal action, and eliminates error interference from the initial random exploration phase by setting loss mask weights. Finally, it optimizes the global network parameters using the gradient backpropagation algorithm.

[0030] In step S400, the system acquires the current physical state characteristics of the workpiece and the historical clamping sequences in the work record in real time. Following the sequence interleaving algorithm in step S200, a real-time context tensor is constructed and input into the trained decision network model in step S300. The initial action probability distribution is calculated. Based on dynamic legality collision avoidance constraint logic, the system traverses the historical executed sequences and applies a penalty masking correction to the probability scores of already operated points in the initial action probability distribution. An optimal search is performed on the corrected probability distribution, and the legal action command with the highest score is output to control the external clamping equipment to execute the next clamping decision. In other words, during the online inference control phase of actual production, the system acquires the latest support reaction force state matrix from sensor acquisition or digital twin feedback, as well as the historical clamping sequences in the work record. A real-time context tensor is constructed online according to the rules of step S200 and input into the trained Transformer model to calculate the predicted initial action probability distribution. To ensure the absolute legality of output commands in the actual physical scenario and avoid fixture interference, the system incorporates dynamic anti-collision constraint logic at the decision output end: the algorithm traverses the currently acquired historical clamping sequences, forcibly modifying the probability scores corresponding to "clamping points that have already been executed" in the initial probability distribution tensor to negative infinity. Finally, the system performs a maximum value search (Argmax) operation on the probability distribution after legality masking, outputting the action ID with the highest score, which serves as the next optimal decision command for controlling the physical clamping device. More specifically, in this step, during the online inference control phase of actual production, the latest multi-axis support reaction force state matrix of the workpiece is acquired in real time through field sensors or a digital twin system, and the historically executed clamping point sequence is read in real time from the control system's operation record. Based on the multimodal interleaving rule, the acquired latest multi-axis support reaction force state matrix is ​​used as the physical state feature at the current moment, and is dimensionality-reduced, interleaved, and position-encoded overlaid with the historically executed clamping point sequence to dynamically construct a real-time context tensor containing all historical causal clues. The real-time context tensor is input into the decision network model that has been trained and has its parameters fixed, and the feature latent vector of the current state is extracted using a multi-head causal self-attention mechanism. The feature vector is then calculated and output through prediction network inference mapping. The next step involves generating an initial action probability distribution tensor for all candidate clamping points. A dynamic anti-collision legality constraint logic is introduced. The algorithm traverses the previously executed clamping point sequence, retrieving clamping point tags that have been operated in previous process steps. Then, in the initial action probability distribution tensor, the probability score values ​​corresponding to all previously operated clamping point tags are forcibly modified to negative infinity. This uses probability space shielding to prevent fixture interference and collisions caused by repeated clamping. A maximum value retrieval algorithm is used to search the probability distribution tensor after the dynamic anti-collision constraint correction, outputting the legal action ID tag with the highest probability score as the current dynamic optimal clamping instruction. This instruction is converted into a control signal within milliseconds and output to the external clamping device, driving the actuator to perform the next optimal clamping operation on the workpiece.

[0031] In this step, the dynamic collision avoidance legality constraint logic includes: Basic variables and set definitions: Suppose there are a total of N clamping points planned on the workpiece, and all points constitute the universal set V: In the current process step of actual production (step t, where 1≤t≤N), the clamping actions that have been completed in the control system's operation record constitute the historical executed sequence. The set of points that have been operated on is defined as follows: : Accordingly, the set of truly legal and manipulable candidate unclamped points in the current physical spacetime. Defined as the complement of the entire set and the set that has been executed: Initial probability output model: After the system collects the real-time context tensor of the current step and inputs it into the trained decision Transformer model, the initial prediction score of each point in the entire set V at the network output (before the Softmax layer, i.e., the unnormalized raw score Logits) is a vector. : in The model predicts the raw energy score for the i-th point as the next clamping action.

[0032] Dynamic probability mask matrix (Mask) construction: In order to mask historical data points at the algorithmic level, a mask matrix with dimension is constructed. Dynamic legality mask vector The piecewise mathematical model for the values ​​of its elements is as follows: Penalty masking correction calculation model: The core logic of dynamic collision avoidance uses element-wise addition to adjust the mask vector. The initial output vector applied to the model This allows us to obtain the corrected legalized score vector. : When expanded into specific component forms, it manifests as follows: After this step of calculation, the energy score of all historically executed points is instantly and forcibly reduced to [a value]. Meanwhile, the model retains its original predictive activity and trends at points where the current process steps are legally available.

[0033] Optimal instruction retrieval output: Discarding any illegal positions that might trigger fixture interference, the system performs an optimal search on the corrected legal probability space using the maximum value retrieval (Argmax) model, outputting the absolutely safe dynamic optimal clamping instruction at step t. : because ,therefore: The optimal action ultimately output by the model It belongs to a legal unassembled set This closed loop prevented on-site physical collisions caused by repeated clamping, and at the same time, parallel matrix-level multiplication and addition were implemented at the computation layer to ensure millisecond-level dynamic response.

[0034] Based on any or a combination of the above embodiments, the present invention also provides a workpiece clamping sequence intelligent optimization system based on state-interleaved Transformer, used to implement the method involved in any of the above embodiments, including: The first main control module is used to acquire the physical model of the workpiece under different clamping conditions. It adopts an optimization strategy with trial and error and state rollback mechanism to carry out multiple rounds of path iteration evolution. At each decision, it traverses the current unclamped target points and evaluates their deformation index. It selects the points that meet the requirements as the current optimal action and executes state rollback after solidifying the physical state characteristics corresponding to the optimal action. The loop continues until all points are allocated, generating time-series sample data composed of alternating physical states and operation actions. The second main control module is used to map the physical state features and operation action features to the hidden feature space of the same dimension respectively. The sequence interleaving algorithm is used to strictly interleave and splice the two according to the time step and superimpose the position encoding to construct a model input tensor that explicitly retains the temporal features of clamping sequence. The third main control module is used to construct a decision network model with a self-attention mechanism and to train the decision network model using the model input tensor. The fourth main control module is used to collect the current physical state characteristics of the workpiece and the historical clamping sequence in the operation record in real time. It constructs a real-time context tensor according to the sequence interleaving algorithm of the second main control module and inputs it into the decision network model trained in the third main control module. It calculates the initial action probability distribution, and based on the dynamic legality anti-collision constraint logic, it traverses the historical executed sequence and performs a penalty masking correction on the probability scores of the points that have been operated in the initial action probability distribution. It performs an optimal search on the corrected probability distribution, outputs the legal action command with the highest score, and controls the external clamping equipment to execute the next clamping decision. This invention deeply decouples and integrates the "offline enhanced data generation paradigm" with "online sequential causal reasoning decision-making," achieving a simultaneous leap in the accuracy of clamping deformation control for weakly stiff workpieces, online response speed, and absolute safety interaction throughout the entire process. In the offline data construction stage, a greedy path optimization strategy incorporating a "trial-and-error" mechanism is adopted. A finite element implicit mechanical solver is used to control the physical model to establish temporary analysis steps for numerical solutions, accurately capturing the displacement field and average deformation of each candidate point after clamping. Combined with state anchor points and optimal action solidification technology, high-quality time-series sample data is packaged, thus fundamentally overcoming the technical bottleneck of traditional "online iterative simulation" where frequent calls to the finite element solver lead to exponentially increasing computational time costs and extremely high computing power. This significantly improves the path planning efficiency before machining high-precision thin-walled structural parts. In the online inference control stage of actual production, by aligning continuous physical states with discrete clamping actions through high-dimensional heterogeneous feature mapping, and performing zipper-like interweaving and position encoding superposition according to physical time steps, the global optimal constant control of complex multi-step clamping processes is achieved by using a decision Transformer model with an upper triangular causal mask matrix to strictly adhere to the physical temporal causality law. On this basis, a dynamic anti-collision legality constraint logic based on parallel matrix-level superposition operation is further established. The algorithm traverses the historical clamping sequence in real time, forcibly masks and corrects the probability scores of the points that have been operated in the initial action probability distribution tensor to negative infinity, and converts them into the optimal legal action command within milliseconds through a maximum value retrieval model and outputs it to the external equipment on site. The algorithm mechanism completely blocks the fixture interference and collision hazards caused by repeated clamping, meeting the industrial requirements of real-time dynamic decision-making and absolute safe interaction in intelligent manufacturing sites.

[0035] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for intelligent optimization of workpiece clamping sequence based on state-intertwined Transformer, characterized in that, Includes the following steps: S100: Obtain the physical model of the workpiece under different clamping conditions, and use an optimization strategy with trial and error and state rollback mechanism to perform multiple rounds of path iteration evolution. At each decision, traverse the current unclamped target points and evaluate their deformation index, select the points that meet the requirements as the current optimal action, and perform state rollback after solidifying the physical state characteristics corresponding to the optimal action. Repeat until all points are allocated, and generate time-series sample data composed of alternating physical states and operation actions. S200: Map the physical state features and operation action features generated in step S100 to the hidden feature space of the same dimension respectively. Use the sequence interleaving algorithm to strictly interleave and splice the two according to the time step and superimpose the position encoding to construct a model input tensor that explicitly retains the temporal features of clamping sequence. S300, Construct a decision network model with a self-attention mechanism, and train the decision network model using the model input tensor; S400: Real-time acquisition of the current physical state characteristics of the workpiece and the historical clamping sequence in the operation record; construction of a real-time context tensor according to the sequence interleaving algorithm in step S200; input into the decision network model trained in step S300; calculation of the initial action probability distribution; based on the dynamic legality anti-collision constraint logic; traversal of the historical executed sequence; penalty masking correction of the probability scores of the already operated points in the initial action probability distribution; optimal retrieval of the corrected probability distribution; output of the legal action instruction with the highest score; control of the external clamping equipment to execute the next clamping decision.

2. The intelligent optimization method for workpiece clamping sequence based on state-intertwined Transformer according to claim 1, characterized in that, The construction steps of time-series sample data in step S100 specifically include: S101, In the offline data generation stage, the physical model of the workpiece clamping is initialized, the geometric model is imported, the material properties are set and the mesh is generated, and the support reaction tensor in the initial unloaded state is extracted as the state anchor point. S102, using the state anchor point as a physical reference, randomly select and execute the first clamping action from all clamping points. The first clamping state is simulated by fixing the multi-axis displacement of the lower surface of the initial clamping position in the physical model and applying downward pressure to the corresponding upper surface. S103, For all remaining unclamped candidate points, establish a temporary analysis step for each candidate point in the physical model for trial purposes, and apply boundary conditions to solve the force equilibrium state of the workpiece. S104. After the solution is completed, the displacement field of the workpiece node set in each temporary analysis step is extracted, and the average deformation of the workpiece is calculated based on the displacement components of each node in different coordinate axis directions, which is used as the deformation index. S105. Compare the trial results of the average deformation corresponding to all candidate points, record the candidate point that minimizes the average deformation of the workpiece, and select it as the current optimal clamping action. S106, Execute state rollback operation, delete all temporary analysis steps used for trial to ensure the continuity of model state, then formally apply the optimal clamping action to the physical model, and extract the multi-axis support reaction matrix of each support point of the workpiece as the current solidified physical state. S107, Repeat steps S103 to S106 until all clamping points are assigned, and save the final generated time sequence action list and the corresponding physical state feature matrix list as a single time sequence sample data.

3. The intelligent optimization method for workpiece clamping sequence based on state-intertwined Transformer according to claim 2, characterized in that, The formula for calculating the average deformation includes: , The total number of nodes. , where i is a node This represents the average deformation.

4. The intelligent optimization method for workpiece clamping sequence based on state-intertwined Transformer according to claim 1, characterized in that, Step S200 includes the following steps: S201 inputs the continuous physical state feature vectors from the time-series sample data into a linear fully connected network, and projects them onto a state hidden layer tensor of a set dimension. S202, before constructing the sequence interleaving, extract the state anchor points and perform all-zeroing or linear transformation processing to generate the state anchor point tensor at time zero, which is used as the starting head feature of the entire long sequence to explicitly characterize the initial boundary of the workpiece in the initial unstressed state. S203, construct a long sequence tensor, fill the zero-time state anchor point tensor into the zero index position of the long sequence tensor, then fill the state hidden layer tensor corresponding to each time step into the even index position of the long sequence in sequence, and fill the action hidden layer tensor corresponding to each time step into the odd index position of the long sequence in sequence, forming a causal context string tensor in which state and action strictly alternate and are interwoven in a zipper-like manner on the physical time axis; S204. Based on the absolute index position of each element in the long sequence, calculate and generate an aperiodic learnable position encoding matrix or a sine / cosine fixed position encoding matrix. Add the position encoding matrix to the causal context string tensor in an element-wise addition manner to give the model the ability to capture the absolute temporal sequence and relative spatial topological relationship of the process steps. Finally, construct a model input tensor that explicitly retains the temporal features of the clamping sequence.

5. The intelligent optimization method for workpiece clamping sequence based on state-intertwined Transformer according to claim 4, characterized in that, Step S201 further includes: inputting the action ID label representing the discrete clamping action into the embedding network, and projecting it into an action hidden layer tensor of the same dimension as the state hidden layer tensor, thereby realizing the dimensionality reduction alignment and spatial representation of heterogeneous multimodal features.

6. The intelligent optimization method for workpiece clamping sequence based on state-intertwined Transformer according to claim 4, characterized in that, In step S203, a unified long sequence tensor of length 2T is constructed using a two-pointer or index mapping algorithm, where T is the total number of clamping points of the workpiece.

7. The intelligent optimization method for workpiece clamping sequence based on state-intertwined Transformer according to claim 1, characterized in that, Step S300 includes: S301, Construct a decision Transformer model that includes multiple multi-head self-attention layers and feedforward neural network layers in cascade, and input the model input tensor as contextual clues for the current time step into the decision Transformer model; S302, extract the feature latent vectors of all corresponding physical state positions in the output sequence after calculation by the causal self-attention layer, input the feature latent vectors into the designed action prediction head network, and calculate the initial action probability distribution of all candidate clamping points in the next step through linear layer mapping and probabilistic activation. S303, extract the corresponding true optimal clamping action label from the time-series sample data, calculate the cross-entropy loss function between the initial action probability distribution output by the action prediction head network and the true optimal clamping action label, for the initial random exploration stage in the time-series sample data, use all-zero loss mask weights to eliminate the interference of random exploration error, configure all-one loss mask weights for the effective process stage, perform weighted correction on the cross-entropy loss function according to the loss mask weights, calculate the gradient of global network parameters through the gradient backpropagation algorithm, and use the optimizer to perform global iterative update and fixation of the weights of the entire decision network model.

8. The intelligent optimization method for workpiece clamping sequence based on state-intertwined Transformer according to claim 7, characterized in that, During the calculation of the weight matrix of the multi-head self-attention layer, a causal mask matrix is ​​constructed in which all elements in the upper triangular region are negative infinity and all elements in the lower triangular and diagonal regions are zero. The causal mask matrix is ​​superimposed on the attention weight scoring matrix and Softmax normalized to forcibly block the backward propagation of future time sequence information to the past or current time step, thus restricting the model to only capture the physical state and clamping action features that have occurred in the past and when predicting the action of the current step.

9. The intelligent optimization method for workpiece clamping sequence based on state-intertwined Transformer according to claim 1, characterized in that, In step S400, the step of traversing the historical executed sequence and penalizing the masking correction of the probability scores belonging to the already operated points in the initial action probability distribution includes: Based on the dynamic legality anti-collision constraint logic, the historical execution sequence of clamping points is traversed to retrieve the clamping point labels that have been operated in previous process steps. Then, in the initial action probability distribution tensor, the probability score values ​​corresponding to all the clamping point labels that have been operated are forcibly modified to negative infinity. The probability space shielding blocks the fixture interference and collision caused by repeated clamping. The optimal retrieval of the corrected probability distribution includes: using a maximum value retrieval algorithm to retrieve the probability distribution tensor after the dynamic anti-collision constraint correction, and outputting the legal action ID tag with the highest probability score as the dynamic optimal clamping instruction at the current moment.

10. A workpiece clamping sequence intelligent optimization system based on state-interleaved Transformer, characterized in that, include: The first main control module is used to acquire the physical model of the workpiece under different clamping conditions. It adopts an optimization strategy with trial and error and state rollback mechanism to carry out multiple rounds of path iteration evolution. At each decision, it traverses the current unclamped target points and evaluates their deformation index. It selects the points that meet the requirements as the current optimal action and executes state rollback after solidifying the physical state characteristics corresponding to the optimal action. The loop continues until all points are allocated, generating time-series sample data composed of alternating physical states and operation actions. The second main control module is used to map the physical state features and operation action features to the hidden feature space of the same dimension respectively. The sequence interleaving algorithm is used to strictly interleave and splice the two according to the time step and superimpose the position encoding to construct a model input tensor that explicitly retains the temporal features of clamping sequence. The third main control module is used to construct a decision network model with a self-attention mechanism and to train the decision network model using the model input tensor. The fourth main control module is used to collect the current physical state characteristics of the workpiece and the historical clamping sequence in the operation record in real time. It constructs a real-time context tensor according to the sequence interleaving algorithm of the second main control module and inputs it into the decision network model trained in the third main control module. The initial action probability distribution is calculated. Based on the dynamic legality anti-collision constraint logic, it traverses the historical executed sequence and performs a punitive masking correction on the probability score of the operation point in the initial action probability distribution. The corrected probability distribution is then optimized and the legal action instruction with the highest score is output to control the external clamping equipment to execute the next clamping decision.

Citation Information

Patent Citations

  • A local bonding and clamping method for reducing deformation during turning of disc-shaped planar components

    CN113351891B