A method and system for tracing the quality of a triflic acid product

CN123014810APending Publication Date: 2026-10-30FU JIAN SHENG JIAN YANG JIN SHI FU YE YOU XIAN GONG SI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611485536.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-23
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0003]本发明提供一种三氟甲磺酸产品质量溯源管理方法及系统,旨在解决现有技术中反应过程参数与杂质谱数据相互割裂、环境扰动模式无法与过程杂质特征有效融合的问题,实现从生产数据到质量缺陷根源的精准逆向追踪

Benefits of technology

[0018]将反应动力学过程参数通过反应路径特征映射处理,得到反应路径特征张量,并对精馏分离阶段杂质谱数据进行杂质成分解耦处理,得到杂质特征向量,再执行化学计量空间对齐,生成过程-杂质联合特征集合。该处理方式将原本分散在反应工程数据空间与分析化学数据空间的信息,依据反应阶段与杂质出峰时间之间的对应关系映射至统一化学计量坐标下,打破了两类数据之间的语义壁垒。由此,氟化反应中间体浓度变化、氧化态演变趋势与各杂质成分的保留时间、分子结构特征能够在同一表示空间中形成对应关系,使得原本孤立的过程偏移与杂质残留之间的化学关联得以显式编码,为召回质量异常的真实工艺根源提供了跨域特征基础。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123014810A_ABST
    Figure CN123014810A_ABST
Patent Text Reader

Abstract

The application discloses a triflic acid product quality traceability management method and system, and belongs to the technical field of chemical product quality management. The method comprises the following steps: acquiring reaction kinetics process parameters of each production batch in the triflic acid production process, impurity spectrum data in the rectification separation stage, and a particle count time sequence of a clean room environment; performing reaction path characteristic mapping on the reaction kinetics process parameters, performing impurity composition decoupling on the impurity spectrum data, and performing chemical metering space alignment on the results to generate a process-impurity combined feature set; using a graph neural network model to perform environment disturbance mode coding on the environment particle time sequence, and performing cross-attention fusion of the environment disturbance mode coding and the process-impurity combined feature set to obtain a fusion traceability feature set; and performing reverse causal chain tracking based on the fusion feature set to generate a root process positioning result and a root impurity type identification result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of chemical product quality management technology, specifically to a method and system for quality traceability management of trifluoromethanesulfonic acid products. Background Technology

[0002] Trifluoromethanesulfonic acid, a key raw material for high-end electronic chemicals and pharmaceutical intermediates, directly impacts the performance and yield of downstream products due to quality fluctuations. Existing quality traceability methods primarily rely on batch record comparison and offline sampling inspection, manually reviewing reactor temperature and pressure curves, distillation column temperature distribution, and cleanroom particle counter reports to check for anomalies step-by-step. However, this method has significant drawbacks. Firstly, reaction kinetic parameters, distillation impurity spectra, and environmental particulate matter data are collected by different systems and stored independently in time series or spectral formats. There is a lack of means to correlate chemical reaction pathway information with impurity formation mechanisms within a unified stoichiometric space, resulting in a fragmented causal link between process anomalies and impurity residues, making it difficult to pinpoint the true source of quality defects. Secondly, the impact of cleanroom environmental particulate matter on product quality exhibits complex nonlinear temporal disturbance characteristics. Traditional threshold alarms can only determine whether the particulate matter count exceeds the standard, failing to effectively extract the evolution of correlation patterns across different particle size ranges. Furthermore, they cannot fuse these environmental disturbance patterns with the distribution of impurities generated within the process at the feature level, causing environmental factors to be treated in isolation, leading to misjudgments or omissions in traceability results. Uncovering the deep connections between reaction pathways, impurity characteristics, and environmental disturbance patterns, and applying these connections to reverse causal deduction, has become a key challenge in the quality control of trifluoromethanesulfonic acid. Summary of the Invention

[0003] This invention provides a method and system for quality traceability management of trifluoromethanesulfonic acid products, aiming to solve the problems in the prior art where reaction process parameters and impurity spectrum data are disconnected and environmental disturbance modes cannot be effectively integrated with process impurity characteristics, so as to achieve accurate reverse tracing from production data to the root cause of quality defects.

[0004] The objective of this invention can be achieved through the following technical solutions:

[0005] This invention provides a method for quality traceability management of trifluoromethanesulfonic acid products. By simultaneously acquiring reaction kinetic process parameters, impurity spectrum data of the distillation separation stage, and the time sequence of particulate matter counts in the cleanroom environment, a multi-dimensional integrated analysis of the production process is performed to achieve accurate traceability of product quality defects. The method includes: acquiring reaction kinetic parameters, impurity spectrum data of the distillation separation stage, and time series sequence of particulate matter counts in the cleanroom environment for each production batch in the trifluoromethanesulfonic acid production process; performing reaction path feature mapping processing on the reaction kinetic parameters to obtain a reaction path feature tensor; performing impurity component decoupling processing on the impurity spectrum data of the distillation separation stage to obtain an impurity feature vector; performing stoichiometric space alignment processing on the reaction path feature tensor and the impurity feature vector to generate an aligned process-impurity joint feature set; calling a pre-trained graph neural network model to perform environmental perturbation pattern encoding processing on the cleanroom environment particulate matter count time series sequence to generate an environmental perturbation feature code; performing cross-attention fusion processing on the environmental perturbation feature code and the process-impurity joint feature set to generate a fused traceability feature set; and performing reverse causal chain tracing processing on the fused traceability feature set to generate root cause process location results and root cause impurity type identification results for each production batch of trifluoromethanesulfonic acid product.

[0006] As a preferred embodiment of the present invention, the acquisition of reaction kinetic parameters, impurity spectrum data of the distillation separation stage, and cleanroom environmental particulate matter count time series for each production batch in the trifluoromethanesulfonic acid production process includes: collecting time series data of reactor temperature, reaction pressure, and reactant feed rate for each production batch from a distributed control system as the reaction kinetic parameters; reading the impurity composition and relative content data of each fraction from an online gas chromatograph-mass spectrometer connected to the distillation column in real time as the impurity spectrum data; and reading the particulate matter count values ​​of different particle size ranges from a laser particulate counter deployed in the cleanroom at a fixed sampling frequency to generate the cleanroom environmental particulate matter count time series. This achieves synchronous and correlated acquisition of three key data types: reaction process, impurity distribution, and environmental cleanliness.

[0007] Preferably, the step of performing reaction path feature mapping processing on the reaction kinetic process parameters to obtain a reaction path feature tensor includes: dividing the reaction kinetic process parameters according to reaction stages to obtain fluorination reaction stage parameters, oxidation reaction stage parameters, and distillation purification stage parameters; calling a pre-trained reaction path encoder to perform intermediate concentration temporal encoding processing on the fluorination reaction stage parameters to generate a first intermediate feature sequence; performing oxidation state evolution encoding processing on the oxidation reaction stage parameters to generate an oxidation state feature sequence; performing fraction composition dynamic encoding processing on the distillation purification stage parameters to generate a fraction feature sequence; and concatenating the first intermediate feature sequence, the oxidation state feature sequence, and the fraction feature sequence through reaction stage concatenation processing to generate the reaction path feature tensor. This processing can extract feature tensors representing the deep dynamics of the reaction path from multiple reaction stages, providing a structured representation for subsequent correlation analysis.

[0008] Preferably, the step of decoupling the impurity components from the impurity spectrum data of the distillation separation stage to obtain the impurity feature vector includes: performing chromatographic peak detection processing on the impurity spectrum data of the distillation separation stage to identify the retention time and peak area data of the chromatographic peaks corresponding to multiple impurity components; calling a pre-trained mass spectrometry analysis model to perform molecular structure inversion processing on the mass spectrometric fragment information of each impurity component to generate a candidate molecular structure feature vector for each impurity component; and arranging the candidate molecular structure feature vectors of each impurity component in peak order based on the chromatographic peak retention time to obtain the impurity feature vector. This processing decouples the impurity components from the spectrum and introduces the molecular structure dimension, improving the accuracy of impurity type identification.

[0009] Furthermore, the step of aligning the reaction path feature tensor and the impurity feature vector in stoichiometric space to generate an aligned process-impurity joint feature set includes: extracting the reaction condition parameter vector corresponding to each reaction stage in the reaction path feature tensor; extracting the retention time label corresponding to each impurity component in the impurity feature vector; constructing a time correspondence matrix between reaction stages and impurity components; mapping the reaction condition parameter vector to the same time coordinate axis as the impurity feature vector according to the retention time label; and performing feature dimension alignment and concatenation processing on the mapped reaction condition parameter vector and the impurity feature vector to generate the process-impurity joint feature set. This achieves precise alignment of reaction conditions and impurity generation in the time domain, forming an integrated characterization.

[0010] Preferably, the step of calling the pre-trained graph neural network model to encode the environmental disturbance pattern of the cleanroom environmental particulate matter counting time series to generate environmental disturbance feature codes includes: performing time window sliding segmentation on the cleanroom environmental particulate matter counting time series to obtain particulate matter counting sub-sequences corresponding to multiple time windows; for each time window, constructing an environmental particulate matter association graph structure with particulate matter size ranges as nodes and counting correlation relationships between size ranges as edges; using the particulate matter counting sub-sequences of each time window as the initial features of the corresponding graph structure nodes, inputting them into the graph neural network model for graph convolution iterative update processing to obtain graph-level feature vectors for each time window; and performing temporal attention weighted aggregation processing on the graph-level feature vectors of each time window to generate the environmental disturbance feature codes. This process models the mutual influence relationships between particulate matter sizes using a graph structure and highlights key disturbance periods through a temporal attention mechanism, accurately capturing the dynamic disturbance patterns of the cleanroom environment.

[0011] Preferably, the step of performing cross-attention fusion processing on the environmental disturbance feature encoding and the process-impurity joint feature set to generate a fused traceability feature set includes: using the process-impurity joint feature set as a query feature matrix, and using the environmental disturbance feature encoding as a key feature matrix and a value feature matrix; calculating the attention weight matrix between the query feature matrix and the key feature matrix, and using the attention weight matrix to perform weighted summation processing on the value feature matrix to obtain an environmental weighted feature matrix; and performing residual connection processing on the environmental weighted feature matrix and the process-impurity joint feature set to generate the fused traceability feature set. This fusion method allows environmental disturbance features to be adaptively weighted according to the reaction process and impurity distribution content, highlighting the impact of environmental disturbances on local features while retaining the original process-impurity information.

[0012] In a preferred embodiment of the present invention, an attention mask matrix for each production process stage is introduced into the cross-attention fusion process. This matrix restricts the environmental disturbance feature encoding to only perform attention calculations on the portion of the process-impurity joint feature set corresponding to the reaction stage. This avoids cross-stage interference and enhances the stage correspondence of the fused features.

[0013] Furthermore, the reaction path feature mapping processing, the impurity component decoupling processing, and the stoichiometric spatial alignment processing are all performed based on the same pre-trained multimodal stoichiometric alignment network, which uses a contrastive learning loss function for joint optimization. Through end-to-end joint training, the reaction path, impurity component, and temporal-spatial alignment are highly synergistic at the feature level, improving the consistency of joint feature expression.

[0014] Preferably, before performing reverse causal chain tracing processing of product quality based on the fused traceability feature set, the method further includes: obtaining a process topology diagram of the trifluoromethanesulfonic acid production process; extracting the sequential dependencies between each production process from the process topology diagram; obtaining the defect impurity type and defect occurrence process information corresponding to the defect samples recorded in historical quality defect record data; and constructing a directed acyclic graph structure of a Bayesian network based on the sequential dependencies between each production process and the defect impurity type and defect occurrence process information, wherein the direction of the connection edge between each process node and the impurity type node is from the process node to the impurity type node. This network structure explicitly expresses the causal dependency between the process and the generation of impurities.

[0015] Further, the step of performing reverse causal chain tracing processing for product quality based on the fused traceability feature set to generate root cause process location results and root cause impurity type identification results includes: inputting the fused traceability feature set into a pre-trained Bayesian network model, wherein the Bayesian network model contains multiple nodes, each node corresponding to a production process or an impurity type; extracting all parent nodes that have directed edges connected to the product quality defect node from the Bayesian network model to form a candidate root cause node set; performing posterior probability inference calculation on each candidate root cause node in the candidate root cause node set to obtain the causal contribution probability of each candidate root cause node to the product quality defect node; selecting the candidate root cause node with the highest causal contribution probability as the root cause node, taking the production process corresponding to the root cause node as the root cause process location result, and taking the impurity type corresponding to the root cause node as the root cause impurity type identification result. The step of performing posterior probability inference calculation on candidate root cause nodes to obtain causal contribution probabilities includes: for each candidate root cause node, obtaining the conditional probability distribution table of the candidate root cause node in the Bayesian network model; inputting the fused traceability feature set as observation evidence into the Bayesian network model, running a belief propagation algorithm to perform probability update processing on the Bayesian network model, and obtaining the posterior probability distribution of each candidate root cause node under the observation evidence; extracting the probability value of the candidate root cause node taking an abnormal state from the posterior probability distribution, and using this probability value as the causal contribution probability of the candidate root cause node to the product quality defect node. Through the causal inference mechanism of the Bayesian network, the most likely causative process and impurity type can be deduced from the fused traceability features, achieving explainable root cause tracing.

[0016] The present invention also includes a trifluoromethanesulfonic acid product quality traceability management system. This system includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of the aforementioned trifluoromethanesulfonic acid product quality traceability management method. This system can be integrated into a production monitoring platform to achieve automatic traceability and attribution analysis of quality defects in trifluoromethanesulfonic acid products.

[0017] The beneficial effects of this invention are:

[0018] By processing reaction kinetic parameters through reaction path feature mapping to obtain reaction path feature tensors, and decoupling impurity component data from the distillation separation stage to obtain impurity feature vectors, stoichiometric space alignment is performed to generate a process-impurity joint feature set. This processing method maps information originally scattered in the reaction engineering data space and analytical chemistry data space to a unified stoichiometric coordinate system based on the correspondence between reaction stages and impurity elution times, breaking down the semantic barriers between the two types of data. As a result, the concentration changes and oxidation state evolution trends of fluorination reaction intermediates can form a correspondence with the retention times and molecular structure characteristics of various impurity components in the same representation space. This allows the chemical correlation between previously isolated process offsets and impurity residues to be explicitly encoded, providing a cross-domain feature foundation for recalling the true process root causes of quality anomalies.

[0019] For the time series of particulate matter counts in cleanroom environments, an environmental disturbance pattern encoding is performed using a graph neural network model. The correlation between particulate matter counts in different particle size ranges is abstracted into a graph structure. Graph-level features are extracted within a time window and then aggregated using temporal attention weighting to obtain environmental disturbance feature encoding that characterizes the collaborative fluctuation patterns and dynamic evolution of particulate matter. This encoding goes beyond simply determining whether a single particle size threshold is exceeded; it integrates spectral pattern information from interactions across multiple particle size ranges. Subsequently, cross-attention fusion processing is employed, using process-impurity joint features as queries and environmental disturbance features as keys and values. Attention weights are calculated, and the environmental features are weighted and summed. This summation is then residually connected to the original process-impurity features to generate a fused source tracing feature set. This mechanism allows the model to dynamically determine which environmental disturbance patterns are truly related to which reaction stages and impurity components, ensuring that the impact of environmental particulate matter is precisely matched to specific process sites and impurity types. This avoids the crude approach of simply attributing overall environmental fluctuations to all processes and significantly suppresses the interference of environmental noise on the source tracing signal. Attached Figure Description

[0020] The invention will now be further described with reference to the accompanying drawings.

[0021] Figure 1 This is a flowchart of the product quality traceability management method for trifluoromethanesulfonic acid;

[0022] Figure 2 This is a flowchart for generating the process-impurity joint feature set;

[0023] Figure 3 This is a flowchart of environmental disturbance feature encoding and fusion tracing feature generation. Detailed Implementation

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

[0025] See Figure 1This invention provides a method for quality traceability management of trifluoromethanesulfonic acid products. This method collects and integrates quality-related data for each production batch in the trifluoromethanesulfonic acid production process, and achieves reverse causal tracing based on this integrated information. During implementation, the method acquires reaction kinetic parameters, impurity spectrum data from the distillation separation stage, and a cleanroom particulate matter count time series for each production batch in the trifluoromethanesulfonic acid production process. The reaction kinetic parameters characterize the temporal changes in temperature, pressure, and material addition rate during the reaction process. The impurity spectrum data from the distillation separation stage reflects the types and contents of impurities in each fraction during distillation. The cleanroom particulate matter count time series reflects the changes in the number of particles of different sizes in the filling or refining environment over time. The reaction kinetic parameters are processed using reaction path feature mapping, converting them from raw time series signals into a structured representation that characterizes changes in reaction intermediate concentration, oxidation state evolution path, and fraction composition dynamics, resulting in a reaction path feature tensor. The impurity spectrum data from the distillation separation stage is decoupled to separate the molecular structure features and peak order of each independent impurity component from the chromatographic and mass spectrometric information, resulting in an impurity feature vector. The reaction path feature tensor and the impurity feature vector are aligned in stoichiometric space. Utilizing the temporal correspondence between the reaction stage and the impurity peak time, the two types of features are mapped to the same time axis and their feature dimensions are aligned and concatenated to generate an aligned process-impurity joint feature set. Simultaneously, a pre-trained graph neural network model is used to encode the environmental perturbation pattern of the cleanroom environmental particulate matter count time series. The temporal statistical information of multi-size particles is constructed into a particulate matter association graph structure and weighted by graph convolution and temporal attention to generate environmental perturbation feature codes. These environmental perturbation feature codes are then fused with the process-impurity joint feature set using cross-attention. The process-impurity joint feature is used as the query, and the environmental perturbation feature is used as the key and value for calculation, resulting in a process-impurity characterization that incorporates environmental perturbation information, generating a fused source-tracing feature set. Based on the fused traceability feature set, reverse causal chain tracing processing of product quality is performed. In a graphical probability model covering process nodes and impurity type nodes and their causal relationships, the contribution probability of each process or impurity type to the final quality defect is inferred, thereby generating the root process location result and root impurity type identification result for trifluoromethanesulfonic acid products in each production batch.

[0026] In practice, the reaction kinetic parameters, impurity profile data of the distillation separation stage, and particulate matter count time series of each production batch in the trifluoromethanesulfonic acid production process are acquired. The reaction vessel temperature time series, reaction pressure time series, and reactant feed rate time series data for each production batch are collected from the distributed control system as reaction kinetic parameters. The distributed control system records the real-time time series of sensor measurements throughout the entire reaction process. Using time as an index, the setpoints and actual values ​​of temperature, pressure, and flow rates of each feed line in the fluorination and oxidation reactors are extracted to form a multivariate time series. Temperature and pressure transmitters are installed on the fluorination and oxidation reactors. The temperature transmitter converts the internal temperature signal of the reactor into a 4-20mA current signal once per second, and the pressure transmitter converts the pressure signal at the same frequency. The distributed control system acquires these current signals through an analog input module and stores them as temperature and pressure time series data. Each feed line is equipped with a mass flow meter, which transmits instantaneous and cumulative flow rates to the distributed control system via a fieldbus protocol. The distributed control system simultaneously records the setpoint and actual feed flow rates. The setpoint and actual flow rates together constitute the reactant feed rate time-series data. Each time index of the multivariate time series corresponds to a vector, with vector dimensions including the fluorination reactor temperature, fluorination reactor pressure, oxidation reactor temperature, oxidation reactor pressure, setpoint flow rate of the first feed line, actual flow rate of the first feed line, setpoint flow rate of the second feed line, and actual flow rate of the second feed line.

[0027] The impurity composition and relative content data of each fraction are read in real time from an online gas chromatography-mass spectrometry (GC-MS) system connected to the distillation column, serving as the impurity spectrum data for the distillation separation stage. The GC-MS system uses automatic sampling valves to periodically extract samples from the light component extraction section at the top of the distillation column, the side-stream extraction section, and the heavy component extraction section at the bottom of the column, with a preset time interval of 15 minutes. After separation by the chromatographic column, the extracted samples enter the mass spectrometer detector. The data processing system of the GC-MS system identifies each chromatographic peak and outputs the chromatographic retention time, mass fragmentation map, and relative content calculated using the area normalization method for each component. The chromatographic retention time is expressed in minutes, the mass fragmentation map is stored as a two-dimensional array of mass-to-charge ratio and ion abundance, and the relative content is a percentage value. The impurity spectrum record obtained for each fraction within one sampling cycle includes the chromatographic retention time, mass fragmentation map, and relative content of at least one impurity component. The impurity spectrum records of the three fractions of the distillation column are combined to form the impurity spectrum data for the distillation separation stage.

[0028] A laser particulate counter, deployed within the cleanroom, reads particulate count values ​​for different size ranges at a fixed sampling frequency, generating a cleanroom environmental particulate count time series. The laser particulate counter is installed near the return air vent in the product exposure area of ​​the cleanroom, sampling once per minute at a fixed sampling frequency of 28.3 liters / minute. The laser particulate counter has a built-in multi-channel particle size classifier, simultaneously outputting particulate count values ​​for size ranges greater than or equal to 0.5 micrometers, greater than or equal to 1.0 micrometers, and greater than or equal to 5.0 micrometers, in units of particles per cubic meter. The laser particulate counter transmits the particulate count values ​​for these three size ranges at each sampling moment to a host computer via an RS-485 communication interface. The host computer stores the particulate count values ​​for the three size ranges as multi-dimensional time series data, indexed by timestamps. The timeline covers the complete period of product filling and sealing operations within the cleanroom; this multi-dimensional time series data constitutes the cleanroom environmental particulate count time series.

[0029] In practical implementation, the process of obtaining the reaction path feature tensor by performing reaction path feature mapping on the reaction kinetic process parameters is as follows. (See reference...) Figure 2 The reaction kinetic parameters were processed according to the reaction stages to obtain parameters for the fluorination reaction stage, the oxidation reaction stage, and the distillation and purification stage. These parameters consist of time-series data on reactor temperature, reaction pressure, and reactant feed rate, all timestamped. Based on predetermined process time points, the time when the fluorination reaction termination condition specified in the trifluoromethanesulfonic acid synthesis process specification was met was used as the boundary between the fluorination and oxidation reaction stages, and the time when the oxidation reaction termination condition was met was used as the boundary between the oxidation and distillation and purification stages. The temperature, pressure, and feed rate data were then divided into three continuous intervals. After segmentation, the temperature, pressure, and feed rate data in the first time interval constituted the fluorination reaction stage parameters; the corresponding data in the second time interval constituted the oxidation reaction stage parameters; and the corresponding data in the third time interval constituted the distillation and purification stage parameters.

[0030] A pre-trained reaction path encoder is invoked to perform temporal encoding of intermediate concentrations on the parameters of the fluorination reaction stage, generating the first intermediate feature sequence. The pre-trained reaction path encoder comprises a fluorination reaction branch encoder, an oxidation reaction branch encoder, and a distillation branch encoder. These three branch encoders are independent, sharing the same encoder architecture but with independent network weight parameters. The fluorination reaction branch encoder employs a sequence-to-sequence Long Short-Term Memory (LSTM) network structure, which includes input gates, forget gates, output gates, and memory units. The input vector of the LSM at each time step is composed of the corresponding fluorination reactor temperature, pressure, actual flow rate of the first feed line, and actual flow rate of the second feed line. The hidden state dimension of the LSM is set to 256, and the network depth is 2 layers. During encoding, the fluorination reaction stage parameters are input to the fluorination reaction branch encoder sequentially, time-step by time. The fluorination reaction branch encoder outputs a hidden state vector of length 256 at each time step. The hidden state vectors from all time steps constitute the first intermediate feature sequence. During pre-training, the loss function of the fluorination reaction branch encoder incorporates a chemical kinetic equation constraint term. This constraint term is defined as follows: at each time step, the predicted intermediate concentration value is obtained by mapping the hidden state vector output by the fluorination reaction branch encoder through a fully connected projection layer. The mean square error between the predicted intermediate concentration value and the theoretical intermediate concentration value calculated based on the fluorination reaction chemical kinetic equation is used as the constraint term. The fluorination reaction chemical kinetic equation adopts the known fluorination reaction rate equation, where the reaction rate constant and activation energy parameters are obtained from literature data on the trifluoromethanesulfonic acid fluorination reaction. The fully connected projection layer is an unbiased linear transformation that maps the 256-dimensional hidden state vector to scalar concentration values. The total loss function of the fluorination reaction branch encoder is the sum of the autoregressive reconstruction loss and the chemical kinetic equation constraint term. An adaptive moment estimation optimizer is used for parameter updates, with a learning rate set to... The training iterations are 200 rounds.

[0031] A pre-trained reaction path encoder is invoked to encode the oxidation state evolution of the oxidation reaction stage parameters, generating an oxidation state feature sequence. The structure of the oxidation reaction branch encoder is the same as that of the fluorination reaction branch encoder, consisting of a two-layer long short-term memory network with a hidden state dimension of 256. The input vector of the oxidation reaction branch encoder at each time step is composed of the corresponding oxidation reactor temperature, oxidation reactor pressure, and actual oxidant feed flow rate. The oxidation reaction branch encoder encodes the oxidation reaction stage parameters in chronological order, and the hidden state vector output at each time step constitutes the oxidation state feature sequence. Each vector in the oxidation state feature sequence represents the implicit state of sulfur oxidation in the trifluoromethanesulfonic acid precursor at the corresponding time. During pre-training, the loss function of the oxidation reaction branch encoder also incorporates chemical kinetic equation constraints. The constraint term is obtained by mapping the hidden state vector to an oxidation state index and comparing it with the theoretical oxidation state index calculated based on the oxidation reaction chemical kinetic equation. The oxidation reaction chemical kinetic equation is established based on the relationship between oxidant consumption rate and temperature and pressure, and the parameters in the equation are obtained from regression analysis of experimental data. The total loss function is the sum of the autoregressive reconstruction loss and the constraint terms of the chemical kinetic equation. The optimizer and hyperparameters are consistent with the fluorination reaction branch encoder.

[0032] A pre-trained reaction path encoder is invoked to dynamically encode the fractional composition of parameters in the distillation and purification stage, generating a fractional feature sequence. The distillation branch encoder employs a two-layer long short-term memory network with a hidden state dimension of 256. The input vector consists of the time-varying values ​​of three variables: reboiler heat load, reflux ratio, and column pressure difference. The reboiler heat load is calculated from the product of the heating medium flow rate and the inlet / outlet temperature difference. The reflux ratio is calculated in real-time from the ratio of reflux flow rate to product flow rate. The column pressure difference is obtained from the difference between the readings of the pressure transmitters at the top and bottom of the column. The distillation branch encoder outputs the hidden state vector at each time step, forming the fractional feature sequence. During pre-training, the autoregressive reconstruction target of the distillation branch encoder is the actual measured value of the top fractional composition at the next time step. This actual measured value is provided by the sample analysis results collected from the top of the distillation column by an online gas chromatography-mass spectrometry system. The chemical kinetic constraint term is replaced with a distillation separation mechanism constraint term. The mechanism constraint term uses the physical-thermal balance equation to map the hidden state to the gas-liquid phase composition of each theoretical stage in the column and compares it with the actual process data. The optimization settings are the same as those for the first two branch encoders.

[0033] The first intermediate feature sequence, oxidation state feature sequence, and distillation fraction feature sequence are concatenated through reaction stage processing to generate a reaction path feature tensor. The reaction stage concatenation process joins the three feature sequences end-to-end along the time dimension, inserting a separator vector (a 256-dimensional vector of all zeros) at the join point. The resulting concatenation yields a feature sequence unfolded chronologically, with each time position corresponding to a 256-dimensional vector. All vectors are stacked chronologically to form the reaction path feature tensor, with a dimension of [missing value]. ,in This represents the total number of time steps encompassed by the three reaction phases.

[0034] The process of decoupling impurity components from the impurity spectrum data of the distillation separation stage to obtain impurity feature vectors is as follows: Chromatographic peak detection processing is performed on the impurity spectrum data of the distillation separation stage to identify the retention time and peak area data of multiple impurity components. The impurity spectrum data of the distillation separation stage includes online gas chromatography-mass spectrometry (GC-MS) output data from the light component extraction section at the top of the column, the side-stream extraction section, and the heavy component section at the bottom of the column. One total ion chromatogram is obtained for each pipeline in each sampling cycle. Moving average smoothing, baseline correction, first derivative zero-crossing detection, and second derivative negative peak determination are performed sequentially on the total ion chromatogram to extract the retention time and peak area data of each resolvable peak in the total ion chromatogram. Retention time is expressed in minutes, and peak area is expressed as the integral of ion current intensity over time. Each confirmed chromatographic peak corresponds to an impurity component, described by its retention time and peak area data.

[0035] A pre-trained mass spectrometry analysis model is used to perform molecular structure inversion processing on the mass spectrometric fragment information of each impurity component, generating candidate molecular structure feature vectors for each impurity component. The pre-trained mass spectrometry analysis model adopts a deep neural network architecture, specifically a fully connected feedforward neural network with three hidden layers. The input layer has a dimension of 500, corresponding to 500 signal channels in the mass spectrum with a mass-to-charge ratio ranging from 50 to 550, divided with a step size of 1. The input value of each channel is the normalized value of the ion abundance at that mass-to-charge ratio. The number of neurons in the three hidden layers are 1024, 512, and 256, respectively, and the activation function is a modified linear unit. The output layer is a 256-dimensional vector representing the candidate molecular structure feature vector. This vector is a continuous representation of the extended connectivity fingerprint of the molecule, characterizing the functional group composition and skeletal features of the molecule. During pre-training, the training data of the mass spectrometry analysis model is obtained from a standard mass spectrometry database and manually annotated trifluoromethanesulfonic acid impurity spectrum data. Each training sample includes a standard mass spectrum of an impurity component and its corresponding standard extended connectivity fingerprint. Mean squared error was used as the loss function, the batch size was set to 64, an adaptive moment estimator optimizer was used, and the learning rate was set to... The training process iterates for 100 rounds. After training, for any impurity component to be analyzed, the mass-to-charge ratio and ion abundance are extracted from the mass spectrometry fragment information, interpolated to a 500-dimensional input vector, and fed into the pre-trained mass spectrometry analysis model to output a 256-dimensional candidate molecular structure feature vector.

[0036] Based on the chromatographic peak retention time, the candidate molecular structure feature vectors of each impurity component are sorted by elution order to obtain impurity feature vectors. All impurity components are then arranged in ascending order of their chromatographic peak retention time, and the candidate molecular structure feature vectors corresponding to each impurity component are extracted. These candidate molecular structure feature vectors are then concatenated end-to-end along the feature dimension according to the sorting order, resulting in a concatenated vector of length [length missing]. A one-dimensional vector, This represents the total number of detected impurity components; this one-dimensional vector is the impurity feature vector. If impurities are detected in all three fractions, they are arranged according to retention time within each fraction, in the order of light component impurities at the top of the column, impurities from the side stream, and heavy component impurities at the bottom of the column. The fractions are also arranged continuously according to retention time between fractions and then spliced ​​together.

[0037] The process of generating a joint feature set of process and impurity by stoichiometric spatial alignment of the reaction path feature tensor and impurity feature vector is as follows: The reaction condition parameter vector corresponding to each reaction stage is extracted from the reaction path feature tensor, and the retention time label corresponding to each impurity component is extracted from the impurity feature vector. Each time step of the reaction path feature tensor is a reaction condition parameter vector, and each reaction condition parameter vector simultaneously contains a vectorized representation of various reaction condition variables such as fluorination reactor temperature, fluorination reactor pressure, oxidation reactor temperature, oxidation reactor pressure, and feed flow rate at the corresponding time step. This vectorized representation is output by the reaction path encoder. In the impurity feature vector, the component located at the... Each candidate molecular structure feature vector at a given position corresponds to a known retention time label, which is obtained from the chromatographic peak detection step.

[0038] Construct a time-correspondence matrix between reaction stages and impurity components. The row indices of the time-correspondence matrix are the time step numbers in the reaction path feature tensor, and the column indices are the sequence numbers of the impurity components. The time-correspondence matrix contains the […]. Line number Column elements The rule for determining the value of is: if the in the reaction path feature tensor is , The timestamp corresponding to the first time step falls within the impurity spectrum data of the distillation separation stage. Within the time neighborhood of the retention time tag of each impurity component, then The value is 1, otherwise The value is 0. The time neighborhood of the retention time tag is defined as the time interval centered on the retention time tag and with a width of twice the half-peak width of the chromatographic peak. The half-peak width of the chromatographic peak is obtained from the chromatographic peak detection results.

[0039] The reaction condition parameter vector is mapped to the same time axis as the impurity feature vector according to the retention time label, and weighted summation resampling is performed using the time correspondence matrix. The mapping process uses the following formula:

[0040]

[0041] in, Indicates the mapping and the first A vector of reaction condition parameters aligned with the retention time tags of each impurity component; The first element in the characteristic tensor of the reaction path represents the... A vector of reaction condition parameters for each time step; This represents the total number of time steps contained in the reaction path feature tensor; Represents the first element in the time correspondence matrix. Line number The element of the column, whose value is determined by the aforementioned time neighborhood rule. When the denominator is zero, Set to an all-zero vector. Through the above mapping, an aligned reaction condition parameter vector with the same dimension as the reaction condition parameter vector is obtained at the retention time tag of each impurity component.

[0042] The mapped reaction condition parameter vector and impurity feature vector are subjected to feature dimension alignment and concatenation processing to generate a process-impurity joint feature set. For the first... Each impurity component will be mapped to the aligned reaction condition parameter vector. The first one extracted from the impurity feature vector eigenvectors of candidate molecular structures By splicing the beginning and end together, the first part is formed. Joint eigenvectors , This represents a vector concatenation operation. The above concatenation is performed sequentially on all impurity components to obtain a series of joint feature vectors. The set of these joint feature vectors arranged in the order of impurity peaks is the process-impurity joint feature set.

[0043] In specific implementation, please refer to Figure 3A pre-trained graph neural network model was used to encode environmental perturbation patterns in the cleanroom particulate matter counting time series, generating environmental perturbation feature codes. The cleanroom particulate matter counting time series was then segmented into multiple time windows using a sliding window method, resulting in multiple particulate matter counting subsequences corresponding to each time window. The cleanroom particulate matter counting time series contains particulate matter count values ​​for three particle size ranges: particles with a diameter greater than or equal to 0.5 micrometers, particles with a diameter greater than or equal to 1.0 micrometers, and particles with a diameter greater than or equal to 5.0 micrometers. Each sampling moment corresponds to a three-dimensional vector. The sliding window length was set to 30 minutes, and the sliding step size was set to 10 minutes. Starting from the beginning of the cleanroom particulate matter counting time series, particulate matter counting subsequences within each time window were sequentially extracted according to the sliding window length and sliding step size. Each particulate matter counting subsequence within a time window contains three-dimensional particulate matter count values ​​for 30 sampling moments; that is, each time window corresponds to a matrix with a dimension of 30 multiplied by 3.

[0044] For each time window, an environmental particulate matter correlation graph structure is constructed, with particulate matter size ranges as nodes and the counting correlations between size ranges as edges. The environmental particulate matter correlation graph structure contains three nodes: the first node corresponds to the particulate matter size range greater than or equal to 0.5 micrometers, the second node corresponds to the particulate matter size range greater than or equal to 1.0 micrometers, and the third node corresponds to the particulate matter size range greater than or equal to 5.0 micrometers. For any two nodes, the Pearson correlation coefficient is calculated for the particulate matter count subsequences corresponding to the two node size ranges within the current time window. The absolute value of the Pearson correlation coefficient is used as the weight of the edge connecting the two nodes. If the particulate matter size ranges corresponding to the two nodes are the same, the edge weight is fixed at 1. The Pearson correlation coefficient is calculated as follows: extract the particulate matter count sequences of the first and second size ranges within the current time window, subtract the mean of each sequence from the two sequences, calculate the inner product, and then divide by the product of their respective standard deviations to obtain the Pearson correlation coefficient. This results in an undirected weighted environmental particulate matter association graph structure with three nodes and three edges.

[0045] The particulate count subsequence of each time window is used as the initial feature of the corresponding graph structure node. This is input into the graph neural network model for graph convolutional iterative update processing to obtain the graph-level feature vector for each time window. The pre-trained graph neural network model adopts a graph attention network architecture. The graph attention network contains two graph attention convolutional layers and one graph-level pooling layer. The input of the first graph attention convolutional layer is the node's initial feature and adjacency matrix, and the output is the node's updated feature. Each node's initial feature is a vector of length 30, composed of the particulate count values ​​of the corresponding particulate size range at 30 sampling times within the current time window. The graph attention convolutional layer performs a self-attention aggregation operation on each node, specifically: for node... compute nodes The attention coefficient with all neighboring nodes, calculated using the following formula:

[0046]

[0047] in, Represents a node Its neighboring nodes The unnormalized attention coefficients between them; Represents a node The input feature vector has a dimension of 30; Representing neighboring nodes The input feature vector has a dimension of 30; This represents a learnable linear transformation weight matrix with dimensions 64 x 30, mapping 30-dimensional input features to a 64-dimensional feature space. This represents a vector concatenation operation; This represents a learnable attention parameter vector with a dimension of 128. The concatenated 128-dimensional vector is then mapped to a scalar. The activation function is a linear unit with leakage correction, and the negative slope is set to 0.2. After calculating the attention coefficients, the attention coefficients are normalized using the softmax function to obtain the normalized attention weights. Then, the transformed features of all neighboring nodes are weighted and summed to obtain the node's value. The second graph's attention convolutional layer takes the output features of the first graph's attention convolutional layer as input, with a node feature dimension of 64. The weight matrix dimension of the second graph's attention convolutional layer is set to 32 x 64, the attention parameter vector dimension is set to 64, and the activation function and hyperparameter settings are the same as the first graph's attention convolutional layer. The output node feature dimension is 32. The graph-level pooling layer uses global average pooling, calculating the element-wise average of the output features of the three nodes to obtain a 32-dimensional vector, which is the graph-level feature vector corresponding to the time window. The graph attention network is pre-trained by inputting the graph-level feature vector of the environmental particulate matter association graph structure into a fully connected classifier to predict whether a product has environmentally introduced defects. The classifier is a fully connected layer with sigmoid activation and uses binary cross-entropy loss. The training data consists of historical cleanroom environmental particulate matter monitoring records and corresponding environmentally introduced defect judgment labels. The optimizer is adaptive moment estimation, and the learning rate is set to... The batch size is 16, and the training iterations are 100 rounds.

[0048] Temporal attention weighted aggregation is performed on the graph-level feature vectors of each time window to generate environmental perturbation feature codes. The graph-level feature vectors of all time windows are arranged in chronological order of their start times, forming a time series. The temporal attention weighted aggregation uses a trainable temporal attention vector with a dimension of 32, the same as the dimension of the graph-level feature vector. The dot product of the graph-level feature vector and the temporal attention vector for each time window is calculated to obtain the attention score for each time window. Then, the attention scores of all time windows are normalized using the softmax function to obtain the attention weight for each time window. The graph-level feature vector of each time window is multiplied by its corresponding attention weight and then summed to obtain the environmental perturbation feature code. The environmental perturbation feature code is a 32-dimensional vector that aggregates environmental particulate matter perturbation pattern information from all time windows, highlighting the time periods that significantly impact product quality.

[0049] The environmental perturbation feature encoding and the process-impurity joint feature set are fused using cross-attention processing to generate a fused source tracing feature set. The process-impurity joint feature set is used as the query feature matrix, and the environmental perturbation feature encoding is used as the key feature matrix and value feature matrix. The process-impurity joint feature set contains multiple joint feature vectors arranged in the order of impurity elution. This set is arranged in matrix form, with the number of rows equal to the number of joint feature vectors and the number of columns equal to the dimension of the joint feature vectors; this matrix serves as the query feature matrix. The environmental perturbation feature encoding is a 32-dimensional vector. It is projected onto the key feature space and value feature space using different learnable linear transformation matrices. Specifically, the key projection matrix is ​​set to a dimension of 32 x 32, mapping the environmental perturbation feature encoding to a 32-dimensional key vector; the value projection matrix is ​​also set to a dimension of 32 x 32, mapping the environmental perturbation feature encoding to a 32-dimensional value vector. Since the query feature matrix contains multiple query vectors, the attention weight between each query vector and the key vector is calculated. The dot product of each query vector and the key vector is then divided by a scaling factor and normalized using softmax to obtain the attention weight for that key vector. The value vectors are then weighted and summed using these attention weights to obtain the environment-weighted feature vector. Since both the key and value vectors originate from environmental perturbation feature encoding, the environment-weighted feature vector essentially extracts information from the environmental perturbation features using the query features. The environment-weighted feature vector is then residually joined with each joint feature vector in the process-impurity joint feature set, with corresponding elements added together to generate a fused source traceability feature set. In this fused source traceability feature set, each fused source traceability feature vector simultaneously contains both process-impurity joint feature information and environmental perturbation information.

[0050] In the specific implementation, before inputting the fusion traceability feature set into the pre-trained Bayesian network model, the Bayesian network model is constructed and trained. A process topology diagram of the trifluoromethanesulfonic acid production process is obtained, and the dependencies between each production process are extracted from this diagram. The process topology diagram defines the sequential connections between the fluorination reaction process, oxidation reaction process, distillation and purification process, and cleanroom filling process in the form of a directed graph. The output of the fluorination reaction process serves as the input of the oxidation reaction process, the output of the oxidation reaction process serves as the input of the distillation and purification process, and the output of the distillation and purification process serves as the input of the cleanroom filling process. Based on the dependencies in the process topology diagram, five process nodes are established in the Bayesian network model: a fluorination reaction node, an oxidation reaction node, a distillation and purification node, a cleanroom filling node, and a trifluoromethanesulfonic acid product quality defect node. Directed edges are added, pointing from the fluorination reaction node to the oxidation reaction node, from the oxidation reaction node to the distillation and purification node, and from the distillation and purification node to the cleanroom filling node.

[0051] The process involves retrieving the defect impurity type and the corresponding process information for each defect sample from historical quality defect records. This historical data includes records of multiple batches of trifluoromethanesulfonic acid products failing final quality inspections. Each record indicates the type of impurity identified as causing the defect and the name of the process in which that impurity occurred. The historical data is statistically analyzed to extract all previously encountered defect impurity types, establishing eight impurity type nodes: fluorine-containing intermediate impurity node, oxidation by-product impurity node, dehydration by-product impurity node, high-boiling-point heavy component impurity node, low-boiling-point light component impurity node, packaging material leachate impurity node, environmentally introduced particulate matter impurity node, and metal ion impurity node. Based on the defect impurity type and the process information for each defect occurrence, a directed edge is added from the defect occurrence process node in each record to the corresponding impurity type node. For example, if a record indicates that an oxidation by-product occurred during an oxidation reaction process, a directed edge is added from the oxidation reaction node to the oxidation by-product impurity node. Furthermore, a directed edge is added from each impurity type node to the trifluoromethanesulfonic acid product quality defect node. Simultaneously, a directed edge is added to each of the fluorination reaction node, oxidation reaction node, distillation purification node, and cleanroom filling node, directly pointing to the trifluoromethanesulfonic acid product quality defect node. All of the above nodes and directed edges constitute the directed acyclic graph structure of the Bayesian network model.

[0052] The state space of each node in the Bayesian network model is discretized. The state space of each process node contains two discrete values: state "0" indicates normal process operation, and state "1" indicates abnormal process operation. The state space of each impurity type node contains two discrete values: state "0" indicates that the impurity content does not exceed the limit, and state "1" indicates that the impurity content exceeds the limit. The state space of the trifluoromethanesulfonic acid product quality defect node contains two discrete values: state "0" indicates that the product quality is qualified, and state "1" indicates that the product quality is defective.

[0053] Parameter learning is performed on the Bayesian network model to determine the conditional probability distribution table for each node. Historical defect records and historical normal batch records are used as the training sample set. In the training sample set, for each production batch, the state value of each node is determined based on defect records and process anomaly records, forming a complete state assignment sample. If a certain impurity type does not appear in the record, its state is "0". The maximum likelihood estimation method is used to calculate the parameters in the conditional probability distribution table of each node. For each node... An entry in its conditional probability distribution table The calculation method is as follows: statistically analyze the nodes that satisfy the conditions in the training sample set. set of parent nodes The value can be a specific combination The total number of samples, and the number of nodes in these samples. The number of samples with a value of "1" is divided by the total number of samples to obtain the conditional probability value. If a certain parent node combination does not appear in the training sample set, Laplace smoothing is applied with a smoothing factor set to 1. After parameter learning is completed, a pre-trained Bayesian network model is obtained.

[0054] In practice, the fused source tracing feature set is input into a pre-trained Bayesian network model. This set consists of multiple fused source tracing feature vectors, each corresponding to an impurity component detected during a distillation separation stage. All fused source tracing feature vectors in the set are globally averaged to obtain a fixed-dimensional overall fused source tracing feature vector, with the same dimension as the individual fused source tracing feature vectors. This overall fused source tracing feature vector is then input into an evidence mapping network, which consists of binary logistic regression classifiers corresponding one-to-one with each node in the Bayesian network model. Each binary logistic regression classifier contains a fully connected linear layer and a sigmoid activation function, taking the overall fused source tracing feature vector as input and outputting a scalar probability value representing the likelihood probability that the node's state is "1". The likelihood probability corresponding to each node is used as virtual observation evidence for that node and input into the pre-trained Bayesian network model. In the Bayesian network model, the virtual observation evidence is set as the likelihood probability function of the corresponding node, thus replacing the traditional hard evidence input.

[0055] From the pre-trained Bayesian network model, all parent nodes connected by directed edges to the trifluoromethanesulfonic acid product quality defect node are extracted to form a candidate root source node set. The candidate root source node set includes fluorination reaction nodes, oxidation reaction nodes, distillation purification nodes, cleanroom filling nodes, and all eight impurity type nodes.

[0056] For each candidate root source node in the candidate root source node set, posterior probability inference is performed to obtain the causal contribution probability of each candidate root source node to the trifluoromethanesulfonic acid product quality defect node. The belief propagation algorithm is then run to update the probability of the Bayesian network model. Given virtual observation evidence, the belief propagation algorithm performs message passing through all nodes of the Bayesian network model, iterating until message convergence, and calculating the posterior marginal probability distribution of each node. For the ... Candidate root source nodes Its posterior probability distribution under observed evidence F is: ,in, Candidate root source nodes The posterior probability value under abnormal conditions is taken as its causal contribution probability to the quality defect node of trifluoromethanesulfonic acid product. The causal contribution probability is expressed as:

[0057]

[0058] in, Indicates the first node in the set of candidate root nodes. The causal contribution probability of each candidate root node The index of the candidate root node, with a value ranging from 1 to the total number of candidate root nodes; Indicates the first The candidate root source nodes are random variables, with a value of 1 indicating that the node is in an abnormal state; F represents the set of virtual observation evidence generated by the fused source tracing feature set through the evidence mapping network. This indicates that under the condition of virtual observation evidence F... The posterior probability, which takes the value 1, is calculated using the belief propagation algorithm.

[0059] Filter out causal contribution probability The highest-ranking candidate root node is selected as the root node. If the root node is a process node, the production process corresponding to the root node is used as the root process location result. If the root node is an impurity type node, the process node pointing to the parent node of the root node is searched in the directed acyclic graph structure of the Bayesian network model. The production process corresponding to that process node is used as the root process location result, and the impurity type corresponding to the root node is used as the root impurity type identification result. The root process location result is a specific production process name, and the root impurity type identification result is a specific impurity type name.

[0060] Optionally, a production process stage attention mask matrix is ​​introduced in the cross-attention fusion processing. The production process stage attention mask matrix is ​​used to restrict the environmental disturbance feature encoding to perform attention calculation only with the part of the corresponding reaction stage in the process-impurity joint feature set.

[0061] In practical implementation, an attention mask matrix for the production process stage is constructed. The dimension of the attention mask matrix for the production process stage is consistent with the dimension of the attention weight matrix calculated in the cross-attention fusion processing. Its number of rows equals the number of joint feature vectors in the process-impurity joint feature set, and its number of columns equals the number of vectors after the environmental perturbation feature encoding undergoes a linear transformation in the key feature space. When the environmental perturbation feature encoding contains only one key vector, the attention mask matrix for the production process stage is represented as a column vector, and its dimension equals the number of joint feature vectors in the process-impurity joint feature set.

[0062] The value of each element in the attention mask matrix for each stage of the production process is determined. Each joint feature vector corresponds to a known retention time label, which is obtained from the chromatographic peak detection step of the impurity spectrum data in the distillation separation stage. Each joint feature vector also corresponds to a process stage label, which is determined based on the source reaction stage of the reaction condition parameter vector merged in the joint feature vector. When the merged reaction condition parameter vector in the joint feature vector originates from the fluorination reaction stage parameters, the corresponding process stage label is the fluorination reaction stage; when it originates from the oxidation reaction stage parameters, the corresponding process stage label is the oxidation reaction stage; when it originates from the distillation and purification stage parameters, the corresponding process stage label is the distillation and purification stage. The environmental disturbance feature encoding corresponds to one or more time windows, each with a start time and an end time. The start and end times of the time windows correspond to the time axis of the cleanroom environmental particulate matter count time series. According to the time scheduling of the trifluoromethanesulfonic acid production process, the time axis of the cleanroom environmental particulate matter count time series covers the execution period of the cleanroom filling process, which is temporally consecutive and adjacent to the distillation and purification stage. The time windows corresponding to the environmental disturbance feature encoding are collectively associated with the distillation and purification stage.

[0063] Based on the correspondence between the process stage labels mentioned above, the value of each element in the attention mask matrix for each production process stage is determined. For the nth element in the attention mask matrix for each production process stage... Line number Column elements row index Corresponding to the first in the process-impurity joint characteristic set Joint feature vectors, column index Corresponding to the environmental perturbation feature encoding in the key feature space, the first... The nth key vector. When the nth key vector. The process stage label of the joint feature vector and the first When the process stages associated with each key vector are the same, The value is 1; when the first The process stage label of the joint feature vector and the first When the process stages associated with each key vector are different, The value is 0. In this implementation scenario, the environmental disturbance feature encoding is as a whole associated with the distillation and purification stage. Therefore, in the attention mask matrix of the production process stage, the element value of the row corresponding to the joint feature vector of the process stage label being the distillation and purification stage is 1, and the element value of the row corresponding to the joint feature vector of the process stage label being the fluorination reaction stage or the oxidation reaction stage is 0.

[0064] The attention mask matrix for the production process stage is applied to the attention weight matrix of the cross-attention fusion processing. During the cross-attention fusion processing, after calculating the dot product between the query feature matrix and the key feature matrix, before applying softmax normalization, the production process stage attention mask matrix and the dot product result are added element-wise. The dot product result corresponding to elements in the production process stage attention mask matrix with a value of 0 is added with a sufficiently large negative number. The summed result is then normalized along the dimension of the key vector using the softmax function. This ensures that the attention weights of positions with a value of 0 in the production process stage attention mask matrix approach zero after softmax processing, while the attention weights of positions with a value of 1 retain their original relative magnitudes. By applying the production process stage attention mask matrix, the environmental disturbance feature encoding only affects the joint feature vector of the process stage labeled as the distillation and purification stage in the process-impurity joint feature set. The attention weights of the joint feature vectors labeled as the fluorination reaction stage and the oxidation reaction stage are set to effective zero values. This ensures that environmental disturbance information is only injected into the distillation and purification stage features that are contemporaneous with the cleanroom environment.

[0065] In some embodiments, reaction path feature mapping, impurity component decoupling, and stoichiometric spatial alignment are all performed based on the same pre-trained multimodal stoichiometric alignment network, which is jointly optimized using a contrastive learning loss function.

[0066] In its implementation, the pre-trained multimodal chemostometry alignment network comprises three sub-modules: a reaction path encoder sub-module, a mass spectrometry analysis sub-module, and a chemostometry spatial alignment sub-module. The reaction path encoder sub-module consists of parallel encoders for fluorination, oxidation, and distillation reactions, all three forming two-layer long short-term memory networks with a hidden state dimension of 256. The mass spectrometry analysis sub-module employs a fully connected feedforward neural network with three hidden layers: 1024, 512, and 256 neurons respectively. All three layers use modified linear units (MRUs) as activation functions, with an input layer dimension of 500 and an output layer dimension of 256. The chemostometry spatial alignment sub-module is composed of a time-correspondence matrix construction unit and a feature dimension alignment and splicing unit connected in series.

[0067] The input to the multimodal stoichiometric alignment network consists of reaction kinetic parameters and impurity profiles from the distillation separation stage of the same production batch. The input data is configured as paired training sample sets. Each training sample set contains one anchor sample and one comparison sample. The anchor sample is a combination of reaction condition parameter vectors and candidate molecular structure feature vectors that match the retention time stamps within the same production batch. The positive comparison sample is another set of matching reaction condition parameter vectors and candidate molecular structure feature vectors from the same production batch. The negative comparison sample is any combination of reaction condition parameter vectors and candidate molecular structure feature vectors from different production batches.

[0068] The output of the multimodal chemostometry alignment network consists of the process-impurity joint feature vectors corresponding to anchor samples, positive contrast samples, and negative contrast samples. During training, the reaction path encoder submodule encodes the reaction kinetic process parameters and outputs the reaction path feature tensor; the mass spectrometry analysis submodule performs molecular structure inversion on the impurity spectrum data from the distillation separation stage and outputs impurity feature vectors; and the chemostometry spatial alignment submodule performs time alignment and concatenation on the reaction path feature tensor and impurity feature vectors, outputting a process-impurity joint feature set. From the process-impurity joint feature set, the corresponding process-impurity joint feature vectors are extracted based on the retained time labels, serving as the feature representations for anchor samples, positive contrast samples, and negative contrast samples.

[0069] The multimodal stoichiometry alignment network is trained using a contrastive learning loss function. Defined as:

[0070]

[0071] Where L represents the value of the contrastive learning loss function; This represents the process of anchor samples passing through a multimodal chemometry alignment network – the joint feature vector of impurities, with a dimension of 256. This represents the process of positive comparison samples passing through a multimodal stoichiometric alignment network output – the joint feature vector of impurities, with a dimension of 256; Indicates the first The process of passing negative contrast samples through a multimodal stoichiometry alignment network to output the joint feature vector of impurities, with a dimension of 256. The index of the negative comparison sample. This represents the total number of negative comparison samples; This represents the cosine similarity calculation function, and the calculation formula is: ,in, Representing vectors transpose, Representing vectors The L2 norm; This refers to temperature hyperparameters. The value is set to 0.07 to adjust the smoothness of the similarity distribution. The setting is based on the experiment conducted in the pre-training process using grid search within the range of 0.01 to 0.5 with a step size of 0.01, and the value that results in the highest nearest neighbor classification accuracy on the validation set is selected. This represents an exponential function with the natural constant e as its base.

[0072] The optimization of the multimodal stoichiometry alignment network employs an adaptive moment estimation optimizer with a learning rate set to [value missing]. The batch size was set to 32, and the training iterations were 300 rounds. During training, all trainable parameters of the reaction path encoder submodule, mass spectrometry analysis submodule, and chemometric space alignment submodule in the multimodal chemometric alignment network participated in gradient backpropagation updates. By contrastive learning loss function, the distance between anchor samples and positive contrast samples in the feature space was shortened, while the distance between anchor samples and negative contrast samples in the feature space was widened.

[0073] In its implementation, a trifluoromethanesulfonic acid product quality traceability management system includes a memory, a processor, and a computer program stored in the memory and running on the processor. The processor is a central processing unit (CPU) or a graphics processing unit (GPU), and the memory is a random access memory (RAM) or a solid-state drive (SSD). When executing the computer program, the processor obtains reaction kinetic parameters for each production batch in the trifluoromethanesulfonic acid production process from the distributed control system, acquires impurity spectrum data for the distillation separation stage from an online gas chromatography-mass spectrometry (GC-MS) instrument connected to the distillation column, and acquires the cleanroom environment particulate count time sequence from a laser particulate counter deployed in the cleanroom. The processor performs reaction path feature mapping processing, dividing the reaction kinetic parameters into reaction stages and calling a pre-trained reaction path encoder to generate a reaction path feature tensor; it performs impurity component decoupling processing, performing chromatographic peak detection and mass spectrometry analysis on the impurity spectrum data from the distillation separation stage to generate an impurity feature vector; and it performs stoichiometric spatial alignment processing, aligning and concatenating the reaction path feature tensor and the impurity feature vector to generate a process-impurity joint feature set. The processor invokes a pre-trained graph neural network model to encode environmental disturbance patterns in the cleanroom particulate matter count time series, generating environmental disturbance feature codes. These environmental disturbance feature codes are then fused with a process-impurity joint feature set through cross-attention processing to generate a fused source tracing feature set. The processor inputs this fused source tracing feature set into a pre-trained Bayesian network model, performs posterior probability inference calculations, selects the candidate root cause nodes with the highest causal contribution probability, and outputs the root cause process location result and the root cause impurity type identification result.

[0074] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.

Claims

1. A method for quality traceability management of trifluoromethanesulfonic acid products, characterized in that, The method includes: Acquire reaction kinetic parameters, impurity spectrum data of the distillation separation stage, and time sequence of particulate matter counts in the cleanroom environment for each production batch in the trifluoromethanesulfonic acid production process. The reaction kinetic process parameters are subjected to reaction path feature mapping to obtain a reaction path feature tensor. The impurity composition data of the distillation separation stage are subjected to impurity component decoupling to obtain an impurity feature vector. The reaction path feature tensor and the impurity feature vector are aligned in stoichiometric space to generate an aligned process-impurity joint feature set. A pre-trained graph neural network model is invoked to encode the environmental disturbance pattern of the cleanroom environmental particulate matter count time series, generating an environmental disturbance feature code. The environmental disturbance feature code is then fused with the process-impurity joint feature set through cross-attention processing to generate a fused source tracing feature set. Based on the fused traceability feature set, reverse causal chain tracing processing of product quality is performed to generate the root process location result and root impurity type identification result for the trifluoromethanesulfonic acid product in each production batch.

2. The method for quality traceability management of trifluoromethanesulfonic acid products according to claim 1, characterized in that, The acquisition of reaction kinetic parameters, impurity spectrum data of the distillation separation stage, and time series of particulate matter counts in the cleanroom environment for each production batch in the trifluoromethanesulfonic acid production process includes: The reaction kinetics process parameters are obtained by collecting time-series data of reactor temperature, reaction pressure, and reactant feed rate for each production batch from the distributed control system. The impurity composition and relative content data of each fraction are read in real time from an online gas chromatograph-mass spectrometer connected to the distillation column as the impurity spectrum data. The particle count values ​​of different particle size ranges are read from the laser particle counter deployed in the clean room at a fixed sampling frequency to generate the time sequence of particle counts in the clean room environment.

3. The method for quality traceability management of trifluoromethanesulfonic acid products according to claim 1, characterized in that, The process of performing reaction path feature mapping on the reaction kinetic process parameters to obtain the reaction path feature tensor includes: The reaction kinetic parameters were processed according to the reaction stages to obtain parameters for the fluorination reaction stage, the oxidation reaction stage, and the distillation and purification stage. The pre-trained reaction path encoder is invoked to perform intermediate concentration temporal encoding on the parameters of the fluorination reaction stage to generate a first intermediate feature sequence; the oxidation reaction stage parameters are subjected to oxidation state evolution encoding to generate an oxidation state feature sequence; and the distillation purification stage parameters are subjected to fraction composition dynamic encoding to generate a fraction feature sequence. The reaction path feature tensor is generated by splicing the first intermediate feature sequence, the oxidation state feature sequence, and the distillation fraction feature sequence together in a reaction stage process.

4. The method for quality traceability management of trifluoromethanesulfonic acid products according to claim 3, characterized in that, The impurity component decoupling process performed on the impurity spectrum data of the distillation separation stage to obtain the impurity feature vector includes: The impurity spectrum data of the distillation separation stage are processed by chromatographic peak detection to identify the retention time and peak area data of multiple impurity components. The pre-trained mass spectrometry analysis model is invoked to perform molecular structure inversion processing on the mass spectrometry fragment information of each impurity component, generating candidate molecular structure feature vectors for each impurity component. Based on the retention time of the chromatographic peaks, the candidate molecular structure feature vectors of each impurity component are arranged in peak order to obtain the impurity feature vector.

5. The method for quality traceability management of trifluoromethanesulfonic acid products according to claim 4, characterized in that, The step of aligning the reaction path feature tensor with the impurity feature vector in stoichiometric space to generate an aligned process-impurity joint feature set includes: Extract the reaction condition parameter vector corresponding to each reaction stage from the reaction path feature tensor, and extract the retention time label corresponding to each impurity component from the impurity feature vector; Construct a time correspondence matrix between reaction stages and impurity components, and map the reaction condition parameter vector to the same time coordinate axis as the impurity feature vector according to the retention time label; The mapped reaction condition parameter vector and the impurity feature vector are subjected to feature dimension alignment and concatenation processing to generate the process-impurity joint feature set.

6. The method for quality traceability management of trifluoromethanesulfonic acid products according to claim 5, characterized in that, The process of calling a pre-trained graph neural network model to perform environmental disturbance pattern encoding on the time series sequence of particulate matter counts in the cleanroom environment, generating environmental disturbance feature encoding, includes: The time sequence of particulate matter counting in the cleanroom environment is subjected to time window sliding segmentation to obtain multiple particulate matter counting sub-sequences corresponding to the time window. For each time window, construct an environmental particulate matter association graph structure with particulate matter size ranges as nodes and the counting association relationships between particle size ranges as edges; The particulate matter count subsequence of each time window is used as the initial feature of the node of the corresponding graph structure, and input into the graph neural network model for graph convolution iterative update processing to obtain the graph-level feature vector of each time window; Temporal attention weighted aggregation is performed on the graph-level feature vectors of each time window to generate the environmental perturbation feature code.

7. The method for quality traceability management of trifluoromethanesulfonic acid products according to claim 6, characterized in that, The step of performing cross-attention fusion processing on the environmental disturbance feature encoding and the process-impurity joint feature set to generate a fused source tracing feature set includes: The process-impurity joint feature set is used as the query feature matrix, and the environmental disturbance feature encoding is used as the key feature matrix and value feature matrix; Calculate the attention weight matrix between the query feature matrix and the key feature matrix, and use the attention weight matrix to perform a weighted summation on the value feature matrix to obtain the environment weighted feature matrix; The environmental weighted feature matrix and the process-impurity joint feature set are subjected to residual connection processing to generate the fused traceability feature set.

8. The method for quality traceability management of trifluoromethanesulfonic acid products according to claim 7, characterized in that, The reverse causal chain tracing process for product quality based on the fused traceability feature set generates the root cause process location result and root cause impurity type identification result for each production batch of trifluoromethanesulfonic acid product, including: The fused traceability feature set is input into a pre-trained Bayesian network model, which contains multiple nodes, each node corresponding to a production process or a type of impurity. Extract all parent nodes that are connected to the product quality defect node by directed edges from the Bayesian network model to form a candidate root source node set; Perform posterior probability inference calculation on each candidate root source node in the candidate root source node set to obtain the causal contribution probability of each candidate root source node to the product quality defect node. The candidate root node with the highest causal contribution probability is selected as the root node, the production process corresponding to the root node is taken as the root process location result, and the impurity type corresponding to the root node is taken as the root impurity type identification result.

9. A method for quality traceability management of trifluoromethanesulfonic acid products according to claim 1, characterized in that, The cross-attention fusion process introduces an attention mask matrix for the production process stage, which restricts the environmental disturbance feature encoding to only perform attention calculations with the part of the process-impurity joint feature set corresponding to the reaction stage.

10. A quality traceability management system for trifluoromethanesulfonic acid products, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the trifluoromethanesulfonic acid product quality traceability management method as described in any one of claims 1 to 9.