Quality tracing method in manufacturing process based on multi-source data parallel processing
By integrating the Transformer framework with dual-token parallel fusion, MPC closed-loop regulation, and Neo4j-PROV traceability, the challenges of cross-variable dependency and local detail capture in the manufacturing process are solved, achieving high-precision prediction and rapid traceability, meeting compliance requirements, and reducing production costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-02
- Publication Date
- 2026-03-27
AI Technical Summary
Existing Transformer models cannot simultaneously capture cross-variable global dependencies and local fragment details during the manufacturing process. The handling of link fragments makes it difficult to trace prediction biases. They also lack an end-to-end PROV-DM traceability framework, making it difficult to meet high-frequency production cycles and regulatory compliance requirements.
Employing a dual-token parallel fusion Transformer framework, combining MPC closed-loop regulation and Neo4j-PROV tracing, and through unified time-based data collection, anomaly detection and missing interpolation, parallel embedding of variable tokens and patch tokens, and fusion of self-attention encoding and multilayer perceptron, high-precision prediction and real-time tracing are achieved.
It improves prediction accuracy, reduces traceability query latency to within 100ms, achieves integrated manufacturing quality management with high precision, high transparency, and high governance, meets GDPR and ISO/IEC 42001 compliance requirements, and reduces production line rework rate.
Smart Images

Figure CN121744170A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quality control and data traceability technology, and in particular to a quality traceability method in the manufacturing process based on parallel processing of multi-source data. Background Technology
[0002] In recent years, with the exponential growth in the number of Industrial Internet of Things (IIoT) terminals, CNC machine tools, industrial robots, and environmental sensors in workshops generate massive, asynchronously sampled 4M1E (Man-Machine-Material-Method-Environment) multi-source time-series data streams daily. Currently, manufacturing has become the largest application area for IIoT. This type of multi-source time-series data has two significant characteristics: firstly, it exhibits cross-variable coupling (such as temperature-pressure, tool wear-vibration), forming global dependencies; secondly, it is affected by shift changes, recipe switching, or sudden failures, exhibiting local non-stationary patterns. Traditional linear statistical models (VAR, ARIMAX, etc.) multiply in parameters as the number of variables and lag order increase, making it difficult to characterize nonlinear interactions and over-smoothing high-frequency information due to resampling at different frequencies, making it difficult to trace the root cause of prediction errors. These models essentially assume a linear superposition relationship between variables, making it difficult to capture nonlinear coupling and process threshold effects in the production process; common practical applications such as temperature-pressure nonlinear saturation or tool wear-vibration amplification are difficult to accurately characterize with linear terms. When data is missing or outliers are frequent, engineers often use SSA or Kalman filtering offline to complete the data. However, SSA assumes local low rank, making it difficult to handle rapidly changing operating conditions. Kalman filtering relies on the linear Gaussian assumption and requires online covariance calculation when sensors are offline or the network fluctuates, resulting in a heavy computational burden. More importantly, the completion operation is often performed in a separate script or ETL service, lacking a PROV record that connects the data chain. This means that subsequent models can only see the repaired data without knowing its source. When prediction errors occur, engineers cannot trace whether the error is caused by abnormal original sampling, resampling strategies, or completion parameters, making root cause localization extremely difficult.
[0003] To address the challenges of dimensionality explosion and nonlinear coupling in multi-source time series forecasting in manufacturing, academia and industry have introduced Transformers for long-sequence prediction. Currently, Transformers employ two main token strategies: the Patch Token approach (PatchTST) first divides the long sequence into several patches, treating each patch as an input token; self-attention thus focuses on capturing details such as the local periodicity of bearing vibration, short-term drift of furnace temperature curves, and abnormal peaks, while significantly compressing computational complexity. For example, on benchmarks with step sizes of 96-720 (Electricity, Traffic, ETTm2, etc.), PatchTST reduces MSE by more than 10-20% compared to LSTM. Its independent channel design allows each variable to follow an independent path, resulting in lower edge GPU memory usage and easier deployment at production line gateways. However, this independent path ignores cross-variable coupling such as temperature-pressure and tool wear-vibration by default, leading to a sharp increase in error when encountering dynamic lag or strongly coupled conditions. The iTransformer variable token approach treats the entire variable sequence as a token, flipping the attention dimension to the variable axis. It can explicitly learn global couplings such as cooling water temperature and spindle current at the same level. It has achieved state-of-the-art results on 8 public benchmarks (ETTh / ETTm, Weather, Exchange, etc.), with a maximum prediction range of >1000 steps and a 14% MSE reduction compared to PatchTST on the ETTh1 long-term task. However, because the time dimension relies solely on position encoding, second-level spikes caused by holiday downtime or tool changes are often smoothed out, leading to a decrease in the detection rate of local anomalies. In summary, PatchTST excels in local details and lightweight deployment, while iTransformer is strong in cross-variable global dependencies. Each has its strengths but it is difficult to achieve both simultaneously. This is precisely the core contradiction that the manufacturing industry urgently needs to solve when achieving high-precision prediction and closed-loop control under high-frequency, strongly coupled processes.
[0004] To balance local details and global dependencies, the industry has stacked deeper Transformers or increased the hidden dimensions. However, the computation of self-attention and the memory usage increase dramatically with the number of tokens, making it difficult for edge GPUs to handle. If an independent channel is configured for each variable, the inference latency can be increased by 5-10 times compared to LSTM. Even with the introduction of techniques such as sparse attention and causal masks to reduce the complexity to O(n·log n), it is still impossible to simultaneously bridge the structural gap between the lack of cross-variable coupling from the patch perspective and the neglect of local spikes from the variable perspective.
[0005] In recent years, regulations such as Article 22 of the GDPR, the US CISA Guidelines for Safe AI, and ISO / IEC 42001:2023 have successively required any automated decision-making system to provide an explainable description of the data source, processing process, and responsible party. IATF 16949 further stipulates that batch-equipment-process three-level traceability must be maintained for at least 15 years. To meet this compliance pressure, the W3C proposed the PROV-DM semantic framework, described by the "entity-activity-agent" triple. Industry commonly uses native graph databases such as Neo4j to achieve sub-second traversal across millions of nodes. However, in reality, data cleaning, missing data completion, ETL for different frequencies, model training, and online inference are often deployed in different containers, with scattered logs and versions. The lack of a low-latency link connecting data acquisition, processing, modeling, control, and traceability makes it difficult for engineers to quickly reconstruct the complete path of "source data → processing script → model parameters → control instructions" and generate a compliance report within the regulatory timeframe when prediction bias occurs.
[0006] In summary, existing technologies reveal three major bottlenecks: First, a single perspective and fragmented information—mainstream Transformer models typically focus only on one token perspective, such as patch or variable, failing to simultaneously capture cross-variable global dependencies and local fragment details; second, handling fragmented processes and difficulty in tracing errors—data cleaning, frequency alignment, missing data completion, model training, and online inference are scattered across different containers and lack version management, making it difficult to quickly trace back to specific scripts or parameters after prediction deviations occur; third, insufficient traceability depth and high compliance pressure—the lack of an end-to-end PROV-DM traceability framework covering "collection → preprocessing → modeling → closed-loop control → batch traceability" hinders one-click auditing and is also detrimental to triggering online retraining and continuous iteration. The invention patent application CN118427607A, "A Transformer Fault Early Warning Method Based on Multivariate Time Series," inputs dissolved gas in oil, short-circuit current withstand, and load sequence into a VARMA prediction model, then uses a gradient boosting tree for fault diagnosis, achieving early warning for transformers. However, it lacks complementary time and variable perspectives; it does not use PROV-DM or graph databases to record preprocessing scripts and model versions, making rapid traceability impossible; and it lacks error-driven feedback nodes, making it impossible to trigger online retraining and maintain long-term robustness. Therefore, there is an urgent need for a manufacturing quality management method that integrates a Transformer framework that combines patch tokens and variable tokens in parallel, and organically combines it with MPC closed-loop regulation and Neo4j-based batch traceability graphs to achieve real-time prediction-control-traceability integration, better supporting high-frequency production cycles and strict regulatory compliance. Summary of the Invention
[0007] The technical problem to be solved by this invention is to address the shortcomings of the existing technology by providing a quality traceability method for the manufacturing process based on parallel processing of multi-source data. It relies on three major innovations: parallel fusion of dual tokens, closed-loop adjustment of MPC, and traceability of Neo4j-PROV. It further improves the prediction effect compared with the single-view Transformer model in public benchmarks. At the same time, it compresses the traceability query latency to less than 100ms at the scale of millions of nodes, realizing integrated manufacturing quality management with high precision, high transparency, and high governance.
[0008] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0009] A quality traceability method for manufacturing processes based on parallel processing of multi-source data includes the following steps:
[0010] Step 1: Constructing the raw data for a unified time base;
[0011] Raw time-series data is collected from multiple data sources using the Apache Kafka message bus, and a monitoring matrix is set up. With the target sequence y(t); where the monitoring matrix is the original time series data, x m (t) represents the total number of time steps for the m-th variable, where M represents the number of variables. Let y(t) represent the set of real numbers; y(t) be the predicted sequence of results; the set obtained after preliminary data processing is denoted as y(t). ;
[0012] Step 2: For the set Anomaly detection and missing data interpolation are performed on the data to obtain a cleaned dataset. ;
[0013] Step 3: Parallel embedding of variable token strategy and patch token strategy; A parallel method is adopted to embed variable token and patch token separately;
[0014] The input manufacturing process data is from multiple sources and has the following shape: , where T is the time step and M is the number of variables, are converted into variable tokens and patch tokens; variable tokens capture cross-variable dependencies, and patch tokens reinforce local periodicity and mutation features;
[0015] Step 4: Parallel self-attention encoding;
[0016] Variable embedding matrix obtained from samples in the same time window With patch embedding matrix They enter two attention pathways respectively, among which The embedding matrix for each variable branch within a single time window, where each row represents a variable. A 3D vector, where M is the number of variables. The embedding matrix for each patch branch within the same time window, i.e., the embedding matrix for each patch. A dimensional vector, where P is the number of patches cut out within this time window;
[0017] Step 5: Latent space multilayer perceptron fusion; the outputs of the variables and patch branches are fused through a multilayer perceptron (MLP) to generate a comprehensive feature vector;
[0018] Step 6: Multi-step linear mapping and source closure;
[0019] Step 5: The fused features are used to generate prediction results through the prediction head, outputting the predicted values for the next H time steps;
[0020] Step 7: Windowing error assessment;
[0021] In the sliding validation set Internal calculation of root mean square error (RMSE) and symmetric mean absolute percentage error (SMAPE); sliding validation set. This represents the set of time indices within the current window; the evaluation results and window boundary times are written together into the evaluation error node, and the prediction output entities referenced by the evaluation service are annotated using entity relationships through activities, satisfying the audit requirements for historical traceability of prediction performance;
[0022] Step 8: Anomaly detection and threshold logic; Set a global error threshold. , and minimum attention threshold ;
[0023] like , or If so, the system determines that the current prediction is in an abnormal state and has a slight deviation. The average weight of the attention to variable m in the nearest variable branch is used; this dual-threshold decision takes into account both the risk of overall accuracy degradation and univariate degradation.
[0024] like , or The system determined the prediction to be severely drifted.
[0025] Step 9: Generate feedback activity and update the model; for sample windows that trigger the conditions, the system generates feedback adjustment nodes;
[0026] Based on the determination in step 8, if the current prediction has a slight deviation, then weight decay is performed. , Set the value to 0.2, assign the node attribute type=weight_adjust, and record it. The values before and after the adjustment facilitate traceability and auditing;
[0027] If the current prediction is a severe drift, set the node attribute type=retrain_trigger, attach the external retraining task identifier run_id, and update the model version number;
[0028] Feedback adjustments are made by linking the activity-affected wasInfluencedBy to the parallel token embedding and multilayer perceptron fusion, while writing the new weights or new model version number to the corresponding node fields to ensure that any adaptive adjustments are persisted and traceable.
[0029] Step 10: Time-based indexing and query performance;
[0030] All entity nodes, when written, are assigned an IN_TIME relationship pointing to the Time-Tree level (ms←second←minute…year), making the interval... The query first locates the common ancestor level, and then performs a subgraph traversal.
[0031] Furthermore, the preliminary data processing in step 1 includes:
[0032] Step 1.1: First, perform time alignment on all variables;
[0033] If the sampling frequency of a certain signal is f m satisfy Then use forward hold; f s The threshold representing the sampling frequency;
[0034] like Then in the original sequence Divide the sequence into several segments according to its length, and take the arithmetic mean of all sequence values in each segment, i.e.:
[0035] ;
[0036] in, The arithmetic mean is given by m, which is a general term for the number of variables, and j represents the lag order / time point in the moving average window.
[0037] Step 1.2: Finally, obtain the result at a unified time. Sampled data pairs ,in , H is the prediction step size, t i The time step of the input monitoring data is represented by , and the resulting set is denoted as . .
[0038] Furthermore, step 2 specifically includes:
[0039] Step 2.1: In the set In this process, the mean of all time steps within the sliding window is calculated for each sequence. with standard deviation ,calculate ,like Then It was judged as an outlier and marked as missing, among which The set threshold;
[0040] Step 2.2: Determine the missing length That is, the number of empty values in a sequence. The set missing length threshold;
[0041] If the missing length Singular spectral analysis (SSA) is introduced; the missing length is... The window uses a length of L s Slicing is performed using a sliding window, and the resulting K values are... s The subsequences are concatenated and embedded into the trajectory matrix. L s K represents the number of rows in the trajectory matrix, i.e., the embedding dimension, which is also the length of the sliding window. s The number of columns in the trajectory matrix represents the number of subsequences obtained by the sliding window; the maximum value is retained. Singular value reconstructed trajectory matrix Then, a diagonal average is performed to obtain the filled sequence;
[0042] like The one-dimensional Kalman filter is used to recursively complete the formula, which is:
[0043] ;
[0044] in, It is the posterior state estimate obtained after using the observations up to time t; It is the posterior state estimate of the previous time step, that is, the state estimate of time step t-1 after using the observations up to t-1; Here, K represents the observation value at time t, K is the Kalman gain, and A is the state transition matrix, which advances the state from the previous time step to the prediction at the current time step. H is the observation matrix, which maps quantities in the "state space" to the "observation space".
[0045] The cleaned dataset is denoted as .
[0046] Furthermore, in step 3, the specific method for embedding the variable token and the patch token is as follows:
[0047] In the process of generating the variable token, the cleaned matrix is input. Expanding along the variable dimension, M sequences are generated; the processing of the variable token is as follows: for each sample window length L, ... Stacked along the variable dimension as follows:
[0048] ;
[0049] Where L is the sliding window length of the input data, i is the sample window number, and M is the number of variables; The input tensor for the variable branch is obtained by stacking the sequence of variables in the i-th window along the variable dimension; This represents a sequence of length L corresponding to the Mth variable in the i-th window;
[0050] Each sequence is mapped to a linear projection. 3D embedding space, the formula is ,in For the projection matrix, For position encoding, the output shape is Specifically, W is the embedding matrix obtained by the i-th window in the variable token branch; v The linear projection matrix of the variable branch maps the time slice of length L to... 3D embedding space; Learnable position encoding for variable branches; one line for each variable. Wei said;
[0051] Patch token generation in progress; input the cleaned matrix. Divide the data into patches based on the time dimension. Each patch contains p time steps. There are several patch sequences; specifically, the length of each sample window is set to L, and p is the window length of the patch, i.e., the number of steps taken in the time dimension at one time. Each patch contains p time steps; the number of patches into which a sample window is divided is... ;
[0052] Mapped to via linear projection Dimension, formula is ,in , , The output shape is ;
[0053] The variable token and the patch token are aligned on the same hidden dimension, ready to enter the self-attention layer; specifically... The linear projection matrix maps each patch row vector of length p of each variable to... 3D embedding space; This is a learnable positional encoding, i.e., patch sequence position / sequence encoding, which provides temporal order information for each patch and adds it row by row to the projection result; X p E is the patch input matrix obtained after time-dimensional sliding partitioning and flattening; p The embedding matrix obtained by the sample window in the patch branch, i.e., for each patch. Wei said; To hide / embed dimensions, maintain consistency with the variable token branch to facilitate subsequent parallel attention and fusion.
[0054] Furthermore, in step 4, the parallel self-attention encoding is specifically as follows:
[0055] Each self-attention layer calculates the query, key, and value, using the following formula: , , ,in, , , ;
[0056] The formula for calculating attention is:
[0057] ;
[0058] in, h represents the number of attention heads;
[0059] Multi-head attention computation is performed in parallel on multiple heads, and the concatenated result is processed by a feedforward network (FFN). The FFN formula is as follows:
[0060] ;
[0061] Each layer includes residual connectivity and layer normalization, as shown in the formula: The output of the variable branch after attention is: Similarly, the output of the patch branch after attention is That is, the outputs of each head are concatenated and linearly mapped back. The result after dimensional analysis; , , The corresponding query matrix, key matrix, and value matrix are obtained by linearly projecting the corresponding input E according to the branch. , , For the linear projection matrix of the corresponding head, project the d-dimensional features onto each head dimension. , and the denominator Keep consistent; the denominator Use the scaling factor to scale the training to stabilize the dimensions per head; This indicates the matrix transpose.
[0062] Furthermore, the specific method of step 5 is as follows:
[0063] Input is a variable, branch output and patch branch output splicing to generate The formula is obtained through MLP processing. ,in , Output the fused features F; , These are two sets of weight matrices from two fully connected layers in an MLP. This depth alignment completes variable-patch information fusion in the latent space, while simultaneously reducing the dimensionality. The resulting vector F is written into the graph as the fused feature entities; the fusion weights and random seeds are recorded in the parallel token embedding and MLP fusion activity nodes.
[0064] Furthermore, the specific method for step 6 is as follows:
[0065] The input is the fused features. Generate by average pooling The formula is ; Mapping to the prediction space through a linear layer, the formula is as follows ,in , Output ; and for each A predictive output entity is established, with fields including the predicted value, prediction step size, and model version number. This entity is then connected to the fused features, and recursively linked back to the original data, forming a complete "data-model-output" path in the source graph. Additionally, key quality indicators at prediction output time k are used... Thus, the deviation is calculated. Used for trigger control. The set threshold; the set allowable deviation threshold limit. ,like Then solve Production process control quantity This control quantity is determined based on the specific process and actuators of the production line; among which, To predict the time domain length, corresponding to the multi-step setting of the future H-step prediction; j is the index within the prediction / optimization step; This is a prediction j steps ahead based on current information at time k, i.e., a future estimate of the key indicators, used for the accumulation of the error term in the objective function; The sequence of process control quantities to be determined; To control the weight of the energy regularization term, a non-negative hyperparameter is used to make a trade-off between the tracking accuracy of key indicators and the magnitude of control energy;
[0066] Production process control quantity Subsequently, the PLC is notified via the Open Platform Communication Unified Architecture OPC-UA, which writes a millisecond-level timestamp and associates it with IN_TIME→Time-Tree (ms←second←…←year), with a closed-loop latency of [missing information]. , This is the timestamp of the model's prediction result at this current step, and The timestamp for the actual issuance / writing of the control commands generated from this prediction result to the PLC; the control commands and model version are synchronously written to the process control node Control Activity, and are connected to the batch data batch node Lot-ID through the activity and agent association wasAssociatedWith.
[0067] Furthermore, the formulas for calculating the root mean square error (RMSE) and the symmetric mean absolute percentage error (SMAPE) in step 7 are as follows:
[0068] ;
[0069] ;
[0070] Where n is the number of samples contained in the validation set V. For the j-th moment in the validation set; For the target sequence at time The true value of the original observation data. At any moment The predicted value.
[0071] The beneficial effects of adopting the above technical solution are as follows: The quality traceability method for manufacturing processes based on parallel processing of multi-source data provided by this invention employs a dual-perspective parallel self-attention mechanism of variable-token and patch-token, enabling the model to simultaneously capture global coupling relationships across variables and microstructural features of local time periods, resulting in better performance in multivariate time series prediction compared to the single-perspective Transformer. After parallel decomposition of the patch dimension and variable dimension, the computational complexity of attention is reduced from... Down to Here, L represents the time step, N represents the number of variables, and P represents the number of batches, significantly reducing memory and latency overhead. The entire process follows the W3C PROV-DM "entity-activity-agent" semantics, writing the entire process of "collection → cleaning → embedding → attention → fusion → prediction → MPC control → evaluation → feedback" into Neo4j in real time. Combined with the Time-Tree hierarchical index, the latency for querying the complete lineage path at a scale of millions of nodes is less than 100ms. It meets the audit requirements of GDPR and ISO / IEC 42001 for interpretable automated decision-making. Defect warnings are moved forward to the process: the prediction module outputs key quality indicators (solder pull-out force, chip offset, filling weight, etc.) in real time. Once the threshold is exceeded, MPC adjustment (such as current, furnace temperature, valve opening) is triggered, moving defect detection from sampling inspection to process execution, reducing the production line rework rate. The evaluation module continuously monitors RMSE and SMAPE. When the error exceeds the threshold, the system automatically generates feedback. This ranges from online reallocation of attention weights to triggering retraining and hot updates by calling the MLflow Model Registry. All adaptive actions are recorded in the graph, allowing for playback and rollback, effectively suppressing concept drift and reducing long-term maintenance costs. Unlike the traditional strategy of "selecting some features after dimensionality reduction," this invention retains the entire monitoring stream through weight dilution rather than hard deletion, and records low-weight variables in the source graph, providing a basis for subsequent root cause analysis and process improvement. The system architecture is divided into nine components: Ingest, Clean, Embed, Self-Attention (SA), Fusion, Predict, Eval, Ctrl (MPC), and ProvGraph, which can be elastically scaled according to business volume. All model weights support FP16 ONNX export, compatible with Triton Server batch inference and Kubernetes rolling updates. This invention achieves breakthroughs in four dimensions: high precision, low resource consumption, high transparency, and strong governance, providing a new industry paradigm for high-dimensional heterogeneous frequency time series prediction that can be directly implemented and sustainably evolved. Attached Figure Description
[0072] Figure 1 This is a schematic diagram of the overall solution provided in an embodiment of the present invention;
[0073] Figure 2 Data traceability diagram provided for embodiments of the present invention;
[0074] Figure 3 This is a schematic diagram of the parallel token strategy provided in an embodiment of the present invention. Detailed Implementation
[0075] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0076] A quality traceability method for manufacturing processes based on parallel processing of multi-source data, combined with Neo4j knowledge graph to achieve end-to-end data traceability. For example... Figure 1 As shown, the system collects multi-source data from various sources (such as sensors, REST APIs, and historical databases) via the Apache Kafka message bus. The data then passes through a preprocessing module, a feature embedding module, a self-attention layer, an MLP fusion module, and a prediction module to finally generate prediction results. The system also includes evaluation, MPC control, and feedback modules, which optimize the overall method performance. Metadata for all data processing flows is stored in the Neo4 graph database to ensure traceability. Figure 2 The PROV model records data traceability, showing the complete chain from raw data to predicted output, and achieves dynamic optimization through feedback loop. Figure 3 The parallel token strategy is shown in detail, including the generation process of variable tagging and patch tagging, as well as the self-attention mechanism.
[0077] Taking an industrial production scenario as an example, the system collects multi-source data from the manufacturing process, including variables such as temperature, pressure, and flow rate, with a sampling frequency of once per minute. Data is collected via a Kafka bus, generating a large number of records. The preprocessing module removes outliers and fills in missing values. Double-label generation uses appropriate parameters to generate variables and patch labels. After processing by the self-attention layer, the MLP (Multi-Level Processing) fuses and generates features, and the prediction head outputs predicted values for future time steps. The evaluation module calculates errors and triggers feedback to adjust weights. MPC (Multi-Level Processing) control optimizes and controls the manufacturing process. The Neo4j graph database records nodes and relationships, supporting millisecond-level traceability queries.
[0078] Step 1: As Figure 1 as well as Figure 2As shown, raw time-series data is first collected from various data sources (such as sensors, REST APIs, and historical databases) via the Apache Kafka message bus. Data sources may include industrial sensors (such as temperature, pressure, and flow), external APIs (such as weather data), or historical databases (such as production records). To ensure data synchronization, the system uses a unified time reference framework for time base alignment, eliminating time deviations from heterogeneous data sources. Specifically, Kafka producers collect data at high frequency, generating message streams containing timestamps, data values, and metadata. The MIDAS algorithm is used for time alignment of multivariate data, ensuring all variables are aligned on the same timeline. The aligned data generates raw data nodes, recorded in the Neo4j graph database. Node attributes include timestamps, data source identifiers, and checksums.
[0079] Step 2: The preprocessing module cleans and standardizes the raw data to ensure data quality.
[0080] First, outliers are detected using the Z-score method, and a standardized score is calculated for each data point using the following formula: Where x is a data point, The mean of the sequence. The standard deviation is used; data points exceeding the threshold are marked as outliers and removed.
[0081] Subsequently, the system selects Singular Spectrum Analysis (SSA) or Kalman filter to fill in missing values based on the data characteristics. If the missing length... Introducing Singular Spectrum Analysis (SSA), The missing value length threshold is set. SSA reconstructs missing values by decomposing the time series into trend, periodic, and noise components, using the following formula: ,in For the k-th singular value, To and The corresponding left singular vector, To and The corresponding right singular vector. The Kalman filter uses a state-space model, and the state update formula is: The observation formula is Where A is the state transition matrix and H is the observation matrix. , This is noise. In this embodiment, if the missing length... Then, a one-dimensional Kalman filter is used to recursively complete the expression. The formula for a one-dimensional Kalman filter is:
[0082] ;
[0083] in, It is the posterior state estimate obtained after using the observations up to time t; It is the posterior state estimate of the previous time step, that is, the state estimate of time step t-1 after using the observations up to t-1; Here, K represents the observation value at time t, K is the Kalman gain, and A is the state transition matrix, which advances the state from the previous time step to the prediction at the current time step. H is the observation matrix, which maps quantities in the "state space" to the "observation space".
[0084] The cleaned data generates processed data nodes, which are recorded in the Neo4 graph database. The attributes include timestamps and processing methods.
[0085] Step 3: Input multi-source data of the manufacturing process, in the shape of Where T is the time step and M is the number of variables, they are converted into variable tokens and patch tokens. For example... Figure 3 As shown, in the process of generating the variable token, the input is the cleaned matrix. Expanding by variable dimension, M sequences are generated. Specifically, the token variable is processed as follows: The length of each sample window is set to L, and... Stacked along the variable dimension as follows:
[0086] ;
[0087] Where L is the sliding window length of the input data, i is the sample window number, and M is the number of variables; The input tensor for the variable branch is obtained by stacking the sequence of variables in the i-th window along the variable dimension; This represents a sequence of length L corresponding to the Mth variable in the i-th window.
[0088] Each sequence is mapped to a linear projection. 3D embedding space, the formula is ,in For the projection matrix, For position encoding, the output shape is Specifically, W is the embedding matrix obtained by the i-th window in the variable token branch; v The linear projection matrix of the variable branch maps the time slice of length L to... 3D embedding space; Learnable position encoding for variable branches; one line for each variable. Wei said.
[0089] Patch token generation in progress; input the cleaned matrix. Divide the data into patches based on the time dimension. Each patch contains p time steps. There are several patch sequences. Specifically, the length of each sample window is set to L, and p is the window length of the patch, i.e., the number of steps taken in the time dimension at one time. Each patch contains p time steps; the number of patches into which a sample window is divided is... .
[0090] Mapped to via linear projection Dimension, formula is ,in , , The output shape is The variable token and the patch token are aligned on the same hidden dimension, ready to enter the self-attention layer. Specifically, The linear projection matrix maps each patch row vector of length p of each variable to... 3D embedding space; For learnable positional encoding, i.e. patch sequence position / sequence encoding, it provides temporal order information for each patch and adds it to the projection result row by row; The patch input matrix is obtained after sliding partitioning and flattening in the time dimension. The embedding matrix obtained by the sample window in the patch branch, i.e., for each patch. Wei said; To hide / embed dimensions, maintain consistency with the variable token branch to facilitate subsequent parallel attention and fusion.
[0091] Thus, variable tokens capture cross-variable dependencies, while patch tokens reinforce local periodicity and mutation characteristics.
[0092] Step 4: Variable labeling is processed through multiple self-attention layers to capture dependencies between variables. The input is a variable label embedding matrix. Each self-attention layer calculates the query, key, and value using the following formula: , , ,in, , , The formula for calculating attention is:
[0093] ;
[0094] in, Where h represents the number of attention heads. Multi-head attention computes multiple heads in parallel, and the concatenated result is processed through a feedforward network (FFN). The FFN formula is: Each layer includes residual connections and layer normalization, as shown in the formula. Patch markers are processed through a similar self-attention layer, with the patch marker embedding matrix as input. The processing method is the same as that for variable branching, extracting local patterns from the time series.
[0095] Step 5: The outputs of the variable and patch branches are fused using a multilayer perceptron (MLP) to generate a comprehensive feature vector. The input is the output of the variable branch. and patch branch output splicing to generate After processing with MLP, the formula is: ,in , The fused features F are then output. Specifically... , These are two sets of weight matrices from two fully connected layers in an MLP. This depth alignment completes variable-patch information fusion in the latent space, while simultaneously reducing the dimensionality. The resulting vector F is written into the graph as the fused feature entities; the fusion weights and random seeds are recorded in the parallel token embedding and MLP fusion activity nodes.
[0096] Step 6: The fused features are used to generate prediction results through the prediction head, outputting the predicted values for the next H time steps. The input is the fused features. Generate by average pooling The formula is The linear layer maps to the prediction space, as shown in the formula. ,in , Output At the same time, for each A predictive output entity is established, with fields including the predicted value, prediction step size, and model version number. This entity is then linked to the fused features, and recursively linked back to the original raw data, forming a complete "data-model-output" path in the source graph. Additionally, key quality indicators at prediction output time k are used... Thus, the deviation is calculated. Used for trigger control. The set threshold; the set allowable deviation threshold limit. ,like Then solve Production process control quantity (Temperature, feed rate, etc.), these control parameters are determined based on the specific production line process and actuators; among them, To predict the time domain length, corresponding to the multi-step setting of the future H-step prediction; j is the index within the prediction / optimization step; This is a prediction j steps ahead based on current information at time k, i.e., a future estimate of the key indicators, used for the accumulation of the error term in the objective function; The sequence of process control quantities to be determined; The weight of the regularization term for control energy (control input amplitude) is a non-negative hyperparameter used to strike a trade-off between the tracking accuracy of key indicators and the magnitude of the control input amplitude (control energy). This generates the process control quantity. Subsequently, the PLC is sent through the open platform's unified communication architecture OPC-UA, which writes millisecond-level timestamps and associates them with IN_TIME→Time-Tree (ms←second←…←year), with closed-loop delay based on... , This is the timestamp of the model's prediction result at this current step (the moment the model output / is accepted). The timestamp (the moment when the control command actually takes effect) for the control command generated based on this prediction result is actually issued / written to the PLC. The control command and model version are synchronously written to the process control node Control Activity, and are connected to the batch data batch node Lot-ID through the activity and agent association wasAssociatedWith.
[0097] Step 7: The prediction results are evaluated using the error calculation module, triggering a feedback mechanism to optimize the model. The evaluation calculates the root mean square error (RMSE) and the symmetric mean absolute percentage error (SMAPE) on the sliding validation set. The internal calculation formulas are as follows: , .
[0098] The evaluation results and window boundary time are written together into the evaluation error node, and the predicted output entities referenced by them are marked with the used relationship, which meets the audit requirements for historical traceability of prediction performance.
[0099] Step 8: Anomaly Detection and Threshold Logic. Set a global error threshold. , and minimum attention threshold .
[0100] like , or If so, the system determines that the current prediction is in an abnormal state and has a slight deviation. This represents the average weight of the attention to variable m in the nearest variable branch. This dual-threshold decision takes into account both the risk of overall accuracy degradation and univariate degradation.
[0101] like , or The system determined that the prediction was severely drifting.
[0102] Step 9: Generate feedback activities and update the model.
[0103] For sample windows identified as abnormal, the system generates feedback adjustment activity nodes:
[0104] Based on the determination in step 8, if the current prediction is determined to be slightly biased, then weight decay is performed, γ=0.2, node attribute type=weight_adjust, and the before and after values (w_before and w_after of the affected target) are recorded in the node.
[0105] If the current prediction is determined to be severely drifted, then the node attribute type=retrain_trigger, with the external retraining task identifier run_id, is updated, and the model version number is updated.
[0106] Feedback adjustments are connected to the parallel token embedding and multilayer perceptron (MLP) fusion activities via wasInfluencedBy (activity affected), while new weights or new model version numbers are written to the corresponding entity fields to ensure that any adaptive adjustments are persisted and traceable.
[0107] Step 10: Time Indexing and Query Performance.
[0108] When all entity nodes are written, an IN_TIME relationship is attached, pointing to the Time-Tree level (ms←second←minute…year), making the interval... The query first locates the common ancestor level, then performs subgraph traversal. Since a single tracing path has a maximum of only 8 hops (collection → cleaning → embedding → attention → fusion → prediction → MPC control → evaluation → feedback), the shortest path query complexity remains O(V+E) at a scale of millions of nodes, with a measured average latency of <100 ms. This performance meets the requirements of real-time tracing for compliance audits in production environments and provides support for online early warning.
[0109] In this embodiment, after windowing error evaluation and determination, if the error exceeds the threshold, feedback is triggered, and the weights of the MLP fusion layer are updated through the Adam optimizer, using the following formula: ,in This is the learning rate. If the error does not decrease after multiple consecutive iterations, model retraining is triggered. The evaluation and feedback operations generate evaluation error and feedback adjustment nodes, which are recorded in [the relevant data]. Figure 2 middle.
[0110] like Figure 2As shown, this embodiment uses the PROV model to record metadata about data sources and processing flows, ensuring end-to-end traceability. Each processing step generates nodes and relationships, which are stored in the Neo4j graph database. Entity nodes (such as raw data, processed data, fused features, and prediction output) record data status, activity nodes (such as anomaly detection, missing value imputation, prediction, error evaluation, and feedback adjustment) record processing operations, and proxy nodes (such as Kafka, models, and evaluation services) record the executing entity. Relationships include: wasGeneratedBy (activity generates entity), used (activity uses entity), wasDerivedFrom (entity derived), wasInformedBy (activity is based on another activity), wasInfluencedBy (activity is affected), and wasAssociatedWith (activity is associated with a proxy). Figure 2 The data origin graph records the complete chain from RawEntity to PredictOutput through the PROV model, including: raw data is connected to anomaly detection through the "used" relationship; anomaly detection generates processed data through "wasGeneratedBy"; processed data is connected to parallel token embedding and MLP fusion through "used"; parallel token embedding and MLP fusion generate fused features through "wasGeneratedBy"; processed data derives fused features through "wasDerivedFrom"; fused features are connected to prediction through "used"; prediction generates prediction output through "wasGeneratedBy"; prediction output is connected to error evaluation through "used"; error evaluation is connected to feedback adjustment through "wasInformedBy"; and feedback adjustment is connected to parallel token embedding and MLP fusion through "wasInfluencedBy" (dashed lines represent feedback loops). In addition, the prediction quality metric is connected to the prediction process via "wasGeneratedBy", the prediction quality metric is connected to the process control via "used", the process control is connected to the data batch via "wasAssociatedWith", and the data batch is simultaneously connected to the feedback adjustment, error assessment, and data collection via "wasAssociatedWith". Kafka, the model, and the assessment service are each their respective execution entities.
[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the present invention.
Claims
1. A quality traceability method in manufacturing processes based on parallel processing of multi-source data, characterized in that: Includes the following steps: Step 1: Constructing the raw data for a unified time base; Raw time-series data is collected from multiple data sources using the Apache Kafka message bus, and a monitoring matrix is set up. With the target sequence y(t); where the monitoring matrix is the original time series data, x m (t) represents the total number of time steps for the m-th variable, where M represents the number of variables. Let y(t) represent the set of real numbers; y(t) be the predicted sequence of results; the set obtained after preliminary data processing is denoted as y(t). ; Step 2: For the set Anomaly detection and missing data interpolation are performed on the data to obtain a cleaned dataset. ; Step 3: Parallel embedding of variable token strategy and patch token strategy; A parallel method is adopted to embed variable token and patch token separately; The input manufacturing process data is from multiple sources and has the following shape: , where T is the time step and M is the number of variables, are converted into variable tokens and patch tokens; variable tokens capture cross-variable dependencies, and patch tokens reinforce local periodicity and mutation features; Step 4: Parallel self-attention encoding; Variable embedding matrix obtained from samples in the same time window With patch embedding matrix They enter two attention pathways respectively, among which The embedding matrix for each variable branch within a single time window, where each row represents a variable. A 3D vector, where M is the number of variables. The embedding matrix for each patch branch within the same time window, i.e., the embedding matrix for each patch. A dimensional vector, where P is the number of patches cut out within this time window; Step 5: Latent space multilayer perceptron fusion; the outputs of the variables and patch branches are fused through a multilayer perceptron to generate a comprehensive feature vector; Step 6: Multi-step linear mapping and source closure; Step 5: The fused features are used to generate prediction results through the prediction head, outputting the predicted values for the next H time steps; Step 7: Windowing error assessment; In the sliding validation set Internal calculation of root mean square error (RMSE) and symmetric mean absolute percentage error (SMAPE); sliding validation set. This represents the set of time indices within the current window; the evaluation results and window boundary times are written together into the evaluation error node, and the prediction output entities referenced by the evaluation service are annotated using entity relationships through activities, satisfying the audit requirements for historical traceability of prediction performance; Step 8: Anomaly detection and threshold logic; Set a global error threshold. , and minimum attention threshold ; like , or If so, the system determines that the current prediction is in an abnormal state and has a slight deviation. The average weight of the attention to variable m in the nearest variable branch is used; this dual-threshold decision takes into account both the risk of overall accuracy degradation and univariate degradation. like , or The system determined the prediction to be severely drifted. Step 9: Generate feedback activity and update the model; for sample windows that trigger the conditions, the system generates feedback adjustment nodes; Based on the determination in step 8, if the current prediction has a slight deviation, then weight decay is performed. , Set the value to 0.2, assign the node attribute type=weight_adjust, and record it. The values before and after the adjustment facilitate traceability and auditing; If the current prediction is a severe drift, set the node attribute type=retrain_trigger, attach the external retraining task identifier run_id, and update the model version number; Feedback adjustments are made by linking the activity-affected wasInfluencedBy to the parallel token embedding and multilayer perceptron fusion, while writing the new weights or new model version number to the corresponding node fields to ensure that any adaptive adjustments are persisted and traceable. Step 10: Time-based indexing and query performance; All entity nodes, when written, are assigned an IN_TIME relationship pointing to the Time-Tree level (ms←second←minute…year), making the interval... The query first locates the common ancestor level, and then performs a subgraph traversal.
2. The quality traceability method for manufacturing processes based on parallel processing of multi-source data according to claim 1, characterized in that: The preliminary data processing in step 1 includes: Step 1.1: First, perform time alignment on all variables; If the sampling frequency of a certain signal is f m satisfy Then use forward hold; f s The threshold representing the sampling frequency; like Then in the original sequence Divide the sequence into several segments according to its length, and take the arithmetic mean of all sequence values in each segment, i.e.: ; in, The arithmetic mean is given by m, which is a general term for the number of variables, and j represents the lag order / time point in the moving average window. Step 1.2: Finally, obtain the result at a unified time. Sampled data pairs ,in , H is the prediction step size, t i The time step of the input monitoring data is represented by , and the resulting set is denoted as . .
3. The quality traceability method for manufacturing processes based on parallel processing of multi-source data according to claim 2, characterized in that: Step 2 specifically includes: Step 2.1: In the set In this process, the mean of all time steps within the sliding window is calculated for each sequence. with standard deviation ,calculate ,like Then It was judged as an outlier and marked as missing, among which The set threshold; Step 2.2: Determine the missing length That is, the number of empty values in a sequence. The set missing length threshold; If the missing length Singular spectrum analysis is introduced; the missing length is... The window uses a length of L s Slicing is performed using a sliding window, and the resulting K values are... s The subsequences are concatenated and embedded into the trajectory matrix. L s K represents the number of rows in the trajectory matrix, i.e., the embedding dimension, which is also the length of the sliding window. s The number of columns in the trajectory matrix represents the number of subsequences obtained by the sliding window; the maximum value is retained. Singular value reconstructed trajectory matrix Then, a diagonal average is performed to obtain the filled sequence; like The one-dimensional Kalman filter is used to recursively complete the formula, which is: ; in, It is the posterior state estimate obtained after using the observations up to time t; It is the posterior state estimate of the previous time step, that is, the state estimate of time step t-1 after using the observations up to t-1; Here, K represents the observation value at time t, K is the Kalman gain, and A is the state transition matrix, which advances the state from the previous time step to the prediction at the current time step. H is the observation matrix, which maps quantities in the "state space" to the "observation space". The cleaned dataset is denoted as .
4. The quality traceability method for manufacturing processes based on parallel processing of multi-source data according to claim 3, characterized in that: In step 3, the specific method for embedding the variables token and patch token is as follows: In the process of generating the variable token, the cleaned matrix is input. Expanding along the variable dimension, M sequences are generated; the processing of the variable token is as follows: for each sample window length L, ... Stacked along the variable dimension as follows: ; Where L is the sliding window length of the input data, i is the sample window number, and M is the number of variables; The input tensor for the variable branch is obtained by stacking the sequence of variables in the i-th window along the variable dimension; This represents a sequence of length L corresponding to the Mth variable in the i-th window; Each sequence is mapped to a linear projection. 3D embedding space, the formula is ,in For the projection matrix, For position encoding, the output shape is Specifically, W is the embedding matrix obtained by the i-th window in the variable token branch; v The linear projection matrix of the variable branch maps the time slice of length L to... 3D embedding space; Learnable position encoding for variable branches; one line for each variable. Wei said; Patch token generation in progress; input the cleaned matrix. Divide the data into patches based on the time dimension. Each patch contains p time steps. There are several patch sequences; specifically, the length of each sample window is set to L, and p is the window length of the patch, i.e., the number of steps taken in the time dimension at one time. Each patch contains p time steps; the number of patches into which a sample window is divided is... ; Mapped to via linear projection Dimension, formula is ,in , , The output shape is ; The variable token and the patch token are aligned on the same hidden dimension, ready to enter the self-attention layer; specifically... The linear projection matrix maps each patch row vector of length p of each variable to... 3D embedding space; This is a learnable positional encoding, i.e., patch sequence position / sequence encoding, which provides temporal order information for each patch and adds it row by row to the projection result; X p E is the patch input matrix obtained after time-dimensional sliding partitioning and flattening; p The embedding matrix obtained by the sample window in the patch branch, i.e., for each patch. Wei said; To hide / embed dimensions, maintain consistency with the variable token branch to facilitate subsequent parallel attention and fusion.
5. The quality traceability method for manufacturing processes based on parallel processing of multi-source data according to claim 4, characterized in that: In step 4, the parallel self-attention encoding is specifically as follows: Each self-attention layer calculates the query, key, and value, using the following formula: , , ,in, , , ; The formula for calculating attention is: ; in, h represents the number of attention heads; Multi-head attention computation is performed in parallel on multiple heads, and the concatenated result is processed by a feedforward network (FFN). The FFN formula is as follows: ; Each layer includes residual connectivity and layer normalization, as shown in the formula: The output of the variable branch after attention is: The output of the patch branch after attention is That is, the outputs of each head are concatenated and linearly mapped back. The result after dimensional analysis; , , The corresponding query matrix, key matrix, and value matrix are obtained by linearly projecting the corresponding input E according to the branch. , , For the linear projection matrix of the corresponding head, project the d-dimensional features onto each head dimension. , and the denominator Keep consistent; the denominator Use the scaling factor to scale the training to stabilize the dimensions per head; This indicates the matrix transpose.
6. The quality traceability method for manufacturing processes based on parallel processing of multi-source data according to claim 5, characterized in that: The specific method for step 5 is as follows: Input is a variable, branch output and patch branch output splicing to generate The formula is obtained through MLP processing. ,in , Output the fused features F; , These are two sets of weight matrices from two fully connected layers in an MLP. This depth alignment completes variable-patch information fusion in the latent space, while simultaneously reducing the dimensionality. The resulting vector F is written into the graph as the fused feature entities; The fusion weights and random seeds are recorded in the parallel token embedding and the MLP fusion active node.
7. The quality traceability method for manufacturing processes based on parallel processing of multi-source data according to claim 6, characterized in that: The specific method for step 6 is as follows: The input is the fused features. Generate by average pooling The formula is ; Mapping to the prediction space through a linear layer, the formula is as follows ,in , Output ; and for each A predictive output entity is established, with fields including the predicted value, prediction step size, and model version number. This entity is then connected to the fused features, and recursively linked back to the original data, forming a complete "data-model-output" path in the source graph. Additionally, key quality indicators at prediction output time k are used... Thus, the deviation is calculated. Used for trigger control. The set threshold; Set the allowable deviation threshold limit ,like Then solve Production process control quantity This control quantity is determined based on the specific process and actuators of the production line; among which, To predict the time domain length, corresponding to the multi-step setting of the future H-step prediction; j is the index within the prediction / optimization step; This is a prediction j steps ahead based on current information at time k, i.e., a future estimate of the key indicators, used for the accumulation of the error term in the objective function; The sequence of process control quantities to be determined; To control the weight of the energy regularization term, a non-negative hyperparameter is used to make a trade-off between the tracking accuracy of key indicators and the magnitude of control energy; Production process control quantity Subsequently, the PLC is notified via the Open Platform Communication Unified Architecture OPC-UA, which writes a millisecond-level timestamp and associates it with IN_TIME→Time-Tree (ms←second←…←year), with a closed-loop latency of [missing information]. , This is the timestamp of the model's prediction result at this current step, and The timestamp for the actual issuance / writing of the control commands generated from this prediction result to the PLC; the control commands and model version are synchronously written to the process control node Control Activity, and are connected to the batch data batch node Lot-ID through the activity and agent association wasAssociatedWith.
8. The quality traceability method for manufacturing processes based on parallel processing of multi-source data according to claim 7, characterized in that: The formulas for calculating the root mean square error (RMSE) and the symmetric mean absolute percentage error (SMAPE) in step 7 are as follows: ; ; Where n is the number of samples contained in the validation set V. For the j-th moment in the validation set; For the target sequence at time The true value of the original observation data. At any moment The predicted value.
Citation Information
Patent Citations
Transformer fault early warning method based on multivariable time series
CN118427607A
General myoelectricity motion intention recognition model construction method and system
CN115050452A
Elevator maintenance period prediction method based on internally and externally generated variable multi-granularity embedding
CN119903971A
Industrial product quality risk association method based on graph neural network
CN121390890A
Command and control system resource trend prediction method based on fusion of long and short time sequence characteristics
CN121412907A