技术领域Technical Field
本发明涉及工业连铸技术领域,具体地,涉及一种基于数字孪生技术的连铸结晶器液位异常预报方法和系统。The present invention relates to the technical field of industrial continuous casting, and in particular to a method and system for predicting liquid level anomaly in a continuous casting crystallizer based on digital twin technology.
背景技术Background Art
在连铸过程中,结晶器液面的异常波动会对铸坯质量造成不利影响。对结晶器液面的合理控制不仅能够优化初生壳的形成和金属凝固过程,从根本上保证铸坯表面质量和内部组织均匀性,而且可以最大限度的避免振动扭曲、卡壳等严重事故的发生。During the continuous casting process, abnormal fluctuations in the mold liquid level will have an adverse effect on the quality of the ingot. Reasonable control of the mold liquid level can not only optimize the formation of the primary shell and the metal solidification process, fundamentally ensure the surface quality and internal structure uniformity of the ingot, but also avoid serious accidents such as vibration distortion and jamming to the greatest extent.
目前,在结晶器液位异常预报方面仍存在一些难点和挑战:液位波动受诸多复杂因素影响,涉及热力学、流体力学等多学科知识,构建精确的物理模型极具挑战;基于数据的黑盒建模方法如机器学习模型,对大量高质量数据有较高需求,一些关键工艺参数难以获取,同时缺乏异常样本的积累,增加了模型训练和预报的难度。At present, there are still some difficulties and challenges in predicting abnormal crystallizer liquid level: liquid level fluctuations are affected by many complex factors, involving multidisciplinary knowledge such as thermodynamics and fluid mechanics, and it is extremely challenging to build an accurate physical model; data-based black box modeling methods such as machine learning models have high requirements for large amounts of high-quality data, and some key process parameters are difficult to obtain. At the same time, there is a lack of accumulation of abnormal samples, which increases the difficulty of model training and prediction.
专利文献CN117386694A公开了一种液压缸磨损演化与泄露监测的方法及其数字孪生系统,方法包括如下步骤:一、构建表征液压缸的泄漏量与接触压力间映射关系的泄露模型。二、对液压缸的三维模型进行CFD仿真分析,得到不同磨损深度下的压力分布模型。三、对压力信号进行小波包分析,确定磨损特征值;并保留对应的特征值提取模型;四、采集真实数据并创建从特征值到磨损深度的数据驱动模型。五、对基础模型进行融合得到磨损演化监测模型和泄漏量监测模型;六、利用磨损演化监测模型和泄漏量监测模型对采集到的压力和位移信号进行状态预测。然而该专利无法完全解决目前存在的技术问题,也无法满足本发明的需求。Patent document CN117386694A discloses a method for monitoring wear evolution and leakage of a hydraulic cylinder and its digital twin system. The method includes the following steps: 1. Constructing a leakage model that characterizes the mapping relationship between the leakage amount and contact pressure of the hydraulic cylinder. 2. Performing CFD simulation analysis on the three-dimensional model of the hydraulic cylinder to obtain a pressure distribution model under different wear depths. 3. Performing wavelet packet analysis on the pressure signal to determine the wear eigenvalue; and retaining the corresponding eigenvalue extraction model; 4. Collecting real data and creating a data-driven model from eigenvalue to wear depth. 5. Fusion of the basic model to obtain a wear evolution monitoring model and a leakage monitoring model; 6. Using the wear evolution monitoring model and the leakage monitoring model to predict the state of the collected pressure and displacement signals. However, this patent cannot completely solve the current technical problems, nor can it meet the needs of the present invention.
发明内容Summary of the invention
针对现有技术中的缺陷,本发明的目的是提供一种基于数字孪生技术的连铸结晶器液位异常预报方法和系统。In view of the defects in the prior art, the purpose of the present invention is to provide a method and system for predicting the abnormal liquid level of a continuous casting crystallizer based on digital twin technology.
根据本发明提供的基于数字孪生技术的连铸结晶器液位异常预报方法,包括:The method for predicting abnormal liquid level of a continuous casting mold based on digital twin technology provided by the present invention includes:
步骤1:构建高保真连铸数字孪生物理环境;Step 1: Build a high-fidelity continuous casting digital twin physical environment;
构建包括中包车、结晶器、扇形段、支架、辊系在内的关键设备部件的三维模型,导入3D建模和仿真引擎,组装成完整的连铸生产线;利用粒子系统模拟熔融金属液体的浇注和流动,展现浇铸全过程;Construct 3D models of key equipment components including the tundish car, crystallizer, sector, bracket, and roller system, import 3D modeling and simulation engines, and assemble them into a complete continuous casting production line; use the particle system to simulate the pouring and flow of molten metal liquid to show the entire casting process;
步骤2:收集和融合浇铸过程中影响结晶器液位的多源异构数据;Step 2: Collect and integrate multi-source heterogeneous data that affect the mold level during the casting process;
与工业现场的监控系统、数据采集设备对接,获取实时生产数据,控制包括中包车、结晶器、辊系在内的数字孪生体的运动轨迹和速度;结合冶金原理分析及现场操作工的经验,选择影响结晶器液位波动的特征参数;Connect with the monitoring system and data acquisition equipment at the industrial site to obtain real-time production data and control the movement trajectory and speed of the digital twin including the tundish, crystallizer, and roller system; select the characteristic parameters that affect the crystallizer liquid level fluctuation based on the analysis of metallurgical principles and the experience of on-site operators;
步骤3:对参数数据进行预处理,按固定窗口长度W分割多变量时序片段作为数据驱动模型的正样本,其中包括输入数据和输出数据;Step 3: Preprocess the parameter data and divide the multivariate time series segments into segments with a fixed window length W as positive samples of the data-driven model, including input data and output data;
步骤4:从随机噪声中生成噪声数据作为数据驱动模型的负样本,噪声数据维度和步骤3中分割后的输入数据维度相同,复制步骤3中分割后的输出数据作为噪声的输出;Step 4: Generate noise data from random noise as negative samples of the data-driven model. The dimension of the noise data is the same as the dimension of the input data after segmentation in step 3. Copy the output data after segmentation in step 3 as the output of the noise.
步骤5:构建样本集,将步骤3中的输入数据和步骤4中的噪声数据作为输入样本,分别记作x1_true和x2_false;将步骤3中的输出数据和步骤4中噪声的输出作为输出样本,分别记作y1_true和y2_false;同时,对真实的输入数据和噪声数据分类,分别标记为0和1的标签;Step 5: Construct a sample set, take the input data in step 3 and the noise data in step 4 as input samples, record them as x1_true and x2_false respectively; take the output data in step 3 and the output of the noise in step 4 as output samples, record them as y1_true and y2_false respectively; at the same time, classify the real input data and the noise data, and mark them as 0 and 1 respectively;
步骤6:构建GAN网络的数字孪生数据驱动模型;Step 6: Build a digital twin data-driven model of the GAN network;
GAN生成器使用transformer的编解码器架构,引入交叉注意力机制,捕捉跨时间和跨维度的依赖关系;判别器使用多层感知机结构;GAN生成器中编码器的输出作为判别器的输入,判别器的损失函数使用二分类交叉熵损失,输出为0和1标签;The GAN generator uses the transformer encoder-decoder architecture and introduces a cross-attention mechanism to capture dependencies across time and dimensions. The discriminator uses a multi-layer perceptron structure. The output of the encoder in the GAN generator is used as the input of the discriminator. The loss function of the discriminator uses a binary cross-entropy loss, and the output is a 0 or 1 label.
步骤7:交替训练GAN生成器和判别器;Step 7: Alternately train the GAN generator and discriminator;
采用python numpy库的shuffle和batch函数,对样本数据随机洗乱之后训练GAN;在训练生成器时,固定判别器参数,并更新生成器参数以最小化其损失函数;在训练判别器时,固定生成器参数,并更新判别器参数以最小化其损失函数;The shuffle and batch functions of the python numpy library are used to randomly shuffle the sample data before training the GAN. When training the generator, the discriminator parameters are fixed and updated to minimize its loss function. When training the discriminator, the generator parameters are fixed and updated to minimize its loss function.
步骤8:模型评价合格后对结晶器液位异常情况进行判别,设置置信度阈值t,当判别器预测分数大于阈值t时判定为异常;生成器输出的预测数据包含所有参数未来一段时间内的变化趋势,用于提前观测结晶器液位的变化;Step 8: After the model is evaluated as qualified, the abnormal situation of the crystallizer liquid level is judged, and the confidence threshold t is set. When the discriminator prediction score is greater than the threshold t, it is judged as abnormal; the prediction data output by the generator contains the change trend of all parameters in the future period of time, which is used to observe the change of the crystallizer liquid level in advance;
步骤9:采用训练好的GAN数据驱动模型进行结晶器液位异常情况在线实时预报,并将模型输出反馈到数字孪生环境。Step 9: Use the trained GAN data-driven model to perform online real-time prediction of abnormal crystallizer liquid level, and feed the model output back to the digital twin environment.
优选地,选择影响结晶器液位波动的特征参数,包括中包钢水净重、塞棒位置、浇铸区连续测温温度、结晶器液位、拉速各1个,结晶器水出口流量4个、油缸摩擦功2个、驱动辊力矩11个、拉绞辊电流25个,共计47个维度。Preferably, characteristic parameters that affect the fluctuation of the crystallizer liquid level are selected, including 1 each of the net weight of molten steel in the tundish, the position of the stopper rod, the continuous temperature measurement in the casting area, the crystallizer liquid level, and the pulling speed, 4 crystallizer water outlet flow rates, 2 cylinder friction works, 11 drive roller torques, and 25 drawing roller currents, totaling 47 dimensions.
优选地,所述步骤3包括:Preferably, the step 3 comprises:
步骤3.1:对步骤2中的参数数据按约束条件进行筛选,筛选出浇铸过程数据,其约束条件为中包车在浇铸位、结晶器液位大于750mm、浇铸区连续测温温度大于1500℃;Step 3.1: Filter the parameter data in step 2 according to the constraint conditions to select the casting process data, where the constraint conditions are that the tundish is at the casting position, the liquid level of the crystallizer is greater than 750 mm, and the continuous temperature measurement temperature of the casting area is greater than 1500 °C;
步骤3.2:利用python中fillna函数前向填充空值,得到多变量时序数据;Step 3.2: Use the fillna function in Python to forward fill in the null values and obtain multivariate time series data;
步骤3.3:将多变量时序数据按固定窗口长度W进行分割,得到一系列长度为W的数据片段;每个片段包含多个变量的值,形成一个二维张量,该张量作为一个样本数据;其中,前W1个作为样本输入数据,(W-W1)个作为样本输出数据;Step 3.3: Split the multivariate time series data into fixed window length W to obtain a series of data segments of length W; each segment contains the values of multiple variables, forming a two-dimensional tensor, which is used as a sample data; among them, the first W1 are used as sample input data, and (W-W1) are used as sample output data;
步骤3.4:准备多个批次的数据,每个批次包含多个样本,用于后续模型的训练。Step 3.4: Prepare multiple batches of data, each batch containing multiple samples, for subsequent model training.
优选地,所述步骤6包括:Preferably, step 6 comprises:
GAN生成器采用transformer的编解码器架构;编码器将步骤3中的输入数据x1_true和步骤4中的噪声数据x2_false映射到潜在空间隐向量z;隐向量z作为解码器的输入,解码器根据隐向量z生成步骤3中的输出数据y1_true和噪声的输出y2_false;同时,编码器输出的隐向量z作为判别器的输入,判别器对隐向量z分类,输出0和1标签,0表示正常,1表示异常;The GAN generator uses the transformer encoder-decoder architecture; the encoder maps the input data x1_true in step 3 and the noise data x2_false in step 4 to the latent space hidden vector z; the hidden vector z is used as the input of the decoder, and the decoder generates the output data y1_true in step 3 and the noise output y2_false according to the hidden vector z; at the same time, the hidden vector z output by the encoder is used as the input of the discriminator, and the discriminator classifies the hidden vector z and outputs 0 and 1 labels, 0 for normal and 1 for abnormal;
编码器和解码器均由嵌入层、位置编码层、注意力层组成;嵌入层是一个线性层,将输入的特征向量映射到更高维度的表示空间;位置编码层是一个可学习的参数矩阵,用于学习高维序列相对或绝对位置的信息,形状和嵌入层的输出相同;注意力层使用缩放点积注意力机制,在点积注意力的基础上,对注意力权重进行缩放,以提高模型的稳定性,具体公式如下:Both the encoder and decoder are composed of an embedding layer, a position encoding layer, and an attention layer; the embedding layer is a linear layer that maps the input feature vector to a higher-dimensional representation space; the position encoding layer is a learnable parameter matrix used to learn the relative or absolute position information of the high-dimensional sequence, and its shape is the same as the output of the embedding layer; the attention layer uses a scaled dot product attention mechanism, and on the basis of the dot product attention, the attention weight is scaled to improve the stability of the model. The specific formula is as follows:
式中,Q·KT为表示查询向量Q和键向量K的点积,dk为维度缩放因子;V为值向量;Where Q·KT represents the dot product of the query vector Q and the key vector K, dk is the dimension scaling factor; V is the value vector;
GAN生成器的编码器由1个嵌入层、1个位置编码层、2个自注意力层组成;嵌入层的输出和位置编码矩阵相加,对相加后的矩阵向量进行归一化处理,送入到第一个自注意力层,用于信息融合;引入一个可学习的参数矩阵作为查询向量Q,第一个自注意力层的输出作为键向量K和值向量V,将三个矩阵送入第二个自注意力层,通过参数矩阵来控制不同时间片段之间信息流动的强度;编码器的输出作为潜在空间隐向量,用于解码器和GAN判别器的输入;The encoder of the GAN generator consists of 1 embedding layer, 1 position encoding layer, and 2 self-attention layers; the output of the embedding layer is added to the position encoding matrix, the added matrix vector is normalized, and sent to the first self-attention layer for information fusion; a learnable parameter matrix is introduced as the query vector Q, the output of the first self-attention layer is used as the key vector K and the value vector V, and the three matrices are sent to the second self-attention layer, and the parameter matrix is used to control the intensity of information flow between different time segments; the output of the encoder is used as the latent vector in the latent space for the input of the decoder and the GAN discriminator;
GAN生成器的解码器和编码器结构相同,外加3个线性层用于预测;将编码器的输出送入到解码器嵌入层;将解码器第二个自注意力层的输出送到线性层;线性层的输出为预测结果;The decoder of the GAN generator has the same structure as the encoder, with three additional linear layers for prediction. The output of the encoder is fed into the embedding layer of the decoder. The output of the second self-attention layer of the decoder is fed into the linear layer. The output of the linear layer is the prediction result.
GAN的判别器是一个3层感知机,其中2个线性层使用GELU激活函数,最后一个输出层使用Sigmoid激活函数,使得最后一层神经元输出0~1之间的小数,用于判别是正常或者异常的概率;The discriminator of GAN is a 3-layer perceptron, in which the 2 linear layers use the GELU activation function and the last output layer uses the Sigmoid activation function, so that the last layer of neurons outputs a decimal between 0 and 1 to determine the probability of normal or abnormal;
GAN生成器的编码器和解码器使用GELU激活函数;使用Adam优化器训练GAN;学习率设置为0.0001;The encoder and decoder of the GAN generator use the GELU activation function; the GAN is trained using the Adam optimizer; the learning rate is set to 0.0001;
损失函数包括2个部分:WMSE加权均方误差用于计算GAN生成器预测数据与输出时序片段的重构损失;交叉熵损失用于计算GAN判别器的分类结果,具体公式为:The loss function consists of two parts: the WMSE weighted mean square error is used to calculate the reconstruction loss of the GAN generator prediction data and the output time series segment; the cross entropy loss is used to calculate the classification result of the GAN discriminator. The specific formula is:
Loss=WMSE+LLoss = WMSE + L
式中,Loss为总损失;WMSE为加权均方误差损失,L为交叉熵损失;In the formula, Loss is the total loss; WMSE is the weighted mean square error loss, and L is the cross entropy loss;
式中,n为样本预测个数,d为样本参数维度;y′ij为模型预测值,yij为实际值;wj为类别j的误差损失;Where n is the number of sample predictions, d is the sample parameter dimension;y′ij is the model prediction value,yij is the actual value;wj is the error loss of category j;
式中:i为观测样本,j为所属类别,M表示类别的数量,pij表示对于观测样本i属于类别j的概率。Where i is the observed sample, j is the category it belongs to, M represents the number of categories, and pij represents the probability that the observed sample i belongs to category j.
优选地,模型判别器置信度阈值t设置范围为0.5~1,置信度阈值设置越大,检测到异常的概率越大。Preferably, the confidence threshold t of the model discriminator is set in the range of 0.5 to 1. The larger the confidence threshold is set, the greater the probability of detecting an abnormality.
根据本发明提供的基于数字孪生技术的连铸结晶器液位异常预报系统,包括:The continuous casting mold liquid level abnormality prediction system based on digital twin technology provided by the present invention includes:
模块M1:构建高保真连铸数字孪生物理环境;Module M1: Building a high-fidelity continuous casting digital twin physical environment;
构建包括中包车、结晶器、扇形段、支架、辊系在内的关键设备部件的三维模型,导入3D建模和仿真引擎,组装成完整的连铸生产线;利用粒子系统模拟熔融金属液体的浇注和流动,展现浇铸全过程;Construct 3D models of key equipment components including the tundish car, crystallizer, sector, bracket, and roller system, import 3D modeling and simulation engines, and assemble them into a complete continuous casting production line; use the particle system to simulate the pouring and flow of molten metal liquid to show the entire casting process;
模块M2:收集和融合浇铸过程中影响结晶器液位的多源异构数据;Module M2: Collect and integrate multi-source heterogeneous data that affect the mold level during the casting process;
与工业现场的监控系统、数据采集设备对接,获取实时生产数据,控制包括中包车、结晶器、辊系在内的数字孪生体的运动轨迹和速度;结合冶金原理分析及现场操作工的经验,选择影响结晶器液位波动的特征参数;Connect with the monitoring system and data acquisition equipment at the industrial site to obtain real-time production data and control the movement trajectory and speed of the digital twin including the tundish, crystallizer, and roller system; select the characteristic parameters that affect the crystallizer liquid level fluctuation based on the analysis of metallurgical principles and the experience of on-site operators;
模块M3:对参数数据进行预处理,按固定窗口长度W分割多变量时序片段作为数据驱动模型的正样本,其中包括输入数据和输出数据;Module M3: preprocesses the parameter data and divides the multivariate time series segments into fixed window length W as positive samples of the data-driven model, including input data and output data;
模块M4:从随机噪声中生成噪声数据作为数据驱动模型的负样本,噪声数据维度和模块M3中分割后的输入数据维度相同,复制模块M3中分割后的输出数据作为噪声的输出;Module M4: Generate noise data from random noise as negative samples of the data-driven model. The dimension of the noise data is the same as the dimension of the input data after segmentation in module M3. Copy the output data after segmentation in module M3 as the output of the noise.
模块M5:构建样本集,将模块M3中的输入数据和模块M4中的噪声数据作为输入样本,分别记作x1_true和x2_false;将模块M3中的输出数据和模块M4中噪声的输出作为输出样本,分别记作y1_true和y2_false;同时,对真实的输入数据和噪声数据分类,分别标记为0和1的标签;Module M5: Construct a sample set, take the input data in module M3 and the noise data in module M4 as input samples, record them as x1_true and x2_false respectively; take the output data in module M3 and the output of the noise in module M4 as output samples, record them as y1_true and y2_false respectively; at the same time, classify the real input data and the noise data, and mark them as 0 and 1 respectively;
模块M6:构建GAN网络的数字孪生数据驱动模型;Module M6: Building a digital twin data-driven model of the GAN network;
GAN生成器使用transformer的编解码器架构,引入交叉注意力机制,捕捉跨时间和跨维度的依赖关系;判别器使用多层感知机结构;GAN生成器中编码器的输出作为判别器的输入,判别器的损失函数使用二分类交叉熵损失,输出为0和1标签;The GAN generator uses the transformer encoder-decoder architecture and introduces a cross-attention mechanism to capture dependencies across time and dimensions. The discriminator uses a multi-layer perceptron structure. The output of the encoder in the GAN generator is used as the input of the discriminator. The loss function of the discriminator uses a binary cross-entropy loss, and the output is 0 and 1 labels.
模块M7:交替训练GAN生成器和判别器;Module M7: Alternately train the GAN generator and discriminator;
采用python numpy库的shuffle和batch函数,对样本数据随机洗乱之后训练GAN;在训练生成器时,固定判别器参数,并更新生成器参数以最小化其损失函数;在训练判别器时,固定生成器参数,并更新判别器参数以最小化其损失函数;The shuffle and batch functions of the python numpy library are used to randomly shuffle the sample data before training the GAN. When training the generator, the discriminator parameters are fixed and updated to minimize its loss function. When training the discriminator, the generator parameters are fixed and updated to minimize its loss function.
模块M8:模型评价合格后对结晶器液位异常情况进行判别,设置置信度阈值t,当判别器预测分数大于阈值t时判定为异常;生成器输出的预测数据包含所有参数未来一段时间内的变化趋势,用于提前观测结晶器液位的变化;Module M8: After the model is evaluated as qualified, the abnormal situation of the crystallizer liquid level is judged, and the confidence threshold t is set. When the discriminator prediction score is greater than the threshold t, it is judged as abnormal; the prediction data output by the generator contains the change trend of all parameters in the future period of time, which is used to observe the change of the crystallizer liquid level in advance;
模块M9:采用训练好的GAN数据驱动模型进行结晶器液位异常情况在线实时预报,并将模型输出反馈到数字孪生环境。Module M9: Use the trained GAN data-driven model to perform online real-time prediction of abnormal crystallizer liquid level, and feed the model output back to the digital twin environment.
优选地,选择影响结晶器液位波动的特征参数,包括中包钢水净重、塞棒位置、浇铸区连续测温温度、结晶器液位、拉速各1个,结晶器水出口流量4个、油缸摩擦功2个、驱动辊力矩11个、拉绞辊电流25个,共计47个维度。Preferably, characteristic parameters that affect the fluctuation of the crystallizer liquid level are selected, including 1 each of the net weight of molten steel in the tundish, the position of the stopper rod, the continuous temperature measurement in the casting area, the crystallizer liquid level, and the pulling speed, 4 crystallizer water outlet flow rates, 2 cylinder friction works, 11 drive roller torques, and 25 drawing roller currents, totaling 47 dimensions.
优选地,所述模块M3包括:Preferably, the module M3 comprises:
模块M3.1:对模块M2中的参数数据按约束条件进行筛选,筛选出浇铸过程数据,其约束条件为中包车在浇铸位、结晶器液位大于750mm、浇铸区连续测温温度大于1500℃;Module M3.1: Filter the parameter data in module M2 according to the constraints to select the casting process data. The constraints are that the tundish is in the casting position, the liquid level of the crystallizer is greater than 750mm, and the continuous temperature measurement temperature in the casting area is greater than 1500℃.
模块M3.2:利用python中fillna函数前向填充空值,得到多变量时序数据;Module M3.2: Use the fillna function in Python to forward fill in empty values to obtain multivariate time series data;
模块M3.3:将多变量时序数据按固定窗口长度W进行分割,得到一系列长度为W的数据片段;每个片段包含多个变量的值,形成一个二维张量,该张量作为一个样本数据;其中,前W1个作为样本输入数据,(W-W1)个作为样本输出数据;Module M3.3: Split the multivariate time series data into fixed window length W to obtain a series of data segments of length W; each segment contains the values of multiple variables, forming a two-dimensional tensor, which is used as a sample data; among them, the first W1 are used as sample input data, and (W-W1) are used as sample output data;
模块M3.4:准备多个批次的数据,每个批次包含多个样本,用于后续模型的训练。Module M3.4: Prepare multiple batches of data, each batch containing multiple samples, for subsequent model training.
优选地,所述模块M6包括:Preferably, the module M6 comprises:
GAN生成器采用transformer的编解码器架构;编码器将模块M3中的输入数据x1_true和模块M4中的噪声数据x2_false映射到潜在空间隐向量z;隐向量z作为解码器的输入,解码器根据隐向量z生成模块M3中的输出数据y1_true和噪声的输出y2_false;同时,编码器输出的隐向量z作为判别器的输入,判别器对隐向量z分类,输出0和1标签,0表示正常,1表示异常;The GAN generator adopts the encoder-decoder architecture of transformer; the encoder maps the input data x1_true in module M3 and the noise data x2_false in module M4 to the latent space hidden vector z; the hidden vector z is used as the input of the decoder, and the decoder generates the output data y1_true in module M3 and the noise output y2_false according to the hidden vector z; at the same time, the hidden vector z output by the encoder is used as the input of the discriminator, and the discriminator classifies the hidden vector z and outputs 0 and 1 labels, 0 indicates normal and 1 indicates abnormal;
编码器和解码器均由嵌入层、位置编码层、注意力层组成;嵌入层是一个线性层,将输入的特征向量映射到更高维度的表示空间;位置编码层是一个可学习的参数矩阵,用于学习高维序列相对或绝对位置的信息,形状和嵌入层的输出相同;注意力层使用缩放点积注意力机制,在点积注意力的基础上,对注意力权重进行缩放,以提高模型的稳定性,具体公式如下:Both the encoder and decoder are composed of an embedding layer, a position encoding layer, and an attention layer; the embedding layer is a linear layer that maps the input feature vector to a higher-dimensional representation space; the position encoding layer is a learnable parameter matrix used to learn the relative or absolute position information of the high-dimensional sequence, and its shape is the same as the output of the embedding layer; the attention layer uses a scaled dot product attention mechanism, and on the basis of the dot product attention, the attention weight is scaled to improve the stability of the model. The specific formula is as follows:
式中,Q·KT为表示查询向量Q和键向量K的点积,dk为维度缩放因子;V为值向量;Where Q·KT represents the dot product of the query vector Q and the key vector K, dk is the dimension scaling factor; V is the value vector;
GAN生成器的编码器由1个嵌入层、1个位置编码层、2个自注意力层组成;嵌入层的输出和位置编码矩阵相加,对相加后的矩阵向量进行归一化处理,送入到第一个自注意力层,用于信息融合;引入一个可学习的参数矩阵作为查询向量Q,第一个自注意力层的输出作为键向量K和值向量V,将三个矩阵送入第二个自注意力层,通过参数矩阵来控制不同时间片段之间信息流动的强度;编码器的输出作为潜在空间隐向量,用于解码器和GAN判别器的输入;The encoder of the GAN generator consists of 1 embedding layer, 1 position encoding layer, and 2 self-attention layers; the output of the embedding layer is added to the position encoding matrix, the added matrix vector is normalized, and sent to the first self-attention layer for information fusion; a learnable parameter matrix is introduced as the query vector Q, the output of the first self-attention layer is used as the key vector K and the value vector V, and the three matrices are sent to the second self-attention layer, and the parameter matrix is used to control the intensity of information flow between different time segments; the output of the encoder is used as the latent vector in the latent space for the input of the decoder and the GAN discriminator;
GAN生成器的解码器和编码器结构相同,外加3个线性层用于预测;将编码器的输出送入到解码器嵌入层;将解码器第二个自注意力层的输出送到线性层;线性层的输出为预测结果;The decoder of the GAN generator has the same structure as the encoder, with three additional linear layers for prediction. The output of the encoder is fed into the embedding layer of the decoder. The output of the second self-attention layer of the decoder is fed into the linear layer. The output of the linear layer is the prediction result.
GAN的判别器是一个3层感知机,其中2个线性层使用GELU激活函数,最后一个输出层使用Sigmoid激活函数,使得最后一层神经元输出0~1之间的小数,用于判别是正常或者异常的概率;The discriminator of GAN is a 3-layer perceptron, in which the 2 linear layers use the GELU activation function and the last output layer uses the Sigmoid activation function, so that the last layer of neurons outputs a decimal between 0 and 1 to determine the probability of normal or abnormal;
GAN生成器的编码器和解码器使用GELU激活函数;使用Adam优化器训练GAN;学习率设置为0.0001;The encoder and decoder of the GAN generator use the GELU activation function; the GAN is trained using the Adam optimizer; the learning rate is set to 0.0001;
损失函数包括2个部分:WMSE加权均方误差用于计算GAN生成器预测数据与输出时序片段的重构损失;交叉熵损失用于计算GAN判别器的分类结果,具体公式为:The loss function consists of two parts: the WMSE weighted mean square error is used to calculate the reconstruction loss of the GAN generator prediction data and the output time series segment; the cross entropy loss is used to calculate the classification result of the GAN discriminator. The specific formula is:
Loss=WMSE+LLoss = WMSE + L
式中,Loss为总损失;WMSE为加权均方误差损失,L为交叉熵损失;In the formula, Loss is the total loss; WMSE is the weighted mean square error loss, and L is the cross entropy loss;
式中,n为样本预测个数,d为样本参数维度;y′ij为模型预测值,yij为实际值;wj为类别j的误差损失;Where n is the number of sample predictions, d is the sample parameter dimension;y′ij is the model prediction value,yij is the actual value;wj is the error loss of category j;
式中:i为观测样本,j为所属类别,M表示类别的数量,pij表示对于观测样本i属于类别j的概率。Where i is the observed sample, j is the category it belongs to, M represents the number of categories, and pij represents the probability that the observed sample i belongs to category j.
优选地,模型判别器置信度阈值t设置范围为0.5~1,置信度阈值设置越大,检测到异常的概率越大。Preferably, the confidence threshold t of the model discriminator is set in the range of 0.5 to 1. The larger the confidence threshold is set, the greater the probability of detecting an abnormality.
与现有技术相比,本发明具有如下的有益效果:Compared with the prior art, the present invention has the following beneficial effects:
将数字孪生技术与生成对抗网络(GAN)模型相结合,尤其是在GAN生成器中引入Transformer编码器-解码器架构,用于结晶器液位异常预报;数字孪生技术可以构建高保真的连铸物理环境,为GAN模型提供大量逼真的模拟数据,解决了传统方法中由于缺乏异常样本而导致的数据不足问题;同时,Transformer结构擅长捕捉时序数据的长期依赖关系,能更好地学习液位波动的内在规律;可以在线预测结晶器液位的变化趋势以及预报结晶器液位是否异常,更有益于实际工程的应用。The digital twin technology is combined with the generative adversarial network (GAN) model, especially the introduction of the Transformer encoder-decoder architecture in the GAN generator for the prediction of abnormal crystallizer liquid level. The digital twin technology can build a high-fidelity continuous casting physical environment and provide a large amount of realistic simulation data for the GAN model, solving the problem of insufficient data caused by the lack of abnormal samples in traditional methods. At the same time, the Transformer structure is good at capturing the long-term dependencies of time series data and can better learn the inherent laws of liquid level fluctuations. It can predict the changing trend of the crystallizer liquid level online and predict whether the crystallizer liquid level is abnormal, which is more beneficial to the application of actual engineering.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
通过阅读参照以下附图对非限制性实施例所作的详细描述,本发明的其它特征、目的和优点将会变得更明显:Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
图1为本发明中基于数字孪生技术的连铸结晶器液位异常预报方法流程图;FIG1 is a flow chart of a method for predicting abnormal liquid level in a continuous casting mold based on digital twin technology in the present invention;
图2为本发明中影响结晶器液位的典型参数曲线图;FIG2 is a graph showing typical parameters affecting the crystallizer liquid level in the present invention;
图3为本发明中影响结晶器液位的典型参数相关分析热力图;FIG3 is a thermal diagram of correlation analysis of typical parameters affecting the crystallizer liquid level in the present invention;
图4为本发明中影响结晶器液位的典型参数相关分析Top图;FIG4 is a Top graph of typical parameter correlation analysis affecting the crystallizer liquid level in the present invention;
图5为本发明中模型训练损失曲线图;FIG5 is a graph showing the loss curve of model training in the present invention;
图6为本发明中判别器对正常数据和噪声数据的分割图;FIG6 is a diagram showing the segmentation of normal data and noise data by the discriminator in the present invention;
图7为本发明中部分参数真实曲线图;FIG7 is a true curve diagram of some parameters in the present invention;
图8为本发明中部分参数预测曲线图。FIG8 is a graph showing prediction curves of some parameters in the present invention.
具体实施方式DETAILED DESCRIPTION
下面结合具体实施例对本发明进行详细说明。以下实施例将有助于本领域的技术人员进一步理解本发明,但不以任何形式限制本发明。应当指出的是,对本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变化和改进。这些都属于本发明的保护范围。The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
实施例1Example 1
如图1所示,一种基于数字孪生技术的连铸结晶器液位异常预报方法,包括以下步骤:As shown in FIG1 , a method for predicting abnormal liquid level of a continuous casting mold based on digital twin technology includes the following steps:
步骤1:构建高保真连铸数字孪生物理环境;Step 1: Build a high-fidelity continuous casting digital twin physical environment;
精确建模中包车、结晶器、扇形段、支架、辊系等关键设备部件的三维模型,导入3D建模和仿真引擎,组装成完整的连铸生产线;利用粒子系统模拟熔融金属液体的浇注和流动,展现浇铸全过程。The three-dimensional models of key equipment components such as the car, crystallizer, fan-shaped segment, bracket, roller system, etc. are accurately modeled and imported into the 3D modeling and simulation engine to assemble a complete continuous casting production line; the particle system is used to simulate the pouring and flow of molten metal liquid to show the entire casting process.
步骤2:收集和融合浇铸过程中影响结晶器液位的多源异构数据;Step 2: Collect and integrate multi-source heterogeneous data that affect the mold level during the casting process;
与工业现场的监控系统、数据采集设备对接,获取实时生产数据,控制中包车、结晶器、辊系等数字孪生体的运动轨迹和速度;结合冶金原理分析及现场操作工的经验,选择影响结晶器液位波动的特征参数;所述参数包括中包钢水净重、塞棒位置、浇铸区连续测温温度、结晶器液位、拉速各1个,结晶器水出口流量4个、油缸摩擦功2个、驱动辊力矩11个、拉绞辊电流25个,共计47个维度。Connect with the monitoring system and data acquisition equipment at the industrial site to obtain real-time production data, and control the motion trajectory and speed of digital twins such as the tundish car, crystallizer, and roller system; combine the analysis of metallurgical principles and the experience of on-site operators to select characteristic parameters that affect the crystallizer liquid level fluctuation; the parameters include tundish steel net weight, stopper rod position, continuous temperature measurement in the casting area, crystallizer liquid level, and drawing speed, 4 crystallizer water outlet flow rates, 2 cylinder friction works, 11 drive roller torques, and 25 drawing roller currents, totaling 47 dimensions.
本实施例中以某钢厂连铸生产实绩数据为例,采样频率1s/次,采集1周浇铸过程中结晶器液位相关参数数据;图2为影响结晶器液位的典型参数曲线图;图3为参数间相关性分析热力图,图4为参数间相关性分析top图,由于参数较多,选取典型参数分析其相关性;其中S1_STS_Car1_StopperPos为塞棒位置;CMO1ST_Fast_uD_uCy1_uMsg_AvgFrictionWork为油缸磨擦功;STR_GERM_WS_M13_DRV_TRQ为驱动辊力矩。In this embodiment, the actual performance data of continuous casting production of a steel plant is taken as an example, the sampling frequency is 1s/time, and the parameter data related to the liquid level of the crystallizer during the casting process of one week is collected; Figure 2 is a typical parameter curve diagram affecting the liquid level of the crystallizer; Figure 3 is a thermal diagram of the correlation analysis between parameters, and Figure 4 is a top diagram of the correlation analysis between parameters. Since there are many parameters, typical parameters are selected to analyze their correlation; among them, S1_STS_Car1_StopperPos is the stopper position; CMO1ST_Fast_uD_uCy1_uMsg_AvgFrictionWork is the friction work of the cylinder; STR_GERM_WS_M13_DRV_TRQ is the torque of the drive roller.
步骤3:数据预处理;Step 3: Data preprocessing;
步骤3.1:对步骤2中的参数数据按约束条件进行筛选,筛选出浇铸过程数据,其约束条件为中包车在浇铸位、结晶器液位大于750mm、浇铸区连续测温温度大于1500℃;Step 3.1: Filter the parameter data in step 2 according to the constraint conditions to select the casting process data, where the constraint conditions are that the tundish is at the casting position, the liquid level of the crystallizer is greater than 750 mm, and the continuous temperature measurement temperature of the casting area is greater than 1500 °C;
步骤3.2:利用python中fillna函数前向填充空值,得到多变量时序数据;Step 3.2: Use the fillna function in Python to forward fill in the null values and obtain multivariate time series data;
步骤3.3:将多变量时序数据按固定窗口长度W进行分割,得到一系列长度为W的数据片段;每个片段包含多个变量的值,形成一个二维张量,该张量作为一个样本数据;其中前W1个作为样本输入数据,(W-W1)个作为样本输出数据;在本实施例中,W设置为360,W1为300,(W-W1)为60,表示用前5分钟的历史数据做输入,预测未来1分钟内数据变化趋势。Step 3.3: Split the multivariate time series data into fixed window length W to obtain a series of data segments of length W; each segment contains the values of multiple variables, forming a two-dimensional tensor, which is used as a sample data; the first W1 are used as sample input data, and (W-W1) are used as sample output data; in this embodiment, W is set to 360, W1 is 300, and (W-W1) is 60, which means that the historical data of the previous 5 minutes is used as input to predict the data change trend within the next 1 minute.
步骤3.4:准备多个批次的数据,每个批次包含多个样本,用于后续模型的训练。Step 3.4: Prepare multiple batches of data, each batch containing multiple samples, for subsequent model training.
步骤4:从随机噪声中生成噪声数据作为GAN网络的负样本,噪声数据维度和步骤3中分割后的输入数据维度相同,复制步骤3中分割后的输出数据作为噪声的输出;随机噪声选择高斯噪声生成,具体公式为:Step 4: Generate noise data from random noise as negative samples of the GAN network. The dimension of the noise data is the same as the dimension of the input data after segmentation in step 3. Copy the output data after segmentation in step 3 as the output of the noise. The random noise is generated by Gaussian noise. The specific formula is:
式中:d表示样本数据的维度,R1xd表示生成噪声的向量维度为d,噪声数据由d个独立的高斯分布随机采样得到的d维向量,每个维度都来自于对应的高斯分布,μ为高斯分布的均值,σ为高斯分布的标准差;在本实施例中,μ设置为0,σ设置为1。Wherein: d represents the dimension of sample data, R1xd represents the dimension of the vector generating noise is d, the noise data is a d-dimensional vector obtained by random sampling from d independent Gaussian distributions, each dimension comes from the corresponding Gaussian distribution, μ is the mean of the Gaussian distribution, σ is the standard deviation of the Gaussian distribution; in this embodiment, μ is set to 0, and σ is set to 1.
步骤5:构建样本集;Step 5: Construct sample set;
将步骤3中的输入数据和步骤4中的噪声数据作为输入样本,分别记作x1_true和x2_false;将步骤3中的输出数据和步骤4中噪声的输出作为输出样本,分别记作y1_true和y2_false;同时,对真实的输入数据和噪声数据分类,分别标记为0和1的标签。The input data in step 3 and the noise data in step 4 are taken as input samples, denoted as x1_true and x2_false respectively; the output data in step 3 and the output of the noise in step 4 are taken as output samples, denoted as y1_true and y2_false respectively; at the same time, the real input data and noise data are classified and marked as 0 and 1 respectively.
步骤6:构建GAN生成判别网络模型:Step 6: Build a GAN to generate a discriminant network model:
步骤6.1:模型输入和输出;Step 6.1: Model input and output;
GAN生成器采用transformer的编解码器架构;编码器将步骤3中的输入数据x1_true和步骤4中的噪声数据x2_false映射到潜在空间隐向量z;隐向量z作为解码器的输入,解码器根据隐向量z生成步骤3中的输出数据y1_true和噪声的输出y2_false;同时,编码器输出的隐向量z作为判别器的输入,判别器对隐向量z分类,输出0和1标签,0表示正常,1表示异常。The GAN generator adopts the encoder-decoder architecture of transformer; the encoder maps the input data x1_true in step 3 and the noise data x2_false in step 4 to the latent space latent vector z; the latent vector z is used as the input of the decoder, and the decoder generates the output data y1_true in step 3 and the noise output y2_false according to the latent vector z; at the same time, the latent vector z output by the encoder is used as the input of the discriminator, and the discriminator classifies the latent vector z and outputs 0 and 1 labels, 0 indicates normal and 1 indicates abnormal.
步骤6.2:基础模块;Step 6.2: Basic module;
编码器和解码器均由嵌入层、位置编码层、注意力层等基础transformer模块组成;嵌入层是一个线性层,将输入的特征向量映射到更高维度的表示空间;位置编码层是一个可学习的参数矩阵,用于学习高维序列相对或绝对位置的信息,形状和嵌入层的输出相同;注意力层使用缩放点积注意力机制,在点积注意力的基础上,对注意力权重进行缩放,以提高模型的稳定性。具体公式如下:Both the encoder and decoder are composed of basic transformer modules such as the embedding layer, position encoding layer, and attention layer. The embedding layer is a linear layer that maps the input feature vector to a higher-dimensional representation space. The position encoding layer is a learnable parameter matrix used to learn the relative or absolute position information of the high-dimensional sequence, and its shape is the same as the output of the embedding layer. The attention layer uses a scaled dot product attention mechanism, and scales the attention weights based on the dot product attention to improve the stability of the model. The specific formula is as follows:
式中,Q·KT为表示查询向量Q和键向量K的点积,dk为维度缩放因子;V为值向量;Where Q·KT represents the dot product of the query vector Q and the key vector K, dk is the dimension scaling factor; V is the value vector;
步骤6.3:编码器;Step 6.3: Encoder;
GAN生成器的编码器由1个嵌入层、1个位置编码层、2个自注意力层组成;嵌入层的输出和位置编码矩阵相加,对相加后的矩阵向量进行归一化处理,送入到第一个自注意力层,用于信息融合;引入一个可学习的参数矩阵作为查询向量Q,第一个自注意力层的输出作为键向量K和值向量V,将三个矩阵送入第二个自注意力层,通过参数矩阵来控制不同时间片段之间信息流动的强度;编码器的输出作为潜在空间隐向量,用于解码器和GAN判别器的输入。在本实施例中,嵌入层是一个输入47维度,输出128维度的线性层,将稀疏向量转换为密集向量,捕捉到输入数据中的更多信息。The encoder of the GAN generator consists of 1 embedding layer, 1 position encoding layer, and 2 self-attention layers; the output of the embedding layer is added to the position encoding matrix, the added matrix vector is normalized, and sent to the first self-attention layer for information fusion; a learnable parameter matrix is introduced as the query vector Q, the output of the first self-attention layer is used as the key vector K and the value vector V, and the three matrices are sent to the second self-attention layer, and the parameter matrix is used to control the intensity of information flow between different time segments; the output of the encoder is used as the latent vector in the latent space for the input of the decoder and the GAN discriminator. In this embodiment, the embedding layer is a linear layer with an input of 47 dimensions and an output of 128 dimensions, which converts sparse vectors into dense vectors and captures more information in the input data.
步骤6.4:解码器;Step 6.4: Decoder;
GAN生成器的解码器和编码器结构相同,外加3个线性层用于预测;将编码器的输出送入到解码器嵌入层;将解码器第二个自注意力层的输出送到线性层;线性层的输出为预测结果。在本实施例中,解码器嵌入层的输出128维度,外加的3个线性层分别为128、47、47,将密集向量还原到原始维度,用于预测。The decoder and encoder structures of the GAN generator are the same, with three additional linear layers for prediction; the output of the encoder is fed into the decoder embedding layer; the output of the second self-attention layer of the decoder is fed into the linear layer; the output of the linear layer is the prediction result. In this embodiment, the output of the decoder embedding layer is 128 dimensions, and the three additional linear layers are 128, 47, and 47 respectively, which restore the dense vector to its original dimension for prediction.
步骤6.5:GAN判别器;Step 6.5: GAN discriminator;
GAN的判别器是一个3层感知机,其中2个线性层使用GELU激活函数,最后一个输出层使用Sigmoid激活函数,使得最后一层神经元输出0~1之间的小数,用于判别是正常或者异常的概率。在本实施例中,判别器输入47维特征向量,3层感知机输出维度分别为256、33、1,最后用于分类。The discriminator of GAN is a 3-layer perceptron, in which 2 linear layers use the GELU activation function, and the last output layer uses the Sigmoid activation function, so that the last layer of neurons outputs a decimal between 0 and 1, which is used to determine the probability of normal or abnormal. In this embodiment, the discriminator inputs a 47-dimensional feature vector, and the output dimensions of the 3-layer perceptron are 256, 33, and 1 respectively, which are finally used for classification.
步骤6.6:模型参数;Step 6.6: Model parameters;
GAN生成器的编码器和解码器使用GELU激活函数;使用Adam优化器训练GAN;学习率设置为0.0001;The encoder and decoder of the GAN generator use the GELU activation function; the GAN is trained using the Adam optimizer; the learning rate is set to 0.0001;
损失函数包括2个部分:WMSE加权均方误差用于计算GAN生成器预测数据与输出时序片段的重构损失;交叉熵损失用于计算GAN判别器的分类结果。具体公式为:The loss function consists of two parts: the WMSE weighted mean square error is used to calculate the reconstruction loss of the GAN generator prediction data and the output time series segment; the cross entropy loss is used to calculate the classification result of the GAN discriminator. The specific formula is:
Loss=WMSE+LLoss = WMSE + L
式中,Loss为总损失;WMSE为加权均方误差损失,L为交叉熵损失;In the formula, Loss is the total loss; WMSE is the weighted mean square error loss, and L is the cross entropy loss;
式中,n为样本预测个数,d为样本参数维度;y′ij为模型预测值,yij为实际值;Where n is the number of sample predictions, d is the sample parameter dimension; y′ij is the model prediction value, yij is the actual value;
式中:i为观测样本,j为所属类别,M表示类别的数量,yijlog(pij)表示该类别和样本i是否相同,相同为1,不同为0,pij表示对于观测样本i属于类别j的概率。Where i is the observed sample, j is the category, M is the number of categories, yij log(pij ) indicates whether the category is the same as sample i, 1 if they are the same and 0 if they are different, and pij indicates the probability that the observed sample i belongs to category j.
在本实施例中,共收集浇铸过程参数数据288473条,按照70%和30%的比例将数据集划分训练数据和测试数据;分批次训练模型,每批次64个样本,每个样本维度是(360,47);WMSE中结晶器液位所占权重为0.31,其他参数所占权重分别为0.015,着重学习结晶器液位的变化趋势;图5为模型训练过程的Loss损失,横坐标表示迭代次数(千次),训练模型直至收敛。In this embodiment, a total of 288,473 casting process parameter data were collected, and the data set was divided into training data and test data at a ratio of 70% and 30%; the model was trained in batches, with 64 samples in each batch and the dimension of each sample being (360, 47); the weight of the crystallizer liquid level in WMSE was 0.31, and the weights of other parameters were 0.015 respectively, focusing on learning the changing trend of the crystallizer liquid level; Figure 5 shows the Loss loss of the model training process, and the horizontal axis represents the number of iterations (thousand times), and the model is trained until convergence.
步骤7:交替训练GAN生成器和判别器:Step 7: Alternately train the GAN generator and discriminator:
采用python numpy库的shuffle和batch函数,对样本数据随机洗乱之后训练GAN;在训练生成器时,固定判别器参数,并更新生成器参数以最小化其损失函数;在训练判别器时,固定生成器参数,并更新判别器参数以最小化其损失函数。本实施例中,图6为训练好的判别器对正常数据和噪声数据的分割图。The shuffle and batch functions of the python numpy library are used to randomly shuffle the sample data and then train the GAN; when training the generator, the discriminator parameters are fixed and the generator parameters are updated to minimize its loss function; when training the discriminator, the generator parameters are fixed and the discriminator parameters are updated to minimize its loss function. In this embodiment, FIG6 is a segmentation diagram of the trained discriminator for normal data and noise data.
步骤8:模型评价合格后对结晶器液位异常情况进行判别,设置置信度阈值t,当判别器预测score大于阈值t时判定为异常;生成器输出的预测数据包含所有参数未来一段时间内的变化趋势,可用于提前观测结晶器液位的变化。本实施例中,图7和图8为部分参数真实曲线图和预测曲线图,由图可知预测趋势和真实趋势大致相同,说明模型拟合较好。Step 8: After the model is evaluated as qualified, the abnormal situation of the crystallizer liquid level is discriminated, and the confidence threshold t is set. When the discriminator predicts that the score is greater than the threshold t, it is judged as abnormal; the prediction data output by the generator contains the change trend of all parameters in the future period of time, which can be used to observe the change of the crystallizer liquid level in advance. In this embodiment, Figures 7 and 8 are the true curve graphs and predicted curve graphs of some parameters. It can be seen from the figure that the predicted trend and the true trend are roughly the same, indicating that the model fit is good.
步骤9:采用训练好的GAN数据驱动模型进行结晶器液位异常情况在线实时预报,并将模型输出反馈到数字孪生环境。Step 9: Use the trained GAN data-driven model to perform online real-time prediction of abnormal crystallizer liquid level, and feed the model output back to the digital twin environment.
实施例2Example 2
本发明还提供一种基于数字孪生技术的连铸结晶器液位异常预报系统,所述基于数字孪生技术的连铸结晶器液位异常预报系统可以通过执行所述基于数字孪生技术的连铸结晶器液位异常预报方法的流程步骤予以实现,即本领域技术人员可以将所述基于数字孪生技术的连铸结晶器液位异常预报方法理解为所述基于数字孪生技术的连铸结晶器液位异常预报系统的优选实施方式。The present invention also provides a continuous casting mold liquid level anomaly prediction system based on digital twin technology. The continuous casting mold liquid level anomaly prediction system based on digital twin technology can be realized by executing the process steps of the continuous casting crystallizer liquid level anomaly prediction method based on digital twin technology, that is, technical personnel in this field can understand the continuous casting crystallizer liquid level anomaly prediction method based on digital twin technology as the preferred implementation mode of the continuous casting crystallizer liquid level anomaly prediction system based on digital twin technology.
根据本发明提供的基于数字孪生技术的连铸结晶器液位异常预报系统,包括:The continuous casting mold liquid level abnormality prediction system based on digital twin technology provided by the present invention includes:
模块M1:构建高保真连铸数字孪生物理环境;Module M1: Building a high-fidelity continuous casting digital twin physical environment;
构建包括中包车、结晶器、扇形段、支架、辊系在内的关键设备部件的三维模型,导入3D建模和仿真引擎,组装成完整的连铸生产线;利用粒子系统模拟熔融金属液体的浇注和流动,展现浇铸全过程;Construct 3D models of key equipment components including the tundish car, crystallizer, sector, bracket, and roller system, import 3D modeling and simulation engines, and assemble them into a complete continuous casting production line; use the particle system to simulate the pouring and flow of molten metal liquid to show the entire casting process;
模块M2:收集和融合浇铸过程中影响结晶器液位的多源异构数据;Module M2: Collect and integrate multi-source heterogeneous data that affect the mold level during the casting process;
与工业现场的监控系统、数据采集设备对接,获取实时生产数据,控制包括中包车、结晶器、辊系在内的数字孪生体的运动轨迹和速度;结合冶金原理分析及现场操作工的经验,选择影响结晶器液位波动的特征参数;Connect with the monitoring system and data acquisition equipment at the industrial site to obtain real-time production data and control the movement trajectory and speed of the digital twin including the tundish, crystallizer, and roller system; select the characteristic parameters that affect the crystallizer liquid level fluctuation based on the analysis of metallurgical principles and the experience of on-site operators;
模块M3:对参数数据进行预处理,按固定窗口长度W分割多变量时序片段作为数据驱动模型的正样本,其中包括输入数据和输出数据;Module M3: preprocesses the parameter data and divides the multivariate time series segments into fixed window length W as positive samples of the data-driven model, including input data and output data;
模块M4:从随机噪声中生成噪声数据作为数据驱动模型的负样本,噪声数据维度和模块M3中分割后的输入数据维度相同,复制模块M3中分割后的输出数据作为噪声的输出;Module M4: Generate noise data from random noise as negative samples of the data-driven model. The dimension of the noise data is the same as the dimension of the input data after segmentation in module M3. Copy the output data after segmentation in module M3 as the output of the noise.
模块M5:构建样本集,将模块M3中的输入数据和模块M4中的噪声数据作为输入样本,分别记作x1_true和x2_false;将模块M3中的输出数据和模块M4中噪声的输出作为输出样本,分别记作y1_true和y2_false;同时,对真实的输入数据和噪声数据分类,分别标记为0和1的标签;Module M5: Construct a sample set, take the input data in module M3 and the noise data in module M4 as input samples, record them as x1_true and x2_false respectively; take the output data in module M3 and the output of the noise in module M4 as output samples, record them as y1_true and y2_false respectively; at the same time, classify the real input data and the noise data, and mark them as 0 and 1 respectively;
模块M6:构建GAN网络的数字孪生数据驱动模型;Module M6: Building a digital twin data-driven model of the GAN network;
GAN生成器使用transformer的编解码器架构,引入交叉注意力机制,捕捉跨时间和跨维度的依赖关系;判别器使用多层感知机结构;GAN生成器中编码器的输出作为判别器的输入,判别器的损失函数使用二分类交叉熵损失,输出为0和1标签;The GAN generator uses the transformer encoder-decoder architecture and introduces a cross-attention mechanism to capture dependencies across time and dimensions. The discriminator uses a multi-layer perceptron structure. The output of the encoder in the GAN generator is used as the input of the discriminator. The loss function of the discriminator uses a binary cross-entropy loss, and the output is a 0 or 1 label.
模块M7:交替训练GAN生成器和判别器;Module M7: Alternately train the GAN generator and discriminator;
采用python numpy库的shuffle和batch函数,对样本数据随机洗乱之后训练GAN;在训练生成器时,固定判别器参数,并更新生成器参数以最小化其损失函数;在训练判别器时,固定生成器参数,并更新判别器参数以最小化其损失函数;The shuffle and batch functions of the python numpy library are used to randomly shuffle the sample data before training the GAN. When training the generator, the discriminator parameters are fixed and updated to minimize its loss function. When training the discriminator, the generator parameters are fixed and updated to minimize its loss function.
模块M8:模型评价合格后对结晶器液位异常情况进行判别,设置置信度阈值t,当判别器预测分数大于阈值t时判定为异常;生成器输出的预测数据包含所有参数未来一段时间内的变化趋势,用于提前观测结晶器液位的变化;Module M8: After the model is evaluated as qualified, the abnormal situation of the crystallizer liquid level is judged, and the confidence threshold t is set. When the discriminator prediction score is greater than the threshold t, it is judged as abnormal; the prediction data output by the generator contains the change trend of all parameters in the future period of time, which is used to observe the change of the crystallizer liquid level in advance;
模块M9:采用训练好的GAN数据驱动模型进行结晶器液位异常情况在线实时预报,并将模型输出反馈到数字孪生环境。Module M9: Use the trained GAN data-driven model to perform online real-time prediction of abnormal crystallizer liquid level, and feed the model output back to the digital twin environment.
选择影响结晶器液位波动的特征参数,包括中包钢水净重、塞棒位置、浇铸区连续测温温度、结晶器液位、拉速各1个,结晶器水出口流量4个、油缸摩擦功2个、驱动辊力矩11个、拉绞辊电流25个,共计47个维度。The characteristic parameters that affect the fluctuation of the crystallizer liquid level are selected, including the net weight of molten steel in the tundish, the position of the stopper rod, the continuous temperature measurement in the casting area, the crystallizer liquid level, and the drawing speed, 4 crystallizer water outlet flow rates, 2 cylinder friction works, 11 driving roller torques, and 25 drawing roller currents, totaling 47 dimensions.
所述模块M3包括:The module M3 comprises:
模块M3.1:对模块M2中的参数数据按约束条件进行筛选,筛选出浇铸过程数据,其约束条件为中包车在浇铸位、结晶器液位大于750mm、浇铸区连续测温温度大于1500℃;Module M3.1: Filter the parameter data in module M2 according to the constraints to select the casting process data. The constraints are that the tundish is in the casting position, the liquid level of the crystallizer is greater than 750mm, and the continuous temperature measurement temperature in the casting area is greater than 1500℃.
模块M3.2:利用python中fillna函数前向填充空值,得到多变量时序数据;Module M3.2: Use the fillna function in Python to forward fill in empty values to obtain multivariate time series data;
模块M3.3:将多变量时序数据按固定窗口长度W进行分割,得到一系列长度为W的数据片段;每个片段包含多个变量的值,形成一个二维张量,该张量作为一个样本数据;其中,前W1个作为样本输入数据,(W-W1)个作为样本输出数据;Module M3.3: Split the multivariate time series data into fixed window length W to obtain a series of data segments of length W; each segment contains the values of multiple variables, forming a two-dimensional tensor, which is used as a sample data; among them, the first W1 are used as sample input data, and (W-W1) are used as sample output data;
模块M3.4:准备多个批次的数据,每个批次包含多个样本,用于后续模型的训练。Module M3.4: Prepare multiple batches of data, each batch containing multiple samples, for subsequent model training.
所述模块M6包括:The module M6 comprises:
GAN生成器采用transformer的编解码器架构;编码器将模块M3中的输入数据x1_true和模块M4中的噪声数据x2_false映射到潜在空间隐向量z;隐向量z作为解码器的输入,解码器根据隐向量z生成模块M3中的输出数据y1_true和噪声的输出y2_false;同时,编码器输出的隐向量z作为判别器的输入,判别器对隐向量z分类,输出0和1标签,0表示正常,1表示异常;The GAN generator adopts the encoder-decoder architecture of transformer; the encoder maps the input data x1_true in module M3 and the noise data x2_false in module M4 to the latent space hidden vector z; the hidden vector z is used as the input of the decoder, and the decoder generates the output data y1_true in module M3 and the noise output y2_false according to the hidden vector z; at the same time, the hidden vector z output by the encoder is used as the input of the discriminator, and the discriminator classifies the hidden vector z and outputs 0 and 1 labels, 0 indicates normal and 1 indicates abnormal;
编码器和解码器均由嵌入层、位置编码层、注意力层组成;嵌入层是一个线性层,将输入的特征向量映射到更高维度的表示空间;位置编码层是一个可学习的参数矩阵,用于学习高维序列相对或绝对位置的信息,形状和嵌入层的输出相同;注意力层使用缩放点积注意力机制,在点积注意力的基础上,对注意力权重进行缩放,以提高模型的稳定性,具体公式如下:Both the encoder and decoder are composed of an embedding layer, a position encoding layer, and an attention layer; the embedding layer is a linear layer that maps the input feature vector to a higher-dimensional representation space; the position encoding layer is a learnable parameter matrix used to learn the relative or absolute position information of the high-dimensional sequence, and its shape is the same as the output of the embedding layer; the attention layer uses a scaled dot product attention mechanism, and on the basis of the dot product attention, the attention weight is scaled to improve the stability of the model. The specific formula is as follows:
式中,Q·KT为表示查询向量Q和键向量K的点积,dk为维度缩放因子;V为值向量;Where Q·KT represents the dot product of the query vector Q and the key vector K, dk is the dimension scaling factor; V is the value vector;
GAN生成器的编码器由1个嵌入层、1个位置编码层、2个自注意力层组成;嵌入层的输出和位置编码矩阵相加,对相加后的矩阵向量进行归一化处理,送入到第一个自注意力层,用于信息融合;引入一个可学习的参数矩阵作为查询向量Q,第一个自注意力层的输出作为键向量K和值向量V,将三个矩阵送入第二个自注意力层,通过参数矩阵来控制不同时间片段之间信息流动的强度;编码器的输出作为潜在空间隐向量,用于解码器和GAN判别器的输入;The encoder of the GAN generator consists of 1 embedding layer, 1 position encoding layer, and 2 self-attention layers; the output of the embedding layer is added to the position encoding matrix, the added matrix vector is normalized, and sent to the first self-attention layer for information fusion; a learnable parameter matrix is introduced as the query vector Q, the output of the first self-attention layer is used as the key vector K and the value vector V, and the three matrices are sent to the second self-attention layer, and the parameter matrix is used to control the intensity of information flow between different time segments; the output of the encoder is used as the latent vector in the latent space for the input of the decoder and the GAN discriminator;
GAN生成器的解码器和编码器结构相同,外加3个线性层用于预测;将编码器的输出送入到解码器嵌入层;将解码器第二个自注意力层的输出送到线性层;线性层的输出为预测结果;The decoder of the GAN generator has the same structure as the encoder, with three additional linear layers for prediction. The output of the encoder is fed into the embedding layer of the decoder. The output of the second self-attention layer of the decoder is fed into the linear layer. The output of the linear layer is the prediction result.
GAN的判别器是一个3层感知机,其中2个线性层使用GELU激活函数,最后一个输出层使用Sigmoid激活函数,使得最后一层神经元输出0~1之间的小数,用于判别是正常或者异常的概率;The discriminator of GAN is a 3-layer perceptron, in which the 2 linear layers use the GELU activation function and the last output layer uses the Sigmoid activation function, so that the last layer of neurons outputs a decimal between 0 and 1 to determine the probability of normal or abnormal;
GAN生成器的编码器和解码器使用GELU激活函数;使用Adam优化器训练GAN;学习率设置为0.0001;The encoder and decoder of the GAN generator use the GELU activation function; the GAN is trained using the Adam optimizer; the learning rate is set to 0.0001;
损失函数包括2个部分:WMSE加权均方误差用于计算GAN生成器预测数据与输出时序片段的重构损失;交叉熵损失用于计算GAN判别器的分类结果,具体公式为:The loss function consists of two parts: the WMSE weighted mean square error is used to calculate the reconstruction loss of the GAN generator prediction data and the output time series segment; the cross entropy loss is used to calculate the classification result of the GAN discriminator. The specific formula is:
Loss=WMSE+LLoss = WMSE + L
式中,Loss为总损失;WMSE为加权均方误差损失,L为交叉熵损失;In the formula, Loss is the total loss; WMSE is the weighted mean square error loss, and L is the cross entropy loss;
式中,n为样本预测个数,d为样本参数维度;y′ij为模型预测值,yij为实际值;wj为类别j的误差损失;Where n is the number of sample predictions, d is the sample parameter dimension;y′ij is the model prediction value,yij is the actual value;wj is the error loss of category j;
式中:i为观测样本,j为所属类别,M表示类别的数量,pij表示对于观测样本i属于类别j的概率。Where i is the observed sample, j is the category it belongs to, M represents the number of categories, and pij represents the probability that the observed sample i belongs to category j.
模型判别器置信度阈值t设置范围为0.5~1,置信度阈值设置越大,检测到异常的概率越大。The confidence threshold t of the model discriminator is set in the range of 0.5 to 1. The larger the confidence threshold is set, the greater the probability of detecting an anomaly.
本领域技术人员知道,除了以纯计算机可读程序代码方式实现本发明提供的系统、装置及其各个模块以外,完全可以通过将方法步骤进行逻辑编程来使得本发明提供的系统、装置及其各个模块以逻辑门、开关、专用集成电路、可编程逻辑控制器以及嵌入式微控制器等的形式来实现相同程序。所以,本发明提供的系统、装置及其各个模块可以被认为是一种硬件部件,而对其内包括的用于实现各种程序的模块也可以视为硬件部件内的结构;也可以将用于实现各种功能的模块视为既可以是实现方法的软件程序又可以是硬件部件内的结构。Those skilled in the art know that, in addition to implementing the system, device and its various modules provided by the present invention in a purely computer-readable program code, it is entirely possible to implement the same program in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded microcontrollers by logically programming the method steps. Therefore, the system, device and its various modules provided by the present invention can be considered as a hardware component, and the modules included therein for implementing various programs can also be considered as structures within the hardware component; the modules for implementing various functions can also be considered as both software programs for implementing the method and structures within the hardware component.
以上对本发明的具体实施例进行了描述。需要理解的是,本发明并不局限于上述特定实施方式,本领域技术人员可以在权利要求的范围内做出各种变化或修改,这并不影响本发明的实质内容。在不冲突的情况下,本申请的实施例和实施例中的特征可以任意相互组合。The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other at will.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410477179.3ACN118585928B (en) | 2024-04-19 | 2024-04-19 | Continuous casting mold liquid level abnormality prediction method and system based on digital twin technology |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410477179.3ACN118585928B (en) | 2024-04-19 | 2024-04-19 | Continuous casting mold liquid level abnormality prediction method and system based on digital twin technology |
| Publication Number | Publication Date |
|---|---|
| CN118585928Atrue CN118585928A (en) | 2024-09-03 |
| CN118585928B CN118585928B (en) | 2025-01-10 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410477179.3AActiveCN118585928B (en) | 2024-04-19 | 2024-04-19 | Continuous casting mold liquid level abnormality prediction method and system based on digital twin technology |
| Country | Link |
|---|---|
| CN (1) | CN118585928B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118965247A (en)* | 2024-10-18 | 2024-11-15 | 福建福清核电有限公司 | A power plant data management method and system based on multi-source data |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2022236064A2 (en)* | 2021-05-06 | 2022-11-10 | Strong Force Iot Portfolio 2016, Llc | Quantum, biological, computer vision, and neural network systems for industrial internet of things |
| CN116944447A (en)* | 2023-06-26 | 2023-10-27 | 东北大学 | Prediction method for instantaneous abnormal fluctuation of liquid level of crystallizer |
| CN117876842A (en)* | 2024-01-10 | 2024-04-12 | 烟台500供热有限公司 | A method and system for detecting anomalies of industrial products based on generative adversarial networks |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2022236064A2 (en)* | 2021-05-06 | 2022-11-10 | Strong Force Iot Portfolio 2016, Llc | Quantum, biological, computer vision, and neural network systems for industrial internet of things |
| CN116944447A (en)* | 2023-06-26 | 2023-10-27 | 东北大学 | Prediction method for instantaneous abnormal fluctuation of liquid level of crystallizer |
| CN117876842A (en)* | 2024-01-10 | 2024-04-12 | 烟台500供热有限公司 | A method and system for detecting anomalies of industrial products based on generative adversarial networks |
| Title |
|---|
| MD. NAZMUL HASAN等: "Wasserstein GAN-based Digital Twin Inspired Model for Early Drift Fault Detection in Wireless Sensor Networks", 《IEEE SENSORS JOURNAL》, 31 December 2017 (2017-12-31), pages 1 - 14* |
| 金家兴: "基于数字孪生的滚动轴承故障建模与智能诊断方法研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》, no. 01, 15 January 2024 (2024-01-15), pages 029 - 309* |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118965247A (en)* | 2024-10-18 | 2024-11-15 | 福建福清核电有限公司 | A power plant data management method and system based on multi-source data |
| CN118965247B (en)* | 2024-10-18 | 2025-02-14 | 福建福清核电有限公司 | Power plant data management method and system based on multi-source data |
| Publication number | Publication date |
|---|---|
| CN118585928B (en) | 2025-01-10 |
| Publication | Publication Date | Title |
|---|---|---|
| Weng et al. | A decomposition dynamic graph convolutional recurrent network for traffic forecasting | |
| CN109460855A (en) | A kind of throughput of crowded groups prediction model and method based on focus mechanism | |
| CN110287583B (en) | A Remaining Life Prediction Method of Industrial Equipment Based on Recurrent Neural Network | |
| CN111860787A (en) | A short-term prediction method and device for coupled directed graph structure traffic data containing missing data | |
| CN110232461A (en) | More interconnection vector machine water quality prediction methods based on quantum genetic algorithm optimization | |
| CN118585928A (en) | Continuous casting mold liquid level abnormality prediction method and system based on digital twin technology | |
| CN117350152A (en) | Electromagnetic field modeling methods, systems, equipment and media based on mechanism data fusion | |
| Klopries et al. | ITF-GAN: Synthetic time series dataset generation and manipulation by interpretable features | |
| Yan et al. | A 3-D convolution-based burn-through point multistep prediction model for sintering process | |
| Liu et al. | A novel integration framework for degradation-state prediction via transformer model with autonomous optimizing mechanism | |
| CN116007937A (en) | Intelligent fault diagnosis method and device for mechanical equipment transmission part | |
| CN116596150A (en) | Event Prediction Method Based on Multi-Branch Self-Attention Transformer Hawkes Process Model | |
| CN119848632B (en) | A vehicle trajectory prediction method and system integrating large kernel convolution and attention mechanism | |
| CN115034554A (en) | Continuous casting billet quality prediction method and system based on time sequence network | |
| Lu et al. | Learning car-following behaviors for a connected automated vehicle system: an improved sequence-to-sequence deep learning model | |
| Chen et al. | Traffic flow prediction with parallel data | |
| CN112182854B (en) | Intelligent monitoring method and system for abnormal furnace conditions of blast furnace | |
| CN117743936A (en) | Vehicle track prediction method based on multi-sequence space-time tensor fusion | |
| CN119861641A (en) | Remote control method and system based on bond alloy wire equipment | |
| Xu et al. | Vehicle-induced deflection prediction using long short-term memory networks | |
| CN114742800B (en) | Reinforced learning electric smelting magnesium furnace working condition identification method based on improved converter | |
| CN116861974A (en) | Arbitrary continuous-time perception model and training method for simulating mixed synaptic transmission | |
| Li et al. | A Spatiotemporal Graph Transformer Network for real-time ball trajectory monitoring and prediction in dynamic sports environments | |
| Chen et al. | Circular economy oriented future building information processing: PSO for CNN approach | |
| Qin et al. | Research on transformer and long short-term memory neural network car-following model considering data loss. |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |