[go: up one dir, main page]

CN114973640B - Traffic flow prediction method, device and system - Google Patents

Traffic flow prediction method, device and system Download PDF

Info

Publication number
CN114973640B
CN114973640B CN202110206150.8A CN202110206150A CN114973640B CN 114973640 B CN114973640 B CN 114973640B CN 202110206150 A CN202110206150 A CN 202110206150A CN 114973640 B CN114973640 B CN 114973640B
Authority
CN
China
Prior art keywords
traffic
road
matrix
traffic flow
historical
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
CN202110206150.8A
Other languages
Chinese (zh)
Other versions
CN114973640A (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.)
Alibaba Group Holding Ltd
Nanyang Technological University
Original Assignee
Alibaba Group Holding Ltd
Nanyang Technological University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd, Nanyang Technological University filed Critical Alibaba Group Holding Ltd
Priority to CN202110206150.8A priority Critical patent/CN114973640B/en
Publication of CN114973640A publication Critical patent/CN114973640A/en
Application granted granted Critical
Publication of CN114973640B publication Critical patent/CN114973640B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/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/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0125Traffic data processing
    • G08G1/0129Traffic data processing for creating historical data or processing based on historical data
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/065Traffic control systems for road vehicles by counting the vehicles in a section of the road or in a parking area, i.e. comparing incoming count with outgoing count

Landscapes

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

Abstract

The invention discloses a traffic flow prediction method, a traffic flow prediction device and a traffic flow prediction system. Wherein the method comprises the following steps: acquiring a track transfer matrix, historical track data and a weighted road adjacency matrix in a preset road network range, wherein the weighted road adjacency matrix is used for representing adjacency relations among roads in the preset road network range; determining a traffic conversion state according to the track transfer matrix and the historical track data, wherein the traffic conversion state is used for representing the corresponding traffic flow after each track transfer when the traffic flow is subjected to track transfer for a plurality of times; determining a neighborhood traffic state according to the weighted road adjacency matrix and the historical track data, wherein the neighborhood traffic state is used for representing traffic flow of an adjacency road section; and predicting the future traffic flow according to the traffic conversion state and the neighborhood traffic state. The traffic flow prediction method and the traffic flow prediction device solve the technical problem that in the prior art, when traffic flow is predicted, the accuracy of non-periodic traffic prediction is low.

Description

交通流量的预测方法、装置及系统Traffic flow prediction method, device and system

技术领域Technical Field

本发明涉及智能交通领域,具体而言,涉及一种交通流量的预测方法、装置及系统。The present invention relates to the field of intelligent transportation, and in particular to a method, device and system for predicting traffic flow.

背景技术Background technique

交通领域将道路交通分为两部分:周期性交通和非周期性交通,其中周期性交通通常由交通出行需求的周期性变化导致,如早晚高峰通勤;而非周期性交通是由一些意外事件导致,如地铁系统故障,道路交通事故等。相关技术中,通过从历史训练数据存在的规律中学习时空交通相关性,实现对未来车辆交通状况的预测,例如预测未来的交通流量、速度、密度等,稳健而准确的交通预测对于交通控制和路线规划等许多交通服务是必要的,然而,相关预测方案仅能预测周期性交通状态,由于对历史上相似规律的观测数据不足,使得非周期性交通预测的准确度较低。In the field of transportation, road traffic is divided into two parts: periodic traffic and non-periodic traffic. Periodic traffic is usually caused by periodic changes in travel demand, such as morning and evening rush hour commuting; and non-periodic traffic is caused by some unexpected events, such as subway system failures, road traffic accidents, etc. In related technologies, by learning the spatiotemporal traffic correlation from the laws existing in historical training data, the prediction of future vehicle traffic conditions is achieved, such as predicting future traffic flow, speed, density, etc. Robust and accurate traffic prediction is necessary for many transportation services such as traffic control and route planning. However, related prediction schemes can only predict periodic traffic conditions. Due to insufficient observation data of similar laws in history, the accuracy of non-periodic traffic prediction is low.

针对上述现有技术中在对交通流量进行预测时,对非周期性交通预测准确度较低的技术问题,目前尚未提出有效的解决方案。With respect to the technical problem that the prediction accuracy of non-periodic traffic is low when predicting traffic flow in the above-mentioned prior art, no effective solution has been proposed yet.

发明内容Summary of the invention

本发明实施例提供了一种交通流量的预测方法、装置及系统,以至少解决现有技术中在对交通流量进行预测时,对非周期性交通预测准确度较低的技术问题。The embodiments of the present invention provide a method, device and system for predicting traffic flow, so as to at least solve the technical problem in the prior art that the prediction accuracy of non-periodic traffic is low when predicting traffic flow.

根据本发明实施例的一个方面,提供了一种交通流量的预测方法,包括:获取预设路网范围内的轨迹转移矩阵、历史轨迹数据和加权道路邻接矩阵,其中,轨迹转移矩阵用于表示预设路网范围内相邻路段中上游路段与下游路段之间的转移概率,加权道路邻接矩阵用于表示预设路网范围内的道路之间的邻接关系;根据轨迹转移矩阵和历史轨迹数据确定交通转化状态,其中,交通转化状态用于表示交通流量在进行多次轨迹转移时每次轨迹转移后对应的交通流量;根据加权道路邻接矩阵和历史轨迹数据确定邻域交通状态,其中,邻域交通状态用于表示邻接路段的交通流量;根据交通转化状态和邻域交通状态预测未来的交通流量。According to one aspect of an embodiment of the present invention, a method for predicting traffic flow is provided, comprising: obtaining a trajectory transfer matrix, historical trajectory data and a weighted road adjacency matrix within a preset road network, wherein the trajectory transfer matrix is used to represent the transfer probability between an upstream road section and a downstream road section in adjacent road sections within the preset road network, and the weighted road adjacency matrix is used to represent the adjacency relationship between roads within the preset road network; determining a traffic conversion state according to the trajectory transfer matrix and the historical trajectory data, wherein the traffic conversion state is used to represent the traffic flow corresponding to each trajectory transfer when multiple trajectory transfers are performed; determining a neighborhood traffic state according to the weighted road adjacency matrix and the historical trajectory data, wherein the neighborhood traffic state is used to represent the traffic flow of adjacent road sections; and predicting future traffic flow according to the traffic conversion state and the neighborhood traffic state.

根据本发明实施例的另一方面,还提供了一种交通流量的预测装置,包括:获取模块,用于获取预设路网范围内的轨迹转移矩阵、历史轨迹数据和加权道路邻接矩阵,其中,轨迹转移矩阵用于表示预设路网范围内相邻路段中上游路段与下游路段之间的转移概率,加权道路邻接矩阵用于表示预设路网范围内的道路之间的邻接关系;交通转化状态确定模块,用于根据轨迹转移矩阵和历史轨迹数据确定交通转化状态,其中,交通转化状态用于表示交通流量在进行多次轨迹转移时每次轨迹转移后对应的交通流量;邻域交通状态确定模块,用于根据加权道路邻接矩阵和历史轨迹数据确定邻域交通状态,其中,邻域交通状态用于表示邻接路段的交通流量;预测模块,用于根据交通转化状态和邻域交通状态预测未来的交通流量。According to another aspect of an embodiment of the present invention, a traffic flow prediction device is also provided, including: an acquisition module, used to acquire a trajectory transfer matrix, historical trajectory data and a weighted road adjacency matrix within a preset road network range, wherein the trajectory transfer matrix is used to represent the transfer probability between an upstream road section and a downstream road section in adjacent road sections within the preset road network range, and the weighted road adjacency matrix is used to represent the adjacency relationship between roads within the preset road network range; a traffic conversion state determination module, used to determine the traffic conversion state according to the trajectory transfer matrix and the historical trajectory data, wherein the traffic conversion state is used to represent the traffic flow corresponding to each trajectory transfer when the traffic flow performs multiple trajectory transfers; a neighborhood traffic state determination module, used to determine the neighborhood traffic state according to the weighted road adjacency matrix and the historical trajectory data, wherein the neighborhood traffic state is used to represent the traffic flow of the adjacent road section; a prediction module, used to predict the future traffic flow according to the traffic conversion state and the neighborhood traffic state.

根据本发明实施例的另一方面,还提供了一种计算机可读存储介质,计算机可读存储介质包括存储的程序,其中,在程序运行时控制计算机可读存储介质所在设备执行上述任意一项的交通流量的预测方法。According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned traffic flow prediction methods.

根据本发明实施例的另一方面,还提供了一种处理器,上述处理器用于运行程序,其中,程序运行时执行上述任意一项的交通流量的预测方法。According to another aspect of an embodiment of the present invention, a processor is further provided, and the processor is used to run a program, wherein when the program is run, any one of the above-mentioned traffic flow prediction methods is executed.

根据本发明实施例的另一方面,还提供了一种交通流量的预测系统,其特征在于,包括:处理器;以及存储器,与处理器连接,用于为处理器提供处理以下处理步骤的指令:获取预设路网范围内的轨迹转移矩阵、历史轨迹数据和加权道路邻接矩阵,其中,轨迹转移矩阵用于表示预设路网范围内相邻路段中上游路段与下游路段之间的转移概率,加权道路邻接矩阵用于表示预设路网范围内的道路之间的邻接关系;根据轨迹转移矩阵和历史轨迹数据确定交通转化状态,其中,交通转化状态用于表示交通流量在进行多次轨迹转移时每次轨迹转移后对应的交通流量;根据加权道路邻接矩阵和历史轨迹数据确定邻域交通状态,其中,邻域交通状态用于表示邻接路段的交通流量;根据交通转化状态和邻域交通状态预测未来的交通流量。According to another aspect of an embodiment of the present invention, a traffic flow prediction system is also provided, characterized in that it includes: a processor; and a memory connected to the processor, for providing the processor with instructions for processing the following processing steps: obtaining a trajectory transfer matrix, historical trajectory data and a weighted road adjacency matrix within a preset road network range, wherein the trajectory transfer matrix is used to represent the transfer probability between an upstream section and a downstream section in adjacent sections within the preset road network range, and the weighted road adjacency matrix is used to represent the adjacency relationship between roads within the preset road network range; determining a traffic conversion state according to the trajectory transfer matrix and the historical trajectory data, wherein the traffic conversion state is used to represent the traffic flow corresponding to each trajectory transfer when multiple trajectory transfers are performed; determining a neighborhood traffic state according to the weighted road adjacency matrix and the historical trajectory data, wherein the neighborhood traffic state is used to represent the traffic flow of adjacent sections; and predicting future traffic flow according to the traffic conversion state and the neighborhood traffic state.

在本发明实施例中,获取预设路网范围内的轨迹转移矩阵、历史轨迹数据和加权道路邻接矩阵,根据轨迹转移矩阵和历史轨迹数据确定交通转化状态,根据交通转化状态和邻域交通状态预测未来的交通流量,由于轨迹转移矩阵、历史轨迹数据和加权道路邻接矩阵可以表征出交通流量从一个道路段至另一个道路段的转移关系,以及上游路段的交通流量对下游路段的交通流量的影响,本方案通过历史行驶轨迹可以预测出未来的交通流量,因此可实现对突发性交通状态的准确预测(例如,交通事故导致的堵车),进而提高了对未来车辆交通状况的预测结果的准确程度,尤其是大幅提高了非周期性交通的预测结果的准确程度,解决了现有技术中在对交通流量进行预测时,对非周期性交通预测准确度较低的技术问题。In an embodiment of the present invention, a trajectory transfer matrix, historical trajectory data and a weighted road adjacency matrix within a preset road network are obtained, a traffic conversion state is determined according to the trajectory transfer matrix and the historical trajectory data, and future traffic flow is predicted according to the traffic conversion state and the neighborhood traffic state. Since the trajectory transfer matrix, the historical trajectory data and the weighted road adjacency matrix can characterize the transfer relationship of traffic flow from one road segment to another, and the influence of the traffic flow of an upstream segment on the traffic flow of a downstream segment, the present solution can predict future traffic flow through historical driving trajectories, and thus can achieve accurate prediction of sudden traffic states (for example, traffic jams caused by traffic accidents), thereby improving the accuracy of the prediction results of future vehicle traffic conditions, especially greatly improving the accuracy of the prediction results of non-periodic traffic, and solving the technical problem of low accuracy of non-periodic traffic prediction in the prior art when predicting traffic flow.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

图1示出了一种用于实现交通流量的预测方法的计算设备的硬件结构框图示意图;FIG1 shows a schematic diagram of a hardware structure block diagram of a computing device for implementing a traffic flow prediction method;

图2是根据本发明实施例的一种交通流量的预测方法的流程图;FIG2 is a flow chart of a method for predicting traffic flow according to an embodiment of the present invention;

图3a是历史时间段T内第0时刻-第t时刻的历史轨迹示意图;FIG3a is a schematic diagram of the historical trajectory from time 0 to time t in the historical time period T;

图3b为根据本发明实施例的预设路网内的邻接道路示意图;FIG3b is a schematic diagram of adjacent roads in a preset road network according to an embodiment of the present invention;

图3c提供了在预设路网中根据车辆在上游路段的行驶轨迹推断下游路段的概率分布的示意图;FIG3 c provides a schematic diagram of inferring the probability distribution of the downstream road segment based on the driving trajectory of the vehicle on the upstream road segment in the preset road network;

图4是根据本发明实施例的一种交通流量的预测方法的示意图;FIG4 is a schematic diagram of a method for predicting traffic flow according to an embodiment of the present invention;

图5是根据本发明实施例的一种交通流量的预测装置的示意图;FIG5 is a schematic diagram of a traffic flow prediction device according to an embodiment of the present invention;

图6根据本发明实施例的一种计算机终端的结构框图。FIG6 is a structural block diagram of a computer terminal according to an embodiment of the present invention.

具体实施方式Detailed ways

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

需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

实施例1Example 1

根据本发明实施例,还提供了一种交通流量的预测方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of the present invention, a method for predicting traffic flow is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

本申请实施例一所提供的方法实施例可以在移动终端、计算设备或者类似的运算装置中执行。图1示出了一种用于实现交通流量的预测方法的计算设备(或移动设备)的硬件结构框图。如图1所示,计算设备10(或移动设备10)可以包括一个或多个(图中采用102a、102b,……,102n来示出)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输模块106。除此以外,还可以包括:显示器、输入/输出接口(I/O接口)、通用串行总线(USB)端口(可以作为I/O接口的端口中的一个端口被包括)、网络接口、电源和/或相机。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,计算设备10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computing device or a similar computing device. FIG1 shows a hardware structure block diagram of a computing device (or mobile device) for implementing a method for predicting traffic flow. As shown in FIG1 , a computing device 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used in the figure to show) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input/output interface (I/O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a power supply and/or a camera. It can be understood by those skilled in the art that the structure shown in FIG1 is only for illustration and does not limit the structure of the above-mentioned electronic device. For example, the computing device 10 may also include more or fewer components than those shown in FIG1 , or have a configuration different from that shown in FIG1 .

应当注意到的是上述一个或多个处理器102和/或其他数据处理电路在本文中通常可以被称为“数据处理电路”。该数据处理电路可以全部或部分的体现为软件、硬件、固件或其他任意组合。此外,数据处理电路可为单个独立的处理模块,或全部或部分的结合到计算设备10(或移动设备)中的其他元件中的任意一个内。如本申请实施例中所涉及到的,该数据处理电路作为一种处理器控制(例如与接口连接的可变电阻终端路径的选择)。It should be noted that the one or more processors 102 and/or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computing device 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

存储器104可用于存储应用软件的软件程序以及模块,如本发明实施例中的交通流量的预测方法对应的程序指令/数据存储装置,处理器102通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的应用程序的漏洞检测方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至计算设备10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 can be used to store software programs and modules of application software, such as the program instructions/data storage device corresponding to the traffic flow prediction method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, to implement the vulnerability detection method of the above-mentioned application program. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computing device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

传输模块106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算设备10的通信供应商提供的无线网络。在一个实例中,传输模块106包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输模块106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。The transmission module 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computing device 10. In one example, the transmission module 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

显示器可以例如触摸屏式的液晶显示器(LCD),该液晶显示器可使得用户能够与计算设备10(或移动设备)的用户界面进行交互。The display may be, for example, a touch screen liquid crystal display (LCD) that may enable a user to interact with a user interface of computing device 10 (or mobile device).

在上述运行环境下,本申请提供了如图2所示的交通流量的预测方法。图2是根据本发明实施例一的交通流量的预测方法的流程图,如图2所示,该方法包括如下步骤:In the above operating environment, the present application provides a traffic flow prediction method as shown in Figure 2. Figure 2 is a flow chart of a traffic flow prediction method according to Embodiment 1 of the present invention. As shown in Figure 2, the method includes the following steps:

步骤S201,获取预设路网范围内的轨迹转移矩阵、历史轨迹数据和加权道路邻接矩阵,其中,轨迹转移矩阵用于表示预设路网范围内相邻路段中上游路段与下游路段之间的转移概率,加权道路邻接矩阵用于表示预设路网范围内的道路之间的邻接关系。Step S201, obtaining a trajectory transfer matrix, historical trajectory data and a weighted road adjacency matrix within a preset road network range, wherein the trajectory transfer matrix is used to represent the transfer probability between an upstream section and a downstream section in adjacent sections within the preset road network range, and the weighted road adjacency matrix is used to represent the adjacency relationship between roads within the preset road network range.

预设路网为需要进行交通流量预测的道路范围,预设路网范围可以包括多条相互邻接或者不邻接的道路段,其中,相互邻接的道路表示具有共同连接点的道路段,不邻接的道路段表示没有连接关系的道路段,例如,图3b为预设路网的邻接道路示意图,如图3b所示,预设路网范围中至少包括道路段i和道路段j,道路段i和道路段j通过连接点相连接,使得车辆可以从道路段i驶入道路段j,则道路段i和道路段j为邻接的道路段。The preset road network is the road range for which traffic flow prediction is required. The preset road network range may include multiple adjacent or non-adjacent road segments, wherein adjacent roads represent road segments with common connection points, and non-adjacent road segments represent road segments without connection relationships. For example, FIG3b is a schematic diagram of adjacent roads of the preset road network. As shown in FIG3b, the preset road network range includes at least road segment i and road segment j. Road segment i and road segment j are connected by a connection point, so that a vehicle can drive from road segment i into road segment j. Then road segment i and road segment j are adjacent road segments.

具体的,轨迹转移矩阵中的元素用于表示上游路段至下游路段的转移概率,该转移概率用于表征从上游路段行驶至某一下游路段的车流量与上游路段的车流量的比值。例如,图3c提供了在路网中根据车辆在上游路段的行驶轨迹推断下游路段的概率分布的示意图,如图3c所示,车辆在上游路段i行驶至分叉路口时,前方存在三条下游路段:下游路段k,下游路段l以及下游路段j,可以基于车辆在上游路段i至三条下游路段的历史行驶轨迹的数据,推算出在t时间段内由上游路段i行驶至下游路段k的转移概率Pt,i,k,由上游路段i行驶至下游路段l的转移概率Pt,i,l,以及由上游路段i行驶至下游路段j的转移概率Pt,i,j,则上述轨迹转移矩阵中可以包含转移概率Pt,i,k,转移概率Pt,i,l以及转移概率Pt,i,j。转移概率Pt,i,k,转移概率Pt,i,l以及转移概率Pt,i,j可以在宏观上表征车流量从上游路段i行驶至下游路段j、k和l的转移比例。Specifically, the elements in the trajectory transfer matrix are used to represent the transfer probability from the upstream section to the downstream section, and the transfer probability is used to characterize the ratio of the traffic flow from the upstream section to a certain downstream section to the traffic flow of the upstream section. For example, FIG3c provides a schematic diagram of inferring the probability distribution of a downstream section in a road network based on the driving trajectory of a vehicle on an upstream section. As shown in FIG3c, when a vehicle travels from an upstream section i to a fork in the road, there are three downstream sections ahead: downstream section k, downstream section l, and downstream section j. Based on the data of the historical driving trajectory of the vehicle from the upstream section i to the three downstream sections, the transition probability P t,i,k from the upstream section i to the downstream section k within a time period t, the transition probability P t,i,l from the upstream section i to the downstream section l, and the transition probability P t,i,j from the upstream section i to the downstream section j can be calculated. Then, the above trajectory transfer matrix can include the transition probability P t,i,k , the transition probability P t,i,l, and the transition probability P t,i,j . The transition probability P t,i,k , the transition probability P t,i,l and the transition probability P t,i,j can macroscopically characterize the transfer ratio of the traffic flow from the upstream segment i to the downstream segments j, k and l.

在一种可选的实施例中,在历史时间段T内的轨迹转移矩阵P可以为:In an optional embodiment, the trajectory transfer matrix P in the historical time period T can be:

P∈RT×|V|×|V|P∈R T×|V|×|V| ;

进一步的,将历史时间T以固定时间间隔划分为t个时间段,则第t个时刻(即第t个时间段对应的历史轨迹的采集时间)的轨迹转移矩阵Pt为:Furthermore, the historical time T is divided into t time periods at fixed time intervals, and the trajectory transfer matrix Pt at the tth moment (i.e., the collection time of the historical trajectory corresponding to the tth time period) is:

Pt∈R|V|×|V|P t ∈R |V|×|V| ;

其中,V={vi}i=1,2,......M,M为预设路网内的道路段的数量,vi表示预设路网中的某一道路段,轨迹转移矩阵Pt中的每一个元素表示车辆从预设路网内道路段i转移至道路段j的概率。Wherein, V={ vi } i=1,2,...M , M is the number of road segments in the preset road network, vi represents a road segment in the preset road network, and each element in the trajectory transfer matrix Pt represents the probability of a vehicle transferring from road segment i to road segment j in the preset road network.

上述历史轨迹数据为在历史的一段时间内车辆在预设路网内的道路段行驶的估计数据,可以包括各道路段内的交通流量,也可以包括车辆在不同道路段行驶的轨迹。历史轨迹数据可以通过不同车辆行驶至同一路段的行驶轨迹数据,以及同一车辆行驶至预设路网内不同路段的行驶轨迹数据获得。在一种可选的实施例中,在历史的一段时间内,可以每个间隔一段时间记录一次汽车的轨迹数据,图3a为历史时间段T内以固定时间间隔所获取的第0时刻-第t时刻的历史轨迹示意图,如图3a所示,历史轨迹数据图a、b、c和d分别为在历史时间段T内的不同时刻,对同一车辆以固定的时间间隔记录获得的预设路网内的行驶轨迹,历史轨迹数据图a-d分别对应了不同的上游路段和下游路段的组合。具体的,历史轨迹数据图3a可以为第1时刻记录的历史轨迹数据图,历史轨迹数据图3b可以为第2时刻下记录的历史轨迹数据图,历史轨迹数据图3c可以为第3时刻下记录的历史轨迹数据图,上述固定的时间间隔可以根据采样需求设定,例如,固定的时间间隔可以为15分钟,即上述第1时刻、第2时刻和第3时刻之间的时间间隔为15分钟。The above historical trajectory data is the estimated data of the vehicle traveling on the road segments in the preset road network during a period of history, which may include the traffic flow in each road segment, and may also include the trajectory of the vehicle traveling on different road segments. The historical trajectory data can be obtained through the driving trajectory data of different vehicles traveling to the same road segment, and the driving trajectory data of the same vehicle traveling to different road segments in the preset road network. In an optional embodiment, during a period of history, the trajectory data of the car can be recorded once every period of time. FIG3a is a schematic diagram of the historical trajectory from the 0th moment to the tth moment obtained at a fixed time interval in the historical time period T. As shown in FIG3a, the historical trajectory data graphs a, b, c and d are respectively the driving trajectories in the preset road network obtained by recording the same vehicle at fixed time intervals at different moments in the historical time period T, and the historical trajectory data graphs a-d correspond to different combinations of upstream road segments and downstream road segments. Specifically, the historical trajectory data graph 3a may be a historical trajectory data graph recorded at the first moment, the historical trajectory data graph 3b may be a historical trajectory data graph recorded at the second moment, and the historical trajectory data graph 3c may be a historical trajectory data graph recorded at the third moment. The above-mentioned fixed time intervals may be set according to sampling requirements. For example, the fixed time interval may be 15 minutes, that is, the time interval between the above-mentioned first moment, the second moment and the third moment is 15 minutes.

在一种可选的实施例中,历史轨迹数据X可以通过矩阵的形式表征:In an optional embodiment, the historical trajectory data X can be represented in the form of a matrix:

X∈RT×|V|X∈R T×|V|

其中,T为统计历史轨迹数据的总的历史时间,上述矩阵X中的每一个元素表示在某个时间段内某一道路段的交通流量。进一步的,将历史时间T以固定时间间隔划分为t个时间段,第t个时刻的历史轨迹数据Xt为:Where T is the total historical time of the statistical historical trajectory data, and each element in the above matrix X represents the traffic flow of a certain road section in a certain time period. Further, the historical time T is divided into t time periods at fixed time intervals, and the historical trajectory data Xt at the tth moment is:

Xt∈R|V| Xt∈R |V| ;

其中,t=1,2,……T。Among them, t=1, 2,…T.

加权道路邻接矩阵通过使用矩阵的形式来表示道路的邻接关系,加权道路邻接矩阵的构成与预设路网中道路段的结构有关,具体的,加权道路邻接矩阵与预设路网中每两个道路段是否相邻以及两个道路段中点间的距离长短有关。在一种可选的实施例中,矩阵中可以使用1表示两个道路段之间相邻,使用0表示两个道路段不相邻。加权道路邻接矩阵A可以通过如下矩阵表征:The weighted road adjacency matrix represents the adjacency relationship of roads in the form of a matrix. The composition of the weighted road adjacency matrix is related to the structure of the road segments in the preset road network. Specifically, the weighted road adjacency matrix is related to whether every two road segments in the preset road network are adjacent and the distance between the midpoints of the two road segments. In an optional embodiment, 1 can be used in the matrix to represent the adjacency between two road segments, and 0 can be used to represent the non-adjacent two road segments. The weighted road adjacency matrix A can be represented by the following matrix:

A∈[0,1]M×MA∈[0,1] M×M ;

其中,加权道路邻接矩阵A为M×M的矩阵,M为预设路网内的道路段的数量,如果预设路网内道路段i和道路段j具有邻接关系,则在矩阵A的第i行和第j列记为1,如果预设路网内道路段i和道路段j不相邻,则在矩阵A的第i行和第j列记为0,i=1,2,3……M,j=1,2,3……M。Among them, the weighted road adjacency matrix A is an M×M matrix, M is the number of road segments in the preset road network, if road segment i and road segment j in the preset road network have an adjacency relationship, then the i-th row and j-th column of the matrix A are recorded as 1, if road segment i and road segment j in the preset road network are not adjacent, then the i-th row and j-th column of the matrix A are recorded as 0, i=1, 2, 3...M, j=1, 2, 3...M.

需要说明的是,轨迹转移矩阵和历史轨迹数据均为与历史时间有关,而加权道路邻接矩阵仅与预设路网中的道路关系和长短有关,与历史时间无关。It should be noted that the trajectory transfer matrix and historical trajectory data are both related to historical time, while the weighted road adjacency matrix is only related to the road relationship and length in the preset road network, and has nothing to do with historical time.

步骤S202,根据轨迹转移矩阵和历史轨迹数据确定交通转化状态,其中,交通转化状态用于表示交通流量在进行多次轨迹转移时每次轨迹转移后对应的交通流量。Step S202, determining a traffic conversion state according to the trajectory transfer matrix and the historical trajectory data, wherein the traffic conversion state is used to represent the traffic flow corresponding to each trajectory transfer when multiple trajectory transfers are performed.

交通转化状态与上述的历史时间T内的历史轨迹数据和上述转移概率有关,每次轨迹转移可以为车辆从预设路网中的一个道路段移动到另一道路段。例如,已获得具有固定时间间隔的时间段的历史时间T内的历史轨迹数据Xt,在第t个时刻内,车辆从道路段i行驶至道路段j,相当于发生了一次从道路段i至道路段j的轨迹转移,交通转化状态则可以表征在完成该次轨迹转移后作为车辆目的地的道路段j的交通流量。The traffic conversion state is related to the historical trajectory data within the above historical time T and the above transfer probability. Each trajectory transfer can be the movement of a vehicle from one road segment to another road segment in the preset road network. For example, the historical trajectory data X t within the historical time T with a fixed time interval has been obtained. At the tth moment, the vehicle travels from road segment i to road segment j, which is equivalent to a trajectory transfer from road segment i to road segment j. The traffic conversion state can represent the traffic flow of road segment j as the vehicle's destination after completing the trajectory transfer.

在一种可选的实施例中,交通转化状态通过矩阵的形式表征,具体的,图4为根据本申请实施例的一种交通流量的预测方法的示意图,如图4所示,基于轨迹转移矩阵P和历史轨迹数据的矩阵X,通过图卷积神经网络模型(即GCNS模型)获得历史时间段T内第t个时刻交通转化状态矩阵Dt,交通转化状态矩阵中的每一个元素可以表征出每次轨迹转移后对应作为目的地的道路段的交通流量。如图4所示,在第t个时刻对应的时间段内,车辆可能发生了多次轨迹转移(例如,从道路段i行驶至道路段j,再行驶至道路段k等),车辆的轨迹可以认为是在道路段i的基础上向外围扩大,交通转化状态Dt可以表征出多次轨迹转移后对道路段i向外围扩大的所有道路段的交通流量的影响。In an optional embodiment, the traffic conversion state is represented in the form of a matrix. Specifically, FIG4 is a schematic diagram of a traffic flow prediction method according to an embodiment of the present application. As shown in FIG4, based on the trajectory transfer matrix P and the matrix X of historical trajectory data, the traffic conversion state matrix Dt at the t-th moment in the historical time period T is obtained through a graph convolutional neural network model (i.e., a GCNS model). Each element in the traffic conversion state matrix can represent the traffic flow of the road segment corresponding to the destination after each trajectory transfer. As shown in FIG4, in the time period corresponding to the t-th moment, the vehicle may have multiple trajectory transfers (for example, driving from road segment i to road segment j, and then to road segment k, etc.), and the vehicle's trajectory can be considered to be expanding outward on the basis of road segment i, and the traffic conversion state Dt can represent the impact of multiple trajectory transfers on the traffic flow of all road segments expanding outward from road segment i.

步骤S203,根据加权道路邻接矩阵和历史轨迹数据确定邻域交通状态,其中,邻域交通状态用于表示邻接路段的交通流量。Step S203, determining the neighborhood traffic state according to the weighted road adjacency matrix and the historical trajectory data, wherein the neighborhood traffic state is used to represent the traffic flow of the adjacent road segment.

邻接路段的交通流量可以为邻接路段的总交通流量,例如,道路段i至道路段j为邻接路段,则邻接路段的交通流量包含了道路段i的交通流量和道路段j的交通流量。The traffic flow of the adjacent road segments may be the total traffic flow of the adjacent road segments. For example, if road segment i to road segment j are adjacent road segments, the traffic flow of the adjacent road segments includes the traffic flow of road segment i and the traffic flow of road segment j.

邻域交通状态可以通过第t个时刻下邻接路段的交通流量表征出邻接路段车辆转移的速度,进而表征出邻接路段区域内交通流量的速度状态。例如,如果邻接路段的交通流量很大,则说明邻接路段的交通行驶速度缓慢;反之,邻接路段的交通流量小,则说明邻接路段的交通行驶速度较快。The traffic state of the neighborhood can be characterized by the speed of vehicle transfer in the adjacent road section through the traffic flow of the adjacent road section at the tth moment, and then the speed state of the traffic flow in the adjacent road section area. For example, if the traffic flow of the adjacent road section is large, it means that the traffic speed of the adjacent road section is slow; conversely, if the traffic flow of the adjacent road section is small, it means that the traffic speed of the adjacent road section is fast.

在一种可选的实施例中,邻域交通状态可以通过矩阵的形式表征,具体的,如图4所示,基于加权道路邻接矩阵A和每个时间段下的历史轨迹数据的矩阵X,通过图卷积神经网络模型(即GCNS模型)获得邻域交通状态矩阵St,邻域交通状态矩阵中的每一个元素可以表征出每个时间段下各邻接路段的交通流量。In an optional embodiment, the neighborhood traffic state can be represented in the form of a matrix. Specifically, as shown in FIG4 , based on the weighted road adjacency matrix A and the matrix X of historical trajectory data in each time period, the neighborhood traffic state matrix St is obtained through a graph convolutional neural network model (i.e., GCNS model). Each element in the neighborhood traffic state matrix can represent the traffic flow of each adjacent road section in each time period.

步骤S204,根据交通转化状态和邻域交通状态预测未来的交通流量。Step S204, predicting future traffic flow according to the traffic conversion status and the neighborhood traffic status.

在获取了历史时间T下t个时间段内的交通转化状态和邻域交通状态,可以预测出未来的t+1时间段内的交通流量,未来的交通流量包含了周期性的交通流量和非周期性的交通流量。After obtaining the traffic conversion status and neighborhood traffic status in t time periods under historical time T, the traffic flow in the future t+1 time period can be predicted. The future traffic flow includes periodic traffic flow and non-periodic traffic flow.

在一种可选的实施例中,图4为根据本申请实施例的一种交通流量的预测方法的示意图,如图4所示,获取历史时间T内的轨迹转移矩阵P、历史轨迹数据X和加权道路邻接矩阵A,将历史时间T按照固定时间间隔分成t个时间段(包含0-t个时间段),提取得到每个时间段内的轨迹转移矩阵Pt和历史轨迹数据Xt,将多个轨迹转移矩阵Pt和多个历史轨迹数据Xt输入图卷积神经网络模型41,得到与每个时间段对应的交通转化状态Dt,将加权道路邻接矩阵A和多个历史轨迹数据Xt输入图卷积神经网络模型42,得到与每个时间段对应的邻域交通状态St,基于交通转化状态Dt和邻域交通状态St得到0-t个时间段内的预测的交通流量,进一步基于0-t个时间段内的预测的交通流量,预测出未来的t+1时间段内的交通流量。基于本申请实施例的交通流量的预测方法,可以比相关技术的交通流量预测结果的预测误差减少5%以上,尤其对于非周期性交通流量的预测结果,预测误差可减少14%,提高了对交通流量预测的准确度。In an optional embodiment, Figure 4 is a schematic diagram of a traffic flow prediction method according to an embodiment of the present application. As shown in Figure 4, a trajectory transfer matrix P, historical trajectory data X and a weighted road adjacency matrix A within a historical time T are obtained, and the historical time T is divided into t time periods (including 0-t time periods) according to a fixed time interval, and the trajectory transfer matrix Pt and historical trajectory data Xt within each time period are extracted, and multiple trajectory transfer matrices Pt and multiple historical trajectory data Xt are input into a graph convolutional neural network model 41 to obtain a traffic conversion state Dt corresponding to each time period, and the weighted road adjacency matrix A and multiple historical trajectory data Xt are input into a graph convolutional neural network model 42 to obtain a neighborhood traffic state St corresponding to each time period, and the predicted traffic flow within 0-t time periods is obtained based on the traffic conversion state Dt and the neighborhood traffic state St , and further based on the predicted traffic flow within 0-t time periods, the traffic flow within the future t+1 time period is predicted. The traffic flow prediction method based on the embodiment of the present application can reduce the prediction error of the traffic flow prediction results by more than 5% compared with the related technology. In particular, for the prediction results of non-periodic traffic flow, the prediction error can be reduced by 14%, thereby improving the accuracy of traffic flow prediction.

本实施例中,获取预设路网范围内的轨迹转移矩阵、历史轨迹数据和加权道路邻接矩阵,根据轨迹转移矩阵和历史轨迹数据确定交通转化状态,其中,交通转化状态用于表示交通流量在进行多次轨迹转移时每次轨迹转移后对应的交通流量,根据加权道路邻接矩阵和历史轨迹数据确定邻域交通状态,其中,邻域交通状态用于表示邻接路段的交通流量,根据交通转化状态和邻域交通状态预测未来的交通流量。轨迹转移矩阵、历史轨迹数据和加权道路邻接矩阵可以表征出交通流量从一个道路段至另一个道路段的转移关系,以及上游路段的交通流量对下游路段的交通流量的影响,相关技术中仅获取各路段的历史交通流量数据,根据历史交通流量数据仅能预测出周期性的交通流量,而本方案是根据车辆的行驶轨迹预测出未来的交通流量,实现对突发性交通状态的准确预测(例如,交通事故导致的堵车),进而提高了对未来车辆交通状况的预测结果的准确程度,尤其是大幅提高了非周期性交通的预测结果的准确程度,解决了现有技术中在对交通流量进行预测时,对非周期性交通预测准确度较低的技术问题。In this embodiment, a trajectory transfer matrix, historical trajectory data and a weighted road adjacency matrix within a preset road network are obtained, and a traffic conversion state is determined according to the trajectory transfer matrix and the historical trajectory data, wherein the traffic conversion state is used to represent the traffic flow corresponding to each trajectory transfer when multiple trajectory transfers are performed, and a neighborhood traffic state is determined according to the weighted road adjacency matrix and the historical trajectory data, wherein the neighborhood traffic state is used to represent the traffic flow of adjacent road sections, and future traffic flow is predicted according to the traffic conversion state and the neighborhood traffic state. The trajectory transfer matrix, historical trajectory data and weighted road adjacency matrix can characterize the transfer relationship of traffic flow from one road segment to another, as well as the impact of traffic flow in an upstream segment on traffic flow in a downstream segment. The related technology only obtains historical traffic flow data of each segment, and can only predict periodic traffic flow based on historical traffic flow data. The present solution predicts future traffic flow based on the vehicle's driving trajectory, and achieves accurate prediction of sudden traffic conditions (for example, traffic jams caused by traffic accidents), thereby improving the accuracy of the prediction results of future vehicle traffic conditions, especially greatly improving the accuracy of the prediction results of non-periodic traffic, and solving the technical problem of low accuracy in predicting non-periodic traffic in the prior art when predicting traffic flow.

作为一种可选的实施例,获取预设路网范围内的轨迹转移矩阵,包括:从历史轨迹数据中提取预设时间间隔内车辆从上游路段转入每个下游路段的数量;根据数量确定由上游路段转移至每个下游路段的转移概率;基于预设路网范围内多个路段之间的转移概率确定轨迹转移矩阵。As an optional embodiment, obtaining a trajectory transfer matrix within a preset road network range includes: extracting the number of vehicles that transfer from the upstream section to each downstream section within a preset time interval from historical trajectory data; determining the transfer probability of transferring from the upstream section to each downstream section based on the number; and determining the trajectory transfer matrix based on the transfer probability between multiple sections within the preset road network range.

预设时间间隔为将历史时间段T分成的具有固定时长的每个时间段的时间长度,预设时间间隔可以根据对历史轨迹数据观测采样的间隔需求确定。例如,历史轨迹数据为过去1天内的车辆轨迹数据,则可以设置预设时间间隔为15分钟,即每15分提取一次历史轨迹数据。The preset time interval is the length of each time period with a fixed length into which the historical time period T is divided. The preset time interval can be determined according to the interval requirements for the observation and sampling of historical trajectory data. For example, if the historical trajectory data is the vehicle trajectory data in the past day, the preset time interval can be set to 15 minutes, that is, the historical trajectory data is extracted every 15 minutes.

具体的,历史轨迹数据可以包括历史时间段T内车辆在各道路段的行驶的轨迹信息,历史时间段T按照预设时间间隔分为t个时间段,第t个时刻为第t个时间段的数据提取时间。在第t个时刻,一辆车在预设路网内的轨迹P(τ|t)可以表示为:Specifically, the historical trajectory data may include the trajectory information of the vehicle on each road segment within the historical time period T. The historical time period T is divided into t time periods according to the preset time interval, and the tth moment is the data extraction time of the tth time period. At the tth moment, the trajectory P(τ|t) of a vehicle in the preset road network can be expressed as:

其中,v1,v2,…,vI表示该辆车在第t个时刻内所行驶过的道路段。Wherein, v 1 , v 2 , …, v I represent the road segments traveled by the vehicle at the tth moment.

基于每辆车的行驶轨迹,可以获得在第t个时刻,从某一个上游路段转入与该上游路段邻接的每个下游路段的车辆数量,根据每个下游路段转入的车辆数量与上游路段中总车辆数的关系可以计算获得由上游路段转移至每个下游路段的转移概率。Based on the driving trajectory of each vehicle, the number of vehicles turning from a certain upstream section to each downstream section adjacent to the upstream section at the tth moment can be obtained. According to the relationship between the number of vehicles turning into each downstream section and the total number of vehicles in the upstream section, the transfer probability from the upstream section to each downstream section can be calculated.

例如,在预设路网中,上游路段i具有三条下游路段(下游路段k,下游路段l以及下游路段j),在第t个时间段内,车辆A的轨迹中包含从道路段vi行驶至道路段vj),车辆B的轨迹中包含从道路段vi行驶至道路段vj,车辆C的轨迹中包含从道路段vi行驶至道路段vk,在第t个时间段内,从上游路段vi转入下游路段vj的车辆数量为2,从上游路段vi转入下游路段vk的车辆数量为1,从上游路段vi转入下游路段v1的车辆数量为0,则上游路段vi行驶至下游路段vk的转移概率Pt,i,k为1/3,由上游路段vi行驶至下游路段vl的转移概率Pt,i,l为0,以及由上游路段vi行驶至下游路段vj的转移概率Pt,i,j为2/3,所获得的Pt,i,k、Pt,i,j、Pt,i,l为构成轨迹转移矩阵Pt的元素。For example, in a preset road network, an upstream road segment i has three downstream road segments (downstream road segment k, downstream road segment l and downstream road segment j). In the tth time period, the trajectory of vehicle A includes traveling from road segment vi to road segment v j ), the trajectory of vehicle B includes traveling from road segment vi to road segment v j , and the trajectory of vehicle C includes traveling from road segment vi to road segment v k . In the tth time period, the number of vehicles turning from the upstream road segment vi to the downstream road segment v j is 2, the number of vehicles turning from the upstream road segment vi to the downstream road segment v k is 1, and the number of vehicles turning from the upstream road segment vi to the downstream road segment v 1 is 0. Then, the transition probability P t,i,k from the upstream road segment vi to the downstream road segment v k is 1/3, the transition probability P t,i,l from the upstream road segment vi to the downstream road segment v l is 0, and the transition probability P t,i, j from the upstream road segment vi to the downstream road segment v j is 2/3. The obtained P t,i,k , P t,i,j , P t,i,l are the elements constituting the trajectory transfer matrix P t .

作为一种可选的实施例,根据数量确定由上游路段转移至每个下游路段的转移概率,包括:对预设时间间隔内车辆从上游路段转入每个下游路段的数量进行扩增,以对轨迹转移矩阵进行稠密化处理;确定扩增后的预设时间间隔内车辆从上游路段转入每个下游路段的数量与预设时间间隔内上游路段中所有车辆的数量之比为由上游路段转移至每个下游路段的转移概率。As an optional embodiment, the transfer probability from the upstream section to each downstream section is determined based on the quantity, including: amplifying the number of vehicles that transfer from the upstream section to each downstream section within a preset time interval to densify the trajectory transfer matrix; determining the ratio of the amplified number of vehicles that transfer from the upstream section to each downstream section within the preset time interval to the number of all vehicles in the upstream section within the preset time interval as the transfer probability from the upstream section to each downstream section.

构建的轨迹转移矩阵Pt∈R|V|×|V|中,如果某个上游路段对应的下游路段没有车辆驶入,则对应的转移概率为0,如果轨迹转移矩阵中存在较多的0,导致轨迹转移矩阵过于稀疏,通过对上游路段转入每个下游路段的数量进行扩增,可以避免轨迹转移矩阵中存在元素0。In the constructed trajectory transfer matrix P t ∈R |V|×|V| , if there is no vehicle entering the downstream section corresponding to a certain upstream section, the corresponding transfer probability is 0. If there are many 0s in the trajectory transfer matrix, the trajectory transfer matrix will be too sparse. By increasing the number of upstream sections transferring to each downstream section, the existence of 0 elements in the trajectory transfer matrix can be avoided.

在一种可选的实施例中,可以在转移概率计算公式中,在驶入下游路段的车辆数量上加1,以完成对上游路段转入每个下游路段的数量扩增后,在t时间段内由上游路段vi行驶至下游路段vj的转移概率计算公式可以为:In an optional embodiment, in the transfer probability calculation formula, the number of vehicles entering the downstream section can be added by 1 to complete the amplification of the number of vehicles entering each downstream section from the upstream section. The transfer probability calculation formula for driving from the upstream section vi to the downstream section vj within the time period t can be:

其中,#veh icles(vi→vj|t)表示第t时刻从上游路段vi行驶至下游路段vj的车辆数量,#veh icles(vi|t)表示上游路段vi的车辆总数量,N(vi)表示上游路段vi所对应的所有下游路段的集合。Among them, #veh icles( vivj |t) represents the number of vehicles traveling from the upstream segment vi to the downstream segment vj at the tth time, #veh icles( vi |t) represents the total number of vehicles on the upstream segment vi , and N( vi ) represents the set of all downstream segments corresponding to the upstream segment vi .

作为一种可选的实施例,根据轨迹转移矩阵和历史轨迹数据确定交通转化状态,包括:获取第一图传播参数,其中,第一图传播参数用于表征轨迹转移矩阵和历史轨迹数据进行图传播时的最大轨迹转移次数;将轨迹转移矩阵和历史轨迹数据输入至第一图神经网络,根据第一图传播参数进行图传播,得到交通转化状态。As an optional embodiment, determining the traffic conversion state according to the trajectory transfer matrix and the historical trajectory data includes: obtaining a first graph propagation parameter, wherein the first graph propagation parameter is used to characterize the maximum number of trajectory transfers when the trajectory transfer matrix and the historical trajectory data are propagated through graph; inputting the trajectory transfer matrix and the historical trajectory data into a first graph neural network, performing graph propagation according to the first graph propagation parameter, and obtaining the traffic conversion state.

上述第一图神经网络可以为图卷积神经网络模型,第一图传播参数可以为转化状态跳数(demand hop),第一图传播参数可以用于控制轨迹转移中车辆在预设路网内可能的最远目的地。第一图传播参数可以根据历史数据确定,例如,可以确定历史数据中在15分钟内车辆的平均轨迹转移次数或最大轨迹转移次数为上述第一图传播参数。The first graph neural network may be a graph convolutional neural network model, the first graph propagation parameter may be a conversion state hop count (demand hop), and the first graph propagation parameter may be used to control the farthest possible destination of a vehicle in a preset road network during trajectory transfer. The first graph propagation parameter may be determined based on historical data, for example, the average trajectory transfer times or the maximum trajectory transfer times of vehicles within 15 minutes in historical data may be determined as the first graph propagation parameter.

在一种可选的实施例中,可以使用如下简化后的图卷积神经网络模型,作为上述第一图神经网络:In an optional embodiment, the following simplified graph convolutional neural network model can be used as the first graph neural network:

Graphprop(X,A;K):=[X||AX||A2X||...||AKX||];Graphprop(X,A;K) := [X||AX||A 2 X||...||A K X||];

其中,K为图卷积神经网络模型中的跳数,A为加权道路邻接矩阵,X为历史轨迹数据。Among them, K is the number of hops in the graph convolutional neural network model, A is the weighted road adjacency matrix, and X is the historical trajectory data.

在一种可选的实施例中,如图4所示,历史时间T的轨迹转移矩阵P包括t个时刻的t个轨迹转移矩阵(第t个时刻对应轨迹转移矩阵Pt),历史轨迹数据X包括t个时刻的t个历史轨迹数据(第t个时刻对应历史轨迹数据Xt)。第一图神经网络为图4中的图卷积神经网络模型41,将轨迹转移矩阵P和历史流量矩阵X输入图卷积神经网络模型41中,输出时间段T内0-t个时刻下,第t个时刻的交通转化状态矩阵DtIn an optional embodiment, as shown in FIG4 , the trajectory transfer matrix P of the historical time T includes t trajectory transfer matrices at t moments (the t-th moment corresponds to the trajectory transfer matrix P t ), and the historical trajectory data X includes t historical trajectory data at t moments (the t-th moment corresponds to the historical trajectory data X t ). The first graph neural network is the graph convolutional neural network model 41 in FIG4 , and the trajectory transfer matrix P and the historical traffic matrix X are input into the graph convolutional neural network model 41, and the traffic conversion state matrix D t at the t-th moment in the 0-t moments within the time period T is output:

Dt∈R|V|×(d+1)D t ∈R |V|×(d+1) ;

其中,d为第一图传播参数,V={vi}i1,2,......M,M为预设路网内的道路段的数量,vi表示预设路网中的某一道路段。第一图传播参数可以表征第t个时刻内车辆在预设路网中的轨迹转移的最大次数,例如,如图4所示,图卷积神经网络模型41中,第t-1个时刻的行驶轨迹411与第t个时刻的行驶轨迹412相比,在d次的轨迹转移下,第t个时刻的行驶轨迹412所形成的范围大于第t-1个时刻的行驶轨迹411所形成的轨迹范围,因此,第一图传播参数d取值越大,车辆在第t个时刻对应的预设时间段内的转移次数越多,车辆在预设路网内可能形成的轨迹范围越大(即可到达更远的目的地)。Wherein, d is the first graph propagation parameter, V = { vi } i = 1, 2, ... M , M is the number of road segments in the preset road network, and vi represents a road segment in the preset road network. The first graph propagation parameter can characterize the maximum number of trajectory transfers of the vehicle in the preset road network at the t-th moment. For example, as shown in FIG4, in the graph convolutional neural network model 41, the driving trajectory 411 at the t-1th moment is compared with the driving trajectory 412 at the t-th moment. Under d trajectory transfers, the range formed by the driving trajectory 412 at the t-th moment is larger than the trajectory range formed by the driving trajectory 411 at the t-1th moment. Therefore, the larger the value of the first graph propagation parameter d, the more times the vehicle transfers in the preset time period corresponding to the t-th moment, and the larger the trajectory range that the vehicle may form in the preset road network (that is, it can reach a farther destination).

作为一种可选的实施例,将轨迹转移矩阵和历史轨迹数据输入至第一图神经网络,根据第一图传播参数进行图传播,得到交通转化状态,包括:将指定时刻的轨迹转移矩阵的转置的n次方与指定时刻的历史轨迹数据相乘,得到指定时刻下第n次轨迹转移后的交通转化状态中间值,其中,n小于等于最大轨迹转移次数;将指定时刻的历史轨迹数据与指定时刻下每次轨迹转移后的交通转化状态中间值相连,得到指定时刻下的交通转化状态。As an optional embodiment, the trajectory transfer matrix and the historical trajectory data are input into the first graph neural network, and graph propagation is performed according to the first graph propagation parameter to obtain the traffic conversion state, including: multiplying the nth power of the transpose of the trajectory transfer matrix at the specified time by the historical trajectory data at the specified time to obtain the intermediate value of the traffic conversion state after the nth trajectory transfer at the specified time, where n is less than or equal to the maximum number of trajectory transfers; connecting the historical trajectory data at the specified time with the intermediate value of the traffic conversion state after each trajectory transfer at the specified time to obtain the traffic conversion state at the specified time.

具体的,指定时刻可以为上述历史时间T内的第1个时刻至第t个时刻中的任意一个时刻,则指定时刻的历史轨迹数据可以为第t个时刻对应的历史轨迹数据Xt,指定时刻的轨迹转移矩阵为第t个时刻对应轨迹转移矩阵Pt,交通转化状态矩阵Dt的计算公式可以为:Specifically, the designated time may be any time from the 1st time to the tth time within the above historical time T, then the historical trajectory data at the designated time may be the historical trajectory data X t corresponding to the tth time, the trajectory transfer matrix at the designated time may be the trajectory transfer matrix P t corresponding to the tth time, and the calculation formula of the traffic conversion state matrix D t may be:

其中,表示轨迹转移矩阵Pt的转置矩阵,||表示矩阵的连接,/> 分别为n取值为1,2……d时对应的交通转化状态中间值。in, represents the transposed matrix of the trajectory transfer matrix P t , || represents the connection of matrices, /> They are the intermediate values of traffic conversion states corresponding to when n is 1, 2...d respectively.

作为一种可选的实施例,根据加权道路邻接矩阵和历史轨迹数据确定的邻域交通状态,包括:获取第二图传播参数,其中,第二图传播参数用于表征加权道路邻接矩阵和历史轨迹数据进行图传播时的最大转移范围;将指定时刻的加权道路邻接矩阵和指定时刻的历史轨迹数据输入至第二图神经网络,根据第二图传播参数进行图传播,得到指定时刻下的邻域交通状态。As an optional embodiment, determining the neighborhood traffic status based on the weighted road adjacency matrix and historical trajectory data includes: obtaining a second graph propagation parameter, wherein the second graph propagation parameter is used to characterize the maximum transfer range when the weighted road adjacency matrix and the historical trajectory data are propagated through graph; inputting the weighted road adjacency matrix at a specified time and the historical trajectory data at a specified time into a second graph neural network, performing graph propagation according to the second graph propagation parameter, and obtaining the neighborhood traffic status at the specified time.

上述第二图神经网络可以为图卷积神经网络模型,第二图传播参数可以为邻域状态跳数(status hop)。指定时刻可以为上述历史时间T内的第0个时刻至第t个时刻中的任意一个时刻。The second graph neural network may be a graph convolutional neural network model, and the second graph propagation parameter may be a neighborhood state hop count. The specified time may be any time from the 0th time to the tth time within the historical time T.

在一种可选的实施例中,邻域交通状态可以采用矩阵形式表征,如图4所示,第二图神经网络为图卷积神经网络模型42,加权道路邻接矩阵A在历史时间T内相同,指定时刻的历史轨迹数据可以为第t个时刻的历史轨迹数据Xt,将加权道路邻接矩阵A和历史轨迹数据Xt输入至图卷积神经网络模型42,图卷积神经网络模型42输出第t个时刻的邻域交通状态矩阵StIn an optional embodiment, the neighborhood traffic state can be represented in matrix form. As shown in FIG4 , the second graph neural network is a graph convolutional neural network model 42. The weighted road adjacency matrix A is the same in the historical time T. The historical trajectory data at a specified time may be the historical trajectory data X t at the t-th time. The weighted road adjacency matrix A and the historical trajectory data X t are input into the graph convolutional neural network model 42. The graph convolutional neural network model 42 outputs the neighborhood traffic state matrix S t at the t-th time:

其中,s为第二图传播参数,V={vi}i=1,2,......M,M为预设路网内的道路段的数量,vi表示预设路网中的某一道路段,如图4所示,第二图传播参数s可以表征第t个时刻内车辆在预设路网中所能到达的最远的邻接路段范围,例如,如图4所示,图卷积神经网络模型42中,第t-1个时刻的行驶轨迹421可以表征经过s次轨迹转移后车辆可到达指定的道路段的范围(即在该范围内的车辆经s或者小于s次转移可到达指定的道路段),第t个时刻的行驶轨迹422表征在经过s次轨迹转移后所到达的指定邻接道路段,即图4中第t-1个时刻的行驶轨迹421中圆圈范围内的车辆在s次轨迹转移后可以到达第t个时刻的行驶轨迹422中所指向的道路段,因此,第二图传播参数s的取值越大,以指定邻接道路段为目的地的车辆所在初始位置的范围就越大。Wherein, s is the second graph propagation parameter, V={ vi } i=1, 2, ...M , M is the number of road segments in the preset road network, vi represents a road segment in the preset road network, as shown in FIG4, the second graph propagation parameter s can represent the range of the farthest adjacent road segment that the vehicle can reach in the preset road network at the t-th moment. For example, as shown in FIG4, in the graph convolutional neural network model 42, the driving trajectory 421 at the t-1th moment can represent the range of the designated road segment that the vehicle can reach after s trajectory transfers (that is, the vehicle within the range can reach the designated road segment after s or less than s transfers), and the driving trajectory 422 at the t-th moment represents the designated adjacent road segment reached after s trajectory transfers, that is, the vehicle within the circle range of the driving trajectory 421 at the t-1th moment in FIG4 can reach the road segment pointed to by the driving trajectory 422 at the t-1th moment after s trajectory transfers. Therefore, the larger the value of the second graph propagation parameter s, the larger the range of the initial position of the vehicle with the designated adjacent road segment as the destination.

作为一种可选的实施例,将指定时刻的加权道路邻接矩阵和指定时刻的历史轨迹数据输入至第二图神经网络,根据第二图传播参数进行图传播,得到指定时刻下的邻域交通状态,包括:将指定时刻的加权道路邻接矩阵的转置的m次方与指定时刻的历史轨迹数据相乘,得到指定时刻下m路段的交通转化状态中间值,其中,m小于等于最大转移范围;将指定时刻的历史轨迹数据与指定时刻下每个m路段的交通转化状态中间值相连,得到指定时刻下的邻域交通状态。As an optional embodiment, the weighted road adjacency matrix at a specified time and the historical trajectory data at a specified time are input into a second graph neural network, and graph propagation is performed according to the second graph propagation parameter to obtain the neighborhood traffic state at the specified time, including: multiplying the mth power of the transpose of the weighted road adjacency matrix at the specified time by the historical trajectory data at the specified time to obtain the intermediate value of the traffic conversion state of the m road sections at the specified time, where m is less than or equal to the maximum transfer range; connecting the historical trajectory data at the specified time with the intermediate value of the traffic conversion state of each m road section at the specified time to obtain the neighborhood traffic state at the specified time.

具体的,第t个时刻的邻域交通状态矩阵St可以通过如下公式获得:Specifically, the neighborhood traffic state matrix St at the tth moment can be obtained by the following formula:

其中,为加权道路邻接矩阵A的归一化矩阵,/>分别为m取值为1,2……s时所对应的交通转化状态中间值。in, is the normalized matrix of the weighted road adjacency matrix A,/> The intermediate values of the traffic conversion state corresponding to when m is 1, 2...s respectively.

作为一种可选的实施例,根据交通转化状态和邻域交通状态预测未来的交通流量,包括:通过注意力机制,基于指定时刻的邻域交通状态对指定时刻下每次轨迹转移得到的交通转化状态进行加权,得到指定时刻预测的待预测时刻的交通流量,其中,邻域交通状态为注意力机制中的查询参数,交通转化状态为注意力机制中的值,注意力机制中的键参数为预设值;按照预设的时间间隔从预设的初始时刻至待预测时刻的前一时刻之间确定多个指定时刻;通过全连接层对多个指定时刻预测得到的待预测时刻的交通流量进行融合处理,得到最终预测的待预测时刻的交通流量。As an optional embodiment, predicting future traffic flow based on traffic conversion status and neighborhood traffic status includes: using an attention mechanism, weighting the traffic conversion status obtained by each trajectory transfer at the specified time based on the neighborhood traffic status at the specified time, to obtain the traffic flow at the time to be predicted predicted at the specified time, wherein the neighborhood traffic status is a query parameter in the attention mechanism, the traffic conversion status is a value in the attention mechanism, and the key parameter in the attention mechanism is a preset value; determining multiple specified time periods from a preset initial time to a previous time of the time to be predicted according to a preset time interval; fusing the traffic flow at the time to be predicted obtained by predicting multiple specified time periods through a fully connected layer to obtain the final predicted traffic flow at the time to be predicted.

指定时刻可以为上述历史时间T内的第0个时刻至第t个时刻中的任意一个时刻。指定时刻预测的待预测时刻的交通流量中,待预测时刻为第0个时刻至第t个时刻,上述最终预测的待预测时刻的交通流量,待预测时刻为第t个时刻后的第t+1个时刻。The designated time may be any time from the 0th time to the tth time within the above historical time T. In the traffic flow at the time to be predicted predicted by the designated time, the time to be predicted is from the 0th time to the tth time, and the traffic flow at the time to be predicted in the above final prediction is at the t+1th time after the tth time.

注意力机制模型可以为:The attention mechanism model can be:

Attention(Q,K,V):=softmax(QKT)V;Attention(Q, K, V) := softmax(QK T )V;

其中,Q为查询参数,K为键参数,V为注意力机制中的值。Among them, Q is the query parameter, K is the key parameter, and V is the value in the attention mechanism.

具体的,如图4所示,通过注意力机制43基于第t个时刻邻域交通状态St对第t个时刻交通转化状态Dt加权,即对不同远处的转化状态跳数d进行加权求平均值,可以为将交通转化状态Dt作为上述注意力机制模型的值V,将邻域交通状态St作为上述注意力机制模型的查询参数Q,根据上述注意力机制模型,得到历史时间T内预测的交通流量H,预测的交通流量H包含第0个时刻至第t个时刻预测的t+1时刻的交通流量,第t个时刻的预测交通流量Ht为:Specifically, as shown in FIG4 , the traffic conversion state Dt at the t-th moment is weighted based on the neighborhood traffic state St at the t-th moment through the attention mechanism 43, that is, the weighted average value of the conversion state hops d at different distances can be obtained, and the traffic conversion state Dt can be used as the value V of the above-mentioned attention mechanism model, and the neighborhood traffic state St can be used as the query parameter Q of the above-mentioned attention mechanism model. According to the above-mentioned attention mechanism model, the predicted traffic flow H within the historical time T is obtained. The predicted traffic flow H includes the traffic flow at the t+1 moment predicted from the 0th moment to the t-th moment. The predicted traffic flow Ht at the t-th moment is:

其中,键参数权重值α∈[0,1]|V|×(d+1)Among them, the key parameter The weight value α∈[0,1] |V|×(d+1) .

如图4所示,将第0个时刻至第t个时刻的预测交通流量H输入全连接层44,全连接层44对第0个时刻至第t个时刻的预测交通流量H进行多步骤融合处理(Multi-stepfusion),输出预测的第t+1个时刻的交通流量yv:As shown in FIG4 , the predicted traffic flow H from the 0th time to the tth time is input into the fully connected layer 44, and the fully connected layer 44 performs multi-step fusion processing on the predicted traffic flow H from the 0th time to the tth time, and outputs the predicted traffic flow y v at the t+1th time:

yv:=Xt+1,v=FulyConnected(H:,v;Θ)=ΘTH:,vy v :=X t+1,v =FulyConnected(H :,v ; Θ)=Θ T H :,v ;

其中,矩阵Xt+1,v中的元素表示未来的第t+1时刻路网内道路段v的预测交通流量。The elements in the matrix Xt +1,v represent the predicted traffic flow of the road segment v in the road network at the future time t+1.

需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

实施例2Example 2

根据本发明实施例,还提供了一种用于实施上述交通流量的预测方法的装置,图5为根据本发明实施例2的交通流量的预测装置的示意图,如图5所示,该装置500包括:According to an embodiment of the present invention, a device for implementing the above-mentioned traffic flow prediction method is also provided. FIG. 5 is a schematic diagram of a traffic flow prediction device according to Embodiment 2 of the present invention. As shown in FIG. 5 , the device 500 includes:

获取模块51,用于获取预设路网范围内的轨迹转移矩阵、历史轨迹数据和加权道路邻接矩阵,其中,轨迹转移矩阵用于表示预设路网范围内相邻路段中上游路段与下游路段之间的转移概率,加权道路邻接矩阵用于表示预设路网范围内的道路之间的邻接关系;交通转化状态确定模块52,用于根据轨迹转移矩阵和历史轨迹数据确定交通转化状态,其中,交通转化状态用于表示交通流量在进行多次轨迹转移时每次轨迹转移后对应的交通流量;邻域交通状态确定模块53,用于根据加权道路邻接矩阵和历史轨迹数据确定邻域交通状态,其中,邻域交通状态用于表示邻接路段的交通流量;预测模块54,用于根据交通转化状态和邻域交通状态预测未来的交通流量。The acquisition module 51 is used to acquire the trajectory transfer matrix, historical trajectory data and weighted road adjacency matrix within the preset road network range, wherein the trajectory transfer matrix is used to represent the transfer probability between the upstream section and the downstream section in the adjacent sections within the preset road network range, and the weighted road adjacency matrix is used to represent the adjacency relationship between the roads within the preset road network range; the traffic conversion state determination module 52 is used to determine the traffic conversion state according to the trajectory transfer matrix and the historical trajectory data, wherein the traffic conversion state is used to represent the traffic flow corresponding to each trajectory transfer when multiple trajectory transfers are performed; the neighborhood traffic state determination module 53 is used to determine the neighborhood traffic state according to the weighted road adjacency matrix and the historical trajectory data, wherein the neighborhood traffic state is used to represent the traffic flow of the adjacent sections; the prediction module 54 is used to predict the future traffic flow according to the traffic conversion state and the neighborhood traffic state.

此处需要说明的是,上述获取模块51、交通转化状态确定模块52、邻域交通状态确定模块53和预测模块54对应于实施例1中的步骤S201至步骤S202,4个模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的计算设备10中。It should be noted that the acquisition module 51, the traffic conversion state determination module 52, the neighborhood traffic state determination module 53 and the prediction module 54 correspond to steps S201 to S202 in Example 1, and the four modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules as part of the device can be run in the computing device 10 provided in Example 1.

作为一种可选的实施例,上述获取模块包括:提取子模块,用于从历史轨迹数据中提取预设时间间隔内车辆从上游路段转入每个下游路段的数量;转移概率确定子模块,用于根据数量确定由上游路段转移至每个下游路段的转移概率;轨迹转移矩阵确定子模块,用于基于预设路网范围内多个路段之间的转移概率确定轨迹转移矩阵。As an optional embodiment, the above-mentioned acquisition module includes: an extraction submodule, which is used to extract the number of vehicles turning from the upstream section to each downstream section within a preset time interval from the historical trajectory data; a transfer probability determination submodule, which is used to determine the transfer probability of transferring from the upstream section to each downstream section according to the number; and a trajectory transfer matrix determination submodule, which is used to determine the trajectory transfer matrix based on the transfer probability between multiple sections within a preset road network range.

作为一种可选的实施例,转移概率确定子模块,包括:扩增子模块,用于对预设时间间隔内车辆从上游路段转入每个下游路段的数量进行扩增,以对轨迹转移矩阵进行稠密化处理;确定子模块,用于确定扩增后的预设时间间隔内车辆从上游路段转入每个下游路段的数量与预设时间间隔内上游路段中所有车辆的数量之比为由上游路段转移至每个下游路段的转移概率。As an optional embodiment, the transfer probability determination submodule includes: an amplification submodule, which is used to amplify the number of vehicles turning from the upstream section to each downstream section within a preset time interval to densify the trajectory transfer matrix; and a determination submodule, which is used to determine the ratio of the amplified number of vehicles turning from the upstream section to each downstream section within the preset time interval to the number of all vehicles in the upstream section within the preset time interval as the transfer probability from the upstream section to each downstream section.

作为一种可选的实施例,交通转化状态确定模块包括:第一参数获取子模块,用于获取第一图传播参数,其中,第一图传播参数用于表征轨迹转移矩阵和历史轨迹数据进行图传播时的最大轨迹转移次数;第一输入子模块,用于将轨迹转移矩阵和历史轨迹数据输入至第一图神经网络,根据第一图传播参数进行图传播,得到交通转化状态。As an optional embodiment, the traffic conversion state determination module includes: a first parameter acquisition submodule, used to obtain a first graph propagation parameter, wherein the first graph propagation parameter is used to characterize the maximum number of trajectory transfers when the trajectory transfer matrix and the historical trajectory data are propagated through the graph; a first input submodule, used to input the trajectory transfer matrix and the historical trajectory data into the first graph neural network, perform graph propagation according to the first graph propagation parameter, and obtain the traffic conversion state.

作为一种可选的实施例,第一输入子模块包括:交通转化状态中间值获取子模块,用于将指定时刻的轨迹转移矩阵的转置的n次方与指定时刻的历史轨迹数据相乘,得到指定时刻下第n次轨迹转移后的交通转化状态中间值,其中,n小于等于最大轨迹转移次数;第一相连子模块,用于将指定时刻的历史轨迹数据与指定时刻下每次轨迹转移后的交通转化状态中间值相连,得到指定时刻下的交通转化状态。As an optional embodiment, the first input submodule includes: a traffic conversion state intermediate value acquisition submodule, which is used to multiply the nth power of the transpose of the trajectory transfer matrix at the specified time by the historical trajectory data at the specified time to obtain the intermediate value of the traffic conversion state after the nth trajectory transfer at the specified time, where n is less than or equal to the maximum number of trajectory transfers; a first connection submodule, which is used to connect the historical trajectory data at the specified time with the intermediate value of the traffic conversion state after each trajectory transfer at the specified time to obtain the traffic conversion state at the specified time.

作为一种可选的实施例,邻域交通状态确定模块,包括:第二参数获取子模块,用于获取第二图传播参数,其中,第二图传播参数用于表征加权道路邻接矩阵和历史轨迹数据进行图传播时的最大转移范围;第二输入子模块,用于将指定时刻的加权道路邻接矩阵和指定时刻的历史轨迹数据输入至第二图神经网络,根据第二图传播参数进行图传播,得到指定时刻下的邻域交通状态。As an optional embodiment, the neighborhood traffic status determination module includes: a second parameter acquisition submodule, used to obtain a second graph propagation parameter, wherein the second graph propagation parameter is used to characterize the maximum transfer range when the weighted road adjacency matrix and the historical trajectory data are propagated through the graph; a second input submodule, used to input the weighted road adjacency matrix at a specified time and the historical trajectory data at a specified time into a second graph neural network, perform graph propagation according to the second graph propagation parameter, and obtain the neighborhood traffic status at the specified time.

作为一种可选的实施例,第二输入子模块,包括:交通转化状态中间值获取子模块,用于将指定时刻的加权道路邻接矩阵的转置的m次方与指定时刻的历史轨迹数据相乘,指定时刻下m路段的交通转化状态中间值,其中,m小于等于最大转移范围;第二相连子模块,用于将指定时刻的历史轨迹数据与指定时刻下每个m路段轨的交通转化状态中间值相连,得到指定时刻下的邻域交通状态。As an optional embodiment, the second input submodule includes: a traffic conversion state intermediate value acquisition submodule, which is used to multiply the mth power of the transpose of the weighted road adjacency matrix at the specified time by the historical trajectory data at the specified time, and obtain the intermediate value of the traffic conversion state of the m road sections at the specified time, where m is less than or equal to the maximum transfer range; a second connection submodule, which is used to connect the historical trajectory data at the specified time with the intermediate value of the traffic conversion state of each m road section at the specified time, to obtain the neighborhood traffic state at the specified time.

作为一种可选的实施例,预测模块包括:加权子模块,用于通过注意力机制,基于指定时刻的邻域交通状态对指定时刻下每次轨迹转移得到的交通转化状态进行加权,得到指定时刻预测的待预测时刻的交通流量,其中,邻域交通状态为注意力机制中的查询参数,交通转化状态为注意力机制中的值,注意力机制中的键参数为预设值;指定时刻确定子模块,用于按照预设的时间间隔从预设的初始时刻至待预测时刻的前一时刻之间确定多个指定时刻;融合子模块,用于通过全连接层对多个指定时刻预测得到的待预测时刻的交通流量进行融合处理,得到最终预测的待预测时刻的交通流量。As an optional embodiment, the prediction module includes: a weighted submodule, which is used to weight the traffic conversion state obtained by each trajectory transfer at the specified time based on the neighborhood traffic state at the specified time through an attention mechanism to obtain the traffic flow at the time to be predicted predicted at the specified time, wherein the neighborhood traffic state is the query parameter in the attention mechanism, the traffic conversion state is the value in the attention mechanism, and the key parameter in the attention mechanism is a preset value; a designated time determination submodule, which is used to determine multiple designated times from a preset initial time to a previous time of the time to be predicted according to a preset time interval; a fusion submodule, which is used to fuse the traffic flow at the time to be predicted obtained by predicting multiple designated times through a fully connected layer to obtain the final predicted traffic flow at the time to be predicted.

实施例3Example 3

本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以用于保存上述实施例一所提供的交通流量的预测方法所执行的程序代码。The embodiment of the present invention further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the traffic flow prediction method provided in the first embodiment.

可选地,在本实施例中,上述存储介质可以位于计算机网络中计算设备群中的任意一个计算设备中,或者位于移动终端群中的任意一个移动终端中。Optionally, in this embodiment, the above storage medium may be located in any one of the computing devices in the computing device group in the computer network, or in any one of the mobile terminals in the mobile terminal group.

存储介质可以为计算机可读存储介质,计算机可读存储介质包括存储的程序,其中,在程序运行时控制计算机可读存储介质所在设备执行上述交通流量的预测方法。The storage medium may be a computer-readable storage medium, and the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned traffic flow prediction method.

可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:获取预设路网范围内的轨迹转移矩阵、历史轨迹数据和加权道路邻接矩阵,其中,轨迹转移矩阵用于表示预设路网范围内相邻路段中上游路段与下游路段之间的转移概率,加权道路邻接矩阵用于表示预设路网范围内的道路之间的邻接关系;根据轨迹转移矩阵和历史轨迹数据确定交通转化状态,其中,交通转化状态用于表示交通流量在进行多次轨迹转移时每次轨迹转移后对应的交通流量;根据加权道路邻接矩阵和历史轨迹数据确定邻域交通状态,其中,邻域交通状态用于表示邻接路段的交通流量;根据交通转化状态和邻域交通状态预测未来的交通流量。Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: obtaining a trajectory transfer matrix, historical trajectory data and a weighted road adjacency matrix within a preset road network range, wherein the trajectory transfer matrix is used to represent the transfer probability between an upstream section and a downstream section in adjacent sections within the preset road network range, and the weighted road adjacency matrix is used to represent the adjacency relationship between roads within the preset road network range; determining a traffic conversion state based on the trajectory transfer matrix and the historical trajectory data, wherein the traffic conversion state is used to represent the traffic flow corresponding to each trajectory transfer when multiple trajectory transfers are performed; determining a neighborhood traffic state based on the weighted road adjacency matrix and the historical trajectory data, wherein the neighborhood traffic state is used to represent the traffic flow of adjacent sections; and predicting future traffic flow based on the traffic conversion state and the neighborhood traffic state.

可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:获取预设路网范围内的轨迹转移矩阵,包括:从历史轨迹数据中提取预设时间间隔内车辆从上游路段转入每个下游路段的数量;根据数量确定由上游路段转移至每个下游路段的转移概率;基于预设路网范围内多个路段之间的转移概率确定轨迹转移矩阵。Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: obtaining a trajectory transfer matrix within a preset road network range, including: extracting the number of vehicles turning from the upstream section to each downstream section within a preset time interval from historical trajectory data; determining the transfer probability of transferring from the upstream section to each downstream section based on the number; and determining the trajectory transfer matrix based on the transfer probability between multiple sections within the preset road network range.

可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:根据数量确定由上游路段转移至每个下游路段的转移概率,包括:对预设时间间隔内车辆从上游路段转入每个下游路段的数量进行扩增,以对轨迹转移矩阵进行稠密化处理;确定扩增后的预设时间间隔内车辆从上游路段转入每个下游路段的数量与预设时间间隔内上游路段中所有车辆的数量之比为由上游路段转移至每个下游路段的转移概率。Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: determining the transfer probability from the upstream section to each downstream section based on the quantity, including: amplifying the number of vehicles transferring from the upstream section to each downstream section within a preset time interval to densify the trajectory transfer matrix; determining the ratio of the number of vehicles transferring from the upstream section to each downstream section within the amplified preset time interval to the number of all vehicles in the upstream section within the preset time interval as the transfer probability from the upstream section to each downstream section.

可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:根据轨迹转移矩阵和历史轨迹数据确定交通转化状态,包括:获取第一图传播参数,其中,第一图传播参数用于表征轨迹转移矩阵和历史轨迹数据进行图传播时的最大轨迹转移次数;将轨迹转移矩阵和历史轨迹数据输入至第一图神经网络,根据第一图传播参数进行图传播,得到交通转化状态。Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: determining a traffic conversion state based on a trajectory transfer matrix and historical trajectory data, including: obtaining a first graph propagation parameter, wherein the first graph propagation parameter is used to characterize the maximum number of trajectory transfers when the trajectory transfer matrix and historical trajectory data are subjected to graph propagation; inputting the trajectory transfer matrix and the historical trajectory data into a first graph neural network, performing graph propagation according to the first graph propagation parameter, and obtaining a traffic conversion state.

可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:将轨迹转移矩阵和历史轨迹数据输入至第一图神经网络,根据第一图传播参数进行图传播,得到交通转化状态,包括:将指定时刻的轨迹转移矩阵的转置的n次方与指定时刻的历史轨迹数据相乘,得到指定时刻下第n次轨迹转移后的交通转化状态中间值,其中,n小于等于最大轨迹转移次数;将指定时刻的历史轨迹数据与指定时刻下每次轨迹转移后的交通转化状态中间值相连,得到指定时刻下的交通转化状态。Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: inputting the trajectory transfer matrix and the historical trajectory data into the first graph neural network, performing graph propagation according to the first graph propagation parameter, and obtaining the traffic conversion state, including: multiplying the nth power of the transpose of the trajectory transfer matrix at the specified time by the historical trajectory data at the specified time to obtain the intermediate value of the traffic conversion state after the nth trajectory transfer at the specified time, where n is less than or equal to the maximum number of trajectory transfers; connecting the historical trajectory data at the specified time with the intermediate value of the traffic conversion state after each trajectory transfer at the specified time to obtain the traffic conversion state at the specified time.

可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:根据加权道路邻接矩阵和历史轨迹数据确定的邻域交通状态,包括:获取第二图传播参数,其中,第二图传播参数用于表征加权道路邻接矩阵和历史轨迹数据进行图传播时的最大转移范围;将指定时刻的加权道路邻接矩阵和指定时刻的历史轨迹数据输入至第二图神经网络,根据第二图传播参数进行图传播,得到指定时刻下的邻域交通状态。Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: determining the neighborhood traffic status based on the weighted road adjacency matrix and historical trajectory data, including: obtaining a second graph propagation parameter, wherein the second graph propagation parameter is used to characterize the maximum transfer range when the weighted road adjacency matrix and the historical trajectory data are propagated through the graph; inputting the weighted road adjacency matrix at a specified time and the historical trajectory data at a specified time into a second graph neural network, performing graph propagation according to the second graph propagation parameter, and obtaining the neighborhood traffic status at the specified time.

可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:将指定时刻的加权道路邻接矩阵和指定时刻的历史轨迹数据输入至第二图神经网络,根据第二图传播参数进行图传播,得到指定时刻下的邻域交通状态,包括:将指定时刻的加权道路邻接矩阵的转置的m次方与指定时刻的历史轨迹数据相乘,得到指定时刻下m路段的交通转化状态中间值,其中,m小于等于最大转移范围;将指定时刻的历史轨迹数据与指定时刻下每个m路段的交通转化状态中间值相连,得到指定时刻下的邻域交通状态。Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: inputting the weighted road adjacency matrix at a specified time and the historical trajectory data at a specified time into a second graph neural network, performing graph propagation according to the second graph propagation parameter, and obtaining the neighborhood traffic state at the specified time, including: multiplying the mth power of the transpose of the weighted road adjacency matrix at the specified time by the historical trajectory data at the specified time to obtain the intermediate value of the traffic conversion state of the m road sections at the specified time, where m is less than or equal to the maximum transfer range; connecting the historical trajectory data at the specified time with the intermediate value of the traffic conversion state of each m road section at the specified time to obtain the neighborhood traffic state at the specified time.

可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:根据交通转化状态和邻域交通状态预测未来的交通流量,包括:通过注意力机制,基于指定时刻的邻域交通状态对指定时刻下每次轨迹转移得到的交通转化状态进行加权,得到指定时刻预测的待预测时刻的交通流量,其中,邻域交通状态为注意力机制中的查询参数,交通转化状态为注意力机制中的值,注意力机制中的键参数为预设值;按照预设的时间间隔从预设的初始时刻至待预测时刻的前一时刻之间确定多个指定时刻;通过全连接层对多个指定时刻预测得到的待预测时刻的交通流量进行融合处理,得到最终预测的待预测时刻的交通流量。Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: predicting future traffic flow based on the traffic conversion state and the neighborhood traffic state, including: through an attention mechanism, weighting the traffic conversion state obtained by each trajectory transfer at the specified time based on the neighborhood traffic state at the specified time, to obtain the traffic flow at the time to be predicted predicted at the specified time, wherein the neighborhood traffic state is a query parameter in the attention mechanism, the traffic conversion state is a value in the attention mechanism, and the key parameter in the attention mechanism is a preset value; determining multiple specified times from a preset initial time to a previous time of the time to be predicted according to a preset time interval; fusing the traffic flow at the time to be predicted obtained by predicting multiple specified times through a fully connected layer to obtain the final predicted traffic flow at the time to be predicted.

实施例4Example 4

根据本申请实施例,还提供了一种计算机终端的实施例,该计算机终端可以是计算机终端群中的任意一个计算机终端设备。可选地,在本实施例中,上述计算机终端也可以替换为移动终端等终端设备。According to an embodiment of the present application, an embodiment of a computer terminal is also provided, and the computer terminal can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the above-mentioned computer terminal can also be replaced by a terminal device such as a mobile terminal.

可选地,在本实施例中,上述计算机终端可以位于计算机网络的多个网络设备中的至少一个网络设备。Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.

在本实施例中,上述计算机终端可以执行应用程序的视频的处理方法中以下步骤的程序代码:获取预设路网范围内的轨迹转移矩阵、历史轨迹数据和加权道路邻接矩阵,其中,轨迹转移矩阵用于表示预设路网范围内相邻路段中上游路段与下游路段之间的转移概率,加权道路邻接矩阵用于表示预设路网范围内的道路之间的邻接关系;根据轨迹转移矩阵和历史轨迹数据确定交通转化状态,其中,交通转化状态用于表示交通流量在进行多次轨迹转移时每次轨迹转移后对应的交通流量;根据加权道路邻接矩阵和历史轨迹数据确定邻域交通状态,其中,邻域交通状态用于表示邻接路段的交通流量;根据交通转化状态和邻域交通状态预测未来的交通流量。In this embodiment, the computer terminal can execute the following steps of the program code in the method for processing the video of the application: obtaining a trajectory transfer matrix, historical trajectory data and a weighted road adjacency matrix within a preset road network range, wherein the trajectory transfer matrix is used to represent the transfer probability between an upstream section and a downstream section in adjacent sections within the preset road network range, and the weighted road adjacency matrix is used to represent the adjacency relationship between roads within the preset road network range; determining a traffic conversion state according to the trajectory transfer matrix and the historical trajectory data, wherein the traffic conversion state is used to represent the traffic flow corresponding to each trajectory transfer when multiple trajectory transfers are performed; determining a neighborhood traffic state according to the weighted road adjacency matrix and the historical trajectory data, wherein the neighborhood traffic state is used to represent the traffic flow of adjacent sections; and predicting future traffic flow according to the traffic conversion state and the neighborhood traffic state.

可选地,图6是根据本申请实施例6的一种计算机终端的结构框图,如图6所示,该计算机终端700可以包括:一个或多个(图中仅示出一个)处理器702、存储器704、以及外设接口706。Optionally, Figure 6 is a structural block diagram of a computer terminal according to Example 6 of the present application. As shown in Figure 6, the computer terminal 700 may include: one or more (only one is shown in the figure) processors 702, a memory 704, and a peripheral interface 706.

其中,存储器可用于存储软件程序以及模块,如本申请实施例中的视频插帧方法和装置对应的程序指令/模块,处理器通过运行存储在存储器内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的视频的处理方法。存储器可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器可进一步包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端700。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。Among them, the memory can be used to store software programs and modules, such as the program instructions/modules corresponding to the video interpolation method and device in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned video processing method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 700 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

处理器用于运行程序,可以通过传输装置调用存储器存储的信息及应用程序,以执行下述步骤:获取预设路网范围内的轨迹转移矩阵、历史轨迹数据和加权道路邻接矩阵,其中,轨迹转移矩阵用于表示预设路网范围内相邻路段中上游路段与下游路段之间的转移概率,加权道路邻接矩阵用于表示预设路网范围内的道路之间的邻接关系;根据轨迹转移矩阵和历史轨迹数据确定交通转化状态,其中,交通转化状态用于表示交通流量在进行多次轨迹转移时每次轨迹转移后对应的交通流量;根据加权道路邻接矩阵和历史轨迹数据确定邻域交通状态,其中,邻域交通状态用于表示邻接路段的交通流量;根据交通转化状态和邻域交通状态预测未来的交通流量。The processor is used to run the program, and can call the information and application program stored in the memory through the transmission device to perform the following steps: obtaining a trajectory transfer matrix, historical trajectory data and a weighted road adjacency matrix within a preset road network range, wherein the trajectory transfer matrix is used to represent the transfer probability between an upstream road section and a downstream road section in adjacent road sections within the preset road network range, and the weighted road adjacency matrix is used to represent the adjacency relationship between roads within the preset road network range; determining a traffic conversion state according to the trajectory transfer matrix and the historical trajectory data, wherein the traffic conversion state is used to represent the traffic flow corresponding to each trajectory transfer when multiple trajectory transfers are performed; determining a neighborhood traffic state according to the weighted road adjacency matrix and the historical trajectory data, wherein the neighborhood traffic state is used to represent the traffic flow of adjacent road sections; and predicting future traffic flow according to the traffic conversion state and the neighborhood traffic state.

本领域普通技术人员可以理解,图6所示的结构仅为示意,计算机终端也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌声电脑以及移动互联网设备(MobileInternet Devices,MID)、PAD等终端设备。图6其并不对上述电子装置的结构造成限定。例如,计算机终端700还可包括比图6中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图6所示不同的配置。Those skilled in the art will appreciate that the structure shown in FIG6 is for illustration only, and the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. FIG6 does not limit the structure of the above electronic devices. For example, the computer terminal 700 may also include more or fewer components (such as a network interface, a display device, etc.) than those shown in FIG6, or have a configuration different from that shown in FIG6.

本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(RandomAccess Memory,RAM)、磁盘或光盘等。A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

实施例5Example 5

根据本申请实施例,还提供了一种交通流量的预测系统,上述系统包括:处理器;以及存储器,与处理器连接,用于为处理器提供处理以下处理步骤的指令:获取预设路网范围内的轨迹转移矩阵、历史轨迹数据和加权道路邻接矩阵,其中,轨迹转移矩阵用于表示预设路网范围内相邻路段中上游路段与下游路段之间的转移概率,加权道路邻接矩阵用于表示预设路网范围内的道路之间的邻接关系;根据轨迹转移矩阵和历史轨迹数据确定交通转化状态,其中,交通转化状态用于表示交通流量在进行多次轨迹转移时每次轨迹转移后对应的交通流量;根据加权道路邻接矩阵和历史轨迹数据确定邻域交通状态,其中,邻域交通状态用于表示邻接路段的交通流量;根据交通转化状态和邻域交通状态预测未来的交通流量。According to an embodiment of the present application, a traffic flow prediction system is also provided, the system comprising: a processor; and a memory connected to the processor, for providing the processor with instructions for processing the following processing steps: obtaining a trajectory transfer matrix, historical trajectory data and a weighted road adjacency matrix within a preset road network range, wherein the trajectory transfer matrix is used to represent the transfer probability between an upstream section and a downstream section in adjacent sections within the preset road network range, and the weighted road adjacency matrix is used to represent the adjacency relationship between roads within the preset road network range; determining a traffic conversion state according to the trajectory transfer matrix and the historical trajectory data, wherein the traffic conversion state is used to represent the traffic flow corresponding to each trajectory transfer when multiple trajectory transfers are performed; determining a neighborhood traffic state according to the weighted road adjacency matrix and the historical trajectory data, wherein the neighborhood traffic state is used to represent the traffic flow of adjacent sections; predicting future traffic flow according to the traffic conversion state and the neighborhood traffic state.

上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

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

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

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

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

以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims (12)

1. A method for predicting traffic flow, comprising:
Acquiring a track transfer matrix, historical track data and a weighted road adjacency matrix in a preset road network range, wherein the track transfer matrix is used for representing the transfer probability between an upstream road section and a downstream road section of adjacent road sections in the preset road network range, and the weighted road adjacency matrix is used for representing the adjacency relationship between roads in the preset road network range;
Determining a traffic conversion state according to the track transfer matrix and the historical track data, wherein the traffic conversion state is used for representing the corresponding traffic flow after each track transfer when the traffic flow is subjected to track transfer for a plurality of times;
Determining a neighborhood traffic state according to the weighted road adjacency matrix and the historical track data, wherein the neighborhood traffic state is used for representing traffic flow of an adjacency road section;
And predicting future traffic flow according to the traffic conversion state and the neighborhood traffic state.
2. The method of claim 1, wherein obtaining a trajectory transfer matrix within a predetermined road network range comprises:
extracting the number of vehicles from the upstream road sections to each downstream road section within a preset time interval from the historical track data;
Determining a transition probability of transitioning from the upstream road segment to each of the downstream road segments based on the number;
and determining the track transition matrix based on transition probabilities among a plurality of road sections in the preset road network range.
3. The method of claim 2, wherein determining a transition probability for transitioning from the upstream road segment to the each downstream road segment based on the number comprises:
amplifying the number of vehicles transferred from an upstream road section to each downstream road section within the preset time interval so as to densify the track transfer matrix;
and determining that the ratio of the number of the amplified vehicles in the preset time interval from the upstream road section to each downstream road section to the number of all the vehicles in the upstream road section in the preset time interval is the transition probability of the upstream road section to each downstream road section.
4. The method of claim 1, wherein determining traffic conversion status from the trajectory transfer matrix and the historical trajectory data comprises:
Acquiring a first graph propagation parameter, wherein the first graph propagation parameter is used for representing the maximum track transfer times when the track transfer matrix and the historical track data are subjected to graph propagation;
And inputting the track transfer matrix and the historical track data into a first graph neural network, and performing graph propagation according to the first graph propagation parameters to obtain the traffic conversion state.
5. The method of claim 4, wherein inputting the trajectory transfer matrix and the historical trajectory data to a first graph neural network, graph propagation according to the first graph propagation parameters, and obtaining the traffic conversion state comprises:
multiplying n-th power of transpose of a track transfer matrix at a specified time with historical track data at the specified time to obtain a traffic conversion state intermediate value after n-th track transfer at the specified time, wherein n is less than or equal to the maximum track transfer times;
And connecting the historical track data at the appointed time with the intermediate value of the traffic conversion state after each track transfer at the appointed time to obtain the traffic conversion state at the appointed time.
6. The method of claim 1, wherein the neighborhood traffic state determined from the weighted roadway adjacency matrix and the historical trajectory data comprises:
Acquiring a second graph propagation parameter, wherein the second graph propagation parameter is used for representing the maximum transfer range of the weighted road adjacency matrix and the historical track data when graph propagation is carried out;
And inputting the weighted road adjacency matrix at the appointed time and the historical track data at the appointed time into a second graph neural network, and performing graph propagation according to the second graph propagation parameters to obtain the neighborhood traffic state at the appointed time.
7. The method of claim 6, wherein inputting the weighted road adjacency matrix at the specified time and the historical track data at the specified time to a second graph neural network, performing graph propagation according to the second graph propagation parameter, and obtaining the neighborhood traffic state at the specified time comprises:
Multiplying the m-th power of the transpose of the weighted road adjacent matrix at the appointed moment by the historical track data at the appointed moment, wherein m is smaller than or equal to the maximum transition range;
And connecting the historical track data at the appointed time with the intermediate value of the traffic conversion state of each m road section track at the appointed time to obtain the neighborhood traffic state at the appointed time.
8. The method of claim 1, wherein predicting future traffic flow based on the traffic conversion state and the neighborhood traffic state comprises:
Weighting a traffic conversion state obtained by each track transfer at a specified time based on a neighborhood traffic state at the specified time through an attention mechanism to obtain a traffic flow at a time to be predicted, which is predicted at the specified time, wherein the neighborhood traffic state is a query parameter in the attention mechanism, the traffic conversion state is a value in the attention mechanism, and a key parameter in the attention mechanism is a preset value;
Determining a plurality of designated moments from a preset initial moment to a moment before the moment to be predicted according to a preset time interval;
And carrying out fusion processing on the traffic flow of the predicted time obtained by predicting the plurality of specified times through the full connection layer to obtain the finally predicted traffic flow of the predicted time.
9. A traffic flow prediction apparatus, comprising:
The acquisition module is used for acquiring a track transfer matrix, historical track data and a weighted road adjacency matrix in a preset road network range, wherein the track transfer matrix is used for representing the transfer probability between an upstream road section and a downstream road section in an adjacent road section in the preset road network range, and the weighted road adjacency matrix is used for representing the adjacency relationship between roads in the preset road network range;
The traffic conversion state determining module is used for determining a traffic conversion state according to the track transfer matrix and the historical track data, wherein the traffic conversion state is used for representing the traffic flow corresponding to each track transfer when the track transfer is carried out for a plurality of times;
the neighborhood traffic state determining module is used for determining neighborhood traffic states according to the weighted road adjacency matrix and the historical track data, wherein the neighborhood traffic states are used for representing traffic flow of adjacent road sections;
and the prediction module is used for predicting the future traffic flow according to the traffic conversion state and the neighborhood traffic state.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program, when run, controls a device in which the computer-readable storage medium is located to perform the traffic flow prediction method according to any one of claims 1 to 8.
11. A processor, characterized in that the processor is configured to run a program, wherein the program, when run, performs the traffic flow prediction method according to any one of claims 1 to 8.
12. A traffic flow prediction system, comprising:
A processor; and
A memory, coupled to the processor, for providing instructions to the processor to process the following processing steps:
Acquiring a track transfer matrix, historical track data and a weighted road adjacency matrix in a preset road network range, wherein the track transfer matrix is used for representing the transfer probability between an upstream road section and a downstream road section of adjacent road sections in the preset road network range, and the weighted road adjacency matrix is used for representing the adjacency relationship between roads in the preset road network range;
Determining a traffic conversion state according to the track transfer matrix and the historical track data, wherein the traffic conversion state is used for representing the corresponding traffic flow after each track transfer when the traffic flow is subjected to track transfer for a plurality of times;
Determining a neighborhood traffic state according to the weighted road adjacency matrix and the historical track data, wherein the neighborhood traffic state is used for representing traffic flow of an adjacency road section;
And predicting future traffic flow according to the traffic conversion state and the neighborhood traffic state.
CN202110206150.8A 2021-02-24 2021-02-24 Traffic flow prediction method, device and system Active CN114973640B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110206150.8A CN114973640B (en) 2021-02-24 2021-02-24 Traffic flow prediction method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110206150.8A CN114973640B (en) 2021-02-24 2021-02-24 Traffic flow prediction method, device and system

Publications (2)

Publication Number Publication Date
CN114973640A CN114973640A (en) 2022-08-30
CN114973640B true CN114973640B (en) 2024-06-14

Family

ID=82973124

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110206150.8A Active CN114973640B (en) 2021-02-24 2021-02-24 Traffic flow prediction method, device and system

Country Status (1)

Country Link
CN (1) CN114973640B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115830855B (en) * 2022-11-11 2024-04-09 南京理工大学 Highway section transit time prediction method based on double-state division

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109993980A (en) * 2019-02-21 2019-07-09 平安科技(深圳)有限公司 Traffic flow forecasting method, device, computer equipment and storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4003828B2 (en) * 2002-03-29 2007-11-07 富士通エフ・アイ・ピー株式会社 Road control method, road control system, and recording medium
CN102110365B (en) * 2009-12-28 2013-11-06 日电(中国)有限公司 Road condition prediction method and road condition prediction system based on space-time relationship
CN105788249B (en) * 2014-12-16 2018-09-28 高德软件有限公司 A kind of traffic flow forecasting method, prediction model generation method and device
CN107180530B (en) * 2017-05-22 2019-09-06 北京航空航天大学 A Road Network State Prediction Method Based on Deep Space-Time Convolutional Recurrent Network
CN108346284A (en) * 2018-01-29 2018-07-31 河海大学 A kind of uncertain road network track of vehicle prediction technique based on Markov model
CN108875998A (en) * 2018-04-20 2018-11-23 北京智行者科技有限公司 A kind of automatic driving vehicle method and system for planning
CN110264709B (en) * 2019-05-06 2021-02-12 北京交通大学 Method for predicting traffic flow of road based on graph convolution network
CN110675623B (en) * 2019-09-06 2020-12-01 中国科学院自动化研究所 Method, system and device for short-term traffic flow prediction based on hybrid deep learning
CN111968375B (en) * 2020-08-27 2021-08-10 北京嘀嘀无限科技发展有限公司 Traffic flow prediction method and device, readable storage medium and electronic equipment
CN112017436B (en) * 2020-09-09 2021-09-28 中国科学院自动化研究所 Method and system for predicting urban traffic travel time

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109993980A (en) * 2019-02-21 2019-07-09 平安科技(深圳)有限公司 Traffic flow forecasting method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN114973640A (en) 2022-08-30

Similar Documents

Publication Publication Date Title
Chen et al. Graph neural network and reinforcement learning for multi‐agent cooperative control of connected autonomous vehicles
Chu et al. Deep multi-scale convolutional LSTM network for travel demand and origin-destination predictions
JP7191843B2 (en) ACTION PLANNING SYSTEM AND METHOD FOR AUTONOMOUS VEHICLES
CN112801355B (en) Data prediction method based on multi-graph fusion space-time attention of long-short-term space-time data
US10156450B2 (en) System and method of navigation
CN110222907B (en) Electric vehicle charging station planning method and terminal equipment
Zhu et al. Multistep flow prediction on car-sharing systems: A multi-graph convolutional neural network with attention mechanism
CN113643532B (en) Regional traffic prediction method and device
CN115565369B (en) Space-time hypergraph convolution traffic flow prediction method and system based on hypergraph
CN115049152B (en) Method, device and electronic equipment for predicting passenger flow in airport transfer area
CN106910199A (en) Towards the car networking mass-rent method of city space information gathering
CN114973640B (en) Traffic flow prediction method, device and system
CN114757418B (en) Training method, system and device for predicting demand for shared bicycles
CN118243125A (en) Automatic driving vehicle track planning method and device based on layered reinforcement learning
Wang et al. Double graph attention actor-critic framework for urban bus-pooling system
CN111862591A (en) Road condition prediction method, road condition prediction device and storage medium
CN117522491A (en) Charging station pricing method, system and storage medium based on reinforcement learning
CN111861538B (en) Information pushing method, device, electronic equipment and storage medium
Hsieh et al. Recommending taxi routes with an advance reservation–a multi-criteria route planner
CN115131987B (en) Parking space recommendation method, device, computer equipment and storage medium
CN114383617B (en) Navigation route calculation method, device and equipment based on map neural network and storage medium
CN114358855B (en) Charging pricing method, server, system, equipment and medium
CN113252054B (en) Navigation method and navigation system
CN115610435A (en) Method and device for predicting object driving intention, storage medium and electronic device
CN116246457A (en) Journey time estimation method for dual graph convolution network based on intersection joint modeling

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