CN112017436B - Method and system for predicting urban traffic travel time - Google Patents

Method and system for predicting urban traffic travel time Download PDF

Info

Publication number
CN112017436B
CN112017436B CN202010940567.2A CN202010940567A CN112017436B CN 112017436 B CN112017436 B CN 112017436B CN 202010940567 A CN202010940567 A CN 202010940567A CN 112017436 B CN112017436 B CN 112017436B
Authority
CN
China
Prior art keywords
traffic flow
track
time
point
sequence
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
CN202010940567.2A
Other languages
Chinese (zh)
Other versions
CN112017436A (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.)
Institute of Automation of Chinese Academy of Science
Original Assignee
Institute of Automation of Chinese Academy of Science
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 Institute of Automation of Chinese Academy of Science filed Critical Institute of Automation of Chinese Academy of Science
Priority to CN202010940567.2A priority Critical patent/CN112017436B/en
Publication of CN112017436A publication Critical patent/CN112017436A/en
Application granted granted Critical
Publication of CN112017436B publication Critical patent/CN112017436B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0108Measuring and analyzing of parameters relative to traffic conditions based on the source of data
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0125Traffic data processing
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/017Detecting movement of traffic to be counted or controlled identifying vehicles

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Traffic Control Systems (AREA)

Abstract

本发明涉及一种城市市内交通旅行时间的预测方法及系统,所述预测方法包括将待测城市划分为矩形网格;基于矩形网格,根据历史交通流量数据构建归一化浮点交通流量矩阵;根据归一化浮点交通流量矩阵,训练城市市内交通流量预测网络;根据矩形网格对车辆行驶路径的轨迹点序列进行简化处理,得到车辆行驶路径的网格化轨迹;根据归一化浮点交通流量矩阵及网格化轨迹,确定网格化轨迹中各轨迹点的特征向量;根据各轨迹点的特征向量,训练城市市内交通旅行时间预测网络;基于城市市内交通流量预测网络和城市市内旅行时间预测网络,根据待测车辆的待测行驶路径,可准确确定所述待测车辆行驶完所述待测路径所需要的旅行时间,可提高复杂场景下预测精度。

Figure 202010940567

The invention relates to a method and system for predicting traffic travel time in a city. The predicting method includes dividing a city to be measured into rectangular grids; building a normalized floating-point traffic flow based on the rectangular grid and historical traffic flow data Matrix; according to the normalized floating-point traffic flow matrix, train the urban traffic flow prediction network; simplify the trajectory point sequence of the vehicle driving path according to the rectangular grid, and obtain the gridded trajectory of the vehicle driving path; according to the normalized Convert the floating-point traffic flow matrix and gridded trajectory to determine the eigenvectors of each trajectory point in the gridded trajectory; train the urban traffic travel time prediction network based on the eigenvectors of each trajectory point; based on the urban traffic flow prediction The network and urban travel time prediction network can accurately determine the travel time required for the vehicle to be tested to complete the path to be tested according to the travel path of the vehicle to be tested, which can improve the prediction accuracy in complex scenarios.

Figure 202010940567

Description

城市市内交通旅行时间的预测方法及系统Prediction method and system of urban traffic travel time

技术领域technical field

本发明涉及城市路况信息处理技术领域,特别涉及一种结合实时路况信息的城市市内交通旅行时间的预测方法及系统。The invention relates to the technical field of urban road condition information processing, in particular to a method and system for predicting the travel time of urban traffic in combination with real-time road condition information.

背景技术Background technique

城市市内交通车辆旅行时间预测是路径规划、车辆导航、智能拼车、出租车智能分单等应用的基础,其任务是给定某条特定的路径,在考虑可能出现的停车延误和十字路口等待延误的情况下,预测出车辆行驶完该条路径所需的时间。当出行者可以考虑多条可选路径时,准确的旅行时间预测结果能帮助选择最优的路线同时避开拥堵路段,对优化城市管理和提高市民的出行效率有十分重要的作用。The travel time prediction of urban traffic vehicles is the basis for applications such as route planning, vehicle navigation, intelligent carpooling, and intelligent taxi order sharing. In the case of delay, predict the time required for the vehicle to complete the route. When travelers can consider multiple alternative routes, accurate travel time prediction results can help choose the optimal route while avoiding congested sections, which is very important for optimizing urban management and improving the travel efficiency of citizens.

目前传统的城市市内交通旅行时间的预测方法主要分为两大类,即参数方法和非参数方法。参数化方法依赖现有的数学和统计学的理论进行预测,包括线性回归模型、自回归整合移动平均模型、卡尔曼滤波、贝叶斯动态线性模型、隐马尔可夫模型、支持向量机等。这些方法已经在短距离旅行时间上取得了不同程度的成功,但在长距离旅行的时间预测上其精度难以满足应用需求。非参数化方法使用数据驱动的方式来捕获数据的潜在知识。非参数化方法不需要对模型的所适用的数据分布情形作假设,具有一定的数据自适应能力。非参数方法包括k-最近邻估计、投票决策、高斯过程等。但参数法计算量大,难以达到实时性能指标要求。At present, the traditional urban traffic travel time prediction methods are mainly divided into two categories, namely parametric methods and non-parametric methods. Parametric methods rely on existing mathematical and statistical theories to make predictions, including linear regression models, autoregressive integrated moving average models, Kalman filtering, Bayesian dynamic linear models, hidden Markov models, and support vector machines. These methods have achieved varying degrees of success in short-distance travel time, but their accuracy is difficult to meet the application requirements for long-distance travel time prediction. Non-parametric methods use a data-driven approach to capture the underlying knowledge of the data. The non-parametric method does not need to make assumptions about the applicable data distribution of the model, and has a certain data adaptive ability. Nonparametric methods include k-nearest neighbor estimation, voting decision, Gaussian process, etc. However, the parameter method has a large amount of calculation, and it is difficult to meet the requirements of real-time performance indicators.

传统的参数方法和非参数方法目前均难以应用到实际场景中,主要有以下两点原因。其一,传统方法仅利用了历史城市市内交通旅行时间数据,忽视了实时路况对城市市内交通旅行时间预测的影响。当用户需要预测某一条路径的旅行时间时,传统方法仅基于当前时间点该条路径上的交通路况,难以将实时路况信息进行动态融合。但是,当用户行驶到某一路段时,该条路段的路况已经发生变化,比如从原来的拥堵状态转变为当前的畅通状态,或者从原来的畅通状态转变为当前的拥堵状态。这种路况状态变化在长距离驾驶情况下尤为明显。其二,传统方法的非线性拟合能力有限。在短距离局部范围且交通状况变化规律明显的城市区域内,传统方法通常可以取得较理想的城市市内交通旅行时间预测结果。但是,对于长距离大范围区域,交通状况呈现高度非线性的动态变化特性,时空关联关系十分复杂。传统方法难以捕获这些复杂的关系,因此往往产生较大的城市市内交通旅行时间预测误差。Traditional parametric methods and non-parametric methods are currently difficult to apply to practical scenarios, mainly for the following two reasons. First, the traditional method only uses the historical urban traffic travel time data, ignoring the impact of real-time road conditions on the urban traffic travel time prediction. When the user needs to predict the travel time of a certain route, the traditional method is only based on the traffic conditions on the route at the current time point, and it is difficult to dynamically fuse the real-time road condition information. However, when the user travels to a certain road section, the road condition of the road section has changed, for example, from the original congested state to the current unblocked state, or from the original unblocked state to the current congested state. This change in road conditions is especially noticeable during long-distance driving. Second, the nonlinear fitting ability of traditional methods is limited. In urban areas with short-distance local scope and obvious changes in traffic conditions, traditional methods can usually obtain better prediction results of intra-city traffic travel time. However, for long-distance and large-scale areas, traffic conditions exhibit highly nonlinear dynamic characteristics, and the spatial and temporal correlations are very complex. Traditional methods are difficult to capture these complex relationships, so they tend to produce large prediction errors of urban traffic travel time.

近年来,深度学习蓬勃发展,以卷积神经网络(Convolutional Neural Network,CNN)和循环神经网络(Recurrent Neural Network,RNN)为代表的深度学习方法,已被广泛引用在机器学习相关的大量任务上,在图像识别、图像语义分割、视觉目标检测、视频内容理解、机器翻译、自动驾驶等众多实际应用中取得了巨大成功。深度学习具有强大的非线性拟合能力。同时,由于其网络结构设计所具备的灵活性,深度学习利于多元信息的融合和处理。In recent years, deep learning has flourished, and deep learning methods represented by Convolutional Neural Network (CNN) and Recurrent Neural Network (RNN) have been widely cited in a large number of tasks related to machine learning. It has achieved great success in many practical applications such as image recognition, image semantic segmentation, visual object detection, video content understanding, machine translation, and autonomous driving. Deep learning has powerful nonlinear fitting capabilities. At the same time, due to the flexibility of its network structure design, deep learning is conducive to the fusion and processing of multiple information.

综上所述,传统方法在处理复杂场景下的城市内长距离城市市内交通旅行时间预测任务上尚难得到理想的效果。To sum up, traditional methods are still difficult to achieve ideal results in dealing with long-distance intra-city traffic travel time prediction tasks in complex scenarios.

发明内容SUMMARY OF THE INVENTION

为了解决现有技术中的上述问题,即为了提高城市市内交通旅行时间预测的准确度,本发明的目的在于提供一种城市市内交通旅行时间的预测方法及系统。In order to solve the above problems in the prior art, that is, in order to improve the accuracy of urban traffic travel time prediction, the purpose of the present invention is to provide a method and system for predicting urban traffic travel time.

为解决上述技术问题,本发明提供了如下方案:In order to solve the above-mentioned technical problems, the present invention provides the following scheme:

一种城市市内交通旅行时间的预测方法,所述预测方法包括:A method for predicting traffic travel time in a city, the predicting method comprising:

将待测城市划分为矩形网格;Divide the city to be tested into a rectangular grid;

基于所述矩形网格,根据历史交通流量数据构建归一化浮点交通流量矩阵;Based on the rectangular grid, construct a normalized floating-point traffic flow matrix according to historical traffic flow data;

根据所述归一化浮点交通流量矩阵,训练城市市内交通流量预测网络;According to the normalized floating-point traffic flow matrix, train the urban traffic flow prediction network;

根据所述矩形网格对车辆行驶路径的轨迹点序列进行简化处理,得到车辆行驶路径的网格化轨迹;Simplify the trajectory point sequence of the vehicle's driving path according to the rectangular grid, and obtain the gridded trajectory of the vehicle's driving path;

根据所述归一化浮点交通流量矩阵及车辆行驶路径的网格化轨迹,确定网格化轨迹中各轨迹点的特征向量;According to the normalized floating-point traffic flow matrix and the gridded trajectory of the vehicle travel path, determine the eigenvectors of each trajectory point in the gridded trajectory;

根据所述网格化轨迹中各轨迹点的特征向量,训练城市市内交通旅行时间预测网络;According to the feature vector of each trajectory point in the gridded trajectory, train the urban traffic travel time prediction network;

基于所述城市市内交通流量预测网络和城市市内旅行时间预测网络,根据待测车辆的待测行驶路径,确定所述待测车辆行驶完所述待测路径所需要的旅行时间。Based on the urban traffic flow prediction network and the urban travel time prediction network, and according to the travel path of the vehicle to be tested, the travel time required for the vehicle to be tested to complete the path to be tested is determined.

可选地,所述基于所述矩形网格,根据历史交通流量数据构建归一化浮点交通流量矩阵,具体包括:Optionally, constructing a normalized floating-point traffic flow matrix according to historical traffic flow data based on the rectangular grid specifically includes:

将选取历史nd天为训练时段,将所述训练时段的每天均划分为具有固定时间间隔的Kd个时间区间;训练时段被划分成的连续时间区间的总个数为K:K=nd×KdThe history n d days are selected as the training period, and each day of the training period is divided into K d time intervals with fixed time intervals; the total number of continuous time intervals that the training period is divided into is K: K=n d ×K d ;

统计所述训练时段内进入联网系统的车辆在矩形网格G内的轨迹数据,每一个轨迹数据记录车辆的经度位置、纬度位置和时间信息;

Figure BDA0002673507330000041
表示在第t个时间区间内出现在矩形网格G的第i行第j列格子区域内的车辆个数;Counting the trajectory data of vehicles entering the networked system in the rectangular grid G during the training period, and each trajectory data records the longitude position, latitude position and time information of the vehicle;
Figure BDA0002673507330000041
Indicates the number of vehicles appearing in the grid area of the i-th row and the j-th column of the rectangular grid G in the t-th time interval;

遍历训练时段内所有的时间区间,统计在同一时间区间内位于进入联网系统内的车辆流量,得到K个交通流量矩阵,分别记为X1,X2,...,Xk,...,XK;Xk表示在第k个时间区间内的交通流量矩阵,k=1,2,....,K;Traverse all the time intervals in the training period, count the traffic flow of vehicles entering the networked system in the same time interval, and obtain K traffic flow matrices, denoted as X 1 , X 2 ,...,X k ,... ,X K ; X k represents the traffic flow matrix in the kth time interval, k=1,2,....,K;

根据以下公式,对各交通流量矩阵进行归一化浮点处理,得到对应的归一化浮点交通流量矩阵:According to the following formula, normalized floating-point processing is performed on each traffic flow matrix to obtain the corresponding normalized floating-point traffic flow matrix:

Figure BDA0002673507330000042
Figure BDA0002673507330000042

其中,

Figure BDA0002673507330000043
为第t个时间区间内的归一化浮点交通流量矩阵Yt的第i行第j列元素,x0表示K个交通流量矩阵中所有元素的最大值。in,
Figure BDA0002673507330000043
is the i-th row and j-th column element of the normalized floating-point traffic flow matrix Y t in the t-th time interval, and x 0 represents the maximum value of all elements in the K traffic flow matrices.

可选地,所述根据所述归一化浮点交通流量矩阵,训练城市市内交通流量预测网络,具体包括:Optionally, the training of an urban traffic flow prediction network according to the normalized floating-point traffic flow matrix specifically includes:

根据所述归一化浮点交通流量矩阵,构建对应的第一训练样本:According to the normalized floating-point traffic flow matrix, a corresponding first training sample is constructed:

Pt=(At;Bt),P t =(A t ; B t ),

其中,t表示时间区间序号,Pt表示第一训练样本;At表示第一训练样本Pt的样本特征,是一个L行M列J层的三维张量,由第t个时间区间为终点的前J个连续时间区间内获得的归一化交通流量矩阵按时间顺序堆叠而成:At=[Yt-J+1,Yt-J+2,…,Yt-1,Yt];Among them, t represents the sequence number of the time interval, P t represents the first training sample; A t represents the sample feature of the first training sample P t , which is a three-dimensional tensor with L rows, M columns, and J layers, starting from the t-th time interval as the end point. The normalized traffic flow matrices obtained in the first J consecutive time intervals of the ];

Bt表示第一训练样本Pt的样本标记,为一个L行M列Q层的三维张量,由以第t+1个时间区间为起点的Q个连续时间区间内获得的归一化交通流量矩阵按时间顺序堆叠而成:Bt=[Yt+1,Yt+2,…,Yt+Q];B t represents the sample label of the first training sample P t , which is a three-dimensional tensor with L rows and M columns and Q layers. The normalized traffic obtained in Q consecutive time intervals starting from the t+1th time interval The flow matrix is stacked in chronological order: B t =[Y t+1 ,Y t+2 ,…,Y t+Q ];

其中,Yt-J+1为第t+1个时间区间内获得的归一化浮点交通流量矩阵,Yt为第t个时间区间内获得的归一化浮点交通流量矩阵,Yt+Q为第t+Q个时间区间内获得的归一化浮点交通流量矩阵;Among them, Y t-J+1 is the normalized floating-point traffic flow matrix obtained in the t+1th time interval, Y t is the normalized floating-point traffic flow matrix obtained in the t-th time interval, and Y t +Q is the normalized floating-point traffic flow matrix obtained in the t+Qth time interval;

根据所述第一训练样本训练城市市内交通流量预测网络;所述城市市内交通流量预测网络用于预测未来Q个连续时间区间内的矩形网格G的归一化浮点交通流量。The urban traffic flow prediction network is trained according to the first training sample; the urban urban traffic flow prediction network is used to predict the normalized floating-point traffic flow of the rectangular grid G in Q consecutive time intervals in the future.

可选地,根据所述矩形网格对车辆行驶路径的轨迹点序列进行简化处理,得到车辆行驶路径的网格化轨迹,具体包括:Optionally, performing simplified processing on the trajectory point sequence of the vehicle driving path according to the rectangular grid to obtain the gridded trajectory of the vehicle driving path, specifically including:

各车辆行驶路径分别用轨迹点序列来描述,每个轨迹点包含该轨迹点所在的经度坐标和纬度坐标;Each vehicle travel path is described by a sequence of track points, and each track point contains the longitude and latitude coordinates of the track point;

对于一条给定的车辆行驶路径,对应的轨迹序列为T,轨迹序列T由N个轨迹点来描述:T={(x1,y1),(x2,y2),…,(xN,yN)};For a given vehicle driving path, the corresponding trajectory sequence is T, and the trajectory sequence T is described by N trajectory points: T={(x 1 ,y 1 ),(x 2 ,y 2 ),…,(x N ,y N )};

其中,x1和y1分别表示第一个轨迹点的经度和纬度,xN和yN分别表示第N个轨迹点的经度和纬度;Among them, x 1 and y 1 represent the longitude and latitude of the first track point, respectively, and x N and y N represent the longitude and latitude of the Nth track point, respectively;

根据所述矩形网格G,将轨迹序列T的N个轨迹点按顺序分成不同的片段,使每一个片段内的轨迹点位于矩形网格G的同一个格子区域:According to the rectangular grid G, the N trajectory points of the trajectory sequence T are divided into different segments in sequence, so that the trajectory points in each segment are located in the same grid area of the rectangular grid G:

Figure BDA0002673507330000051
Figure BDA0002673507330000051

其中,设轨迹T将被分成n个片段,第一个片段包含从第一个轨迹点(x1,y1)到第d1个轨迹点

Figure BDA0002673507330000052
第二个片段包含从第d1+1个轨迹点
Figure BDA0002673507330000053
到第d2个轨迹点
Figure BDA0002673507330000054
以此类推,第n个片段包含从第dn-1+1个轨迹点
Figure BDA0002673507330000055
到第N个轨迹点(xN,yN),| |表示片段间隔符;d1、d2、dn-1、n均为自然数;Among them, let the trajectory T be divided into n segments, the first segment contains from the first trajectory point (x 1 , y 1 ) to the d 1th trajectory point
Figure BDA0002673507330000052
The second fragment contains 1 +1 trajectory points from the dth
Figure BDA0002673507330000053
to the d 2nd trajectory point
Figure BDA0002673507330000054
And so on, the nth segment contains the trajectory points from d n-1 +1
Figure BDA0002673507330000055
To the Nth track point (x N , y N ), | | represents the segment spacer; d 1 , d 2 , d n-1 , and n are all natural numbers;

计算同一个片段内的轨迹点的经度和纬度的平均值,得到网格化轨迹TGCalculate the average of the longitude and latitude of the trajectory points within the same segment to get the gridded trajectory T G :

Figure BDA0002673507330000061
Figure BDA0002673507330000061

其中,

Figure BDA0002673507330000062
表示属于第i个片段内的轨迹点的经度的平均值,
Figure BDA0002673507330000063
表示属于第i个片段内的轨迹点的纬度的均值,xj和yj分别为经度坐标和纬度坐标,当i=1时,d0=1;当i=n时,dn=N;
Figure BDA0002673507330000064
in,
Figure BDA0002673507330000062
represents the mean of the longitudes of the trajectory points belonging to the ith segment,
Figure BDA0002673507330000063
Represents the mean value of the latitude of the trajectory points belonging to the ith segment, x j and y j are the longitude and latitude coordinates respectively, when i=1, d 0 =1; when i=n, d n =N;
Figure BDA0002673507330000064

可选地,根据所述归一化浮点交通流量矩阵及车辆行驶路径的网格化轨迹,确定网格化轨迹中各轨迹点的特征向量,具体包括:Optionally, according to the normalized floating-point traffic flow matrix and the gridded trajectory of the vehicle travel path, determine the feature vector of each trajectory point in the gridded trajectory, specifically including:

从所述归一化浮点交通流量矩阵中取出连续Q个归一化浮点交通流量矩阵Yp+1,Yp+2,…,Yp+Q;其中,p为车辆行驶路径T第一个轨迹点(x1,y1)的时间在训练时段所属时间区间的序号;Take out consecutive Q normalized floating-point traffic flow matrices Y p+1 , Y p+2 , . . . , Y p+Q from the normalized floating-point traffic flow matrix; The sequence number of the time interval of a trajectory point (x 1 , y 1 ) in the time interval to which the training period belongs;

根据网格化轨迹TG的第i个轨迹点

Figure BDA0002673507330000069
位于矩形网格G的第ri行和第ci列所在的格子区域,分别取出归一化浮点交通流量矩阵Yp+1,Yp+2,…,Yp+Q中第ri行和第ci列的元素:
Figure BDA0002673507330000065
其中,
Figure BDA0002673507330000066
为归一化浮点交通流量矩阵Yp+Q的第ri行和第ci列的元素;ri和ci分别为网格化轨迹TG的第i个轨迹点
Figure BDA0002673507330000067
位于矩形网格的行序号和列序号;According to the i-th trajectory point of the gridded trajectory T G
Figure BDA0002673507330000069
In the grid area where the ri- th row and the c- th column of the rectangular grid G are located, take out the ri -th in the normalized floating-point traffic flow matrix Y p+1 , Y p+2 ,...,Y p+Q respectively Elements of row and column c i :
Figure BDA0002673507330000065
in,
Figure BDA0002673507330000066
are the elements of the ri-th row and ci- th column of the normalized floating-point traffic flow matrix Y p+Q ; ri and ci are the ith trajectory point of the gridded trajectory T G respectively
Figure BDA0002673507330000067
The row and column numbers in the rectangular grid;

构建网格化轨迹TG的第i个轨迹点的特征向量fiConstruct the eigenvector f i of the ith trajectory point of the gridded trajectory T G :

Figure BDA0002673507330000068
Figure BDA0002673507330000068

其中,n为网格化轨迹TG的轨迹点的个数;上标T表示向量转置。Among them, n is the number of trajectory points of the gridded trajectory T G ; the superscript T represents the vector transposition.

可选地,根据所述网格化轨迹中各轨迹点的特征向量,训练城市市内交通旅行时间预测网络,具体包括:Optionally, according to the feature vector of each trajectory point in the gridded trajectory, train the urban traffic travel time prediction network, specifically including:

获取车辆行驶路径的轨迹序列T中各轨迹点的记录时间o1,o2,…,oN;其中,oN为第N个轨迹点的记录时间;Obtain the recording time o 1 , o 2 , . . . , o N of each track point in the track sequence T of the vehicle travel path; wherein, o N is the recording time of the Nth track point;

根据所述矩形网格G,将各记录时间按顺序分成不同的片段,使每一个片段内的记录时间位于矩形网格G的同一个格子区域:According to the rectangular grid G, each recording time is divided into different segments in sequence, so that the recording time in each segment is located in the same grid area of the rectangular grid G:

Figure BDA0002673507330000071
Figure BDA0002673507330000071

其中,其中,设记录时间将被分成n个片段,第一个片段包含从第一个记录时间o1到第d1个记录时间

Figure BDA0002673507330000072
第二个片段包含从第d1+1个记录时间
Figure BDA0002673507330000073
到第d2个记录时间
Figure BDA0002673507330000074
以此类推,第n个片段包含从第dn-1+1个记录时间
Figure BDA0002673507330000075
到第N个记录时间oN,| |表示片段间隔符;d1、d2、dn-1、n均为自然数| |表示分片间隔符,d1、d2、dn-1、n均为自然数;Among them, it is assumed that the recording time will be divided into n segments, and the first segment contains the recording time from the first recording time o 1 to the d 1 th recording time
Figure BDA0002673507330000072
The second segment contains the record time from d 1 + 1
Figure BDA0002673507330000073
to the d 2nd record time
Figure BDA0002673507330000074
And so on, the nth segment contains the record time from dn -1 +1th
Figure BDA0002673507330000075
To the Nth recording time o N , | | represents the segment separator; d 1 , d 2 , d n-1 , and n are all natural numbers | | represents the fragment separator, d 1 , d 2 , d n-1 , n is a natural number;

计算行驶完当前片段i所需要的行驶时间:Calculate the travel time required to complete the current segment i:

Figure BDA0002673507330000076
Figure BDA0002673507330000076

其中,

Figure BDA0002673507330000077
为行驶完第i个片段的时间,对应于特征向量fi的标记时间;i、j、di、di-1均为自然数,当i=1时,d0=1;当i=n时,dn+1=N;in,
Figure BDA0002673507330000077
is the time to complete the i-th segment, corresponding to the marked time of the feature vector f i ; i, j, d i , and d i-1 are all natural numbers, when i=1, d 0 =1; when i=n , d n+1 =N;

根据所述特征向量及行驶完各片段的行驶时间,构建第二训练样本:According to the feature vector and the travel time of each segment, construct a second training sample:

Figure BDA0002673507330000078
Figure BDA0002673507330000078

其中,F表示第二训练样本,特征向量序列f1,f2…,fn为第二训练样本F的样本特征,时间时序

Figure BDA0002673507330000079
为第二训练样本F的样本标记;fn为车辆行驶路径的网格化轨迹的第n个轨迹点的特征向量;
Figure BDA00026735073300000710
为对应于特征向量fn的标记时间;Among them, F represents the second training sample, the feature vector sequence f 1 , f 2 ..., f n is the sample feature of the second training sample F, time series
Figure BDA0002673507330000079
is the sample label of the second training sample F; f n is the feature vector of the nth trajectory point of the gridded trajectory of the vehicle travel path;
Figure BDA00026735073300000710
is the marked time corresponding to the feature vector f n ;

根据所述第二训练样本训练城市市内交通旅行时间预测网络,所述城市市内交通旅行时间预测网络用于预测整个行驶路径的行驶时间。According to the second training sample, an urban traffic travel time prediction network is trained, and the urban traffic travel time prediction network is used to predict the travel time of the entire travel path.

可选地,基于所述城市市内交通流量预测网络和城市市内旅行时间预测网络,根据待测车辆的待测行驶路径,确定所述待测车辆行驶完所述待测路径所需要的旅行时间,具体包括:Optionally, based on the urban intra-city traffic flow prediction network and the urban intra-city travel time prediction network, and according to the to-be-tested travel path of the to-be-tested vehicle, determine the travel required by the to-be-tested vehicle to complete the to-be-tested path. time, including:

以所述待测车辆行驶的当前时刻为终点时间区间,计算前J个连续时间区间内的归一化浮点交通流量矩阵,并将各矩阵按时间顺序堆叠成三维张量:Taking the current time of the vehicle to be tested as the end time interval, calculate the normalized floating-point traffic flow matrix in the first J continuous time intervals, and stack each matrix into a three-dimensional tensor in chronological order:

A=[Y1,Y2,…,YJ];A=[Y 1 ,Y 2 ,...,Y J ];

其中,A为L行M列J层的三维立体数据构成的三维张量,由以当前时间区间为终点的前J个连续时间区间内获得的归一化浮点交通流量矩阵按时间顺序堆叠而成,Y1为第前J-1个时间区间内获得的归一化浮点交通流量矩阵,Y2为第前J-2个时间区间内获得的归一化浮点交通流量矩阵,YJ为当前时间内获得的归一化浮点交通流量矩阵;L为矩形网格G在纬度方向的行数,M为矩形网格G在经度方向的列数;Among them, A is a three-dimensional tensor composed of three-dimensional stereo data of L rows, M columns, and J layers. The normalized floating-point traffic flow matrices obtained in the first J consecutive time intervals with the current time interval as the end point are stacked in chronological order. , Y 1 is the normalized floating-point traffic flow matrix obtained in the first J-1 time interval, Y 2 is the normalized floating-point traffic flow matrix obtained in the first J-2 time interval, Y J is the normalized floating-point traffic flow matrix obtained at the current time; L is the number of rows in the latitude direction of the rectangular grid G, and M is the number of columns in the longitude direction of the rectangular grid G;

根据所述三维张量A及城市市内交通流量预测网络,预测未来连续Q个时间区间内的归一化浮点交通流量:B1,B2,…,BQAccording to the three-dimensional tensor A and the urban traffic flow prediction network, predict the normalized floating-point traffic flow in consecutive Q time intervals in the future: B 1 , B 2 , . . . , B Q ;

其中,BQ为城市市内交通流量预测网络预测的未来第Q个时间区间内的归一化浮点交通流量;Among them, B Q is the normalized floating-point traffic flow in the Qth time interval in the future predicted by the urban traffic flow prediction network;

根据待测车辆的待测行驶路径的轨迹序列R确定对应的网格化轨迹RG、各轨迹点的特征向量;Determine the corresponding gridded trajectory R G and the feature vector of each trajectory point according to the trajectory sequence R of the to-be-tested driving path of the vehicle to be tested;

轨迹序列R的样本特征B:B=(b1,b2,…,bn);Sample feature B of the trajectory sequence R: B=(b 1 ,b 2 ,...,b n );

其中,待测行驶路径R的样本特征B由特征向量序列b1,b2,…,bn组成;b1为网格化轨迹RG的第一个轨迹点的特征向量,bn为网格化轨迹RG的第n个轨迹点的特征向量;n为网格化轨迹RG所包含的轨迹点的个数;Among them, the sample feature B of the driving path R to be tested consists of a sequence of feature vectors b 1 , b 2 ,..., bn ; b 1 is the feature vector of the first track point of the gridded track R G , and bn is the grid The feature vector of the nth trajectory point of the gridded trajectory RG ; n is the number of trajectory points contained in the gridded trajectory RG ;

待测车辆行驶路径R的网格化轨迹RG的第i个轨迹点的特征向量:The eigenvector of the i-th trajectory point of the gridded trajectory R G of the vehicle's driving path R:

Figure BDA0002673507330000091
Figure BDA0002673507330000091

其中,bi表示网格化轨迹RG的第i个轨迹点的特征向量,

Figure BDA0002673507330000092
Figure BDA0002673507330000093
分别表示网格化轨迹RG的第i个轨迹点的经度和纬度,
Figure BDA0002673507330000094
为当前时刻城市市内交通流量预测网络所预测的第一个时间区间内的浮点归一化交通流量矩B1的第ri行和第ci列的元素,
Figure BDA0002673507330000095
为当前时刻城市市内交通流量预测网络所预测的第二个时间区间内的浮点归一化交通流量矩阵B2的第ri行和第ci列的元素,
Figure BDA0002673507330000096
为当前时刻城市市内交通流量预测网络所预测的第Q个时间区间内的浮点归一化交通流量矩阵BQ的第ri行和第ci列的元素;ri和ci分别为网格化轨迹RG的第i个轨迹点
Figure BDA0002673507330000097
位于矩形网格的行序号和列序号;Q为城市市内交通流量预测网络所预测的时间区间的个数,上标T表示向量转置;Among them, b i represents the eigenvector of the i-th trajectory point of the gridded trajectory R G ,
Figure BDA0002673507330000092
and
Figure BDA0002673507330000093
represent the longitude and latitude of the i-th track point of the gridded track R G , respectively,
Figure BDA0002673507330000094
is the element of the r i row and c i column of the floating point normalized traffic flow moment B 1 in the first time interval predicted by the urban traffic flow prediction network at the current moment,
Figure BDA0002673507330000095
is the element of row ri and column ci of the floating-point normalized traffic flow matrix B 2 in the second time interval predicted by the urban traffic flow prediction network at the current moment,
Figure BDA0002673507330000096
is the element of the rith row and cith column of the floating-point normalized traffic flow matrix B Q in the Qth time interval predicted by the urban traffic flow prediction network at the current moment; ri and ci are respectively The ith trajectory point of the gridded trajectory R G
Figure BDA0002673507330000097
The row number and column number located in the rectangular grid; Q is the number of time intervals predicted by the urban traffic flow prediction network, and the superscript T represents the vector transposition;

根据所述将网格化轨迹RG的各轨迹点的特征向量及城市市内旅行时间预测网络,确定行驶完待测车辆的待测行驶路径R的时间。According to the eigenvectors of each track point of the gridded track R G and the urban travel time prediction network, determine the time when the vehicle to be tested is driven on the travel path R to be tested.

为解决上述技术问题,本发明还提供了如下方案:In order to solve the above-mentioned technical problems, the present invention also provides the following solutions:

一种城市市内交通旅行时间预测系统,所述预测系统包括:An urban traffic travel time prediction system, the prediction system includes:

网格划分单元,用于将待测城市划分为矩形网格;The grid division unit is used to divide the city to be tested into rectangular grids;

归一化处理单元,用于基于所述矩形网格,根据历史交通流量数据构建归一化浮点交通流量矩阵;a normalization processing unit for constructing a normalized floating-point traffic flow matrix according to historical traffic flow data based on the rectangular grid;

第一训练单元,用于根据所述归一化浮点交通流量矩阵,训练城市市内交通流量预测网络;a first training unit, configured to train an urban traffic flow prediction network according to the normalized floating-point traffic flow matrix;

简化处理单元,用于根据所述矩形网格对车辆行驶路径的轨迹点序列进行简化处理,得到车辆行驶路径的网格化轨迹;a simplification processing unit, configured to perform simplified processing on the trajectory point sequence of the vehicle driving path according to the rectangular grid to obtain the gridded trajectory of the vehicle driving path;

特征确定单元,用于根据所述归一化浮点交通流量矩阵及车辆行驶路径的网格化轨迹,确定网格化轨迹中各轨迹点的特征向量;a feature determination unit, configured to determine the feature vector of each trajectory point in the gridded trajectory according to the normalized floating-point traffic flow matrix and the gridded trajectory of the vehicle travel path;

第二训练单元,用于根据所述网格化轨迹中各轨迹点的特征向量,训练城市市内交通旅行时间预测网络;The second training unit is used for training the urban traffic travel time prediction network according to the feature vector of each trajectory point in the gridded trajectory;

时间预测单元,用于基于所述城市市内交通流量预测网络和城市市内旅行时间预测网络,根据待测车辆的待测行驶路径,确定所述待测车辆行驶完所述待测路径所需要的旅行时间。The time prediction unit is used to determine, based on the urban traffic flow prediction network and the urban travel time prediction network, and according to the travel path to be tested of the vehicle to be tested, what is required for the vehicle to be tested to complete the path to be tested travel time.

为解决上述技术问题,本发明还提供了如下方案:In order to solve the above-mentioned technical problems, the present invention also provides the following solutions:

一种城市市内交通旅行时间预测系统,包括:An urban traffic travel time prediction system, comprising:

处理器;以及processor; and

被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行以下操作:memory arranged to store computer-executable instructions which, when executed, cause the processor to:

将待测城市划分为矩形网格;Divide the city to be tested into a rectangular grid;

基于所述矩形网格,根据历史交通流量数据构建归一化浮点交通流量矩阵;Based on the rectangular grid, construct a normalized floating-point traffic flow matrix according to historical traffic flow data;

根据所述归一化浮点交通流量矩阵,训练城市市内交通流量预测网络;According to the normalized floating-point traffic flow matrix, train the urban traffic flow prediction network;

根据所述矩形网格对车辆行驶路径的轨迹点序列进行简化处理,得到车辆行驶路径的网格化轨迹;Simplify the trajectory point sequence of the vehicle's driving path according to the rectangular grid, and obtain the gridded trajectory of the vehicle's driving path;

根据所述归一化浮点交通流量矩阵及车辆行驶路径的网格化轨迹,确定网格化轨迹中各轨迹点的特征向量;According to the normalized floating-point traffic flow matrix and the gridded trajectory of the vehicle travel path, determine the eigenvectors of each trajectory point in the gridded trajectory;

根据所述网格化轨迹中各轨迹点的特征向量,训练城市市内交通旅行时间预测网络;According to the feature vector of each trajectory point in the gridded trajectory, train the urban traffic travel time prediction network;

基于所述城市市内交通流量预测网络和城市市内旅行时间预测网络,根据待测车辆的待测行驶路径,确定所述待测车辆行驶完所述待测路径所需要的旅行时间。Based on the urban traffic flow prediction network and the urban travel time prediction network, and according to the travel path of the vehicle to be tested, the travel time required for the vehicle to be tested to complete the path to be tested is determined.

为解决上述技术问题,本发明还提供了如下方案:In order to solve the above-mentioned technical problems, the present invention also provides the following solutions:

一种计算机可读存储介质,所述计算机可读存储介质存储一个或多个程序,所述一个或多个程序当被包括多个应用程序的电子设备执行时,使得所述电子设备执行以下操作:A computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform the following operations :

将待测城市划分为矩形网格;Divide the city to be tested into a rectangular grid;

基于所述矩形网格,根据历史交通流量数据构建归一化浮点交通流量矩阵;Based on the rectangular grid, construct a normalized floating-point traffic flow matrix according to historical traffic flow data;

根据所述归一化浮点交通流量矩阵,训练城市市内交通流量预测网络;According to the normalized floating-point traffic flow matrix, train the urban traffic flow prediction network;

根据所述矩形网格对车辆行驶路径的轨迹点序列进行简化处理,得到车辆行驶路径的网格化轨迹;Simplify the trajectory point sequence of the vehicle's driving path according to the rectangular grid, and obtain the gridded trajectory of the vehicle's driving path;

根据所述归一化浮点交通流量矩阵及车辆行驶路径的网格化轨迹,确定网格化轨迹中各轨迹点的特征向量;According to the normalized floating-point traffic flow matrix and the gridded trajectory of the vehicle travel path, determine the eigenvectors of each trajectory point in the gridded trajectory;

根据所述网格化轨迹中各轨迹点的特征向量,训练城市市内交通旅行时间预测网络;According to the feature vector of each trajectory point in the gridded trajectory, train the urban traffic travel time prediction network;

基于所述城市市内交通流量预测网络和城市市内旅行时间预测网络,根据待测车辆的待测行驶路径,确定所述待测车辆行驶完所述待测路径所需要的旅行时间。Based on the urban traffic flow prediction network and the urban travel time prediction network, and according to the travel path of the vehicle to be tested, the travel time required for the vehicle to be tested to complete the path to be tested is determined.

根据本发明的实施例,本发明公开了以下技术效果:According to the embodiments of the present invention, the present invention discloses the following technical effects:

本发明通过对待测城市划分矩形网格,并参考历史交通流量数据,训练城市市内交通流量预测网络及城市市内交通旅行时间预测网络,通过城市市内交通流量预测网络及城市市内交通旅行时间预测网络,可实时确定待测车辆的待测行驶路径的行驶时间,可提高复杂场景下预测精度。The present invention divides the city to be tested into rectangular grids and refers to the historical traffic flow data to train the urban traffic flow prediction network and the urban traffic travel time prediction network. The time prediction network can determine the travel time of the vehicle to be tested in real time, which can improve the prediction accuracy in complex scenarios.

附图说明Description of drawings

图1是本发明城市市内交通旅行时间的预测方法的流程图;Fig. 1 is the flow chart of the prediction method of the urban traffic travel time of the present invention;

图2是城市市内交通流量预测网络的结构图;Figure 2 is a structural diagram of a city traffic flow forecast network;

图3是城市市内交通旅行时间预测网络的结构图;Figure 3 is a structural diagram of a city traffic travel time prediction network;

图4是本发明城市市内交通旅行时间预测系统的模块结构示意图。FIG. 4 is a schematic diagram of the module structure of the urban traffic travel time prediction system of the present invention.

符号说明:Symbol Description:

网格划分单元—1,归一化处理单元—2,第一训练单元—3,简化处理单元—4,特征确定单元—5,第二训练单元—6,时间预测单元—7。Grid division unit-1, normalization processing unit-2, first training unit-3, simplification processing unit-4, feature determination unit-5, second training unit-6, temporal prediction unit-7.

具体实施方式Detailed ways

下面参照附图来描述本发明的优选实施方式。本领域技术人员应当理解的是,这些实施方式仅仅用于解释本发明的技术原理,并非旨在限制本发明的保护范围。Preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principle of the present invention, and are not intended to limit the protection scope of the present invention.

本发明的目的是提供一种城市市内交通旅行时间的预测方法,通过对待测城市划分矩形网格,并参考历史交通流量数据,训练城市市内交通流量预测网络及城市市内交通旅行时间预测网络,通过城市市内交通流量预测网络及城市市内交通旅行时间预测网络,可实时确定待测车辆的待测行驶路径的行驶时间,可提高复杂场景下预测精度。The purpose of the present invention is to provide a method for predicting urban traffic travel time, by dividing the city to be measured into a rectangular grid, and referring to historical traffic flow data, to train the urban traffic flow prediction network and the urban traffic travel time prediction The network, through the urban traffic flow prediction network and the urban traffic travel time prediction network, can determine the travel time of the vehicle to be tested in real time, which can improve the prediction accuracy in complex scenarios.

为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more clearly understood, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.

如图1所示,本发明城市市内交通旅行时间的预测方法包括:As shown in Figure 1, the method for predicting the travel time of urban traffic in the present invention includes:

步骤100:将待测城市划分为矩形网格。Step 100: Divide the city to be tested into rectangular grids.

步骤200:基于所述矩形网格,根据历史交通流量数据构建归一化浮点交通流量矩阵。Step 200: Based on the rectangular grid, construct a normalized floating-point traffic flow matrix according to historical traffic flow data.

步骤300:根据所述归一化浮点交通流量矩阵,训练城市市内交通流量预测网络。Step 300: Train an urban traffic flow prediction network according to the normalized floating-point traffic flow matrix.

步骤400:根据所述矩形网格对车辆行驶路径的轨迹点序列进行简化处理,得到车辆行驶路径的网格化轨迹。Step 400: Simplify the trajectory point sequence of the vehicle travel path according to the rectangular grid to obtain a gridded trajectory of the vehicle travel path.

步骤500:根据所述归一化浮点交通流量矩阵及车辆行驶路径的网格化轨迹,确定网格化轨迹中各轨迹点的特征向量。Step 500: According to the normalized floating-point traffic flow matrix and the gridded trajectory of the vehicle travel path, determine the feature vector of each trajectory point in the gridded trajectory.

步骤600:根据所述网格化轨迹中各轨迹点的特征向量,训练城市市内交通旅行时间预测网络。Step 600: According to the feature vector of each trajectory point in the gridded trajectory, train a city traffic travel time prediction network.

步骤700:基于所述城市市内交通流量预测网络和城市市内旅行时间预测网络,根据待测车辆的待测行驶路径,确定所述待测车辆行驶完所述待测路径所需要的旅行时间。Step 700: Based on the urban traffic flow prediction network and the urban travel time prediction network, and according to the travel path of the vehicle to be tested, determine the travel time required for the vehicle to be tested to complete the path to be tested .

其中,在步骤100中,根据该城市市内各区域道路等级、道路网络密集程度、交通行驶状态等因素,将待测城市划分为一个矩形的矩形网格G,矩形网格G的各行各列大小可以不必一致。且矩形网格G在纬度方向被划分为L行,在经度方向被划分为M列。在这里,L和M均为自然数。这样,矩形网格G将城市感兴趣区域划分为L×M个格子区域,每一个格子区域对应着地理上不同的矩形区域。Wherein, in step 100, the city to be tested is divided into a rectangular grid G according to factors such as road grades, road network density, traffic driving status and other factors in each area of the city, and each row and column of the rectangular grid G is The size does not have to be the same. And the rectangular grid G is divided into L rows in the latitude direction and M columns in the longitude direction. Here, L and M are both natural numbers. In this way, the rectangular grid G divides the urban area of interest into L×M grid areas, and each grid area corresponds to a geographically different rectangular area.

在步骤200中,所述基于所述矩形网格,根据历史交通流量数据构建归一化浮点交通流量矩阵,具体包括:In step 200, the normalized floating-point traffic flow matrix is constructed according to the historical traffic flow data based on the rectangular grid, which specifically includes:

步骤210:将选取历史nd天为训练时段,将所述训练时段的每天均划分为具有固定时间间隔的Kd个时间区间;训练时段被划分成的连续时间区间的总个数为K:K=nd×KdStep 210: selecting the historical n d days as the training period, and dividing each day of the training period into K d time intervals with fixed time intervals; the total number of the continuous time intervals that the training period is divided into is K: K=n d ×K d .

需要指出的是,这里涉及到一个地理区域划分和时间间隔选择的问题。如果格子区域过小,则会存在一些时间区间某些格子区域没有车辆流量的情形;如果格子区域过大,则很难精确地描述交通流量特性。在本发明实施例中,设定矩形网格G在纬度方向的行数L为120,矩形网格G在经度方向的列数M为120,每天被划分的时间区间个数Kd为360。也就是说,时间间隔为4分钟。选择时间间隔为4分钟主要是考虑到对于绝大多数城市,在该时间间隔内交通状态通常不会发生频繁转换。It should be pointed out that this involves a problem of geographical area division and time interval selection. If the grid area is too small, there will be some time intervals where there is no vehicle flow in some grid areas; if the grid area is too large, it is difficult to accurately describe the traffic flow characteristics. In the embodiment of the present invention, the number of rows L in the latitude direction of the rectangular grid G is set to 120, the number of columns M of the rectangular grid G in the longitude direction is 120, and the number of time intervals K d divided every day is 360. That is, the time interval is 4 minutes. The time interval of 4 minutes is chosen mainly because for the vast majority of cities, the traffic state usually does not change frequently during this time interval.

步骤220:统计所述训练时段内进入联网系统的车辆在矩形网格G内的轨迹数据,每一个轨迹数据记录车辆的经度位置、纬度位置和时间信息。Step 220: Count the trajectory data of the vehicles entering the networked system in the rectangular grid G during the training period, and each trajectory data records the longitude position, latitude position and time information of the vehicle.

在实施本发明时,联网系统可以是一个或多个系统的组合,比如,出租车营运管理系统、公共交通车辆公交营运管理系统、交通出行服务系统、以及车联网等。When implementing the present invention, the networking system may be a combination of one or more systems, such as a taxi operation management system, a public transport vehicle bus operation management system, a traffic travel service system, and a car networking.

Figure BDA0002673507330000141
表示在第t个时间区间内出现在矩形网格G的第i行第j列格子区域内的车辆个数。这里
Figure BDA0002673507330000142
为自然数,随后,将序号i遍历1至L之间的整数,序号j遍历1至M之间的整数,得到一个大小为L行M列的流量矩阵。记该流量矩阵为Xt。流量矩阵Xt的每一个元素记录第t个时间区间内在对应格子区域内的车辆流量。t的取值范围为1至K之间的整数。
Figure BDA0002673507330000141
Indicates the number of vehicles that appear in the grid area of the i-th row and j-th column of the rectangular grid G in the t-th time interval. here
Figure BDA0002673507330000142
is a natural number, then, traverse the sequence number i through the integers between 1 and L, and the sequence number j through the integers between 1 and M, to obtain a flow matrix with a size of L rows and M columns. Let this flow matrix be X t . Each element of the flow matrix X t records the vehicle flow in the corresponding grid area in the t-th time interval. The value range of t is an integer between 1 and K.

步骤230:遍历训练时段内所有的时间区间,统计在同一时间区间内位于进入联网系统内的车辆流量,得到K个交通流量矩阵,分别记为X1,X2,...,Xk,...,XK;Xk表示在第k个时间区间内的交通流量矩阵,k=1,2,....,K。Step 230: Traverse all the time intervals in the training period, count the traffic flow of vehicles entering the networked system in the same time interval, and obtain K traffic flow matrices, which are respectively denoted as X 1 , X 2 ,...,X k , ...,X K ; X k represents the traffic flow matrix in the kth time interval, k=1,2,....,K.

步骤240:根据以下公式,对各交通流量矩阵进行归一化浮点处理,得到对应的归一化浮点交通流量矩阵:Step 240: Perform normalized floating-point processing on each traffic flow matrix according to the following formula to obtain a corresponding normalized floating-point traffic flow matrix:

Figure BDA0002673507330000143
Figure BDA0002673507330000143

其中,

Figure BDA0002673507330000144
为第t个时间区间内的归一化浮点交通流量矩阵Yt的第i行第j列元素,x0表示K个交通流量矩阵中所有元素的最大值(出现在所有时间区间和所有格子区间内的车辆数目的最大值)。in,
Figure BDA0002673507330000144
is the i-th row and j-th column element of the normalized floating-point traffic flow matrix Y t in the t-th time interval, x 0 represents the maximum value of all elements in the K traffic flow matrices (appears in all time intervals and all grids maximum number of vehicles in the interval).

通过引入浮点归一化操作可以提供各矩形网格的交通流量的相对值,从而减少因交通流量统计不全而引起的偏差。By introducing the floating point normalization operation, the relative value of the traffic flow of each rectangular grid can be provided, thereby reducing the deviation caused by incomplete traffic flow statistics.

在步骤300中,构建城市市内交通流量预测网络所需的训练样本集。城市市内交通流量预测网络的任务是利用归一化浮点交通流量矩阵所构成的时间序列数据来预测未来多个连续时间区间内的交通流量。为了训练城市市内交通流量预测网络,需要从训练时段获得的浮点归一化交通流量矩阵中构建训练样本。每一个训练样本由样本特征和输出标记两部分所组成。In step 300, a training sample set required for the urban traffic flow prediction network is constructed. The task of the urban traffic flow prediction network is to use the time series data formed by the normalized floating-point traffic flow matrix to predict the traffic flow in multiple continuous time intervals in the future. In order to train the intra-city traffic flow prediction network, training samples need to be constructed from the floating-point normalized traffic flow matrix obtained during the training period. Each training sample consists of sample features and output labels.

具体地,所述根据所述归一化浮点交通流量矩阵,训练城市市内交通流量预测网络,包括:Specifically, according to the normalized floating-point traffic flow matrix, the training of the urban traffic flow prediction network includes:

步骤310:根据所述归一化浮点交通流量矩阵,构建对应的第一训练样本:Step 310: According to the normalized floating-point traffic flow matrix, construct a corresponding first training sample:

Pt=(At;Bt),P t =(A t ; B t ),

其中,t表示时间区间序号,Pt表示第一训练样本;At表示第一训练样本Pt的样本特征,是一个L行M列J层的三维张量,由第t个时间区间为终点的前J个连续时间区间内获得的归一化交通流量矩阵按时间顺序堆叠而成:At=[Yt-J+1,Yt-J+2,…,Yt-1,Yt];其中,Yt-J+1为第t+1个时间区间内获得的归一化浮点交通流量矩阵,Yt-J+2为第t+2个时间区间内获得的归一化浮点交通流量矩阵,Yt-1为第t-1个时间区间内获得的归一化浮点交通流量矩阵,Yt为第t个时间区间内获得的归一化浮点交通流量矩阵,自然数L为矩形网格G在纬度方向的行数,自然数M为矩形网格G在经度方向的列数,J为样本特征的连续时间区间个数,Q为构建样本标记的连续时间区间个数(即城市市内交通流量预测网络所需要预测的未来连续时间区间内归一化浮点交通流量矩阵的个数)。在这里,J和Q均为自然数;Among them, t represents the sequence number of the time interval, P t represents the first training sample; A t represents the sample feature of the first training sample P t , which is a three-dimensional tensor with L rows, M columns, and J layers, starting from the t-th time interval as the end point. The normalized traffic flow matrices obtained in the first J consecutive time intervals of the ]; where Y t-J+1 is the normalized floating-point traffic flow matrix obtained in the t+1th time interval, and Y t-J+2 is the normalized floating-point traffic flow matrix obtained in the t+2th time interval Floating-point traffic flow matrix, Y t-1 is the normalized floating-point traffic flow matrix obtained in the t-1th time interval, Y t is the normalized floating-point traffic flow matrix obtained in the t-th time interval, The natural number L is the number of rows in the latitude direction of the rectangular grid G, the natural number M is the number of columns in the longitude direction of the rectangular grid G, J is the number of continuous time intervals for sample features, and Q is the number of continuous time intervals for constructing sample markers (that is, the number of normalized floating-point traffic flow matrices in the future continuous time interval that the urban traffic flow forecasting network needs to predict). Here, J and Q are both natural numbers;

Bt表示第一训练样本Pt的样本标记,为一个L行M列Q层的三维张量,由以第t+1个时间区间为起点的Q个连续时间区间内获得的归一化交通流量矩阵按时间顺序堆叠而成:Bt=[Yt+1,Yt+2,…,Yt+Q];B t represents the sample label of the first training sample P t , which is a three-dimensional tensor with L rows and M columns and Q layers. The normalized traffic obtained in Q consecutive time intervals starting from the t+1th time interval The flow matrix is stacked in chronological order: B t =[Y t+1 ,Y t+2 ,…,Y t+Q ];

其中,其中,Yt+1为第t+1个时间区间内获得的归一化浮点交通流量矩阵,Yt+2为第t+2个时间区间内获得的归一化浮点交通流量矩阵,Yt+Q为第t+Q个时间区间内获得的归一化浮点交通流量矩阵,自然数L为矩形网格G在纬度方向的行数,自然数M为矩形网格G在经度方向的列数,自然数Q为构建样本标记的连续时间区间个数,t为自然数。样本特征At和样本标记Bt均是已知的。Among them, Y t+1 is the normalized floating-point traffic flow matrix obtained in the t+1 time interval, and Y t+2 is the normalized floating-point traffic flow obtained in the t+2 time interval Matrix, Y t+Q is the normalized floating-point traffic flow matrix obtained in the t+Qth time interval, the natural number L is the row number of the rectangular grid G in the latitude direction, and the natural number M is the rectangular grid G in the longitude direction The number of columns of , the natural number Q is the number of continuous time intervals for constructing sample markers, and t is a natural number. Both the sample feature At and the sample label Bt are known.

考虑到需要预测未来Q个连续时间区间内的流量数据,对于总长度为K的归一化浮点交通流量矩阵,t可以取1到K-J-Q+1之间的整数。因此,按上述方式一共可以获得K-J-Q个训练样本。在本实施例中,自然数J和Q均被设定为10。Considering the need to predict the traffic data in Q consecutive time intervals in the future, for a normalized floating-point traffic flow matrix with a total length of K, t can take an integer between 1 and K-J-Q+1. Therefore, a total of K-J-Q training samples can be obtained in the above manner. In this embodiment, the natural numbers J and Q are both set to 10.

步骤320:根据所述第一训练样本训练城市市内交通流量预测网络;所述城市市内交通流量预测网络用于预测未来Q个连续时间区间内的矩形网格G的归一化浮点交通流量。Step 320: Train an urban traffic flow prediction network according to the first training sample; the urban urban traffic flow prediction network is used to predict the normalized floating-point traffic of the rectangular grid G in Q consecutive time intervals in the future flow.

本实施例城市市内交通流量预测网络的主干结构如表1所示。在表1中,conv代表卷积层。本实施例采用的城市市内交通流量预测网络共有7个卷积层。卷积层conv1、卷积层conv2和卷积层conv3组成编码器,用于学习高层语义特征;卷积层conv4、卷积层conv5、卷积层conv6和卷积层conv7组成解码器,用于从高层语义特征逐步解码获得每个格子区域内的交通流量预测结果。本实施例城市市内交通流量预测网络的卷积核大小均为3×3。The backbone structure of the urban traffic flow prediction network in this embodiment is shown in Table 1. In Table 1, conv stands for convolutional layer. The urban traffic flow prediction network used in this embodiment has a total of 7 convolution layers. Convolutional layer conv1, convolutional layer conv2 and convolutional layer conv3 form an encoder for learning high-level semantic features; convolutional layer conv4, convolutional layer conv5, convolutional layer conv6 and convolutional layer conv7 form a decoder for The traffic flow prediction results in each grid area are obtained by step-by-step decoding from high-level semantic features. The size of the convolution kernel of the urban traffic flow prediction network in this embodiment is all 3×3.

在表1中,卷积层conv1的输入通道数为10,这是因为本实施例所采用的城市市内交通流量预测网络以连续10个时间区域内获得的归一化浮点交通流量矩阵为输入数据。卷积层conv7的输入通道数为10,这是因为本实施例所采用的城市市内交通流量预测网络以预测未来10个连续时间区间内的归一化浮点交通流量数据为输出。In Table 1, the number of input channels of the convolutional layer conv1 is 10. This is because the normalized floating-point traffic flow matrix obtained in the urban traffic flow prediction network used in this embodiment is obtained in 10 consecutive time regions as Input data. The number of input channels of the convolutional layer conv7 is 10, because the urban traffic flow prediction network used in this embodiment uses the normalized floating-point traffic flow data predicted in 10 continuous time intervals in the future as the output.

在表1中,本实施例所采用的城市市内交通流量预测网络的卷积层conv1、卷积层conv2、卷积层conv3、卷积层conv4、卷积层conv5、卷积层conv6的输出通道数分别为20、40、80、40、20、10。因此,表1中的参数确定了本实施例所采用的城市市内交通流量预测网络的结构。In Table 1, the output of the convolutional layer conv1, convolutional layer conv2, convolutional layer conv3, convolutional layer conv4, convolutional layer conv5, and convolutional layer conv6 of the urban traffic flow prediction network used in this embodiment The number of channels is 20, 40, 80, 40, 20, 10, respectively. Therefore, the parameters in Table 1 determine the structure of the urban traffic flow prediction network used in this embodiment.

每一个卷积操作之后紧跟一个激励操作,并由常用的线性整流函数(RectifiedLinear Unit,ReLU)来完成。线性整流函数就是对卷积的结果与零取最大值运算,即如果卷积的结果大于零则保留该结果,否则置零。Each convolution operation is followed by an excitation operation, which is performed by the commonly used Rectified Linear Unit (ReLU). The linear rectification function is to take the maximum value of the result of the convolution and zero, that is, if the result of the convolution is greater than zero, the result is retained, otherwise it is set to zero.

值得注意的是,在本发明中,城市市内交通流量预测网络并没有在编码器中执行通常所采用的池化(pooling)操作,即执行矩形网格区域下采样操作。这是因为,相对于全局(整个城市)而言,城市交通状况更多地体现出局部区域关联性,因此不必通过下采样来扩大特征学习的区域。It is worth noting that, in the present invention, the intra-city traffic flow prediction network does not perform the commonly used pooling operation in the encoder, that is, the down-sampling operation of the rectangular grid area. This is because, compared with the global (the whole city), the urban traffic conditions reflect more local regional correlations, so it is not necessary to expand the region of feature learning through downsampling.

如图2所示,卷积层conv1的输出(经过激励操作之后)为卷积层conv2的输入,卷积层conv2的输出(经过激励操作之后)为卷积层conv3的输入,卷积层conv3的输出(经过激励操作之后)为卷积层conv4的输入。As shown in Figure 2, the output of the convolutional layer conv1 (after the excitation operation) is the input of the convolutional layer conv2, the output of the convolutional layer conv2 (after the excitation operation) is the input of the convolutional layer conv3, and the convolutional layer conv3 The output of (after excitation operation) is the input of the convolutional layer conv4.

如图2所示,卷积层conv5的输入为卷积层conv2的输出和卷积层conv4输出串接(concatenate)而成,即图2中所示的“conc”操作。这样,卷积层conv5的输入通道数为80,如表1所示。卷积层conv6的输入为卷积层conv1的输出和卷积层conv5输出串接而成,即图2中所示的“串接”操作。这样,卷积层conv6的输入通道数为40,如表1所示。卷积层conv7的输入为卷积层conv1的输入和卷积层conv6输出串接而成,即图2中所示的“串接”操作。这样,卷积层conv7的输入通道数为20,如表1所示。在本发明中,引入“串接”操作是为了增加各网格区域内归一化浮点交通流量的精度。As shown in Figure 2, the input of the convolutional layer conv5 is formed by concatenating the output of the convolutional layer conv2 and the output of the convolutional layer conv4, that is, the "conc" operation shown in Figure 2. In this way, the number of input channels of the convolutional layer conv5 is 80, as shown in Table 1. The input of the convolutional layer conv6 is the concatenation of the output of the convolutional layer conv1 and the output of the convolutional layer conv5, that is, the "concatenation" operation shown in Figure 2. In this way, the number of input channels of the convolutional layer conv6 is 40, as shown in Table 1. The input of the convolutional layer conv7 is the concatenation of the input of the convolutional layer conv1 and the output of the convolutional layer conv6, that is, the "concatenation" operation shown in Figure 2. In this way, the number of input channels of the convolutional layer conv7 is 20, as shown in Table 1. In the present invention, the "concatenation" operation is introduced to increase the precision of the normalized floating point traffic flow within each grid area.

表1:城市市内交通流量预测网络卷积核大小以及各层输入输出通道数Table 1: The size of the convolution kernel of the urban traffic flow prediction network and the number of input and output channels in each layer

名称name 卷积核大小convolution kernel size 输入通道数Number of input channels 输出通道数Number of output channels conv1conv1 3×33×3 1010 2020 conv2conv2 3×33×3 2020 4040 conv3conv3 3×33×3 4040 8080 conv4conv4 3×33×3 8080 4040 conv5conv5 3×33×3 8080 2020 conv6conv6 3×33×3 4040 2020 conv7conv7 3×33×3 3030 1010

最后,对本实施例所采用的城市市内交通流量预测网络进行训练。在本发明中,该以均方误差(Mean Squared Error,MSE)作为该网络的损失函数。优化算法采用本领域经典的误差反向传播算法。在本发明中,学习率大小为0.001,批量数据集的大小设定为16,每一个批量数据集一共训练20轮。Finally, the urban traffic flow prediction network used in this embodiment is trained. In the present invention, the mean squared error (Mean Squared Error, MSE) is used as the loss function of the network. The optimization algorithm adopts the classic error back-propagation algorithm in the field. In the present invention, the size of the learning rate is 0.001, the size of the batch data set is set to 16, and each batch data set is trained for 20 rounds in total.

在该网络被训练之后,在应用该网络时,给定一个由连续J个时间区域内获得的归一化浮点交通流量矩阵按时序顺序堆叠而成三维张量,该网络将输出一个三维张量,由Q个矩阵堆叠而成,按时间顺序每个矩阵为该网络所预测的未来一个时间区间内的归一化浮点交通流量矩阵。After the network is trained, when the network is applied, given a 3D tensor stacked in chronological order from normalized floating-point traffic flow matrices obtained in consecutive J time regions, the network will output a 3D tensor It consists of stacking Q matrices, each of which is a normalized floating-point traffic flow matrix in a future time interval predicted by the network in chronological order.

本发明将城市感兴趣区域划分为包含L行和M列的矩形网格G。矩形网格G的空间分辨率小于现有定位系统(比如北导航系统)所能记录的车辆行驶路径的空间分辨率。为了对行驶路径进行特征描述,需要使行驶路径的轨迹点序列与矩形网格G的空间分辨率保持一致。因此,需要对车辆行驶路径的原始轨迹序列按矩形网格G进行网格化简化。The present invention divides the urban area of interest into a rectangular grid G containing L rows and M columns. The spatial resolution of the rectangular grid G is smaller than the spatial resolution of the vehicle travel path that can be recorded by the existing positioning system (such as the north navigation system). In order to characterize the travel path, it is necessary to keep the trajectory point sequence of the travel path consistent with the spatial resolution of the rectangular grid G. Therefore, it is necessary to perform grid simplification on the original trajectory sequence of the vehicle travel path according to the rectangular grid G.

具体地,步骤400中,根据所述矩形网格对车辆行驶路径的轨迹点序列进行简化处理,得到车辆行驶路径的网格化轨迹,包括:Specifically, in step 400, a simplified process is performed on the trajectory point sequence of the vehicle's driving path according to the rectangular grid to obtain a gridded trajectory of the vehicle's driving path, including:

步骤410:各车辆行驶路径分别用轨迹点序列来描述,每个轨迹点包含该轨迹点所在的经度坐标和纬度坐标;Step 410: Each vehicle travel path is described by a sequence of track points, and each track point includes the longitude and latitude coordinates where the track point is located;

对于一条给定的车辆行驶路径,对应的轨迹序列为T,轨迹序列T由N个轨迹点来描述:T={(x1,y1),(x2,y2),…,(xN,yN)};For a given vehicle driving path, the corresponding trajectory sequence is T, and the trajectory sequence T is described by N trajectory points: T={(x 1 ,y 1 ),(x 2 ,y 2 ),…,(x N ,y N )};

其中,x1和y1分别表示第一个轨迹点的经度和纬度,xN和yN分别表示第N个轨迹点的经度和纬度。Among them, x 1 and y 1 represent the longitude and latitude of the first track point, respectively, and x N and y N represent the longitude and latitude of the Nth track point, respectively.

步骤420:根据所述矩形网格G,将轨迹序列T的N个轨迹点按顺序分成不同的片段,使每一个片段内的轨迹点位于矩形网格G的同一个格子区域:Step 420: According to the rectangular grid G, divide the N trajectory points of the trajectory sequence T into different segments in sequence, so that the trajectory points in each segment are located in the same grid area of the rectangular grid G:

Figure BDA0002673507330000191
Figure BDA0002673507330000191

其中,设轨迹T将被分成n个片段,第一个片段包含从第一个轨迹点(x1,y1)到第d1个轨迹点

Figure BDA0002673507330000192
第二个片段包含从第d1+1个轨迹点
Figure BDA0002673507330000193
到第d2个轨迹点
Figure BDA0002673507330000194
以此类推,第n个片段包含从第dn-1+1个轨迹点
Figure BDA0002673507330000195
到第N个轨迹点(xN,yN),| |表示片段间隔符;d1、d2、dn-1、n均为自然数。Among them, let the trajectory T be divided into n segments, the first segment contains from the first trajectory point (x 1 , y 1 ) to the d 1th trajectory point
Figure BDA0002673507330000192
The second fragment contains 1 +1 trajectory points from the dth
Figure BDA0002673507330000193
to the d 2nd trajectory point
Figure BDA0002673507330000194
And so on, the nth segment contains the trajectory points from d n-1 +1
Figure BDA0002673507330000195
To the Nth track point (x N , y N ), | | represents the segment spacer; d 1 , d 2 , d n-1 , and n are all natural numbers.

步骤430:计算同一个片段内的轨迹点的经度和纬度的平均值,得到网格化轨迹TGStep 430: Calculate the average of the longitude and latitude of the track points in the same segment to obtain the gridded track T G :

Figure BDA0002673507330000196
Figure BDA0002673507330000196

其中,

Figure BDA0002673507330000201
表示属于第i个片段内的轨迹点的经度的平均值,
Figure BDA0002673507330000202
表示属于第i个片段内的轨迹点的纬度的均值,xj和yj分别为经度坐标和纬度坐标,当i=1时,d0=1;当i=n时,dn=N;
Figure BDA0002673507330000203
in,
Figure BDA0002673507330000201
represents the mean of the longitudes of the trajectory points belonging to the ith segment,
Figure BDA0002673507330000202
Represents the mean value of the latitude of the trajectory points belonging to the ith segment, x j and y j are the longitude and latitude coordinates respectively, when i=1, d 0 =1; when i=n, d n =N;
Figure BDA0002673507330000203

其中符号“x”代表对应轨迹点的经度坐标,符号“y”代表对应轨迹点的纬度坐标,d1、d2、dn-1、n均为自然数。The symbol "x" represents the longitude coordinate of the corresponding trajectory point, the symbol "y" represents the latitude coordinate of the corresponding trajectory point, and d 1 , d 2 , d n-1 , and n are all natural numbers.

对于一条给定的车辆行驶路径,仅仅采用该路径中各轨迹点的位置坐标来预测行驶完该轨迹的时间是不足够的。为达成此目的,本发明在每一个轨迹点附加上对应格子区域内的归一化浮点交通流量。归一化浮点交通流量是动态信息,与车辆行驶时间密切相关,因此可以用于估计行驶时间。For a given vehicle travel path, it is not enough to use only the position coordinates of each track point in the path to predict the time to complete the track. To achieve this purpose, the present invention adds the normalized floating point traffic flow in the corresponding grid area to each track point. Normalized floating-point traffic flow is dynamic information that is closely related to vehicle travel time and can therefore be used to estimate travel time.

设车辆行驶路径轨迹T经过步骤S3所述的网格化简化后得到的网格化轨迹TG的第i个轨迹点

Figure BDA0002673507330000204
位于矩形网格G的第ri行和第ci列所在的格子区域。在这里,自然数i的取值范围为1到n之间的整数,自然数ri的取值范围为1至L之间的整数,自然数ci的取值范围为1至M之间的整数,自然数L为矩形网格G在纬度方向的行数,自然数M为矩形网格G在经度方向的列数。Assume that the ith trajectory point of the gridded trajectory T G obtained after the vehicle travel path trajectory T is simplified by the gridding described in step S3
Figure BDA0002673507330000204
It is located in the grid area where the ri- th row and the ci- th column of the rectangular grid G are located. Here, the value range of the natural number i is an integer between 1 and n, the value range of the natural number ri is an integer between 1 and L, and the value range of the natural number c i is an integer between 1 and M, The natural number L is the number of rows of the rectangular grid G in the latitude direction, and the natural number M is the number of columns of the rectangular grid G in the longitude direction.

具体地,在步骤500中,根据所述归一化浮点交通流量矩阵及车辆行驶路径的网格化轨迹,确定网格化轨迹中各轨迹点的特征向量,包括:Specifically, in step 500, according to the normalized floating-point traffic flow matrix and the gridded trajectory of the vehicle travel path, determine the feature vector of each trajectory point in the gridded trajectory, including:

步骤510:从所述归一化浮点交通流量矩阵中取出连续Q个归一化浮点交通流量矩阵Yp+1,Yp+2,…,Yp+Q;其中,p为车辆行驶路径T第一个轨迹点(x1,y1)的时间在训练时段所属时间区间的序号。Step 510: Take out consecutive Q normalized floating-point traffic flow matrices Y p+1 , Y p+2 , . . . , Y p+Q from the normalized floating-point traffic flow matrix; The sequence number of the time interval of the first trajectory point (x 1 , y 1 ) of the path T in the time interval to which the training period belongs.

在训练时段,由于车辆行驶路径轨迹T属于历史数据,因此它的第一个轨迹点(x1,y1)的时间是已知的。记第一个轨迹点(x1,y1)的时间在步骤S1中的训练时段的所属时间区间的索引值为p。这里p为自然数。During the training period, since the vehicle travel path trajectory T belongs to historical data, the time of its first trajectory point (x 1 , y 1 ) is known. The index value of the time interval to which the time of the first trajectory point (x 1 , y 1 ) belongs to the training period in step S1 is recorded as p. Here p is a natural number.

步骤520:根据网格化轨迹TG的第i个轨迹点

Figure BDA0002673507330000211
位于矩形网格G的第ri行和第ci列所在的格子区域,分别取出归一化浮点交通流量矩阵Yp+1,Yp+2,…,Yp+Q中第ri行和第ci列的元素:
Figure BDA0002673507330000212
其中,
Figure BDA0002673507330000213
为归一化浮点交通流量矩阵Yp+Q的第ri行和第ci列的元素;ri和ci分别为网格化轨迹TG的第i个轨迹点
Figure BDA0002673507330000214
位于矩形网格的行序号和列序号。Step 520: According to the i-th trajectory point of the gridded trajectory T G
Figure BDA0002673507330000211
In the grid area where the ri- th row and the c- th column of the rectangular grid G are located, take out the ri -th in the normalized floating-point traffic flow matrix Y p+1 , Y p+2 ,...,Y p+Q respectively Elements of row and column c i :
Figure BDA0002673507330000212
in,
Figure BDA0002673507330000213
are the elements of the ri-th row and ci- th column of the normalized floating-point traffic flow matrix Y p+Q ; ri and ci are the ith trajectory point of the gridded trajectory T G respectively
Figure BDA0002673507330000214
The row and column numbers in the rectangular grid.

步骤530:构建网格化轨迹TG的第i个轨迹点的特征向量fiStep 530: Construct the feature vector f i of the i-th trajectory point of the gridded trajectory TG :

Figure BDA0002673507330000215
Figure BDA0002673507330000215

其中,fi表示网格化轨迹TG的第i个轨迹点的特征向量,

Figure BDA0002673507330000216
Figure BDA0002673507330000217
分别表示网格化轨迹TG的第i个轨迹点的经度和纬度,
Figure BDA0002673507330000218
为浮点归一化交通流量矩阵Yp+1的第ri行和第ci列的元素,
Figure BDA0002673507330000219
为浮点归一化交通流量矩阵Yp+2的第ri行和第ci列的元素,
Figure BDA00026735073300002110
为浮点归一化交通流量矩阵Yp+Q的第ri行和第ci列的元素;ri和ci分别为网格化轨迹TG的第i个轨迹点
Figure BDA00026735073300002111
位于矩形网格的行索引值和列索引值;p为车辆行驶路径T第一个轨迹点的时间在训练时段所属时间区间的索引值;自然数Q为城市市内交通流量预测网络所预测的时间区间的个数;自然数n为网格化轨迹TG的轨迹点的个数;自然数i的取值范围为1到n之间的整数;上标T表示向量转置。Among them, f i represents the feature vector of the i-th trajectory point of the gridded trajectory T G ,
Figure BDA0002673507330000216
and
Figure BDA0002673507330000217
respectively represent the longitude and latitude of the i-th track point of the gridded track T G ,
Figure BDA0002673507330000218
is the floating point normalized traffic flow matrix Y p+1 elements in row r i and column c i ,
Figure BDA0002673507330000219
is the floating point normalized traffic flow matrix Y p+2 elements in row r i and column c i ,
Figure BDA00026735073300002110
is the element of the ri-th row and ci- th column of the floating-point normalized traffic flow matrix Y p+Q ; ri and ci are the ith trajectory point of the gridded trajectory T G respectively
Figure BDA00026735073300002111
The row index value and column index value located in the rectangular grid; p is the index value of the time of the first trajectory point of the vehicle travel path T in the time interval of the training period; the natural number Q is the time predicted by the urban traffic flow prediction network The number of intervals; the natural number n is the number of trajectory points of the gridded trajectory T G ; the value range of the natural number i is an integer between 1 and n; the superscript T represents the vector transposition.

网格化轨迹TG的每一个轨迹点既有位置坐标信息也有与交通状态相关的动态信息,从而有利于提升行驶时间估计的精度。Each trajectory point of the gridded trajectory T G has both the position coordinate information and the dynamic information related to the traffic state, which is beneficial to improve the accuracy of the travel time estimation.

在步骤600中,根据所述网格化轨迹中各轨迹点的特征向量,训练城市市内交通旅行时间预测网络,具体包括:In step 600, according to the feature vector of each trajectory point in the gridded trajectory, train the urban traffic travel time prediction network, which specifically includes:

步骤610:获取车辆行驶路径的轨迹序列T中各轨迹点的记录时间o1,o2,…,oN;其中,oN为第N个轨迹点的记录时间。Step 610: Acquire the recording time o 1 , o 2 , . . . , o N of each track point in the track sequence T of the vehicle traveling path; wherein, o N is the recording time of the Nth track point.

具体地,对一条位于矩形网格G内的车辆行驶路径的轨迹T,按步骤400的方法将轨迹T进行网格化简化得到网格化轨迹TG。进一步,按步骤500的方法获得网格化轨迹TG的每个轨迹点的特征向量,即f1,f2…,fn。其中,f1为网格化轨迹TG的第一个轨迹点的特征向量,f2为网格化轨迹TG的第二个轨迹点的特征向量,fn为网格化轨迹TG的第n个轨迹点的特征向量。在这里,自然数n为网格化轨迹TG所包含的轨迹点的个数。Specifically, for a trajectory T of a vehicle traveling path located in a rectangular grid G, the gridded trajectory T G is obtained by performing grid simplification on the trajectory T according to the method of step 400 . Further, according to the method of step 500, the feature vector of each trajectory point of the gridded trajectory T G is obtained, that is, f 1 , f 2 . . . , f n . Among them, f 1 is the eigenvector of the first trajectory point of the gridded trajectory TG , f2 is the eigenvector of the second trajectory point of the gridded trajectory TG , and fn is the eigenvector of the gridded trajectory TG The eigenvector of the nth trajectory point. Here, the natural number n is the number of trajectory points included in the gridded trajectory TG .

对应地,对车辆行驶路径的轨迹T,记其包含的轨迹点个数为N。从数据库中取出轨迹路径的各轨迹点的记录时间,按顺序排列为o1,o2,…,oN。其中,o1为轨迹T的第一个轨迹点的记录时间,o2为第一个轨迹点的记录时间,oN为第N个轨迹点的记录时间。因此,行驶完轨迹T的总时间为oN-o1Correspondingly, for the trajectory T of the vehicle travel path, the number of trajectory points contained in it is denoted as N. The recording time of each track point of the track path is retrieved from the database, and is arranged in sequence as o 1 , o 2 ,...,o N . Among them, o 1 is the recording time of the first track point of the track T, o 2 is the recording time of the first track point, and o N is the recording time of the Nth track point. Therefore, the total time to travel the trajectory T is o N -o 1 .

步骤620:根据所述矩形网格G,将各记录时间按顺序分成不同的片段,使每一个片段内的记录时间位于矩形网格G的同一个格子区域:Step 620: According to the rectangular grid G, divide each recording time into different segments in sequence, so that the recording time in each segment is located in the same grid area of the rectangular grid G:

Figure BDA0002673507330000221
Figure BDA0002673507330000221

其中,其中,设记录时间将被分成n个片段,第一个片段包含从第一个记录时间o1到第d1个记录时间

Figure BDA0002673507330000222
第二个片段包含从第d1+1个记录时间
Figure BDA0002673507330000223
到第d2个记录时间
Figure BDA0002673507330000224
以此类推,第n个片段包含从第dn-1+1个记录时间
Figure BDA0002673507330000225
到第N个记录时间oN,| |表示片段间隔符;d1、d2、dn-1、n均为自然数| |表示分片间隔符,d1、d2、dn-1、n均为自然数。Among them, it is assumed that the recording time will be divided into n segments, and the first segment contains the recording time from the first recording time o 1 to the d 1 th recording time
Figure BDA0002673507330000222
The second segment contains the record time from d 1 + 1
Figure BDA0002673507330000223
to the d 2nd record time
Figure BDA0002673507330000224
And so on, the nth segment contains the record time from dn -1 +1th
Figure BDA0002673507330000225
To the Nth recording time o N , | | represents the segment separator; d 1 , d 2 , d n-1 , and n are all natural numbers | | represents the fragment separator, d 1 , d 2 , d n-1 , n are all natural numbers.

由于车辆行驶路径各不相同,因此其轨迹点的个数也各不相同。也就是説,对不同的轨迹T,其轨迹点个数N是不相同的。对应地,网格化轨迹TG的轨迹点个数n也不相同。为了适应这种轨迹长短不一的情形,本发明将沿着网格化轨迹TG,在每一个格子区域输出一个行驶时间。Since the driving paths of the vehicles are different, the number of their trajectory points is also different. That is to say, for different tracks T, the number N of track points is different. Correspondingly, the number n of track points of the gridded track T G is also different. In order to adapt to the situation of the different lengths of the trajectory, the present invention will output a travel time in each grid area along the gridded trajectory TG .

步骤630:计算行驶完当前片段i所需要的行驶时间:Step 630: Calculate the travel time required to complete the current segment i:

Figure BDA0002673507330000226
Figure BDA0002673507330000226

其中,

Figure BDA0002673507330000231
为行驶完第i个片段的时间,对应于特征向量fi的标记时间;i、j、di、di-1均为自然数,当i=1时,d0=1;当i=n时,dn+1=N。in,
Figure BDA0002673507330000231
is the time to complete the i-th segment, corresponding to the marked time of the feature vector f i ; i, j, d i , and d i-1 are all natural numbers, when i=1, d 0 =1; when i=n , d n+1 =N.

步骤640:根据所述特征向量及行驶完各片段的行驶时间,构建第二训练样本:Step 640: Construct a second training sample according to the feature vector and the travel time of each segment:

Figure BDA0002673507330000232
Figure BDA0002673507330000232

其中,F表示第二训练样本,特征向量序列f1,f2…,fn为第二训练样本F的样本特征,时间时序

Figure BDA0002673507330000233
为第二训练样本F的样本标记;f1为车辆行驶路径的网格化轨迹的第一个轨迹点的特征向量,f2为车辆行驶路径的网格化轨迹的第二个轨迹点的特征向量,fn为车辆行驶路径的网格化轨迹的第n个轨迹点的特征向量;
Figure BDA0002673507330000234
为对应于特征向量f1的标记时间,
Figure BDA0002673507330000235
为对应于特征向量f2的标记时间,
Figure BDA0002673507330000236
为对应于特征向量fn的标记时间;自然数n为车辆行驶路径的网格化轨迹的轨迹点的个数。Among them, F represents the second training sample, the feature vector sequence f 1 , f 2 ..., f n is the sample feature of the second training sample F, time series
Figure BDA0002673507330000233
is the sample label of the second training sample F; f1 is the feature vector of the first trajectory point of the gridded trajectory of the vehicle driving path, and f2 is the feature of the second trajectory point of the gridded trajectory of the vehicle driving path vector, f n is the feature vector of the nth trajectory point of the gridded trajectory of the vehicle travel path;
Figure BDA0002673507330000234
is the labeling time corresponding to the feature vector f 1 ,
Figure BDA0002673507330000235
is the labeling time corresponding to the feature vector f2 ,
Figure BDA0002673507330000236
is the marked time corresponding to the feature vector f n ; the natural number n is the number of trajectory points of the gridded trajectory of the vehicle travel path.

步骤650:根据所述第二训练样本训练城市市内交通旅行时间预测网络,所述城市市内交通旅行时间预测网络用于预测整个行驶路径的行驶时间。Step 650: Train an urban traffic travel time prediction network according to the second training sample, where the urban urban traffic travel time prediction network is used to predict the travel time of the entire travel path.

如图3所示,本发明以标准的长短时记忆(Long-Short term Memory,LSTM)单元为每一个时刻的信息处理单元来设计网络的主体结构。As shown in FIG. 3 , the present invention uses a standard Long-Short Term Memory (LSTM) unit as the information processing unit at each moment to design the main structure of the network.

对于一个训练样本F,首先将特征向量f1送入至第一个轨迹点对应的LSTM单元,该单元输出一个隐状态向量v1,进一步将隐状态向量v1输入至一个全连接神经网络(Fully-Connected Network,FCN)。记该全连接神经网络为FCN单元。FCN单元以隐状态向量v1为输入层,没有隐含层,输出层包含一个结点,输出层的激励函数为线性整流函数,即步骤所使用的ReLU。此时,FCN单元输出走完第一个轨迹片段的预测时间,记该为预测时间

Figure BDA0002673507330000241
接着,将特征向量f2和隐状态向量v1同时送入至第二个轨迹点对应的LSTM单元,该单元输出一个隐状态向量v2,进一步将隐状态向量v2输入至FCN单元,输出行驶完前两个片段的总的行驶时间,记该为预测时间
Figure BDA0002673507330000242
以此类推,最后将特征向量fn送入至第n个轨迹点对应的LSTM单元,通过FCN单元输出行驶完前n个片段的总的行驶时间,即整个轨迹的行驶时间,记该为预测时间
Figure BDA0002673507330000243
For a training sample F, the feature vector f 1 is first sent to the LSTM unit corresponding to the first trajectory point, which outputs a hidden state vector v 1 , and further inputs the hidden state vector v 1 to a fully connected neural network ( Fully-Connected Network, FCN). Denote the fully connected neural network as the FCN unit. The FCN unit takes the hidden state vector v1 as the input layer, there is no hidden layer, the output layer contains a node, and the excitation function of the output layer is a linear rectification function, that is, the ReLU used in the step. At this time, the FCN unit outputs the predicted time when the first trajectory segment is completed, which is recorded as the predicted time.
Figure BDA0002673507330000241
Next, the feature vector f 2 and the hidden state vector v 1 are simultaneously sent to the LSTM unit corresponding to the second trajectory point, the unit outputs a hidden state vector v 2 , and the hidden state vector v 2 is further input to the FCN unit, output The total driving time after driving the first two segments is recorded as the predicted time
Figure BDA0002673507330000242
By analogy, the feature vector f n is finally sent to the LSTM unit corresponding to the nth trajectory point, and the total travel time of the first n segments is output through the FCN unit, that is, the travel time of the entire trajectory, which is recorded as prediction. time
Figure BDA0002673507330000243

需要指出的是,上述处理过程可以适用于包含任意轨迹点个数的训练样本。本发明的实施例城市市内交通旅行时间预测网络该网络所能处理的轨迹点数按训练样本集中所有网格化轨迹TG所包含的最大轨迹点数来设计。It should be pointed out that the above processing process can be applied to training samples containing any number of trajectory points. The number of trajectory points that can be processed by the urban traffic travel time prediction network in the embodiment of the present invention is designed according to the maximum number of trajectory points contained in all gridded trajectories TG in the training sample set.

在上述处理过程中,按标准LSTM单元的计算流程,只需要确定LSTM单元的隐状态向量的维度即可确定整个网络的结构。在本发明中,隐状态向量的维度设定为特征向量f1,f2…,fn的维度的一半,即

Figure BDA0002673507330000244
其中[]代表取整运算。在这里,Q为步骤300中城市市内交通流量预测网络所输出的连续时间区间交通流量矩阵的个数。In the above processing process, according to the calculation process of the standard LSTM unit, only the dimension of the hidden state vector of the LSTM unit needs to be determined to determine the structure of the entire network. In the present invention, the dimension of the hidden state vector is set as half of the dimension of the feature vector f 1 , f 2 . . . , f n , that is,
Figure BDA0002673507330000244
Where [] represents the rounding operation. Here, Q is the number of continuous time interval traffic flow matrices output by the urban traffic flow prediction network in step 300 .

在整个城市市内交通旅行时间预测网络中,所有的LSTM单元的结构是相同的,同时参数也是相同的。另外,所有的FCN单元的结构是相同的,同时参数也是相同的。这一设计的优点在于,在应用该网络时,可以通过拷贝LSTM单元和FCN单元将网络进行延长,从而可以适用于任意长度的行驶轨迹。In the whole urban traffic travel time prediction network, the structure of all LSTM units is the same, and the parameters are also the same. In addition, the structure of all FCN units is the same, and the parameters are also the same. The advantage of this design is that when applying the network, the network can be extended by copying the LSTM unit and the FCN unit, so that it can be applied to driving trajectories of any length.

接着,定义损失函数。对于网格化轨迹TG的每一个轨迹点,全连接神经网络P均输出一个预测时间,因此需要定义损失函数。对于样本F所引起的损失,由以下损失函数来计算:Next, define the loss function. For each trajectory point of the gridded trajectory TG , the fully connected neural network P outputs a prediction time, so a loss function needs to be defined. The loss caused by sample F is calculated by the following loss function:

Figure BDA0002673507330000245
Figure BDA0002673507330000245

其中,loss(F)表示样本F所引起的损失,

Figure BDA0002673507330000251
为FCN单元输出的网格化轨迹TG的前i个片段的预测时间,
Figure BDA0002673507330000252
为样本F的已知的标记时间。在这里,对样本F,自然数i的取值范围为1到n之间的整数。Among them, loss(F) represents the loss caused by sample F,
Figure BDA0002673507330000251
is the predicted time of the first i segments of the gridded trajectory T G output by the FCN unit,
Figure BDA0002673507330000252
is the known marking time of sample F. Here, for the sample F, the value range of the natural number i is an integer between 1 and n.

最后,训练城市市内交通旅行时间预测网络。在本发明中,训练城市市内旅行时间预测网络时,采用标准的误差反向传播算法进行。在此过程中,在本发明实施例中,学习率大小设定为0.001,批量数据集的大小设定为64,每一个批量数据集一共训练20轮。Finally, train a travel time prediction network for intra-city traffic. In the present invention, the standard error back-propagation algorithm is used to train the intra-city travel time prediction network. During this process, in the embodiment of the present invention, the size of the learning rate is set to 0.001, the size of the batch data set is set to 64, and each batch data set is trained for a total of 20 rounds.

在步骤700中,基于所述城市市内交通流量预测网络和城市市内旅行时间预测网络,根据待测车辆的待测行驶路径,确定所述待测车辆行驶完所述待测路径所需要的旅行时间,具体包括:In step 700, based on the urban intra-city traffic flow prediction network and the urban intra-city travel time prediction network, and according to the to-be-tested travel path of the to-be-tested vehicle, determine the amount of time required for the tested vehicle to travel the to-be-tested path. Travel time, including:

步骤710:以所述待测车辆行驶的当前时刻为终点时间区间,计算前J个连续时间区间内的归一化浮点交通流量矩阵,并将各矩阵按时间顺序堆叠成三维张量:Step 710: Take the current time when the vehicle to be tested is traveling as the end time interval, calculate the normalized floating-point traffic flow matrix in the first J consecutive time intervals, and stack each matrix into a three-dimensional tensor in chronological order:

A=[Y1,Y2,…,YJ];A=[Y 1 ,Y 2 ,...,Y J ];

其中,A为L行M列J层的三维立体数据构成的三维张量,由以当前时间区间为终点的前J个连续时间区间内获得的归一化浮点交通流量矩阵按时间顺序堆叠而成,Y1为第前J-1个时间区间内获得的归一化浮点交通流量矩阵,Y2为第前J-2个时间区间内获得的归一化浮点交通流量矩阵,YJ为当前时间内获得的归一化浮点交通流量矩阵;L为矩形网格G在纬度方向的行数,M为矩形网格G在经度方向的列数。Among them, A is a three-dimensional tensor composed of three-dimensional stereo data of L rows, M columns, and J layers. The normalized floating-point traffic flow matrices obtained in the first J consecutive time intervals with the current time interval as the end point are stacked in chronological order. , Y 1 is the normalized floating-point traffic flow matrix obtained in the first J-1 time interval, Y 2 is the normalized floating-point traffic flow matrix obtained in the first J-2 time interval, Y J is the normalized floating-point traffic flow matrix obtained at the current time; L is the number of rows in the latitude direction of the rectangular grid G, and M is the number of columns in the longitude direction of the rectangular grid G.

步骤720:根据所述三维张量A及城市市内交通流量预测网络,预测未来连续Q个时间区间内的归一化浮点交通流量:B1,B2,…,BQStep 720: Predict the normalized floating-point traffic flow in consecutive Q time intervals in the future according to the three-dimensional tensor A and the urban traffic flow prediction network: B 1 , B 2 , . . . , B Q ;

其中,其中,B1为城市市内交通流量预测网络所预测的未来第一个时间区间内的归一化浮点交通流量;B2为该网络所预测的未来第二个时间区间内的归一化浮点交通流量;BQ为该网络所预测的未来第Q个时间区间内的归一化浮点交通流量。Among them, B 1 is the normalized floating-point traffic flow in the first time interval in the future predicted by the urban traffic flow prediction network; B 2 is the normalized traffic flow in the second time interval in the future predicted by the network Normalized floating-point traffic flow; B Q is the normalized floating-point traffic flow predicted by the network in the Qth time interval in the future.

步骤730:根据待测车辆的待测行驶路径的轨迹序列R确定对应的网格化轨迹RG、各轨迹点的特征向量;Step 730: Determine the corresponding gridded trajectory R G and the feature vector of each trajectory point according to the trajectory sequence R of the driving path to be tested of the vehicle to be tested;

轨迹序列R的样本特征B:B=(b1,b2,…,bn);Sample feature B of the trajectory sequence R: B=(b 1 ,b 2 ,...,b n );

其中,待测行驶路径R的样本特征B由特征向量序列b1,b2,…,bn组成;b1为网格化轨迹RG的第一个轨迹点的特征向量,b2为网格化轨迹RG的第二个轨迹点的特征向量,bn为网格化轨迹RG的第n个轨迹点的特征向量;自然数n为网格化轨迹RG所包含的轨迹点的个数;Among them, the sample feature B of the driving path R to be tested consists of a sequence of feature vectors b 1 , b 2 ,..., bn ; b 1 is the feature vector of the first track point of the gridded track R G , and b 2 is the grid The eigenvector of the second trajectory point of the gridded trajectory RG , b n is the eigenvector of the nth trajectory point of the gridded trajectory RG; the natural number n is the number of trajectory points contained in the gridded trajectory RG number;

待测车辆行驶路径R的网格化轨迹RG的第i个轨迹点的特征向量:The eigenvector of the i-th trajectory point of the gridded trajectory R G of the vehicle's driving path R:

Figure BDA0002673507330000261
Figure BDA0002673507330000261

其中,bi表示网格化轨迹RG的第i个轨迹点的特征向量,

Figure BDA0002673507330000262
Figure BDA0002673507330000263
分别表示网格化轨迹RG的第i个轨迹点的经度和纬度,设网格化轨迹RG的第i个轨迹点
Figure BDA0002673507330000264
位于矩形网格G的第ri行和第ci列所在的格子区域。在这里,自然数i的取值范围为1到n之间的整数;自然数ri的取值范围为1至L之间的整数,自然数ci的取值范围为1至M之间的整数;
Figure BDA0002673507330000265
为当前时刻城市市内交通流量预测网络所预测的第一个时间区间内的浮点归一化交通流量矩B1的第ri行和第ci列的元素,
Figure BDA0002673507330000266
为当前时刻城市市内交通流量预测网络所预测的第二个时间区间内的浮点归一化交通流量矩阵B2的第ri行和第ci列的元素,
Figure BDA0002673507330000267
为当前时刻城市市内交通流量预测网络所预测的第Q个时间区间内的浮点归一化交通流量矩阵BQ的第ri行和第ci列的元素;ri和ci分别为网格化轨迹RG的第i个轨迹点
Figure BDA0002673507330000268
位于矩形网格的行序号和列序号;自然数Q为城市市内交通流量预测网络所预测的时间区间的个数,上标T表示向量转置;Among them, b i represents the eigenvector of the i-th trajectory point of the gridded trajectory R G ,
Figure BDA0002673507330000262
and
Figure BDA0002673507330000263
respectively represent the longitude and latitude of the ith track point of the gridded track R G , and set the ith track point of the grid track RG
Figure BDA0002673507330000264
It is located in the grid area where the ri- th row and the ci- th column of the rectangular grid G are located. Here, the value range of the natural number i is an integer between 1 and n; the value range of the natural number ri is an integer between 1 and L, and the value range of the natural number c i is an integer between 1 and M;
Figure BDA0002673507330000265
is the element of the r i row and c i column of the floating point normalized traffic flow moment B 1 in the first time interval predicted by the urban traffic flow prediction network at the current moment,
Figure BDA0002673507330000266
is the element of row ri and column ci of the floating-point normalized traffic flow matrix B 2 in the second time interval predicted by the urban traffic flow prediction network at the current moment,
Figure BDA0002673507330000267
is the element of the rith row and cith column of the floating-point normalized traffic flow matrix B Q in the Qth time interval predicted by the urban traffic flow prediction network at the current moment; ri and ci are respectively The ith trajectory point of the gridded trajectory R G
Figure BDA0002673507330000268
The row number and column number located in the rectangular grid; the natural number Q is the number of time intervals predicted by the urban traffic flow prediction network, and the superscript T represents the vector transposition;

步骤740:根据所述将网格化轨迹RG的各轨迹点的特征向量及城市市内旅行时间预测网络,确定行驶完待测车辆的待测行驶路径R的时间。Step 740 : According to the feature vector of each track point of the gridded track R G and the urban travel time prediction network, determine the time when the vehicle to be tested is driven on the travel path R to be tested.

具体地,将网格化轨迹RG的各轨迹点的特征向量b1,b2,…,bn顺序输入至对应的LSTM单元,运行城市市内旅行时间预测网络。由最后一个全连接神经网络FCN单元输出行驶完待预测车辆行驶路径R的时间,此即为城市市内交通流量预测网络所预测的时间。Specifically, the feature vectors b 1 , b 2 , . The last fully connected neural network FCN unit outputs the time when the vehicle to be predicted travels the route R, which is the time predicted by the urban traffic flow prediction network.

本发明城市市内交通旅行时间的预测方法可以预测给定路径的城市市内交通旅行时间,主要体现在以下几个方面:The prediction method of the urban traffic travel time of the present invention can predict the urban traffic travel time of a given route, which is mainly reflected in the following aspects:

1)本发明需要训练了两个网络,一个网络进行实时路况信息预测,另外一个网络利用前一个网络的预测结果来进行给定路径的城市市内交通旅行时间预测。这种框架设计的可以考虑到影响城市市内交通旅行时间的实时路况。1) The present invention needs to train two networks, one network predicts real-time road condition information, and the other network uses the prediction result of the previous network to predict the urban traffic travel time of a given route. This framework is designed to take into account the real-time traffic conditions that affect the travel time of intra-city traffic.

2)使用了深度学习的方法。其出色的非线性拟合能力已经在很多机器学习领域中得到了证明。其在城市市内交通旅行时间预测上能比传统的方法取得更好的效果;2) The method of deep learning is used. Its excellent nonlinear fitting ability has been proven in many machine learning fields. It can achieve better results than traditional methods in urban traffic travel time prediction;

3)虽然本以实时交通流量信息作为影响城市市内交通旅行时间的额外因素的代表,但是本发明的框架可以轻松的应用到考虑其他因素情况上,只需要对网络结构进行部分修改。如要考虑动态变化的天气信息对城市市内交通旅行时间的影响时,只需要将城市市内交通流量预测网络换成实时天气预测网络即可。这增加了本发明的灵活性。3) Although the real-time traffic flow information is used as the representative of the additional factors affecting the traffic travel time in the city, the framework of the present invention can be easily applied to other factors, and only needs to partially modify the network structure. To consider the impact of dynamically changing weather information on urban traffic travel time, it is only necessary to replace the urban traffic flow forecast network with a real-time weather forecast network. This increases the flexibility of the present invention.

下面以谋市出租车轨迹数据上进行了实验。为了验证本发明的有效性,图给出了两条轨迹。其中,行驶路径R1的轨迹序列下:The following experiments are carried out on the taxi trajectory data of Yimou City. In order to verify the effectiveness of the present invention, two trajectories are shown in the figure. Among them, under the trajectory sequence of the travel path R 1 :

([104.048087,30.67257],[104.048688,30.667996],[104.046058,30.663864],[104.045486,30.663977],[104.041591,30.665894],[104.041185,30.665958],[104.045532,30.663658],[104.045747,30.660006],[104.046027,30.656351],[104.049302,30.653285],[104.052818,30.652634],[104.05679,30.649528],[104.060861,30.647632],[104.065253,30.647387],[104.068546,30.646833],[104.070377,30.646512],[104.074429,30.646343],[104.07896,30.645559],[104.082964,30.643429],[104.086483,30.642236],[104.088603,30.639872],[104.087352,30.63816],[104.08751,30.638336],[104.088682,30.639902],[104.088278,30.640154],[104.087855,30.639184],[104.092022,30.641449],[104.094963,30.638586],[104.094659,30.637947],[104.09227,30.637359],[104.089681,30.640921],[104.086951,30.638889],[104.08346,30.637202],[104.07876,30.634991],[104.074695,30.633712],[104.069852,30.633636],[104.064814,30.633495],[104.060504,30.633411],[104.055255,30.63328],[104.050522,30.63545],[104.04863,30.63635],[104.046449,30.637371],[104.042775,30.636046],[104.040166,30.631991],[104.037331,30.630241],[104.033926,30.633511],[104.030826,30.636792],[104.028128,30.639455],[104.025346,30.642233],[104.02234,30.641511],[104.018598,30.638672],[104.013982,30.63651],[104.01379,30.636413],[104.009396,30.634587],[104.006292,30.633066],[104.002995,30.631547],[103.999547,30.629926],[103.994709,30.627643],[103.990154,30.625509],[103.985626,30.623449],[103.981084,30.621406],[103.977224,30.61967],[103.975757,30.619052],[103.972676,30.617613],[103.970359,30.616433],[103.975089,30.618571],[103.979211,30.620433])。([104.048087,30.67257],[104.048688,30.667996],[104.046058,30.663864],[104.045486,30.663977],[104.041591,30.665894],[104.041185,30.665958],[104.045532,30.663658],[104.045747,30.660006],[ 104.046027,30.656351],[104.049302,30.653285],[104.052818,30.652634],[104.05679,30.649528],[104.060861,30.647632],[104.065253,30.647387],[104.068546,30.646833],[104.070377,30.646512],[104.074429, 30.646343],[104.07896,30.645559],[104.082964,30.643429],[104.086483,30.642236],[104.088603,30.639872],[104.087352,30.63816],[104.08751,30.638336],[104.088682,30.639902],[104.088278,30.640154] ,[104.087855,30.639184],[104.092022,30.641449],[104.094963,30.638586],[104.094659,30.637947],[104.09227,30.637359],[104.089681,30.640921],[104.086951,30.638889],[104.08346,30.637202],[ 104.07876,30.634991],[104.074695,30.633712],[104.069852,30.633636],[104.064814,30.633495],[104.060504,30.633411],[104.055255,30.63328],[104.050522,30.63545],[104.04863,30.63635],[104.046449, 30.637371],[104.042775,30.636046],[104.040166,30.631991] ,[104.037331,30.630241],[104.033926,30.633511],[104.030826,30.636792],[104.028128,30.639455],[104.025346,30.642233],[104.02234,30.641511],[104.018598,30.638672],[104.013982,30.63651],[ 104.01379,30.636413],[104.009396,30.634587],[104.006292,30.633066],[104.002995,30.631547],[103.999547,30.629926],[103.994709,30.627643],[103.990154,30.625509],[103.985626,30.623449],[103.981084, 30.621406], [103.97575757,30.619052], [103.972676,30.617613], [103.970359, 30.616433], [103.979211,33.3.33.3.33.333333]

行驶路径R2的轨迹序列如下:The trajectory sequence of the travel path R 2 is as follows:

([104.107954,30.694667],[104.107533,30.692622],[104.106701,30.6916],[104.105737,30.69041],[104.104835,30.689299],[104.103889,30.688151],[104.102697,30.686618],[104.102828,30.68506],[104.103921,30.683158],[104.104684,30.681414],[104.10577,30.679865],[104.107494,30.677033],[104.108455,30.675276],[104.109234,30.673234],[104.110213,30.671347],[104.110638,30.670777],[104.111095,30.668693],[104.111861,30.666929],[104.112352,30.66585],[104.113085,30.663795],[104.113307,30.663361],[104.114126,30.661514],[104.114649,30.659982],[104.1149,30.657735],[104.114941,30.656178],[104.114834,30.654379],[104.114826,30.652352],[104.115693,30.650939],[104.117447,30.650225],[104.116893,30.648046],[104.118718,30.648134],[104.118882,30.64808],[104.118639,30.647728],[104.117693,30.647957],[104.116512,30.647634],[104.116169,30.646546],[104.115794,30.645291],[104.11504,30.643075],[104.11424,30.641665],[104.111912,30.642674],[104.110404,30.64393],[104.108867,30.641481],[104.107777,30.63992],[104.106731,30.63847],[104.105625,30.636528],[104.104823,30.635327],[104.104013,30.634062],[104.102934,30.632328],[104.101653,30.630342],[104.100493,30.628484],[104.100305,30.62732],[104.099455,30.626544],[104.098251,30.624969],[104.097108,30.623899],[104.095813,30.622056],[104.094057,30.621055],[104.091939,30.620839],[104.089401,30.620788],[104.087057,30.62065],[104.085334,30.620683],[104.083797,30.620698],[104.081851,30.620675],[104.080276,30.620622],[104.077718,30.620695],[104.076107,30.620588],[104.074552,30.620557],[104.07202,30.620715],[104.071711,30.622295],[104.071833,30.624357],[104.072982,30.625105],[104.073218,30.625109],[104.074141,30.625175],[104.076509,30.62515],[104.076778,30.622888],[104.076874,30.621773],[104.076716,30.624068],[104.0766,30.625956],[104.076441,30.628046],[104.076338,30.630266],[104.076184,30.632202],[104.076129,30.633659],[104.076051,30.635315],[104.075996,30.637499])。([104.107954,30.694667],[104.107533,30.692622],[104.106701,30.6916],[104.105737,30.69041],[104.104835,30.689299],[104.103889,30.688151],[104.102697,30.686618],[104.102828,30.68506],[ 104.103921,30.683158],[104.104684,30.681414],[104.10577,30.679865],[104.107494,30.677033],[104.108455,30.675276],[104.109234,30.673234],[104.110213,30.671347],[104.110638,30.670777],[104.111095, 30.668693],[104.111861,30.666929],[104.112352,30.66585],[104.113085,30.663795],[104.113307,30.663361],[104.114126,30.661514],[104.114649,30.659982],[104.1149,30.657735],[104.114941,30.656178] ,[104.114834,30.654379],[104.114826,30.652352],[104.115693,30.650939],[104.117447,30.650225],[104.116893,30.648046],[104.118718,30.648134],[104.118882,30.64808],[104.118639,30.647728],[ 104.117693,30.647957],[104.116512,30.647634],[104.116169,30.646546],[104.115794,30.645291],[104.11504,30.643075],[104.11424,30.641665],[104.111912,30.642674],[104.110404,30.64393],[104.108867, 30.641481],[104.107777,30.63992],[104.106731,30.63847],[ 104.105625,30.636528],[104.104823,30.635327],[104.104013,30.634062],[104.102934,30.632328],[104.101653,30.630342],[104.100493,30.628484],[104.100305,30.62732],[104.099455,30.626544],[104.098251, 30.624969],[104.097108,30.623899],[104.095813,30.622056],[104.094057,30.621055],[104.091939,30.620839],[104.089401,30.620788],[104.087057,30.62065],[104.085334,30.620683],[104.083797,30.620698] ,[104.081851,30.620675],[104.080276,30.620622],[104.077718,30.620695],[104.076107,30.620588],[104.074552,30.620557],[104.07202,30.620715],[104.071711,30.622295],[104.071833,30.624357],[ 104.072982,30.625105],[104.073218,30.625109],[104.074141,30.625175],[104.076509,30.62515],[104.076778,30.622888],[104.076874,30.621773],[104.076716,30.624068],[104.0766,30.625956],[104.076441, 30.628046],[104.076338,30.630266],[104.076184,30.632202],[104.076129,30.633659],[104.076051,30.635315],[104.075996,30.637499]).

行驶路径R1于某日12点01分开始的轨迹数据,行驶路径R2为某日18点13分开始的轨迹数据,行驶完红色轨迹的真实时间3481秒,行驶完蓝色轨迹的真实时间为2550秒。利用本发明方法,行驶完红色轨迹的预测时间为2975秒,行驶完蓝色轨迹的预测时间为2861秒。考虑到路况的复杂性、不确定性和红绿灯等因素,参考目前业界的整体技术水平,这一结果的精度是可以接收的。The trajectory data of the driving route R 1 starting at 12:01 on a certain day, the driving route R 2 is the trajectory data starting at 18:13 on a certain day, the real time of driving the red track is 3481 seconds, and the real time of driving the blue track is 2550 seconds. Using the method of the present invention, the predicted time after driving the red track is 2975 seconds, and the predicted time after driving the blue track is 2861 seconds. Considering the complexity, uncertainty, traffic lights and other factors of road conditions, and referring to the current overall technical level of the industry, the accuracy of this result is acceptable.

实验表明,根据本发明的方法可以有效预测给定路径的行驶时间。本发明考虑到了实时路况对旅行时间的影响,并利用深度学习的方法构建预测模型,获得了较高精度的预测结果。Experiments show that the method according to the present invention can effectively predict the travel time of a given route. The present invention takes into account the influence of real-time road conditions on travel time, and uses a deep learning method to construct a prediction model, thereby obtaining a higher-precision prediction result.

优选地,本发明还提供一种城市市内交通旅行时间预测系统,可提高城市市内交通旅行时间预测的准确度。Preferably, the present invention also provides an urban traffic travel time prediction system, which can improve the accuracy of urban traffic travel time prediction.

如图4所示,本发明城市市内交通旅行时间预测系统包括网格划分单元1、归一化处理单元2、第一训练单元3、简化处理单元4、特征确定单元5、第二训练单元6及时间预测单元7。As shown in FIG. 4 , the urban traffic travel time prediction system of the present invention includes a grid division unit 1, a normalization processing unit 2, a first training unit 3, a simplified processing unit 4, a feature determination unit 5, and a second training unit 6 and temporal prediction unit 7.

具体地,所述网格划分单元1用于将待测城市划分为矩形网格;Specifically, the grid dividing unit 1 is used to divide the city to be tested into rectangular grids;

所述归一化处理单元2用于基于所述矩形网格,根据历史交通流量数据构建归一化浮点交通流量矩阵;The normalization processing unit 2 is configured to construct a normalized floating-point traffic flow matrix according to the historical traffic flow data based on the rectangular grid;

所述第一训练单元3用于根据所述归一化浮点交通流量矩阵,训练城市市内交通流量预测网络;The first training unit 3 is used for training the urban traffic flow prediction network according to the normalized floating-point traffic flow matrix;

所述简化处理单元4用于根据所述矩形网格对车辆行驶路径的轨迹点序列进行简化处理,得到车辆行驶路径的网格化轨迹;The simplification processing unit 4 is configured to perform simplified processing on the trajectory point sequence of the vehicle driving path according to the rectangular grid to obtain the gridded trajectory of the vehicle driving path;

所述特征确定单元5用于根据所述归一化浮点交通流量矩阵及车辆行驶路径的网格化轨迹,确定网格化轨迹中各轨迹点的特征向量;The feature determination unit 5 is configured to determine the feature vector of each track point in the gridded track according to the normalized floating-point traffic flow matrix and the gridded track of the vehicle travel path;

所述第二训练单元6用于根据所述网格化轨迹中各轨迹点的特征向量,训练城市市内交通旅行时间预测网络;The second training unit 6 is used to train the urban traffic travel time prediction network according to the feature vector of each trajectory point in the gridded trajectory;

所述时间预测单元7用于基于所述城市市内交通流量预测网络和城市市内旅行时间预测网络,根据待测车辆的待测行驶路径,确定所述待测车辆行驶完所述待测路径所需要的旅行时间。The time prediction unit 7 is configured to determine, based on the urban traffic flow prediction network and the urban travel time prediction network, and according to the traveling path of the vehicle to be tested, that the vehicle to be tested has traveled the path to be tested. required travel time.

此外,本发明还提供一种城市市内交通旅行时间预测系统,包括:In addition, the present invention also provides an urban traffic travel time prediction system, including:

处理器;以及processor; and

被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行以下操作:memory arranged to store computer-executable instructions which, when executed, cause the processor to:

将待测城市划分为矩形网格;Divide the city to be tested into a rectangular grid;

基于所述矩形网格,根据历史交通流量数据构建归一化浮点交通流量矩阵;Based on the rectangular grid, construct a normalized floating-point traffic flow matrix according to historical traffic flow data;

根据所述归一化浮点交通流量矩阵,训练城市市内交通流量预测网络;According to the normalized floating-point traffic flow matrix, train the urban traffic flow prediction network;

根据所述矩形网格对车辆行驶路径的轨迹点序列进行简化处理,得到车辆行驶路径的网格化轨迹;Simplify the trajectory point sequence of the vehicle's driving path according to the rectangular grid, and obtain the gridded trajectory of the vehicle's driving path;

根据所述归一化浮点交通流量矩阵及车辆行驶路径的网格化轨迹,确定网格化轨迹中各轨迹点的特征向量;According to the normalized floating-point traffic flow matrix and the gridded trajectory of the vehicle travel path, determine the eigenvectors of each trajectory point in the gridded trajectory;

根据所述网格化轨迹中各轨迹点的特征向量,训练城市市内交通旅行时间预测网络;According to the feature vector of each trajectory point in the gridded trajectory, train the urban traffic travel time prediction network;

基于所述城市市内交通流量预测网络和城市市内旅行时间预测网络,根据待测车辆的待测行驶路径,确定所述待测车辆行驶完所述待测路径所需要的旅行时间。Based on the urban traffic flow prediction network and the urban travel time prediction network, and according to the travel path of the vehicle to be tested, the travel time required for the vehicle to be tested to complete the path to be tested is determined.

此外,本发明还提供了一种计算机可读存储介质,所述计算机可读存储介质存储一个或多个程序,所述一个或多个程序当被包括多个应用程序的电子设备执行时,使得所述电子设备执行以下操作:In addition, the present invention also provides a computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, make the one or more programs The electronic device performs the following operations:

将待测城市划分为矩形网格;Divide the city to be tested into a rectangular grid;

基于所述矩形网格,根据历史交通流量数据构建归一化浮点交通流量矩阵;Based on the rectangular grid, construct a normalized floating-point traffic flow matrix according to historical traffic flow data;

根据所述归一化浮点交通流量矩阵,训练城市市内交通流量预测网络;According to the normalized floating-point traffic flow matrix, train the urban traffic flow prediction network;

根据所述矩形网格对车辆行驶路径的轨迹点序列进行简化处理,得到车辆行驶路径的网格化轨迹;Simplify the trajectory point sequence of the vehicle's driving path according to the rectangular grid, and obtain the gridded trajectory of the vehicle's driving path;

根据所述归一化浮点交通流量矩阵及车辆行驶路径的网格化轨迹,确定网格化轨迹中各轨迹点的特征向量;According to the normalized floating-point traffic flow matrix and the gridded trajectory of the vehicle travel path, determine the eigenvectors of each trajectory point in the gridded trajectory;

根据所述网格化轨迹中各轨迹点的特征向量,训练城市市内交通旅行时间预测网络;According to the feature vector of each trajectory point in the gridded trajectory, train the urban traffic travel time prediction network;

基于所述城市市内交通流量预测网络和城市市内旅行时间预测网络,根据待测车辆的待测行驶路径,确定所述待测车辆行驶完所述待测路径所需要的旅行时间。Based on the urban traffic flow prediction network and the urban travel time prediction network, and according to the travel path of the vehicle to be tested, the travel time required for the vehicle to be tested to complete the path to be tested is determined.

相对于现有技术,本发明城市市内交通旅行时间预测系统、计算机可读存储介质与上述城市市内交通旅行时间的预测方法的有益效果相同,在此不再赘述。Compared with the prior art, the urban traffic travel time prediction system and the computer-readable storage medium of the present invention have the same beneficial effects as the above-mentioned urban traffic travel time prediction method, which will not be repeated here.

至此,已经结合附图所示的优选实施方式描述了本发明的技术方案,但是,本领域技术人员容易理解的是,本发明的保护范围显然不局限于这些具体实施方式。在不偏离本发明的原理的前提下,本领域技术人员可以对相关技术特征作出等同的更改或替换,这些更改或替换之后的技术方案都将落入本发明的保护范围之内。So far, the technical solutions of the present invention have been described with reference to the preferred embodiments shown in the accompanying drawings, however, those skilled in the art can easily understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims (5)

1. A prediction method for urban traffic travel time is characterized by comprising the following steps:
dividing a city to be tested into rectangular grids;
based on the rectangular grid, a normalized floating point traffic flow matrix is constructed according to historical traffic flow data;
training an urban traffic flow prediction network according to the normalized floating point traffic flow matrix; the method specifically comprises the following steps:
according to the normalized floating point traffic flow matrix, constructing a corresponding first training sample:
Pt=(At;Bt),
wherein t represents a time interval number, PtRepresenting a first training sample; a. thetRepresenting a first training sample PtThe sample characteristic is a three-dimensional tensor of L rows, M columns and J layers, and a normalized traffic flow matrix obtained in the first J continuous time intervals with the t-th time interval as an end point is piled in a time sequenceAnd (3) stacking: a. thet=[Yt-J+1,Yt-J+2,…,Yt-1,Yt];
BtRepresenting a first training sample PtThe sample mark is a three-dimensional tensor of an L-row M-column Q layer, and is formed by stacking normalized traffic flow matrixes obtained in Q continuous time intervals with the t +1 th time interval as a starting point according to a time sequence: b ist=[Yt+1,Yt+2,…,Yt+Q];
Wherein, Yt-J+1Is a normalized floating point traffic flow matrix, Y, obtained in the t-J +1 time intervaltFor the normalized floating-point traffic flow matrix, Y, obtained in the t-th time intervalt+QObtaining a normalized floating point traffic flow matrix in the t + Q time intervals;
training an urban traffic flow prediction network according to the first training sample; the urban traffic flow prediction network is used for predicting the normalized floating point traffic flow of a rectangular grid G in Q continuous time intervals;
simplifying the track point sequence of the vehicle running path according to the rectangular grid to obtain a gridded track of the vehicle running path; the method specifically comprises the following steps:
each vehicle driving path is described by a track point sequence, and each track point comprises a longitude coordinate and a latitude coordinate of the track point;
for a given vehicle travel path, the corresponding trajectory sequence is T, which is described by N trajectory points: t { (x)1,y1),(x2,y2),…,(xN,yN)};
Wherein x is1And y1Respectively representing the longitude and latitude, x, of the first trace pointNAnd yNRespectively representing the longitude and the latitude of the Nth track point;
according to the rectangular grid G, dividing N track points of the track sequence T into different segments in sequence, and enabling the track points in each segment to be located in the same grid area of the rectangular grid G:
Figure FDA0003217467490000021
wherein, let the trajectory T be divided into n segments, the first segment containing the point (x) from the first trajectory1,y1) To d1One track point
Figure FDA0003217467490000022
The second fragment comprises the second fragment from1+1 track points
Figure FDA0003217467490000023
To d2One track point
Figure FDA0003217467490000024
By analogy, the nth segment contains the segment from dn-1+1 track points
Figure FDA0003217467490000025
To the Nth track point (x)N,yN) And | represents a fragment space symbol; d1、d2、dn-1N is a natural number;
calculating the average value of the longitude and the latitude of the track points in the same segment to obtain a gridded track TG
Figure FDA0003217467490000026
Wherein,
Figure FDA0003217467490000027
represents the average of the longitudes of track points belonging to the ith segment,
Figure FDA0003217467490000028
mean value, x, representing the latitude of a tracing point belonging to the ith segmentjAnd yjAre respectively asLongitude and latitude coordinates, when i is 1, d01 is ═ 1; when i is n, dn=N;
Figure FDA0003217467490000029
Determining the characteristic vector of each track point in the gridding track according to the normalized floating point traffic flow matrix and the gridding track of the vehicle running path; the method specifically comprises the following steps:
taking out continuous Q normalized floating point traffic flow matrixes Y from the normalized floating point traffic flow matrixp+1,Yp+2,…,Yp+Q(ii) a Wherein p is the first track point (x) of the vehicle driving path T1,y1) The sequence number of the time interval to which the time belongs in the training time interval;
according to the gridding track TGThe ith track point of
Figure FDA0003217467490000031
R is located at rectangular grid GiRow and ciTaking out the normalized floating point traffic flow matrix Y from the grid area where the row is locatedp+1,Yp+2,…,Yp+QMiddle riRow and ciElements of the column:
Figure FDA0003217467490000032
wherein,
Figure FDA0003217467490000033
for normalizing floating-point traffic flow matrix Yp+QR ofiRow and ciElements of a column; r isiAnd ciRespectively, a gridded track TGThe ith track point of
Figure FDA0003217467490000034
The row serial numbers and the column serial numbers of the rectangular grids;
constructing a gridded trajectory TGCharacteristic vector f of ith track pointi
Figure FDA0003217467490000035
Wherein n is a gridding track TGThe number of the track points; superscript T represents vector transposition;
training a prediction network of urban traffic travel time according to the feature vectors of all track points in the gridding track; the method specifically comprises the following steps:
acquiring the recording time o of each track point in the track sequence T of the vehicle running path1,o2,…,oN(ii) a Wherein o isNRecording time of the Nth track point;
according to the rectangular grid G, dividing each recording time into different segments in sequence, and enabling the recording time in each segment to be located in the same grid area of the rectangular grid G:
Figure FDA0003217467490000036
wherein it is provided that the recording time is divided into n segments, the first segment containing the time from the first recording time o1To d1A recording time
Figure FDA0003217467490000037
The second fragment comprises the second fragment from1+1 recording time
Figure FDA0003217467490000038
To d2A recording time
Figure FDA0003217467490000041
By analogy, the nth segment contains the segment from dn-1+1 recording time
Figure FDA0003217467490000042
To the Nth recording time oNAnd | represents a fragment space symbol; d1、d2、dn-1N is a natural number | | | represents a fragment space character, d1、d2、dn-1N is a natural number;
calculating the driving time required by driving the current section i:
Figure FDA0003217467490000043
wherein,
Figure FDA0003217467490000044
for the time of the i-th segment, corresponding to the feature vector fiThe marking time of (1); i. j, di、di-1Are all natural numbers, and when i is equal to 1, d01 is ═ 1; when i is n, dn+1=N;
And constructing a second training sample according to the feature vector and the driving time of each segment after driving:
Figure FDA0003217467490000045
where F represents the second training sample, the sequence of feature vectors F1,f2…,fnFor the sample characteristics of the second training sample F, time sequence
Figure FDA0003217467490000046
Labeling the sample of the second training sample F; f. ofnThe characteristic vector of the nth track point of the gridding track of the vehicle running path is obtained;
Figure FDA0003217467490000047
to correspond to the feature vector fnThe marking time of (1);
training an urban traffic travel time prediction network according to the second training sample, wherein the urban traffic travel time prediction network is used for predicting the travel time of the whole travel path;
determining the travel time required by the vehicle to be tested to finish running the path to be tested according to the running path to be tested of the vehicle to be tested on the basis of the urban traffic flow prediction network and the urban travel time prediction network; the method specifically comprises the following steps:
calculating normalized floating point traffic flow matrixes in the first J continuous time intervals by taking the current running time of the vehicle to be detected as a terminal time interval, and stacking the matrixes into a three-dimensional tensor according to a time sequence:
A=[Y1,Y2,…,YJ];
a is a three-dimensional tensor formed by three-dimensional stereo data of L rows, M columns and J layers, and is formed by stacking normalized floating point traffic flow matrixes obtained in the first J continuous time intervals with the current time interval as an end point according to a time sequence, and Y is1For the normalized floating point traffic flow matrix, Y, obtained in the first J-1 time interval2For the normalized floating point traffic flow matrix, Y, obtained in the first J-2 time intervalsJObtaining a normalized floating point traffic flow matrix in the current time; l is the number of rows of the rectangular grid G in the latitude direction, and M is the number of columns of the rectangular grid G in the longitude direction;
according to the three-dimensional tensor A and an urban traffic flow prediction network, predicting normalized floating point traffic flow in Q time intervals in future: b is1,B2,…,BQ
Wherein, BQPredicting the normalized floating point traffic flow in the future Q-th time interval predicted by the network for the urban traffic flow;
determining a corresponding gridding track R according to a track sequence R of a running path to be tested of a vehicle to be testedGFeature vectors of the track points;
sample feature B of trace sequence R: b ═ B1,b2,…,bn);
Wherein, the sample characteristic B of the running path R to be measured is composed of a characteristic vector sequence B1,b2,…,bnComposition is carried out; b1Is a gridded track RGThe feature vector of the first trace point of (b)nIs a gridded track RGThe feature vector of the nth trace point; n is a gridded locus RGThe number of the contained track points;
gridding track R of vehicle running path R to be testedGThe feature vector of the ith trace point of (1):
Figure FDA0003217467490000051
wherein, biRepresenting a gridded footprint RGThe feature vector of the ith trace point of (a),
Figure FDA0003217467490000052
and
Figure FDA0003217467490000053
respectively represent gridded traces RGLongitude and latitude of the ith trace point,
Figure FDA0003217467490000054
floating point normalized traffic flow moment B in the first time interval predicted by urban traffic flow prediction network at present moment1R ofiRow and ciThe elements of the column are,
Figure FDA0003217467490000055
a floating point normalized traffic flow matrix B in a second time interval predicted by the urban traffic flow prediction network at the current moment2R ofiRow and ciThe elements of the column are,
Figure FDA0003217467490000056
floating point normalization traffic flow matrix B in Q time interval predicted by urban traffic flow prediction network at present momentQR ofiRow and ciElements of a column; r isiAnd ciRespectively, a gridded trace RGThe ith track point of
Figure FDA0003217467490000061
The row serial numbers and the column serial numbers of the rectangular grids; the natural number Q is the number of time intervals predicted by the urban traffic flow prediction network, and the superscript T represents vector transposition;
from said-gridded footprint RGAnd determining the time of the running path R to be tested of the vehicle to be tested after the vehicle to be tested runs.
2. The method for predicting urban traffic travel time according to claim 1, wherein the constructing a normalized floating-point traffic flow matrix according to historical traffic flow data based on the rectangular grid specifically comprises:
will select history ndDays are training periods, each day of which is divided into K with fixed time intervalsdA time interval; the total number of consecutive time intervals into which the training period is divided is K: k is nd×Kd
Counting the track data of the vehicles entering the networking system in the rectangular grid G in the training period, wherein the longitude position, the latitude position and the time information of the vehicles are recorded in each track data;
Figure FDA0003217467490000062
representing the number of vehicles appearing in the ith row and jth column grid sub-area of the rectangular grid G in the tth time interval;
traversing all time intervals in the training period, counting the vehicle flow entering the networking system in the same time interval to obtain K traffic flow matrixes which are respectively marked as X1,X2,...,Xk,...,XK;XkA traffic flow matrix in a K-th time interval, K being 1, 2.... K;
according to the following formula, carrying out normalization floating point processing on each traffic flow matrix to obtain a corresponding normalization floating point traffic flow matrix:
Figure FDA0003217467490000063
wherein,
Figure FDA0003217467490000071
for the normalized floating point traffic flow matrix Y in the t-th time intervaltRow i and column j elements of (1), x0Represents the maximum of all elements in the K traffic flow matrices.
3. A system for predicting urban traffic travel time, the system comprising:
the grid dividing unit is used for dividing the city to be detected into rectangular grids;
the normalization processing unit is used for constructing a normalization floating point traffic flow matrix according to historical traffic flow data based on the rectangular grid;
the first training unit is used for training an urban traffic flow prediction network according to the normalized floating point traffic flow matrix; the method specifically comprises the following steps:
according to the normalized floating point traffic flow matrix, constructing a corresponding first training sample:
Pt=(At;Bt),
wherein t represents a time interval number, PtRepresenting a first training sample; a. thetRepresenting a first training sample PtThe sample characteristic is a three-dimensional tensor of L rows, M columns and J layers, and is formed by stacking normalized traffic flow matrixes obtained in the first J continuous time intervals with the t-th time interval as an end point according to the time sequence: a. thet=[Yt-J+1,Yt-J+2,…,Yt-1,Yt];
BtRepresenting a first training sample PtIs a three-dimensional tensor of L rows, M columns and Q layers, and is marked by the t +1 thThe normalized traffic flow matrixes obtained in Q continuous time intervals with the time intervals as the starting points are stacked according to the time sequence: b ist=[Yt+1,Yt+2,…,Yt+Q];
Wherein, Yt-J+1Is a normalized floating point traffic flow matrix, Y, obtained in the t-J +1 time intervaltFor the normalized floating-point traffic flow matrix, Y, obtained in the t-th time intervalt+QObtaining a normalized floating point traffic flow matrix in the t + Q time intervals;
training an urban traffic flow prediction network according to the first training sample; the urban traffic flow prediction network is used for predicting the normalized floating point traffic flow of a rectangular grid G in Q continuous time intervals;
the simplification processing unit is used for simplifying the track point sequence of the vehicle driving path according to the rectangular grid to obtain a gridded track of the vehicle driving path; the method specifically comprises the following steps:
each vehicle driving path is described by a track point sequence, and each track point comprises a longitude coordinate and a latitude coordinate of the track point;
for a given vehicle travel path, the corresponding trajectory sequence is T, which is described by N trajectory points: t { (x)1,y1),(x2,y2),…,(xN,yN)};
Wherein x is1And y1Respectively representing the longitude and latitude, x, of the first trace pointNAnd yNRespectively representing the longitude and the latitude of the Nth track point;
according to the rectangular grid G, dividing N track points of the track sequence T into different segments in sequence, and enabling the track points in each segment to be located in the same grid area of the rectangular grid G:
Figure FDA0003217467490000081
wherein it is assumed that the trajectory T will be divided into n segments, the firstA segment contains a point (x) from the first track1,y1) To d1One track point
Figure FDA0003217467490000082
The second fragment comprises the second fragment from1+1 track points
Figure FDA0003217467490000083
To d2One track point
Figure FDA0003217467490000084
By analogy, the nth segment contains the segment from dn-1+1 track points
Figure FDA0003217467490000085
To the Nth track point (x)N,yN) And | represents a fragment space symbol; d1、d2、dn-1N is a natural number;
calculating the average value of the longitude and the latitude of the track points in the same segment to obtain a gridded track TG
Figure FDA0003217467490000091
Wherein,
Figure FDA0003217467490000092
represents the average of the longitudes of track points belonging to the ith segment,
Figure FDA0003217467490000093
mean value, x, representing the latitude of a tracing point belonging to the ith segmentjAnd yjLongitude coordinate and latitude coordinate, when i is 1, d01 is ═ 1; when i is n, dn=N;
Figure FDA0003217467490000094
The characteristic determining unit is used for determining the characteristic vector of each track point in the gridding track according to the normalized floating point traffic flow matrix and the gridding track of the vehicle running path; the method specifically comprises the following steps:
taking out continuous Q normalized floating point traffic flow matrixes Y from the normalized floating point traffic flow matrixp+1,Yp+2,…,Yp+Q(ii) a Wherein p is the first track point (x) of the vehicle driving path T1,y1) The sequence number of the time interval to which the time belongs in the training time interval;
according to the gridding track TGThe ith track point of
Figure FDA0003217467490000095
R is located at rectangular grid GiRow and ciTaking out the normalized floating point traffic flow matrix Y from the grid area where the row is locatedp+1,Yp+2,…,Yp+QMiddle riRow and ciElements of the column:
Figure FDA0003217467490000096
wherein,
Figure FDA0003217467490000097
for normalizing floating-point traffic flow matrix Yp+QR ofiRow and ciElements of a column; r isiAnd ciRespectively, a gridded track TGThe ith track point of
Figure FDA0003217467490000098
The row serial numbers and the column serial numbers of the rectangular grids;
constructing a gridded trajectory TGCharacteristic vector f of ith track pointi
Figure FDA0003217467490000099
Wherein n is a gridding track TGThe number of the track points; superscript T represents vector transposition;
the second training unit is used for training the urban traffic travel time prediction network according to the feature vectors of all track points in the gridding track; the method specifically comprises the following steps:
acquiring the recording time o of each track point in the track sequence T of the vehicle running path1,o2,…,oN(ii) a Wherein o isNRecording time of the Nth track point;
according to the rectangular grid G, dividing each recording time into different segments in sequence, and enabling the recording time in each segment to be located in the same grid area of the rectangular grid G:
Figure FDA0003217467490000101
wherein it is provided that the recording time is divided into n segments, the first segment containing the time from the first recording time o1To d1A recording time
Figure FDA0003217467490000102
The second fragment comprises the second fragment from1+1 recording time
Figure FDA0003217467490000103
To d2A recording time
Figure FDA0003217467490000104
By analogy, the nth segment contains the segment from dn-1+1 recording time
Figure FDA0003217467490000105
To the Nth recording time oNAnd | represents a fragment space symbol; d1、d2、dn-1N is a natural number | | | represents a fragment space character, d1、d2、dn-1N is naturalCounting;
calculating the driving time required by driving the current section i:
Figure FDA0003217467490000106
wherein,
Figure FDA0003217467490000107
for the time of the i-th segment, corresponding to the feature vector fiThe marking time of (1); i. j, di、di-1Are all natural numbers, and when i is equal to 1, d01 is ═ 1; when i is n, dn+1=N;
And constructing a second training sample according to the feature vector and the driving time of each segment after driving:
Figure FDA0003217467490000108
where F represents the second training sample, the sequence of feature vectors F1,f2…,fnFor the sample characteristics of the second training sample F, time sequence
Figure FDA0003217467490000109
Labeling the sample of the second training sample F; f. ofnThe characteristic vector of the nth track point of the gridding track of the vehicle running path is obtained;
Figure FDA00032174674900001010
to correspond to the feature vector fnThe marking time of (1);
training an urban traffic travel time prediction network according to the second training sample, wherein the urban traffic travel time prediction network is used for predicting the travel time of the whole travel path;
the time prediction unit is used for determining the travel time required by the vehicle to be detected to run through the path to be detected according to the to-be-detected running path of the vehicle to be detected based on the urban traffic flow prediction network and the urban travel time prediction network; the method specifically comprises the following steps:
calculating normalized floating point traffic flow matrixes in the first J continuous time intervals by taking the current running time of the vehicle to be detected as a terminal time interval, and stacking the matrixes into a three-dimensional tensor according to a time sequence:
A=[Y1,Y2,…,YJ];
a is a three-dimensional tensor formed by three-dimensional stereo data of L rows, M columns and J layers, and is formed by stacking normalized floating point traffic flow matrixes obtained in the first J continuous time intervals with the current time interval as an end point according to a time sequence, and Y is1For the normalized floating point traffic flow matrix, Y, obtained in the first J-1 time interval2For the normalized floating point traffic flow matrix, Y, obtained in the first J-2 time intervalsJObtaining a normalized floating point traffic flow matrix in the current time; l is the number of rows of the rectangular grid G in the latitude direction, and M is the number of columns of the rectangular grid G in the longitude direction;
according to the three-dimensional tensor A and an urban traffic flow prediction network, predicting normalized floating point traffic flow in Q time intervals in future: b is1,B2,…,BQ
Wherein, BQPredicting the normalized floating point traffic flow in the future Q-th time interval predicted by the network for the urban traffic flow;
determining a corresponding gridding track R according to a track sequence R of a running path to be tested of a vehicle to be testedGFeature vectors of the track points;
sample feature B of trace sequence R: b ═ B1,b2,…,bn);
Wherein, the sample characteristic B of the running path R to be measured is composed of a characteristic vector sequence B1,b2,…,bnComposition is carried out; b1Is a gridded track RGThe feature vector of the first trace point of (b)nIs a gridded track RGThe feature vector of the nth trace point; n is a gridded locus RGThe number of the contained track points;
gridding track R of vehicle running path R to be testedGThe feature vector of the ith trace point of (1):
Figure FDA0003217467490000111
wherein, biRepresenting a gridded footprint RGThe feature vector of the ith trace point of (a),
Figure FDA0003217467490000121
and
Figure FDA0003217467490000122
respectively represent gridded traces RGLongitude and latitude of the ith trace point,
Figure FDA0003217467490000123
floating point normalized traffic flow moment B in the first time interval predicted by urban traffic flow prediction network at present moment1R ofiRow and ciThe elements of the column are,
Figure FDA0003217467490000124
a floating point normalized traffic flow matrix B in a second time interval predicted by the urban traffic flow prediction network at the current moment2R ofiRow and ciThe elements of the column are,
Figure FDA0003217467490000125
floating point normalization traffic flow matrix B in Q time interval predicted by urban traffic flow prediction network at present momentQR ofiRow and ciElements of a column; r isiAnd ciRespectively, a gridded trace RGThe ith track point of
Figure FDA0003217467490000126
The row serial numbers and the column serial numbers of the rectangular grids; the natural number Q is the number of time intervals predicted by the urban traffic flow prediction network, and the superscript T represents vector transposition;
from said-gridded footprint RGAnd determining the time of the running path R to be tested of the vehicle to be tested after the vehicle to be tested runs.
4. A system for predicting urban traffic travel time, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
dividing a city to be tested into rectangular grids;
based on the rectangular grid, a normalized floating point traffic flow matrix is constructed according to historical traffic flow data;
training an urban traffic flow prediction network according to the normalized floating point traffic flow matrix; the method specifically comprises the following steps:
according to the normalized floating point traffic flow matrix, constructing a corresponding first training sample:
Pt=(At;Bt),
wherein t represents a time interval number, PtRepresenting a first training sample; a. thetRepresenting a first training sample PtThe sample characteristic is a three-dimensional tensor of L rows, M columns and J layers, and is formed by stacking normalized traffic flow matrixes obtained in the first J continuous time intervals with the t-th time interval as an end point according to the time sequence: a. thet=[Yt-J+1,Yt-J+2,…,Yt-1,Yt];
BtRepresenting a first training sample PtThe sample mark is a three-dimensional tensor of an L-row M-column Q layer, and is formed by stacking normalized traffic flow matrixes obtained in Q continuous time intervals with the t +1 th time interval as a starting point according to a time sequence: b ist=[Yt+1,Yt+2,…,Yt+Q];
Wherein, Yt-J+1Is a normalized floating point traffic flow matrix, Y, obtained in the t-J +1 time intervaltFor the normalized floating-point traffic flow matrix, Y, obtained in the t-th time intervalt+QObtaining a normalized floating point traffic flow matrix in the t + Q time intervals;
training an urban traffic flow prediction network according to the first training sample; the urban traffic flow prediction network is used for predicting the normalized floating point traffic flow of a rectangular grid G in Q continuous time intervals;
simplifying the track point sequence of the vehicle running path according to the rectangular grid to obtain a gridded track of the vehicle running path; the method specifically comprises the following steps:
each vehicle driving path is described by a track point sequence, and each track point comprises a longitude coordinate and a latitude coordinate of the track point;
for a given vehicle travel path, the corresponding trajectory sequence is T, which is described by N trajectory points: t { (x)1,y1),(x2,y2),…,(xN,yN)};
Wherein x is1And y1Respectively representing the longitude and latitude, x, of the first trace pointNAnd yNRespectively representing the longitude and the latitude of the Nth track point;
according to the rectangular grid G, dividing N track points of the track sequence T into different segments in sequence, and enabling the track points in each segment to be located in the same grid area of the rectangular grid G:
Figure FDA0003217467490000141
wherein, let the trajectory T be divided into n segments, the first segment containing the point (x) from the first trajectory1,y1) To d1One track point
Figure FDA0003217467490000142
The second fragment comprises the second fragment from1+1 track points
Figure FDA0003217467490000143
To d2One track point
Figure FDA0003217467490000144
By analogy, the nth segment contains the segment from dn-1+1 track points
Figure FDA0003217467490000145
To the Nth track point (x)N,yN) And | represents a fragment space symbol; d1、d2、dn-1N is a natural number;
calculating the average value of the longitude and the latitude of the track points in the same segment to obtain a gridded track TG
Figure FDA0003217467490000146
Wherein,
Figure FDA0003217467490000147
represents the average of the longitudes of track points belonging to the ith segment,
Figure FDA0003217467490000148
mean value, x, representing the latitude of a tracing point belonging to the ith segmentjAnd yjLongitude coordinate and latitude coordinate, when i is 1, d01 is ═ 1; when i is n, dn=N;
Figure FDA0003217467490000149
Determining the characteristic vector of each track point in the gridding track according to the normalized floating point traffic flow matrix and the gridding track of the vehicle running path; the method specifically comprises the following steps:
taking out continuous Q normalized floating point traffic flow matrixes Y from the normalized floating point traffic flow matrixp+1,Yp+2,…,Yp+Q(ii) a Wherein p is the first track point (x) of the vehicle driving path T1,y1) The sequence number of the time interval to which the time belongs in the training time interval;
according to the gridding track TGThe ith track point of
Figure FDA00032174674900001410
R is located at rectangular grid GiRow and ciTaking out the normalized floating point traffic flow matrix Y from the grid area where the row is locatedp+1,Yp+2,…,Yp+QMiddle riRow and ciElements of the column:
Figure FDA00032174674900001411
wherein,
Figure FDA00032174674900001412
for normalizing floating-point traffic flow matrix Yp+QR ofiRow and ciElements of a column; r isiAnd ciRespectively, a gridded track TGThe ith track point of
Figure FDA0003217467490000151
The row serial numbers and the column serial numbers of the rectangular grids;
constructing a gridded trajectory TGCharacteristic vector f of ith track pointi
Figure FDA0003217467490000152
Wherein n is a gridding track TGThe number of the track points; superscript T represents vector transposition;
training a prediction network of urban traffic travel time according to the feature vectors of all track points in the gridding track; the method specifically comprises the following steps:
acquiring the recording time o of each track point in the track sequence T of the vehicle running path1,o2,…,oN(ii) a Wherein o isNRecording time of the Nth track point;
according to the rectangular grid G, dividing each recording time into different segments in sequence, and enabling the recording time in each segment to be located in the same grid area of the rectangular grid G:
Figure FDA0003217467490000153
wherein it is provided that the recording time is divided into n segments, the first segment containing the time from the first recording time o1To d1A recording time
Figure FDA0003217467490000154
The second fragment comprises the second fragment from1+1 recording time
Figure FDA0003217467490000155
To d2A recording time
Figure FDA0003217467490000156
By analogy, the nth segment contains the segment from dn-1+1 recording time
Figure FDA0003217467490000157
To the Nth recording time oNAnd | represents a fragment space symbol; d1、d2、dn-1N is a natural number | | | represents a fragment space character, d1、d2、dn-1N is a natural number;
calculating the driving time required by driving the current section i:
Figure FDA0003217467490000158
wherein,
Figure FDA0003217467490000159
for the time of the i-th segment, corresponding to the feature vector fiThe marking time of (1); i. j, di、di-1Are all natural numbers, and when i is equal to 1, d01 is ═ 1; when i is n, dn+1=N;
And constructing a second training sample according to the feature vector and the driving time of each segment after driving:
Figure FDA0003217467490000161
where F represents the second training sample, the sequence of feature vectors F1,f2…,fnFor the sample characteristics of the second training sample F, time sequence
Figure FDA0003217467490000162
Labeling the sample of the second training sample F; f. ofnThe characteristic vector of the nth track point of the gridding track of the vehicle running path is obtained;
Figure FDA0003217467490000163
to correspond to the feature vector fnThe marking time of (1);
training an urban traffic travel time prediction network according to the second training sample, wherein the urban traffic travel time prediction network is used for predicting the travel time of the whole travel path;
determining the travel time required by the vehicle to be tested to finish running the path to be tested according to the running path to be tested of the vehicle to be tested on the basis of the urban traffic flow prediction network and the urban travel time prediction network; the method specifically comprises the following steps:
calculating normalized floating point traffic flow matrixes in the first J continuous time intervals by taking the current running time of the vehicle to be detected as a terminal time interval, and stacking the matrixes into a three-dimensional tensor according to a time sequence:
A=[Y1,Y2,…,YJ];
a is a three-dimensional tensor formed by three-dimensional stereo data of L rows, M columns and J layers, and is formed by stacking normalized floating point traffic flow matrixes obtained in the first J continuous time intervals with the current time interval as an end point according to a time sequence, and Y is1For the normalized floating point traffic flow matrix, Y, obtained in the first J-1 time interval2For the normalized floating point traffic flow matrix, Y, obtained in the first J-2 time intervalsJObtaining a normalized floating point traffic flow matrix in the current time; l is the number of rows of the rectangular grid G in the latitude direction, and M is the number of columns of the rectangular grid G in the longitude direction;
according to the three-dimensional tensor A and an urban traffic flow prediction network, predicting normalized floating point traffic flow in Q time intervals in future: b is1,B2,…,BQ
Wherein, BQPredicting the normalized floating point traffic flow in the future Q-th time interval predicted by the network for the urban traffic flow;
determining a corresponding gridding track R according to a track sequence R of a running path to be tested of a vehicle to be testedGFeature vectors of the track points;
sample feature B of trace sequence R: b ═ B1,b2,…,bn);
Wherein, the sample characteristic B of the running path R to be measured is composed of a characteristic vector sequence B1,b2,…,bnComposition is carried out; b1Is a gridded track RGThe feature vector of the first trace point of (b)nIs a gridded track RGThe feature vector of the nth trace point; n is a gridded locus RGThe number of the contained track points;
gridding track R of vehicle running path R to be testedGThe feature vector of the ith trace point of (1):
Figure FDA0003217467490000171
wherein, biRepresenting a gridded footprint RGThe feature vector of the ith trace point of (a),
Figure FDA0003217467490000172
and
Figure FDA0003217467490000173
respectively represent gridded traces RGLongitude and latitude of the ith trace point,
Figure FDA0003217467490000174
floating point normalized traffic flow moment B in the first time interval predicted by urban traffic flow prediction network at present moment1R ofiRow and ciThe elements of the column are,
Figure FDA0003217467490000175
a floating point normalized traffic flow matrix B in a second time interval predicted by the urban traffic flow prediction network at the current moment2R ofiRow and ciThe elements of the column are,
Figure FDA0003217467490000176
floating point normalization traffic flow matrix B in Q time interval predicted by urban traffic flow prediction network at present momentQR ofiRow and ciElements of a column; r isiAnd ciRespectively, a gridded trace RGThe ith track point of
Figure FDA0003217467490000177
The row serial numbers and the column serial numbers of the rectangular grids; the natural number Q is the number of time intervals predicted by the urban traffic flow prediction network, and the superscript T represents vector transposition;
from said-gridded footprint RGAnd determining the time of the running path R to be tested of the vehicle to be tested after the vehicle to be tested runs.
5. A computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to:
dividing a city to be tested into rectangular grids;
based on the rectangular grid, a normalized floating point traffic flow matrix is constructed according to historical traffic flow data;
training an urban traffic flow prediction network according to the normalized floating point traffic flow matrix; the method specifically comprises the following steps:
according to the normalized floating point traffic flow matrix, constructing a corresponding first training sample:
Pt=(At;Bt),
wherein t represents a time interval number, PtRepresenting a first training sample; a. thetRepresenting a first training sample PtThe sample characteristic is a three-dimensional tensor of L rows, M columns and J layers, and is formed by stacking normalized traffic flow matrixes obtained in the first J continuous time intervals with the t-th time interval as an end point according to the time sequence: a. thet=[Yt-J+1,Yt-J+2,…,Yt-1,Yt];
BtRepresenting a first training sample PtThe sample mark is a three-dimensional tensor of an L-row M-column Q layer, and is formed by stacking normalized traffic flow matrixes obtained in Q continuous time intervals with the t +1 th time interval as a starting point according to a time sequence: b ist=[Yt+1,Yt+2,…,Yt+Q];
Wherein, Yt-J+1Is a normalized floating point traffic flow matrix, Y, obtained in the t-J +1 time intervaltFor normalized floating point obtained in the t-th time intervalTraffic flow matrix, Yt+QObtaining a normalized floating point traffic flow matrix in the t + Q time intervals;
training an urban traffic flow prediction network according to the first training sample; the urban traffic flow prediction network is used for predicting the normalized floating point traffic flow of a rectangular grid G in Q continuous time intervals;
simplifying the track point sequence of the vehicle running path according to the rectangular grid to obtain a gridded track of the vehicle running path; the method specifically comprises the following steps:
each vehicle driving path is described by a track point sequence, and each track point comprises a longitude coordinate and a latitude coordinate of the track point;
for a given vehicle travel path, the corresponding trajectory sequence is T, which is described by N trajectory points: t { (x)1,y1),(x2,y2),…,(xN,yN)};
Wherein x is1And y1Respectively representing the longitude and latitude, x, of the first trace pointNAnd yNRespectively representing the longitude and the latitude of the Nth track point;
according to the rectangular grid G, dividing N track points of the track sequence T into different segments in sequence, and enabling the track points in each segment to be located in the same grid area of the rectangular grid G:
Figure FDA0003217467490000191
wherein, let the trajectory T be divided into n segments, the first segment containing the point (x) from the first trajectory1,y1) To d1One track point
Figure FDA0003217467490000192
The second fragment comprises the second fragment from1+1 track points
Figure FDA0003217467490000193
To d2One track point
Figure FDA0003217467490000194
By analogy, the nth segment contains the segment from dn-1+1 track points
Figure FDA0003217467490000195
To the Nth track point (x)N,yN) And | represents a fragment space symbol; d1、d2、dn-1N is a natural number;
calculating the average value of the longitude and the latitude of the track points in the same segment to obtain a gridded track TG
Figure FDA0003217467490000196
Wherein,
Figure FDA0003217467490000197
represents the average of the longitudes of track points belonging to the ith segment,
Figure FDA0003217467490000198
mean value, x, representing the latitude of a tracing point belonging to the ith segmentjAnd yjLongitude coordinate and latitude coordinate, when i is 1, d01 is ═ 1; when i is n, dn=N;
Figure FDA0003217467490000199
Determining the characteristic vector of each track point in the gridding track according to the normalized floating point traffic flow matrix and the gridding track of the vehicle running path; the method specifically comprises the following steps:
taking out continuous Q normalized floating point traffic flow matrixes Y from the normalized floating point traffic flow matrixp+1,Yp+2,…,Yp+Q(ii) a Wherein p is a vehicleFirst track point (x) of travel path T1,y1) The sequence number of the time interval to which the time belongs in the training time interval;
according to the gridding track TGThe ith track point of
Figure FDA0003217467490000201
R is located at rectangular grid GiRow and ciTaking out the normalized floating point traffic flow matrix Y from the grid area where the row is locatedp+1,Yp+2,…,Yp+QMiddle riRow and ciElements of the column:
Figure FDA0003217467490000202
wherein,
Figure FDA0003217467490000203
for normalizing floating-point traffic flow matrix Yp+QR ofiRow and ciElements of a column; r isiAnd ciRespectively, a gridded track TGThe ith track point of
Figure FDA0003217467490000204
The row serial numbers and the column serial numbers of the rectangular grids;
constructing a gridded trajectory TGCharacteristic vector f of ith track pointi
Figure FDA0003217467490000205
Wherein n is a gridding track TGThe number of the track points; superscript T represents vector transposition;
training a prediction network of urban traffic travel time according to the feature vectors of all track points in the gridding track; the method specifically comprises the following steps:
acquiring the recording time o of each track point in the track sequence T of the vehicle running path1,o2,…,oN(ii) a Wherein o isNRecording time of the Nth track point;
according to the rectangular grid G, dividing each recording time into different segments in sequence, and enabling the recording time in each segment to be located in the same grid area of the rectangular grid G:
Figure FDA0003217467490000206
wherein it is provided that the recording time is divided into n segments, the first segment containing the time from the first recording time o1To d1A recording time
Figure FDA0003217467490000207
The second fragment comprises the second fragment from1+1 recording time
Figure FDA0003217467490000208
To d2A recording time
Figure FDA0003217467490000209
By analogy, the nth segment contains the segment from dn-1+1 recording time
Figure FDA00032174674900002010
To the Nth recording time oNAnd | represents a fragment space symbol; d1、d2、dn-1N is a natural number | | | represents a fragment space character, d1、d2、dn-1N is a natural number;
calculating the driving time required by driving the current section i:
Figure FDA0003217467490000211
wherein,
Figure FDA0003217467490000212
for the time of the i-th segment, corresponding to the feature vector fiThe marking time of (1); i. j, di、di-1Are all natural numbers, and when i is equal to 1, d01 is ═ 1; when i is n, dn+1=N;
And constructing a second training sample according to the feature vector and the driving time of each segment after driving:
Figure FDA0003217467490000213
where F represents the second training sample, the sequence of feature vectors F1,f2…,fnFor the sample characteristics of the second training sample F, time sequence
Figure FDA0003217467490000214
Labeling the sample of the second training sample F; f. ofnThe characteristic vector of the nth track point of the gridding track of the vehicle running path is obtained;
Figure FDA0003217467490000215
to correspond to the feature vector fnThe marking time of (1);
training an urban traffic travel time prediction network according to the second training sample, wherein the urban traffic travel time prediction network is used for predicting the travel time of the whole travel path;
determining the travel time required by the vehicle to be tested to finish running the path to be tested according to the running path to be tested of the vehicle to be tested on the basis of the urban traffic flow prediction network and the urban travel time prediction network; the method specifically comprises the following steps:
calculating normalized floating point traffic flow matrixes in the first J continuous time intervals by taking the current running time of the vehicle to be detected as a terminal time interval, and stacking the matrixes into a three-dimensional tensor according to a time sequence:
A=[Y1,Y2,…,YJ];
a is a three-dimensional tensor formed by three-dimensional stereo data of L rows, M columns and J layers, and is formed by stacking normalized floating point traffic flow matrixes obtained in the first J continuous time intervals with the current time interval as an end point according to a time sequence, and Y is1For the normalized floating point traffic flow matrix, Y, obtained in the first J-1 time interval2For the normalized floating point traffic flow matrix, Y, obtained in the first J-2 time intervalsJObtaining a normalized floating point traffic flow matrix in the current time; l is the number of rows of the rectangular grid G in the latitude direction, and M is the number of columns of the rectangular grid G in the longitude direction;
according to the three-dimensional tensor A and an urban traffic flow prediction network, predicting normalized floating point traffic flow in Q time intervals in future: b is1,B2,…,BQ
Wherein, BQPredicting the normalized floating point traffic flow in the future Q-th time interval predicted by the network for the urban traffic flow;
determining a corresponding gridding track R according to a track sequence R of a running path to be tested of a vehicle to be testedGFeature vectors of the track points;
sample feature B of trace sequence R: b ═ B1,b2,…,bn);
Wherein, the sample characteristic B of the running path R to be measured is composed of a characteristic vector sequence B1,b2,…,bnComposition is carried out; b1Is a gridded track RGThe feature vector of the first trace point of (b)nIs a gridded track RGThe feature vector of the nth trace point; n is a gridded locus RGThe number of the contained track points;
gridding track R of vehicle running path R to be testedGThe feature vector of the ith trace point of (1):
Figure FDA0003217467490000221
wherein, biRepresenting a gridded footprint RGThe ith track ofThe feature vector of a point is determined,
Figure FDA0003217467490000222
and
Figure FDA0003217467490000223
respectively represent gridded traces RGLongitude and latitude of the ith trace point,
Figure FDA0003217467490000224
floating point normalized traffic flow moment B in the first time interval predicted by urban traffic flow prediction network at present moment1R ofiRow and ciThe elements of the column are,
Figure FDA0003217467490000225
a floating point normalized traffic flow matrix B in a second time interval predicted by the urban traffic flow prediction network at the current moment2R ofiRow and ciThe elements of the column are,
Figure FDA0003217467490000226
floating point normalization traffic flow matrix B in Q time interval predicted by urban traffic flow prediction network at present momentQR ofiRow and ciElements of a column; r isiAnd ciRespectively, a gridded trace RGThe ith track point of
Figure FDA0003217467490000231
The row serial numbers and the column serial numbers of the rectangular grids; the natural number Q is the number of time intervals predicted by the urban traffic flow prediction network, and the superscript T represents vector transposition;
from said-gridded footprint RGAnd determining the time of the running path R to be tested of the vehicle to be tested after the vehicle to be tested runs.
CN202010940567.2A 2020-09-09 2020-09-09 Method and system for predicting urban traffic travel time Active CN112017436B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010940567.2A CN112017436B (en) 2020-09-09 2020-09-09 Method and system for predicting urban traffic travel time

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010940567.2A CN112017436B (en) 2020-09-09 2020-09-09 Method and system for predicting urban traffic travel time

Publications (2)

Publication Number Publication Date
CN112017436A CN112017436A (en) 2020-12-01
CN112017436B true CN112017436B (en) 2021-09-28

Family

ID=73521869

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010940567.2A Active CN112017436B (en) 2020-09-09 2020-09-09 Method and system for predicting urban traffic travel time

Country Status (1)

Country Link
CN (1) CN112017436B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112907953B (en) * 2021-01-27 2022-01-28 吉林大学 Bus travel time prediction method based on sparse GPS data
CN114973640B (en) * 2021-02-24 2024-06-14 阿里巴巴集团控股有限公司 Traffic flow prediction method, device and system
CN113836661B (en) * 2021-09-24 2024-02-20 北京百度网讯科技有限公司 Time prediction method, model training method, related devices and electronic equipment
CN114863699B (en) * 2022-06-14 2023-05-23 电子科技大学 Urban vehicle-road cooperative traffic flow prediction method based on digital twin
CN118052347B (en) * 2024-04-16 2024-07-19 北京航空航天大学 A travel time estimation method and system based on floating vehicle travel trajectory sequence

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5898553B2 (en) * 2012-03-30 2016-04-06 株式会社アイ・トランスポート・ラボ Traffic flow prediction device, traffic flow prediction method, and traffic flow prediction program
CN107103758A (en) * 2017-06-08 2017-08-29 厦门大学 A kind of city area-traffic method for predicting based on deep learning
CN107967532A (en) * 2017-10-30 2018-04-27 厦门大学 The Forecast of Urban Traffic Flow Forecasting Methodology of integration region vigor
CN109035761A (en) * 2018-06-25 2018-12-18 复旦大学 Travel time estimation method based on back-up surveillance study
CN109520499A (en) * 2018-10-08 2019-03-26 浙江浙大中控信息技术有限公司 Region isochronal method in real time is realized based on vehicle GPS track data
CN110428500A (en) * 2019-07-29 2019-11-08 腾讯科技(深圳)有限公司 Trajectory data processing method, device, storage medium and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5898553B2 (en) * 2012-03-30 2016-04-06 株式会社アイ・トランスポート・ラボ Traffic flow prediction device, traffic flow prediction method, and traffic flow prediction program
CN107103758A (en) * 2017-06-08 2017-08-29 厦门大学 A kind of city area-traffic method for predicting based on deep learning
CN107967532A (en) * 2017-10-30 2018-04-27 厦门大学 The Forecast of Urban Traffic Flow Forecasting Methodology of integration region vigor
CN109035761A (en) * 2018-06-25 2018-12-18 复旦大学 Travel time estimation method based on back-up surveillance study
CN109520499A (en) * 2018-10-08 2019-03-26 浙江浙大中控信息技术有限公司 Region isochronal method in real time is realized based on vehicle GPS track data
CN110428500A (en) * 2019-07-29 2019-11-08 腾讯科技(深圳)有限公司 Trajectory data processing method, device, storage medium and device

Also Published As

Publication number Publication date
CN112017436A (en) 2020-12-01

Similar Documents

Publication Publication Date Title
CN112017436B (en) Method and system for predicting urban traffic travel time
CN114202120B (en) Urban traffic journey time prediction method for multi-source heterogeneous data
CN114565124B (en) Ship traffic flow prediction method based on improved graph convolution neural network
Yin et al. Multi-stage attention spatial-temporal graph networks for traffic prediction
Chu et al. Deep multi-scale convolutional LSTM network for travel demand and origin-destination predictions
CN110570651B (en) Road network traffic situation prediction method and system based on deep learning
He et al. Learning heterogeneous traffic patterns for travel time prediction of bus journeys
CN109670277B (en) A Travel Time Prediction Method Based on Multimodal Data Fusion and Multi-Model Integration
CN108629978B (en) A Traffic Trajectory Prediction Method Based on High-dimensional Road Network and Recurrent Neural Network
CN103106280B (en) A kind of range query method of uncertain space-time trajectory data under road network environment
CN112633602B (en) Traffic congestion index prediction method and device based on GIS map information
CN112785077B (en) Travel demand prediction method and system based on spatiotemporal data
CN115409256B (en) Route recommendation method for avoiding congestion area based on travel time prediction
CN117546218A (en) Distributed multitasking machine learning for traffic prediction
CN114996659B (en) Vehicle track prediction method and system with continuous learning capability
CN107103754A (en) A kind of road traffic condition Forecasting Methodology and system
CN116578661B (en) A vehicle trajectory spatiotemporal reconstruction method and system based on attention mechanism
CN113536493A (en) Effective path generation method based on clustering reverse thrust and section passenger flow estimation method
CN116682018B (en) A method, apparatus, system and storage medium for predicting vehicle trajectory
CN110490365A (en) A method of based on the pre- survey grid of multisource data fusion about vehicle order volume
CN110598917A (en) Destination prediction method, system and storage medium based on path track
Sun et al. Road network metric learning for estimated time of arrival
CN115565376A (en) Vehicle travel time prediction method and system fusing graph2vec and double-layer LSTM
CN116153125A (en) Space dimension bus arrival time prediction method based on IDA-RNN model
CN116226684A (en) A Fast Detection Method of ETC Abnormal Data Based on Improved DTW Algorithm

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