CN112668797B - Long-short-period traffic prediction method - Google Patents

Long-short-period traffic prediction method Download PDF

Info

Publication number
CN112668797B
CN112668797B CN202011641479.9A CN202011641479A CN112668797B CN 112668797 B CN112668797 B CN 112668797B CN 202011641479 A CN202011641479 A CN 202011641479A CN 112668797 B CN112668797 B CN 112668797B
Authority
CN
China
Prior art keywords
traffic
traffic prediction
term
feature
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
CN202011641479.9A
Other languages
Chinese (zh)
Other versions
CN112668797A (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.)
Sun Yat Sen University
Original Assignee
Sun Yat Sen 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 Sun Yat Sen University filed Critical Sun Yat Sen University
Priority to CN202011641479.9A priority Critical patent/CN112668797B/en
Publication of CN112668797A publication Critical patent/CN112668797A/en
Application granted granted Critical
Publication of CN112668797B publication Critical patent/CN112668797B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

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

Abstract

The application discloses a long-term and short-term traffic prediction method, which comprises the steps of obtaining first historical traffic data of nodes in a constructed traffic road network diagram, and carrying out convolution processing on the first historical traffic data through a first convolution layer in a preset traffic prediction model; traffic prediction is carried out on the convolved first historical traffic data through a first iteration RNN operator in the model, a traffic prediction result of a first time step is output, and the traffic prediction result of the first time step is input to a next iteration RNN operator for traffic prediction until the T-th traffic prediction is carried out p T of the iterative RNN operator output p Traffic prediction results of the time steps are obtained through a splicing module in the model p And the traffic prediction results of the time steps are spliced and then input into a second convolution layer for convolution processing, and the final traffic prediction result is output. The traffic prediction method solves the technical problems that the existing traffic prediction method has high prediction error accumulation and cannot simultaneously consider the long-term prediction precision and the short-term prediction precision.

Description

一种长短期交通预测方法A Long-term and Short-term Traffic Forecasting Method

技术领域technical field

本申请涉及交通预测技术领域,尤其涉及一种长短期交通预测方法。The present application relates to the technical field of traffic forecasting, in particular to a long-term and short-term traffic forecasting method.

背景技术Background technique

交通预测是经典的时空预测问题,在实际生活中应用广泛,例如智慧城市路网规划、智能出行路径规划、城市公共交通系统等。由于交通数据具有高度非线性和复杂性,现有技术主要通过深度学习来解决交通预测问题。而现有的交通预测方法存在预测误差累计较高,以及不能同时兼顾长短期预测精度的问题。Traffic forecasting is a classic spatiotemporal forecasting problem, which is widely used in real life, such as smart city road network planning, intelligent travel route planning, urban public transportation systems, etc. Due to the highly nonlinear and complex nature of traffic data, existing technologies mainly use deep learning to solve traffic prediction problems. However, the existing traffic forecasting methods have the problems of high accumulation of forecast errors and the inability to take into account both long-term and short-term forecast accuracy.

发明内容Contents of the invention

本申请提供了一种长短期交通预测方法,用于解决现有的交通预测方法存在预测误差累计较高,以及不能同时兼顾长短期预测精度的技术问题。The present application provides a long-term and short-term traffic forecasting method, which is used to solve the technical problems that the existing traffic forecasting methods have a high accumulation of forecast errors and cannot take into account both long-term and short-term forecasting accuracy.

有鉴于此,本申请第一方面提供了一种长短期交通预测方法,包括:In view of this, the first aspect of the present application provides a long-term and short-term traffic forecasting method, including:

将交通路网构建为图结构,得到交通路网图;Construct the traffic road network into a graph structure to obtain a traffic road network graph;

获取所述交通路网图中的节点的第一历史交通数据;Acquiring first historical traffic data of nodes in the traffic road network graph;

将所述第一历史交通数据输入到包含第一卷积层、Tp个迭代RNN算子、拼接模块和第二卷积层的预置交通预测模型,使得所述第一卷积层对所述第一历史交通数据进行卷积处理,第一个迭代RNN算子对卷积处理后的所述第一历史交通数据进行交通预测,输出第一个时间步的交通预测结果,将所述第一个时间步的交通预测结果输入到下一个迭代RNN算子进行交通预测,直至第Tp个迭代RNN算子输出第Tp个时间步的交通预测结果,所述拼接模块对Tp个时间步的交通预测结果进行拼接,所述第二卷积层对拼接后的交通预测结果进行卷积处理,输出最终的交通预测结果。The first historical traffic data is input to the preset traffic prediction model comprising the first convolutional layer, T p iterative RNN operators, splicing modules and the second convolutional layer, so that the first convolutional layer is The first historical traffic data is subjected to convolution processing, and the first iterative RNN operator performs traffic prediction on the first historical traffic data after convolution processing, outputs the traffic prediction result of the first time step, and converts the first time step The traffic prediction result of one time step is input to the next iterative RNN operator for traffic prediction, until the T pth iterative RNN operator outputs the traffic prediction result of the T pth time step, and the splicing module performs the traffic prediction for the T p time step The traffic prediction results of the first step are spliced, and the second convolutional layer performs convolution processing on the spliced traffic prediction results to output the final traffic prediction result.

可选的,所述迭代RNN算子包括门控线性单元、扩散卷积层和全连接层;Optionally, the iterative RNN operator includes a gated linear unit, a diffuse convolution layer and a fully connected layer;

所述第一个迭代RNN算子对卷积处理后的所述第一历史交通数据进行交通预测,输出第一个时间步的交通预测结果,包括:The first iterative RNN operator performs traffic prediction on the first historical traffic data after convolution processing, and outputs the traffic prediction result of the first time step, including:

所述门控线性单元提取卷积处理后的所述第一历史交通数据的时间依赖关系,输出第一特征;The gated linear unit extracts the time dependence of the first historical traffic data after convolution processing, and outputs the first feature;

所述扩散卷积层提取所述第一特征的空间依赖关系,输出第二特征;The diffusion convolution layer extracts the spatial dependence of the first feature, and outputs the second feature;

所述全连接层对所述第二特征进行交通预测,输出第一个时间步的交通预测结果。The fully connected layer performs traffic prediction on the second feature, and outputs the traffic prediction result of the first time step.

可选的,所述门控线性单元提取卷积处理后的所述第一历史交通数据的时间依赖关系,输出第一特征,包括:Optionally, the gated linear unit extracts the temporal dependence of the first historical traffic data after convolution processing, and outputs the first feature, including:

所述门控线性单元对卷积处理后的所述第一历史交通数据进行一维卷积处理,得到第一卷积特征和第二卷积特征,The gated linear unit performs one-dimensional convolution processing on the first historical traffic data after convolution processing to obtain a first convolution feature and a second convolution feature,

所述门控线性单元通过激活函数对所述第二卷积特征进行激活处理,并计算所述第一卷积特征与激活处理后的所述第二卷积特征的哈达玛积;The gated linear unit activates the second convolution feature through an activation function, and calculates the Hadamard product of the first convolution feature and the activated second convolution feature;

所述门控线性单元将卷积处理后的所述第一历史交通数据与所述哈达玛积进行残差连接,输出第一特征。The gated linear unit performs residual connection between the first historical traffic data after convolution processing and the Hadamard product, and outputs a first feature.

可选的,所述扩散卷积层提取所述第一特征的空间依赖关系,输出第二特征,包括:Optionally, the diffusion convolution layer extracts the spatial dependence of the first feature, and outputs a second feature, including:

所述扩散卷积层对所述第一特征进行带自适应矩阵的扩散卷积特征提取,输出第二特征。The diffusion convolution layer performs diffusion convolution feature extraction with an adaptive matrix on the first feature, and outputs a second feature.

可选的,所述第二特征为:Optionally, the second feature is:

Figure BDA0002880019890000021
Figure BDA0002880019890000021

其中,Z为第二特征,Pf=A/rowsum(A)为前向转移矩阵,A为权重邻接矩阵;Pb=AT/rowsum(AT)为后向转移矩阵;X为第一特征,W为扩散卷积层的参数矩阵,K为常数;

Figure BDA0002880019890000022
为自适应矩阵,E1、E2分别为源节点嵌入、目标节点嵌入。Among them, Z is the second feature, P f =A/rowsum(A) is the forward transfer matrix, A is the weight adjacency matrix; P b = AT /rowsum(A T ) is the backward transfer matrix; X is the first Features, W is the parameter matrix of the diffusion convolution layer, and K is a constant;
Figure BDA0002880019890000022
is an adaptive matrix, and E 1 and E 2 are source node embedding and target node embedding respectively.

可选的,所述方法还包括:Optionally, the method also includes:

基于所述交通路网图计算所述权重邻接矩阵,所述权重邻接矩阵中的权重的计算公式为:The weight adjacency matrix is calculated based on the traffic road network diagram, and the calculation formula of the weight in the weight adjacency matrix is:

Figure BDA0002880019890000023
Figure BDA0002880019890000023

其中,aij为交通路网图中的邻居节点i、j之间边的权重,dij为邻居节点i、j之间的距离,δ为阈值参数,ε为超参数。Among them, a ij is the weight of the edge between neighbor nodes i and j in the traffic road network graph, d ij is the distance between neighbor nodes i and j, δ is the threshold parameter, and ε is the hyperparameter.

可选的,所述将所述第一历史交通数据输入到包含第一卷积层、Tp个迭代RNN算子、拼接模块和第二卷积层的预置交通预测模型,之前还包括:Optionally, the input of the first historical traffic data to a preset traffic prediction model comprising the first convolutional layer, T p iterative RNN operators, splicing modules and the second convolutional layer, also includes:

对所述第一历史交通数据进行预处理。Perform preprocessing on the first historical traffic data.

可选的,所述预置交通预测模型的配置过程为:Optionally, the configuration process of the preset traffic prediction model is:

获取所述交通路网图中的节点的第二历史交通数据;Acquiring second historical traffic data of nodes in the traffic road network graph;

通过所述第二历史交通数据对交通预测网络进行训练,得到所述预置交通预测模型。The traffic prediction network is trained by the second historical traffic data to obtain the preset traffic prediction model.

可选的,所述交通预测网络的损失函数为:Optionally, the loss function of the traffic prediction network is:

Figure BDA0002880019890000031
Figure BDA0002880019890000031

其中,

Figure BDA0002880019890000032
为预测的Tp个时间步的交通数据,/>
Figure BDA0002880019890000033
为未来Tp个时间步的真实交通数据,Wθ为交通预测网络的训练参数。in,
Figure BDA0002880019890000032
is the predicted traffic data of T p time steps, />
Figure BDA0002880019890000033
is the real traffic data of T p time steps in the future, and W θ is the training parameter of the traffic prediction network.

从以上技术方案可以看出,本申请具有以下优点:As can be seen from the above technical solutions, the present application has the following advantages:

本申请提供了一种长短期交通预测方法,包括:将交通路网构建为图结构,得到交通路网图;获取交通路网图中的节点的第一历史交通数据;将第一历史交通数据输入到包含第一卷积层、Tp个迭代RNN算子、拼接模块和第二卷积层的预置交通预测模型,使得第一卷积层对第一历史交通数据进行卷积处理,第一个迭代RNN算子对卷积处理后的第一历史交通数据进行交通预测,输出第一个时间步的交通预测结果,将第一个时间步的交通预测结果输入到下一个迭代RNN算子进行交通预测,直至第Tp个迭代RNN算子输出第Tp个时间步的交通预测结果,拼接模块对Tp个时间步的交通预测结果进行拼接,第二卷积层对拼接后的交通预测结果进行卷积处理,输出最终的交通预测结果。This application provides a long-term and short-term traffic forecasting method, including: constructing the traffic road network as a graph structure to obtain the traffic road network graph; obtaining the first historical traffic data of the nodes in the traffic road network graph; Input to the preset traffic prediction model including the first convolutional layer, T p iterative RNN operators, splicing module and the second convolutional layer, so that the first convolutional layer performs convolution processing on the first historical traffic data, and the second An iterative RNN operator performs traffic prediction on the first historical traffic data after convolution processing, outputs the traffic prediction result of the first time step, and inputs the traffic prediction result of the first time step to the next iterative RNN operator Carry out traffic prediction until the T pth iterative RNN operator outputs the traffic prediction result of the T p time step, the splicing module splices the traffic prediction results of the T p time step, and the second convolutional layer The prediction results are processed by convolution, and the final traffic prediction results are output.

本申请中的交通预测方法,将获取的第一历史交通数据输入到预置交通预测模型,通过迭代RNN算子进行一个时间步的预测,每一次的交通预测结果输入到下一个迭代RNN算子进行下一个时间步的预测,同时作为最终输出结果的一部分,通过每个迭代RNN算子进行一个时间步的预测,可以提取到有效的长短期交通时空信息,减少误差累计的现象,提高了短期交通预测精度;通过拼接模块将所有时间步的交通预测结果进行拼接,再对拼接后的交通预测结果进行卷积处理输出最终的交通预测结果,得到了长短期交通预测结果,兼顾到了长短期交通预测精度,从而解决了现有的交通预测方法存在预测误差累计较高,以及不能同时兼顾长短期预测精度的技术问题。In the traffic forecasting method in this application, the acquired first historical traffic data is input into a preset traffic forecasting model, and a time step forecast is performed through an iterative RNN operator, and each traffic forecast result is input into the next iterative RNN operator Predict the next time step, and at the same time, as part of the final output, through each iterative RNN operator to predict a time step, you can extract effective long-term and short-term traffic spatio-temporal information, reduce the phenomenon of error accumulation, and improve the short-term Accuracy of traffic prediction; the traffic prediction results of all time steps are spliced through the splicing module, and then the spliced traffic prediction results are convoluted to output the final traffic prediction results, and the long-term and short-term traffic prediction results are obtained, taking into account the long-term and short-term traffic Forecasting accuracy, thus solving the technical problems that the existing traffic forecasting methods have a high accumulation of forecasting errors and cannot take into account the long-term and short-term forecasting accuracy at the same time.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present application. Those skilled in the art can also obtain other drawings based on these drawings without any creative effort.

图1为本申请实施例提供的一种长短期交通预测方法的一个流程示意图;Fig. 1 is a schematic flow chart of a long-term and short-term traffic forecasting method provided by the embodiment of the present application;

图2为本申请实施例提供的一种交通路网传感器分布的一个示意图;Fig. 2 is a schematic diagram of a traffic road network sensor distribution provided by an embodiment of the present application;

图3为本申请实施例提供的一种RNN结构的一个结构示意图;FIG. 3 is a schematic structural diagram of an RNN structure provided in an embodiment of the present application;

图4为本申请实施例提供的一种门控线性单元的一个结构示意图;FIG. 4 is a schematic structural diagram of a gated linear unit provided in an embodiment of the present application;

图5为本申请实施例提供的一种预置交通预测网络模型的一个结构示意图;FIG. 5 is a schematic structural diagram of a preset traffic prediction network model provided by the embodiment of the present application;

图6为本申请实施例提供的第一个迭代RNN算子进行交通预测的一个流程示意图。FIG. 6 is a schematic flow chart of traffic prediction performed by the first iterative RNN operator provided in the embodiment of the present application.

具体实施方式Detailed ways

本申请提供了一种长短期交通预测方法,用于解决现有的交通预测方法存在预测误差累计较高,以及不能同时兼顾长短期预测精度的技术问题。The present application provides a long-term and short-term traffic forecasting method, which is used to solve the technical problems that the existing traffic forecasting methods have a high accumulation of forecast errors and cannot take into account both long-term and short-term forecasting accuracy.

为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to enable those skilled in the art to better understand the solution of the application, the technical solution in the embodiment of the application will be clearly and completely described below in conjunction with the drawings in the embodiment of the application. Obviously, the described embodiment is only It is a part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

为了便于理解,请参阅图1,本申请提供的一种长短期交通预测方法的一个实施例,包括:For ease of understanding, please refer to Figure 1, an embodiment of a long-term and short-term traffic forecasting method provided by the present application, including:

步骤101、将交通路网构建为图结构,得到交通路网图。Step 101. Construct the traffic road network into a graph structure to obtain a traffic road network graph.

在本申请实施例中,可以将交通路网构建为有向图结构,得到交通路网图G=(V,E,A),V为节点集,即交通路网上传感器的集合,可以参考图2,每个传感器会记录历史交通数据,例如速度、车流量等。E为节点间的边集,A∈RN×N为交通路网图G的权重邻接矩阵。In the embodiment of the present application, the traffic road network can be constructed as a directed graph structure, and the traffic road network graph G=(V, E, A) can be obtained, and V is a node set, that is, a collection of sensors on the traffic road network. 2. Each sensor will record historical traffic data, such as speed, traffic flow, etc. E is the edge set between nodes, and A∈R N×N is the weighted adjacency matrix of the traffic road network graph G.

进一步,权重邻接矩阵中的权重的计算公式为:Further, the calculation formula of the weight in the weight adjacency matrix is:

Figure BDA0002880019890000051
Figure BDA0002880019890000051

其中,aij为交通路网图中的邻居节点i、j之间边的权重,dij为邻居节点i、j之间的距离,δ为阈值参数,可以设置为0.1,ε为超参数,可以根据实际情况设置具体的值。权重邻接矩阵A由交通路网图中所有的邻居节点i、j之间边的权重构成。Among them, a ij is the weight of the edge between neighbor nodes i and j in the traffic road network graph, d ij is the distance between neighbor nodes i and j, δ is the threshold parameter, which can be set to 0.1, ε is the hyperparameter, A specific value can be set according to the actual situation. The weight adjacency matrix A is composed of the weights of the edges between all neighbor nodes i and j in the traffic road network graph.

步骤102、获取交通路网图中的节点的第一历史交通数据。Step 102. Obtain first historical traffic data of nodes in the traffic road network graph.

在得到交通路网图G后,可以通过其中的节点获取第一历史交通数据。

Figure BDA0002880019890000052
为在第t个时间步的第i个节点的交通数据,xt∈RN为第t个时间步的所有节点的交通数据。本申请实施例中,通过获取历史的τ个交通数据,以预测未来Tp个时间步的交通数据。因此,本申请实施例中获取的第一历史交通数据可以表示为:After obtaining the traffic road network graph G, the first historical traffic data can be obtained through the nodes in it.
Figure BDA0002880019890000052
is the traffic data of the i-th node in the t-th time step, and x t ∈ R N is the traffic data of all nodes in the t-th time step. In the embodiment of the present application, the traffic data of T p time steps in the future are predicted by acquiring historical τ traffic data. Therefore, the first historical traffic data obtained in the embodiment of the present application can be expressed as:

X=(x1,x2,…,xτ)∈RN×τX=(x 1 , x 2 ,..., x τ )∈R N×τ ;

需要预测未来的交通数据可以表示为:The traffic data that needs to be predicted in the future can be expressed as:

Figure BDA0002880019890000053
Figure BDA0002880019890000053

步骤103、将第一历史交通数据输入到包含第一卷积层、Tp个迭代RNN算子、拼接模块和第二卷积层的预置交通预测模型,使得第一卷积层对第一历史交通数据进行卷积处理,第一个迭代RNN算子对卷积处理后的第一历史交通数据进行交通预测,输出第一个时间步的交通预测结果,将第一个时间步的交通预测结果输入到下一个迭代RNN算子进行交通预测,直至第Tp个迭代RNN算子输出第Tp个时间步的交通预测结果,拼接模块对Tp个时间步的交通预测结果进行拼接,第二卷积层对拼接后的交通预测结果进行卷积处理,输出最终的交通预测结果。Step 103, input the first historical traffic data to the preset traffic prediction model comprising the first convolutional layer, T p iterative RNN operators, splicing modules and the second convolutional layer, so that the first convolutional layer is relatively accurate to the first The historical traffic data is processed by convolution, and the first iterative RNN operator performs traffic prediction on the first historical traffic data after convolution processing, outputs the traffic prediction result of the first time step, and converts the traffic prediction result of the first time step The result is input to the next iterative RNN operator for traffic prediction, until the T pth iterative RNN operator outputs the traffic prediction result of the T pth time step, the splicing module splices the traffic prediction results of the T p time step, and the traffic prediction result of the T pth time step is The second convolutional layer performs convolution processing on the concatenated traffic prediction results, and outputs the final traffic prediction results.

RNN是一类用于处理序列数据的神经网络,与其他的只在层与层之间建立连接的基础神经网络的不同之处在于,RNN在层之间的神经元之间也建立权的连接,因为序列数据靠后的数据与前面数据也有密切联系,如图3所示。RNN is a type of neural network used to process sequence data. The difference from other basic neural networks that only establish connections between layers is that RNN also establishes weighted connections between neurons between layers. , because the data at the back of the sequence data is also closely related to the data at the front, as shown in Figure 3.

本申请实施例基于RNN思想,将一次迭代预测过程作为一个迭代RNN算子,其输出的预测结果作为最终输出结果的一部分,同时将该单步预测结果输入到下一个迭代RNN算子,本申请实施例中的预置交通预测模型包括Tp个迭代RNN算子,用于预测未来的Tp个时间步的交通数据。本申请实施例中的迭代RNN算子与传统的RNN结构不同,传统的RNN结构中的每个RNN算子共用参数,而本申请实施例中的迭代RNN算子中包含一次预测的时间和空间模块(即线性门控单元和扩散卷积层)等,分别用于提取时间依赖关系和空间依赖关系,完成单步预测,而不同的迭代RNN算子的参数是不同的。The embodiment of this application is based on the idea of RNN, an iterative prediction process is used as an iterative RNN operator, and the output prediction result is part of the final output result, and the single-step prediction result is input to the next iterative RNN operator at the same time. The preset traffic prediction model in the embodiment includes T p iterative RNN operators for predicting traffic data of T p time steps in the future. The iterative RNN operator in the embodiment of this application is different from the traditional RNN structure. Each RNN operator in the traditional RNN structure shares parameters, while the iterative RNN operator in the embodiment of the application includes the time and space of a prediction Modules (ie, linear gating unit and diffusion convolution layer), etc., are used to extract temporal dependencies and spatial dependencies, respectively, to complete single-step prediction, and the parameters of different iterative RNN operators are different.

本申请实施例中的预置交通预测模型包括第一卷积层、Tp个迭代RNN算子、拼接模块和第二卷积层,可以参考图5。通过将获取的第一历史交通数据输入到预置交通预测模型预测未来的Tp个时间步的交通数据,具体的,通过第一卷积层对第一历史交通数据进行卷积处理,通过第一个迭代RNN算子对卷积后的第一历史交通数据进行交通预测,输出第一个时间步的交通预测结果,将第一个时间步的交通预测结果输入到下一个迭代RNN算子进行交通预测,直至第Tp个迭代RNN算子输出第Tp个时间步的交通预测结果,通过拼接模块对Tp个时间步的交通预测结果进行拼接,通过第二卷积层对拼接后的交通预测结果进行卷积处理,输出最终的交通预测结果。The preset traffic prediction model in the embodiment of the present application includes a first convolutional layer, T p iterative RNN operators, a splicing module and a second convolutional layer, as shown in FIG. 5 . By inputting the obtained first historical traffic data into the preset traffic prediction model to predict the traffic data of T p time steps in the future, specifically, the first convolutional layer is used to perform convolution processing on the first historical traffic data, and the second An iterative RNN operator performs traffic prediction on the first convoluted historical traffic data, outputs the traffic prediction result of the first time step, and inputs the traffic prediction result of the first time step to the next iterative RNN operator for further calculation. Traffic prediction until the T pth iterative RNN operator outputs the traffic prediction result of the T p time step, the traffic prediction results of the T p time step are spliced through the splicing module, and the spliced traffic prediction results are spliced by the second convolutional layer The traffic prediction results are convoluted to output the final traffic prediction results.

进一步,将第一历史交通数据输入到包含第一卷积层、Tp个迭代RNN算子、拼接模块和第二卷积层的预置交通预测模型之前还包括:对第一历史交通数据进行预处理。具体的,可以采用线性差值法补全第一历史交通数据中缺失的空值,并用Z-Score方法去除离群点。Further, before inputting the first historical traffic data to the preset traffic prediction model comprising the first convolutional layer, T p iterative RNN operators, splicing modules and the second convolutional layer, it also includes: performing the first historical traffic data preprocessing. Specifically, a linear difference method may be used to fill in missing null values in the first historical traffic data, and a Z-Score method may be used to remove outliers.

进一步,本申请实施例中的迭代RNN算子包括门控线性单元、扩散卷积层和全连接层。请参考图6,第一个迭代RNN算子对卷积处理后的第一历史交通数据进行交通预测,输出第一个时间步的交通预测结果的具体步骤包括:Further, the iterative RNN operator in the embodiment of the present application includes a gated linear unit, a diffuse convolution layer and a fully connected layer. Please refer to Figure 6, the first iterative RNN operator performs traffic prediction on the first historical traffic data after convolution processing, and the specific steps for outputting the traffic prediction result of the first time step include:

S1031、门控线性单元提取卷积处理后的第一历史交通数据的时间依赖关系,输出第一特征。S1031. The gated linear unit extracts the temporal dependence of the first historical traffic data after convolution processing, and outputs the first feature.

本申请实施例中,门控线性单元对卷积处理后的第一历史交通数据进行一维卷积处理,得到第一卷积特征和第二卷积特征;门控线性单元通过激活函数对第二卷积特征进行激活处理,并计算第一卷积特征与激活处理后的第二卷积特征的哈达玛积;门控线性单元将卷积处理后的第一历史交通数据与哈达玛积进行残差连接,输出第一特征。In the embodiment of the present application, the gated linear unit performs one-dimensional convolution processing on the first historical traffic data after convolution processing to obtain the first convolution feature and the second convolution feature; The second convolutional feature is activated, and the Hadamard product of the first convolutional feature and the activated second convolutional feature is calculated; the gated linear unit performs the convolutional first historical traffic data and the Hadamard product. Residual connection, output first feature.

本申请实施例中的门控线性单元通过卷积结构来捕获第一历史交通数据在时间维度上的动态信息,可以参考图4。具体的,通过一个一维的因果卷积层进行一维卷积处理,该因果卷积层的卷积核宽度为Kt,在卷积核的作用下,输入数据在卷积处理后的时间序列长度缩短Kt-1。对于输入的卷积处理后的第一历史交通数据

Figure BDA0002880019890000071
Ci为卷积处理后的第一历史交通数据的维度,本申请实施例中因果卷积层的卷积核的大小为
Figure BDA0002880019890000072
门控线性单元对卷积处理后的第一历史交通数据进行一维卷积处理后,得到的卷积结果为/>
Figure BDA0002880019890000073
将卷积结果分为前后两部分,得到第一卷积特征P和第二卷积特征Q,第一卷积特征P和第二卷积特征Q的特征数和卷积前的输入特征数是一致的。The gated linear unit in the embodiment of the present application uses a convolution structure to capture the dynamic information of the first historical traffic data in the time dimension, as shown in FIG. 4 . Specifically, one-dimensional convolution processing is performed through a one-dimensional causal convolution layer. The width of the convolution kernel of the causal convolution layer is K t . Under the action of the convolution kernel, the input data after convolution processing time The sequence length is shortened by K t -1. For the first historical traffic data after input convolution processing
Figure BDA0002880019890000071
Ci is the dimension of the first historical traffic data after convolution processing, and the size of the convolution kernel of the causal convolution layer in the embodiment of the present application is
Figure BDA0002880019890000072
After the gated linear unit performs one-dimensional convolution processing on the first historical traffic data after convolution processing, the obtained convolution result is
Figure BDA0002880019890000073
The convolution result is divided into two parts before and after, and the first convolution feature P and the second convolution feature Q are obtained. The feature numbers of the first convolution feature P and the second convolution feature Q and the input feature numbers before convolution are consistent.

本申请实施例优选采用sigmoid激活函数对第二卷积特征Q进行激活处理,用于对第一卷积特征P做门控,即计算第一卷积特征与激活处理后的第二卷积特征的哈达玛积P⊙σ(Q),⊙为哈达玛积。门控线性单元进一步将卷积处理后的第一历史交通数据与计算得到的哈达玛积进行残差连接,输出第一特征。In the embodiment of the present application, it is preferable to use the sigmoid activation function to activate the second convolutional feature Q for gating the first convolutional feature P, that is, to calculate the first convolutional feature and the activated second convolutional feature The Hadamard product P⊙σ(Q), ⊙ is the Hadamard product. The gated linear unit further performs residual connection between the first historical traffic data after convolution processing and the calculated Hadamard product, and outputs the first feature.

S1032、扩散卷积层提取第一特征的空间依赖关系,输出第二特征。S1032. The diffusion convolution layer extracts the spatial dependence of the first feature, and outputs the second feature.

本申请实施例中的扩散卷积层为带自适应矩阵的扩散卷积层,扩散卷积层对第一特征进行带自适应矩阵的扩散卷积特征提取,输出第二特征。The diffusion convolution layer in the embodiment of the present application is a diffusion convolution layer with an adaptive matrix, and the diffusion convolution layer performs feature extraction with a diffusion convolution with an adaptive matrix on the first feature, and outputs the second feature.

在给定节点结构信息,可以采用K个有限步来模拟信号的扩散过程,提取节点特征,扩散卷积处理得到的扩散卷积特征为:Given the node structure information, K finite steps can be used to simulate the diffusion process of the signal, extract node features, and the diffusion convolution features obtained by diffusion convolution processing are:

Figure BDA0002880019890000075
Figure BDA0002880019890000075

其中,Pk为转移矩阵的幂级数,转移矩阵由权重邻接矩阵A计算得到。在本申请实施例中,由于交通路网结构为有向图,扩散过程有两个方向,即前向转移矩阵Pf=A/rowsum(A),后向转移矩阵Pb=AT/rowsum(AT),因此扩散卷积特征可以表示为:Among them, P k is the power series of the transfer matrix, and the transfer matrix is calculated from the weighted adjacency matrix A. In the embodiment of this application, since the traffic road network structure is a directed graph, the diffusion process has two directions, that is, the forward transfer matrix P f =A/rowsum(A), and the backward transfer matrix P b = AT /rowsum (A T ), so the diffusion convolution feature can be expressed as:

Figure BDA0002880019890000081
Figure BDA0002880019890000081

式中,X为输入的第一特征,W为扩散卷积层的参数矩阵。In the formula, X is the first feature of the input, and W is the parameter matrix of the diffusion convolution layer.

在给定节点结构信息,可以通过自适应矩阵获取隐藏的空间信息,自适应矩阵为:Given the node structure information, the hidden spatial information can be obtained through the adaptive matrix, and the adaptive matrix is:

Figure BDA0002880019890000082
Figure BDA0002880019890000082

式中,自适应矩阵

Figure BDA0002880019890000083
包括两个随机初始化可学习参数E1、E2∈RN×c,具体的,E1为源节点嵌入,E2为目标节点嵌入,通过E1、E2相乘,得到源节点和目标节点之间的空间依赖权重,再通过ReLU激活函数来消除该权重的弱连接,通过SoftMax函数对ReLU激活函数处理后的权重进行归一化处理,自适应矩阵可以看作是隐扩散过程的转移矩阵。In the formula, the adaptive matrix
Figure BDA0002880019890000083
Including two randomly initialized learnable parameters E 1 , E 2R N×c , specifically, E 1 is source node embedding, E 2 is target node embedding, by multiplying E 1 and E 2 , the source node and target The space between nodes depends on the weight, and then the weak connection of the weight is eliminated through the ReLU activation function, and the weight processed by the ReLU activation function is normalized through the SoftMax function. The adaptive matrix can be regarded as the transfer of the implicit diffusion process matrix.

本申请实施例中,采用扩散卷积捕获显式的图结构关联,采用自适应矩阵捕获隐式的图结构关联,通过二者结合共同捕获空间依赖关系,即给定节点的图结构信息,最终输出的第二特征为:In the embodiment of the present application, the explicit graph structure correlation is captured by the diffusion convolution, and the implicit graph structure correlation is captured by the adaptive matrix, and the spatial dependency is captured through the combination of the two, that is, the graph structure information of a given node, and finally The second feature output is:

Figure BDA0002880019890000084
Figure BDA0002880019890000084

S1033、全连接层对第二特征进行交通预测,输出第一个时间步的交通预测结果。S1033. The fully connected layer performs traffic prediction on the second feature, and outputs the traffic prediction result of the first time step.

全连接层对输入的第二特征进行交通预测,输出第一个时间步的交通预测结果y1The fully connected layer performs traffic prediction on the input second feature, and outputs the traffic prediction result y 1 of the first time step.

其他的迭代RNN算子的具体处理过程为上述第一个迭代RNN算子的处理过程类似,不同之处在于,不同的迭代RNN算子的输入数据和输出数据不同。The specific processing process of other iterative RNN operators is similar to the processing process of the first iterative RNN operator above, the difference is that the input data and output data of different iterative RNN operators are different.

进一步,本申请实施例中的预置交通预测模型的配置过程为:获取交通路网图中的节点的第二历史交通数据;通过第二历史交通数据对交通预测网络进行训练,得到预置交通预测模型。Further, the configuration process of the preset traffic prediction model in the embodiment of the present application is: obtain the second historical traffic data of the nodes in the traffic road network graph; train the traffic prediction network through the second historical traffic data to obtain the preset traffic predictive model.

获取到第二历史交通数据后,可以将时间间隔设为5分钟,即一个小时内将有12个历史交通数据,一天共有288个历史交通数据。还可以对第二历史交通数据进行预处理,具体的,使用线性插值法补全第二历史交通数据中缺失的空值,并用Z-Score方法去除离群点。After obtaining the second historical traffic data, the time interval can be set to 5 minutes, that is, there will be 12 historical traffic data in one hour, and there are 288 historical traffic data in one day. It is also possible to preprocess the second historical traffic data, specifically, use a linear interpolation method to fill in missing null values in the second historical traffic data, and use a Z-Score method to remove outliers.

其中,第二历史交通数据距离当前时间的时间段比第一历史交通数据距离当前时间的时间段要长。例如,某交通路网中的传感器记录有62天的历史交通数据,可以将前50天的历史交通数据作为训练集,得到第二历史交通数据;可以将第51天到第56天的历史交通数据作为验证集,得到第三历史交通数据;可以将最后6天的历史交通数据作为测试集,得到第一历史交通数据。当然本领域技术人员可以根据实际情况进行灵活划分,在此不对其做具体限定。Wherein, the time period between the second historical traffic data and the current time is longer than the time period between the first historical traffic data and the current time. For example, if the sensors in a traffic network record 62 days of historical traffic data, the historical traffic data of the first 50 days can be used as a training set to obtain the second historical traffic data; the historical traffic data of the 51st to 56th days can be The data is used as a verification set to obtain the third historical traffic data; the historical traffic data of the last 6 days can be used as a test set to obtain the first historical traffic data. Of course, those skilled in the art can make flexible divisions according to actual conditions, which are not specifically limited here.

通过第二历史交通数据对交通预测网络进行训练,直至达到预置迭代次数,停止训练,得到预置交通预测模型,在训练过程中可以采用第三历史交通数据进行模型验证。The traffic prediction network is trained through the second historical traffic data until the preset number of iterations is reached, and the training is stopped to obtain a preset traffic prediction model. During the training process, the third historical traffic data can be used for model verification.

训练时,可以通过损失函数计算损失值,通过损失值反向传播更新交通预测网络各层参数。交通预测网络的损失函数可以为:During training, the loss value can be calculated through the loss function, and the parameters of each layer of the traffic prediction network can be updated through the backpropagation of the loss value. The loss function of the traffic prediction network can be:

Figure BDA0002880019890000091
Figure BDA0002880019890000091

其中,

Figure BDA0002880019890000092
为预测的Tp个时间步的交通数据,/>
Figure BDA0002880019890000093
为未来Tp个时间步的真实交通数据,Wθ为交通预测网络的训练参数。in,
Figure BDA0002880019890000092
is the predicted traffic data of T p time steps, />
Figure BDA0002880019890000093
is the real traffic data of T p time steps in the future, and W θ is the training parameter of the traffic prediction network.

本申请实施例中的长短期交通预测方法,将迭代预测和一次性预测的优势结合在一起,保证了长短期交通预测结果的准确性;并且,本申请实施例中的预置交通预测模型能够同时兼顾长短期预测的精度,并能够减少迭代预测误差的累积,因为训练时,在每一步预测都会根据真实值去调整预测结果的误差。The long-term and short-term traffic forecasting method in the embodiment of the present application combines the advantages of iterative forecasting and one-time forecasting to ensure the accuracy of the long-term and short-term traffic forecasting results; and the preset traffic forecasting model in the embodiment of the present application can At the same time, it takes into account the accuracy of long-term and short-term predictions, and can reduce the accumulation of iterative prediction errors, because during training, each step of the prediction will adjust the error of the prediction results according to the real value.

本申请实施例中的交通预测方法,将获取的第一历史交通数据输入到预置交通预测模型,通过迭代RNN算子进行一个时间步的预测,每一次的交通预测结果输入到下一个迭代RNN算子进行下一个时间步的预测,同时作为最终输出结果的一部分,通过每个迭代RNN算子进行一个时间步的预测,可以提取到有效的长短期交通时空信息,减少误差累计的现象,提高了短期交通预测精度;通过拼接模块将所有时间步的交通预测结果进行拼接,再对拼接后的交通预测结果进行卷积处理输出最终的交通预测结果,得到了长短期交通预测结果,兼顾到了长短期交通预测精度,从而解决了现有的交通预测方法存在预测误差累计较高,以及不能同时兼顾长短期预测精度的技术问题。In the traffic forecasting method in the embodiment of the present application, the acquired first historical traffic data is input into the preset traffic forecasting model, and a time-step forecast is performed through an iterative RNN operator, and each traffic forecasting result is input into the next iterative RNN The operator predicts the next time step, and as a part of the final output result, through each iteration of the RNN operator to predict a time step, effective long-term and short-term traffic spatio-temporal information can be extracted, reducing the phenomenon of error accumulation and improving The short-term traffic prediction accuracy is improved; the traffic prediction results of all time steps are spliced through the splicing module, and then the spliced traffic prediction results are convoluted to output the final traffic prediction results, and the long-term and short-term traffic prediction results are obtained, taking into account the long-term The accuracy of short-term traffic forecasting solves the technical problems that the existing traffic forecasting methods have a high cumulative forecast error and cannot take into account both long-term and short-term forecasting accuracy.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以通过一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(英文全称:Read-OnlyMemory,英文缩写:ROM)、随机存取存储器(英文全称:Random Access Memory,英文缩写:RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions for executing all or part of the steps of the methods described in the various embodiments of the present application through a computer device (which may be a personal computer, a server, or a network device, etc.). The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English full name: Read-OnlyMemory, English abbreviation: ROM), random access memory (English full name: Random Access Memory, English abbreviation: RAM), disk Or various media such as CDs that can store program codes.

以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still understand the foregoing The technical solutions described in each embodiment are modified, or some of the technical features are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the application.

Claims (8)

1.一种长短期交通预测方法,其特征在于,包括:1. A long-term and short-term traffic forecasting method, characterized in that, comprising: 将交通路网构建为图结构,得到交通路网图;Construct the traffic road network into a graph structure to obtain a traffic road network graph; 获取所述交通路网图中的节点的第一历史交通数据;Acquiring first historical traffic data of nodes in the traffic road network graph; 将所述第一历史交通数据输入到包含第一卷积层、Tp个迭代RNN算子、拼接模块和第二卷积层的预置交通预测模型,使得所述第一卷积层对所述第一历史交通数据进行卷积处理,第一个迭代RNN算子对卷积处理后的所述第一历史交通数据进行交通预测,输出第一个时间步的交通预测结果,将所述第一个时间步的交通预测结果输入到下一个迭代RNN算子进行交通预测,直至第Tp个迭代RNN算子输出第Tp个时间步的交通预测结果,所述拼接模块对Tp个时间步的交通预测结果进行拼接,所述第二卷积层对拼接后的交通预测结果进行卷积处理,输出最终的交通预测结果;The first historical traffic data is input to the preset traffic prediction model comprising the first convolutional layer, T p iterative RNN operators, splicing modules and the second convolutional layer, so that the first convolutional layer is The first historical traffic data is subjected to convolution processing, and the first iterative RNN operator performs traffic prediction on the first historical traffic data after convolution processing, outputs the traffic prediction result of the first time step, and converts the first time step The traffic prediction result of one time step is input to the next iterative RNN operator for traffic prediction, until the T pth iterative RNN operator outputs the traffic prediction result of the T pth time step, and the splicing module performs the traffic prediction for the T p time step The traffic prediction results of the first step are spliced, and the second convolution layer performs convolution processing on the spliced traffic prediction results, and outputs the final traffic prediction results; 所述迭代RNN算子包括门控线性单元、扩散卷积层和全连接层;The iterative RNN operator includes a gated linear unit, a diffusion convolution layer and a fully connected layer; 所述第一个迭代RNN算子对卷积处理后的所述第一历史交通数据进行交通预测,输出第一个时间步的交通预测结果,包括:The first iterative RNN operator performs traffic prediction on the first historical traffic data after convolution processing, and outputs the traffic prediction result of the first time step, including: 所述门控线性单元提取卷积处理后的所述第一历史交通数据的时间依赖关系,输出第一特征;The gated linear unit extracts the time dependence of the first historical traffic data after convolution processing, and outputs the first feature; 所述扩散卷积层提取所述第一特征的空间依赖关系,输出第二特征;The diffusion convolution layer extracts the spatial dependence of the first feature, and outputs the second feature; 所述全连接层对所述第二特征进行交通预测,输出第一个时间步的交通预测结果。The fully connected layer performs traffic prediction on the second feature, and outputs the traffic prediction result of the first time step. 2.根据权利要求1所述的长短期交通预测方法,其特征在于,所述门控线性单元提取卷积处理后的所述第一历史交通数据的时间依赖关系,输出第一特征,包括:2. The long-term and short-term traffic prediction method according to claim 1, characterized in that, said gated linear unit extracts the temporal dependence of said first historical traffic data after convolution processing, and outputs the first feature, comprising: 所述门控线性单元对卷积处理后的所述第一历史交通数据进行一维卷积处理,得到第一卷积特征和第二卷积特征,The gated linear unit performs one-dimensional convolution processing on the first historical traffic data after convolution processing to obtain a first convolution feature and a second convolution feature, 所述门控线性单元通过激活函数对所述第二卷积特征进行激活处理,并计算所述第一卷积特征与激活处理后的所述第二卷积特征的哈达玛积;The gated linear unit activates the second convolution feature through an activation function, and calculates the Hadamard product of the first convolution feature and the activated second convolution feature; 所述门控线性单元将卷积处理后的所述第一历史交通数据与所述哈达玛积进行残差连接,输出第一特征。The gated linear unit performs residual connection between the first historical traffic data after convolution processing and the Hadamard product, and outputs a first feature. 3.根据权利要求2所述的长短期交通预测方法,其特征在于,所述扩散卷积层提取所述第一特征的空间依赖关系,输出第二特征,包括:3. The long-term and short-term traffic prediction method according to claim 2, wherein the diffusion convolution layer extracts the spatial dependence of the first feature, and outputs the second feature, including: 所述扩散卷积层对所述第一特征进行带自适应矩阵的扩散卷积特征提取,输出第二特征。The diffusion convolution layer performs diffusion convolution feature extraction with an adaptive matrix on the first feature, and outputs a second feature. 4.根据权利要求3所述的长短期交通预测方法,其特征在于,所述第二特征为:4. The long-term and short-term traffic prediction method according to claim 3, characterized in that, the second feature is:
Figure FDA0004062618600000021
Figure FDA0004062618600000021
其中,Z为第二特征,Pf=A/rowsum(A)为前向转移矩阵,A为权重邻接矩阵;Pb=AT/rowsum(AT)为后向转移矩阵,AT为权重邻接矩阵的转置矩阵;X为第一特征,W为扩散卷积层的参数矩阵,K为常数;
Figure FDA0004062618600000022
为自适应矩阵,E1、E2分别为源节点嵌入、目标节点嵌入,Wk1为扩散卷积层在第k个有限步的前向转移矩阵的参数矩阵,Wk2为扩散卷积层在第k个有限步的后向转移矩阵的参数矩阵,Wk3为扩散卷积层在第k个有限步的自适应矩阵的参数矩阵。
Among them, Z is the second feature, P f =A/rowsum(A) is the forward transfer matrix, A is the weight adjacency matrix; P b = AT /rowsum(A T ) is the backward transfer matrix, and A T is the weight The transpose matrix of the adjacency matrix; X is the first feature, W is the parameter matrix of the diffusion convolution layer, and K is a constant;
Figure FDA0004062618600000022
is an adaptive matrix, E 1 and E 2 are source node embedding and target node embedding respectively, W k1 is the parameter matrix of the forward transition matrix of the diffusion convolution layer at the kth finite step, W k2 is the diffusion convolution layer at The parameter matrix of the backward transition matrix of the k-th finite step, W k3 is the parameter matrix of the adaptive matrix of the k-th finite step of the diffusion convolution layer.
5.根据权利要求4所述的长短期交通预测方法,其特征在于,所述方法还包括:5. The long-term and short-term traffic prediction method according to claim 4, characterized in that, the method further comprises: 基于所述交通路网图计算所述权重邻接矩阵,所述权重邻接矩阵中的权重的计算公式为:The weight adjacency matrix is calculated based on the traffic road network diagram, and the calculation formula of the weight in the weight adjacency matrix is:
Figure FDA0004062618600000023
Figure FDA0004062618600000023
其中,aij为交通路网图中的邻居节点i、j之间边的权重,dij为邻居节点i、j之间的距离,δ为阈值参数,ε为超参数。Among them, a ij is the weight of the edge between neighbor nodes i and j in the traffic road network graph, d ij is the distance between neighbor nodes i and j, δ is the threshold parameter, and ε is the hyperparameter.
6.根据权利要求1所述的长短期交通预测方法,其特征在于,所述将所述第一历史交通数据输入到包含第一卷积层、Tp个迭代RNN算子、拼接模块和第二卷积层的预置交通预测模型,之前还包括:6. the long-term and short-term traffic prediction method according to claim 1, is characterized in that, described first historical traffic data is input to comprise the first convolutional layer, T iterative RNN operator, stitching module and the first The preset traffic prediction model of the second convolutional layer also includes: 对所述第一历史交通数据进行预处理。Perform preprocessing on the first historical traffic data. 7.根据权利要求1-6任一项所述的长短期交通预测方法,其特征在于,所述预置交通预测模型的配置过程为:7. The long-term and short-term traffic forecasting method according to any one of claims 1-6, wherein the configuration process of the preset traffic forecasting model is: 获取所述交通路网图中的节点的第二历史交通数据;Acquiring second historical traffic data of nodes in the traffic road network graph; 通过所述第二历史交通数据对交通预测网络进行训练,得到所述预置交通预测模型。The traffic prediction network is trained by the second historical traffic data to obtain the preset traffic prediction model. 8.根据权利要求7所述的长短期交通预测方法,其特征在于,所述交通预测网络的损失函数为:8. The long-term and short-term traffic prediction method according to claim 7, wherein the loss function of the traffic prediction network is:
Figure FDA0004062618600000031
Figure FDA0004062618600000031
其中,
Figure FDA0004062618600000032
为预测的Tp个时间步的交通数据,/>
Figure FDA0004062618600000033
为未来Tp个时间步的真实交通数据,Wθ为交通预测网络的训练参数。
in,
Figure FDA0004062618600000032
is the predicted traffic data of T p time steps, />
Figure FDA0004062618600000033
is the real traffic data of T p time steps in the future, and W θ is the training parameter of the traffic prediction network.
CN202011641479.9A 2020-12-31 2020-12-31 Long-short-period traffic prediction method Active CN112668797B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011641479.9A CN112668797B (en) 2020-12-31 2020-12-31 Long-short-period traffic prediction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011641479.9A CN112668797B (en) 2020-12-31 2020-12-31 Long-short-period traffic prediction method

Publications (2)

Publication Number Publication Date
CN112668797A CN112668797A (en) 2021-04-16
CN112668797B true CN112668797B (en) 2023-06-16

Family

ID=75413867

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011641479.9A Active CN112668797B (en) 2020-12-31 2020-12-31 Long-short-period traffic prediction method

Country Status (1)

Country Link
CN (1) CN112668797B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113505536A (en) * 2021-07-09 2021-10-15 兰州理工大学 Optimized traffic flow prediction model based on space-time diagram convolution network

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020040411A1 (en) * 2018-08-21 2020-02-27 한국과학기술정보연구원 Device for predicting traffic state information, method for predicting traffic state information, and storage medium for storing program for predicting traffic state information
CN111899510A (en) * 2020-07-28 2020-11-06 南京工程学院 Intelligent traffic system flow short-term prediction method and system based on divergent convolution and GAT
CN111968375A (en) * 2020-08-27 2020-11-20 北京嘀嘀无限科技发展有限公司 Traffic flow prediction method and device, readable storage medium and electronic equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109410575B (en) * 2018-10-29 2020-05-01 北京航空航天大学 A Road Network State Prediction Method Based on Capsule Network and Nested Long Short-Term Memory Neural Network
CN110674987A (en) * 2019-09-23 2020-01-10 北京顺智信科技有限公司 Traffic flow prediction system and method and model training method
CN110491129A (en) * 2019-09-24 2019-11-22 重庆城市管理职业学院 The traffic flow forecasting method of divergent convolution Recognition with Recurrent Neural Network based on space-time diagram
CN110717627B (en) * 2019-09-29 2022-01-25 浙江大学 Full traffic prediction method based on dual graph framework
CN111292562B (en) * 2020-05-12 2020-08-18 北京航空航天大学 Aviation flow prediction method
CN112071065A (en) * 2020-09-16 2020-12-11 山东理工大学 Traffic flow prediction method based on global diffusion convolution residual error network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020040411A1 (en) * 2018-08-21 2020-02-27 한국과학기술정보연구원 Device for predicting traffic state information, method for predicting traffic state information, and storage medium for storing program for predicting traffic state information
CN111899510A (en) * 2020-07-28 2020-11-06 南京工程学院 Intelligent traffic system flow short-term prediction method and system based on divergent convolution and GAT
CN111968375A (en) * 2020-08-27 2020-11-20 北京嘀嘀无限科技发展有限公司 Traffic flow prediction method and device, readable storage medium and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于图卷积神经网络的城市交通态势预测算法;闫旭;范晓亮;郑传潘;臧彧;王程;程明;陈龙彪;;浙江大学学报(工学版)(第06期);第104-112页 *

Also Published As

Publication number Publication date
CN112668797A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
CN112445823B (en) Neural network structure search method, image processing method and device
CN113393474B (en) A classification and segmentation method of 3D point cloud based on feature fusion
CN111079532A (en) Video content description method based on text self-encoder
CN110874550A (en) Data processing method, apparatus, device and system
CN113610286A (en) PM accounting for spatio-temporal correlations and meteorological factors2.5Concentration prediction method and device
CN114266897B (en) Method, device, electronic device and storage medium for predicting acne category
CN116826734B (en) Photovoltaic power generation prediction method and device based on multi-input model
CN114357160B (en) Early rumor detection method and device based on generated propagation structural features
CN114862010B (en) A method, device, equipment and medium for determining flow based on spatiotemporal data
CN117173885A (en) Traffic state prediction method and system based on dynamic graph feature learning
CN118134017A (en) A method for predicting social network links using spiking neural networks
CN117789046A (en) Remote sensing image change detection method, device, electronic equipment and storage medium
CN115545334A (en) Land use type prediction method, land use type prediction device, electronic device, and storage medium
CN117558125A (en) Space-time heterogeneous decoupling method based on multi-mode traffic flow prediction
CN116979506A (en) HGL-GTCN-based short-term power load prediction method
CN114973678B (en) Traffic prediction method based on graph attention neural network and space-time big data
CN112668797B (en) Long-short-period traffic prediction method
CN114338416B (en) Space-time multi-index prediction method and device and storage medium
CN118916839A (en) Traffic index prediction method and device
CN114566048B (en) A traffic control method based on multi-view adaptive spatio-temporal graph network
CN115879627B (en) Falling object prediction method, device, electronic device and storage medium
CN114936327B (en) Element recognition model acquisition method and device, computer equipment and storage medium
CN117593877A (en) A short-term traffic flow prediction method based on ensemble graph convolutional neural network
CN113792163B (en) Multimedia recommendation method and device, electronic equipment and storage medium
CN115271157A (en) Multi-task traffic flow prediction method, device, terminal and storage medium based on Transformer

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
GR01 Patent grant
GR01 Patent grant