Method and system for predicting internal temperature in accumulative skew rolling process of magnesium alloy pipe

By constructing a machine learning-based internal temperature prediction system for magnesium alloy tubes, and combining a finite element model with a neural network based on the Transformer architecture, real-time temperature sensing and precise control during the production process of magnesium alloy tubes were achieved. This solved the problem of insufficient temperature prediction in existing technologies and improved production efficiency and product quality.

CN121869874APending Publication Date: 2026-04-17TAIYUAN UNIVERSITY OF SCIENCE AND TECHNOLOGY +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TAIYUAN UNIVERSITY OF SCIENCE AND TECHNOLOGY
Filing Date
2026-01-15
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies are insufficient to meet the requirements of real-time sensing and accurate prediction of internal temperature during the production process of magnesium alloy tubes, which makes it impossible to achieve real-time control and dynamic adjustment in intelligent manufacturing, resulting in high scrap rates and low production efficiency.

Method used

An internal temperature prediction system for magnesium alloy tubes during cumulative skew rolling was constructed using a machine learning-based approach, combining a three-dimensional nonlinear thermo-coupled finite element model and a neural network model based on the Transformer architecture. This system collects and processes process parameters in real time, and achieves real-time prediction and control of the internal temperature through the machine learning model.

Benefits of technology

It enables real-time online prediction of the internal temperature of magnesium alloy tubes, with fast response speed and high prediction accuracy, meeting the requirements of closed-loop control, significantly reducing scrap rate, and improving product quality consistency and production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121869874A_ABST
    Figure CN121869874A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of metal material processing intelligent control, and relates to an internal temperature prediction method and system in the accumulative skew rolling process of a magnesium alloy pipe, and the method specifically comprises the steps: firstly, collecting a plurality of technological parameters in the accumulative skew rolling process of the magnesium alloy pipe, and obtaining corresponding magnesium alloy pipe internal temperature label data through finite element simulation; secondly, training a machine learning model by taking the process parameters as input and the magnesium alloy pipe internal temperature label data as output; and finally, integrating the trained machine learning model into a process control system, receiving process parameters in real time, and outputting corresponding magnesium alloy pipe internal temperature prediction data in real time by the machine learning model. According to the method, a mechanism model and a data driving method are fused, a mapping model between rolling process parameters and the internal temperature field of the magnesium alloy pipe is constructed by utilizing a machine learning algorithm, and real-time and accurate prediction of the internal state of the magnesium alloy pipe in the accumulative skew rolling process is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent control technology for metal material processing, and relates to a method and system for predicting the internal temperature during the cumulative skew rolling process of magnesium alloy tubes, particularly a method and system for predicting the internal temperature during the cumulative skew rolling process of magnesium alloy tubes based on machine learning. Background Technology

[0002] Skew rolling technology is a core method for producing high-quality magnesium alloy tubes. Its operation is a complex thermodynamic process involving multiple passes and coupled parameters. The parameters involved are extensive, including roll speed, feed angle, skew angle, and rolling temperature. These parameters interact with each other and jointly determine the final microstructure, mechanical properties, and dimensional accuracy of the magnesium alloy tube.

[0003] However, significant bottlenecks exist in the current perception and control of critical states such as temperature distribution inside magnesium alloy tubes during the rolling process. First, there is a strong reliance on numerical simulation. Traditional methods typically employ the finite element method for process analysis, which offers high accuracy but is extremely time-consuming, making it unsuitable for real-time feedback and dynamic control of the production line. Second, there is a lag in detection. Traditional offline sampling inspection methods cannot achieve 100% online quality monitoring across the entire process and all dimensions. Often, by the time problems are exposed, the optimal time for handling them has been missed, resulting in irreparable losses.

[0004] Therefore, existing technologies are insufficient to meet the demands of intelligent manufacturing for real-time perception, accurate prediction, and proactive control of the production process. There is an urgent need to develop a method that can directly and quickly predict the internal state of magnesium alloy tubes based on measurable process parameters. This is crucial for reducing scrap rates and achieving intelligent production. Summary of the Invention

[0005] To address the shortcomings of the existing technologies, this invention provides a method and system for predicting the internal temperature during the cumulative skew rolling process of magnesium alloy tubes based on machine learning, in order to solve the problem that existing technologies cannot meet the requirements of intelligent manufacturing for real-time perception, accurate prediction and proactive control of the production process.

[0006] This invention provides a method for predicting the internal temperature during the cumulative skew rolling process of magnesium alloy tubes, comprising the following steps: S1. Collect various process parameters from each cumulative skew rolling process of magnesium alloy tubes to form several feature sets; S2. Construct a three-dimensional nonlinear thermo-mechanical coupled finite element model of magnesium alloy tube during the cumulative skew rolling process. Take the feature set in step S1 as input and output the internal temperature label data of magnesium alloy tube corresponding to each feature set. S3. Preprocess each feature set and its corresponding internal temperature label data of magnesium alloy tubes, and use the preprocessed data as the total dataset. Then, divide the total dataset into training set, validation set and test set according to the proportion. The training set / validation set / test set all include each feature set and its corresponding internal temperature label data of magnesium alloy tubes. S4. Using the feature set as input and the internal temperature label data of the magnesium alloy tube as output, construct an initial machine learning model and input the training set and validation set into the initial machine learning model for training and optimization to obtain the target machine learning model. S5. Use the test set to evaluate the performance of the target machine learning model. If the evaluation is successful, integrate the target machine learning model into the process control system. Otherwise, return to step S3 to re-divide the total dataset into training, validation and test sets proportionally, and repeat steps S4-S5 until the evaluation is successful. S6. During the cumulative skew rolling process of magnesium alloy tubes, the process control system receives and preprocesses the process parameters in real time according to the set time interval. Then, the preprocessed process parameters are input into the target machine learning model. The target machine learning model outputs the corresponding internal temperature prediction data of the magnesium alloy tube in real time and feeds it back to the process control system. The process control system then transmits the prediction results fed back by the target machine learning model to the human-machine interface for display in real time.

[0007] Preferably, the various process parameters in each cumulative skew rolling process of magnesium alloy tubes include equipment geometric parameters, process operating parameters, temperature parameters, and material data. Among them, the equipment geometric parameters include roll diameter, roll profile curve, feed angle, rolling angle, and mandrel diameter; the process operating parameters include the main motor speed of each stand, rolling force, rolling torque, roll speed, and motor current; the temperature parameters are the tube surface temperature sequence collected by several infrared thermometers installed at the outlet of the annular heating furnace, the reheating furnace, and the inlet and outlet of the rolling process; and the material data include the coded steel grade, the initial outer diameter of the tube blank, the wall thickness, and the length.

[0008] Preferably, step S2 specifically includes:

[0009] S21. Based on the material constitutive parameters, rolling equipment geometric parameters, and thermophysical parameters during the cumulative skew rolling process of magnesium alloy tubes, a three-dimensional nonlinear thermo-mechanical coupled finite element model is constructed. The material constitutive parameters include elastic modulus, Poisson's ratio, and coefficient of thermal expansion. The rolling equipment geometric parameters include roll diameter, feed angle, and mandrel diameter. The thermophysical parameters include thermal conductivity, specific heat capacity, and interfacial friction coefficient.

[0010] S22. Using the feature set in step S1 as the boundary and load conditions for simulation, input the three-dimensional nonlinear thermo-coupled finite element model to perform high-precision thermo-coupled finite element simulation analysis and obtain the internal temperature field distribution data of the magnesium alloy tube corresponding to each feature set.

[0011] S23. Extract key indicators with clear physical meaning from the internal temperature field distribution data of the magnesium alloy tube corresponding to each feature set, and use them as internal temperature label data of the magnesium alloy tube corresponding to each feature set. The internal temperature label data of the magnesium alloy tube corresponding to each feature set includes the core temperature of the cross section, the surface temperature, and the temperature gradient between the core and the surface.

[0012] Preferably, preprocessing includes data cleaning, feature encoding, feature selection, and data standardization;

[0013] In addition, the training set, accounting for 70% to 80% of the total dataset, is used to train the initial machine learning model; the validation set, accounting for 10% to 15% of the total dataset, is used to monitor the training effect of the initial machine learning model, adjust the hyperparameters of the initial machine learning model and prevent overfitting; and the test set, accounting for 10% to 15% of the total dataset, is used to evaluate the performance of the target machine learning model and test its generalization ability.

[0014] Preferably, the initial machine learning model is a neural network model based on the Transformer architecture, wherein the neural network model based on the Transformer architecture includes an input layer, an input embedding layer, a positional encoding layer, an encoder layer, a decoder layer, and an output layer. The encoder layer contains a multi-head self-attention mechanism and a feedforward neural network, and the decoder layer contains a multi-head masked self-attention mechanism, a multi-head cross self-attention mechanism, and a feedforward neural network. A random deactivation layer is set after the input embedding layer and a random deactivation layer is also set before the output layer.

[0015] Furthermore, the specific steps for building a neural network model based on the Transformer architecture are as follows:

[0016] S411. Model Input Construction: Construct a multi-dimensional time series matrix from the feature sets of N time steps. ,in This is a multidimensional time series dataset of process parameters, where N is the time window length, d is the feature dimension, and R is the set of real numbers, indicating that all elements in the matrix are real numbers.

[0017] S412, Model Structure Design:

[0018] (1) Input embedding layer: Encodes the original parameter sequence in the constructed multidimensional time series matrix and maps it to a high-dimensional space;

[0019] (2) Position encoding layer: Introduces a learnable position encoding method to provide the temporal order information of each process parameter in the sequence for the neural network model based on the Transformer architecture;

[0020] (3) Encoder layer: It is composed of several encoder modules stacked together. Each encoder module is composed of several multi-head self-attention mechanism sub-modules and feedforward neural network sub-modules stacked together. Each sub-module is followed by a residual connection and a normalization layer. Feature fusion is achieved through the residual connection and the normalization layer.

[0021] (4) Decoder layer: It is composed of several decoder modules stacked together. Each decoder module is composed of several multi-head masked self-attention mechanism sub-modules, multi-head cross self-attention mechanism sub-modules and feedforward neural network sub-modules stacked together. Each sub-module is followed by a residual connection and a normalization layer. Feature fusion is achieved through the residual connection and the normalization layer.

[0022] (5) Output layer: After the decoder output, a fully connected layer is connected to directly regress the predicted temperature data inside the magnesium alloy tube.

[0023] Preferably, within each encoder module and decoder module, a random deactivation layer is set after each of its sub-modules;

[0024] In each encoder module, the various types of sub-modules are combined according to a cross-stacking strategy. Specifically, the stacking pattern is as follows: starting with the multi-head self-attention mechanism sub-module, followed by the feedforward neural network sub-module, and then repeating this sequence cyclically. In each decoder module, the various types of sub-modules are combined according to a cross-stacking strategy. Specifically, the stacking pattern is as follows: starting with the multi-head masked self-attention mechanism sub-module, followed by the multi-head cross self-attention mechanism sub-module and the feedforward neural network sub-module, and then repeating this sequence cyclically.

[0025] Furthermore, the feedforward neural network submodules in both the encoder and decoder modules employ a two-layer fully connected structure, as shown in the following calculation formula:

[0026]

[0027] In the formula, FFN is a feedforward neural network, X is the input matrix; W1 and W2 are weight matrices, and the dimension of W1 is... The dimension of W2 is b1 and b2 are bias vectors, with b1 having dimension 1. The dimension of b2 is ReLU is a non-linear activation function.

[0028] Preferably, step S4, which involves inputting the training set and validation set into the initial machine learning model for training and optimization, specifically involves:

[0029] S421. Input the training set into the initial machine learning model for training. During the training process, use the loss function to quantify the difference between the predicted value and the true value. By minimizing the loss function, continuously adjust the parameters of the initial machine learning model to gradually improve the prediction accuracy of the initial machine learning model and complete the training of the initial machine learning model.

[0030] S422. During the training of the initial machine learning model using the training set, the validation set is used for optimization, specifically as follows:

[0031] (1) Overfit detection and suppression: After a certain number of training rounds, the validation loss of the current initial machine learning model is calculated using the validation set and used as the validation evaluation index. If the training loss is observed to continue to decrease but the validation loss tends to stabilize or increase, it is determined that the initial machine learning model is "overfitting". At this time, the Dropout regularization mechanism is triggered, that is, some neural network nodes are randomly dropped during the training process, forcing the initial machine learning model to learn more robust feature representations, reducing the dependence on specific training samples, and improving the generalization ability.

[0032] (2) Hyperparameter optimization: Based on the performance of the validation set, the key hyperparameters of the initial machine learning model are tuned using hyperparameter optimization tools. Through comparative experiments of multiple sets of hyperparameter combinations, the key hyperparameter combinations that enable the initial machine learning model to achieve the best performance on the validation set are selected to obtain the best performance of the initial machine learning model. The key hyperparameters include the time window length, the number of heads in the multi-head self-attention layer, the number of hidden nodes in the feedforward neural network, and the learning rate.

[0033] Preferably, step S5, which uses a test set to evaluate the performance of the target machine learning model, specifically involves:

[0034] First, the feature set data of the test set is input into the target machine learning model, and the target machine learning model outputs the corresponding predicted data of the internal temperature of the magnesium alloy tube.

[0035] Secondly, the predicted internal temperature data of magnesium alloy tubes and the internal temperature label data of magnesium alloy tubes are quantitatively compared using evaluation metrics to obtain evaluation results. If the evaluation is passed, it indicates that the target machine learning model has good generalization ability and can be used; otherwise, the target machine learning model is retrained, where the evaluation metrics are mean absolute error or root mean square error.

[0036] Furthermore, the specific steps for integrating the target machine learning model into the process control system are as follows:

[0037] S51. Solidify the target machine learning model into an executable file;

[0038] S52. Integrate and deploy the solidified target machine learning model executable file into the process control system of the tube rolling mill, specifically as follows:

[0039] S521. On the process control system of the tube rolling mill, complete the installation of executable files and environment configuration;

[0040] S522. Establish a data interface based on industrial communication protocols to ensure bidirectional data communication between the target machine learning model and the mill control system, that is, to enable the solidified target machine learning model executable file to read production data and feed back prediction results in real time.

[0041] S523. Integrate the prediction results of the target machine learning model into the human-machine interaction display module of the rolling mill, so that operators can see the predicted temperature in real time, and configure a graded early warning mechanism and a closed-loop optimization mechanism.

[0042] Preferably, the graded early warning mechanism is as follows: The operation engineer will pre-set the target temperature range and graded early warning threshold in the process control system according to the product quality requirements and production process standards of the magnesium alloy tube. When the predicted internal temperature of the magnesium alloy tube received by the process control system exceeds the target temperature range and reaches the graded early warning threshold, the system will automatically issue the corresponding audible and visual alarm signal to remind the operation engineer to pay attention in time and take corresponding adjustment measures.

[0043] The closed-loop optimization mechanism is as follows: The process control system will periodically calculate the deviation between the predicted internal temperature data of the magnesium alloy tube and the measured internal temperature data of the magnesium alloy tube obtained by the high-precision online monitoring equipment. When the deviation is within the preset range, no adjustment is required; when the deviation exceeds the preset range, the process control system will automatically trigger the model fine-tuning program of the target machine learning model and use the latest measured data and process parameter data to adjust the local parameters of the target machine learning model.

[0044] This invention also provides an internal temperature prediction system for the cumulative skew rolling process of magnesium alloy tubes, used to execute the internal temperature prediction method during the cumulative skew rolling process of magnesium alloy tubes, including: Data acquisition module: Collects various process parameters from each cumulative skew rolling process of magnesium alloy tubes, forming several feature sets; Finite element simulation module: Input the feature set into the three-dimensional nonlinear thermo-mechanical coupled finite element model of the cumulative skew rolling process of magnesium alloy tube, and obtain the internal temperature label data of magnesium alloy tube corresponding to each feature set; Data preprocessing module: preprocesses each feature set and its corresponding internal temperature label data of magnesium alloy tubes, and uses the preprocessed data as the total dataset. Then, the total dataset is divided into training set, validation set and test set according to the proportion. The training set / validation set / test set all include each feature set and its corresponding internal temperature label data of magnesium alloy tubes. Model building module: Using the feature set as input and the internal temperature label data of magnesium alloy tube as output, an initial machine learning model is built, and the training set and validation set are input into the initial machine learning model for training and optimization to obtain the target machine learning model; Model evaluation module: Uses a test set to evaluate the performance of the target machine learning model, and integrates the target machine learning model into the real-time detection and display module after passing the evaluation; Real-time detection and display module: During the cumulative skew rolling production of magnesium alloy tubes, the module receives and preprocesses the process parameters in real time at set time intervals. Then, it inputs the preprocessed process parameters into the built-in target machine learning model, receives the corresponding predicted internal temperature data of the magnesium alloy tubes in real time from the target machine learning model, and uploads it to the human-machine interface for real-time display.

[0045] Compared with the prior art, the present invention has the following beneficial effects:

[0046] 1. This invention integrates mechanistic models and data-driven methods, and uses machine learning algorithms to construct a mapping model between rolling process parameters and the internal temperature field of magnesium alloy tubes, thereby realizing real-time online prediction of key physical quantities, namely the internal temperature data of magnesium alloy tubes.

[0047] 2. This invention transforms internal states that cannot be measured online into key process indicators that can be perceived in real time, with a response speed of milliseconds. It not only achieves accurate real-time prediction but also meets the timeliness requirements of closed-loop control.

[0048] 3. This invention utilizes the powerful nonlinear fitting capability of machine learning to overcome the limitations of traditional models, accurately characterize the mapping relationship between complex process parameters and internal states, and has high prediction accuracy and strong generalization ability.

[0049] 4. This invention provides core model support for realizing proactive quality control based on prediction results, online optimization of process parameters, and full-process digital twins. It is a key technology for the transformation from "experience-driven" production to "data-driven" production.

[0050] 5. This invention can effectively and significantly reduce the waste of trial rolling materials, reduce the dependence on physical simulation methods, greatly shorten the R&D cycle of new products, and significantly improve the product qualification rate and quality consistency.

[0051] 6. This invention adopts a neural network model based on the Transformer architecture. Compared with traditional models, it can capture the long-term coupling relationship of multiple process parameters in parallel through a multi-head self-attention mechanism, and pay attention to the process parameters of all time steps at the same time. It can solve the problem that the model is prone to forgetting the influence of parameters in the previous few seconds on the current temperature under long cycles, and is suitable for scenarios with many parameters and complex changes, such as skew rolling.

[0052] 7. This invention establishes a closed-loop optimization mechanism, which periodically calculates the deviation between the predicted internal temperature data of the magnesium alloy tube and the measured internal temperature data of the magnesium alloy tube obtained through high-precision online monitoring equipment, and processes the deviation accordingly, thereby ensuring that the neural network model based on the Transformer architecture always maintains good adaptive ability and prediction performance.

[0053] 8. The skew rolling temperature is affected by many factors. When using traditional models for prediction, parameters are often missed. Moreover, due to the inconsistent units of the parameters, it is difficult to perform collaborative calculations. This invention first integrates various parameters systematically, and then unifies the processing units to ensure that the neural network model based on the Transformer architecture can fully incorporate all influencing factors, thereby achieving more accurate and comprehensive predictions. Attached Figure Description

[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 This is a flowchart of the internal temperature prediction method during the cumulative skew rolling process of magnesium alloy tubes in this embodiment of the invention;

[0056] Figure 2 This is a schematic diagram of the basic structure of the neural network model based on the Transformer architecture in an embodiment of the present invention.

[0057] Figure 3 This is a schematic diagram of the self-attention mechanism of a neural network model based on the Transformer architecture in an embodiment of the present invention;

[0058] Figure 4 This is a schematic diagram of the feedforward neural network submodule structure in an embodiment of the present invention. Detailed Implementation

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

[0060] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. The terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, unless otherwise explicitly specified and limited, the terms "installed," "connected," and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0061] like Figure 1 As shown, this invention provides a method for predicting the internal temperature during the cumulative skew rolling process of magnesium alloy tubes, including the following steps:

[0062] S1. Collect various process parameters from the cumulative skew rolling process of magnesium alloy tubes to form several feature sets.

[0063] In this application, the various process parameters in each cumulative skew rolling process of magnesium alloy tubes include equipment geometric parameters, process operating parameters, temperature parameters, and material data.

[0064] In this application, multi-dimensional data related to the cumulative skew rolling process of magnesium alloy tubes are comprehensively collected from multiple channels, including the rolling mill's basic automation system, process control system, manufacturing execution system, and sensor network. This data constitutes the feature set of the machine learning model in this application, specifically covering the following four types of process parameters:

[0065] (1) Equipment geometric parameters: The roll diameter, roll profile curve, feed angle, rolling angle, and mandrel diameter are accurately measured and recorded using professional measuring tools and equipment. It is important to ensure that the measuring tools meet the accuracy requirements during the measurement process, and to perform multiple measurements on the same parameter to reduce errors. Finally, the accurate measurement data is incorporated into the feature set.

[0066] (2) Process operating parameters: Using sensors installed on the main motors and related equipment of each stand of the rolling mill, process operating parameters such as the speed of the main motor of each stand, rolling force, rolling torque, roll speed, and motor current are collected in real time. It should be noted that the sensors need to be calibrated regularly to ensure the accuracy and stability of the collected data, and the collected data needs to be transmitted and stored in real time.

[0067] (3) Temperature parameters: Infrared thermometers are installed at the outlet of the annular heating furnace, the reheating furnace, and the inlet and outlet of the rolling process. Multiple infrared thermometers need to be installed at the inlet and outlet of the rolling process to achieve comprehensive monitoring of the tube surface temperature. These infrared thermometers continuously collect temperature data at set time intervals to form a tube surface temperature sequence.

[0068] (4) Material data: Collect the steel grade of magnesium alloy pipe and encode the steel grade according to the preset coding rules. At the same time, measure and record the initial outer diameter, wall thickness and length of the pipe blank to ensure the accuracy and completeness of the data.

[0069] In this embodiment, the equipment geometric parameters include roll diameter, roll profile curve, feed angle, rolling angle, and mandrel diameter; the process operation parameters include the main motor speed of each stand, rolling force, rolling torque, roll speed, and motor current; the temperature parameters are the tube surface temperature sequence collected by several infrared thermometers installed at the outlet of the annular heating furnace, the reheating furnace, and the inlet and outlet of the rolling process; the material data include the steel grade, initial outer diameter of the tube blank, wall thickness, and length after encoding.

[0070] S2. Construct a three-dimensional nonlinear thermo-mechanical coupled finite element model of the magnesium alloy tube during the cumulative skew rolling process. Using the feature set in step S1 as input, output the internal temperature label data of the magnesium alloy tube corresponding to each feature set.

[0071] In this application, step S2 specifically includes:

[0072] S21. Based on the material constitutive parameters, rolling equipment geometric parameters, and thermophysical parameters during the cumulative skew rolling process of magnesium alloy tubes, a three-dimensional nonlinear thermo-mechanical coupled finite element model is constructed.

[0073] In this application, the constitutive parameters of the material include the elastic modulus, Poisson's ratio, and coefficient of thermal expansion; the geometric parameters of the rolling equipment include the roll diameter, feed angle, and mandrel diameter; and the thermophysical parameters include thermal conductivity, specific heat capacity, and interfacial friction coefficient.

[0074] S22. Using the feature set in step S1 as the boundary and load conditions for simulation, input the three-dimensional nonlinear thermo-coupled finite element model to perform high-precision thermo-coupled finite element simulation analysis and obtain the internal temperature field distribution data of the magnesium alloy tube corresponding to each feature set.

[0075] It should be emphasized that the realization of high-precision thermo-mechanical coupled finite element simulation in this application depends on the accurate characterization of the mechanical and thermophysical behavior of magnesium alloy materials under high temperature and high strain rate. Therefore, based on the material constitutive parameters, rolling equipment geometric parameters and thermophysical parameters in the cumulative skew rolling process of magnesium alloy tubes, a three-dimensional nonlinear thermo-mechanical coupled finite element model is constructed in this application to carry out high-precision thermo-mechanical coupled finite element simulation analysis.

[0076] S23. Extract key indicators with clear physical meaning from the internal temperature field distribution data of the magnesium alloy tube corresponding to each feature set, and use them as internal temperature label data of the magnesium alloy tube corresponding to each feature set.

[0077] It should be noted that, in the embodiments of this application, after performing high-precision thermo-coupling finite element simulation analysis, the temperature field distribution data inside the magnesium alloy tube corresponding to each feature set is full-field data, including stress field, strain field, heat generation rate, core temperature of cross-section, surface temperature, and temperature gradient between the core and surface. However, the amount of data on the temperature field distribution inside the magnesium alloy tube is too large, and some data is not suitable for direct use in machine learning model training. Therefore, in this application, the full-field data is condensed into key indicators, that is, key indicators with clear physical meaning are extracted from the temperature field distribution data inside the magnesium alloy tube corresponding to each feature set, to obtain internal temperature label data of magnesium alloy tube suitable for direct use in machine learning model training.

[0078] In this application, the key indicators with clear physical meaning extracted from the internal temperature field distribution data of magnesium alloy tubes include spatial distribution indicators and gradient indicators. The spatial distribution indicators include the core temperature and surface temperature of the cross-section, while the gradient indicators are the temperature gradient between the core and the surface. Therefore, the internal temperature label data of the magnesium alloy tube corresponding to each feature set in this application includes the core temperature, surface temperature, and temperature gradient between the core and the surface of the cross-section.

[0079] S3. Preprocess each feature set and its corresponding internal temperature label data of magnesium alloy tubes. Use the preprocessed data as the total dataset. Then divide the total dataset into training set, validation set and test set according to the proportion. Each training set, validation set and test set includes each feature set and its corresponding internal temperature label data of magnesium alloy tubes.

[0080] In this application, preprocessing includes data cleaning, feature encoding, feature selection, and data standardization.

[0081] In this embodiment, data cleaning involves using statistical methods and data mining techniques to comprehensively examine the original data, identifying and processing missing and outlier values. Specifically, missing values ​​are supplemented using linear interpolation; for outliers, data exceeding a reasonable threshold range is removed, or smoothing methods are used to correct them, ensuring data integrity and accuracy.

[0082] In this embodiment of the application, the feature encoding is as follows: for non-numerical features in the feature set, such as steel grade numbers that have been encoded, a suitable encoding method is used to convert them into numerical features that the machine learning model can process, so as to ensure that the machine learning model can learn and analyze these features normally.

[0083] In this embodiment, feature selection is performed using methods such as feature importance analysis and correlation analysis to eliminate redundant features and improve the training efficiency and prediction accuracy of the machine learning model.

[0084] In this embodiment of the application, data standardization is performed by standardizing all cleaned and encoded data using the Z-score method, so that all feature data are within the same numerical range, in order to eliminate the impact of differences in units and numerical ranges between different features on the training of machine learning models, thereby improving the training efficiency and prediction accuracy of machine learning models.

[0085] It should be emphasized that, since the finite element simulation used as the physical model in this application needs to use the original physical parameters to achieve high-fidelity calculation, while the input parameters of the machine learning model need to ensure the input requirements of scale uniformity, this application does not preprocess the input data of the finite element simulation, but only preprocesses the training data of the machine learning model.

[0086] In this application, the training set is used to train the initial machine learning model, accounting for 70% to 80% of the total dataset; the validation set is used to monitor the training effect of the initial machine learning model during the initial machine learning model training process, adjust the hyperparameters of the initial machine learning model and prevent overfitting, accounting for 10% to 15% of the total dataset; and the test set is used to evaluate the performance of the target machine learning model and test the generalization ability of the target machine learning model, accounting for 10% to 15% of the total dataset.

[0087] In this embodiment of the application, when using a test set to evaluate the performance of the target machine learning model, mean absolute error, root mean square error, etc. are used as evaluation metrics.

[0088] S4. Using the feature set as input and the internal temperature label data of the magnesium alloy tube as output, construct an initial machine learning model and input the training set and validation set into the initial machine learning model for training and optimization to obtain the target machine learning model.

[0089] In this application, the initial machine learning model is a neural network model based on the Transformer architecture, and the basic structure of the model is as follows: Figure 2 As shown, the model consists of an encoder and a decoder. The encoder first processes the raw data through an input embedding layer, converting it into an intermediate representation, which is then passed to each decoder. The decoder's input is also processed through the input embedding layer and works in conjunction with this intermediate representation, ultimately generating the prediction result through a fully connected layer. The core structure of the encoder includes a multi-head self-attention mechanism and a feedforward neural network, while the decoder additionally includes two types of self-attention mechanisms: multi-head masked self-attention for processing the decoder input sequence and multi-head cross-attention for establishing a connection with the encoder. Furthermore, each attention mechanism and feedforward neural network is followed by a residual connection and a normalization layer to enhance the model's stability and training effect. Moreover, the core of this model lies in its self-attention mechanism, which automatically calculates and weights the mutual influence of all process parameters at different time steps, thereby more accurately capturing complex nonlinear dynamics. Therefore, this application selects a neural network model based on the Transformer architecture to better capture the temporal dependence and global interaction characteristics of process parameters during the cumulative skew rolling process of magnesium alloy tubes, meeting the real-time monitoring requirements for key quality indicators in magnesium alloy tube skew rolling production.

[0090] It should be noted that the neural network model based on the Transformer architecture in this application adopts an encoder-decoder structure to separate the tasks of feature extraction and prediction generation. The encoder is responsible for encoding the input information and extracting key features and patterns; the decoder, based on the features extracted by the encoder and combined with existing partial prediction results (in autoregressive prediction), gradually generates the final prediction output. These two inputs work together: the first input provides the current conditions, and the second input provides historical temperature trends. Combining them allows for the prediction of future temperatures based on historical temperature trends.

[0091] like Figure 2As shown, the neural network model based on the Transformer architecture in this application has two inputs. The encoder input receives the preprocessed time series of process parameters, processes these parameters, and extracts features. The decoder input specifically receives previous temperature data (such as the temperature predicted a few seconds ago or historical temperature labels). Because temperature changes continuously, this data is shifted one position to the next, and combined with the process parameter features extracted by the encoder, future temperature predictions are generated step by step according to the time sequence of temperature changes. For example, to predict the temperature at the current moment, the model needs to refer to the temperature conditions at previous moments and the current process parameters to ensure that the prediction result conforms to the physical law of continuous temperature change.

[0092] It's important to note that the reason for shifting the data one position to the right in the decoder input is as follows: assuming the historical temperature data is from the 1st, 2nd, and 3rd seconds, to predict the temperature at the 4th second, the model needs to "generate" the prediction for the 3rd second based on the actual temperature from the 1st to 2nd seconds; then, it uses the "actual + predicted" temperature from the 1st to 3rd seconds to generate the prediction for the 4th second, and so on, to achieve the autoregressive prediction logic of "predicting the future step by step".

[0093] The neural network model based on the Transformer architecture used in this application utilizes a self-attention mechanism to calculate the dependencies between different time steps and different features in the process parameter sequence, and predicts the internal temperature data of magnesium alloy tubes based on this relationship.

[0094] In this application, the neural network model based on the Transformer architecture includes an input layer, an input embedding layer, a positional encoding layer, an encoder layer, a decoder layer, and an output layer. The encoder layer contains a multi-head self-attention and feedforward neural network, and the decoder layer contains a multi-head masked self-attention, a multi-head cross self-attention, and a feedforward neural network.

[0095] In this application, the specific steps for constructing the neural network model based on the Transformer architecture are as follows:

[0096] S411. Model Input Construction: Construct a multi-dimensional time series matrix from the feature sets of N time steps. ,in This is a multidimensional time series dataset of process parameters, where N is the time window length, d is the feature dimension, and R is the set of real numbers, indicating that all elements in the matrix are real numbers.

[0097] It should be noted that, in this application, the feature dimension refers to the number of process parameters contained in the feature set.

[0098] In this application, static process parameter states are transformed into dynamic time-series processes through model input construction, enabling the neural network based on the Transformer architecture to learn the cumulative impact of historical changes in process parameters on the current temperature state, thus laying a data foundation for capturing the dynamic characteristics of the process.

[0099] S412, Model Structure Design:

[0100] (1) Input embedding layer: Encodes the original parameter sequence in the constructed multidimensional time series matrix and maps it to a high-dimensional space.

[0101] It should be noted that the input embedding layer can transform the original input data and positional features into a standardized representation suitable for the encoder-decoder architecture. For example, it can uniformly transform process parameters with different dimensions, such as rolling force, rotation speed, and temperature, into the same semantic space, eliminating the influence of the difference in dimensions between parameters on model learning. This is particularly suitable for the fusion representation of multi-source heterogeneous parameters in the skew rolling process of magnesium alloy tubes in this application. It can provide standardized input for subsequent attention weight calculation, enabling the neural network model based on the Transformer architecture to better extract the latent feature information in the data.

[0102] (2) Position encoding layer: Introduces a learnable position encoding method to provide the time sequence information of each process parameter in the sequence for the neural network model based on the Transformer architecture.

[0103] Because of the inherent permutation invariance of the attention mechanism, that is, the attention calculation result remains unchanged when the order of the input sequence elements changes, it is fundamentally contradictory to the requirement of obtaining temporal correlation in sequence modeling. Therefore, positional encoding must be injected into the input embedding layer to eliminate this disorder sensitivity.

[0104] In this embodiment of the application, when the position of the element in the sequence is When the feature dimension is d, the neural network model based on the Transformer architecture uses the following formula to generate positional encoding:

[0105]

[0106]

[0107] In the formula, This is the location encoding at time t, where d is the feature dimension; A series of different frequency parameters are used to control the periodicity of the sine and cosine functions; k is the current dimension index, and T is the transpose sign.

[0108] In the feature encoding process of the input embedding layer, the absolute positional encoding parameters are fused with the original input features through a linear superposition operation. This encoding system constructs a doubly orthogonal parameter space in the high-dimensional embedding space: first, for a d-dimensional feature vector, each dimension corresponds to an independent positional encoding parameter space; second, at the temporal dimension level, each positional index in the sequence is mapped to a unique encoding vector. The encoding function defined by this formula achieves a precise mathematical representation of the feature space coordinates by constructing a bijective relationship between positional indices and encoding vectors.

[0109] Position encoding can ensure that the model can accurately identify the sequential relationship of parameters when processing time series data, and can identify timing patterns such as "the temperature is most affected at the 3rd second after the feed angle is adjusted", thereby better capturing the timing characteristics of the process.

[0110] In this application, by using an input embedding layer and learnable position coding, it is possible to achieve mixed input of static parameters (roll diameter, mandrel diameter, steel grade coding) and dynamic time-series parameters (roll speed, rolling force, surface temperature sequence), which solves the structural adaptation problem of mixed multi-source parameter types in skew rolling scenarios and avoids information loss caused by parameter type splitting.

[0111] (3) Encoder layer: It consists of several encoder modules stacked together. Each encoder module is composed of several multi-head self-attention mechanism sub-modules and feedforward neural network sub-modules stacked together. Each sub-module is followed by a residual connection and a normalization layer. Feature fusion is achieved through the residual connection and the normalization layer.

[0112] In this application, the various types of sub-modules in each encoder module are combined according to a cross-stacking arrangement strategy. The specific stacking pattern is as follows: starting with the multi-head self-attention mechanism sub-module, connecting to the feedforward neural network sub-module, and then repeating this sequence in a loop. That is, the final stacking sequence is: multi-head self-attention mechanism sub-module → feedforward neural network sub-module → multi-head self-attention mechanism sub-module → feedforward neural network sub-module → ... → multi-head self-attention mechanism sub-module → feedforward neural network sub-module.

[0113] In this embodiment of the application, the working principle of the encoder module is as follows:

[0114] (31) The original input of the encoder module is sent to the multi-head self-attention mechanism sub-module. The multi-head self-attention mechanism sub-module calculates the correlation weight between different time steps and different parameters in the process parameter sequence, captures the global temporal dependency and parameter coupling relationship, and obtains the output of the multi-head self-attention mechanism sub-module. Then, the original input of the encoder module and the output of the multi-head self-attention mechanism sub-module are fused through residual connection and normalization layer to achieve feature fusion.

[0115] (32) Input the fused features from the previous step into the feedforward neural network submodule. The feedforward neural network submodule further processes and transforms the fused features to obtain the output of the feedforward neural network submodule. Then, the fused features from the previous step and the output of the feedforward neural network submodule are fused through residual connections and normalization layers to achieve feature fusion.

[0116] (33) Input the fused features from the previous step into the multi-head self-attention mechanism submodule. The multi-head self-attention mechanism submodule calculates the correlation weights between different time steps and different parameters in the process parameter sequence. After capturing the global temporal dependency and parameter coupling relationship, the output of the multi-head self-attention mechanism submodule is obtained. Then, the fused features from the previous step and the output of the multi-head self-attention mechanism submodule are fused through residual connection and normalization layer to achieve feature fusion.

[0117] (34) Input the fused features from the previous step into the feedforward neural network submodule. The feedforward neural network submodule further processes and transforms the fused features to obtain the output of the feedforward neural network submodule. Then, the fused features from the previous step and the output of the feedforward neural network submodule are fused through residual connections and normalization layers to achieve feature fusion.

[0118] (35) Repeat steps (33)-(34) until the stacked sequence in the encoder module is complete.

[0119] The encoder layer enables the model to automatically identify the key process parameters most relevant to temperature evolution and their lag time from historical data, accurately capturing long-range dependencies.

[0120] In this application, the information between samples has been fully fused after the attention mechanism, while the feedforward neural network mixes the input in the feature dimension and further enhances the expressive power of the model by introducing nonlinear transformation.

[0121] (4) Decoder layer: It is composed of several decoder modules stacked together. Each decoder module is composed of several multi-head masked self-attention mechanism sub-modules, multi-head cross self-attention mechanism sub-modules and feedforward neural network sub-modules stacked together. Each sub-module is followed by a residual connection and a normalization layer. Feature fusion is achieved through the residual connection and the normalization layer.

[0122] In this application, the various types of sub-modules in each decoder module are combined according to a cross-stacking arrangement strategy. The specific stacking pattern is as follows: starting with the multi-head masked self-attention mechanism sub-module, the multi-head cross self-attention mechanism sub-module and the feedforward neural network sub-module are connected in sequence, and then this sequence is repeated cyclically. That is, the final stacking sequence is as follows: multi-head masked self-attention mechanism sub-module → multi-head cross self-attention mechanism sub-module → feedforward neural network sub-module → multi-head masked self-attention mechanism sub-module → multi-head cross self-attention mechanism sub-module → feedforward neural network sub-module → ... → multi-head masked self-attention mechanism sub-module → multi-head cross self-attention mechanism sub-module → feedforward neural network sub-module.

[0123] In this embodiment of the application, the working principle of the decoder module is as follows:

[0124] (41) The original input of the decoder module is sent to the multi-head masked self-attention mechanism sub-module. After the multi-head masked self-attention mechanism sub-module performs masking processing, the output of the multi-head masked self-attention mechanism sub-module is obtained. Then, the original input of the decoder module and the output of the multi-head masked self-attention mechanism sub-module are fused through residual connection and normalization layer to achieve feature fusion.

[0125] (42) Input the fused features from the previous step into the multi-head cross self-attention mechanism submodule. After performing the association operation on the global features of the process parameters output by the encoder layer in the multi-head cross self-attention mechanism submodule, obtain the output of the multi-head cross self-attention mechanism submodule. Then, fuse the fused features from the previous step with the output of the multi-head cross self-attention mechanism submodule through residual connection and normalization layer.

[0126] (43) Input the fused features from the previous step into the feedforward neural network submodule. The feedforward neural network submodule further processes and transforms the fused features to obtain the output of the feedforward neural network submodule. Then, the fused features from the previous step and the output of the feedforward neural network submodule are fused through residual connections and normalization layers to achieve feature fusion.

[0127] (44) Input the fused features from the previous step into the multi-head masked self-attention mechanism submodule. After the multi-head masked self-attention mechanism submodule performs masking processing, the output of the multi-head masked self-attention mechanism submodule is obtained. Then, the fused features from the previous step and the output of the multi-head masked self-attention mechanism submodule are fused through residual connection and normalization layer to achieve feature fusion.

[0128] (45) Input the fused features from the previous step into the multi-head cross self-attention mechanism submodule. After performing the association operation on the global features of the process parameters output by the encoder layer in the multi-head cross self-attention mechanism submodule, obtain the output of the multi-head cross self-attention mechanism submodule. Then, fuse the fused features from the previous step with the output of the multi-head cross self-attention mechanism submodule through residual connection and normalization layer.

[0129] (46) Input the fused features from the previous step into the feedforward neural network submodule. The feedforward neural network submodule further processes and transforms the fused features to obtain the output of the feedforward neural network submodule. Then, the fused features from the previous step and the output of the feedforward neural network submodule are fused through residual connections and normalization layers to achieve feature fusion.

[0130] (47) Repeat steps (44)-(46) until the stacked sequence in the decoder module is complete.

[0131] like Figure 4 As shown, the feedforward neural network sub-modules in both the encoder and decoder modules of this application consist of a two-layer fully connected structure and a ReLU activation function, as illustrated in the following calculation formula:

[0132]

[0133] In the formula, FFN is a feedforward neural network, X is the input matrix; W1 and W2 are weight matrices, and the dimension of W1 is... The dimension of W2 is d、 Let R be the feature dimension, and R be the set of real numbers; b1 and b2 are bias vectors, with b1 having a dimension of . The dimension of b2 is ReLU is a non-linear activation function.

[0134] It is important to emphasize that W1 and b1 are the parameters of the first fully connected layer, and W2 and b2 are the parameters of the second fully connected layer. In this application, the first fully connected layer expands the input feature dimension from d to d0. FNN Then the second fully connected layer restores it to d.

[0135] The decoder layer enables the model to generate temperature prediction sequences for multiple future time steps in an autoregressive manner. Each prediction step integrates global information from historical process parameters from the encoder and the inherent patterns of the predicted temperature sequences, thereby significantly improving the coherence and accuracy of multi-step predictions.

[0136] In this application, the neural network model based on the Transformer architecture includes three core attention mechanisms: multi-head self-attention, multi-head masked self-attention, and multi-head cross-attention. Although the computational logic of these three attention mechanisms differs, their basic architecture all adopts the multi-head self-attention framework. It is important to note that the multi-head self-attention mechanism itself is a multi-dimensional extension of the self-attention mechanism. Specifically, the self-attention mechanism can automatically calculate and weight the mutual influence of all process parameters at different time steps, as shown in the following example. Figure 3 As shown, the calculation formula is as follows:

[0137]

[0138] In the formula, the query vector Q, key vector K, and value vector V are all generated from the feature X through projection. The scaling factor is T, and the transpose sign is T. This represents the multiplication of the query vector and the transpose of the key vector, used to calculate the association weights between different time steps and different process parameters; Indicates will The result is normalized to the probability value of [0, 1].

[0139] It should be noted that, Figure 3 middle To query the vector matrix, It is a value vector matrix. A is a key vector matrix, where all three dimensions are the time window length N × feature dimension d; A is... Normalized attention weight matrix; The output feature matrix of the self-attention mechanism is the result of multiplying the attention weight matrix and the value vector matrix.

[0140] By employing a self-attention mechanism, the model can focus on the present and predict the most critical historical moments and process parameters. For example, the temperature at a certain moment may be strongly correlated with the rolling force of a few stands a few seconds ago. The neural network model based on the Transformer architecture can automatically discover and utilize this relationship. The feedforward neural network further processes and transforms the output of the multi-head self-attention layer to enhance the model's nonlinear fitting ability.

[0141] The multi-head masked self-attention mechanism used in this application can mask the decoder input, so that the model only focuses on the predicted historical temperature. For example, when predicting the temperature at the 3rd second, it can only see the predicted value at the 1st and 2nd second, avoiding direct leakage of the label information at the current moment, and allowing the model to gradually predict the temperature value and prevent jumps.

[0142] The multi-head cross-attention mechanism used in this application can establish a connection between the decoder and the encoder, allowing the decoder to simultaneously focus on the key process parameter features extracted by the encoder when generating the temperature. For example, when predicting the temperature at the 3rd second, cross-attention will guide the model to focus on the rolling force change at the 2nd second, ensuring the causal relationship between the temperature prediction and the process parameters, and achieving the physical logic that the change in process parameters causes the temperature change.

[0143] Furthermore, the decoder output in this application can be used to calculate the attention weight matrix. For example, it can calculate that the feed angle accounts for 30% of the temperature and the roll speed accounts for 25%, and visualize the influence weight of each process parameter on the temperature. This breaks through the limitations of traditional models and supports process optimization, that is, it shows which parameter can be adjusted to control the temperature faster.

[0144] (5) Output layer: After the decoder output, a fully connected layer is connected to directly regress the predicted temperature data inside the magnesium alloy tube.

[0145] The advantages of the Transformer-based neural network model used in this application compared to traditional RNN and LSTM models are as follows:

[0146] (1) Global perception: Unlike the stepwise processing of RNN / LSTM, the neural network model based on the Transformer architecture can process the entire sequence in parallel and directly model the dependency relationship between parameters at any two time points, regardless of the distance, thus avoiding the long-term dependency forgetting problem.

[0147] (2) Excellent sequence modeling capability: It is particularly suitable for handling continuous dynamic processes in the rolling process where parameters influence each other and are coupled before and after, and can more accurately predict the changing trend of the system state.

[0148] (3) Interpretability: By visualizing the self-attention weight matrix after training, the importance of different process parameters to the final prediction result can be analyzed, providing physical insights for process optimization.

[0149] In this application, step S4, which involves inputting the training set and validation set into the initial machine learning model for training and optimization, specifically involves:

[0150] S421. Input the training set into the initial machine learning model for training. During the training process, use the loss function to quantify the difference between the predicted value and the true value. By minimizing the loss function, continuously adjust the parameters of the initial machine learning model to gradually improve the prediction accuracy of the initial machine learning model and complete the training of the initial machine learning model.

[0151] S422. During the training of the initial machine learning model using the training set, the validation set is used for optimization, specifically as follows:

[0152] (1) Overfit detection and suppression: After a certain number of training rounds, the validation loss of the current initial machine learning model is calculated using the validation set and used as the validation evaluation index. If the training loss is observed to continue to decrease but the validation loss tends to stabilize or increase, it is determined that the initial machine learning model is "overfitting". At this time, the Dropout regularization mechanism is triggered, that is, some neural network nodes are randomly dropped during the training process, forcing the initial machine learning model to learn more robust feature representations, reducing the dependence on specific training samples, and improving the generalization ability.

[0153] (2) Hyperparameter optimization: Based on the performance of the validation set, the key hyperparameters of the initial machine learning model are tuned using hyperparameter optimization tools. Through comparative experiments of multiple sets of hyperparameter combinations, the key hyperparameter combinations that enable the initial machine learning model to achieve the best performance on the validation set are selected to obtain the best performance of the initial machine learning model. The key hyperparameters include the time window length, the number of heads in the multi-head self-attention layer, the number of hidden nodes in the feedforward neural network, and the learning rate.

[0154] In this application, a random deactivation layer is provided after the input embedding layer. Furthermore, within each encoder module and decoder module, a random deactivation layer is provided after each of its sub-modules. Additionally, a random deactivation layer is provided before the output layer.

[0155] In this application, the loss function for both the training and validation sets in steps S421 and S422 is the mean absolute error (MAE); the hyperparameter optimization tool used in step S422 is an optimization algorithm, specifically using Optuna for Bayesian optimization.

[0156] S5. Use the test set to evaluate the performance of the target machine learning model. If the evaluation is successful, integrate the target machine learning model into the process control system. Otherwise, return to step S3 to re-divide the total dataset into training, validation and test sets proportionally, and repeat steps S4-S5 until the evaluation is successful.

[0157] In this application, step S5, which uses a test set to evaluate the performance of the target machine learning model, specifically involves:

[0158] First, the feature set data of the test set is input into the target machine learning model, and the target machine learning model outputs the corresponding predicted data of the internal temperature of the magnesium alloy tube.

[0159] Secondly, the predicted internal temperature data of magnesium alloy tubes and the internal temperature label data of magnesium alloy tubes are quantitatively compared using evaluation metrics to obtain evaluation results. If the evaluation is passed, it indicates that the target machine learning model has good generalization ability and can be used; otherwise, the target machine learning model is retrained, where the evaluation metrics are mean absolute error or root mean square error.

[0160] In this application, the specific steps for integrating the target machine learning model into the process control system are as follows:

[0161] S51. Solidify the target machine learning model into an executable file;

[0162] S52. Integrate and deploy the solidified target machine learning model executable file into the process control system of the tube rolling mill, specifically as follows:

[0163] S521. On the process control system of the tube rolling mill, complete the installation of executable files and environment configuration;

[0164] S522. Establish a data interface based on industrial communication protocols to ensure bidirectional data communication between the target machine learning model and the mill control system, that is, to enable the solidified target machine learning model executable file to read production data and feed back prediction results in real time.

[0165] S523. Integrate the prediction results of the target machine learning model into the human-machine interaction display module of the rolling mill, so that operators can see the predicted temperature in real time, and configure a graded early warning mechanism and a closed-loop optimization mechanism.

[0166] It is important to note that during the process of embedding the target machine learning model into an executable file, the integrity and portability of the model must be ensured, enabling it to run normally under different hardware environments and operating systems. Furthermore, when integrating and deploying the embedded target machine learning model executable file into the rolling mill's process control system, a data interface must be established to achieve bidirectional data communication between the target machine learning model and the rolling mill's process control system. This ensures that the target machine learning model can read the process parameter data from the rolling mill's process control system in real time and feed back the prediction results to the rolling mill's process control system.

[0167] In this application, the graded early warning mechanism is as follows: the operation engineer will pre-set the target temperature range and graded early warning threshold in the process control system according to the product quality requirements and production process standards of the magnesium alloy tube. When the predicted internal temperature data of the magnesium alloy tube received by the process control system exceeds the target temperature range and reaches the graded early warning threshold, the system will automatically issue a corresponding audible and visual alarm signal to remind the operation engineer to pay attention in time and take corresponding adjustment measures to prevent the production of unqualified products.

[0168] For example, the target temperature range preset in this application is A1 to A2. When the predicted internal temperature of the magnesium alloy tube received by the process control system is within the target temperature range, no audible or visual alarm signal is triggered. When the predicted internal temperature of the magnesium alloy tube received by the process control system deviates from the target temperature range by ±15℃, that is, when the predicted data is in the range of A1-15℃ to A1 or A2 to A2+15℃, a first-level warning will be triggered. At this time, the human-machine interface will trigger a yellow visual warning and a low-frequency sound prompt "slight temperature deviation". When the predicted internal temperature of the magnesium alloy tube received by the process control system deviates from the first-level warning range by ±15℃, that is, when the predicted data is in the range of A1-30℃ to A1-15℃ or A2+15℃, a first-level warning will be triggered. When the temperature falls within the range of A1-50℃ to A1-30℃, a Level 2 warning will be triggered. At this time, the human-machine interface will trigger an orange visual alarm and a continuous high-frequency alarm. Simultaneously, the process control system will automatically make minor adjustments to key parameters, such as automatically adjusting the roll speed, and generate an alarm log to report to the production management system. When the temperature prediction data of the magnesium alloy tube received by the process control system deviates from the Level 2 warning range by ±20℃, that is, when the prediction data is in the range of A1-50℃ to A1-30℃ or A2+30℃ to A2+50℃, a Level 3 warning will be triggered. At this time, the human-machine interface will trigger a red visual emergency alarm and a highest priority audible and visual alarm. The process control system will automatically send an "emergency stop" request to the mill main control system to interrupt the production process.

[0169] In this application, the closed-loop optimization mechanism is as follows: the process control system periodically calculates the deviation between the predicted internal temperature data of the magnesium alloy tube and the measured internal temperature data of the magnesium alloy tube obtained through high-precision online monitoring equipment. When the deviation is within the preset range, it indicates that the target machine learning model is currently performing well and no adjustment is needed. When the deviation exceeds the preset range, the process control system automatically triggers the model fine-tuning program of the target machine learning model, and uses the latest measured data and process parameter data to adjust the local parameters of the target machine learning model to improve the prediction accuracy of the target machine learning model.

[0170] It should be noted that the model fine-tuning procedure is a specific execution operation within the closed-loop optimization mechanism. In this embodiment, the model fine-tuning procedure specifically involves: using the latest measured data and process parameter data to form a small batch of new samples; targeting local network layers in the target machine learning model that are sensitive to the current operating conditions, such as the feedforward neural network submodule of the decoder layer; and, while keeping other core parameters fixed, updating these local parameters with the optimization objective of minimizing the prediction bias of the new samples, so that the predicted values ​​of the target machine learning model under the current operating conditions are closer to the measured temperature. In short, it involves using new data to specifically update the parameters of the sensitive layers of the target machine learning model.

[0171] Preferably, after the process control system automatically triggers the model fine-tuning program to adjust the local parameters of the target machine learning model, if the deviation of the target machine learning model still cannot be effectively controlled, or the performance of the target machine learning model deteriorates significantly, the process control system will prompt the operation engineer that the target machine learning model needs to be retrained. Subsequently, the operation engineer will use the latest dataset to re-execute steps S1-S5 to retrain the target machine learning model, so that the target machine learning model always maintains good adaptive ability and predictive performance to meet the needs of actual production.

[0172] It is important to emphasize that, with conventional models, if production conditions change after the model is fixed, the model needs to be retrained and redeployed. The fixed files in this application can be directly adapted to the rolling mill control system via a dedicated data interface, and a closed-loop optimization mechanism allows for fine-tuning of the target machine learning model parameters based on the latest process data, achieving online optimization without the need for redeployment.

[0173] S6. During the cumulative skew rolling process of magnesium alloy tubes, the process control system receives and preprocesses the process parameters in real time according to the set time interval. Then, the preprocessed process parameters are input into the target machine learning model. The target machine learning model outputs the corresponding internal temperature prediction data of the magnesium alloy tube in real time and feeds it back to the process control system. The process control system then transmits the prediction results fed back by the target machine learning model to the human-machine interface for display in real time.

[0174] It should be noted that the process parameters in step S6 of this application are the same as the feature set data in step S1, both including equipment geometric parameters, process operating parameters, temperature parameters, and material data; similarly, the predicted internal temperature data of the magnesium alloy tube is also the same as the internal temperature label data of the magnesium alloy tube. In addition, the preprocessing in step S6 is the same as the preprocessing in step S3.

[0175] In this application, the target machine learning model outputs the corresponding internal temperature prediction data of the magnesium alloy tube in real time and feeds it back to the process control system. The process control system can transmit the prediction results fed back by the target machine learning model to the human-machine interface in real time and display them to the operator in the form of charts or curves. This allows the operator to understand the internal state of the magnesium alloy tube in the cumulative skew rolling process in real time through the human-machine interface and keep abreast of the production situation.

[0176] This invention also provides an internal temperature prediction system for the cumulative skew rolling process of magnesium alloy tubes, used to execute the internal temperature prediction method during the cumulative skew rolling process of magnesium alloy tubes, including: Data acquisition module: Collects various process parameters from each cumulative skew rolling process of magnesium alloy tubes, forming several feature sets; Finite element simulation module: Input the feature set into the three-dimensional nonlinear thermo-mechanical coupled finite element model of the cumulative skew rolling process of magnesium alloy tube, and obtain the internal temperature label data of magnesium alloy tube corresponding to each feature set; Data preprocessing module: preprocesses each feature set and its corresponding internal temperature label data of magnesium alloy tubes, and uses the preprocessed data as the total dataset. Then, the total dataset is divided into training set, validation set and test set according to the proportion. The training set / validation set / test set all include each feature set and its corresponding internal temperature label data of magnesium alloy tubes. Model building module: Using the feature set as input and the internal temperature label data of magnesium alloy tube as output, an initial machine learning model is built, and the training set and validation set are input into the initial machine learning model for training and optimization to obtain the target machine learning model; Model evaluation module: Uses a test set to evaluate the performance of the target machine learning model, and integrates the target machine learning model into the real-time detection and display module after passing the evaluation; Real-time detection and display module: During the cumulative skew rolling production of magnesium alloy tubes, the module receives and preprocesses the process parameters in real time at set time intervals. Then, it inputs the preprocessed process parameters into the built-in target machine learning model, receives the corresponding predicted internal temperature data of the magnesium alloy tubes in real time from the target machine learning model, and uploads it to the human-machine interface for real-time display.

[0177] This application also includes a data storage module for storing historical process parameters, finite element simulation parameters, and model prediction parameters.

[0178] In this embodiment, a relational database is used to construct the data storage architecture. Database operation programs are written to implement operations such as data insertion, querying, updating, and deletion. Simultaneously, a data backup and recovery mechanism is established to regularly back up the data and prevent data loss. Furthermore, data warehouse technology is employed to integrate and analyze historical data, providing data support for the enterprise's production decisions.

[0179] This application also includes a model optimization module connected to the real-time detection and display module. This module periodically receives predicted internal temperature data of the magnesium alloy tube and calculates the deviation between the predicted data and the measured internal temperature data obtained through high-precision online monitoring equipment. Based on the calculated deviation, corresponding measures are implemented, specifically:

[0180] When the deviation is within the preset range, it indicates that the target machine learning model is currently performing well and no adjustment is needed.

[0181] When the deviation exceeds the preset range, the real-time detection and display module automatically triggers the model fine-tuning program of the target machine learning model, and uses the latest measured data and process parameter data to adjust the local parameters of the target machine learning model.

[0182] This application also includes a graded early warning mechanism module, which is connected to the real-time detection and display module. This module receives predicted internal temperature data of the magnesium alloy tube and compares it with the target temperature range and graded early warning thresholds preset by the operating engineer. Based on the comparison results, it issues corresponding audible and visual alarm signals.

[0183] In summary, the method and system for predicting the internal temperature of magnesium alloy tubes during the cumulative skew rolling process provided in this application enable real-time and accurate prediction of the internal state of magnesium alloy tubes during the cumulative skew rolling process, providing an effective means for product quality control and process optimization.

[0184] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for predicting the internal temperature during the process of accumulative roll-bonding of magnesium alloy tubes, characterized by, Includes the following steps: S1. Collect various process parameters from each cumulative skew rolling process of magnesium alloy tubes to form several feature sets; S2. Construct a three-dimensional nonlinear thermo-mechanical coupled finite element model of magnesium alloy tube during the cumulative skew rolling process. Take the feature set in step S1 as input and output the internal temperature label data of magnesium alloy tube corresponding to each feature set. S3. Preprocess each feature set and its corresponding internal temperature label data of magnesium alloy tubes, and use the preprocessed data as the total dataset. Then, divide the total dataset into training set, validation set and test set according to the proportion. The training set / validation set / test set all include each feature set and its corresponding internal temperature label data of magnesium alloy tubes. S4. Using the feature set as input and the internal temperature label data of the magnesium alloy tube as output, construct an initial machine learning model and input the training set and validation set into the initial machine learning model for training and optimization to obtain the target machine learning model. S5. Use the test set to evaluate the performance of the target machine learning model. If the evaluation is successful, integrate the target machine learning model into the process control system. Otherwise, return to step S3 to re-divide the total dataset into training, validation and test sets proportionally, and repeat steps S4-S5 until the evaluation is successful. S6. During the cumulative skew rolling process of magnesium alloy tubes, the process control system receives and preprocesses the process parameters in real time according to the set time interval. Then, the preprocessed process parameters are input into the target machine learning model. The target machine learning model outputs the corresponding internal temperature prediction data of the magnesium alloy tube in real time and feeds it back to the process control system. The process control system then transmits the prediction results fed back by the target machine learning model to the human-machine interface for display in real time.

2. The method of claim 1, wherein the magnesium alloy tube is a magnesium alloy tube for an automobile, and the magnesium alloy tube is subjected to a cross wedge rolling process. The various process parameters for each cumulative skew rolling process of magnesium alloy tubes include equipment geometric parameters, process operating parameters, temperature parameters, and material data. Among them, equipment geometric parameters include roll diameter, roll profile curve, feed angle, rolling angle, and mandrel diameter. Process operating parameters include the main motor speed of each stand, rolling force, rolling torque, roll speed, and motor current. Temperature parameters are the tube surface temperature sequence collected by several infrared thermometers installed at the outlet of the annular heating furnace, the reheating furnace, and the inlet and outlet of the rolling process. Material data includes the coded steel grade, initial outer diameter of the tube blank, wall thickness, and length.

3. The method for predicting the internal temperature during the cumulative skew rolling process of magnesium alloy tubes according to claim 1, characterized in that, Step S2 is as follows: S21. Based on the material constitutive parameters, rolling equipment geometric parameters, and thermophysical parameters during the cumulative skew rolling process of magnesium alloy tubes, a three-dimensional nonlinear thermo-mechanical coupled finite element model is constructed. The material constitutive parameters include elastic modulus, Poisson's ratio, and coefficient of thermal expansion. The rolling equipment geometric parameters include roll diameter, feed angle, and mandrel diameter. The thermophysical parameters include thermal conductivity, specific heat capacity, and interfacial friction coefficient. S22. Using the feature set in step S1 as the boundary and load conditions for simulation, input the three-dimensional nonlinear thermo-coupled finite element model to perform high-precision thermo-coupled finite element simulation analysis and obtain the internal temperature field distribution data of the magnesium alloy tube corresponding to each feature set. S23. Extract key indicators with clear physical meaning from the internal temperature field distribution data of the magnesium alloy tube corresponding to each feature set, and use them as internal temperature label data of the magnesium alloy tube corresponding to each feature set. The internal temperature label data of the magnesium alloy tube corresponding to each feature set includes the core temperature of the cross section, the surface temperature, and the temperature gradient between the core and the surface.

4. The method for predicting the internal temperature during the cumulative skew rolling process of magnesium alloy tubes according to claim 1, characterized in that, Preprocessing includes data cleaning, feature encoding, feature selection, and data standardization; In addition, the training set, accounting for 70% to 80% of the total dataset, is used to train the initial machine learning model; the validation set, accounting for 10% to 15% of the total dataset, is used to monitor the training effect of the initial machine learning model, adjust the hyperparameters of the initial machine learning model and prevent overfitting; and the test set, accounting for 10% to 15% of the total dataset, is used to evaluate the performance of the target machine learning model and test its generalization ability.

5. The method for predicting the internal temperature during the cumulative skew rolling process of magnesium alloy tubes according to claim 1, characterized in that, The initial machine learning model is a neural network model based on the Transformer architecture. The neural network model based on the Transformer architecture includes an input layer, an input embedding layer, a positional encoding layer, an encoder layer, a decoder layer, and an output layer. The encoder layer contains a multi-head self-attention mechanism and a feedforward neural network, and the decoder layer contains a multi-head masked self-attention mechanism, a multi-head cross self-attention mechanism, and a feedforward neural network. A random deactivation layer is set after the input embedding layer and before the output layer. Furthermore, the specific steps for building a neural network model based on the Transformer architecture are as follows: S411. Model Input Construction: Construct a multi-dimensional time series matrix from the feature sets of N time steps. ,in This is a multidimensional time series dataset of process parameters, where N is the time window length, d is the feature dimension, and R is the set of real numbers, indicating that all elements in the matrix are real numbers. S412, Model Structure Design: (1) Input embedding layer: Encodes the original parameter sequence in the constructed multidimensional time series matrix and maps it to a high-dimensional space; (2) Position encoding layer: Introduces a learnable position encoding method to provide the temporal order information of each process parameter in the sequence for the neural network model based on the Transformer architecture; (3) Encoder layer: It is composed of several encoder modules stacked together. Each encoder module is composed of several multi-head self-attention mechanism sub-modules and feedforward neural network sub-modules stacked together. Each sub-module is followed by a residual connection and a normalization layer. Feature fusion is achieved through the residual connection and the normalization layer. (4) Decoder layer: It is composed of several decoder modules stacked together. Each decoder module is composed of several multi-head masked self-attention mechanism sub-modules, multi-head cross self-attention mechanism sub-modules and feedforward neural network sub-modules stacked together. Each sub-module is followed by a residual connection and a normalization layer. Feature fusion is achieved through the residual connection and the normalization layer. (5) Output layer: After the decoder output, a fully connected layer is connected to directly regress the predicted temperature data inside the magnesium alloy tube.

6. The method for predicting the internal temperature during the cumulative skew rolling process of magnesium alloy tubes according to claim 5, characterized in that, Within each encoder module and decoder module, a random deactivation layer is set after each of its sub-modules; In each encoder module, the various types of sub-modules are combined according to a cross-stacking strategy. Specifically, the stacking pattern is as follows: starting with the multi-head self-attention mechanism sub-module, followed by the feedforward neural network sub-module, and then repeating this sequence cyclically. In each decoder module, the various types of sub-modules are combined according to a cross-stacking strategy. Specifically, the stacking pattern is as follows: starting with the multi-head masked self-attention mechanism sub-module, followed by the multi-head cross self-attention mechanism sub-module and the feedforward neural network sub-module, and then repeating this sequence cyclically. Furthermore, the feedforward neural network submodules in both the encoder and decoder modules employ a two-layer fully connected structure, as shown in the following calculation formula: , In the formula, FFN is a feedforward neural network, X is the input matrix; W1 and W2 are weight matrices, and the dimension of W1 is... The dimension of W2 is b1 and b2 are bias vectors, with b1 having dimension 1. The dimension of b2 is ReLU is a non-linear activation function.

7. The method for predicting the internal temperature during the cumulative skew rolling process of magnesium alloy tubes according to claim 1, characterized in that, Step S4, which involves inputting the training and validation sets into the initial machine learning model for training and optimization, specifically involves the following steps: S421. Input the training set into the initial machine learning model for training. During the training process, use the loss function to quantify the difference between the predicted value and the true value. By minimizing the loss function, continuously adjust the parameters of the initial machine learning model to gradually improve the prediction accuracy of the initial machine learning model and complete the training of the initial machine learning model. S422. During the training of the initial machine learning model using the training set, the validation set is used for optimization, specifically as follows: (1) Overfit detection and suppression: After a certain number of training rounds, the validation loss of the current initial machine learning model is calculated using the validation set and used as the validation evaluation index. If the training loss is observed to continue to decrease but the validation loss tends to stabilize or increase, it is determined that the initial machine learning model is "overfitting". At this time, the Dropout regularization mechanism is triggered, that is, some neural network nodes are randomly dropped during the training process, forcing the initial machine learning model to learn more robust feature representations, reducing the dependence on specific training samples, and improving the generalization ability. (2) Hyperparameter optimization: Based on the performance of the validation set, the key hyperparameters of the initial machine learning model are tuned using hyperparameter optimization tools. Through comparative experiments of multiple sets of hyperparameter combinations, the key hyperparameter combinations that enable the initial machine learning model to achieve the best performance on the validation set are selected to obtain the best performance of the initial machine learning model. The key hyperparameters include the time window length, the number of heads in the multi-head self-attention layer, the number of hidden nodes in the feedforward neural network, and the learning rate.

8. The method for predicting the internal temperature during the cumulative skew rolling process of magnesium alloy tubes according to claim 1, characterized in that, Step S5 involves evaluating the performance of the target machine learning model using a test set. First, the feature set data of the test set is input into the target machine learning model, and the target machine learning model outputs the corresponding predicted data of the internal temperature of the magnesium alloy tube. Secondly, the predicted internal temperature data of magnesium alloy tubes and the internal temperature label data of magnesium alloy tubes are quantitatively compared using evaluation metrics to obtain evaluation results. If the evaluation is passed, it indicates that the target machine learning model has good generalization ability and can be used. Otherwise, retrain the target machine learning model, with the evaluation metric being the mean absolute error or root mean square error. Furthermore, the specific steps for integrating the target machine learning model into the process control system are as follows: S51. Solidify the target machine learning model into an executable file; S52. Integrate and deploy the solidified target machine learning model executable file into the process control system of the tube rolling mill, specifically as follows: S521. On the process control system of the tube rolling mill, complete the installation of executable files and environment configuration; S522. Establish a data interface based on industrial communication protocols to ensure bidirectional data communication between the target machine learning model and the mill control system, that is, to enable the solidified target machine learning model executable file to read production data and feed back prediction results in real time. S523. Integrate the prediction results of the target machine learning model into the human-machine interaction display module of the rolling mill, so that operators can see the predicted temperature in real time, and configure a graded early warning mechanism and a closed-loop optimization mechanism.

9. The method for predicting the internal temperature during the cumulative skew rolling process of magnesium alloy tubes according to claim 8, characterized in that, The graded early warning mechanism is as follows: The operation engineer will pre-set the target temperature range and graded early warning threshold in the process control system according to the product quality requirements and production process standards of magnesium alloy tubes. When the predicted internal temperature data of magnesium alloy tubes received by the process control system exceeds the target temperature range and reaches the graded early warning threshold, the system will automatically issue the corresponding audible and visual alarm signal to remind the operation engineer to pay attention in time and take corresponding adjustment measures. The closed-loop optimization mechanism is as follows: The process control system will periodically calculate the deviation between the predicted internal temperature data of the magnesium alloy tube and the measured internal temperature data of the magnesium alloy tube obtained by the high-precision online monitoring equipment. When the deviation is within the preset range, no adjustment is required; when the deviation exceeds the preset range, the process control system will automatically trigger the model fine-tuning program of the target machine learning model and use the latest measured data and process parameter data to adjust the local parameters of the target machine learning model.

10. An internal temperature prediction system for the cumulative skew rolling process of magnesium alloy tubes, used to execute the internal temperature prediction method for the cumulative skew rolling process of magnesium alloy tubes according to any one of claims 1-9, comprising: Data acquisition module: Collects various process parameters from each cumulative skew rolling process of magnesium alloy tubes, forming several feature sets; Finite element simulation module: Input the feature set into the three-dimensional nonlinear thermo-mechanical coupled finite element model of the cumulative skew rolling process of magnesium alloy tube, and obtain the internal temperature label data of magnesium alloy tube corresponding to each feature set; Data preprocessing module: preprocesses each feature set and its corresponding internal temperature label data of magnesium alloy tubes, and uses the preprocessed data as the total dataset. Then, the total dataset is divided into training set, validation set and test set according to the proportion. The training set / validation set / test set all include each feature set and its corresponding internal temperature label data of magnesium alloy tubes. Model building module: Using the feature set as input and the internal temperature label data of magnesium alloy tube as output, an initial machine learning model is built, and the training set and validation set are input into the initial machine learning model for training and optimization to obtain the target machine learning model; Model evaluation module: Uses a test set to evaluate the performance of the target machine learning model, and integrates the target machine learning model into the real-time detection and display module after passing the evaluation; Real-time detection and display module: During the cumulative skew rolling production of magnesium alloy tubes, the module receives and preprocesses the process parameters in real time at set time intervals. Then, it inputs the preprocessed process parameters into the built-in target machine learning model, receives the corresponding predicted internal temperature data of the magnesium alloy tubes in real time from the target machine learning model, and uploads it to the human-machine interface for real-time display.