Multi-scale fusion-based multivariate time series prediction model construction method
By adopting a multi-scale fusion model construction method in multivariate time series data prediction, the problem of failure to fully utilize time and frequency domain information in the prior art is solved, and higher prediction accuracy is achieved.
Patent Information
- Application Number
- CN202411430489.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-14
AI Technical Summary
The existing deep learning methods have not fully integrated and utilized time and frequency domain information in multivariate time series data prediction, and are limited to modeling at a single scale, which affects the prediction accuracy.
The multivariate time series prediction model construction method based on multi-scale fusion includes dual-sampling time-frequency extraction module, multi-scale time-frequency mining module, fusion module and prediction module. By downsampling and segmented sampling of multivariate time series data, it obtains Multi-scale time and frequency domain features, and feature fusion processing is performed to improve prediction accuracy.
Through multi-scale fusion processing, the time and frequency domain information of multi-time series data can be used more effectively, improving the prediction accuracy of multi-time series data.
Smart Images

Figure CN119442131A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data prediction, specifically to a multivariate time series data prediction technology in the field of data prediction, and more specifically to a technology for predicting multivariate time series data based on deep learning, namely, a method for constructing a multivariate time series prediction model based on multi-scale fusion. Background Art
[0002] Multivariate time series data forecasting technology is a key data analysis method that focuses on analyzing multiple time series variables at the same time. This data forecasting technology can be applied to different fields, such as transportation, energy, economy, environment, meteorology, etc. Through multivariate time series data forecasting, researchers can deeply understand and reveal the interactions and dependencies between these variables, so as to more comprehensively grasp the dynamic changes of complex systems. In addition, multivariate time series data forecasting can also provide information about the future trends of multiple variables, thus providing valuable help and reference for decision making.
[0003] Mainstream multivariate time series data prediction technologies can be divided into statistical methods, machine learning methods, and deep learning methods. Statistical methods use formal mathematical models to solidify the modeling process of multivariate time series into a series of prior knowledge, thereby realizing multivariate time series data prediction. However, statistical methods are mainly applicable to stationary multivariate time series data with regular changes. When faced with non-stationary multivariate time series data, it is difficult to fully analyze its data transformation trend, and thus it is impossible to predict non-stationary multivariate time series data.
[0004] Machine learning methods, such as support vector machines and decision trees, usually use nonlinear modeling to improve the model's ability to model historical observations and future changes in time series data, thereby achieving multivariate time series data prediction. However, the model constructed by the machine learning method can only predict univariate time series data, and cannot analyze the correlation between multivariate time series data, and performs poorly in the multivariate time series data prediction task.
[0005] Compared with the above two methods, deep learning methods have attracted widespread attention due to their excellent nonlinear modeling capabilities and deep analysis of spatial relationships. Classic models in deep learning, such as recursive neural networks and convolutional neural networks, effectively mine the spatiotemporal dependencies of multivariate time series data through serialization modeling and convolution techniques, respectively, thereby achieving multivariate time series data prediction. In addition, with the increase in computing resources, spatiotemporal graph neural networks and Transformer models based on attention mechanisms have further optimized the processing of contextual information and the simulation of spatial relationships, improving the prediction performance of multivariate time series data.
[0006] Although existing deep learning methods have made significant progress in multivariate time series data prediction tasks with their excellent nonlinear modeling capabilities, they still have two shortcomings. On the one hand, these methods fail to fully integrate and utilize the time domain and frequency domain information of multivariate time series data, which poses an obstacle to the accurate prediction of multivariate time series data. On the other hand, most existing deep learning methods are limited to modeling and utilizing time domain and frequency domain information at a single scale, ignoring time domain information and frequency domain information at different scales, thus affecting the prediction accuracy of multivariate time series data. Summary of the invention
[0007] Therefore, the purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a method for constructing a multivariate time series prediction model based on multi-scale fusion, a multivariate time series prediction model, and a multivariate time series data prediction method.
[0008] The objectives of the present invention are achieved through the following technical solutions.
[0009] According to a first aspect of the present invention, a method for constructing a multivariate time series prediction model based on multiscale fusion is provided, the method comprising: step S1, obtaining a training data set, the training data set comprising multivariate time series data of multiple preset time periods; step S2, constructing an initial model, the initial model comprising a dual-sampling time-frequency extraction module, a multi-scale time-frequency mining module, a fusion module and a prediction module, wherein: the dual-sampling time-frequency extraction module is used to downsample and segment the multivariate time series data respectively to obtain first sampling sequence data and second sampling sequence data, and perform frequency domain transformation respectively to obtain first sampling sequence frequency domain data and second sampling sequence frequency domain data; the multi-scale time-frequency mining module is used to encode the first sampling sequence data, the second sampling sequence data, the first sampling sequence frequency domain data and the second sampling sequence frequency domain data corresponding to the multivariate time series data to obtain the time domain features and The frequency domain features of the first sampling sequence frequency domain data and the second sampling sequence frequency domain data; the fusion module is used to perform feature fusion processing on the time domain features of the first sampling sequence data and the frequency domain features of the first sampling sequence frequency domain data corresponding to the multivariate time series data to obtain the first time-frequency domain features, and perform feature fusion processing on the time domain features of the second sampling sequence data and the frequency domain features of the second sampling sequence frequency domain data corresponding to the multivariate time series data to obtain the second time-frequency domain features; the prediction module is used to perform fusion processing on the first time-frequency domain features and the second time-frequency domain features corresponding to the multivariate time series data to predict the multivariate time series data in the next time period corresponding to the preset time period of the multivariate time series data; step S3, taking the multivariate time series data as input and the multivariate time series data of the next time period of the multivariate time series data as prediction output, using the training data set to train the initial model based on the preset loss function until convergence, to obtain the multivariate time series prediction model.
[0010] In some embodiments of the present invention, the multivariate time series data includes multiple historical moments with consecutive moments, and each historical moment corresponds to multiple observation data, and the dual sampling time-frequency extraction module is configured to downsample the multivariate time series data in the following manner: the multivariate time series data is sampled multiple times with a preset value as the sampling interval to obtain multiple downsampled subsequence data corresponding to the preset value, and the multiple downsampled subsequence data are spliced to obtain the first sampling sequence data; wherein each downsampled subsequence data includes multiple historical moments with discrete moments, and the time length of the historical moments contained in each downsampled subsequence data is consistent.
[0011] In some embodiments of the present invention, the dual sampling time-frequency extraction module is configured to perform segmented sampling on the multivariate time series data in the following manner: the multivariate time series data is sampled multiple times with a preset value as the segmentation interval to obtain multiple segmented sampling sub-sequence data corresponding to the preset value, and the multiple segmented sampling sub-sequence data are spliced to obtain a second sampling sequence data; wherein each segmented sampling sub-sequence data includes multiple historical moments that are consecutive in time, and the time length of the historical moments contained in each segmented sampling sub-sequence data is consistent.
[0012] In some embodiments of the present invention, the multi-scale time-frequency mining module includes a time domain coding unit and a frequency domain coding unit, wherein: the time domain coding unit is used to encode the first sampling sequence data and the second sampling sequence data corresponding to the multivariate time series data to obtain the time domain characteristics of the first sampling sequence data and the second sampling sequence data; the frequency domain coding unit is used to encode the first sampling sequence frequency domain data and the second sampling sequence frequency domain data corresponding to the multivariate time series data based on the self-attention mechanism to obtain the frequency domain characteristics of the first sampling sequence frequency domain data and the second sampling sequence frequency domain data.
[0013] In some embodiments of the present invention, the fusion module is configured to perform feature fusion processing on the time domain features of the first sampling sequence data corresponding to the multivariate time series data and the frequency domain features of the first sampling sequence frequency domain data based on the cross-attention mechanism to obtain first time-frequency domain features, and to perform feature fusion processing on the time domain features of the second sampling sequence data corresponding to the multivariate time series data and the frequency domain features of the second sampling sequence frequency domain data to obtain second time-frequency domain features.
[0014] In some embodiments of the present invention, the preset loss function is:
[0015] in, represents the total loss, represents the loss between the multivariate time series data in the next time period of the preset time period corresponding to the multivariate time series data and the predicted output corresponding to the multivariate time series data, represents the first contrast loss, Denotes the second contrast loss.
[0016] According to a second aspect of the present invention, a multivariate time series prediction model is provided, the model comprising: a dual sampling time-frequency extraction module, for down-sampling and segmented sampling of multivariate time series data respectively to obtain first sampling sequence data and second sampling sequence data, and performing frequency domain transformation respectively to obtain first sampling sequence frequency domain data and second sampling sequence frequency domain data; a multi-scale time-frequency mining module, for encoding the first sampling sequence data, the second sampling sequence data, the first sampling sequence frequency domain data and the second sampling sequence frequency domain data corresponding to the multivariate time series data to obtain the time domain features of the first sampling sequence data and the second sampling sequence data and the first sampling sequence frequency domain data; The fusion module is used to perform feature fusion processing on the time domain features of the first sampling sequence data and the frequency domain features of the first sampling sequence frequency domain data corresponding to the multivariate time series data to obtain the first time-frequency domain features, and to perform feature fusion processing on the time domain features of the second sampling sequence data and the frequency domain features of the second sampling sequence frequency domain data corresponding to the multivariate time series data to obtain the second time-frequency domain features; the prediction module is used to perform fusion processing on the first time-frequency domain features and the second time-frequency domain features corresponding to the multivariate time series data to predict the multivariate time series data in the next time period corresponding to the preset time period of the multivariate time series data.
[0017] According to the third aspect of the present invention, a multivariate time series data prediction method is provided, the method comprising: step T1, obtaining the multivariate time series data to be predicted; step T2, using the multivariate time series prediction model as described in the second aspect of the present invention to predict the multivariate time series data to be predicted.
[0018] Compared with the prior art, the advantages of the present invention are: (1) a dual sampling time-frequency extraction module is provided to obtain the multi-scale form of multivariate time series data, so as to obtain the time domain form and frequency domain form of multivariate time series data at different scales; (2) a multi-scale time-frequency mining module is provided to obtain the time domain information and frequency domain information of multivariate time series data at different scales; (3) a fusion module is provided to fuse the time domain information and frequency domain information of multivariate time series data at different scales to obtain the time-frequency domain fusion features at different scales, so as to predict the multivariate time series data based on the time-frequency domain fusion features at different scales, thereby improving the prediction accuracy of the multivariate time series data. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The embodiments of the present invention are further described below with reference to the accompanying drawings, in which: Figure 1 A schematic diagram of a method for constructing a multivariate time series prediction model according to an embodiment of the present invention; Figure 2 Schematic diagram of initial model composition according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0021] As mentioned in the background technology section, although existing deep learning methods have made significant progress in multivariate time series data prediction tasks with their excellent nonlinear modeling capabilities and deep analysis of spatial relationships, they still have two shortcomings. On the one hand, these methods fail to fully integrate and utilize the time domain and frequency domain information of multivariate time series data, which poses an obstacle to the accurate prediction of multivariate time series data. On the other hand, most existing deep learning methods are limited to modeling and utilizing time domain and frequency domain information at a single scale, ignoring time domain information and frequency domain information at different scales, thus affecting the prediction accuracy of multivariate time series data.
[0022] In order to solve the above problems, the inventors analyzed the existing technologies and found that the existing technologies are not sufficient for mining the time domain information and frequency domain information at multiple scales of time series. In order to make full use of the time domain information and frequency domain information at different scales and improve the prediction accuracy of multivariate time series data, the inventors proposed a new prediction model construction scheme, in which the prediction model sets a double sampling time-frequency extraction module to obtain the multi-scale form of multivariate time series data; also sets a multi-scale time-frequency mining module to obtain the time domain information and frequency domain information of multivariate time series data at different scales; and also sets a fusion module to fuse the time domain information and frequency domain information of multivariate time series data at different scales to obtain the time-frequency domain fusion features at different scales, so as to predict the multivariate time series data based on the time-frequency domain fusion features at different scales, thereby improving the prediction accuracy of the multivariate time series data.
[0023] In summary, if Figure 1 As shown, the present invention provides a method for constructing a multivariate time series prediction model based on multiscale fusion, the method comprising: step S1, obtaining a training data set, the training data set comprising multivariate time series data of multiple preset time periods; step S2, constructing an initial model, which comprises a dual sampling time-frequency extraction module, a multiscale time-frequency mining module, a fusion module and a prediction module; step S3, taking the multivariate time series data as input, the multivariate time series data of the next time period of the multivariate time series data as prediction output, using the training data set to train the initial model based on a preset loss function until convergence, and obtaining a multivariate time series prediction model.
[0024] In order to better understand the present invention, each step is described in detail below in conjunction with specific embodiments.
[0025] 1. Step S1
[0026] The step S1 is used to obtain training data, and the training data includes multivariate time series data of multiple preset time periods, wherein each multivariate time series data includes multiple historical moments with consecutive moments, and each historical moment corresponds to multiple observation data. Specifically, the multivariate time series data of each preset time period includes multiple time series with the same time length, and each time series is the monitoring value of the same variable at different historical moments in the same time period. For example, a multivariate time series data representing the meteorological changes of a certain city, wherein one time series data represents the change of the temperature of the city over time, one time series data represents the change of the humidity of the city over time, and one time series data represents the change of the wind speed of the city over time, etc.
[0027] Step S2
[0028] The step S2 is used to construct an initial model, such as Figure 2 As shown, the initial model includes a dual sampling time-frequency extraction module, a multi-scale time-frequency mining module, a fusion module and a prediction module. Each module is described in detail below.
[0029] 2.1 Dual sampling time-frequency extraction module
[0030] The dual sampling time-frequency extraction module is used to perform down sampling and segmented sampling on the multivariate time series data to obtain the first sampling sequence data and the second sampling sequence data, and perform frequency domain transformation on the first sampling sequence frequency domain data and the second sampling sequence frequency domain data. It should be noted that the dual sampling time-frequency extraction module adopts the sampling method of down sampling and segmented sampling to obtain sequence data of different scales from the original multivariate time series data, and performs frequency domain transformation on the sequence data of different scales to obtain frequency domain data of sequence data of different scales. Through such a sampling method, four different tensors can be obtained, namely the first sampling sequence data, the second sampling sequence data, the first sampling sequence frequency domain data and the second sampling sequence frequency domain data, wherein the first sampling sequence data includes large-scale time domain information, the first sampling sequence frequency domain data includes large-scale frequency domain information, the second sampling sequence data includes small-scale time domain information, and the second sampling sequence frequency domain data includes small-scale frequency domain information.
[0031] According to one embodiment of the present invention, the dual sampling time-frequency extraction module is configured to downsample the multivariate time series data in the following manner: the multivariate time series data is sampled multiple times with a preset value as the sampling interval to obtain multiple downsampled subsequence data corresponding to the preset value, and the multiple downsampled subsequence data are spliced to obtain the first sampling sequence data; wherein each downsampled subsequence data includes multiple discrete historical moments, and the time length of the historical moments contained in each downsampled subsequence data is consistent. It should be noted that the downsampled subsequence data obtained by downsampling has a larger time scale than the original multivariate time series data, which enables the downsampled subsequence data to obtain more intuitive global information. It should also be noted that in order to avoid information loss caused by downsampling, multiple downsampled subsequence data need to be spliced together.
[0032] In order to better understand the downsampling process described in the above embodiment, a time series length is Multivariate time series data ( , represents the set of real numbers, represents the number of variables, The specific downsampling process includes: first, taking the preset value C as the sampling interval to sample the multivariate time series data. Perform multiple sampling to obtain C down-sampling subsequence data; then, splice the C down-sampling subsequence data to obtain the first sampling sequence data ( ). The down-sampled subsequence data obtained in the down-sampling process can be expressed as: ,in, Indicates downsampled subsequence data, Representing multivariate time series data Historical moments Data on (including time points Data corresponding to all variables above), Representing multivariate time series data Historical moments The data on Representing multivariate time series data Historical moments The data on Representing multivariate time series data Historical moments The data on.
[0033] According to one embodiment of the present invention, the dual sampling time-frequency extraction module is configured to perform segmented sampling on the multivariate time series data in the following manner: the multivariate time series data is sampled multiple times with a preset value as the segmentation interval to obtain multiple segmented sampling subsequence data corresponding to the preset value, and the multiple segmented sampling subsequence data are spliced to obtain the second sampling sequence data; wherein each segmented sampling subsequence data includes multiple historical moments with continuous moments, and the time length of the historical moments contained in each segmented sampling subsequence data is consistent. It should be noted that segmented sampling divides the original multivariate time series data into multiple continuous segmented sampling subsequence data with the same time length, and each segmented sampling subsequence data contains local information within a period of historical time. Unlike downsampling, segmented sampling focuses more attention on local information, which can reflect the details of local information changes within a period of time. It should also be noted that in order to avoid the information loss caused by segmented sampling, it is also necessary to splice multiple segmented sampling subsequence data together.
[0034] In order to better understand the segmented sampling process described in the above embodiment, a time series length is still Multivariate time series data Take as an example to illustrate how to perform segmented sampling processing. The specific segmented sampling process includes: first, the multivariate time series data is segmented with the preset value C as the segment interval. Perform multiple sampling to obtain C segmented sampling subsequence data; then, splice the C segmented sampling subsequence data to obtain the second sampling sequence data ( ). The segmented sampling subsequence data obtained in the segmented sampling process can be expressed as: ,in, Indicates Segmented sampling subsequence data, Representing multivariate time series data Historical moments The data on Representing multivariate time series data Historical moments The data on Representing multivariate time series data Historical moments The data on.
[0035] After downsampling and segmented sampling are respectively performed on the multivariate time series data based on the sampling method described in the above embodiment, the obtained first sampling sequence data and the second sampling sequence data need to be transformed in the frequency domain to obtain their respective corresponding frequency domain forms. In the present invention, the frequency domain forms of the first sampling sequence data and the second sampling sequence data are obtained by Fourier transform. and the second sampling sequence data Take the example to explain how to perform frequency domain transformation. The specific frequency domain transformation process is as follows:
[0036]
[0037] in, represents the frequency domain data of the first sampling sequence, represents the frequency domain data of the second sampling sequence, represents the activation function, represents the fully connected layer, stands for Fast Fourier Transform.
[0038] 2.2 Multi-scale time-frequency mining module
[0039] The multi-scale time-frequency mining module is used to encode the first sampling sequence data, the second sampling sequence data, the first sampling sequence frequency domain data and the second sampling sequence frequency domain data corresponding to the multivariate time series data to obtain the time domain features of the first sampling sequence data and the second sampling sequence data and the frequency domain features of the first sampling sequence frequency domain data and the second sampling sequence frequency domain data. It should be noted that the main function of the multi-scale time-frequency mining module is to mine the time domain information and frequency domain information at small scales and large scales from the first sampling sequence data, the second sampling sequence data, the first sampling sequence frequency domain data and the second sampling sequence frequency domain data extracted by the dual sampling time-frequency extraction module.
[0040] According to one embodiment of the present invention, the multi-scale time-frequency mining module includes a time domain coding unit and a frequency domain coding unit, wherein: the time domain coding unit is used to encode the first sampling sequence data and the second sampling sequence data corresponding to the multivariate time series data to obtain the time domain characteristics of the first sampling sequence data and the second sampling sequence data; the frequency domain coding unit is used to encode the first sampling sequence frequency domain data and the second sampling sequence frequency domain data corresponding to the multivariate time series data based on the self-attention mechanism to obtain the frequency domain characteristics of the first sampling sequence frequency domain data and the second sampling sequence frequency domain data.
[0041] Take the multivariate time series data shown in the previous example The corresponding first sampling sequence data , the second sampling sequence data Take as an example to explain how the time domain coding unit performs coding processing. Specifically, for time domain information, a multi-layer perceptron is used as the time domain coding unit for coding processing. The coding process is expressed as follows:
[0042]
[0043] in, Indicates the first sampling sequence data The time domain characteristics of Represents the time domain characteristics of the second sampling sequence data.
[0044] Take the multivariate time series data shown in the previous example The corresponding first sampling sequence frequency domain data and the second sampling sequence frequency domain data Take as an example to illustrate how the frequency domain coding unit performs coding processing. Specifically, for frequency domain information, the frequency domain coding unit performs coding processing based on the self-attention mechanism, and the coding process is expressed as follows:
[0045]
[0046] in, Represents the frequency domain data of the first sampling sequence The frequency domain characteristics of Represents the frequency domain data of the second sampling sequence The frequency domain characteristics of Standardization of presentation layer, represents the activation function, represents the first weight, represents the second weight, represents the third weight, Indicates transpose.
[0047] 2.3 Fusion Module
[0048] The fusion module is used to perform feature fusion processing on the time domain features of the first sampling sequence data corresponding to the multivariate time series data and the frequency domain features of the first sampling sequence frequency domain data to obtain first time-frequency domain features, and to perform feature fusion processing on the time domain features of the second sampling sequence data corresponding to the multivariate time series data and the frequency domain features of the second sampling sequence frequency domain data to obtain second time-frequency domain features.
[0049] According to one embodiment of the present invention, the fusion module is configured to perform feature fusion processing on the time domain features of the first sampling sequence data corresponding to the multivariate time series data and the frequency domain features of the first sampling sequence frequency domain data based on the cross-attention mechanism to obtain the first time-frequency domain features, and to perform feature fusion processing on the time domain features of the second sampling sequence data corresponding to the multivariate time series data and the frequency domain features of the second sampling sequence frequency domain data to obtain the second time-frequency domain features.
[0050] Take the multivariate time series data shown in the previous example The corresponding time domain characteristics of the first sampling sequence data , the frequency domain characteristics of the first sampling sequence frequency domain data , the time domain characteristics of the second sampling sequence data and the frequency domain characteristics of the frequency domain data of the second sampling sequence Take as an example to illustrate how the fusion module performs fusion processing. Specifically, in the fusion process, the cross attention mechanism is used to achieve the fusion of time-frequency information. The fusion process is shown as follows:
[0051]
[0052] in, Representing multivariate time series data The corresponding first time-frequency domain feature, Representing multivariate time series data The corresponding second time-frequency domain features.
[0053] It should be noted that after the fusion module fuses the time-frequency information based on the cross-attention mechanism, time-frequency domain features of different scales can be obtained. For example, the multivariate time series data shown in the above example The corresponding first time-frequency domain feature For large-scale features, multivariate time series data The corresponding second time-frequency domain feature It is a feature at a small scale.
[0054] 2.4 Prediction Module
[0055] The prediction module is used to fuse the first time-frequency domain features and the second time-frequency domain features corresponding to the multivariate time series data to predict the multivariate time series data in the next time period of the preset time period corresponding to the multivariate time series data. It should be noted that the prediction module realizes the fusion of multi-scale information based on the cross-attention mechanism and the multi-layer perceptron to obtain the prediction result. Taking the multivariate time series data shown in the above example as an example The corresponding first time-frequency domain feature and the second time-frequency domain feature For example, the prediction process is as follows:
[0056] in, Representing multivariate time series data The corresponding multivariate time series data in the next time period.
[0057] Step S3
[0058] The step S3 is used to train the initial model. During the training process, the multivariate time series data is used as input, and the multivariate time series data of the next time period of the multivariate time series data is used as the prediction output. The training data set is used to train the initial model based on a preset loss function until convergence to obtain a multivariate time series prediction model.
[0059] According to one embodiment of the present invention, the preset loss function is:
[0060] in, represents the total loss, represents the loss between the multivariate time series data in the next time period of the preset time period corresponding to the multivariate time series data and the predicted output corresponding to the multivariate time series data, represents the first contrast loss, Denotes the second contrast loss.
[0061] In order to better understand the training process of the initial model, the calculation process of the prediction loss and the contrast loss is introduced below.
[0062] The prediction loss is obtained by calculating the L1 loss between the prediction output corresponding to the multivariate time series data and the multivariate time series data in the next time period of the preset time period corresponding to the multivariate time series data. The specific expression is as follows:
[0063] in, represents the mean function, Represents the multivariate time series data in the next time period corresponding to the preset time period. Represents the forecast output corresponding to multivariate time series data.
[0064] For the first contrast loss and the second contrast loss, the calculation principles of the two contrast losses are the same. The difference is that the first contrast loss is calculated based on the time domain characteristics of the first sampling sequence data corresponding to multiple multivariate time series data and the frequency domain characteristics of the first sampling sequence frequency domain data, and the second contrast loss is calculated based on the time domain characteristics of the second sampling sequence data corresponding to multiple multivariate time series data and the frequency domain characteristics of the second sampling sequence frequency domain data.
[0065] In order to better understand the calculation process of contrast loss, the following describes how to calculate the first contrast loss based on the time domain characteristics of the first sampling sequence data corresponding to multiple multivariate time series data and the frequency domain characteristics of the first sampling sequence frequency domain data. It should be noted that the calculation principle of the second contrast loss is the same as that of the first contrast loss, so it will not be repeated here.
[0066] First, the time domain features of the first sampling sequence data and the frequency domain features of the first sampling sequence frequency domain data corresponding to each multivariate time series data are subjected to dimensionality reduction processing, which is specifically expressed as follows:
[0067]
[0068] in, represents the time domain characteristics of the first sampling sequence data after dimensionality reduction processing, Represents the frequency domain features of the first sampling sequence data after dimensionality reduction processing.
[0069] Then, the time domain features of the first sampling sequence data corresponding to the multiple different multivariate time series data obtained after the dimensionality reduction process and the frequency domain features of the first sampling sequence data are used as comparison samples to calculate the comparison loss, which is specifically expressed as follows:
[0070] in,
[0071] in, Indicates The comparison samples and The contrast loss between the comparison samples is Indicates A comparison sample, Indicates A comparison sample, Indicates A comparison sample, represents the logarithmic function, represents the exponential function, represents the cosine similarity function, represents the number of multivariate time series data, Represents the temperature parameter. It should be noted that by contrasting the learning loss, the semantic alignment of the time domain and frequency domain information can be effectively achieved, thereby effectively improving the prediction performance of the multivariate time series prediction model.
[0072] Based on the model building steps described in the aforementioned embodiments, the present invention also provides a model training device for training a multivariate time series prediction model, the device comprising: a data input module, a data preprocessing module, a hyperparameter setting module, a model storage module, a data storage module, a configuration information storage module, a model loading module and a user operation module, wherein: the data input module is used to receive multivariate time series data; the data preprocessing module is used to normalize the multivariate time series data; the hyperparameter setting module is used to adjust model hyperparameters such as learning rate, temperature coefficient, and embedding scale; the model storage module is used to store the trained multivariate time series prediction model; the data storage module is used to store the multivariate time series data; the configuration information storage module is used to store model-related configuration information; the model loading module is used to read the trained multivariate time series prediction model from the model storage module; the user operation module is used to provide a visual processing interface to enable users to train the multivariate time series prediction model based on model training requirements.
[0073] Based on the model building steps described in the aforementioned embodiments, according to one embodiment of the present invention, the present invention further provides a multivariate time series prediction model, the model comprising: a dual sampling time-frequency extraction module, for down-sampling and segmented sampling of the multivariate time series data respectively to obtain first sampling sequence data and second sampling sequence data, and performing frequency domain transformation respectively to obtain first sampling sequence frequency domain data and second sampling sequence frequency domain data; a multi-scale time-frequency mining module, for encoding the first sampling sequence data, the second sampling sequence data, the first sampling sequence frequency domain data and the second sampling sequence frequency domain data corresponding to the multivariate time series data to obtain time domain characteristics of the first sampling sequence data and the second sampling sequence data. The fusion module is used to perform feature fusion processing on the time domain features of the first sampling sequence data and the frequency domain features of the first sampling sequence frequency domain data corresponding to the multivariate time series data to obtain the first time-frequency domain features, and to perform feature fusion processing on the time domain features of the second sampling sequence data and the frequency domain features of the second sampling sequence frequency domain data corresponding to the multivariate time series data to obtain the second time-frequency domain features; the prediction module is used to perform fusion processing on the first time-frequency domain features and the second time-frequency domain features corresponding to the multivariate time series data to predict the multivariate time series data in the next time period corresponding to the preset time period of the multivariate time series data.
[0074] Furthermore, the present invention also proposes a multivariate time series data prediction method, which includes: step T1, obtaining the multivariate time series data to be predicted; step T2, using the multivariate time series prediction model described in the above embodiment to predict the multivariate time series data to be predicted.
[0075] The beneficial effects of the present invention are: (1) a dual sampling time-frequency extraction module is provided to obtain the multi-scale form of multivariate time series data, so as to obtain the time domain form and frequency domain form of multivariate time series data at different scales; (2) a multi-scale time-frequency mining module is provided to obtain the time domain information and frequency domain information of multivariate time series data at different scales; (3) a fusion module is provided to fuse the time domain information and frequency domain information of multivariate time series data at different scales to obtain the time-frequency domain fusion features at different scales, so as to predict the multivariate time series data based on the time-frequency domain fusion features at different scales, thereby improving the prediction accuracy of the multivariate time series data.
[0076] It should be noted that although the above describes the various steps in a specific order, it does not mean that the various steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order as long as the required functions can be achieved.
[0077] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0078] A computer-readable storage medium may be a tangible device that holds and stores instructions used by an instruction execution device. Computer-readable storage media may include, for example, but are not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof.
[0079] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for constructing a multivariate time series prediction model based on multi-scale fusion, characterized in that: The method comprises: Step S1, obtaining a training data set, wherein the training data set includes multivariate time series data of multiple preset time periods; Step S2: construct an initial model, which includes a dual sampling time-frequency extraction module, a multi-scale time-frequency mining module, a fusion module and a prediction module, wherein: The dual sampling time-frequency extraction module is used to perform down-sampling and segmented sampling on the multivariate time series data to obtain first sampling sequence data and second sampling sequence data, and perform frequency domain transformation to obtain first sampling sequence frequency domain data and second sampling sequence frequency domain data respectively; The multi-scale time-frequency mining module is used to encode the first sampling sequence data, the second sampling sequence data, the first sampling sequence frequency domain data and the second sampling sequence frequency domain data corresponding to the multivariate time series data to obtain the time domain features of the first sampling sequence data and the second sampling sequence data and the frequency domain features of the first sampling sequence frequency domain data and the second sampling sequence frequency domain data; The fusion module is used to perform feature fusion processing on the time domain features of the first sampling sequence data corresponding to the multivariate time series data and the frequency domain features of the first sampling sequence frequency domain data to obtain the first time-frequency domain features, and to perform feature fusion processing on the time domain features of the second sampling sequence data corresponding to the multivariate time series data and the frequency domain features of the second sampling sequence frequency domain data to obtain the second time-frequency domain features; The prediction module is used to fuse the first time-frequency domain feature and the second time-frequency domain feature corresponding to the multivariate time series data to predict the multivariate time series data in the next time period corresponding to the preset time period of the multivariate time series data; Step S3, using the multivariate time series data as input, and the multivariate time series data of the next time period of the multivariate time series data as the prediction output, using the training data set to train the initial model based on the preset loss function until convergence, to obtain a multivariate time series prediction model.
2. The method according to claim 1, characterized in that The multivariate time series data includes a plurality of historical moments that are continuous in time, and each historical moment corresponds to a plurality of observation data. The dual sampling time-frequency extraction module is configured to downsample the multivariate time series data in the following manner: The multivariate time series data is sampled multiple times with a preset value as a sampling interval to obtain multiple down-sampled sub-sequence data corresponding to the preset value, and the multiple down-sampled sub-sequence data are spliced to obtain the first sampling sequence data; wherein each down-sampled sub-sequence data includes multiple discrete historical moments, and the time length of the historical moments contained in each down-sampled sub-sequence data is consistent.
3. The method according to claim 2, characterized in that The dual sampling time-frequency extraction module is configured to perform segmented sampling on the multivariate time series data in the following manner: The multivariate time series data is sampled multiple times with a preset value as a segmentation interval to obtain multiple segmented sampling subsequence data corresponding to the preset value, and the multiple segmented sampling subsequence data are spliced to obtain second sampling sequence data; wherein each segmented sampling subsequence data includes multiple historical moments that are continuous in time, and the time length of the historical moments contained in each segmented sampling subsequence data is consistent.
4. The method according to claim 3, characterized in that The multi-scale time-frequency mining module includes a time domain coding unit and a frequency domain coding unit, wherein: The time domain encoding unit is used to encode the first sampling sequence data and the second sampling sequence data corresponding to the multivariate time series data to obtain the time domain features of the first sampling sequence data and the second sampling sequence data; The frequency domain encoding unit is used to encode the first sampling sequence frequency domain data and the second sampling sequence frequency domain data corresponding to the multivariate time series data based on the self-attention mechanism to obtain the frequency domain features of the first sampling sequence frequency domain data and the second sampling sequence frequency domain data.
5. The method according to claim 4, characterized in that The fusion module is configured to perform feature fusion processing on the time domain features of the first sampling sequence data corresponding to the multivariate time series data and the frequency domain features of the first sampling sequence frequency domain data based on the cross-attention mechanism to obtain the first time-frequency domain features, and to perform feature fusion processing on the time domain features of the second sampling sequence data corresponding to the multivariate time series data and the frequency domain features of the second sampling sequence frequency domain data to obtain the second time-frequency domain features.
6. The method according to claim 5, characterized in that The preset loss function is: in, represents the total loss, represents the loss between the multivariate time series data in the next time period of the preset time period corresponding to the multivariate time series data and the predicted output corresponding to the multivariate time series data, represents the first contrast loss, Denotes the second contrast loss.
7. A multivariate time series prediction model constructed by the method according to any one of claims 1 to 6, characterized in that: The model includes: A dual sampling time-frequency extraction module is used to perform down-sampling and segmented sampling on the multivariate time series data to obtain first sampling sequence data and second sampling sequence data, and perform frequency domain transformation to obtain first sampling sequence frequency domain data and second sampling sequence frequency domain data; A multi-scale time-frequency mining module is used to encode the first sampling sequence data, the second sampling sequence data, the first sampling sequence frequency domain data and the second sampling sequence frequency domain data corresponding to the multivariate time series data to obtain the time domain features of the first sampling sequence data and the second sampling sequence data and the frequency domain features of the first sampling sequence frequency domain data and the second sampling sequence frequency domain data; The fusion module is used to perform feature fusion processing on the time domain features of the first sampling sequence data corresponding to the multivariate time series data and the frequency domain features of the first sampling sequence frequency domain data to obtain the first time-frequency domain features, and to perform feature fusion processing on the time domain features of the second sampling sequence data corresponding to the multivariate time series data and the frequency domain features of the second sampling sequence frequency domain data to obtain the second time-frequency domain features; The prediction module is used to fuse the first time-frequency domain features and the second time-frequency domain features corresponding to the multivariate time series data to predict the multivariate time series data in the next time period of the preset time period corresponding to the multivariate time series data.
8. A multivariate time series data prediction method, characterized in that: The method comprises: Step T1, obtaining multivariate time series data to be predicted; Step T2: using the multivariate time series prediction model as described in claim 7 to predict the multivariate time series data to be predicted.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the steps of any method described in claims 1-6 and 8.
10. An electronic device, characterized in that: include: one or more processors, and A memory, wherein the memory is used to store executable instructions; The one or more processors are configured to implement the steps of the method of any one of claims 1-6 and 8 by executing the executable instructions.
Citation Information
Cited By
Continuous casting anomaly detection method and device, equipment and storage medium
CN122310379A