CN110232437B - CNN-based time series prediction method and model determination method - Google Patents

CNN-based time series prediction method and model determination method Download PDF

Info

Publication number
CN110232437B
CN110232437B CN201910460741.0A CN201910460741A CN110232437B CN 110232437 B CN110232437 B CN 110232437B CN 201910460741 A CN201910460741 A CN 201910460741A CN 110232437 B CN110232437 B CN 110232437B
Authority
CN
China
Prior art keywords
data
period
layer structure
layer
convolution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910460741.0A
Other languages
Chinese (zh)
Other versions
CN110232437A (en
Inventor
李肯立
王康
陈岑
李克勤
段明星
刘楚波
阳王东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan University
Original Assignee
Hunan University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan University filed Critical Hunan University
Priority to CN201910460741.0A priority Critical patent/CN110232437B/en
Publication of CN110232437A publication Critical patent/CN110232437A/en
Application granted granted Critical
Publication of CN110232437B publication Critical patent/CN110232437B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application relates to a CNN-based time series prediction method and a model determination method. The prediction method comprises the following steps: acquiring historical time sequence data, and determining cycle parameters according to cycle characteristics of the historical time sequence data, wherein the cycle parameters comprise cycle types and cycle duration corresponding to the cycle types; determining corresponding component data of the prediction time point in the historical time series data based on the prediction time point, the historical time series data, the period parameter and a preset cycle span, wherein the component data comprises closest time period data and period data; and predicting the component data by adopting the determined CNN model to obtain a prediction result corresponding to the prediction time point. By adopting the method, the time series information can be predicted efficiently and accurately.

Description

CNN-based time series prediction method and model determination method
Technical Field
The present application relates to the field of computer technologies, and in particular, to a CNN-based time series prediction method, apparatus, computer device, and storage medium, and a CNN-based time series prediction model determination method, apparatus, computer device, and storage medium.
Background
The time series refers to a series formed by arranging numerical values of the same statistical index according to the occurrence time sequence, and the main purpose of time series prediction is to predict the future according to the existing historical data. With the development of artificial neural networks, the application of the Recurrent Neural Networks (RNNs) in time series prediction has become more and more mature. However, currently, for a time sequence, the RNN can only extract long-term and short-term related information of data from a time trajectory, and cannot give feedback to periodic information of the sequence, which has the problems of long time consumption and inaccurate prediction result.
Disclosure of Invention
Based on this, it is necessary to provide a CNN-based time series prediction method, apparatus, computer device and storage medium, and a CNN-based time series prediction model construction method, apparatus, computer device and storage medium, in view of the above technical problems.
A CNN-based time series prediction method, the method comprising:
acquiring historical time sequence data, and determining cycle parameters according to cycle characteristics of the historical time sequence data, wherein the cycle parameters comprise cycle types and cycle duration corresponding to the cycle types;
determining component data corresponding to the prediction time point in the historical time series data based on the prediction time point, the historical time series data, the period parameter and a preset cycle span, wherein the component data comprises closest time period data and period data;
and predicting the component data by adopting the determined CNN model to obtain a prediction result corresponding to the prediction time point.
A CNN-based time series prediction apparatus, the apparatus comprising:
the period parameter acquisition module is used for acquiring historical time sequence data and determining period parameters according to the period characteristics of the historical time sequence data, wherein the period parameters comprise period types and period durations corresponding to the period types;
a component data determination module, configured to determine, based on a predicted time point, the historical time-series data, the cycle parameter, and a preset cycle span, component data corresponding to the predicted time point in the historical time-series data, where the component data includes closest time period data and cycle data;
and the prediction module is used for predicting the component data by adopting the determined CNN model to obtain a prediction result corresponding to the prediction time point.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the CNN-based time series prediction method when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the CNN-based time series prediction method.
According to the CNN-based time series prediction method, the CNN-based time series prediction device, the CNN-based time series prediction method and the CNN-based time series prediction device, the CNN-based time series prediction device and the CNN-based storage medium, the CNN-based time series prediction device are used for extracting component data including data in the closest time period and periodic data by analyzing the periodic characteristics of the time series and processing the data to be tested according to the periodic characteristics, wherein the periodic data can include multiple groups of data, such as short periodic data and long periodic data, and the characteristics of the time series can be integrated from the global through the component data, so that when the CNN-based time series prediction device analyzes the component data, comprehensive and accurate data characteristics can be extracted, and further, the subsequent time series information can be predicted efficiently and accurately.
A CNN-based method for determining a time series prediction model, the method comprising:
acquiring time sequence sample data, and determining a period parameter according to the period characteristic of the time sequence sample data, wherein the time sequence sample data comprises data to be trained and data to be tested, and the period parameter comprises a period type and a period duration corresponding to the period type;
determining component data corresponding to the data to be trained in the time sequence sample data based on the data to be trained, the time sequence sample data, the period parameter and a preset cycle span, wherein the component data comprises closest time period data and period data;
and training the component data by adopting a CNN model to be trained to obtain a training result corresponding to the data to be trained, adjusting parameters of the CNN model to be trained according to the difference between the training result corresponding to the data to be trained and a real result, and continuing training until a training end condition is met to obtain a trained model.
A CNN-based time series prediction model determination apparatus, the apparatus comprising:
the period parameter acquisition module is used for acquiring time sequence sample data and determining period parameters according to the period characteristics of the time sequence sample data, wherein the time sequence sample data comprises data to be trained and data to be tested, and the period parameters comprise period types and period durations corresponding to the period types;
a component data determining module, configured to determine, based on the data to be trained, the time sequence sample data, the period parameter, and a preset cycle span, component data corresponding to the data to be trained in the time sequence sample data, where the component data includes data of a closest time period and periodic data;
and the training module is used for training the component data by adopting a CNN model to be trained to obtain a training result corresponding to the data to be trained, adjusting parameters of the CNN model to be trained according to the difference between the training result corresponding to the data to be trained and the real result, and continuing training until a training end condition is met to obtain the trained CNN model.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the CNN-based time series prediction model determination method when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the CNN-based time series prediction model determination method.
The CNN-based time series prediction model determining method, device, computer equipment and storage medium, by analyzing the periodic characteristics of the time series and processing the data to be trained according to the periodic characteristics, component data including data of the closest time period and periodic data are extracted, the periodic data may include multiple sets of data, such as short-period data and long-period data, and the features of the time series may be integrated from the global perspective by these component data, therefore, when the convolutional neural network analyzes the component data, comprehensive and accurate data characteristics can be extracted, further, the time series information after the prediction is efficiently and accurately predicted, in addition, the component data is input into the convolution neural network for processing, the method can improve the capability of data parallel computation, accelerate the training and testing speed and save the time of model training and testing.
Drawings
FIG. 1 is a schematic flow chart of an embodiment of a CNN-based time series prediction method;
FIG. 2 is a schematic diagram of short-term information of a traffic data set in one embodiment;
FIG. 3 is a diagram illustrating short-term information for a solar data set in one embodiment;
FIG. 4 is a diagram illustrating long period information for a traffic data set in one embodiment;
FIG. 5 is a diagram illustrating long period information for a solar data set in one embodiment;
FIG. 6 is a schematic diagram of an autocorrelation of a traffic data set in one embodiment;
FIG. 7 is a schematic diagram of an autocorrelation of a solar data set in one embodiment;
FIG. 8 is a flow diagram illustrating a CNN-based time series prediction method in one embodiment;
FIG. 9 is a diagram of a Resnet network architecture in one embodiment;
FIG. 10 is a flow diagram illustrating a CNN-based time series prediction model determination method in one embodiment;
FIG. 11 is a diagram illustrating a parallel computation structure for model data in one embodiment;
fig. 12 is a block diagram showing a configuration of a CNN-based time series prediction apparatus according to an embodiment;
fig. 13 is a block diagram showing the configuration of a CNN-based time series prediction model determination apparatus in one embodiment;
FIG. 14 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In one embodiment, as shown in fig. 1, a CNN-based time series prediction method is provided, which includes the following steps S102 to S106.
S102, obtaining historical time sequence data, and determining a period parameter according to the period characteristic of the historical time sequence data, wherein the period parameter comprises a period type and a period duration corresponding to the period type.
And S104, determining corresponding component data of the predicted time point in the historical time series data based on the predicted time point, the historical time series data, the period parameter and a preset cycle span, wherein the component data comprises closest time period data and period data.
S106, predicting the component data by adopting the determined CNN model to obtain a prediction result corresponding to the prediction time point.
In the time series prediction method based on the CNN (convolutional neural network), the component data including the closest time period data and the cycle data is extracted by analyzing the cycle characteristic of the time series and processing the data to be tested according to the cycle characteristic, wherein the cycle data may include multiple groups of data, such as short cycle data and long cycle data, and the characteristics of the time series can be integrated from the global through the component data, so that when the convolutional neural network analyzes the component data, comprehensive and accurate data characteristics can be extracted, and the subsequent time series information can be predicted efficiently and accurately.
In one embodiment, after the historical time series data is obtained, the historical time series data is periodically analyzed to find the appropriate cycle duration and cycle span.
Taking a traffic data set as an example, the traffic data set includes hourly data (2015-2016) collected in 48 months by California traffic department that describes the occupancy of the road (between 0 and 1), with 862 observation points in total. As shown in fig. 2 and 4, which illustrate a short period information map and a long period information map of the traffic data set, respectively.
Taking as an example a solar data set comprising data every 10 minutes in 2006 for 137 photovoltaic power stations in alabama, which data describes the amount of solar power generation. As shown in fig. 3 and 5, which illustrate a short-period information map and a long-period information map of the solar data set, respectively.
To further illustrate the periodic nature of the data sets, sensors may be randomly selected from the two data sets and the autocorrelation of the sequence plotted, as shown in fig. 6 and 7, which illustrate the autocorrelation plots of the traffic data set and the solar data set, respectively. The autocorrelation can clearly show the interdependence between time series. The expression for resolving the autocorrelation may be as follows:
Figure BDA0002077988040000051
wherein R (τ) denotes the autocorrelation, xtRepresents a time series signal, μ is the mean and σ is the variance. As can be seen from the figure, there are high correlation period rules in the traffic data set and the solar data set, for example, in the traffic data set, the short period duration is 24 hours, and the long period duration is 7 days, which reflect the regularity of traffic conditions. When observing the special periodicity of the data set, the experimental results obtained by different methods can be analyzed, and the hyper-parameters of the model can be set more accurately by analyzing and extracting the periodic information of the data set.
In one embodiment, the closest time period data corresponding to the predicted time point in the historical time series data is determined based on the closest time point of the predicted time point in the historical time series data and a preset cycle span; and determining each period data corresponding to each period time length in the historical time sequence data of the predicted time point based on the predicted time point, each period time length and the preset cycle span.
In one embodiment, as shown in FIG. 8, givenA set of observed Time series of histories (Time) data X ═ X1,x2,...,xTLet the predicted time point be xT+hX of theT+hThe corresponding component data in the historical time-series data includes three, respectively as follows:
Figure BDA0002077988040000061
Figure BDA0002077988040000062
Figure BDA0002077988040000063
wherein, XcTClosest time segment (Closense) data representing predicted time points, XsTShort period (Short) data, X, representing the predicted point-in-timelTLong period (Long) data corresponding to the predicted time points are represented. Wherein k iscRepresenting the closest time span, psIndicating short cycle duration, ksRepresenting a short period span, plRepresenting a short period span, klRepresenting a long period span.
In one embodiment, the three components are used as convolution components, and the determined CNN model is input for processing. Specifically, the CNN model may include three convolutional layer structures and a fully-connected layer structure. And respectively convolving the data of the closest time segment, the short period data and the long period data by adopting a first convolution layer structure, a second convolution layer structure and a third convolution layer structure to obtain the characteristics corresponding to the data. Wherein the second and third convolutional layer structures are identical, the first convolutional layer structure adds a pooling layer relative to the second and third convolutional layer structures because the closest period data is typically more data than the short period data and the long period data.
In one embodiment, each convolutional layer structure has three convolutional layers, and the filter size of each convolutional layer is set to (3 × 3), which not only can reduce the number of parameters in the training process for the model, but also can reduce the computational complexity and greatly shorten the training time. The number of convolution filters of the first, second and third convolutional layers is set to 32, 64 and 128, respectively, because semantic information becomes richer as the network deepens in the convolutional neural network, the features of the previous layer can be more sufficiently extracted by increasing the number of filters.
In one embodiment, a residual network (Resnet) concept is added to each convolution component, which can increase the network layer depth of each convolution component while preventing gradient diffusion or gradient explosion. As shown in fig. 9, it is a schematic diagram of a Resnet network structure, where x is input, the left side is a convolution component (convolution component) not added to the Resnet idea, x is input, and f (x) is output. And after the Resnet idea is added, inputting x into a first layer of convolution layer (convolution layer) to obtain a first layer of convolution output result, activating the first layer of convolution output result (relu), inputting the first layer of convolution layer into a second layer of convolution layer to obtain a second layer of convolution output result, overlapping the second layer of convolution output result with the original input, activating the overlapping result (H (x) ═ F (x) + x), inputting the third layer of convolution layer, and finally outputting the extracted features from the third layer of convolution layer.
In one embodiment, after the features of the three components are extracted, as shown in fig. 8, the three components are subjected to Weighted fusion (Weighted feature fusion), and the full link layer is input for mapping, so as to obtain a Prediction result (Prediction). The expression of the feature weighted fusion may be as follows:
Figure BDA0002077988040000071
wherein, YfusionRepresenting features after weighted fusion, Yc、Ys、YlRespectively representing the characteristics of the closest time period data, short period data and long period data, Wc、Ws、WlRespectively represent Yc、Ys、YlThe corresponding weight.
In one embodiment, as shown in fig. 10, a CNN-based time series prediction model determination method is provided, which includes the following steps S1002 to S1006.
S1002, acquiring time sequence sample data, and determining a period parameter according to the period characteristic of the time sequence sample data, wherein the time sequence sample data comprises data to be trained, and the period parameter comprises a period type and a period duration corresponding to the period type.
S1004, determining component data corresponding to the data to be trained in the time sequence sample data based on the data to be trained, the time sequence sample data, the period parameter and a preset cycle span, wherein the component data comprises data in a closest time period and periodic data;
s1006, training the component data by using a CNN model to be trained to obtain a training result corresponding to the data to be trained, adjusting parameters of the CNN model to be trained according to a difference between the training result corresponding to the data to be trained and a real result, and continuing training until a training end condition is met to obtain the trained CNN model.
According to the CNN (convolutional neural network) -based time series prediction model determining method, the periodic characteristics of the time series are analyzed, the data to be trained are processed according to the periodic characteristics, and the component data including the data in the closest time period and the periodic data are extracted, wherein the periodic data can include multiple groups of data, such as short periodic data and long periodic data, and the characteristics of the time series can be integrated from the global direction through the component data, so that when the convolutional neural network analyzes the component data, comprehensive and accurate data characteristics can be extracted, the subsequent time series information can be predicted efficiently and accurately, in addition, the component data are input into the convolutional neural network for processing, the data parallel computing capacity can be improved, the training and testing speed is increased, and the model training and testing time is saved.
In one embodiment, after the time series sample data is obtained, the time series sample data is periodically analyzed to find out the appropriate period duration and cycle span.
In one embodiment, the closest time period data corresponding to each data to be trained in the time series sample data is determined based on the corresponding previous time point of each data to be trained in the time series sample data and the preset cycle span; and determining each period data corresponding to each period time length of the data to be trained in the time sequence sample data based on the data to be trained, each period time length and a preset cycle span.
In one embodiment, the period data includes short period data and long period data, and the closest time period data, the short period data and the long period data of each to-be-trained data are input into the to-be-trained CNN model for training as three convolution components.
In one embodiment, the model to be trained may be constructed as follows: building a unified computing equipment architecture (CUDA) operation environment, installing a corresponding display card driver, installing a software development kit (CUDA SDK), and configuring operation parameters; and (3) carrying out algorithm realization by using a TensorFlow open source framework, respectively constructing convolution layer structures of three sub-networks, and setting a weighted fusion full-connection layer. And confirming the parameter setting of model training according to the periodic characteristics of the time sequence sample data, wherein the set parameters can comprise hyper-parameters and cycle span. The model has high flexibility, and the cycle span set in the model can be freely adjusted according to the data characteristics.
In one embodiment, the first convolutional layer structure, the second convolutional layer structure and the third convolutional layer structure are adopted to convolve the data with the closest time segment, the short period data and the long period data respectively to obtain the characteristics corresponding to the component data. Wherein the second and third convolutional layer structures are identical, the first convolutional layer structure adds a pooling layer relative to the second and third convolutional layer structures because the closest period data is typically more data than the short period data and the long period data.
In one embodiment, each convolutional layer structure has three convolutional layers, and the filter size of each convolutional layer is set to (3 × 3), which not only can reduce the number of parameters in the training process for the model, but also can reduce the computational complexity and greatly shorten the training time. The number of convolution filters of the first, second and third convolutional layers is set to 32, 64 and 128, respectively, because semantic information becomes richer as the network deepens in the convolutional neural network, the features of the previous layer can be more sufficiently extracted by increasing the number of filters.
In one embodiment, a residual network (Resnet) concept is added to each convolution component, which can increase the network layer depth of each convolution component while preventing gradient diffusion or gradient explosion. Specifically, each component is input into a first layer of convolutional layer to obtain a first layer of convolutional output result, the first layer of convolutional output result is input into a second layer of convolutional layer to obtain a second layer of convolutional output result, the second layer of convolutional output result is overlapped with the original convolutional component input, the overlapped result is input into a third layer of convolutional layer, and finally the extracted features of the convolutional components are output from the third layer of convolutional layer. After the features of the three components are extracted, the features are subjected to feature weighting fusion, and the features are input into a full-link layer for mapping to obtain a training result corresponding to the data to be trained.
In one embodiment, the Loss function (Loss) of the network is set as follows:
Figure BDA0002077988040000091
wherein the content of the first and second substances,
Figure BDA0002077988040000092
and YitRespectively representing the predicted value and the actual value of the ith sample at the time point t, wherein N is the total number of samples.
In one embodiment, because the to-be-trained CNN model includes three component networks with similar structures, each component is a CNN network structure, and the CNN model is very suitable for multi-thread Graphics Processing Unit (GPU) computation, a tensflo model parallel mechanism is used for network training, which can greatly reduce the time of model training. As shown in fig. 11, using the data parallel training method of tensrflow, the model parameters are stored in a designated Graphics Processing Unit (GPU)/Central Processing Unit (CPU), and copies of the model parameters are stored in different GPUs, each training provides batch _ size _ GPU _ num data, and the batch _ size data is equally split into multiple batches (batches) and sent to different GPUs, where batch _ size represents the number of training samples in each batch, and GPU _ num represents the number of GPUs. The forward operation is carried out on different GPUs, when the model parameters are updated, gradient data obtained by backward calculation of a plurality of GPUs are averaged, and the model parameters are updated on a designated GPU/CPU by utilizing the gradient data.
In one embodiment, using Adam as the optimizer, which has the ability to adjust the parameters correctly, and the robustness of selecting the super-parameters, can make the computation more efficient and take up less memory during the sequence regression.
In one embodiment, the training end condition may be that a preset number of iterations is reached, or that the loss function value is minimized.
In one embodiment, after the trained model is obtained, the trained model is tested. Specifically, the time sequence sample data further includes data to be tested, and the time sequence sample data may be divided into a training set and a test set according to a certain proportion, where the training set includes the data to be trained, and the test set includes the data to be tested. And testing the trained CNN model based on the data to be tested to obtain a test result corresponding to the data to be tested, adjusting the setting parameters of the trained CNN model according to the difference between the test result of the data to be tested and the real result when the optimal condition of the model is not met, and repeatedly performing model training and model testing according to the adjusted setting parameters of the trained CNN model until the optimal condition of the model is met to obtain the determined CNN model.
The setting parameters may include one or more of hyper-parameters and cyclic spans. The model optimal conditions may be: the Relative Square Error (RSE) and the Relative Absolute Error (RAE) of the tested value and the actual value are minimum, and the empirical correlation Coefficient (CORR) is maximum. Wherein, RSE, RAE and CORR can be respectively calculated by the following formulas:
Figure BDA0002077988040000101
Figure BDA0002077988040000102
Figure BDA0002077988040000103
wherein the content of the first and second substances,
Figure BDA0002077988040000104
and YitRespectively representing the predicted value and the actual value of the ith sample at the time point t,
Figure BDA0002077988040000105
and Yi represents the predicted value and the actual value of the ith sample at all time points, Y represents the actual value of all samples at all time points, and omegatestRepresenting the test set, n is the total number of samples, mean represents the average.
It should be understood that although the various steps in the flowcharts of fig. 1 and 10 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1 and 10 may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 12, there is provided a CNN-based time series prediction apparatus including: a first period parameter acquisition module 1202, a first component data determination module 1204, and a prediction module 1206, wherein:
a first period parameter obtaining module 1202, configured to obtain historical time series data, and determine a period parameter according to a period characteristic of the historical time series data, where the period parameter includes a period type and a period duration corresponding to the period type.
A first component data determining module 1204, configured to determine, based on a predicted time point, the historical time-series data, the cycle parameter, and a preset cycle span, corresponding component data of the predicted time point in the historical time-series data, where the component data includes closest time period data and cycle data.
And the predicting module 1206 is configured to predict the component data by using the determined CNN model, so as to obtain a prediction result corresponding to the prediction time point.
In one embodiment, the first component data determination module 1204 comprises: a first closest time period data determination unit and a first cycle data determination unit, wherein:
a first closest time period data determining unit, configured to determine, based on a closest time point of the predicted time point in the historical time series data and the preset cycle span, corresponding closest time period data of the predicted time point in the historical time series data.
A first cycle data determining unit, configured to determine, based on the predicted time point, each of the cycle durations, and the preset cycle span, each of cycle data corresponding to each of the cycle durations at the predicted time point in the historical time series data.
In one embodiment, the determined CNN model includes a first convolutional layer structure, a second convolutional layer structure, and a fully-connected layer structure, and the prediction module 1206 includes a first convolutional unit and a prediction unit, wherein:
the first convolution unit is used for performing convolution on the data of the closest time period by adopting the first convolution layer structure to obtain a first characteristic corresponding to the data of the closest time period; convolving the periodic data by adopting the second convolution layer structure to obtain a second characteristic corresponding to the periodic data;
and the prediction unit is used for mapping the feature weighted and fused by the first feature and the second feature by adopting the full-connection layer structure to obtain a prediction result corresponding to the prediction time point.
In one embodiment, the first convolutional layer structure and the second convolutional layer structure each comprise three convolutional layers, the first convolutional unit comprises a first convolutional subunit and a second convolutional subunit, wherein:
the first convolution subunit is used for performing convolution on the data of the closest time period by adopting a first layer of convolution layer of the first convolution layer structure to obtain a first layer of output result; performing convolution on the first layer output result by adopting a second layer convolution layer of the first convolution layer structure to obtain a second layer output result; convolving the superposition result by adopting the third convolution layer of the first convolution layer structure to obtain a first characteristic corresponding to the data of the closest time period; and the superposition result is obtained by superposing the second-layer output result and the original input of the data of the closest time segment.
The second convolution subunit is used for performing convolution on the periodic data by adopting the first layer of convolution layer of the second convolution layer structure to obtain a first layer of output result; performing convolution on the first layer output result by adopting a second layer convolution layer of the second convolution layer structure to obtain a second layer output result; convolving the superposition result by adopting a third convolution layer of the second convolution layer structure to obtain a second characteristic corresponding to the periodic data; and the superposition result is obtained by superposing the second-layer output result and the original input of the periodic data.
For specific limitations of the CNN-based time series prediction apparatus, reference may be made to the above limitations of the CNN-based time series prediction method, which are not described herein again. The modules in the CNN-based time series prediction apparatus may be wholly or partially implemented by software, hardware, or a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, as shown in fig. 13, there is provided a CNN-based time series prediction model determination apparatus including: a second period parameter obtaining module 1302, a second component data determining module 1304, and a training module 1306, wherein:
a second period parameter obtaining module 1302, configured to obtain time sequence sample data, and determine a period parameter according to a period characteristic of the time sequence sample data, where the time sequence sample data includes data to be trained and data to be tested, and the period parameter includes a period type and a period duration corresponding to the period type;
a second component data determining module 1304, configured to determine, based on the data to be trained, the time sequence sample data, the period parameter, and a preset cycle span, component data corresponding to the data to be trained in the time sequence sample data, where the component data includes closest time period data and period data;
the training module 1306 is configured to train the component data by using a CNN model to be trained, obtain a training result corresponding to the data to be trained, adjust parameters of the CNN model to be trained according to a difference between the training result corresponding to the data to be trained and a real result, and continue training until a training end condition is met, so as to obtain a trained CNN model.
In one embodiment, the second component data determination module 1304 includes: a second closest period data determination unit and a second period data determination unit, wherein:
and a second closest time segment data determining unit, configured to determine, based on a previous time point corresponding to each piece of data to be trained in time sequence sample data and the preset cycle span, closest time segment data corresponding to each piece of data to be trained in the time sequence sample data.
And a second periodic data determining unit, configured to determine, based on the data to be trained, the period durations and the preset cycle span, each periodic data corresponding to each period duration in the time series sample data of the data to be trained.
In one embodiment, the CNN model to be trained includes a first convolutional layer structure, a second convolutional layer structure, and a fully-connected layer structure, and the training module 1306 includes a second convolutional unit and a training unit, where:
the second convolution unit is used for performing convolution on the data of the closest time period by adopting the first convolution layer structure to obtain a first characteristic corresponding to the data of the closest time period; convolving the periodic data by adopting the second convolution layer structure to obtain a second characteristic corresponding to the periodic data;
and the training unit is used for mapping the features weighted and fused by the first features and the second features by adopting the full-connection layer structure to obtain a training result corresponding to the data to be trained.
In one embodiment, the first convolutional layer structure and the second convolutional layer structure each include three convolutional layers, the second convolutional unit includes a third convolutional subunit and a fourth convolutional subunit, wherein:
the third convolution subunit is used for adopting the first layer of convolution layer of the first convolution layer structure to carry out convolution on the data of the closest time period so as to obtain a first layer of output result; performing convolution on the first layer output result by adopting a second layer convolution layer of the first convolution layer structure to obtain a second layer output result; convolving the superposition result by adopting the third convolution layer of the first convolution layer structure to obtain a first characteristic corresponding to the data of the closest time period; and the superposition result is obtained by superposing the second-layer output result and the original input of the data of the closest time segment.
The fourth convolution subunit is used for performing convolution on the periodic data by adopting the first layer of convolution layer of the second convolution layer structure to obtain a first layer of output result; performing convolution on the first layer output result by adopting a second layer convolution layer of the second convolution layer structure to obtain a second layer output result; convolving the superposition result by adopting a third convolution layer of the second convolution layer structure to obtain a second characteristic corresponding to the periodic data; and the superposition result is obtained by superposing the second-layer output result and the original input of the periodic data.
In an embodiment, the determining apparatus further includes a testing module, configured to test the trained CNN model based on the data to be tested to obtain a testing result corresponding to the data to be tested, adjust a setting parameter of the trained CNN model according to a difference between the testing result of the data to be tested and a real result when a model optimal condition is not satisfied, and repeat model training and model testing according to the adjusted setting parameter of the trained CNN model until the model optimal condition is satisfied to obtain the determined CNN model.
For specific limitations of the CNN-based time series prediction model determination apparatus, reference may be made to the above limitations of the CNN-based time series prediction model determination method, which are not described herein again. The various modules in the CNN-based time series prediction model determination device described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 14. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a CNN-based time series prediction method or a CNN-based time series prediction model determination method.
Those skilled in the art will appreciate that the architecture shown in fig. 14 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the above-described method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the respective method embodiment as described above.
It should be understood that the terms "first", "second", "third" and "fourth" in the above-described embodiments are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (14)

1. A CNN-based time series prediction method, the method comprising:
acquiring historical time sequence data, and determining a period parameter according to the period characteristic of the historical time sequence data, wherein the period parameter comprises a period type and a period duration corresponding to the period type, the period type comprises a short period and a long period, and the period duration comprises a short period duration and a long period duration;
determining component data corresponding to the prediction time point in the historical time series data based on the prediction time point, the historical time series data, the period parameter and a preset cycle span, wherein the preset cycle span comprises a closest time period span, a short period span and a long period span, and the component data comprises the closest time period data, short period data and long period data;
predicting the component data by adopting the determined CNN model to obtain a prediction result corresponding to the prediction time point;
determining corresponding component data of the predicted time point in the historical time series data based on the predicted time point, the historical time series data, the period parameter and a preset cycle span, wherein the step of determining the corresponding component data of the predicted time point in the historical time series data comprises the following steps:
determining corresponding closest time period data of the predicted time point in the historical time series data based on the closest time point of the predicted time point in the historical time series data and the closest time period span;
determining short cycle data corresponding to the prediction time point in the historical time sequence data based on the prediction time point, the short cycle duration and the short cycle span;
and determining corresponding long-period data of the predicted time point in the historical time sequence data based on the predicted time point, the long-period duration and the long-period span.
2. The method according to claim 1, wherein the determined CNN model includes a first convolutional layer structure, a second convolutional layer structure, a third convolutional layer structure, and a fully-connected layer structure, and predicting the component data by using the determined CNN model to obtain a prediction result corresponding to the prediction time point, includes:
convolving the data of the closest time period by adopting the first convolution layer structure to obtain a first characteristic corresponding to the data of the closest time period;
convolving the short-period data by adopting the second convolution layer structure to obtain a second characteristic corresponding to the short-period data;
convolving the long-period data by adopting the third convolution layer structure to obtain a third feature corresponding to the long-period data;
and mapping the feature after weighted fusion of the first feature, the second feature and the third feature by adopting the full-connection layer structure to obtain a prediction result corresponding to the prediction time point.
3. The method of claim 2, wherein the first convolutional layer structure comprises three convolutional layers, and the convolving the closest time period data with the first convolutional layer structure to obtain the first feature corresponding to the closest time period data comprises:
performing convolution on the data of the closest time period by adopting the first layer of convolution layer of the first convolution layer structure to obtain a first layer of output result;
performing convolution on the first layer output result by adopting a second layer convolution layer of the first convolution layer structure to obtain a second layer output result;
convolving the superposition result by adopting the third convolution layer of the first convolution layer structure to obtain a first characteristic corresponding to the data of the closest time period; and the superposition result is obtained by superposing the second-layer output result and the original input of the data of the closest time segment.
4. The method of claim 2, wherein the second convolutional layer structure comprises three convolutional layers, and convolving the short period data with the second convolutional layer structure to obtain a second feature corresponding to the short period data comprises:
performing convolution on the short-period data by adopting the first layer of convolution layer of the second convolution layer structure to obtain a first layer of output result;
performing convolution on the first layer output result by adopting a second layer convolution layer of the second convolution layer structure to obtain a second layer output result;
convolving the superposition result by adopting a third convolution layer of the second convolution layer structure to obtain a second characteristic corresponding to the short-period data; and the superposition result is obtained by superposing the second-layer output result and the original input of the short-period data.
5. The method of claim 2, wherein the third convolutional layer structure comprises three convolutional layers, and convolving the long-period data with the third convolutional layer structure to obtain a third feature corresponding to the long-period data comprises:
performing convolution on the long-period data by adopting the first layer of convolution layer of the third convolution layer structure to obtain a first layer of output result;
performing convolution on the first layer output result by adopting a second layer convolution layer of the third convolution layer structure to obtain a second layer output result;
convolving the superposition result by adopting a third convolution layer of the third convolution layer structure to obtain a third characteristic corresponding to the long-period data; and the superposition result is obtained by superposing the second-layer output result and the original input of the long-period data.
6. A CNN-based method for determining a time series prediction model, the method comprising:
acquiring time sequence sample data, and determining a period parameter according to the period characteristic of the time sequence sample data, wherein the time sequence sample data comprises data to be trained, the period parameter comprises a period type and a period duration corresponding to the period type, the period type comprises a short period and a long period, and the period duration comprises a short period duration and a long period duration;
determining component data corresponding to the data to be trained in the time sequence sample data based on the data to be trained, the time sequence sample data, the period parameter and a preset cycle span, wherein the preset cycle span comprises a closest time period span, a short cycle span and a long cycle span, and the component data comprises the closest time period data, short cycle data and long cycle data;
training the component data by adopting a CNN model to be trained to obtain a training result corresponding to the data to be trained, adjusting parameters of the CNN model to be trained according to the difference between the training result corresponding to the data to be trained and a real result, and continuing training until a training end condition is met to obtain a trained CNN model;
determining component data corresponding to the data to be trained in the time sequence sample data based on the data to be trained, the time sequence sample data, the period parameter and a preset cycle span, including:
determining the closest time period data corresponding to the data to be trained in the time sequence sample data based on the corresponding previous time point of the data to be trained in the time sequence sample data and the closest time period span;
determining short-period data corresponding to the data to be trained in the time sequence sample data based on the data to be trained, the short-period duration and the short-period span;
and determining long-period data corresponding to the data to be trained in the time sequence sample data based on the data to be trained, the long-period duration and the long-period span.
7. The method of claim 6, wherein the time series sample data further comprises data to be tested, the method further comprising:
and testing the trained CNN model based on the data to be tested to obtain a test result corresponding to the data to be tested, adjusting the setting parameters of the trained CNN model according to the difference between the test result and the real result of the data to be tested when the optimal condition of the model is not met, and repeatedly performing model training and model testing according to the adjusted setting parameters of the trained CNN model until the optimal condition of the model is met to obtain the determined CNN model.
8. The method of claim 7, wherein testing the trained CNN model based on the data to be tested to obtain a test result corresponding to the data to be tested comprises:
determining component data corresponding to the data to be tested in the time series sample data based on the data to be tested, the time series sample data, the period parameter and the preset cycle span;
and testing the component data by adopting the trained CNN model to obtain a test result corresponding to the data to be tested.
9. The method according to claim 6, wherein the CNN model to be trained includes a first convolutional layer structure, a second convolutional layer structure, a third convolutional layer structure, and a fully-connected layer structure, and the training of the component data by using the CNN model to be trained to obtain the training result corresponding to the data to be trained includes:
convolving the data of the closest time period by adopting the first convolution layer structure to obtain a first characteristic corresponding to the data of the closest time period;
convolving the short-period data by adopting the second convolution layer structure to obtain a second characteristic corresponding to the short-period data;
convolving the long-period data by adopting the third convolution layer structure to obtain a third feature corresponding to the long-period data;
and mapping the feature after weighted fusion of the first feature, the second feature and the third feature by adopting the full-connection layer structure to obtain a training result corresponding to the data to be trained.
10. The method of claim 9, wherein the first convolutional layer structure comprises three convolutional layers, and convolving the closest time period data with the first convolutional layer structure to obtain a first feature corresponding to the closest time period data comprises:
performing convolution on the data of the closest time period by adopting the first layer of convolution layer of the first convolution layer structure to obtain a first layer of output result;
performing convolution on the first layer output result by adopting a second layer convolution layer of the first convolution layer structure to obtain a second layer output result;
convolving the superposition result by adopting the third convolution layer of the first convolution layer structure to obtain a first characteristic corresponding to the data of the closest time period; and the superposition result is obtained by superposing the second-layer output result and the original input of the data of the closest time segment.
11. The method of claim 9, wherein the second convolutional layer structure comprises three convolutional layers, and convolving the short period data with the second convolutional layer structure to obtain a second feature corresponding to the short period data comprises:
performing convolution on the short-period data by adopting the first layer of convolution layer of the second convolution layer structure to obtain a first layer of output result;
performing convolution on the first layer output result by adopting a second layer convolution layer of the second convolution layer structure to obtain a second layer output result;
convolving the superposition result by adopting a third convolution layer of the second convolution layer structure to obtain a second characteristic corresponding to the short-period data; and the superposition result is obtained by superposing the second-layer output result and the original input of the short-period data.
12. The method of claim 9, wherein the third convolutional layer structure comprises three convolutional layers, and convolving the long-period data with the third convolutional layer structure to obtain a third feature corresponding to the long-period data comprises:
performing convolution on the long-period data by adopting the first layer of convolution layer of the third convolution layer structure to obtain a first layer of output result;
performing convolution on the first layer output result by adopting a second layer convolution layer of the third convolution layer structure to obtain a second layer output result;
convolving the superposition result by adopting a third convolution layer of the third convolution layer structure to obtain a third characteristic corresponding to the long-period data; and the superposition result is obtained by superposing the second-layer output result and the original input of the long-period data.
13. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 12.
14. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 12.
CN201910460741.0A 2019-05-30 2019-05-30 CNN-based time series prediction method and model determination method Active CN110232437B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910460741.0A CN110232437B (en) 2019-05-30 2019-05-30 CNN-based time series prediction method and model determination method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910460741.0A CN110232437B (en) 2019-05-30 2019-05-30 CNN-based time series prediction method and model determination method

Publications (2)

Publication Number Publication Date
CN110232437A CN110232437A (en) 2019-09-13
CN110232437B true CN110232437B (en) 2021-11-16

Family

ID=67858801

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910460741.0A Active CN110232437B (en) 2019-05-30 2019-05-30 CNN-based time series prediction method and model determination method

Country Status (1)

Country Link
CN (1) CN110232437B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111242352A (en) * 2020-01-02 2020-06-05 深圳市麦谷科技有限公司 Parking aggregation effect prediction method based on vehicle track
CN112286933B (en) * 2020-10-28 2021-09-14 况客科技(北京)有限公司 Data processing system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107103359A (en) * 2017-05-22 2017-08-29 东南大学 The online Reliability Prediction Method of big service system based on convolutional neural networks
JP2018142272A (en) * 2017-02-28 2018-09-13 株式会社エヌ・ティ・ティ・データ Content evaluation prediction system and content evaluation prediction method
CN109359758A (en) * 2018-08-03 2019-02-19 阿里巴巴集团控股有限公司 Dealing amount of foreign exchange prediction technique and device
CN109389244A (en) * 2018-09-06 2019-02-26 浙江鸿程计算机系统有限公司 Tourist's number prediction technique in a kind of short-term scenic spot of multifactor perception based on GRU

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018142272A (en) * 2017-02-28 2018-09-13 株式会社エヌ・ティ・ティ・データ Content evaluation prediction system and content evaluation prediction method
CN107103359A (en) * 2017-05-22 2017-08-29 东南大学 The online Reliability Prediction Method of big service system based on convolutional neural networks
CN109359758A (en) * 2018-08-03 2019-02-19 阿里巴巴集团控股有限公司 Dealing amount of foreign exchange prediction technique and device
CN109389244A (en) * 2018-09-06 2019-02-26 浙江鸿程计算机系统有限公司 Tourist's number prediction technique in a kind of short-term scenic spot of multifactor perception based on GRU

Also Published As

Publication number Publication date
CN110232437A (en) 2019-09-13

Similar Documents

Publication Publication Date Title
CN108921359B (en) Distributed gas concentration prediction method and device
CN112598248B (en) Load prediction method, load prediction device, computer equipment and storage medium
CN112528365B (en) Method for predicting healthy evolution trend of underground infrastructure structure
CN110232437B (en) CNN-based time series prediction method and model determination method
CN111126668A (en) Spark operation time prediction method and device based on graph convolution network
CN112053560A (en) Short-time traffic flow prediction method, system and storage medium based on neural network
CN114911788B (en) Data interpolation method and device and storage medium
CN116865251A (en) Short-term load probability prediction method and system
CN114118634A (en) Soil moisture prediction method and device
Lin et al. Remaining useful life prediction in prognostics using multi-scale sequence and Long Short-Term Memory network⋆
CN116432861A (en) Comprehensive energy system source charge price multitasking combined prediction method and system
CN116013426A (en) Site ozone concentration prediction method with high space-time resolution
CN113537591A (en) Long-term weather prediction method and device, computer equipment and storage medium
CN113110961B (en) Equipment abnormality detection method and device, computer equipment and readable storage medium
CN110866682A (en) Underground cable early warning method and device based on historical data
CN112016702A (en) Medical data processing method, device, equipment and medium based on transfer learning
CN115545362A (en) AI and TSD combined new energy medium-term power combined prediction method
CN116029438A (en) Modeling method of water quality parameter prediction model and water quality parameter prediction method and device
Abotaleb et al. Forecasting and modeling on average rainwater and vapor pressure in Chelyabinsk Russia using deep learning models
CN113887820A (en) Method and device for predicting fault of electric power spot business system, computer equipment and storage medium
CN110969297A (en) Power load prediction method and device based on backward interval partial least square method
CN115392444B (en) Parameter optimization method of unmanned aerial vehicle knowledge model combination based on reinforcement learning
CN117172085B (en) PCCP broken wire prediction method, device, computer equipment and medium
CN115116212A (en) Traffic prediction method for road network, computer device, storage medium and program product
CN117200222A (en) System load prediction method and system based on double-input CNN-LSTM

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Li Kenli

Inventor after: Wang Kang

Inventor after: Chen Cen

Inventor after: Li Keqin

Inventor after: Duan Mingxing

Inventor after: Liu Chubo

Inventor after: Yang Wangdong

Inventor before: Chen Cen

Inventor before: Wang Kang

Inventor before: Li Keqin

Inventor before: Duan Mingxing

Inventor before: Liu Chubo

Inventor before: Yang Wangdong

Inventor before: Li Kenli

GR01 Patent grant
GR01 Patent grant