Multivariable time series prediction method fusing federated learning and pre-training large model fine tuning

By integrating federated learning and pre-trained large model fine-tuning, and using reversible instance normalization, combinatorial decomposition, and wavelet Fourier transform adapters, the problem of data shortage and privacy in time series prediction is solved, and more efficient time series prediction results are achieved. .

CN118690900APending Publication Date: 2024-09-24ZHEJIANG UNIV OF TECH
View PDF 0 Cites 12 Cited by

Patent Information

Application Number
CN202410730795.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

The existing technology suffers from insufficient data, data privacy issues, and high consumption of computing resources in time series prediction, making it difficult to effectively utilize large-scale pre-trained language models for time series prediction.

Method used

Adopting a method that integrates federated learning and pre-trained large model fine-tuning, through reversible instance normalization, combinatorial decomposition, wavelet Fourier transform adapter and federated proximal algorithm, fine-tuning the pre-trained large model for time series prediction, solving the problem of data privacy and computing The problem of insufficient resources.

Benefits of technology

It improves the accuracy and efficiency of time series prediction, effectively utilizes the learning and representation capabilities of large models, and solves the problems of data barriers and insufficient resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690900A
    Figure CN118690900A
Patent Text Reader

Abstract

The invention discloses a multivariable time series prediction method fusing federated learning and pre-training large model fine tuning. The multivariable time series prediction method comprises the following steps: step 1, carrying out data normalization on input time series data through a RevIN method; step 2, decomposing the time sequence into a long-term trend and a seasonal property by using a combination decomposition method; 3, constructing a wavelet Fourier transform adapter, and obtaining local periodic characteristics and global periodic characteristics of the data; 4, constructing a pre-training large model, freezing a feed-forward layer and a self-attention module of the pre-training large model, and inserting the adapter constructed in the step 3 in front of the self-attention module of the model by using an adapter fine tuning method; and step 5, combining the pre-trained large model constructed in the step 4 with a federated learning framework to form a federated large model, issuing model parameters by a server side, only uploading adapter parameters by a client side after local data training, performing parameter aggregation by a federated near-end algorithm after the server side receives the parameters, and establishing a federated large model. After the server side and the client side are subjected to multiple rounds of parameter transmission, the global model is optimal; and step 6, realizing an optimal prediction result for the time sequence data through the optimal global prediction model obtained in the step 5.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the prediction task of multivariate time series data, and more specifically to a multivariate time series prediction method that integrates federated learning and fine-tuning of a pre-trained large model. Background Art

[0002] At present, the organic integration of the Internet and different industries has enabled the digital economy to play an important role in industrial development. In the era of big data, by analyzing massive amounts of data, deeply mining the value of data and applying it to people's production and life, the value of data and the effectiveness of analyzing data are fully reflected. The analysis of data can solve the difficulty of traditional methods in inferring the whole from the part, and grasp the interrelationships and development trends between things through the whole, so as to achieve scientific prediction and accurate decision-making.

[0003] Time series data is a complex and special data type that plays an important role in the research of finance, transportation, energy and other fields. Time series data is a set of or multiple sets of random variables generated according to the time dimension, which usually records the change process at a relatively fixed sampling frequency. In recent years, with the rapid development of sensor and network technology, it has become possible to generate and accumulate a large amount of time series data. For the field of time series data, it usually involves multiple research problems such as classification, anomaly detection and prediction, among which time series prediction tasks are the focus of its research.

[0004] Existing research on time series prediction is mainly based on the Transformer model architecture. Transformer variants are mainly divided into module level and architecture level. Module level variants mainly make subtle changes to the overall Transformer architecture, including designing new attention modules, exploring innovative ways to normalize time series data, and utilizing biases in token input. The architecture level mainly builds a new Transformer architecture with certain novelty. These studies are still mainly specialized modeling around the Transformer model, and the rapid development of large pre-trained language models in computer vision (CV) and natural language processing (NLP) has made it possible to apply pre-trained large language models (LLM) to time series prediction. The complex reasoning and pattern recognition capabilities demonstrated by LLM can better identify potential feature information in time series data, thereby making more accurate predictions.

[0005] Although there is a certain potential in extending the application of LLM to time series prediction, there are also certain difficulties. First, building a specific time series large model requires a large amount of domain data, and the existing public time series data accumulation is far less than NLP data, which cannot meet the needs of building a time series large model. Secondly, due to the high value of some time series related data and the privacy of the data, the relevant data cannot be made public. Even if there is enough time series data, it costs a lot to obtain this data in a centralized manner. Finally, due to the large number of parameters in the large model, the computing resources required to train the large model are large.

[0006] Federated learning is a distributed training method. Each client trains the model using local data and only shares the parameters of the training model with the server without actually sending the original data. This effectively solves the data island problem while ensuring data privacy. During federated learning training, since large-scale language models have more parameters, more efficient parameter fine-tuning technology is required. Summary of the invention

[0007] In order to solve the shortcomings of the existing technology and address the above-mentioned practical problems, the present invention carefully analyzes the technical field of the problem to which such problems belong, and proposes a time series prediction method that integrates federated learning and fine-tuning of a pre-trained large model. The present invention mainly targets time series prediction tasks, utilizes the powerful learning and representation capabilities of the large model, and applies the large model to time series prediction by fine-tuning, while federated learning provides the large model with more high-quality non-public training data, making the training data diverse. The present invention can provide theoretical basis and technical support for relevant personnel for time series prediction tasks.

[0008] The technical solution of the present invention is as follows:

[0009] A time series prediction method integrating federated learning and fine-tuning of a pre-trained large model includes the following steps:

[0010] Step 1: Use the reversible instance normalization method (Reversible Instance Normalization, RevIN) to normalize the input time series data;

[0011] Step 2: Decompose the time series using a combined decomposition method, using regression splines to capture long-term trend changes and smoothing splines to capture seasonal changes;

[0012] Step 3: construct a wavelet Fourier transform adapter, use wavelet transform to obtain local periodic features, and use Fourier transform to obtain global periodic features;

[0013] Step 4: Build a pre-trained large model, freeze its feed-forward layer and self-attention module, and use the adapter tuning method to insert the adapter built in step 3 into the pre-trained large model;

[0014] Step 5: Using federated learning, the client downloads the pre-trained large model with the adapter from the server and trains it using local data. Each client uploads the trained adapter parameters to the server, and the server aggregates the model using the Fedprox (Federated Proximal) algorithm.

[0015] Step 6: The final global model in step 5 is optimized and the time series data is tested to obtain the optimal prediction result.

[0016] In step 1 of the present invention, the reversible instance normalization method is used to normalize the input time series using the mean (Exp) and variance (Var). The normalization method can be defined as:

[0017]

[0018] In step 2, the time series data can be decomposed into trend, seasonality and residual. The trend reflects the long-term change trend contained in the data, the seasonality represents the cyclical fluctuations caused by seasonal factors, and the residual contains the part of the data that is not explained by the trend and seasonality. The time series is divided into three new subsequences, which can be expressed by the following formula:

[0019] c m =t m +s m +τ m (2)

[0020] In the formula, c m represents the time series, t m Indicates the long-term trend, s m represents seasonality, τ m Represents the residual. In the combined decomposition method, regression spline is a commonly used non-parametric approximation method. The time series is fitted by a piecewise q-order polynomial. The time series is divided into multiple sub-intervals, and a polynomial function is used to fit in each sub-interval to obtain the trend change in the time series. The calculation formula is:

[0021]

[0022] Where α iBy using the least squares method to estimate, m represents the number of points (called nodes) in the subinterval, q represents the polynomial order, and any spline function u(c) of order q can be defined as the basis function u i (c) is a linear combination of the above. The smoothing spline decomposition targets seasonal changes. The smoothing spline is a method for softly fitting seasonal patterns. It limits seasonal changes through penalty terms to ensure the smoothness of seasonal patterns. Its calculation equation is:

[0023]

[0024] Where u″(c) represents the second-order derivative of u(c), the first term in the equation is the goodness of fit, and the second term penalizes the roughness of the function through the smoothing parameter λ.

[0025] In step 3, an adapter module is constructed, which consists of two parts. One part converts the signal from the time domain to the frequency domain through discrete Fourier transform (DFT), and decomposes the time series signal into a series of different frequencies. Define a time series signal x = [x0, ..., x N-1 ], DFT can be expressed as:

[0026]

[0027] Where x[n] represents the discrete sampling value of the time domain signal, and X[k] corresponds to the frequency Here we use the Fast Fourier Transform (FFT) in DFT as the main method for time series signals, and then reconstruct the signal represented in the frequency domain back to the time domain through the Inverse Fast Fourier Transform (IFFT). This method can effectively capture the global periodicity in the signal.

[0028] The Continuous Wavelet Transform (CWT) can analyze time series signals. CWT decomposes time series signals at different scales. Each scale corresponds to a specific frequency range, so that the frequency components of the time series signals are obtained at different time points. In this way, the local periodic characteristics in the time series data can be obtained. CWT can be expressed as:

[0029]

[0030] Where x(t) represents the original signal, is the complex conjugate of the wavelet function at time scale a and translation parameter b. The Fourier transform and wavelet transform of global and local periodicity are adaptively balanced by periodic weighting coefficients.

[0031] In step 4, GPT-2 (Generative Pre-trained Transformer) is selected as the basic large model for building the time series prediction model. During training, its self-attention module and feedforward layer are frozen, and only the gradients of the position embedding layer and the normalization layer are updated. The adapter module constructed in step 3 is inserted before the self-attention module, and finally a pre-trained large model suitable for time series prediction is constructed. The output results of the model training are then denormalized in RevIN to obtain the real output results.

[0032] In step 5, a federated learning framework is constructed and combined with the pre-trained large model constructed in step 4. The overall federated learning process includes: first, the server initializes the global model θ0. In each round t, the server converts the global model θ t It is sent to k clients. After receiving the LLM sent by the server, the client uses the time series data D k Participate in this round of training. After the training is completed, perform local updates and optimize the following functions:

[0033]

[0034] Where F k (θ; θ t ) is the local loss function of client k, and μ is a non-negative hyperparameter that controls the strength of proximal thinking.

[0035] Since the overall LLM has a large number of parameters, the client only updates the adapter parameters after the parameters are updated. Upload without uploading the complete LLM parameters to the server.

[0036] Secondly, the server accepts the adapter parameters uploaded by all k clients in this round Afterwards, each Combined with the global model θ0 to form a new global model θ k , and then globally aggregate the parameters through the federated proximal algorithm and update the global model. The aggregation formula can be expressed as:

[0037]

[0038] Where K is the number of clients participating in this round of updates.

[0039] In step 6, the final global model that reaches convergence has the best performance. The global model is tested. Compared with the model trained with the same type of time series data but smaller in scale, the final global model of the present invention has better effect in time series prediction.

[0040] The beneficial effects of the present invention are as follows:

[0041] 1. The innovation of the present invention lies in that the large language model is generalized to time series prediction by fine-tuning the adapter of the pre-trained large language model, thus giving full play to the learning and representation capabilities of the large model.

[0042] 2. The combined decomposition method is used to decompose the time series data, and then a wavelet Fourier transform adapter is constructed to fully capture the potential characteristics and relationships of the time series data, thereby fully improving the prediction performance of the model.

[0043] 3. Combining the pre-trained large model with the federated learning framework effectively solves the data barrier problems caused by data security and privacy protection. At the same time, the distributed training method solves the problem of insufficient resources for centralized training models. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is an implementation flow chart of the present invention;

[0045] Figure 2 This is a schematic diagram of the fine-tuning part of the adapter;

[0046] Figure 3 It is a schematic diagram of the federal large model established by the present invention. DETAILED DESCRIPTION

[0047] The following is a more detailed description of the embodiments of the present invention. Figure 1 The embodiments described below with reference to the accompanying drawings are only used to explain the present invention and should not be interpreted as limiting the present invention.

[0048] Implementation Example 1:

[0049] like Figure 1 As shown, a time series prediction method integrating federated learning and fine-tuning of a pre-trained large model of the present invention comprises the following steps:

[0050] Step 1: Use the reversible instance normalization method (RevIN) to normalize the input time series using the mean (Exp) and variance (Var). The normalization method can be defined as:

[0051]

[0052] Step 2: Decompose the time series using a combined decomposition method. Time series data can be decomposed into trend, seasonality, and residual. Trend reflects the long-term trend of change in the data, seasonality represents the cyclical fluctuations caused by seasonal factors, and residual contains the part of the data that is not explained by trend and seasonality. The time series is divided into three new sub-series, which can be expressed as follows:

[0053] c m =t m +s m +τ m (2)

[0054] In the formula, c m represents the time series, t m Indicates the long-term trend, s m represents seasonality, τ m Represents the residual. In the combined decomposition method, regression spline is a commonly used non-parametric approximation method. The time series is fitted by a piecewise q-order polynomial. The time series is divided into multiple sub-intervals, and a polynomial function is used to fit in each sub-interval to obtain the trend change in the time series. The calculation formula is:

[0055]

[0056] Where α i By using the least squares method to estimate, m represents the number of points (called nodes) in the subinterval, q represents the polynomial order, and any spline function u(c) of order q can be defined as the basis function u i (c) is a linear combination of the above. The smoothing spline decomposition targets seasonal changes. The smoothing spline is a method for softly fitting seasonal patterns. It limits seasonal changes through penalty terms to ensure the smoothness of seasonal patterns. Its calculation equation is:

[0057]

[0058] Where u″(c) represents the second-order derivative of u(c), the first term in the equation is the goodness of fit, and the second term penalizes the roughness of the function through the smoothing parameter λ.

[0059] For the input multivariate time series data, each feature is processed by the method in step 2 before being input into the model.

[0060] Step 3: Build the wavelet Fourier transform adapter;

[0061] Wavelet transform is used to obtain local periodic features, and Fourier transform is used to obtain global periodic features. The two methods are used to process the input time series data simultaneously, and finally the two processing results are combined through adaptive periodic weighting coefficients.

[0062] From the perspective of frequency domain, discrete Fourier transform (DFT) is used to convert time series data from time domain to frequency domain, and the time series signal is decomposed into a series of different frequencies. Define a time series signal x = [x0, ..., x N-1 ], DFT can be expressed as:

[0063]

[0064] Where x[n] represents the discrete sampling value of the time domain signal, and X[k] corresponds to the frequency In order to improve the computational efficiency and real-time processing capability of the algorithm, we use the Fast Fourier Transform (FFT) in DFT as the processing method for time series data, and then reconstruct the signal represented in the frequency domain back to the time domain through the Inverse Fast Fourier Transform (IFFT). In this way, the global periodicity in the time series data can be effectively captured.

[0065] In time series data, global features describe the overall properties of the entire time series and are closely related to its long-term trend. However, local features cannot be ignored. They can be manifested as fluctuations, peaks and valleys, and mutations in the time series. They are an indispensable part of the time series. The continuous wavelet transform (CWT) can fully capture the local features in the time series. CWT decomposes the time series signal at different scales. Each scale corresponds to a specific frequency range, so that the frequency components of the time series signal are obtained at different time points. In this way, the local periodic characteristics in the time series data can be obtained. CWT can be expressed as:

[0066]

[0067] Where x(t) represents the original signal, is the complex conjugate of the wavelet function at time scale a and translation parameter b. The Fourier transform and wavelet transform of global and local periodicity are adaptively balanced by periodic weighting coefficients.

[0068] Step 4: Build a large pre-trained model and fine-tune it;

[0069] In the present invention, a pre-trained large language model is selected as the basic model, its feedforward layer and self-attention module are frozen, and the adapter constructed in step 3 is inserted into the pre-trained LLM by using the adapter tuning method, so that the LLM is effectively generalized to the power load forecasting task;

[0070] Since GPT-2 (Generative Pre-trained Transformer) is a relatively mature large language model, using it as the overall basic model can give full play to the powerful learning and representation capabilities of LLM and better process complex time series data. Figure 2 As shown in the figure, the overall structure of GPT-2 is not changed much. Since the self-attention module and feedforward layer contain most of the learning knowledge from the pre-trained LLM, we choose to freeze its self-attention module and feedforward layer, and perform gradient updates on its position embedding layer and normalization layer. The wavelet Fourier adapter module constructed in step 3 is inserted before the self-attention module. Through this adapter fine-tuning method, the LLM is finally adapted to the downstream task of time series prediction. The output results of the model training are denormalized in RevIN to obtain the real output results.

[0071] Step 5: Join the federated learning framework and form a federated pre-trained LLM with the pre-trained LLM;

[0072] like Figure 3 As shown, horizontal federated learning is selected in the present invention. Different participants have the same overall feature dimension of the power load data set, but the data content is the time series related data collected locally. The shared time series pre-training LLM is trained using their local time series data, which effectively solves the problem of data not being shared due to data privacy and security issues, and effectively improves the performance of the model. At the same time, the introduction of the adapter effectively improves the data transmission efficiency between the server and the client in federated learning.

[0073] The overall federated learning process includes: First, the server initializes the global model θ0. In each round t, the server converts the global model θ t It is sent to k clients. After receiving the LLM sent by the server, the client uses the time series data D k Participate in this round of training. After the training is completed, perform local updates and optimize the following functions:

[0074]

[0075] Where F k (θ; θ t) is the local loss function of client k, and μ is a non-negative hyperparameter that controls the strength of proximal thinking.

[0076] Since the overall LLM has a large number of parameters, the client only updates the adapter parameters after the parameters are updated. Upload without uploading the complete LLM parameters to the server.

[0077] Secondly, the server accepts the adapter parameters uploaded by all k clients in this round Afterwards, each Combined with the global model θ0 to form a new global model θ k , and then globally aggregate the parameters through the federated proximal algorithm and update the global model. The aggregation formula can be expressed as:

[0078]

[0079] Where K is the number of clients participating in this round of updates.

[0080] Finally, after multiple rounds of global model delivery, adapter parameter upload, and global model aggregation, the model converges when the predetermined training rounds are reached or the model performance reaches stability.

[0081] Step 6: The global model that has reached convergence has the best performance. The global model is tested. Compared with the model trained with the same type of time series data but smaller in scale, the final global model of the present invention has better effect in time series prediction.

[0082] Implementation Example 2:

[0083] Various exemplary embodiments of the present invention will now be described in detail. This detailed description should not be considered as limiting the present invention, but should be understood as a more detailed description of certain aspects, features, and embodiments of the present invention.

[0084] The present invention provides a method for power load forecasting that integrates federated learning and pre-trained large model fine-tuning, such as Figure 1 As shown, the steps include:

[0085] Step 1: Normalize the time series data;

[0086] In an application scenario of time series prediction, taking power load prediction as an example, the main task of the method of the present invention is to train the model with existing data to predict the power load situation in the future. In order to improve the stability of the data and the final accuracy of the model, the time series data is normalized by reversible instance normalization (RevIN) and the input time series is normalized using the mean (Exp) and variance (Var). The normalization method can be defined as:

[0087]

[0088] Step 2: Effectively decompose the input time series data;

[0089] In time series data, trend and seasonality are two important components. Trend is the long-term trend of change in time series data, and seasonality is the periodic fluctuation of time series data due to certain factors. The remaining part after removing the trend and seasonality in the data is represented by the residual. Therefore, the time series can be expressed as:

[0090]

[0091] In the formula, c m represents the time series, t m Indicates the long-term trend, s m represents seasonality, τ m In the present invention, the trend and seasonality in the time series data are mainly used, so the time series is decomposed into the trend and seasonality parts by a combined decomposition method.

[0092] Regression spline is a commonly used non-parametric approximation method. It fits time series data by piecewise q-order polynomials. The time series is divided into multiple sub-intervals, and a polynomial function is used to fit in each sub-interval to obtain the trend changes in the time series data. The calculation formula is:

[0093]

[0094] Where α i By using the least squares method to estimate, m represents the number of points (called nodes) in the subinterval, q represents the polynomial order, and any spline function u(c) of order q can be defined as the basis function u i (c) is a linear combination of. The smoothing spline decomposition targets seasonal changes.

[0095] Smoothing spline is a method for gently fitting seasonal patterns. It limits seasonal changes through penalty terms to ensure the smoothness of seasonal patterns. Its calculation equation is:

[0096]

[0097] Where u″(c) represents the second-order derivative of u(c), the first term in the equation is the goodness of fit, and the second term penalizes the roughness of the function through the smoothing parameter λ.

[0098] The time series data contains multiple variables. In order to fully analyze the relationship between the multiple variables and improve the prediction accuracy, in the present invention, each variable of the input multivariate time series data is processed by a combined decomposition method and then input into the model.

[0099] Step 3: Build the wavelet Fourier transform adapter;

[0100] The wavelet transform method can extract local periodic features in the data, while the Fourier transform method can obtain global periodic features. Combining the two methods can fully extract the global and local features in the data, and finally adaptively combine the two parts of the processing results through the periodic weighting coefficient.

[0101] From the frequency domain perspective, the discrete Fourier transform (DFT) is used to convert the data from the time domain to the frequency domain, and the time series signal is decomposed into a series of different frequencies. Define a time series signal x = [x0, ..., x N-1 ], DFT can be expressed as:

[0102]

[0103] Where x[n] represents the discrete sampling value of the time domain signal, and X[k] corresponds to the frequency In order to improve the computational efficiency and real-time processing capability of the algorithm, we use the Fast Fourier Transform (FFT) in DFT as the processing method for time series data, and then reconstruct the signal represented in the frequency domain back to the time domain through the Inverse Fast Fourier Transform (IFFT). In this way, the global periodicity in the time series data can be effectively captured.

[0104] Global features describe the overall properties and long-term trends in time series data, and can analyze data changes as a whole, while local features reflect short-term changes and subtle patterns in time series data, fully identifying data mutations. Therefore, combining local features with global features can better analyze time series data. Continuous Wavelet Transform (CWT) can fully capture the local features in time series data. CWT decomposes the time series signal at different scales, and each scale corresponds to a specific frequency range, so as to obtain the frequency components of the time series signal at different time points. In this way, the local periodic features in the time series data can be obtained. CWT can be expressed as:

[0105]

[0106] Where x(t) represents the original signal, is the complex conjugate of the wavelet function in time scale a and translation parameter b.

[0107] The data is processed by two methods and the two parts of the processing results are adaptively combined and output through the periodic weighting coefficient to enter the next module of the model.

[0108] Step 4: Build a large pre-trained model and fine-tune it;

[0109] In the present invention, a pre-trained large language model is selected as the basic model, its feed-forward layer and self-attention module are frozen, and the adapter constructed in step 3 is inserted into the pre-trained LLM by using the adapter tuning method, so that the LLM is effectively generalized to the time series prediction task;

[0110] Since GPT-2 (Generative Pre-trained Transformer) is a relatively mature large language model, using it as the overall basic model can give full play to the powerful learning and representation capabilities of LLM and better process complex time series data. Figure 2 As shown in the figure, the overall structure of GPT-2 is not changed much. Since the self-attention module and feedforward layer contain most of the learning knowledge from the pre-trained LLM, we choose to freeze its self-attention module and feedforward layer, and perform gradient updates on its position embedding layer and normalization layer. The wavelet Fourier adapter module constructed in step 3 is inserted before the self-attention module. Through this adapter fine-tuning method, the LLM is finally adapted to the downstream task of time series prediction. The output results of the model training are denormalized in RevIN to obtain the real output results.

[0111] Step 5: Join the federated learning framework and form a federated pre-trained LLM with the pre-trained LLM;

[0112] like Figure 3 As shown, horizontal federated learning is selected in the present invention. Different participants have the same overall feature dimension of the time series data sets, but the data content is the time series related data collected locally. The shared time series pre-training LLM is trained using their local related time series data, which effectively solves the problem of data not being shared due to data privacy and security issues, and effectively improves the performance of the model. At the same time, the introduction of the adapter effectively improves the data transmission efficiency between the server and the client in federated learning.

[0113] The overall federated learning process includes: First, the server initializes the global model θ0. In each round t, the server converts the global model θ t It is sent to k clients. After receiving the LLM sent by the server, the client uses the local time series data D k Participate in this round of training. After the training is completed, perform local updates and optimize the following functions:

[0114]

[0115] Where F k (θ; θ t ) is the local loss function of client k, and μ is a non-negative hyperparameter that controls the strength of proximal thinking.

[0116] Since the overall LLM has a large number of parameters, the client only updates the adapter parameters after the parameters are updated. Upload without uploading the complete LLM parameters to the server.

[0117] Secondly, the server accepts the adapter parameters uploaded by all k clients in this round Afterwards, each Combined with the global model θ0 to form a new global model θ k , and then globally aggregate the parameters through the federated proximal algorithm and update the global model. The aggregation formula can be expressed as:

[0118]

[0119] Where K is the number of clients participating in this round of updates.

[0120] Finally, after multiple rounds of global model delivery, adapter parameter upload, and global model aggregation, the model converges when the predetermined training rounds are reached or the model performance reaches stability.

[0121] Step 6: The converged global model has the best performance for time series prediction. The global model is tested and the mean squared error (MSE) is used as the time series prediction evaluation standard. Compared with the model trained with smaller-scale time series data, the global model of the present invention has better effect on time series prediction.

[0122] Step 7: Input the power load data of the existing region in the past few years to realize the prediction of power load in the future;

[0123] When multiple clients obtain the global model sent by the server, they will use the existing local power load data for model training. In the data processing stage, the client will perform standard normalization on its existing local power load data, and then decompose the power load data into trend and seasonality parts through the combined decomposition method, and input them into the model respectively.

[0124] During the model training phase, the model continues to process the trend and seasonality of the input data separately. The model fully extracts the global and local features of the data through the wavelet Fourier adapter module, and then adaptively aggregates the obtained global and local features through the periodic weighting coefficients.

[0125] In the federated aggregation phase, the local client uploads the adapter parameters after completing a round of model training. After receiving the adapter parameters uploaded by multiple local clients, the server will combine each adapter parameter with the existing global model, update the adapter parameters of the global model, and then aggregate the global model through the federated proximal algorithm. After completing a round of parameter updates, the server will send down the adapter parameters again. After receiving the adapter parameters, the local client will update and start the next round of training. When the scheduled training rounds are reached or the model performance reaches stability, the global model converges.

[0126] Finally, using the global model that has reached optimal convergence, the power load situation in the region for a period of time in the future can be predicted.

[0127] The contents described in the embodiments of this specification are merely an enumeration of the implementation forms of the inventive concept and are for illustrative purposes only. The protection scope of the present invention should not be considered to be limited to the specific forms described in this implementation example, and the protection scope of the present invention also extends to equivalent technical means that can be thought of by ordinary technicians in this field based on the inventive concept.

Claims

1. A multivariate time series prediction method integrating federated learning and fine-tuning of a pre-trained large model, characterized in that: The following steps are involved: Step 1: Use the reversible instance normalization method (RevIN) to normalize the input time series data; Step 2: Decompose the time series using a combined decomposition method, using regression splines to capture long-term trend changes and smoothing splines to capture seasonal changes; Step 3: construct a wavelet Fourier transform adapter, obtain local periodic features through the wavelet transform method, and obtain global periodic features through the Fourier transform method; Step 4: Build a pre-trained large model, freeze its feed-forward layer and self-attention module, and use the adapter tuning method to insert the adapter built in step 3 into the pre-trained large model; Step 5: Using federated learning, the client downloads the pre-trained large model with the adapter from the server and trains it using local data. Each client uploads the trained adapter parameters to the server, and the server aggregates the model using the Fedprox (Federated Proximal) algorithm. Step 6: Use the optimal global prediction model obtained in step 5 to achieve the optimal prediction result for the time series.

2. According to claim 1, a multivariate time series prediction method integrating federated learning and pre-trained large model fine-tuning is characterized in that: Step 1 specifically includes: using the reversible instance normalization method to normalize the input time series using the mean (Exp) and variance (Var). The normalization method can be defined as:

3. According to claim 1, a multivariate time series prediction method integrating federated learning and pre-trained large model fine-tuning is characterized in that: In step 2, the time series data can be decomposed into trend, seasonality and residual. The trend reflects the long-term trend of change in the data, the seasonality represents the cyclical fluctuations caused by seasonal factors, and the residual contains the part of the data that is not explained by the trend and seasonality. The time series is divided into three new sub-series, which can be expressed by the following formula: In the formula, represents a time series, Indicates the long-term trend. Indicates seasonality, Represents the residual. In the combined decomposition method, regression spline is a commonly used non-parametric approximation method. The time series is fitted by a piecewise q-order polynomial. The time series is divided into multiple sub-intervals, and a polynomial function is used to fit in each sub-interval to obtain the trend change in the time series. The calculation formula is: Where α i By using the least squares method to estimate, m represents the number of points (called nodes) in the subinterval, q represents the polynomial order, and any spline function u(c) of order q can be defined as the basis function u i (c) is a linear combination of the above. The smoothing spline decomposition targets seasonal changes. The smoothing spline is a method for softly fitting seasonal patterns. It limits seasonal changes through penalty terms to ensure the smoothness of seasonal patterns. Its calculation equation is: Where u″(c) represents the second-order derivative of u(c), the first term in the equation is the goodness of fit, and the second term penalizes the roughness of the function through the smoothing parameter λ.

4. According to claim 1, a multivariate time series prediction method integrating federated learning and pre-trained large model fine-tuning is characterized in that: In step 3, an adapter module is constructed, which consists of two parts. One part converts the time series data from the time domain to the frequency domain through discrete Fourier transform (DFT), and decomposes the time series signal into a series of different frequencies. Define a time series signal x = [x0,…,x N-1 ],,DFT can be expressed as: Where x[n] represents the discrete sampling value of the time domain signal, and X[k] corresponds to the frequency Here we use the Fast Fourier Transform (FFT) in DFT as the main method for time series signals, and then reconstruct the signal represented in the frequency domain back to the time domain through the Inverse Fast Fourier Transform (IFFT). This method can effectively capture the global periodicity in the signal. The Continuous Wavelet Transform (CWT) can analyze time series signals. CWT decomposes time series signals at different scales. Each scale corresponds to a specific frequency range, so that the frequency components of the time series signals are obtained at different time points. In this way, the local periodic characteristics in the time series data can be obtained. CWT can be expressed as: Where x(t) represents the original signal, is the complex conjugate of the wavelet function at time scale a and translation parameter b. The Fourier transform and wavelet transform of global and local periodicity are adaptively balanced by periodic weighting coefficients.

5. A multivariate time series prediction method integrating federated learning and pre-trained large model fine-tuning according to claim 1, characterized in that: In step 4, GPT-2 (Generative Pre-trained Transformer) is selected as the basic large model for constructing the time series prediction model. During training, its self-attention module and feedforward layer are frozen, and only the gradients of the position embedding layer and the normalization layer are updated. The adapter module constructed in step 3 is inserted before the self-attention module, and finally a pre-trained large model suitable for time series prediction is constructed. The output result of the model training is transformed by denormalization in RevIN to obtain the real output result.

6. The multivariate time series prediction method integrating federated learning and pre-trained large model fine-tuning according to claim 1 is characterized in that: In step 5, a federated learning framework is constructed and combined with the pre-trained large model constructed in step 4. The overall federated learning process includes: first, the server initializes the global model θ0. In each round t, the server converts the global model θ t It is sent to k clients. After receiving the LLM sent by the server, the client uses the local time series data D k Participate in this round of training. After the training is completed, perform local updates and optimize the following functions: Where F k (θ; θ t ) is the local loss function of client k, and μ is a non-negative hyperparameter that controls the strength of proximal thinking. Since the overall LLM has a large number of parameters, the client only updates the adapter parameters after the parameters are updated. Upload without uploading the complete LLM parameters to the server. Secondly, the server accepts the adapter parameters uploaded by all k clients in this round Afterwards, each Combined with the global model θ0 to form a new global model θ k , and then globally aggregate the parameters through the federated proximal algorithm and update the global model. The aggregation formula can be expressed as: Where K is the number of clients participating in this round of updates. Finally, after multiple rounds of global model delivery, adapter parameter upload, and global model aggregation, the model converges when the predetermined training rounds are reached or the model performance reaches stability.

7. The multivariate time series prediction method integrating federated learning and pre-trained large model fine-tuning according to claim 1 is characterized in that: In step 6, the converged global model is optimal, and the global model can achieve the optimal prediction result for the time series.

Citation Information

Cited By

  • Feature extraction method and system for short-term photovoltaic power prediction

    CN118885883A

  • Method, device and equipment for determining power distribution strategy of medium-and-long-term regional users

    CN119151243A

  • Method, device and equipment for determining power distribution strategy for medium- and long-term regional users

    CN119151243B

  • Power battery detection method and device and nonvolatile storage medium

    CN119270080A

  • Power battery detection method and device, and nonvolatile storage medium

    CN119270080B