CN117171543A - Space-time data prediction method and data acquisition monitoring system - Google Patents

Space-time data prediction method and data acquisition monitoring system Download PDF

Info

Publication number
CN117171543A
CN117171543A CN202311026579.4A CN202311026579A CN117171543A CN 117171543 A CN117171543 A CN 117171543A CN 202311026579 A CN202311026579 A CN 202311026579A CN 117171543 A CN117171543 A CN 117171543A
Authority
CN
China
Prior art keywords
data
space
time
prediction
generator
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.)
Pending
Application number
CN202311026579.4A
Other languages
Chinese (zh)
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.)
University of Science and Technology Beijing USTB
Original Assignee
University of Science and Technology Beijing USTB
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 University of Science and Technology Beijing USTB filed Critical University of Science and Technology Beijing USTB
Priority to CN202311026579.4A priority Critical patent/CN117171543A/en
Publication of CN117171543A publication Critical patent/CN117171543A/en
Pending legal-status Critical Current

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a space-time data prediction method and a data acquisition monitoring system, wherein the method comprises the following steps: establishing a topological space diagram according to the collected space-time data, and recording diagram signal sequences of nodes of the topological space diagram at different moments; constructing a space-time data prediction model based on a space-time generation countermeasure network, and training the space-time data prediction model by taking a history image signal sequence as a training set; the space-time generation countermeasure network comprises a generator and a discriminator, wherein the generator is used for modeling space-time dependency relationship in space-time data, and the discriminator is used for regularizing the space-time generation countermeasure network; and carrying out space-time data prediction by using the trained model to obtain a graph signal sequence of each node of the future preset time step. According to the invention, the countermeasures are introduced into the objective function of the prediction model to model uncertainty in data, and the real space-time data distribution is learned through the countermeasures, so that the capability of the prediction model to learn data representation is enhanced, and the problem of excessively fast multi-step prediction error growth is solved.

Description

Space-time data prediction method and data acquisition monitoring system
Technical Field
The invention relates to the technical field of space-time data prediction, in particular to a space-time data prediction method based on a space-time generation countermeasure network and a data acquisition monitoring system.
Background
A large amount of space-time data is generated in the real world, and how to use the space-time data to develop efficient urban applications such as traffic prediction has important practical value and research significance. The space-time data has the characteristics of large scale, high dimensionality, complex structure, heterogeneity, high nonlinearity degree and the like. In order to solve the problem of large-scale space-time data prediction, a space-time data prediction model based on advanced deep learning technology such as a graph neural network is sequentially proposed by a learner and successfully applied to modeling of complex space-time data. Of these models, the more excellent one includes a model based on graph attention mechanism and a model based on graph convolution neural network, which are all affiliated with the messaging mechanism, and connect the output of the network with the historical spatiotemporal information by aggregating the information of the relevant nodes.
Although the existing graph neural network technology achieves good effect on the problem of space-time data prediction, the following disadvantages still exist: first, existing spatio-temporal data prediction models mostly use a loss function such as a mean square error as an objective function to optimize model parameters. However, the spatiotemporal data in the real world is highly random and it is difficult to model this uncertainty using a specific, inflexible single objective function. Second, another problem with existing methods is the rapid increase in multi-step prediction error. In the multi-step prediction problem, existing methods are generally divided into two ways: iterative multi-step prediction mode, direct multi-step prediction mode. The iterative multi-step prediction approach has great flexibility and requires less data, so most spatio-temporal data prediction models employ this approach, but it has serious error accumulation problems in multi-step prediction tasks. While spatio-temporal data prediction models using direct multi-step prediction strategies can alleviate to some extent the problem of error accumulation that exists in iterative multi-step prediction strategy based models, they are a great challenge to model learning ability, with the different models varying very much over the prediction time steps in the multi-step prediction task. Therefore, how to make the model learn data features more efficiently is a problem that requires intensive research in the task of spatio-temporal data prediction.
Generating a challenge network (Generative Adversarial Nets, GAN) is a type of neural network based on a challenge learning process that is capable of learning a probability distribution from given real data and generating new data using the learned distribution. Based on generating strong modeling capabilities against the network, in recent years there have also been studies considering the introduction of GAN modeling ideas into the prediction problem. For time series data recorded by a single spatial site sensor, koochali et al introduced condition GAN (Conditional GAN) to model data distribution, eliminating the disadvantage of difficult modeling of complex variable correlations based on mean regression strategies in past studies. Wu et al propose a time series prediction model based on generating an antagonism network to improve multi-step prediction performance by regularization of the discriminators. For a space-time data prediction scene of a plurality of spatial location sensors, wang et al propose sequence-to-sequence generation countermeasure network to predict urban traffic data, but the model uses traditional CNN to model a spatial dependency relationship, can only be used for Euclidean structured data, and cannot be directly used for topological graph structured data.
Disclosure of Invention
In view of the above problems, an object of the present invention is to provide a spatio-Temporal data prediction method and a data collection monitoring system, in which a space-time generation countermeasure network (STGAN) is provided as a countermeasure graph neural network model for spatio-Temporal data prediction, a framework is formed by combining a noise reduction spatio-Temporal attention network and a generation countermeasure network, a countermeasure loss is introduced into an objective function of a prediction model, which is used for modeling uncertainty in data, and learning real spatio-Temporal data distribution through a countermeasure process, so as to strengthen the capability of the prediction model to learn data characterization, thereby alleviating the problem that a multi-step prediction error grows too fast.
In order to solve the technical problems, the invention provides the following technical scheme:
in one aspect, a method for predicting spatio-temporal data is provided, including the steps of:
establishing a topological space diagram according to the collected space-time data, and recording diagram signal sequences of nodes of the topological space diagram at different moments;
constructing a space-time data prediction model based on a space-time generation countermeasure network, and training the space-time data prediction model by taking a history image signal sequence as a training set;
the space-time generation countermeasure network comprises a generator and a discriminator, wherein the generator is used for modeling space-time dependency relationship in space-time data, and for given input data, the generated data is obtained through prediction; the discriminator is used for regularizing the space-time generation countermeasure network, sampling the generated data output by the generator and the real data and inputting the sampled data into the discriminator, and when the discriminator cannot distinguish the generated data and the real data, considering that the space-time data prediction model converges;
and carrying out space-time data prediction by using the trained space-time data prediction model to obtain a graph signal sequence of each node of the future preset time step.
Preferably, the spatiotemporal data is traffic data collected in an urban road network.
Preferably, in the space-time generation countermeasure network, the Wasserstein distance is used as an optimization target to measure the difference between the real data distribution and the generated data distribution.
Preferably, in the space-time generation countermeasure network, a Huber loss term is added to the loss function of the generator as a predicted loss of the generator.
Preferably, in the generator, a localized space-time diagram is obtained through a random walk theory to simulate space-time dependency in space-time data, and space-time dependency among nodes is synchronously captured through a space-time diagram attention module on the basis of the localized space-time diagram.
Preferably, the input of the generator comprises a sequence of history signals for two time periods: recent inputs and periodic inputs;
for recently input data, firstly, space-time characteristics are extracted through a space-time diagram attention module, then, periodic characteristic information in periodic input data is introduced through a self-attention module, and finally, a predicted future diagram signal sequence is generated through a full-connection layer.
Preferably, when training the space-time generation countermeasure network, the generator parameters are updated once per iteration, and the corresponding discriminator parameters are updated a plurality of times.
On the other hand, a data acquisition monitoring system is provided, and the data acquisition monitoring system comprises a data acquisition module, a data analysis prediction module, a data service center and a monitoring APP;
the data acquisition module is used for acquiring space-time data; the data analysis and prediction module is used for predicting the collected space-time data according to the space-time data prediction method; the data service center stores historical space-time data, real-time space-time data and business flow data and provides retrieval service; the monitoring APP is used for providing inquiry, display, online updating and modification of data, and is convenient for management personnel to monitor in real time.
Preferably, the data acquisition module comprises: the system comprises a traffic measuring instrument, a data acquisition front end, a serial port server, an industrial personal computer, a display and data acquisition software.
Preferably, the monitoring APP comprises: the system comprises a client, a server and a system management background;
the client is used for user registration and login, online inquiry, modification and login exit; the server side is used for registering, logging in and verifying, and transmitting, adding, modifying and deleting data; the system management background is used for managing the database.
Compared with the prior art, the technical scheme provided by the invention has the following beneficial effects:
the invention provides a space-time data prediction method and a data acquisition monitoring system based on a space-time generation countermeasure network, wherein the space-time generation countermeasure network is a frame combining a drawing meaning network and a generation countermeasure network and consists of a generator and a discriminator. The generator is used for modeling space-time dependence in the space-time data, and the discriminator is used for regularizing the prediction model so that the prediction model can learn the representation of the space-time data better.
According to the invention, the antagonism loss is introduced into the objective function of the prediction model, so that uncertainty in modeling data is utilized, and the real space-time data distribution is learned through the antagonism process, so that the capability of the prediction model for learning data representation is enhanced, and the problem of excessively fast growth of multi-step prediction errors is solved. The validity of the proposed method was verified on two real public transportation datasets.
The invention constructs a public transportation data acquisition monitoring system, and a complete system is formed by mutually connecting a data acquisition module, a data analysis prediction module and a monitoring APP, so that the real-time monitoring is convenient.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a spatio-temporal data prediction method provided by an embodiment of the present invention;
FIG. 2 is a topological space diagram of traffic data provided by an embodiment of the present invention;
fig. 3 is a schematic diagram of an STGAN challenge learning process according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a network architecture of a generator according to an embodiment of the present invention;
FIG. 5 is a localized space-time diagram provided by an embodiment of the present invention;
FIG. 6 is a schematic diagram of a network structure of a arbiter according to an embodiment of the present invention;
FIG. 7 is a graph showing the comparison of the traffic speed prediction results MAE according to the embodiment of the present invention along the time step;
fig. 8 is a comparison chart of the traffic speed prediction result RMSE provided by the embodiment of the present invention along the time step;
FIG. 9 is a graph showing the comparison of the traffic flow prediction results MAE according to the embodiment of the present invention along the time step;
fig. 10 is a comparison chart of the traffic flow prediction result RMSE provided by the embodiment of the present invention along the time step.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. It will be apparent that the described embodiments are some, but not all, embodiments of the invention. All other embodiments, which can be made by a person skilled in the art without creative efforts, based on the described embodiments of the present invention fall within the protection scope of the present invention.
The embodiment of the invention provides a space-time data prediction method, as shown in fig. 1, comprising the following steps:
establishing a topological space diagram according to the collected space-time data, and recording diagram signal sequences of nodes of the topological space diagram at different moments;
constructing a space-time data prediction model based on a space-time generation countermeasure network, and training the space-time data prediction model by taking a history image signal sequence as a training set;
the space-time generation countermeasure network comprises a generator and a discriminator, wherein the generator is used for modeling space-time dependency relationship in space-time data, and for given input data, the generated data is obtained through prediction; the discriminator is used for regularizing the space-time generation countermeasure network, sampling the generated data output by the generator and the real data and inputting the sampled data into the discriminator, and when the discriminator cannot distinguish the generated data and the real data, considering that the space-time data prediction model converges;
and carrying out space-time data prediction by using the trained space-time data prediction model to obtain a graph signal sequence of each node of the future preset time step.
Specifically, the space-time data is traffic data collected in an urban road network. Given traffic data collected in urban road network (road network), defining its space road network structure as topological space diagram Wherein (1)>For the set of nodes in the graph, +.>The number of the nodes corresponds to N road sections in the road network; epsilon is a collection of edges representing connectivity between nodes (road segments); a epsilon R N×N For the adjacency matrix of graph G, if two nodes n i And n j With edges between them (e.g. two road sections are interconnected), A ij =1, otherwise a ij =0,A ij The subscript ij of (1) represents the row and column indexes of matrix a; r is a real number set.
As shown in fig. 2, the road network is represented as a topological space diagram G, and diagram signal sequences of nodes of the topological space diagram at different moments are recorded. Figure 2 (a) shows a graph signal sequence of traffic data,representing the observed graph signal of the road network at time t, wherein +.>For node n i And the signal value at the time t, N represents the number of nodes in the road network topology space, and F represents the number of variables observed by each node. Fig. 2 (b) shows a time series of three variables recorded by a sensor of a certain node.
Assuming past T h In the course of the time step(s),(time-space-characteristic three-dimensional tensor data) representing F variable image signal sequences recorded by N nodes, and making their correspondent data distribution be +.>The goal here is to predict the future T from a given input by learning a function f p Traffic flow of nodes in road network of individual time steps +.>Wherein->Representing node n i Future target variable values predicted from time t+1.
In order to improve the accuracy of space-time data prediction, the invention introduces the capability of strengthening the representation of the prediction data of the prediction model in an anti-learning mode. Here, let true T p The data distribution corresponding to the traffic flow Y of each node in the road network of each time step is thatTo estimate +.>The corresponding data distribution is->By means of the countermeasure learning process, it is desirable to find a generator +.>To minimizeAnd->Difference of two distributions->(wherein Div (·, ·) represents Divergence (divengence) for measuring the difference of the two distributions) and applies it as a spatio-temporal data prediction model to the actual prediction task.
The space-time generation countermeasure network countermeasure learning process designed by the invention is shown in figure 3, and consists of a generator and a discriminator. Wherein the generator section comprises a graph neural network module for modeling spatio-temporal dependencies in the spatio-temporal data. During training, the generator and the discriminator are sequentially iterated, namely, in each iteration process, data are firstly input into the generator, and the generator generates output. The output of the generator, namely the generated data and the real data, is sampled and input into the discriminator. The whole model converges when the time-space diagram sequence generated by the generator is so similar to the real time-space diagram sequence that it is difficult for the arbiter to distinguish whether it inputs the output from the generator or the real data.
The challenge learning process of the space-time generated challenge network (STGAN) is explained in detail below.
First, a primitive against a network (GAN) is generatedThe method comprises generating a generator in an countermeasure network given a data setAnd discriminator->Learning is performed in an antagonistic process. Wherein (1)>Is to distinguish whether its input comes from real data or from real dataThe generated data;
the task of (1) is to generate data with the same distribution as the real data, let +.>It is difficult to distinguish the difference between the generated data and the real data, and a discriminator is added +.>Is a function of the error rate (error rate).
The objective function of GAN is defined as:
wherein,input Y representing the arbiter comes from the true data distribution +.>Is>Input representing the arbiter +.>From generator output->I.e. generating a data distribution +.>Is used (X represents the input of the generator). For the two different inputs, the output of the discriminator is +.>Or->
And->Is>And->Respectively defined as:
the definition of the two loss functions described above creates a significant problem, namelyThe more powerful the discrimination of +.>The more severe the gradient disappearance phenomenon, the more difficult it is to learn the true data distribution efficiently>Let it be assumed that the generator is fixed +.>Consider the optimum situation of the arbiter +. >Integrating the objective function of the GAN to obtain the following steps:
the generator network parameters are fixed and a specific data Y, possibly from a real data distribution, is input to the arbiterPossibly also from the generation of a data distribution +.>
In the formula (5)For->And (3) deriving to obtain:
the optimal discriminator obtained by simplification is as follows:loss function at generator->Add irrelevant item->Minimization of formula (7) is equivalent to minimization of formula (3):
optimal discriminantSubstitution formula (7) gives:
Kullback-Leibler (KL) divergence and Jensen-Shannon (JS) divergence are widely used data distribution difference metrics. Given two distributionsAnd->Their KL and JS divergences are defined as:
substituting formulas (9) and (10) into formula (8) yields:
in the original GAN model learning process, the closer the arbiter is to the optimal state, the more similar the loss of the minimization generator is to the minimizationAnd->JS divergence between. However, JS divergence cannot effectively measure the difference between distributions, resulting in the generator loss becoming a fixed value of 2log2, causing the gradient disappearance phenomenon, reducing the ability of the generator to learn the true data distribution.
Aiming at the problems existing in the original GAN, the invention uses Wasserstein GAN (WGAN) as an countermeasure learning framework of STGAN, uses Wasserstein distance to replace JS divergence as an optimization target, and can more effectively measure real data distribution And generating data distribution->Differences between them. The objective function of the WGAN is defined as:
fig. 3 shows a schematic diagram of the STGAN model challenge learning presented in the present invention in the context of a spatiotemporal data prediction task. It has been shown in the definition of the problem that the task of spatio-temporal data prediction, which the present invention is directed to, is to predict the future T P Target variable values corresponding to N space position sensors under each time stepWherein->Represents t+i (i=1, 2, …, T p ) Real data values recorded by each space sensor at the moment. Generator->Generated predictive dataInput map signal sequence dependent on itself +.>
Given a set of real data and generator generated dataWherein->Representing the output of the generator, the fight loss portion of the STGAN objective function is defined as:
the design concept of GAN and WGAN is considered to be for generating new data instead of predicting future data. Thus, in order for the generator to generate dataWhile following the real data distribution, as close as possible to the real data Y, a Huber loss term is added in the loss function of the generator as a predictive loss of the generator:
combining equations (13) and (14) to finally obtain the objective function of STGAN:
wherein the parameters areFor controlling the importance of the Huber loss in the overall objective function. Spatiotemporal data generated by the generator +. >The whole model converges as it is very similar to the real spatiotemporal data Y, so that it is difficult for the arbiter to distinguish whether it inputs the output from the generator or the real data.
As shown in algorithm 1, during the training of the STGAN model, the gradient was calculated using a small batch random gradient descent method (the number of lots is set to m). Given θ represents a generator of STGANω represents the discriminator +.>And updating the two parameters by using an RMSProp optimization algorithm. Gradient of generator and discriminator θ And ω respectively defined as:
further, the structure of the generator provided by the embodiment of the invention is described as follows:
given a history signal sequence X in As input, a generatorIs to generate a future T p Target data of nodes in the graph G +.>And, the generated data +.>The real data Y can be approximated as much as possible so that the arbiter +.>Whether its input data comes from the real data Y or the generated data cannot be correctly judged +.>The effect of 'false spurious' is achieved. The generator in the STGAN framework proposed by the present invention is a DSTGAT model, and the model construction is shown in FIG. 4. By inputting a large amount of historical spatiotemporal data, generator +. >Can learn the real space-time data distribution +.>And uses the learned generation profile +.>Predicting a variable value at a future time.
In order for the predictive model to more effectively extract temporal and spatial dependencies in the data, the input spatio-temporal dataFirst, a convolution operation Conv with a convolution kernel size of 1×1 is used for each node signal vector at each time in the topological space diagram G 1×1 Mapping to high-dimensional space>F emb Representing the mapped feature dimension. Different from LSTM and other sequence learning models, the model can retain the temporal order information in the data, the attention mechanism can not distinguish the front-back relative order of the data, and the coded data X can be directly used emb The temporal causal information cannot be effectively captured by inputting the temporal causal information into the attention module. To obtain order information of the input sequence, position embedding is added to the data. For input data X in A learnable temporal coding matrix +.>Added to X emb In (1) obtaining the output of the input layer->
X * =Conv 1×1 (X in )+P (18)
The spatio-temporal dependencies of nodes in the topological space diagram contain multiple types: the influence of the neighbor node at the current moment, the influence of the node history moment state on the node, and the influence of the neighbor node history state on the node. The spatio-temporal dependencies between these complex nodes are important for accurate predictions. In order to more accurately synchronously capture the space-time dependency relationship in the data, the invention establishes a localized space-time diagram.
The propagation of information in the topological space diagram may be represented as a diffusion process, which has markov properties. For this purpose, the diffusion convolution used in DCRNN represents the information propagation of the graph in successive time steps as restart probability by means of a state transition matrixIs a random walk of (c). Given a picture signal X t ∈R N×F And convolution kernel f θ The diffusion convolution operation is defined as:
where, O represents diffusion convolution, τ is defined diffusion step size, θ ε R τ×2 Is a convolution kernel f θ A parameter that is learnable in the database; degree-of-departure diagonal matrix D of directed graph O Diag (a), entry diagonal matrix D I =diag(A T )。And->The state transition matrix and the inverse transition matrix of the diffusion process are respectively represented. While the diffusion convolution operation described above is defined on a directed graph, it can be extended into an undirected graph. When applied to undirected graphs, it is equivalent to a spectral convolution operation approximated by chebyshev polynomials.
From the definition of the diffusion convolution, it can be found that the image signal data X at the same time is always used in the information diffusion process t . Unlike other types of data, the node information in the graph is constant, so that when graph convolution operations such as diffusion convolution are used, different diffusion steps can use the same-moment graph signal data. For spatiotemporal data, the node states at each time point of the spatiotemporal data dynamically change along with time. For each diffusion step, the plot signal for its corresponding time step needs to be considered. Thus, the present invention utilizes the random walk theory to obtain a localized space-time diagram A ST ∈R τN×τN To simulate the space-time dependency relationship in the space-time data, tau represents the diffusion step length, A ST Each space-time node has both spatial and temporal properties. FIG. 5 (a) shows previous studies such as DCRNN, which model temporal and spatial dependencies, respectively, artificially splitting the spatiotemporal relationships in the dataLinkage; fig. 5 (b) shows the space-time dependence of the localized space-time diagram modeling proposed by the present invention, wherein the map signal information at different time, but not at a single time, is extracted by random walk; when (c) in fig. 5 is τ=3, the time-space diagram a is localized ST In the form of (a) using a plurality of adjacency matrices a of different orders (τ) Composition A ST . Wherein A is (τ) Representing a tau-order adjacency matrix, A (1) For space node n in topological space diagram G =a i The tau-order neighbor is n which can be reached through tau space nodes i Is defined in the set of spatial nodes.
Self-attention, one of the dot product attention mechanisms, has been widely used in recent years for various natural language processing and computer vision tasks. Classical self-attention contains three data: query, key andF d is the dimension of three data vectors. The manner of attention calculation can be expressed as:
wherein,respectively representing matrix forms obtained by stacking the query, the key and the value, wherein SoftMax is an activation function.
The classical self-attention mechanisms described above do not efficiently extract spatiotemporal dependencies in the data. Therefore, the invention further provides the time-space diagram attention to synchronously capture the complex time-space dependency relationship among the nodes on the basis of the localized time-space diagram. Input of space-time diagram attention module in layer 1 sub-network layer for different components(wherein T (l-1) For the time dimension of input data, N is the space dimension, namely the number of nodes, F (l-1) Feature dimension), the space-time diagram attention first uses threeDifferent full connection layers capture long-sequence temporal dependence of each node of input data to obtain q=w Q H (l-1) 、K=W K H (l-1) And->Wherein W is Q 、W K And->Considering local spatiotemporal relevance, Q, K and +.>Splitting into multiple heads along the time dimension, for each head +.>Computing attention to extract local spatiotemporal dependency features:
Z * =Concat(head 1 ,…,head s ,…,head S ) (21)
wherein,output representing multi-headed attention through a matrix transformation:
restoring the time dimension to T (l-1) =sτ, the spatial dimension is restored to N. For Z * The output of the space-time diagram attention module is obtained using a convolution layer of 1 x 3 convolution kernels>Concat (-) indicates an operation of splicing a plurality of heads, each +.>Map signal data corresponding to a set of τ consecutive time steps. The input data of the corresponding time-space diagram attention is +. > And->Obtaining a attention coefficient matrix M epsilon R by matrix multiplication calculation of Q and K τN×τN The i-th row of matrix M pays attention to coefficient vector M i ∈R τN Corresponds to q i And K= { K 1 ,…,k j ,…,k τN Dot product calculation result; wherein M is ij For the vector q i And k is equal to j And the product value of (a) represents the attention coefficient of the space-time node i to the space-time node j.
The attention mechanism has more flexibility in capturing dynamic associations in data than the graph convolution operation. But simply drawing attention brings a lot of noise and increases the difficulty of model learning. To this end, a time-space diagram A will be localized ST Mask matrix as attention, i.e. mask=a ST The learning difficulty of the model can be effectively reduced. Wherein, the element Mask of the ith row and the jth column of the matrix Mask ij Indicating whether there is a dependency relationship between the spatiotemporal node j (j=1, 2, …, τn) and the spatiotemporal node i, mask ij =0 indicates no dependence, mask ij Not equal to 0 indicates that there is a dependency. In the space-time diagram attention module, the information of the space-time node i is aggregated to form a space-time node j (Mask ij Not equal to 0) information v j To obtain an update, calculating the weight alpha at the time of polymerization using a softMax function ij
Wherein, representing the state of the space-time node i after the space-time diagram attention module aggregates relevant space-time node information update; alpha ij Representing a state vector v corresponding to a space-time node j when the space-time node i updates the state of the space-time node i j Weight of its influence, when Mask ij When=0, the corresponding α ij =0。
A generatorComprising a history signal sequence of two time periods: recent input->And cycle input->For the input data of the recent time period, firstly, X is extracted by a time-space diagram attention module recent Spatiotemporal features in (1) and then introducing periodic input X using a self-attention module week Periodic characteristic information in the data. Finally, generating a predicted future map signal by means of the fully connected layer +.>
Specific generatorThe network architecture includes three stacked sub-network layers (mode migration layers). Recent input X recent Processing with input layer to obtain output->As input to the first layer mode migration layer. In the pattern migration layer, input data first goes through a space-time diagram attention module to extract complex space-time dependencies in the data. Output of the time space diagram attention module +.>After residual error and layer standardization, the data are input into a self-attention module and are mapped by a full-connection layer to obtain Q s At the same time X week Obtained via the input layer->Input to a self-attention module, and mapped by two different full connection layers to obtain K s And V s . By using the obtained Q s 、K s And V s Calculate self-attention to get output +.> After the residual error and the layer standardization, the output of the feedforward layer is input into a feedforward layer, and the output O is obtained after the residual error and the layer standardization (1) Will output O (1) As an input of the second-layer mode migration layer, correspondingly obtaining an output O (2) And similarly obtaining the output O of the third layer mode migration layer (3) . At the end of the assembly, O (3) The output of the generator is obtained by a fully connected layer>
Further, the structure of the arbiter provided by the embodiment of the invention is described as follows:
in the pair ofIn the learning-resistant process, the real data is givenAs input, the output of the arbiter>As close to 1 as possible; data generated by a given generator->As input, the discriminator outputs +.>Approaching 0 as much as possible, the generator tries to make the output of the arbiter +.>As close to 1 as possible. The error of the discriminator is reversely transmitted back to the generator for guiding the generator to learn the characteristics in the space-time data, so as to generate more real data. A good arbiter can act as a regularization. For this reason, in training STGAN, the generator parameters are updated once per iteration, and the corresponding arbiter parameters need to be updated iteratively n times critic
In designing the arbiter network structure, two sub-network modules of the above design are referenced and used as well: input layer and space-time diagram attention module, specific discriminator The network architecture is shown in fig. 6. Aiming at input, the discriminator extracts space-time characteristic information in the data by using a space-time diagram attention module, and combines three full-connection layers to obtain output of the discriminator.
Correspondingly, the embodiment of the invention also provides a data acquisition monitoring system, which comprises a data acquisition module, a data analysis and prediction module, a data service center and a monitoring APP;
the data acquisition module is used for acquiring space-time data; the data analysis and prediction module is used for predicting the collected space-time data according to the space-time data prediction method; the data service center stores historical space-time data, real-time space-time data and business flow data and provides retrieval service; the monitoring APP is used for providing inquiry, display, online updating and modification of data, and is convenient for management personnel to monitor in real time.
The data acquisition module comprises: the traffic measuring instrument comprises a traffic measuring instrument, a data acquisition front end, a serial port server, an industrial personal computer, a display, data acquisition software and the like.
The data acquisition module is a support system for acquiring traffic data, and takes C++ as a development language to embed various data communication protocols such as 101, 102, 103, 104, modbus, CDT, DISA and the like of various IEC 60870-5; modeling accords with the requirements of an interface reference model, a Common Information Model (CIM) and a Component Interface Specification (CIS) in IEC 61970, accords with international standards, and can be used as middleware to be seamlessly integrated with each system; and the access of system data such as a monitoring system, a comprehensive energy management and control system, metering, fault analysis, alarm pushing and the like is realized. The system supports the access of various devices and has the resolving capability of various protocols.
The data acquisition monitoring system adopts a 2-level architecture, namely a single comprehensive energy management and control system and a cloud platform centralized monitoring system. The comprehensive energy management and control system is used for collecting real-time operation monitoring data of local traffic and realizing local data monitoring, historical data sampling and storage and uploading of key real-time data to the cloud platform centralized monitoring system. The cloud platform centralized monitoring system takes traffic real-time monitoring data for monitoring traffic conditions. The communication protocol between the 2-level systems can adopt an electric power standard IEC104 protocol or other protocols, the real-time data acquisition frequency supports the second level according to the protocol requirements, and modes such as variable quantity uploading, cyclic uploading and calling can be supported.
The data service center stores historical space-time data and real-time space-time data of the production process by using a real-time historical database and provides retrieval service; the business SQL database (Oracle or MYSQL) stores business process static data and provides retrieval service, and the application mode of offline analysis data by using the big data analysis platform can support the real-time monitoring requirement of the running state of the photovoltaic building and can also meet the analysis requirements of various application-oriented and theme-oriented.
The data service center adopts a real-time database system design, the real-time database system is novel database management system software, and the high-speed database engine developed based on a 64bit system and the advanced distributed cluster architecture enable the system to be suitable for acquisition, storage, retrieval and release of massive real-time/historical data, have good horizontal expansion capability and high availability, can process dynamic data which is rapidly changed along with time, and improve the speed and efficiency of data retrieval and search.
The monitoring APP is mainly used for inquiring and displaying related data information, and is updated and modified online, so that management personnel can monitor the related data information in real time.
The monitoring APP mainly comprises a client, a server and a system management background; the client uses MUI front end frame to develop and design, uses HTML5, CSS, javaScript language to develop front end, and is used for user registration and login, online inquiry, modification and log-out; the server uses the ThinkJS server framework to develop, and is matched with a MySQL database for registration, login verification and data transmission, addition, modification and deletion functions; the system management background is developed by using HTML5, CSS and JavaScript language and is used for managing the database.
The monitoring APP is simple and convenient to operate, and the interface is concise and beautified. The system has real-time performance, and registered users can log on the system through the mobile phone APP wherever they are. The system provides automatic query and display functions and user registration information management capabilities. The monitoring APP is provided with a query for the distribution area of the regional monitoring points, and the distribution condition of each region in the map is loaded on line and the inflection point coordinates of the region are obtained by utilizing the GPS positioning function on the Android mobile phone.
The implementation of the method according to the invention is described in more detail below by way of more specific examples.
The required traffic data sets are acquired through the data acquisition module, and the performance of the model is evaluated on two real public traffic data sets: peMS08 and METR-LA.
(1) The PeMS08 data set is traffic data collected from an expressway at a frequency of sampling every 30 seconds.
(2) The traffic speed dataset METR-LA contains traffic speed data recorded by 207 sensors on the highway for a total of four months.
The raw data was re-aggregated at 5 minute intervals, a day containing 288 records of sampling time points. The data recorded by each node in the two data sets is normalized in the following manner and then input into the neural network.
In the above expression, mean (x) and std (x) are operations for obtaining the data x-means and standard deviations, respectively.
In the experimental part of the invention, a LSTM, GCRN, ASTGCN and generator method was used as a reference model for comparison experiments.
The STGAN model provided by the invention is realized by using a Pytorch deep learning framework. The input and output time ranges are respectively T w =12、T r =24 and T p =12; delta in the generator predicted loss is set to 1; diffusion step τ=3 in the localized space-time diagram. Periodic and recent inputs in generator and input layer mapping dimension F of arbiter emb Are set to 36. The METR-LA traffic speed dataset and the PeMS08 traffic flow dataset were each divided into three portions at a ratio of 6:2:2 for training, validation and testing, respectively. The batch number is set to be 16, an RMSProp optimization algorithm is selected, and the learning rate alpha is set to be 0.0008; the generator iterates once, corresponding to the number n of the arbiter iterations critic =3; the model was trained on 40 epochs.
Analysis of experimental results:
(1) Traffic speed prediction result analysis
The average predictions for 15 minutes (3 time steps), 30 minutes (6 time steps), 60 minutes (12 time steps) and 12 time steps for each experimental model to predict the METR-LA traffic speed dataset are listed in Table 1. Experimental results indicate that the STGAN presented herein achieves relatively better predictions compared to other baseline models. In particular, STGAN improves the average MAE and RMSE over the data set for 12 time steps by 6.43% and 3.27%, respectively, compared to the DSTGAT model.
TABLE 1 comparison of traffic speed prediction accuracy
Further, the curves of MAE and RMSE increase over time for the predicted results of each model on the METR-LA dataset are given in FIGS. 7 and 8. The STGAN model was improved by 5.90% and 1.25% compared to MAE and RMSE of DSTGAT, respectively, on short-term (first 6 time steps) prediction tasks. In contrast, STGAN was improved on average by 7.17% and 2.71% on MAE, RMSE, respectively, compared to DSTGAT over long-term (6 time steps later) prediction tasks. As the prediction time step extends, MAE and RMSE of the STGAN model increase relatively slowly compared with other methods, which reflects the phenomenon that the STGAN model provided by the invention relatively well relieves multi-step prediction error growth, and verifies the excellent performance of the countermeasure learning strategy provided by the invention.
LSTM uses an iterative multi-step prediction strategy with MAEs at 15, 30 and 60 min prediction levels of 5.15, 6.87 and 9.18, respectively, with an increase in error of 1.72 from 15 to 30 min, a relative increase of 2.31 from 30 to 60 min, and a very fast increase in error along the time step. This is on the one hand because it models temporal correlations only, and does not take into account the reasons of spatial correlation. In contrast, GCRN also uses an iterative multi-step prediction strategy, and overall prediction error is much smaller than LSTM because spatial correlation is modeled using a graph convolution operation. The error increases by 1.36 from 15 minutes to 30 minutes, increases by 2.12 from 30 minutes to 60 minutes, and the error increase amplitude is also reduced to a certain extent. The MAEs of 15 to 30 minutes of ASTGCN and DSTGAT models adopting the direct multi-step prediction mode are respectively increased by 1.08 and 1.11, and the MAEs of 30 to 60 minutes are respectively increased by 1.69 and 1.86. It is verified that the direct multi-step prediction approach can alleviate the problem of error accumulation to some extent. Finally, compared with ASTGCN and DSTGAT, the space-time generation method provided by the invention obtains relatively better prediction results of the anti-network STGAN, wherein the MAE value of the prediction results is relatively increased by 0.89 from 15 minutes to 30 minutes and is relatively increased by 1.48 from 30 minutes to 60 minutes.
(2) Traffic flow prediction result analysis
Table 2 lists the results of traffic flow predictions for each experimental model on the PeMS08 dataset. Similar to the experimental results for the METR-LA dataset, on the PeMS08 dataset, the STGAN presented herein achieved better predictions compared to other baseline models. Compared to the DSTGAT model, STGAN has 2.39% and 3.42% improvement in average MAE and RMSE over 12 time steps on the dataset, respectively. Compared with ASTGCN, the average MAE and the RMSE of STGAN are respectively improved by 9.19 percent and 5.18 percent.
Table 2 comparison of traffic flow prediction accuracy
The curves of the MAE and RMSE increase over time for the predicted results on the PeMS08 dataset for each experimental model are given in FIGS. 9 and 10. The predicted MAE and RMSE curves for each model were more intense on the PeMS08 dataset than on the METR-LA dataset. On the short-term (first 6 time steps) prediction tasks, the STGAN model was improved by 4.37% and 3.08% on MAE and RMSE, respectively, compared to DSTGAT. STGAN is improved on average by 4.04% and 3.83% on MAE, RMSE, respectively, over long-term (last 6 time steps) prediction tasks compared to DSTGAT. The experimental result of traffic flow prediction on the PeMS08 data set again proves the effectiveness of the space-time generation countermeasure network STGAN provided by the invention, and the multistep prediction error growth phenomenon can be relieved by utilizing the countermeasure learning strategy, so that the accuracy of the space-time data prediction task is further improved.
(3) Generator loss function weight parameter analysis
The invention experimentally researches the generator of STGANIn the loss functionInfluence of the value on the prediction accuracy of the value, +.>Representing the ratio of the antagonism loss to the Huber loss (predictive loss) in STGAN that plays a role in generator parameter updating. The data shown in Table 3 are four different +.>Under the values, the STGAN model averages the MAE and RMSE values of the predicted results over 60 minutes (12 time steps).
It can be seen that the prediction accuracy of STGAN over two different data sets is a function of the prediction penalty weight valueThe decrease of (1) increases first and decreases second. STGAN is at predictive loss weight +.>The prediction error is maximum at 0.00003. As the predictive loss weight increases, the STGAN prediction error decreases, and the value of the predictive loss weight is +.>At 0.0003, the model performance is optimal. As the weight value continues to increase, the accuracy of STGAN prediction decreases slightly. Experimental results show that when the generation loss weight is overlarge, the model is difficult to accurately capture the space-time dependence characteristics, so that the performance of the model is reduced. When predicting loss weight->When the model learning time-space dependence characteristics are too small, the difficulty of learning the model is increased, and the prediction accuracy of the model is also affected.
Table 3 influence of the generator prediction loss term weight on the prediction result
In summary, the invention provides a space-time generation countermeasure network model STGAN for space-time data prediction, which aims at the problems that a single loss function is difficult to model uncertainty in space-time data and multi-step prediction errors rapidly increase along steps, and forms a framework which is formed by combining a simplified noise-reduction space-time diagram attention network and a generated countermeasure network and consists of a generator and a discriminator. The generator is a space-time data prediction model and is used for modeling space-time dependency relationship in space-time data, and the discriminator is used for regularizing the graph neural network so as to enable the graph neural network to learn the representation of the space-time data better. And introducing countermeasures loss into an objective function of the prediction model to model uncertainty in data, and learning real space-time data distribution through a countermeasures process to strengthen the accuracy of the prediction model so as to solve the problem that multi-step prediction errors grow too fast. The effectiveness of the STGAN is verified by the experimental result of applying the STGAN to two types of traffic data.
The invention also constructs a data acquisition monitoring system, and the whole invention forms a complete traffic data analysis monitoring system, thereby providing a beneficial reference for the research and development of the related fields.
Embodiments of the present invention also provide an electronic device that may vary widely due to configuration or performance, and may include one or more processors (central processing units, CPU) and one or more memories, where the memories store at least one instruction that is loaded and executed by the processors to implement the steps of the spatio-temporal data prediction method described above.
In an exemplary embodiment, a computer readable storage medium, such as a memory comprising instructions executable by a processor in a terminal to perform the above-described spatio-temporal data prediction method, is also provided. For example, the computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
References in the specification to "one embodiment," "an example embodiment," "some embodiments," etc., indicate that the embodiment described may include a particular feature, structure, or characteristic, but every embodiment may not necessarily include the particular feature, structure, or characteristic. Further, when a particular feature, structure, or characteristic is described in connection with an embodiment, it is submitted that it is within the knowledge of one skilled in the relevant art to effect such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described.
The invention is intended to cover any alternatives, modifications, equivalents, and variations that fall within the spirit and scope of the invention. In the following description of preferred embodiments of the invention, specific details are set forth in order to provide a thorough understanding of the invention, and the invention will be fully understood to those skilled in the art without such details. In other instances, well-known methods, procedures, flows, components, circuits, and the like have not been described in detail so as not to unnecessarily obscure aspects of the present invention.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in implementing the methods of the embodiments described above may be implemented by a program that instructs associated hardware, and the program may be stored on a computer readable storage medium, such as: ROM/RAM, magnetic disks, optical disks, etc.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims (10)

1. A method for predicting spatio-temporal data, comprising the steps of:
establishing a topological space diagram according to the collected space-time data, and recording diagram signal sequences of nodes of the topological space diagram at different moments;
constructing a space-time data prediction model based on a space-time generation countermeasure network, and training the space-time data prediction model by taking a history image signal sequence as a training set;
the space-time generation countermeasure network comprises a generator and a discriminator, wherein the generator is used for modeling space-time dependency relationship in space-time data, and for given input data, the generated data is obtained through prediction; the discriminator is used for regularizing the space-time generation countermeasure network, sampling the generated data output by the generator and the real data and inputting the sampled data into the discriminator, and when the discriminator cannot distinguish the generated data and the real data, considering that the space-time data prediction model converges;
and carrying out space-time data prediction by using the trained space-time data prediction model to obtain a graph signal sequence of each node of the future preset time step.
2. The method of claim 1, wherein the spatiotemporal data is traffic data collected in an urban road network.
3. The method of claim 1, wherein the spatiotemporal generation countermeasure network uses wasperstein distance as an optimization target to measure a difference between a real data distribution and a generated data distribution.
4. The method according to claim 1, wherein in the spatio-temporal generation countermeasure network, a Huber loss term is added to a loss function of the generator as a prediction loss of the generator.
5. The method according to claim 1, wherein the generator obtains a localized space-time diagram by a random walk theory to simulate a space-time dependency relationship in the space-time data, and the space-time dependency relationship between the nodes is synchronously captured by a space-time diagram attention module on the basis of the localized space-time diagram.
6. The method of claim 1, wherein the input to the generator comprises a sequence of history signals for two time periods: recent inputs and periodic inputs;
For recently input data, firstly, space-time characteristics are extracted through a space-time diagram attention module, then, periodic characteristic information in periodic input data is introduced through a self-attention module, and finally, a predicted future diagram signal sequence is generated through a full-connection layer.
7. The method of claim 1, wherein the generator parameters are updated once per iteration and the corresponding arbiter parameters are updated multiple times per iteration while training the spatiotemporal generation countermeasure network.
8. The data acquisition monitoring system is characterized by comprising a data acquisition module, a data analysis prediction module, a data service center and a monitoring APP;
the data acquisition module is used for acquiring space-time data; the data analysis and prediction module is used for predicting the acquired space-time data according to the space-time data prediction method of any one of claims 1-7; the data service center stores historical space-time data, real-time space-time data and business flow data and provides retrieval service; the monitoring APP is used for providing inquiry, display, online updating and modification of data, and is convenient for management personnel to monitor in real time.
9. The data acquisition monitoring system of claim 8, wherein the data acquisition module comprises: the system comprises a traffic measuring instrument, a data acquisition front end, a serial port server, an industrial personal computer, a display and data acquisition software.
10. The data acquisition monitoring system of claim 8, wherein the monitoring APP comprises: the system comprises a client, a server and a system management background;
the client is used for user registration and login, online inquiry, modification and login exit; the server side is used for registering, logging in and verifying, and transmitting, adding, modifying and deleting data; the system management background is used for managing the database.
CN202311026579.4A 2023-08-15 2023-08-15 Space-time data prediction method and data acquisition monitoring system Pending CN117171543A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311026579.4A CN117171543A (en) 2023-08-15 2023-08-15 Space-time data prediction method and data acquisition monitoring system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311026579.4A CN117171543A (en) 2023-08-15 2023-08-15 Space-time data prediction method and data acquisition monitoring system

Publications (1)

Publication Number Publication Date
CN117171543A true CN117171543A (en) 2023-12-05

Family

ID=88942166

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311026579.4A Pending CN117171543A (en) 2023-08-15 2023-08-15 Space-time data prediction method and data acquisition monitoring system

Country Status (1)

Country Link
CN (1) CN117171543A (en)

Similar Documents

Publication Publication Date Title
CN114422381A (en) Communication network flow prediction method, system, storage medium and computer equipment
CN114299723B (en) Traffic flow prediction method
CN112910711B (en) Wireless service flow prediction method, device and medium based on self-attention convolutional network
CN112910710B (en) Network flow space-time prediction method and device, computer equipment and storage medium
CN110570035B (en) People flow prediction system for simultaneously modeling space-time dependency and daily flow dependency
CN112187554B (en) Operation and maintenance system fault positioning method and system based on Monte Carlo tree search
Sommer et al. Online distributed learning in wind power forecasting
CN116346639A (en) Network traffic prediction method, system, medium, equipment and terminal
CN113505924A (en) Information propagation prediction method and system based on cascade spatiotemporal features
CN115221396A (en) Information recommendation method and device based on artificial intelligence and electronic equipment
CN114694379B (en) Traffic flow prediction method and system based on self-adaptive dynamic graph convolution
Xu et al. Short‐term traffic flow prediction based on whale optimization algorithm optimized BiLSTM_Attention
Zhou et al. Network traffic prediction method based on echo state network with adaptive reservoir
CN115660147A (en) Information propagation prediction method and system based on influence modeling between propagation paths and in propagation paths
CN117271899A (en) Interest point recommendation method based on space-time perception
CN112489420A (en) Road traffic state prediction method, system, terminal and storage medium
Kong et al. A novel ConvLSTM with multifeature fusion for financial intelligent trading
CN116937559A (en) Power system load prediction system and method based on cyclic neural network and tensor decomposition
Shao et al. A Hybrid Approach by CEEMDAN‐Improved PSO‐LSTM Model for Network Traffic Prediction
CN117171543A (en) Space-time data prediction method and data acquisition monitoring system
CN116484016A (en) Time sequence knowledge graph reasoning method and system based on automatic maintenance of time sequence path
CN115830865A (en) Vehicle flow prediction method and device based on adaptive hypergraph convolution neural network
CN116308854A (en) Information cascading popularity prediction method and system based on probability diffusion
CN115333957A (en) Service flow prediction method and system based on user behaviors and enterprise service characteristics
CN114566048A (en) Traffic control method based on multi-view self-adaptive space-time diagram network

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