High-precision simulation data interpolation method for multi-cycle simulation test
By training ARIMA and TFT models in multi-period simulation tests and using dynamic weighting algorithms for prediction, the data incoherence caused by periodic dissynchronization is solved, the prediction accuracy and generalization ability of the model are improved, and the high accuracy and high efficiency requirements of complex simulation testing environments are met.
Patent Information
- Application Number
- CN202510155776.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-06-24
AI Technical Summary
In the face of complex multi-period simulation tests, it is difficult to solve the problem of data incoherence caused by periodic dissynchronization, and traditional interpolation and statistical models do not perform well when dealing with nonlinear and non-stationary data.
A high-precision simulation data interpolation method for multi-period simulation test is proposed. By collecting historical data for preprocessing and stationary, ARIMA model and TFT model are trained, and a dynamic weighting algorithm is used to achieve real-time prediction of slow-period model output data.
It improves prediction accuracy, enhances the processing ability of non-stationary and nonlinear data, improves the generalization ability of the model, solves the problem of data loss, and meets the needs of high precision and high efficiency in complex simulation testing environments.
Smart Images

Figure CN120197469A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of real-time simulation testing, and relates to a high-precision simulation data interpolation method for multi-cycle simulation testing. Background Art
[0002] In modern industry, scientific research, and technological development, simulation testing has become an important tool. By simulating the behavior of systems and environmental conditions in the real world, it helps researchers and engineers evaluate system performance, optimize design solutions, and predict system behavior. Especially in real-time simulation testing, the interaction and collaborative work of different simulation models are crucial for the accuracy and efficiency of the system. However, the real simulation testing environment is often complex and changeable, presenting many challenges. These challenges are reflected in the following aspects:
[0003] 1. Period asynchrony: In a complex simulation system, different simulation models may have different execution periods. For example, one model may perform an update every second, while another model may update every five seconds. This period asynchrony can lead to gaps and discontinuities in the data transfer process, making it difficult for subsequent models to perform accurate calculations and predictions in the absence of necessary data.
[0004] 2. Data incoherence: Due to reasons such as sensor failures, network delays, and inconsistent data acquisition frequencies, data missing or incoherence often occurs during the simulation process. In such cases, if data filling and prediction cannot be carried out in a timely and effective manner, the reliability and accuracy of the entire simulation system will be greatly reduced.
[0005] 3. High-precision requirements: In many application scenarios, such as industrial control, environmental monitoring, and financial analysis, simulation testing has extremely high requirements for data accuracy. Traditional interpolation and prediction methods, such as linear interpolation and spline interpolation, although performing well in dealing with simple time series data, often lack prediction accuracy and robustness when facing complex and non-linear time series data.
[0006] When facing various challenges in complex simulation testing, the existing technologies are insufficient in the following aspects:
[0007] 1. Limitations of linear interpolation and spline interpolation: Traditional interpolation methods such as linear interpolation and spline interpolation, although simple and fast in calculation, can only handle simple linear or smoothly changing data. These methods are difficult to provide high-precision prediction results when facing complex and non-linear time series data. In addition, when dealing with large-scale data, their performance is often insufficient and cannot meet the requirements of high precision and high efficiency. This limitation makes it difficult for linear interpolation and spline interpolation to be effectively applied in complex simulation testing environments.
[0008] 2. Applicability of statistical models: Traditional statistical models, such as autoregressive (AR) models or moving average (MA) models, perform well in dealing with stationary time series data because they rely on the assumption of data stationarity. However, for non-stationary and non-linear data, the processing ability of these models is limited and it is difficult to capture the complex changes in the data. In addition, when the data is severely missing, the performance of these models is also unsatisfactory and it is difficult to meet the high requirements for data continuity and accuracy in real-time simulation tests. Therefore, statistical models perform inadequately in coping with complex and dynamically changing simulation test environments.
[0009] 3. Insufficient model generalization ability: Existing ARIMA models perform well in specific datasets and environments. For example, the existing public patent CN118246582A has good characteristics in specific industrial load forecasting of power systems. However, when facing different types of time series data or in different application scenarios, their prediction performance often drops significantly. This problem of insufficient generalization ability makes it difficult for the models to maintain their prediction accuracy and reliability when dealing with diverse data in practical applications. In addition, the overfitting problem of the models also makes them perform poorly when facing new data, which further limits the practicality of these methods in complex simulation test environments. Summary of the Invention
[0010] The technical problem solved by the present invention is: To overcome the deficiencies of the prior art, a high-precision simulation data interpolation method for multi-cycle simulation tests is proposed, aiming to solve the problem of data incoherence caused by cycle asynchronization during the interaction of simulation models, and capable of performing high-precision prediction and interpolation between existing data points.
[0011] The technical solution adopted by the present invention is:
[0012] A high-precision simulation data interpolation method for multi-cycle simulation tests, the steps of the method include:
[0013] Step 1, collect historical data of relevant simulation modules, including timestamps and simulation module output value data;
[0014] Step 2, preprocess the historical data obtained in Step 1, and perform stationarization processing on the preprocessed time series data;
[0015] Step 3, train the ARIMA model using the historical data processed in Step 2;
[0016] Step 4, train the TFT model using the historical data processed in Step 2;
[0017] Step 5: Apply the trained ARIMA model and TFT model to the multi-period simulation system, and use the dynamic weighting algorithm to achieve real-time prediction of the output data of the slow-period model.
[0018] Preferably, the historical data includes environmental temperature, humidity, pressure data, speed data, and user input data. The user input data includes simulation parameter settings, control commands, and adjustment instructions.
[0019] Preferably, in Step 2, the process of preprocessing the data is as follows:
[0020] 2.1 Clean the data to remove noise and outliers in the data;
[0021] 2.2 Normalize the data processed in 2.1 so that its value is between 0 and 1;
[0022] 2.3 Use 70 - 80% of the processed data as the training set, and the rest as the validation set.
[0023] Preferably, the difference processing method is used to smooth the time series data, and the method is as follows:
[0024] Perform a first-order difference on the original time series data y′ t to obtain the differenced series Δy′ t : Δy′ t = y′ t - y′ t-1 ;
[0025] If the data is still not stationary after the first-order difference, perform a second-order difference or multiple differences until the data is stationary.
[0026] Preferably, the implementation method of Step 3 is as follows:
[0027] Analyze the time series data and plot the autocorrelation function ACF and partial autocorrelation function PACF diagrams of the time series data;
[0028] Use the autocorrelation function ACF diagram and partial autocorrelation function PACF diagram to determine the autoregressive order p, differencing order d, and moving average order q of the ARIMA model;
[0029] Obtain the converged ARIMA model parameters by iteratively calculating the error terms;
[0030] Preferably, the implementation method of Step 4 is as follows:
[0031] 4.1 Extract the statistical features, timestamp features, and periodic features from the historical data, and merge them into a feature vector as the input of the TFT model;
[0032] 4.2 Set the input dimension, hidden dimension, number of attention heads, number of layers, and output dimension of the TFT model;
[0033] 4.3 Set hyperparameters for the TFT model, including the loss function, initial learning rate, learning decay rate, batch size, and early stopping condition;
[0034] 4.4 Use the Adam optimizer to train the TFT model.
[0035] Preferably, the timestamp feature x_time(t) at time t = [h(t), d(t), w(t)], where h(t) is the hour feature, d(t) is the day feature, and w(t) is the week feature.
[0036] Preferably, in step 2, the preprocessed data is split into a training set and a validation set. In steps 3 and 4, the training set is used to train the model, and the validation set is used to validate the trained model.
[0037] Preferably, the implementation of step 5 is as follows:
[0038] 5.1 At time t, collect the output data of the slow-cycle simulation module in the past m cycles:
[0039] y(t - mnT), y(t - (m - 1)nT),..., y(t)
[0040] where T is the fast cycle, i.e., the calculation cycle of the fast-cycle simulation module; n is the slow-fast cycle ratio and is a positive integer; y(t) is the output data at time t;
[0041] 5.2 Use the trained ARIMA model to predict the output values of the slow-cycle simulation module at the next n fast-cycle times:
[0042]
[0043] Use the trained TFT model to predict the output values of the slow-cycle simulation module at the next n fast-cycle times:
[0044]
[0045] k' is the fast-cycle count variable;
[0046] 5.3 Calculate the dynamic weight, and the method is as follows:
[0047] 5.3.1 Perform STL decomposition on the historical data according to the following formula:
[0048] y(t - knT) = Tr(t - knT) + Sr(t - knT) + R(t - knT), k = 0, 1,..., m
[0049] Perform STL decomposition on the ARIMA predicted values:
[0050]
[0051] Perform STL decomposition on the TFT predicted values:
[0052]
[0053] Among them, y(t - knT) is the output data of the previous k slow cycles before the t-th moment of the slow cycle simulation module, Tr(t - knT) is the historical data trend term obtained by STL decomposition, Sr(t - knT) is the historical data seasonal term obtained by STL decomposition, and R(t - knT) is the historical data residual term obtained by STL decomposition;
[0054] is the predicted data of the ARIMA model for the previous k slow cycles before the t-th moment, Tr ARIMA (t - knT) is the predicted data trend term of the ARIMA model obtained by STL decomposition, Sr ARIMA (t - knT) is the predicted data seasonal term of the ARIMA model obtained by STL decomposition, R ARIMA (t - knT) is the predicted data residual term of the ARIMA model obtained by STL decomposition;
[0055] is the predicted data of the TFT model for the previous k slow cycles before the t-th moment, Tr TFT (t - knT) is the predicted data trend term of the TFT model obtained by STL decomposition, Sr TFT (t - knT) is the predicted data seasonal term of the TFT model obtained by STL decomposition, R TFT (t - knT) is the predicted data residual term of the TFT model obtained by STL decomposition;
[0056] 5.3.2 Calculate the mean square error MSE of the predicted data trend term of the ARIMA model according to the decomposition results Tr,ARIMA , the mean square error MSE of the predicted data seasonal term of the ARIMA model Sr,ARIMA , the mean square error MSE of the predicted data trend term of the TFT model Tr,TFT , the mean square error MSE of the predicted data seasonal term of the TFT model Sr,TFT ;
[0057] 5.3.3 Calculate the dynamic weight W of the ARIMA model predicted data using the mean square errors of the predicted data trend term and seasonal term of the ARIMA model ARIMA , calculate the dynamic weight W of the TFT model predicted data using the mean square errors of the predicted data trend term and seasonal term of the TFT model TFT ;
[0058]
[0059] W TFT = 1 - W ARIMA
[0060] 5.4 The predicted values at the next n fast - cycle moments are weighted and fused using the following formula to obtain the final predicted value at time t;
[0061]
[0062] 5.5 At time t + k'T, where k' = 1, 2,..., n - 1, the predicted value is passed to all fast - cycle simulation modules that require this output value as the input value;
[0063] 5.6 At the output moment of each slow - cycle simulation module, steps 5.3 - 5.5 are repeated to achieve continuous simulation.
[0064] Preferably, the implementation method of step 5.3.2 is as follows:
[0065]
[0066] The beneficial effects of the present invention compared with the prior art are as follows:
[0067] (1) The prediction accuracy is improved: By improving the traditional ARIMA model, the present invention can better handle complex non - linear time - series data. The improved model overcomes the limitations of linear interpolation and spline interpolation in dealing with complex data, not only improving the prediction accuracy of the model but also enhancing its ability to capture complex data changes. Especially in the case of large - scale data and dynamic change environments, it can provide efficient predictions.
[0068] (2) The ability to process non - stationary and non - linear data is enhanced: Based on the traditional statistical model, the present invention optimizes the data pre - processing and model training processes, enabling the model to be applicable not only to stationary time - series data but also to effectively handle non - stationary and non - linear data. This improvement makes the model perform more excellently in complex simulation test environments and can meet the high - precision real - time prediction requirements.
[0069] (3) The generalization ability of the model is improved: By optimizing the model structure, the present invention enhances the generalization ability of the ARIMA model in different data sets and application scenarios. When dealing with diverse time - series data, it can maintain a high prediction accuracy and stability, avoiding the common over - fitting problem of the traditional ARIMA model. Therefore, this method is more suitable for complex simulation test environments, ensuring that the model has good practicability in different scenarios.
[0070] (4) Solved the problem of missing data: The present invention has been optimized in dealing with missing data and can still maintain a high prediction accuracy when the data is discontinuous or missing. Compared with traditional statistical models and interpolation methods, the method of the present invention can better ensure the integrity and continuity of data, meeting the requirements for data accuracy and coherence in real-time simulation tests. Description of the Drawings
[0071] Figure 1 They are ACF and PACF diagrams, where (a) is the ACF diagram and (b) is the PACF diagram. Detailed Embodiment
[0072] The present invention will be further described below in conjunction with the drawings and embodiments.
[0073] In modern industry, scientific research, and technological development, real-time simulation tests help researchers and engineers evaluate system performance, optimize design solutions, and predict system behavior by simulating the system behavior and environmental conditions in the real world. The present invention proposes an improved high-precision data prediction and interpolation method for ARIMA, aiming to solve the problem of data incoherence caused by out-of-sync cycles during the interaction of simulation models. By combining the autoregressive, differencing, and moving average components of the ARIMA model, the present invention can capture linear trends in the short term, while capturing long-term dependencies and trends of non-linear changes through the multi-head attention mechanism and time embedding function of deep learning. It not only improves the accuracy of data prediction but also adapts to complex multi-cycle simulation systems, effectively dealing with data missing and incoherence, ensuring the continuity and accuracy of data interaction between simulation models, and enhancing the overall performance and reliability of simulation tests.
[0074] The ARIMA model captures short-term linear trends through autoregressive, differencing, and moving average components and is suitable for processing stationary or stationary time series data. In the improvement of the present invention, the addition of the multi-head attention mechanism and time embedding function can handle long-term dependencies and complex non-linear changes in time series. This fusion algorithm can not only accurately predict short-term changes but also efficiently capture long-term trends.
[0075] Through the improved ARIMA model, the present invention can provide continuous, smooth, and high-precision data input for the next simulation model, ensuring the accuracy and continuity of data interaction during the simulation test process. This method significantly improves the stability and prediction performance of the simulation system in a complex multi-cycle simulation test environment.
[0076] The specific steps of the present invention are as follows:
[0077] Step 1: Collection of historical data
[0078] Collect historical simulation data of relevant simulation modules, including timestamps and simulation module output value data.
[0079] Step 2: Preprocess historical data
[0080] Step a: Preprocessing
[0081] 1. Data cleaning: Remove noise and outliers, mutation points or significantly incorrect data points in the data, and use the statistical method Z-score to detect and process outliers.
[0082] 2. Data normalization: Normalize the data so that its values are between 0 and 1 for subsequent model processing. The normalization formula is:
[0083]
[0084] where y is the original data value, and min(y) and max(y) are the minimum and maximum values in the dataset respectively.
[0085] 3. Data splitting: Split the dataset into a training set and a validation set. Usually, 70 - 80% of the data is used as the training set, and the rest is used as the validation set.
[0086] Step b: Data stationarization
[0087] Time series data usually has trends and seasonal variations. Directly applying the ARIMA model may lead to inaccurate prediction results. Therefore, it is first necessary to perform stationarization processing on the time series data to meet the stationarity assumption. The commonly used stationarization method is differencing.
[0088] Differencing: Perform a first-order difference on the original time series y′ t to obtain the differenced series Δy′ t : Δy′ t = y′ t - y′ t-1 If the data is still not stationary after the first-order difference, a second-order difference or multiple differences can be performed until the data becomes stationary.
[0089] Step 3: Train the ARIMA model using historical data;
[0090] Analyze the time series data, use the ACF (Autocorrelation Function) and PACF (Partial Autocorrelation Function) plots to identify the structure of the ARIMA model, determine the number of autoregressive terms (AR order) p, the number of differencing times d, and the number of moving average terms (MA order) q; through iterative calculation of the error terms, finally obtain the converged ARIMA model parameters;
[0091] Step 4: Train the TFT model using historical data;
[0092] 4.1 Feature extraction: Statistical features, timestamp features, and periodic features are extracted from historical simulation data and combined into a feature vector as the input to the TFT model. Among them, the timestamp feature extraction uses the following method: At each moment t, the timestamp feature x_time(t) is extracted:
[0093] x_time(t) = [h(t), d(t), w(t)]
[0094] h(t): Hour feature, h(t) = [sin(2π·hour / 24), cos(2π·hour / 24)], where hour is the current time;
[0095] d(t): Day feature, d(t) = [sin(2π·day / 7), cos(2π·day / 7)], where day is the current date;
[0096] w(t): Week feature, w(t) = [sin(2π·week / 52), cos(2π·week / 52)], where week is the current week number.
[0097] 4.2 Set the core parameters of the TFT model, such as the input dimension, hidden dimension, number of attention heads, number of layers, output dimension, etc.:
[0098] 4.3 Model training
[0099] The model is trained using the Adam optimizer, and hyperparameters such as the loss function, initial learning rate, learning decay rate, batch size, and early stopping condition are set:
[0100] Step Five: Apply the trained model to the multi-period simulation system and use the dynamic weighting algorithm to achieve real-time prediction of the output data of the slow-period model.
[0101] 5.1 Data collection
[0102] At time t, collect the output data of the slow-period module in the past m cycles:
[0103] y(t - mnT), y(t - (m - 1)nT),..., y(t)
[0104] Among them,
[0105] - t: The current moment
[0106] - T: The calculation period of the fast-period simulation module
[0107] - n: The slow-fast period ratio (a positive integer)
[0108] - m: The number of historical data cycles used for weight calculation
[0109] -y(t): True value at time t
[0110] 5.2 Model Prediction
[0111] Use the trained ARIMA model to predict the output values at the next n fast-cycle times:
[0112]
[0113] Use the trained TFT model to predict the output values at the next n fast-cycle times:
[0114]
[0115] - Predicted value of the ARIMA model at time t
[0116] - Predicted value of the TFT model at time t
[0117] -k: Fast-cycle count variable
[0118] 5.3 Dynamic Weight Calculation Perform STL decomposition on the real historical data:
[0119] y(t - knT) = Tr(t - knT) + Sr(t - knT) + R(t - knT), k = 0, 1,..., m Perform STL decomposition on the ARIMA predicted value:
[0120]
[0121] Perform STL decomposition on the TFT predicted value:
[0122]
[0123] Calculate the mean square error of the trend term and the seasonal term:
[0124]
[0125] Calculate the dynamic weight:
[0126]
[0127] W TFT = 1 - W ARIMA
[0128] Where:
[0129] -Tr(): Trend term obtained by STL decomposition
[0130] -Sr(): Seasonal term obtained by STL decomposition
[0131] - R(): Residual term obtained by STL decomposition
[0132] - MSE Tr,ARIMA : Mean squared error of the trend term of the ARIMA model
[0133] - MSE Sr,ARIMA : Mean squared error of the seasonal term of the ARIMA model
[0134] - MSE Tr,TFT : Mean squared error of the trend term of the TFT model
[0135] - MSE Sr,TFT : Mean squared error of the seasonal term of the TFT model
[0136] 5.4 Final predicted value calculation
[0137] Perform weighted fusion on the predicted values at the next n fast - cycle moments:
[0138]
[0139] Where:
[0140] - Final predicted value at time t
[0141] - W ARIMA : Dynamic weight of the ARIMA model
[0142] - W TFT : Dynamic weight of the TFT model
[0143] 5.5 Predicted value transmission
[0144] At time t + kT (k = 1, 2,..., n - 1), transmit the predicted value to all fast - cycle simulation modules that require this output value as the input value.
[0145] 5.6 Loop update
[0146] At time t + nT, return to step 5.3, recalculate the dynamic weights and update the predicted values.
[0147] Example:
[0148] Suppose there is a dual - cycle system with fast and slow cycles. The system contains two simulation modules. The period of the fast - cycle simulation module is T = 1 second, and the simulation period of the slow - cycle simulation module is nT = 5 seconds (n = 5). The output data of the slow - cycle simulation module is the input data of the fast - cycle simulation module B.
[0149] At t = 1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 14..., it is necessary to calculate the input data of the fast - cycle simulation module.
[0150] I. Collection and Preprocessing of Training Data
[0151] 1. Data Collection In this example, we have completed the collection of training data before the simulation starts. The training data includes timestamps and the corresponding output values of the slow cycle simulation module.
[0152] 2. Data Cleaning Check whether there are obvious noises and outliers in the data. In this example, the data has been cleaned.
[0153] 3. Data Normalization Normalize the data as follows:
[0154]
[0155] Minimum value min(y) = 100
[0156] Maximum value max(y) = 116
[0157] The normalized data is as follows:
[0158] y' = [0, 0.333, 0.167, 0.5, 0.333, 0.667, 0.5, 0.833, 0.667, 1]
[0159] 4. Data Splitting Split the dataset into a training set and a validation set. Usually, 70 - 80% of the data is used as the training set, and the rest is used as the validation set. In this example, we use the first 8 data points as the training set and the last 2 data points as the validation set.
[0160] II. Data Stationarization
[0161] Perform a first - order difference to make the data stationary:
[0162] Δy' t = y' t - y' t-1
[0163] The differenced data is as follows:
[0164] Δy' = [0.333, -0.166, 0.333, -0.167, 0.334, -0.167, 0.333, -0.166]
[0165] III. Training the ARIMA Model Using Historical Data
[0166] 1. Plot the ACF and PACF diagrams: First, analyze the time - series data and plot its ACF and PACF diagrams.
[0167] 2. Observe the ACF diagram:
[0168] If the ACF plot shows significant truncation after a certain lag q, it may be an MA(q) model.
[0169] If the ACF plot shows slow decay, there may be an AR component.
[0170] 3. Observe the PACF plot:
[0171] If the PACF plot shows significant truncation after a certain lag p, it may be an AR(p) model.
[0172] If the PACF plot shows slow decay, there may be an MA component.
[0173] 4. Combine the ACF and PACF plots: Based on the observations of y, preliminarily determine the orders p and q of the AR and MA components.
[0174] 5. Model validation: Construct ARIMA models of different orders, use criteria such as AIC (Akaike Information Criterion), BIC (Bayesian Information Criterion) for model selection, and select the optimal model.
[0175] Assist in selecting the parameters p and q through the autocorrelation function (ACF) and partial autocorrelation function (PACF) plots.
[0176] The ACF and PACF plots are as Figure 1 shown. Among them, (a) is the ACF plot and (b) is the PACF plot. ACF plot: It shows a significant positive correlation at lag 1, and the autocorrelation values at the remaining lags decay rapidly to near zero. This indicates that the MA(1) model is appropriate, so q = 1.
[0177] PACF plot: It shows a significant positive correlation at lag 1, and the partial autocorrelation values at the remaining lags decay rapidly to near zero. This indicates that the AR(1) model is appropriate, so p = 1.
[0178] The parameters selected through analysis are:
[0179] p = 1
[0180] d = 1
[0181] q = 1
[0182] Automatically learn the non-linear features of time series through time embedding, multi-head attention mechanism and long-term dependence capture. Without manually selecting the differencing order or other parameters, the model combines time-related features for multi-task learning.
[0183] 6. Model parameter calculation
[0184] Fit the data, and the model form is:
[0185] y t = c + ε t + φ1y t-1 + θ1ε t-1
[0186] There is the following normalized historical data as training data:
[0187] y = [0, 0.333, 0.167, 0.5, 0.333, 0.667, 0.5, 0.833]
[0188] Assume the initial parameters are:
[0189] · c = 0.05 θ1 = 0.4
[0190] · φ1 = 0.6
[0191] · θ1 = 0.4
[0192] · White noise ε t is initialized to zero
[0193] By iteratively calculating the error terms and updating the parameters, the converged parameter values are finally obtained. The specific calculations are as follows:
[0194] The first iteration (assuming the initial white noise is zero):
[0195] 1. Calculate the first error term: ε1 = y1 - c = 0.333 - 0.05 = 0.283
[0196] 2. Calculate the second error term: ε2 = y2 - c - φ1y1 - θ1ε1 = 0.167 - 0.05 - 0.6 ·
[0197] 0.333 - 0.4 · 0.283 = -0.1172
[0198] 3. Repeat the above calculations to obtain all error terms: ε = [0.283, -0.1172,...]
[0199] 4. Update the parameters:
[0200] c = c + Δc
[0201] φ1 = φ1 + Δφ1
[0202] θ1 = θ1 + Δθ1
[0203] 5. Judge convergence. If the change in the log-likelihood function value is very small, stop the iteration.
[0204] Through multiple iterations, the finally obtained parameter estimation values are:
[0205] · Constant term c = 0.05
[0206] · Autoregressive coefficient φ1 = 0.6
[0207] · Moving average coefficient θ1 = 0.4
[0208] · White noise ε t
[0209] IV. Training the TFT model using historical data
[0210] Data preparation: Extract statistical features, timestamp features, and periodic features from historical simulation data, and combine them into a feature vector as the input to the TFT model. An example of constructing the timestamp feature is as follows:
[0211] For the 2nd hour of the 1st day of the 3rd week, the timestamp feature is:
[0212] x_time(t) = [h(t), d(t), w(t)]
[0213] h(t): Hour feature, h(t) = [sin(2π·2 / 24), cos(2π·2 / 24)]
[0214] d(t): Day feature, d(t) = [sin(2π·1 / 7), cos(2π·1 / 7)]
[0215] w(t): Week feature, w(t) = [sin(2π·3 / 52), cos(2π·3 / 52)]
[0216] Construct the TFT model. The core parameters of the model are:
[0217] Variable selection network
[0218] Input dimension: Sequence length × 6 (number of time features)
[0219] Hidden dimension: 16
[0220] Attention mechanism
[0221] Number of attention heads: 4
[0222] Hidden dimension: 32
[0223] Number of layers: 3
[0224] Output layer
[0225] Output dimension: 1 (predicted value)
[0226] Model training
[0227] Loss function:
[0228] Optimizer: Adam
[0229] Initial learning rate: 0.001
[0230] Learning rate decay: Halve when the validation loss does not improve for 5 epochs
[0231] Batch size: 64
[0232] Early stopping: Stop when the validation loss does not improve for 10 epochs
[0233] V. Apply the trained model to the multi - cycle simulation system and use the dynamic weighting algorithm to achieve real - time prediction of the output data of the slow - cycle model.
[0234] When t = 100 seconds, the data of the last 4 slow - cycle simulation modules are as follows:
[0235] t = 85 seconds: y(85)=100
[0236] t = 90 seconds: y(90)=105
[0237] t = 95 seconds: y(95)=102
[0238] t = 100 seconds: y(100)=108
[0239] The current predicted values obtained using the ARIMA model trained in step 3 are:
[0240] Y’_ARIMA(101)=108.8
[0241] Y’_ARIMA(102)=109.5
[0242] Y’_ARIMA(103)=110.2
[0243] Y’_ARIMA(104)=110.7
[0244] Y’_ARIMA(105)=111.1
[0245] The current predicted values obtained using the TFT model trained in step 4 are:
[0246] Y’_TFT(101)=109.2
[0247] Y’_TFT(102)=110.1
[0248] Y’_TFT(103) = 110.8
[0249] Y’_TFT(104) = 111.3
[0250] Y’_TFT(105) = 111.7
[0251] Perform STL decomposition on the true value of the slow cycle simulation module at t = 100, and obtain:
[0252] yr(100) = 108 (true value)
[0253] Tr(100) = 106 (trend term decomposition value)
[0254] Sr(100) = 1.5 (seasonal term decomposition value)
[0255] R(100) = 0.5 (residual term decomposition value)
[0256] Perform STL decomposition on the prediction result of the ARIMA model at t = 100, and obtain Y’_ARIMA(100) = 107.5 (ARIMA predicted value)
[0257] Tr_ARIMA(100) = 105.8 (trend term decomposition value)
[0258] Sr_ARIMA(100) = 1.3 (seasonal term decomposition value)
[0259] R_ARIMA(100) = 0.4 (residual term decomposition value)
[0260] Perform STL decomposition on the prediction result of the TFT model at t = 100, and obtain
[0261] Y’_TFT(100) = 108.2 (TFT predicted value)
[0262] Tr_TFT(100) = 106.1 (trend term decomposition value)
[0263] Sr_TFT(100) = 1.6 (seasonal term decomposition value)
[0264] R_TFT(100) = 0.5 (residual term decomposition value)
[0265] Calculate the trend term MSE and seasonal term MSE predicted by the ARIMA model and the TFT model respectively: MSE_Tr,ARIMA = 0.04
[0266] MSE_Sr,ARIMA = 0.04
[0267] MSE_Tr,TFT = 0.01
[0268] MSE_Sr,TFT = 0.01
[0269] Calculate the dynamic weight value:
[0270] W_ARIMA = 0.02 / (0.08 + 0.02) = 0.2
[0271] W_TFT = 1 - 0.2 = 0.8
[0272] Calculate the final predicted value:
[0273] Y’(101) = 0.2 × 108.8 + 0.8 × 109.2 = 109.12
[0274] Y’(102) = 0.2 × 109.5 + 0.8 × 110.1 = 109.98
[0275] Y’(103) = 0.2 × 110.2 + 0.8 × 110.8 = 110.68
[0276] Y’(104) = 0.2 × 110.7 + 0.8 × 111.3 = 111.18
[0277] Y’(105) = 0.2 × 111.1 + 0.8 × 111.7 = 111.58
[0278] Transfer of predicted values
[0279] At times t = 101 to t = 104, sequentially transfer Y’(101) to Y’(104) to the fast cycle module.
[0280] At time t = 105 (the next slow cycle), repeat the entire prediction process.
[0281] The parts not detailed in the present invention belong to the common general knowledge of those skilled in the art.
Claims
1. A high-precision simulation data interpolation method for multi-cycle simulation testing, characterized in that The steps of the method include: Step 1: Collect historical data of relevant simulation modules, including timestamps and simulation module output value data; Step 2: preprocess the historical data obtained in step 1, and perform stabilization on the preprocessed time series data; Step 3: Use the historical data processed in step 2 to train the ARIMA model; Step 4: Use the historical data processed in step 2 to train the TFT model; Step 5: Apply the trained ARIMA model and TFT model to the multi-period simulation system, and use the dynamic weighting algorithm to achieve real-time prediction of the slow-period model output data.
2. A high-precision simulation data interpolation method for multi-cycle simulation testing according to claim 1, characterized in that: The historical data includes ambient temperature, humidity, pressure data, speed data, and user input data, wherein the user input data includes simulation parameter settings, control commands, and adjustment instructions.
3. The high-precision simulation data interpolation method for multi-cycle simulation testing according to claim 1, characterized in that: In step 2, the process of preprocessing the data is as follows: 2.1 Clean the data to remove noise and outliers; 2.2 Normalize the data processed in 2.1 so that its value is between 0 and 1; 2.3 Use 70-80% of the processed data as the training set and the rest as the validation set.
4. The high-precision simulation data interpolation method for multi-cycle simulation testing according to claim 1, characterized in that: The difference processing method is used to stabilize the time series data. The method is as follows: For the original time series data y′ t Perform a difference to obtain the differenced sequence Δy′ t : Δy′ t =y′ t -y′ t-1 ; If the data is still not stable after the first difference, perform a second or multiple differences until the data becomes stable.
5. The high-precision simulation data interpolation method for multi-cycle simulation testing according to claim 1, characterized in that: The implementation of step three is as follows: Analyze the time series data and draw the autocorrelation function ACF and partial autocorrelation function PACF diagram of the time series data; The autocorrelation function ACF diagram and the partial autocorrelation function PACF diagram are used to determine the number of autoregressive terms p, the number of difference times d, and the number of moving average terms q of the ARIMA model; By iteratively calculating the error term, the converged ARIMA model parameters are obtained.
6. The high-precision simulation data interpolation method for multi-cycle simulation testing according to claim 1, characterized in that: The implementation of step 4 is as follows: 4.1 Extract statistical features, timestamp features, and period features from historical data and merge them into feature vectors as input for the TFT model; 4.2 Set the input dimension, hidden dimension, number of attention heads, number of layers, and output dimension of the TFT model; 4.3 Set hyperparameters for the TFT model, including loss function, initial learning rate, learning decay rate, batch size, and early stopping conditions; 4.4 Use Adam optimizer to train the TFT model.
7. A high-precision simulation data interpolation method for multi-cycle simulation testing according to claim 6, characterized in that: The timestamp feature at time t is x_time(t) = [h(t), d(t), w(t)], where h(t) is the hour feature, d(t) is the day feature, and w(t) is the week feature.
8. The high-precision simulation data interpolation method for multi-cycle simulation testing according to claim 1, characterized in that: In the step 2, the preprocessed data is split into a training set and a validation set. In steps 3 and 4, the model is trained using the training set, and the trained model is validated using the validation set.
9. The high-precision simulation data interpolation method for multi-cycle simulation testing according to claim 1, characterized in that: The implementation of step five is as follows: 5.1 At time t, collect the output data of the slow cycle simulation module in the past m cycles: y(t-mnT),y(t-(m-1)nT),...,y(t) Wherein, T is the fast cycle, i.e., the calculation cycle of the fast cycle simulation module; n is the ratio of the slow and fast cycles, which is a positive integer; y(t) is the output data at time t; 5.2 Use the trained ARIMA model to predict the output value of the slow cycle simulation module at the next n fast cycle moments: Use the trained TFT model to predict the output value of the slow cycle simulation module at the next n fast cycle moments: k′ is the fast cycle counting variable; 5.3 Calculate the dynamic weight as follows: 5.3.1 Perform STL decomposition on historical data according to the following formula: y(t-knT)=Tr(t-knT)+Sr(t-knT)+R(t-knT),k=0,1,...,m Perform STL decomposition on the ARIMA forecast values: Perform STL decomposition on the TFT prediction value: in, y(t-knT) is the output data of k slow cycles before time t of the slow cycle simulation module, Tr(t-knT) is the trend term of historical data obtained by STL decomposition, Sr(t-knT) is the seasonal term of historical data obtained by STL decomposition, and R(t-knT) is the residual term of historical data obtained by STL decomposition; is the forecast data of the ARIMA model in k slow cycles before time t, Tr ARIMA (t-knT) is the trend item of the ARIMA model prediction data obtained by STL decomposition, Sr ARIMA (t-knT) is the seasonal term of the ARIMA model forecast data obtained by STL decomposition, R ARIMA (t-knT) is the residual term of the ARIMA model forecast data obtained by STL decomposition; is the prediction data of k slow cycles before time t by the TFT model, Tr TFT (t-knT) is the trend item of the TFT model prediction data obtained by STL decomposition, Sr TFT (t-knT) is the seasonal term of the TFT model prediction data obtained by STL decomposition, R TFT (t-knT) is the residual term of the TFT model prediction data obtained by STL decomposition; 5.3.2 Calculate the mean square error (MSE) of the ARIMA model forecasting data trend item based on the decomposition results Tr,ARIMA , mean square error MSE of seasonal terms of ARIMA model forecast data Sr,ARIMA , Mean square error MSE of the trend term of the TFT model prediction data Tr,TFT , Mean square error MSE of seasonal terms of TFT model prediction data Sr,TFT ; 5.3.3 Using the mean square error of the trend term and seasonal term of the ARIMA model to calculate the dynamic weight W of the ARIMA model forecast data ARIMA , the dynamic weight W of the TFT model prediction data is calculated using the mean square error of the trend term and seasonal term of the TFT model prediction data TFT ; IN TFT =1-W ARIMA 5.4 Use the following formula to perform weighted fusion on the predicted values of the next n fast cycle moments to obtain the final predicted value at time t; 5.5 At time t+k′T, k′=1,2,...,n-1, the predicted value Passed to all fast-cycle simulation modules that need this output value as input value; 5.6 At each slow cycle simulation module output moment, repeat steps 5.3-5.5 to achieve continuous simulation.
10. The high-precision simulation data interpolation method for multi-cycle simulation testing according to claim 9, characterized in that: The implementation of step 5.3.2 is as follows: