Time series forecasting method and device

By combining the memory enhancement network and the ordinary differential equation solver to process irregular time series data, using gradient enhancement and graph convolution technology, the challenge of irregular time series prediction is solved, and the prediction accuracy and model representation ability are improved. .

WO2024187894A1PCT designated stage expired Publication Date: 2024-09-19ALIPAY (HANGZHOU) INFORMATION TECH CO LTD

Patent Information

Application Number
PCT/CN2023/141419
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-15
Filing Date
2023-12-25
Publication Date
2024-09-19

AI Technical Summary

Technical Problem

It is difficult for existing technologies to effectively process irregular or incomplete time series data for time series prediction, especially when data is missing and sampling is irregular.

Method used

The memory enhancement network is used to perform gradient enhancement on the gradient data of the time series, combined with an ordinary differential equation solver and graph convolution operation, to decode the hidden state to obtain the prediction results of the future time through means such as vector domain functions and time-related functions.

Benefits of technology

It solves the problems related to hidden state discontinuity and data regularity and gradient nonlinearity, improves the accuracy of prediction and the representation ability of the model, and is suitable for multi-variable time series and long-term distance prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023141419_19092024_PF_FP_ABST
    Figure CN2023141419_19092024_PF_FP_ABST
Patent Text Reader

Abstract

One or more embodiments of the present description provide a time series forecasting method and device. The method comprises: acquiring first gradient data of an observed time series; performing gradient augmentation on the first gradient data by means of a memory-augmented network to obtain second gradient data; obtaining a vector domain function according to the second gradient data, and solving the vector domain function by means of an ordinary differential equation solver to obtain a hidden state of the time series; and decoding the hidden state to obtain a forecasting result of a future time. Compared with directly solving a hidden state according to an observed time series, the method solves the problem that a data rule is nonlinearly related to a gradient on the basis of solving the problem of a discontinuous hidden state, thereby improving the accuracy of forecasting.
Need to check novelty before this filing date? Find Prior Art

Description

Time series prediction method and device Technical Field

[0001] One or more embodiments of this specification relate to the field of data processing technology, and in particular, to a time series prediction method and apparatus. Background Art

[0002] Time series forecasting can be applied to a variety of scenarios requiring data prediction. It is typically performed based on time series collected at equal intervals, i.e., regular time series with a fixed sampling frequency. However, in some cases, due to data collection limitations, data loss and irregular sampling, the collected data may be irregular or incomplete. How to perform time series forecasting based on such irregular or incomplete time series data remains to be studied.

[0003] Summary of the Invention

[0004] In view of this, one or more embodiments of this specification provide a time series prediction method and apparatus.

[0005] To achieve the above-mentioned objectives, one or more embodiments of this specification provide the following technical solutions: According to the first aspect of one or more embodiments of this specification, a time series prediction method is proposed, including: obtaining first gradient data of an observed time series; performing gradient enhancement on the first gradient data using a memory enhancement network to obtain second gradient data; obtaining a vector domain function based on the second gradient data, and solving the vector domain function using an ordinary differential equation solver to obtain a hidden state of the time series; decoding the hidden state to obtain a prediction result for the future time.

[0006] In some embodiments, the step of performing gradient enhancement on the first gradient data using a memory enhancement network to obtain second gradient data includes: converting the signal gradient in the first gradient data using a weight parameter matrix to obtain an enhanced signal gradient, and obtaining the second gradient data based on the enhanced signal gradient, wherein the weight parameter matrix is ​​formed by parameters stored in a storage body corresponding to the trained memory enhancement network.

[0007] In some embodiments, the signal gradient in the first gradient data is converted using the weight parameter matrix to obtain an enhanced signal gradient, including: multiplying the signal gradient with the weight parameter matrix to obtain a conversion result; processing the conversion result using a normalized exponential function to obtain a normalized result; and multiplying the normalized result with the transposed matrix of the weight parameter matrix to obtain an enhanced signal gradient.

[0008] In some embodiments, the vector domain function further includes a time-related function, and the time function is obtained according to a periodic function and a trend function.

[0009] In some embodiments, the method also includes: performing weighted summation on the superposition results of sine functions and cosine functions of different frequencies to obtain the periodic function; performing weighted summation on polynomial functions to obtain the trend function; adding the periodic function and the trend function to obtain the time function, wherein the weight parameters of the periodic function and the weight parameters of the trend function are learnable parameters.

[0010] In some embodiments, when the time series is a multivariate time series, the vector domain function further includes a spatial correlation function, and the spatial correlation function is obtained by performing a graph convolution operation on the hidden state.

[0011] In some embodiments, the method further includes: generating an embedding matrix, each row of the embedding matrix represents a word vector for each time series; processing the multiplication result of the embedding matrix and the transposed matrix of the embedding matrix using a ReLU activation function to obtain an activation result; processing the activation result using a normalized exponential function to obtain an adaptive Chebyshev matrix; and performing a graph convolution operation on the hidden state using the adaptive Chebyshev matrix to obtain a spatial correlation function.

[0012] In some embodiments, the hidden state is decoded to obtain a prediction result for the future time, including: using a projection network to map the hidden state at the last moment t of the observed time series to obtain a predicted value at time t+1; using first-order Euler discretization, estimating the hidden state at time t+1 based on the predicted value at time t+1; repeating the mapping and first-order Euler discretization estimation until the predicted values ​​for all predicted moments are obtained.

[0013] According to a second aspect of one or more embodiments of the present specification, a time series prediction device is proposed, comprising: an acquisition unit for acquiring first gradient data of an observed time series; an enhancement unit for performing gradient enhancement on the first gradient data using a memory enhancement network to obtain second gradient data; a solution unit for obtaining a vector domain function based on the second gradient data, and solving the vector domain function using an ordinary differential equation solver to obtain a hidden state of the time series; and a decoding unit for decoding the hidden state to obtain a prediction result for the future time.

[0014] In some embodiments, the enhancement unit is specifically used to: use a weight parameter matrix to convert the signal gradient in the first gradient data to obtain an enhanced signal gradient, and obtain second gradient data based on the enhanced signal gradient, wherein the weight parameter matrix is ​​formed by parameters stored in a storage body corresponding to the trained memory enhancement network.

[0015] In some embodiments, when the enhancement unit is used to convert the signal gradient in the first gradient data using a weight parameter matrix, it is specifically used to: multiply the signal gradient with the weight parameter matrix to obtain a conversion result; process the conversion result using a normalized exponential function to obtain a normalized result; and multiply the normalized result with the transposed matrix of the weight parameter matrix to obtain an enhanced signal gradient.

[0016] In some embodiments, the vector domain function further includes a time-related function, and the time function is obtained according to a periodic function and a trend function.

[0017] In some embodiments, the device also includes a time feature enhancement unit, which is used to: perform weighted summation on the superposition results of sine functions and cosine functions of different frequencies to obtain the periodic function; perform weighted summation on polynomial functions to obtain the trend function; add the periodic function and the trend function to obtain the time function, wherein the weight parameters of the periodic function and the weight parameters of the trend function are learnable parameters.

[0018] In some embodiments, when the time series is a multivariate time series, the vector domain function further includes a spatial correlation function, and the spatial correlation function is obtained by performing a graph convolution operation on the hidden state.

[0019] In some embodiments, the device also includes a spatial correlation enhancement unit, which is used to: generate an embedding matrix, each row of the embedding matrix represents a word vector for each time series; use a ReLU activation function to process the multiplication result of the embedding matrix and the transposed matrix of the embedding matrix to obtain an activation result; use a normalized exponential function to process the activation result to obtain an adaptive Chebyshev matrix; use the adaptive Chebyshev matrix to perform a graph convolution operation on the hidden state to obtain a spatial correlation function.

[0020] In some embodiments, the decoding unit is specifically used to: use a projection network to map the hidden state of the last moment t of the observed time series to obtain a predicted value at moment t+1; estimate the hidden state at moment t+1 based on the predicted value at moment t+1 through first-order Euler discretization; repeat the mapping and first-order Euler discretization estimation until the predicted values ​​of all predicted moments are obtained.

[0021] According to a third aspect of one or more embodiments of this specification, an electronic device is proposed, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the method proposed in the above embodiment by running the executable instructions.

[0022] According to a fourth aspect of one or more embodiments of this specification, a computer-readable storage medium is proposed, on which computer-executable instructions are stored. When the instructions are executed by a processor, the method proposed in the above embodiment is implemented.

[0023] In this specification, the gradient data of the observed time series is gradient enhanced, and the ordinary differential equation is solved based on the enhanced gradient data to obtain the hidden state of the time series, and the prediction result for the future time is obtained by decoding the hidden state. Compared with directly solving the hidden state based on the observed time series, this method not only solves the problem of hidden state discontinuity, but also solves the problem of data regularity and gradient nonlinearity, thereby improving the accuracy of the prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] FIG1 is a schematic diagram of a time series prediction method provided by an exemplary embodiment.

[0025] FIG2 is a flowchart of another time series prediction method provided by an exemplary embodiment.

[0026] FIG3 is a schematic diagram of the time series prediction method shown in FIG2 .

[0027] FIG4 is a flow chart of a gradient enhancement method provided by an exemplary embodiment.

[0028] FIG5 is a flowchart of a method for constructing a spatial correlation function provided by an exemplary embodiment.

[0029] FIG6 is a flowchart of a decoding method provided by an exemplary embodiment.

[0030] FIG7 is a schematic diagram of yet another time series prediction method provided by an exemplary embodiment.

[0031] 8A and 8B are heat maps of the weight matrix of the time series prediction network in the embodiment of FIG. 7 and the related art, respectively.

[0032] FIG9 is a block diagram of a time series prediction apparatus provided by an exemplary embodiment.

[0033] FIG10 is a schematic structural diagram of a device provided by an exemplary embodiment. DETAILED DESCRIPTION

[0034] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments are not intended to represent all implementations consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with certain aspects of one or more embodiments of this specification, as detailed in the appended claims.

[0035] It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than those described in this specification. In addition, a single step described in this specification may be broken down into multiple steps for description in other embodiments, and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0036] A time series, also known as a dynamic series, is a series of values ​​of the same statistical indicator arranged in chronological order. Time series forecasting involves using observed time series (historical data) to infer future time series by leveraging the inherent temporal relationships of data across multiple dimensions.

[0037] Time series forecasting can be applied to various scenarios requiring data prediction. Time series forecasting is performed based on time series collected at equal intervals, i.e., time series with a fixed sampling frequency. However, in some cases, due to data collection limitations, data loss and irregular sampling, the collected data may be irregular or incomplete. How to perform time series forecasting based on such irregular or incomplete time series data remains to be studied.

[0038] This specification proposes a method for solving the time series prediction problem of irregular or incomplete time series data by combining ordinary differential equations (ODE) with deep learning. This method can be applied to a variety of fields, such as intelligent transportation, intelligent manufacturing, smart home, smart medical care, cloud native, database, etc. For example, the embodiments of this specification can be used for traffic flow prediction, database tenant capacity prediction, e-commerce inventory capacity prediction, etc. Those skilled in the art should understand that the time series prediction method proposed in this specification can also be applied to other fields and other scenarios. The above is only an example and is not intended to be limiting.

[0039] The time series prediction method proposed in the embodiments of this disclosure can be used to predict future data based on historical time series data, and can also be used to complete incomplete data. The method can be executed by an electronic device, which can be a server, such as a single server, multiple servers, a server cluster, a cloud computing platform, etc., or a terminal device, such as a desktop computer, a portable computer, a supercomputer, etc. This application does not limit the specific type of electronic device.

[0040] In this time series forecasting method, represents the observed time series, and the prediction problem can be expressed as: t:t+H =G Θ (x t-L:t )+∈ (1)

[0041] Among them, H is the time distance of the prediction, L is the look-back window of the historical time series, ∈ is the residual of the prediction, G Θ (·) is the parameterized time series prediction network proposed in this specification.

[0042] The loss function for learning the parameters Θ of the time series prediction network can be the mean square error or other types, for example, as shown below:

[0043] In order to capture the internal characteristics of time series data, this paper proposes a hidden state z that can be described by a neural ordinary differential equation t The continuous dynamic system is described by the following ordinary differential dynamic equation:

[0044] in, and ξ(·) are parameterized neural networks, which are used for the following relation transformations x0→z0, z t →x t ; F(·) represents the dynamic function of the hidden state, which can also be called the vector field function. This dynamic function is also a neural network that can be learned.

[0045] According to formula (3), the solution of this ODE can be determined by the initial state of z0 and the implicit dynamics along the integration path, that is:

[0046] This neural ODE is used to learn the hidden state of the entire time for time series prediction, which can be calculated using a numerical ODE solver and can be obtained by x t =ξ(z t ) to obtain the prediction for the next time step. The solution process can be expressed by the following formula: t=ODESolver(F,z0,(t0,…,t)). (5)

[0047] In some embodiments, an ODE solver can be used to integrally encode observed time series data to obtain a hidden state, which can then be decoded to obtain predicted values ​​for the time period after the current moment. As shown in Figure 1, the observed time series consists of data x1, x2, ..., xn observed at times t1, t2, ..., tn, respectively. The ODE solver is used to obtain the hidden state for future moments. As shown in Figure 1, the hidden state obtained by this method suffers from discontinuity.

[0048] In view of this, this specification also proposes a time series prediction method. FIG2 is a flowchart of the time series prediction method, which includes: step 201, obtaining first gradient data of an observed time series.

[0049] Referring to the schematic diagram of the time series prediction method shown in Figure 3, the observed time series is the data x1, x2, ..., xn observed at time t1, t2, ..., tn, respectively. The times t1, t2, ..., tn can be uniformly distributed or non-uniformly distributed, that is, the time series can be regular, irregular, or incomplete.

[0050] The change of input signal x can directly affect the local dynamics of hidden state. In the differential method, in order to incorporate the input signal into the hidden dynamics, it is necessary to rely on continuous input signal. However, the observed time series may be regularly sampled or irregularly sampled time series data. Therefore, we first need to derive a continuous approximation from the discrete time series. Specifically, we can use X to represent the cubic spline with nodes t=0,…,T, so that Among them, d x is the size of the input signal.

[0051] Gradient extraction can be performed on the continuous approximation X of the input signal, and the gradient extraction results can be interpolated and smoothed to obtain gradient data of the signal path corresponding to the time series. To distinguish it from the gradient data obtained later, the gradient data here can be referred to as first gradient data.

[0052] Step 202: Use a memory enhancement network to perform gradient enhancement on the first gradient data to obtain second gradient data.

[0053] When the observed time series is an irregular variable, since the data regularity is usually not linearly related to the gradient, if the hidden state is obtained by directly solving the ODE based on the first gradient data of the time series, the regularity of the time series reflected by the first gradient data may be inconsistent with the regularity of the original time series, resulting in a deterioration in the prediction results of the future time series.

[0054] In the embodiment of this specification, a trained memory enhancement network may be used to perform gradient enhancement on the first gradient data to obtain second gradient data, as shown in FIG3 .

[0055] For the continuous approximation X of the observed time series, the signal gradient function is dX / dt, which can be obtained by using g v The function performs gradient enhancement as shown below: g v (x <t )=g v (dX / dt) (6)

[0056] Among them, the function g v Augmenting networks for memory.

[0057] In some embodiments, the signal gradient in the first gradient data can be converted using a weight parameter matrix of the network to obtain an enhanced signal, and second gradient data can be obtained based on the enhanced signal gradient, wherein the weight parameter matrix is ​​formed by parameters stored in a memory bank corresponding to the trained memory enhancement network.

[0058] In one example, the gradient enhancement method shown in FIG. 4 may be used for signal gradient conversion, including steps 401 to 403 .

[0059] Step 401: multiply the signal gradient by the weight parameter matrix to obtain a conversion result; Step 402: process the conversion result using a normalized exponential function to obtain a normalized result; Step 403: multiply the normalized result by the transposed matrix of the weight parameter matrix to obtain an enhanced signal gradient.

[0060] The above process can be expressed by the following formula: g v (dX / dt)=M T ×softmax(M×dX / dt) (7)

[0061] Among them, M is the weight parameter matrix and softmax() is the normalized exponential function.

[0062] Step 203: Obtain a vector domain function according to the second gradient data, and use an ODE solver to solve the vector domain function to obtain the hidden state of the time series, as shown in FIG3 .

[0063] The vector domain function is used to serially input each state to perform integral encoding to obtain the hidden state. The vector domain function can also be called a dynamic function.

[0064] In the embodiments of this specification, the vector domain function includes data related to the hidden state and the local changes in the signal path after interpolation. For example, the vector domain function can be expressed by the following formula: F(Θ) = f θ (z t )g v (dX / dt) (8)

[0065] Among them, Θ is a learnable parameter, f θ (z t ) is the state-related function, g v (dX / dt) is the gradient boosting function.

[0066] By solving the vector domain function shown in formula (8) using the ODE solver, the hidden state of the time series can be obtained. When the observation times corresponding to the observed time series are 1, ..., t-1, t, the hidden states z1, ..., z t-1 、z t The process can be expressed as follows: z1,…,z t =ODESolver(F,z0,(t0,…,t)) (9)

[0067] Among them, z0 is the initial value of the hidden state.

[0068] Step 204: Decode the hidden state to obtain a prediction result for the future time.

[0069] In the decoding stage, the decoder can be used to decode the hidden state z t Perform a decoding operation to obtain the predicted future time sequence.

[0070] In one example, a single-layer convolutional network can be applied to obtain the hidden state z t Generate one-short predictions

[0071] In the embodiments of the present specification, by performing gradient enhancement on the gradient data of the observed time series and solving the ODE based on the enhanced gradient data, the hidden state of the time series is obtained, and the prediction result for the future time is obtained by decoding the hidden state. Compared with directly solving the hidden state based on the observed time series, this method not only solves the problem of hidden state discontinuity, but also solves the problem of data regularity and gradient nonlinearity, thereby improving the accuracy of the prediction.

[0072] When a vector domain function is only related to the hidden state and not time, it is easy to overfit details during the solution process, leading to overfitting. To address this problem, the embodiments of this specification also propose a method for adding a time-related function in the vector domain to enhance the temporal characteristics of the hidden state. The time-related function can be derived from a periodic function and a trend function.

[0073] In the case where the vector domain function includes a time-dependent function, the vector domain function can be expressed by the following formula: F(Θ)=h ω (t)f θ (z t ) g v (dX / dt) (10)

[0074] Among them, Θ is a learnable parameter, h ω (t) is the time correlation function, f θ (z t ) is the state-related function, g v (dX / dt) is the gradient enhancement function, is a periodic function, is a trend function.

[0075] In some embodiments, the periodic function may be obtained by weighted summing the superposition results of sine functions and cosine functions of different frequencies, for example, which may be expressed by the following formula:

[0076] Among them, ω (s) is the weight parameter of the periodic function, and s is the number of seasonal functions (cos(·)+sin(·)).

[0077] The trend function can be obtained by weighted summation of polynomial functions, for example, it can be expressed by the following formula:

[0078] Among them, ω (p) is the weight parameter of the trend function, and p is the number of polynomials.

[0079] The weight parameters of the periodic function and the weight parameters of the trend function are learnable parameters.

[0080] Adding a periodic function to a vector domain function can enhance the seasonal properties of the hidden state, while adding a trend function to a vector domain function can enhance the trend properties of the hidden state. By enhancing the temporal characteristics of the hidden state, the representational power and interpretability of the time series prediction network model can be improved, especially for complex time series with strong periodicity; and the predictable duration can be increased, enabling long-horizon forecasting.

[0081] In the case where the time series is a multivariate time series, the embodiments of this specification further propose adding a spatial correlation function obtained by performing a graph convolution operation on the hidden state in the vector domain to capture the spatial relationship between the multivariate time series.

[0082] In some embodiments, the spatial correlation function may be constructed by graph convolution as expressed in the following formula:

[0083] in, represents the tth time slice of N observed time series, is the matrix corresponding to the hidden state of N time series, is the degree matrix, is the adjacency matrix, is a low-rank Chebyshev matrix, and b are the learnable weight parameters and bias parameters, respectively, d x is the size of the input signal, d z is the size of the hidden state.

[0084] In one example, the spatial correlation function may be constructed using the method shown in FIG5 , including steps 501 to 504 .

[0085] Step 501: Generate an embedding matrix.

[0086] In the embodiment of this specification, in order to make the adjacency matrix more flexible, a learnable embedding matrix is ​​constructed Among them, each row of the embedding matrix E represents the word vector (embedding) of each time series, |ν| represents the number of feature vectors, and d e is the size of the word vector.

[0087] Step 502: Use the ReLU activation function to process the multiplication result of the embedding matrix and the transposed matrix of the embedding matrix to obtain an activation result.

[0088] The activation process can be expressed as σ(EE T ), where σ represents the ReLU activation function and E represents the embedding matrix. EE TThe similarity between nodes can be measured.

[0089] Step 503: Process the activation result using a normalized exponential function to obtain an adaptive Chebyshev matrix.

[0090] By performing the following nonlinear transformation on the activation result obtained in step 502, a normalized adjacency matrix can be obtained:

[0091] Where φ represents the normalized exponential function softmax.

[0092] According to the normalized adjacency matrix, the adaptive Chebyshev matrix I+φ(σ(EE T ).

[0093] Step 504: Use the adaptive Chebyshev matrix to perform a graph convolution operation on the hidden state to obtain a spatial correlation function.

[0094] In one example, the spatial correlation function can be obtained using the following formula: ψ γ (z t )=ψ1((I+φ(σ(EE T )))ψ0(z t )EW) (15)

[0095] Where W is a trainable weight tensor, ψ0 is an initial linear network, and ψ1 is an output linear network, where the initial linear network and the output linear network can be fully connected layers respectively.

[0096] In the case where the vector domain function includes a time-dependent function, the vector domain function can be expressed by the following formula: F(Θ)=h ω (t)f θ (z t ) ψ γ (z t )g v (dX / dt) (16)

[0097] Among them, Θ is a learnable parameter, h ω (t) is the time correlation function, f θ (z t ) is the state-related function, ψ γ (z t ) is the spatial correlation function, g v (dX / dt) is the gradient enhancement function, is a periodic function, is a trend function.

[0098] In the embodiments of this specification, for multivariate time series, a spatial correlation function is added to the vector domain function, which takes into account the spatial correlation between time series, improves the representation ability of the prediction model for multivariate time series prediction, and thus improves the accuracy of the prediction.

[0099] Regarding the decoding process of the hidden state, since decoding the hidden state using a single-layer convolutional network ignores the dynamics of the learned hidden state, resulting in poor prediction results, the embodiment of this specification proposes a step-by-step decoding method, as shown in Figure 6.

[0100] Step 601: Use the projection network to map the hidden state of the last moment t of the observed time series to obtain the predicted value at time t+1.

[0101] Specifically, the above mapping process can be expressed according to the following formula:

[0102] Among them, θ is a projection network used to map hidden states to outputs, z t is the hidden state at the last moment t of the observed time series.

[0103] Step 602: Estimate the hidden state at time t+1 based on the predicted value at time t+1 through first-order Euler discretization.

[0104] Specifically, the formula for first-order Euler discretization is as follows:

[0105] Among them, z is the hidden state, f θ (z t ) is the state-related function, g v (dX / dt) is the gradient enhancement function, dX / dt is the change of the interpolation signal, which can be estimated by first-order numerical difference.

[0106] Step 603: Repeat the mapping and first-order Euler discrete estimation until the predicted values ​​at all prediction moments are obtained.

[0107] According to the prediction in step 601 and z calculated in step 602 t+1 , recursively using the projection network ζ θ , the predicted value at time t+2 can be obtained, until the predicted values ​​at all predicted moments are obtained.

[0108] The above decoding method takes into account the dynamics of the learned hidden state and improves the prediction effect.

[0109] FIG7 is a schematic diagram of a time series prediction method provided by an exemplary embodiment.

[0110] The vector field function F in Figure 7 θ (z t ) is based on the time correlation function h ω (t), state-related function f θ (z t ), spatial correlation function ψ γ (z t ), gradient enhancement function g v (dX / dt) is constructed, the vector field function F θ (z t ) as shown in formula (16).

[0111] The time series prediction method can be divided into an encoding process implemented by an encoder and a decoding process implemented by a decoder, and the time series prediction network including the encoder and the decoder can be called a neural latent dynamic network.

[0112] As shown in Figure 7, the encoder first extracts the gradient of the dynamic approximation X of the observed time series to obtain gradient data.

[0113] Taking traffic flow prediction as an example, the observed time series is the traffic flow data x1, x2, ..., xn observed at time t1, t2, ..., tn. The traffic flow data can be regular time series data or irregular or incomplete time series data.

[0114] By performing gradient extraction on the continuous approximation of the observed traffic flow data and interpolating and smoothing the results of the gradient extraction, the gradient data of the signal path corresponding to the observed traffic flow data is obtained. Next, the weight parameter g of the memory enhancement network is used to calculate the gradient of the signal path corresponding to the observed traffic flow data. v Perform gradient enhancement on the gradient data; then solve the enhanced gradient data with ODE to obtain the hidden states z0, ..., z t-1 、z t , the solution process can be expressed using the following formula:

[0115] Next comes the decoding process. The decoder uses the projection network ζ θ For the hidden state z t Mapping, we get And according to Calculate z t+1 Then, according to z t+1 and projected networks θ get z t+2, and so on, until the traffic flow prediction value at the last prediction time τ is obtained

[0116] In this embodiment, by performing gradient enhancement on the gradient data of the observed time series, enhancing the temporal features of the hidden state, and increasing the spatial correlation between multivariate time series, the representation ability and interpretability of the time series prediction network model can be improved, thereby improving the accuracy of the prediction.

[0117] The heat map of the weight matrix of the time series prediction network proposed in the embodiment of this specification and the heat map of the weight matrix of the time series prediction network in the related art are shown in Figures 8A and 8B respectively. The size of the weight matrix is ​​16×16. As can be seen from the figure, the time series prediction network proposed in the embodiment of this specification has a sparser weight matrix than the related art, but can achieve better prediction results for long-distance predictions. Referring to Figure 9, Figure 9 is a block diagram of a time series prediction device provided by an exemplary embodiment, the device comprising: an acquisition unit 901 for acquiring first gradient data of an observed time series; an enhancement unit 902 for performing gradient enhancement on the first gradient data using a memory enhancement network to obtain second gradient data; a solution unit 903 for obtaining a vector domain function based on the second gradient data, and solving the vector domain function using an ordinary differential equation solver to obtain a hidden state of the time series; a decoding unit 904 for decoding the hidden state to obtain a prediction result for the future time.

[0118] In some embodiments, the enhancement unit is specifically used to: use a weight parameter matrix to convert the signal gradient in the first gradient data to obtain an enhanced signal gradient, and obtain second gradient data based on the enhanced signal gradient, wherein the weight parameter matrix is ​​formed by parameters stored in a storage body corresponding to the trained memory enhancement network.

[0119] In some embodiments, when the enhancement unit is used to convert the signal gradient in the first gradient data using a weight parameter matrix, it is specifically used to: multiply the signal gradient with the weight parameter matrix to obtain a conversion result; process the conversion result using a normalized exponential function to obtain a normalized result; and multiply the normalized result with the transposed matrix of the weight parameter matrix to obtain an enhanced signal gradient.

[0120] In some embodiments, the vector domain function further includes a time-related function, and the time function is obtained according to a periodic function and a trend function.

[0121] In some embodiments, the device also includes a time feature enhancement unit, which is used to: perform weighted summation on the superposition results of sine functions and cosine functions of different frequencies to obtain the periodic function; perform weighted summation on polynomial functions to obtain the trend function; add the periodic function and the trend function to obtain the time function, wherein the weight parameters of the periodic function and the weight parameters of the trend function are learnable parameters.

[0122] In some embodiments, when the time series is a multivariate time series, the vector domain function further includes a spatial correlation function, and the spatial correlation function is obtained by performing a graph convolution operation on the hidden state.

[0123] In some embodiments, the device also includes a spatial correlation enhancement unit, which is used to: generate an embedding matrix, each row of the embedding matrix represents a word vector for each time series; use a ReLU activation function to process the multiplication result of the embedding matrix and the transposed matrix of the embedding matrix to obtain an activation result; use a normalized exponential function to process the activation result to obtain an adaptive Chebyshev matrix; use the adaptive Chebyshev matrix to perform a graph convolution operation on the hidden state to obtain a spatial correlation function.

[0124] In some embodiments, the decoding unit is specifically used to: use a projection network to map the hidden state of the last moment t of the observed time series to obtain a predicted value at moment t+1; estimate the hidden state at moment t+1 based on the predicted value at moment t+1 through first-order Euler discretization; repeat the mapping and first-order Euler discretization estimation until the predicted values ​​of all predicted moments are obtained.

[0125] FIG10 is a schematic structural diagram of a device provided by an exemplary embodiment. Referring to FIG10 , at the hardware level, the device includes a processor 1002, an internal bus 1004, a network interface 1006, a memory 1008, and a non-volatile memory 1010, and may also include hardware required for other services. One or more embodiments of this specification may be implemented based on software, such as the processor 1002 reading the corresponding computer program from the non-volatile memory 1010 into the memory 1008 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but may also be hardware or logic devices.

[0126] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email transceiver, game console, tablet computer, wearable device, or any combination of these devices.

[0127] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0128] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0129] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0130] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0131] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0132] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "an," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0133] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when..." or "when..." or "in response to determining."

[0134] The above description is an embodiment of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification should be included in the scope of protection of one or more embodiments of this specification.

Claims

1. A time series prediction method, comprising: Obtain the first gradient data of the observed time series; Performing gradient enhancement on the first gradient data using a memory enhancement network to obtain second gradient data; Obtaining a vector domain function according to the second gradient data, and solving the vector domain function using an ordinary differential equation solver to obtain a hidden state of the time series; The hidden state is decoded to obtain a prediction result for the future time.

2. The method according to claim 1, wherein: Using the memory enhancement network to perform gradient enhancement on the first gradient data to obtain second gradient data includes: The signal gradient in the first gradient data is converted using a weight parameter matrix to obtain an enhanced signal gradient, and the second gradient data is obtained based on the enhanced signal gradient, wherein the weight parameter matrix is ​​formed by parameters stored in a storage body corresponding to the trained memory enhancement network.

3. The method according to claim 2, wherein: The signal gradient in the first gradient data is converted by using the weight parameter matrix to obtain an enhanced signal gradient, including: Multiplying the signal gradient by the weight parameter matrix to obtain a conversion result; Processing the conversion result using a normalized exponential function to obtain a normalized result; The normalized result is multiplied by the transposed matrix of the weight parameter matrix to obtain an enhanced signal gradient.

4. The method according to any one of claims 1 to 3, wherein: The vector domain function also includes a time-related function, and the time function is obtained according to a periodic function and a trend function.

5. The method according to claim 4, further comprising: Performing weighted summation on superposition results of sine functions and cosine functions of different frequencies to obtain the periodic function; Performing weighted summation on the polynomial function to obtain the trend function; The periodic function and the trend function are added to obtain the time function, Among them, the weight parameter of the periodic function and the weight parameter of the trend function are learnable parameters.

6. The method according to any one of claims 1 to 3, wherein: In the case where the time series is a multivariate time series, the vector domain function further includes a spatial correlation function, and the spatial correlation function is obtained by performing a graph convolution operation on the hidden state.

7. The method according to claim 6, further comprising: Generate an embedding matrix, each row of which represents the word vector of each time series; Using a ReLU activation function to process a multiplication result of the embedding matrix and a transposed matrix of the embedding matrix to obtain an activation result; Processing the activation result by using a normalized exponential function to obtain an adaptive Chebyshev matrix; The adaptive Chebyshev matrix is ​​used to perform a graph convolution operation on the hidden state to obtain a spatial correlation function.

8. The method according to claim 1, wherein: The hidden state is decoded to obtain a prediction result for the future time, including: Use the projection network to map the hidden state of the last moment t of the observed time series to obtain the predicted value at moment t+1; Through the first-order Euler discretization, the hidden state at time t+1 is estimated based on the predicted value at time t+1; The mapping and first-order Euler discrete estimation are repeated until the predicted values ​​at all prediction times are obtained.

9. A time series prediction device, comprising: An acquisition unit, used for acquiring first gradient data of an observed time series; an enhancement unit, configured to perform gradient enhancement on the first gradient data using a memory enhancement network to obtain second gradient data; A solving unit, configured to obtain a vector domain function according to the second gradient data, and solve the vector domain function using an ordinary differential equation solver to obtain a hidden state of the time series; A decoding unit is used to decode the hidden state to obtain a prediction result for a future time.

10. An electronic device, comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 8 by running the executable instructions.

11. A computer-readable storage medium having computer-executable instructions stored thereon, wherein the instructions are executed by a processor to implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Power load prediction method based on TPA-Seq2Seq, and related components

    CN111553543A

  • Flow prediction method for intelligent traffic control system

    CN115470886A

  • Prediction method for resisting incomplete data of auto-encoder by fusing neural differential equation

    CN115687860A

  • Time sequence prediction method and device

    CN116432834A

  • Gradient learning for probabilistic ARMA time-series models

    US20060129395A1

Cited By

  • Load probability prediction method based on double attention and quantile regression

    CN118863603A

  • Industrial time series AIGC basic model, electronic device and computer program product

    CN119003997A

  • Wind power generation power prediction method and system

    CN119312168A

  • Power distribution equipment cooperative control method and system based on edge calculation

    CN120262704A

  • Intelligent indoor disinfection effect prediction method and system

    CN120386989A