Data prediction method and device based on time sequence model
By integrating LSTM, SVM, and ANN models and combining them with linear regression, the problem of predicting large-sample nonlinear data in oil and gas field production processes has been solved, enabling real-time prediction of production data for oil and gas field enterprises and improving the level of intelligent management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA NAT PETROLEUM CORP
- Filing Date
- 2024-11-26
- Publication Date
- 2026-05-26
AI Technical Summary
Existing time series forecasting models struggle to effectively fit and predict large-sample, nonlinear, and complex energy consumption series data in oil and gas field production processes, resulting in insufficient intelligent management levels for oil and gas field enterprises.
By integrating Long Short-Term Memory Network (LSTM), Support Vector Machine (SVM), and Neural Network (ANN) models, and by normalizing and reconstructing the phase space of historical data, the system utilizes the prediction results of a linear regression model combined with multiple neural network models to achieve real-time prediction of future production data.
It has improved the level of intelligent management in oil and gas field enterprises, enabling accurate prediction of future production data and enhancing the intelligent management capabilities of the production process.
Smart Images

Figure CN122087757A_ABST
Abstract
Description
Technical Field
[0001] This article relates to the field of energy conservation and consumption reduction technology in oil and gas fields, and in particular to a data prediction method and device based on a time series model. Background Technology
[0002] For time series forecasting, traditional models such as autoregressive (AR), moving average (MA), and moving autoregressive (ARMA) models perform well when handling small, linear, and stationary data. However, they do not exhibit strong robustness when dealing with large datasets where there is no strong linear relationship between the data points.
[0003] In recent years, with the development of artificial intelligence and deep learning, related models have been applied in various fields. For example, Long Short-Term Memory (LSTM) models have been used to predict time series-related problems, and artificial neural networks and support vector machines have been widely used in various prediction scenarios. However, for production time series data in oilfield production processes, due to the numerous processes, complex business links, and influences from external environments, energy consumption series data exhibits certain periodic characteristics and strong nonlinear characteristics. Using a single model makes it difficult to fit the data trends. Therefore, addressing these challenges by establishing a time series prediction model based on historical production data accumulated by oil and gas companies is an urgent problem to be solved. Summary of the Invention
[0004] This application provides a data prediction method and apparatus based on a time series model. By integrating Long Short-Term Memory Network (LSTM), Support Vector Machine (SVM), and Neural Network Model (ANN), this application enables real-time prediction of important production data in the production process of oil and gas field enterprises. Based on historical production data, it calculates the enterprise's production data at a future point in time, thereby improving the enterprise's intelligent management level.
[0005] In a first aspect, this application provides a data prediction method based on a time series model, the method comprising:
[0006] Collect historical data within a predetermined time range and normalize the historical data;
[0007] The normalized historical data is used to make predictions using each of the trained time series models to obtain the prediction data corresponding to each model.
[0008] Based on the prediction data corresponding to each model, the prediction data for the predetermined time point is obtained using a linear regression model.
[0009] Optionally, the step of collecting historical data within a predetermined time range and normalizing the historical data includes:
[0010] Based on the phase space reconstruction time window, collect historical data within the predetermined time window range;
[0011] The historical data is subjected to phase space reconstruction processing;
[0012] The historical data after phase space reconstruction is normalized to obtain normalized historical data.
[0013] Optionally, the time series model includes: a long short-term memory network model, a support vector machine model, and a neural network model.
[0014] Optionally, the training process of the network model in the time series model is as follows:
[0015] Acquire sample data and reconstruct the phase space of the sample data;
[0016] Normalize the sample data after phase space reconstruction;
[0017] The normalized sample data is divided into a training sample dataset and a test sample dataset;
[0018] The initial network model is obtained by training each network model in the time series model using the training sample dataset.
[0019] The initial network model was validated using a test sample dataset, resulting in a trained neural network model and a long short-term memory network model.
[0020] Optionally, the neural network model includes an input layer, a hidden layer, and an output layer;
[0021] The input layer contains 5 neurons, the hidden layer contains 4 neurons, and the output layer contains 1 neuron.
[0022] The Long Short-Term Memory (LSTM) network model consists of three parts: a forget gate, a memory gate, and an output gate.
[0023] Optionally, the training process of the support vector machine model in the time series model is as follows:
[0024] Acquire sample data and reconstruct the phase space of the sample data;
[0025] Normalize the sample data after phase space reconstruction;
[0026] The normalized sample data is divided into a training sample dataset and a test sample dataset;
[0027] Support vector machine models for each function were established using linear kernel function, polynomial kernel function, radial basis function, Fourier kernel function, and Sigmoid kernel function, respectively.
[0028] For each type of support vector machine model, the same loss function is used to train the model using the training sample dataset to obtain the initial model.
[0029] For the test sample dataset, the mean squared error of the support vector machine model corresponding to each loss function is calculated.
[0030] The support vector machine model corresponding to the minimum mean squared error is determined as the final support vector machine model.
[0031] Optionally, the linear regression model is:
[0032] y′=x1*y Ann +x2*y lstm +x3*y svm +x4;
[0033] In the above model, y′ is the predicted value of the linear regression model, y Ann y is the predicted value of the neural network model. lstm y represents the predicted value from the Long Short-Term Memory network model. svm x1, x2, x3, and x4 are the predicted values of the support vector machine model; x1, x2, x3, and x4 are coefficients.
[0034] Optionally, the training process for the linear regression model is as follows:
[0035] The linear regression model is trained using each training sample to obtain the corresponding prediction data;
[0036] The loss value for this sample is calculated based on the predicted data and the loss function of the linear regression model.
[0037] The four coefficients of the linear regression model corresponding to the minimum loss value are determined using the least squares method;
[0038] The trained linear regression model is obtained based on the four determined coefficients.
[0039] Optionally, the loss function of the linear regression model is:
[0040]
[0041] In the above formula, loss is the loss value, y′ i Let y be the predicted value of the linear regression model for the i-th sample data. i Let be the true value of the i-th sample data, where i is the sample data number and n is the number of datasets.
[0042] Secondly, this application also provides a data prediction device based on a time series model, characterized in that the device includes: a memory and a processor; the memory is used to store a data prediction program based on a time series model, and the processor is used to read and execute the data prediction program based on a time series model, and execute the method described in any one of the above embodiments.
[0043] Thirdly, this application also provides a computer-readable storage medium storing a data processing program, which is executed by a processor using the data prediction method based on a time series model as described in any of the above embodiments.
[0044] Compared with related technologies, this application provides a data prediction method and apparatus based on a time series model. The method includes: collecting historical data within a predetermined time range and normalizing the historical data; predicting the normalized historical data using each model in a trained time series model to obtain predicted data corresponding to each model; and obtaining predicted data for a predetermined time point using a linear regression model based on the predicted data corresponding to each model. This application achieves real-time prediction of important production data in the production process of oil and gas field enterprises by integrating Long Short-Term Memory Network (LSTM), Support Vector Machine (SVM), and ANN models, and calculates the enterprise's production data for a future point in time based on historical production data, thereby improving the intelligent management level of the enterprise.
[0045] Other features and advantages of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the application. Other advantages of this application can be realized and obtained by means of the solutions described in the description and the accompanying drawings. Attached Figure Description
[0046] The accompanying drawings are used to provide an understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0047] Figure 1 This is a flowchart of a data prediction method based on a time series model according to an embodiment of this application;
[0048] Figure 2 This is a schematic diagram of a data prediction device based on a time series model according to an embodiment of this application;
[0049] Figure 3 This is a flowchart illustrating the data acquisition and sample partitioning process in one exemplary embodiment.
[0050] Figure 4 This is a flowchart of data normalization processing in an exemplary embodiment;
[0051] Figure 5 This is a flowchart of the model training process in one exemplary embodiment;
[0052] Figure 6 This is a schematic diagram illustrating the construction and calculation process of a linear regression model in an exemplary embodiment.
[0053] Figure 7 This is a flowchart of data prediction based on a time series model in an exemplary embodiment. Detailed Implementation
[0054] This application describes several embodiments, but these descriptions are exemplary and not restrictive, and it will be apparent to those skilled in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with, or may replace, any feature or element of any other embodiment.
[0055] This application includes and contemplates combinations of features and elements known to those skilled in the art. The embodiments, features, and elements disclosed in this application may also be combined with any conventional features or elements to form a unique inventive scheme as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive schemes to form another unique inventive scheme as defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in this application may be implemented individually or in any suitable combination. Therefore, the embodiments are not limited except by the limitations imposed by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.
[0056] Furthermore, in describing representative embodiments, the specification may have presented methods and / or processes as a specific sequence of steps. However, the method or process should not be limited to the specific order of steps described herein, to the extent that it does not depend on such a specific order. As will be understood by those skilled in the art, other sequences of steps are also possible. Therefore, the specific order of steps set forth in the specification should not be construed as a limitation of the claims. Moreover, the claims concerning the method and / or process should not be limited to the steps performed in the written order, and those skilled in the art will readily understand that these orders can be varied and still remain within the spirit and scope of the embodiments of this application.
[0057] This invention provides a data prediction method based on a time series model, such as... Figure 1 As shown, the method includes steps S100-S120:
[0058] S100: Collect historical data within a predetermined time range and normalize the historical data;
[0059] S110: Use each of the trained time series models to predict the normalized historical data to obtain the prediction data corresponding to each model.
[0060] S120: Based on the prediction data corresponding to each model, use a linear regression model to obtain the prediction data at a predetermined time point.
[0061] In one exemplary embodiment, historical data within a predetermined time range is collected, and the historical data is normalized, including:
[0062] Step 1: Collect historical data within the predetermined time window range according to the phase space reconstruction time window;
[0063] Identify oil and gas field companies and collect hourly data from these companies over several consecutive months. For example, if the phase space reconstruction window is 5 hours, and you need to predict data for 8 AM on a certain day, you need to collect historical data from the 5 hours preceding that time (3 AM to 7 AM).
[0064] Step 2: Perform phase space reconstruction processing on historical data;
[0065] Step 3: Normalize the data after phase space reconstruction to obtain normalized historical data.
[0066] In one exemplary embodiment, the time series model includes: a Long Short-Term Memory (LSTM) network model, a Support Vector Machine (SVM) model, and an ANN neural network model.
[0067] In one exemplary embodiment, the training process of the time series model is as follows:
[0068] Step 1: Obtain sample data and reconstruct the phase space of the sample data;
[0069] Step 2: Normalize the sample data after phase space reconstruction;
[0070] Step 3: Divide the normalized sample data into training sample datasets and test sample datasets;
[0071] Step 4: Use the training sample dataset to train each network model in the time series model to obtain the initial network model;
[0072] Step 5: Validate the initial network model using the test sample dataset to obtain the trained neural network model, long short-term memory network model, and support vector machine model.
[0073] In one exemplary embodiment, the neural network model includes an input layer, a hidden layer, and an output layer;
[0074] The input layer contains 5 neurons, the hidden layer contains 4 neurons, and the output layer contains 1 neuron.
[0075] The activation function used is ReLU = max(0, x);
[0076] The loss function is:
[0077] To meet different needs, neural network models can be built according to specific circumstances, for example:
[0078] The dataset {x} after spatial reconstruction i A three-layer neural network model ANN is constructed for the time window {i = 1, 2, ..., M}. If the dimension of the time window is m, then the input layer contains m neurons, the hidden layer contains N neurons, and the output layer contains 1 neuron. The default value for N is set to 1.
[0079] In this model, the activation function ReLU = max(0,x) is used;
[0080] The loss function is:
[0081] Where n is the number of datasets, v d For the model prediction result of the d-th data, y d The label of the dth data item is selected from the training set {x}. i-train For each element i = 1, 2, ..., a, the loss function e is optimized using stochastic gradient descent or other optimization algorithms.
[0082] During training, the validation set {x} is used. i-valiadte Randomly verify the training effect of the model (i = 1, 2, ..., b) to ensure the effectiveness of model training. When the model converges or reaches the maximum number of iterations, stop training and mark the model as Ann.
[0083] In one exemplary embodiment, the Long Short-Term Memory (LSTM) network model consists of three parts: a forget gate, a memory gate, and an output gate.
[0084] Establish a fully connected neural network model, setting the number of input features of the fully connected neural network model to W, the fully connected neural network model does not contain hidden layers, and the output dimension of the neural network model is 1.
[0085] In this model, the activation function ReLU = max(0,x) is used;
[0086] The loss function is:
[0087] Where n is the number of datasets, v d For the model prediction result of the d-th data, y d The label of the dth data item is selected from the training set {x}. i-train The model is trained on the set {x,i = 1, 2, ..., a}. During the training process, the validation set {x} is used. i-valiadte The training results of the model are randomly verified for i = 1, 2, ..., b to ensure the effectiveness of the model training. When the model converges or reaches the number of iterations, the training stops and the model is marked as Lstm.
[0088] In one exemplary embodiment, the training process of the support vector machine model is as follows:
[0089] Step 1: Establish support vector machine models for each type of kernel function, including linear kernel function, polynomial kernel function, radial basis function, Fourier kernel function, and Sigmoid kernel function.
[0090] Step 2: Train the support vector machine model using the same loss function for each function.
[0091] Step 3: Calculate the mean squared error of the support vector machine model for each sample test set for each function using the loss function;
[0092] Step 4: Determine the support vector machine model of the function corresponding to the minimum mean square error, and use it as the final support vector machine model.
[0093] In one exemplary embodiment, the linear regression model is:
[0094] y′=x1*yAnn +x2*y lstm +x3*y svm +x4;
[0095] In the above model, y′ is the predicted value of the linear regression model, y Ann y is the predicted value of the neural network model. lstm y represents the predicted value from the Long Short-Term Memory network model. svm x1, x2, x3, and x4 are the predicted values of the support vector machine model; x1, x2, x3, and x4 are coefficients.
[0096] In this embodiment, the training process of the linear regression model is as follows:
[0097] Step 1: Train the linear regression model using each training sample to obtain the corresponding predicted data y′. i ;
[0098] Step 2: Based on the predicted data y′ i The loss function of the linear regression model is used to calculate the loss value of the sample.
[0099] The loss function for the linear regression model is:
[0100]
[0101] In the above formula, loss is the loss value, y′ i Let y be the predicted value of the linear regression model for the i-th sample data. i Let be the true value of the i-th sample data, where i is the sample data number and n is the total number of sample data.
[0102] Step 3: Use the least squares method to determine the four coefficients x1, x2, x3 and x4 of the linear regression model corresponding to the minimum loss value;
[0103] Step 4: Based on the four determined coefficients x1, x2, x3 and x4, obtain the trained linear regression model.
[0104] The specific training process is as follows: After the three models—Long Short-Term Memory (LSTM), Support Vector Machine (SVM), and ANN—are trained, the spatially reconstructed dataset {x} is used. i Construct a linear regression model y′=x1*y for i=1,2,…,M}. Ann +x2*y lstm +x3*y svm +x4,
[0105] Where, y′ i =x1*y Ann-i +x2*ylstm-i +x3*y svm-i +x4, where n is the number of datasets, y i Let y be the label of the i-th dataset. Ann-i Let y be the prediction result of the Ann model for the i-th dataset. lstm-i The prediction result of the Lstm model for the i-th dataset, y svm-i This represents the prediction result of the SVM model for the i-th dataset.
[0106] Select all datasets {x i For each i = 1, 2, ..., M, the loss function is optimized using the least squares method to determine the coefficients x1, x2, x3 and x4.
[0107] The final model is determined based on the determined coefficients, y′.
[0108] In one exemplary embodiment, based on the prediction data corresponding to each model, a linear regression model is used to obtain the prediction data at a predetermined time point. The specific implementation process is as follows:
[0109] First, the normalized historical dataset is input into the trained Ann, Lstm, and SVM models respectively, and the output of each model is calculated and labeled as y. ANN ,y lstm and y svm ;
[0110] Then, based on the trained linear regression model, we calculate y′=x1*y Ann +x2*y lstm +x3*y svm +x4, and use the calculated value as the final prediction result.
[0111] Secondly, this application also provides a data prediction device based on a time series model, such as... Figure 2 As shown, the device includes a memory 200 and a processor 210; the memory is used to store a data prediction program based on a time series model, and the processor is used to read and execute the data prediction program based on a time series model, and to execute the method described in any of the above embodiments.
[0112] Thirdly, this application also provides a computer-readable storage medium storing a data processing program, which is executed by a processor using the data prediction method based on a time series model as described in any of the above embodiments.
[0113] The method implemented in this application has the following technical effects:
[0114] 1. By integrating Long Short-Term Memory Network (LSTM), Support Vector Machine (SVM), and Neural Network Model (ANN), a linear regression model is obtained to solve the problem of predicting production data at a future point in time during the production process of oil and gas field enterprises;
[0115] 2. This method can generate production data for a future point in time based on historical production data of oil and gas field enterprises, thereby improving the enterprise's intelligent management level.
[0116] Example 1
[0117] This example demonstrates the implementation process of verifying the data of an oil and gas field company using the time-series model-based automatic data verification method described in this application:
[0118] The first step is to collect data and divide the collected data into test sample sets and training sample sets. The specific execution process is as follows: Figure 3 As shown.
[0119] Step 300: For the target oil and gas field enterprise to be processed, collect historical production data of the oil and gas field enterprise according to time series. The collection frequency is hourly, and the collection time is 121 hours. Mark the collected time series dataset as {X}. i ,i=1,2,…,121}, then {X i} is marked as the energy consumption of the enterprise on day i.
[0120] Step 310: Reconstruct the phase space of the dataset.
[0121] For the dataset {X} collected in step 11 i Phase space reconstruction is performed to obtain the time series model {x}. i ,i=1,2,…,116};
[0122] The input is represented as x t =[X t ,X t+1 ,X t+2 ,…,X t+m-1 Let t = 1, 2, ..., 116, m = 5, each data point has a dimension of 5, the sliding window is 1, and for the t-th data point, the corresponding output is Y. t =x t+m .
[0123] Step 310: Divide the sample set
[0124] The phase space reconstructed data {x} is reconstructed according to a 3:1 ratio. i The i = 1, 2, ..., 116} are divided into training sample set and validation sample set respectively;
[0125] The training sample set is labeled as {x} i-train ,i=1,2,…,87}
[0126] The validation sample set is labeled as {x i-valiadte ,i=1,2,…,29}
[0127] Step 2: Normalize the data, specifically as follows: Figure 4 As shown.
[0128] Step 400: Normalize the collected historical production dataset to map the enterprise's historical production data to a range of 0 to 1.
[0129] Specifically, it refers to the entire dataset {x} after the phase space is reconstructed. i The production data of each hour of the enterprise is normalized to the range of 0 to 1, and the normalization rule is recorded.
[0130] Step 410: Record the normalization rule. In practical applications, all data are normalized using the same normalization rule.
[0131] Step 3: Train the neural network model, specifically the Long Short-Term Memory network model and the Support Vector Machine model, as follows: Figure 5 As shown.
[0132] Step 500: Select a neural network model, a long short-term memory network model, and a support vector machine model; initialize the model parameters; and set the maximum number of iterations and the model convergence value.
[0133] Step 510: Use the training set to train the model. During the training process, use a validator to validate the model. After the model converges, label the model with LSTM, SVM, and Ann.
[0134] The specific training process for each model is as follows:
[0135] I. Training the Neural Network Model
[0136] Using the spatially reconstructed dataset {x i Establish a three-layer neural network model for i = 1, 2, ..., 116; the three layers of the neural network model are: input layer, hidden layer and output layer.
[0137] The input layer contains 5 neurons, the hidden layer contains 4 neurons, and the output layer contains 1 neuron.
[0138] The activation function is: ReLU = max(0, x).
[0139] The loss function is:
[0140] Where n = 87 is the number of training sets, v d For the model prediction result of the d-th data, y d The label for the dth data item.
[0141] Select training set {x i-train For the set i = 1, 2, ..., 87, the loss function e is optimized using stochastic gradient descent or other optimization algorithms.
[0142] During training, the validation set {x} is used. i-valiadte The training results of the model are randomly verified using the set {x,i = 1, 2, ..., 29}. When the model converges or reaches the maximum number of iterations, training stops. The model is then labeled as Ann, and the training set {x} is used to perform random validation. i-train The prediction results for each element of the group i = 1, 2, ..., 87 are labeled as y. ANN .
[0143] II. Training the Long Short-Term Memory Network Model
[0144] The dataset {x} after spatial reconstruction i Establish a Long Short-Term Memory (LSTM) network model for i = 1, 2, ..., 116. The LSM network model consists of three parts: the forget gate, the memory gate, and the output gate.
[0145] Establish a fully connected neural network model, setting the number of input features to 10, the fully connected neural network model to have no hidden layers, and the output dimension of the neural network model to 1.
[0146] The activation function is: ReLU = max(0, x).
[0147] The loss function is:
[0148] Where n = 87 is the number of training sets, v d For the model prediction result of the d-th data, y d The label for the dth data item.
[0149] Select training set {x i-train The model is trained on the set {x,i = 1, 2, ..., 87}. During the training process, the validation set {x} is used. i-valiadte The training results of the model are randomly verified using the set {x,i = 1, 2, ..., 29}. When the model converges or reaches the required number of iterations, training is stopped. The model is then labeled as Lstm, and the training set {x} is used to verify the training results. i-train The prediction results for each element of the group i = 1, 2, ..., 87 are labeled as y. lstm .
[0150] III. Training the Support Vector Machine Model
[0151] The dataset {x} after spatial reconstruction i Support vector machine (SVM) models are built for the set {x,i = 1, 2, ..., 116}. Linear kernel functions, polynomial kernel functions, radial basis function kernel functions, Fourier kernel functions, and Sigmoid kernel functions are selected to build different SVM models. For each function's corresponding SVM model, the same loss function is used to train the model. The prediction results of the SVM model for each function are calculated using the sample test set. i-train The prediction results for each element of the group i = 1, 2, ..., 87 are labeled as y. svm .
[0152] The mean squared error is calculated using the loss function; the support vector machine model corresponding to the minimum mean squared error is determined as the final support vector machine model, labeled as SVM.
[0153] Step 4: Construction and training of the linear regression model y′
[0154] like Figure 6 As shown, the specific process includes:
[0155] Step 600: Construct a new model y′=x1*y Ann +x2*y lstm +x3*y svm +x4
[0156] Step 610: Select the training set and validation set, and use the least squares method to determine the coefficients x1, x2, x3 and x4.
[0157] The dataset {x} after spatial reconstruction i For each i = 1, 2, ..., 116, the training set {x} is selected. i-train Design of i = 1, 2, ..., 87 Where y′ i =x1*y Ann-i +x2*y lstm-i +x3*y svm-i +x4, where y i Let y be the label of the i-th training dataset. Ann-i For the prediction result of the Ann model on the i-th training dataset, y lstm-i The prediction result of the Lstm model for the i-th training dataset, y svm-i This represents the prediction result of the SVM model for the i-th training dataset. The loss function is optimized using the least squares method to determine the coefficients x1, x2, x3, and x4.
[0158] Step 620: Mark y′ as the final model.
[0159] Step 5: Use the actual dataset for prediction
[0160] like Figure 7 As shown, the details are as follows:
[0161] Step 700: Collect the company's production data from the past m hours (m>100);
[0162] Step 710: Normalize the data using the normalization rules described above;
[0163] The test dataset was normalized using a normalization principle and then input into the Ann, LSTM, and SVM models respectively. Their outputs were calculated and labeled as y. ANN ,y lstm and y svm ;
[0164] Step 720: Calculate the prediction results for the normalized data using models LSTM, SVM, and Ann respectively, and use y ANN ,y lstm and y svm Mark them separately
[0165] Step 730: Use the model y′=x1*y Ann +x2*y lstm +x3*y svm +x4 calculation
[0166] The calculated value will be used as the final prediction result.
[0167] This method enables real-time prediction of key production data in oil and gas field enterprises. Based on historical production data, the model calculates the enterprise's production data at a future point in time, thereby improving the enterprise's intelligent management level.
[0168] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
Claims
1. A data prediction method based on a time series model, characterized in that, The method includes: Collect historical data within a predetermined time range and normalize the historical data; The normalized historical data is used to make predictions using each of the trained time series models to obtain the prediction data corresponding to each model. Based on the prediction data corresponding to each model, the prediction data for the predetermined time point is obtained using a linear regression model.
2. The data prediction method based on a time series model according to claim 1, characterized in that, The process of collecting historical data within a predetermined time range and normalizing the historical data includes: Based on the phase space reconstruction time window, collect historical data within the predetermined time window range; The historical data is subjected to phase space reconstruction processing; The historical data after phase space reconstruction is normalized to obtain normalized historical data.
3. The data prediction method based on a time series model according to claim 1, characterized in that, The time series models include: Long Short-Term Memory Network (LSTM) model, Support Vector Machine (SVM) model, and Neural Network (NN) model.
4. The data prediction method based on a time series model according to claim 3, characterized in that, The training process of the network model in the time series model is as follows: Acquire sample data and reconstruct the phase space of the sample data; Normalize the sample data after phase space reconstruction; The normalized sample data is divided into a training sample dataset and a test sample dataset; The initial network model is obtained by training each network model in the time series model using the training sample dataset. The initial network model was validated using a test sample dataset, resulting in a trained neural network model and a long short-term memory network model.
5. The data prediction method based on a time series model according to claim 3, characterized in that, The neural network model includes an input layer, hidden layers, and an output layer; The input layer contains 5 neurons, the hidden layer contains 4 neurons, and the output layer contains 1 neuron. The Long Short-Term Memory (LSTM) network model consists of three parts: a forget gate, a memory gate, and an output gate.
6. The data prediction method based on a time series model according to claim 3, characterized in that, The training process of the support vector machine model in the time series model is as follows: Acquire sample data and reconstruct the phase space of the sample data; Normalize the sample data after phase space reconstruction; The normalized sample data is divided into a training sample dataset and a test sample dataset; Support vector machine models for each function were established using linear kernel function, polynomial kernel function, radial basis function, Fourier kernel function, and Sigmoid kernel function, respectively. For each type of support vector machine model, the same loss function is used to train the model using the training sample dataset to obtain the initial model. For the test sample dataset, the mean squared error of the support vector machine model corresponding to each loss function is calculated. The support vector machine model corresponding to the minimum mean squared error is determined as the final support vector machine model.
7. The data prediction method based on a time series model according to claim 3, characterized in that, The linear regression model is as follows: y′=x1*y Ann +x2*y lstm +x3*y svm +x4; In the above model, y′ is the predicted value of the linear regression model, y Ann y is the predicted value of the neural network model. lstm y represents the predicted value from the Long Short-Term Memory network model. svm x1, x2, x3, and x4 are the predicted values of the support vector machine model; x1, x2, x3, and x4 are coefficients.
8. The data prediction method based on a time series model according to claim 7, characterized in that, The training process for a linear regression model is as follows: The linear regression model is trained using each training sample to obtain the corresponding prediction data; The loss value for this sample is calculated based on the predicted data and the loss function of the linear regression model. The four coefficients of the linear regression model corresponding to the minimum loss value are determined using the least squares method; The trained linear regression model is obtained based on the four determined coefficients.
9. The data prediction method based on a time series model according to claim 8, characterized in that, The loss function of the linear regression model is: In the above formula, loss is the loss value, y′ i Let y be the predicted value of the linear regression model for the i-th sample data. i Let be the true value of the i-th sample data, where i is the sample data number and n is the number of datasets.
10. A data prediction device based on a time series model, characterized in that, The apparatus includes a memory and a processor; the memory is used to store a data prediction program based on a time series model, and the processor is used to read and execute the data prediction program based on a time series model, performing the method according to any one of claims 1-9.
11. A computer-readable storage medium storing a data processing program, the data processing program being executed by a processor according to any one of claims 1-9, the data prediction method based on a time series model.