Traffic flow prediction methods, devices, equipment and storage media

By acquiring the temporal and spatial characteristics of traffic data, a traffic network relationship model is established. Features are extracted using an LSTM encoder and a convolutional neural network, and a graph attention network model is constructed. This solves the problem of low traffic flow prediction accuracy and achieves higher prediction accuracy.

CN117953679BActive Publication Date: 2026-05-19BEIHANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIHANG UNIV
Filing Date
2024-01-18
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods do not fully consider road characteristics, periodicity, and node connectivity, resulting in low prediction accuracy.

Method used

By acquiring traffic data, determining temporal and spatial features, establishing a traffic network relationship model, extracting feature information using an LSTM encoder and a convolutional neural network, and constructing a graph attention network model for prediction.

Benefits of technology

It improves the accuracy of traffic flow prediction and effectively captures the real dynamics of traffic flow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117953679B_ABST
    Figure CN117953679B_ABST
Patent Text Reader

Abstract

This application provides a traffic flow prediction method, apparatus, device, and storage medium, relating to the field of Internet technology. The method includes: acquiring traffic data within a preset range; determining temporal and spatial characteristic information based on the traffic data; establishing a traffic network relationship model based on the temporal and spatial characteristic information; and determining predicted traffic data corresponding to the preset range based on the traffic network relationship model. The method provided in this application achieves the technical effect of improving the accuracy of traffic flow prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a traffic flow prediction method, apparatus, device, and storage medium. Background Technology

[0002] With the acceleration of urbanization and the increase in the number of vehicles, traffic congestion has become a common problem faced by many cities around the world. As a key part of urban traffic management and planning, traffic flow prediction is of great significance for alleviating traffic congestion, improving road use efficiency and enhancing the sustainability of urban transportation systems. Traffic flow prediction methods have become a promising direction for application.

[0003] In existing technologies, traffic flow prediction methods utilize deep learning models. These models extract features from traffic data through neural networks and process the data effectively to achieve traffic prediction.

[0004] Because existing prediction methods do not fully consider road characteristics, periodic features, or the connection strength between nodes, the models cannot accurately capture the real dynamics of traffic flow, resulting in low traffic flow prediction accuracy. Summary of the Invention

[0005] This application provides a traffic flow prediction method, apparatus, device, and storage medium to solve the technical problem of low traffic flow prediction accuracy.

[0006] Firstly, this application provides a traffic flow prediction method, including:

[0007] Acquire traffic data within a preset range, and determine temporal and spatial characteristic information based on the traffic data;

[0008] A traffic network relationship model is established based on temporal and spatial feature information;

[0009] Predicted traffic data for a preset range is determined based on a traffic network relationship model.

[0010] Optionally, time-related information can be determined based on traffic data, including:

[0011] Determine the time-series traffic data corresponding to the preset range based on traffic data;

[0012] The time-series traffic data is processed based on the first LSTM encoder model to determine the time-series feature information;

[0013] The time-series traffic data is processed based on the second LSTM encoder model to determine periodic feature information;

[0014] Time feature information is determined based on time series feature information and periodic feature information.

[0015] Optionally, the time-series traffic data is processed based on the second LSTM encoder model to determine periodic feature information, including:

[0016] Based on the second LSTM encoder model, the time-series traffic data is divided into N sets of periodic traffic data corresponding to N preset time intervals; where N is a positive integer;

[0017] Periodic characteristic information is determined based on N sets of periodic traffic data.

[0018] Optionally, determining temporal and spatial characteristic information based on traffic data also includes:

[0019] Traffic data is processed using convolutional neural networks to determine map feature information corresponding to a preset range;

[0020] Based on traffic data, determine road information, road classification information, and / or traffic flow data;

[0021] Based on road information, road classification information, and / or traffic flow data, determine road characteristic information;

[0022] Spatial feature information is determined based on map feature information and road feature information.

[0023] Optionally, based on road information, road classification information, and / or traffic flow data, road characteristic information is determined, including:

[0024] Based on road information, road classification information, and / or traffic flow data, determine the road feature vector corresponding to the traffic data;

[0025] Based on road feature vectors, road feature information is determined.

[0026] Optionally, a traffic network relationship model is established based on temporal and spatial feature information, including:

[0027] Based on road feature information, temporal feature information, and periodic feature information, node feature information is determined;

[0028] Edge feature information is determined based on node feature information and map feature information;

[0029] Based on edge feature information and traffic flow data, determine the node connection strength information;

[0030] Construct the target matrix based on node feature information, edge feature information, and node connection strength information;

[0031] A graph attention network model is constructed based on the target matrix, and the graph attention network model is determined to be a traffic network relationship model; the traffic network relationship model is used to output the target feature representation.

[0032] Optionally, predictive traffic data corresponding to a preset range is determined based on a traffic network relationship model, including:

[0033] Input the target feature representation into the target LSTM decoder model;

[0034] The target processing data is output from the target LSTM decoder model and then input into the target linear layer.

[0035] Predicted traffic data corresponding to a preset range is output based on the target linear layer.

[0036] Secondly, this application provides a traffic flow prediction device, comprising:

[0037] The processing module is used to acquire traffic data within a preset range and determine time and spatial feature information based on the traffic data;

[0038] A module is established to build a traffic network relationship model based on time and spatial feature information;

[0039] The prediction module is used to determine the predicted traffic data corresponding to a preset range based on the traffic network relationship model.

[0040] Optionally, the processing module is also used for:

[0041] Determine the time-series traffic data corresponding to the preset range based on traffic data;

[0042] The time-series traffic data is processed based on the first LSTM encoder model to determine the time-series feature information;

[0043] The time-series traffic data is processed based on the second LSTM encoder model to determine periodic feature information;

[0044] Time feature information is determined based on time series feature information and periodic feature information.

[0045] Optionally, the processing module is also used for:

[0046] Based on the second LSTM encoder model, the time-series traffic data is divided into N sets of periodic traffic data corresponding to N preset time intervals; where N is a positive integer;

[0047] Periodic characteristic information is determined based on N sets of periodic traffic data.

[0048] Optionally, the processing module is also used for:

[0049] Traffic data is processed using convolutional neural networks to determine map feature information corresponding to a preset range;

[0050] Based on traffic data, determine road information, road classification information, and / or traffic flow data;

[0051] Based on road information, road classification information, and / or traffic flow data, determine road characteristic information;

[0052] Spatial feature information is determined based on map feature information and road feature information.

[0053] Optionally, the processing module is also used for:

[0054] Based on road information, road classification information, and / or traffic flow data, determine the road feature vector corresponding to the traffic data;

[0055] Based on road feature vectors, road feature information is determined.

[0056] Optionally, the module is also used for:

[0057] Based on road feature information, temporal feature information, and periodic feature information, node feature information is determined;

[0058] Edge feature information is determined based on node feature information and map feature information;

[0059] Based on edge feature information and traffic flow data, determine the node connection strength information;

[0060] Construct the target matrix based on node feature information, edge feature information, and node connection strength information;

[0061] A graph attention network model is constructed based on the target matrix, and the graph attention network model is determined to be a traffic network relationship model; the traffic network relationship model is used to output the target feature representation.

[0062] Optionally, the prediction module is also used for:

[0063] Input the target feature representation into the target LSTM decoder model;

[0064] The target processing data is output from the target LSTM decoder model and then input into the target linear layer.

[0065] Predicted traffic data corresponding to a preset range is output based on the target linear layer.

[0066] Thirdly, this application provides a traffic flow prediction device, comprising:

[0067] Processor and memory;

[0068] The memory stores the instructions that the computer executes;

[0069] The processor executes computer execution instructions stored in memory, causing the traffic flow prediction device to execute any of the traffic flow prediction methods in the first aspect.

[0070] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement a traffic flow prediction method as described in any of the first aspects.

[0071] This application provides a traffic flow prediction method, apparatus, device, and storage medium. It acquires traffic data within a preset range, determines temporal and spatial feature information based on the traffic data, establishes a traffic network relationship model based on the temporal and spatial feature information, and determines the predicted traffic data corresponding to the preset range based on the traffic network relationship model. Therefore, when performing traffic flow prediction, after acquiring traffic data within the preset range, it determines the corresponding temporal traffic data based on the traffic data, processes the temporal traffic data using a first LSTM encoder model to determine temporal feature information, processes the temporal traffic data using a second LSTM encoder model to determine periodic feature information, determines temporal feature information based on the temporal and periodic feature information, processes the traffic data using a convolutional neural network to determine the map feature information corresponding to the preset range, and determines road information, road classification information, and / or traffic flow data based on the traffic data. Based on road classification information and / or traffic flow data, road feature information is determined; based on map feature information and road feature information, spatial feature information is determined; simultaneously, based on road feature information, temporal feature information, and periodic feature information, node feature information is determined; based on node feature information and map feature information, edge feature information is determined; based on edge feature information and traffic flow data, node connection strength information is determined; based on node feature information, edge feature information, and node connection strength information, a target matrix is ​​constructed; based on the target matrix, a graph attention network model is constructed, which is then used as a traffic network relationship model; finally, the target feature representation is input into the target LSTM decoder model, the target LSTM decoder model outputs target processing data, and the target processing data is input into the target linear layer; based on the target linear layer, predicted traffic data corresponding to a preset range is output. This approach solves the technical problem of low traffic flow prediction accuracy and achieves the technical effect of improving traffic flow prediction accuracy. Attached Figure Description

[0072] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0073] Figure 1 The flow chart of the traffic flow prediction method provided in the embodiments of this application Figure 1 ;

[0074] Figure 2 The flow chart of the traffic flow prediction method provided in the embodiments of this application Figure 2 ;

[0075] Figure 3 The flow chart of the traffic flow prediction method provided in the embodiments of this application Figure 3 ;

[0076] Figure 4 The flow chart of the traffic flow prediction method provided in the embodiments of this application Figure 4 ;

[0077] Figure 5 The flow chart of the traffic flow prediction method provided in the embodiments of this application Figure 5 ;

[0078] Figure 6 This is a schematic diagram of the traffic flow prediction device provided in the embodiments of this application;

[0079] Figure 7 This is a hardware structure diagram of the traffic flow prediction device provided in the embodiments of this application.

[0080] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0081] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0082] In existing technologies, traffic flow prediction methods utilize deep learning models. These models extract features from traffic data through neural networks and process the data effectively to achieve traffic prediction.

[0083] Because existing prediction methods do not fully consider road characteristics, periodic features, or the connection strength between nodes, the models cannot accurately capture the real dynamics of traffic flow, resulting in low traffic flow prediction accuracy.

[0084] This application provides a traffic flow prediction method, apparatus, device, and storage medium. It acquires traffic data within a preset range, determines temporal and spatial feature information based on the traffic data, establishes a traffic network relationship model based on the temporal and spatial feature information, and determines the predicted traffic data corresponding to the preset range based on the traffic network relationship model. Therefore, when performing traffic flow prediction, after acquiring traffic data within the preset range, it determines the corresponding temporal traffic data based on the traffic data, processes the temporal traffic data using a first LSTM encoder model to determine temporal feature information, processes the temporal traffic data using a second LSTM encoder model to determine periodic feature information, determines temporal feature information based on the temporal and periodic feature information, processes the traffic data using a convolutional neural network to determine the map feature information corresponding to the preset range, and determines road information, road classification information, and / or traffic flow data based on the traffic data. Based on road classification information and / or traffic flow data, road feature information is determined; based on map feature information and road feature information, spatial feature information is determined; simultaneously, based on road feature information, temporal feature information, and periodic feature information, node feature information is determined; based on node feature information and map feature information, edge feature information is determined; based on edge feature information and traffic flow data, node connection strength information is determined; based on node feature information, edge feature information, and node connection strength information, a target matrix is ​​constructed; based on the target matrix, a graph attention network model is constructed, which is then used as a traffic network relationship model; finally, the target feature representation is input into the target LSTM decoder model, the target LSTM decoder model outputs target processing data, and the target processing data is input into the target linear layer; based on the target linear layer, predicted traffic data corresponding to a preset range is output. This approach solves the technical problem of low traffic flow prediction accuracy and achieves the technical effect of improving traffic flow prediction accuracy.

[0085] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.

[0086] Figure 1 Traffic flow prediction method flow provided in the embodiments of this application Figure 1 .like Figure 1 As shown in the embodiments of this application, the traffic flow prediction method includes:

[0087] S101. Obtain traffic data within a preset range, and determine time and spatial characteristic information based on the traffic data;

[0088] In this embodiment, traffic data includes traffic flow data, vehicle speed data, and lane occupancy rate recorded by the detection points.

[0089] S102. Establish a traffic network relationship model based on time and spatial feature information;

[0090] S103. Determine the predicted traffic data corresponding to the preset range based on the traffic network relationship model.

[0091] This application provides a traffic flow prediction method that acquires traffic data within a preset range, determines temporal and spatial feature information based on the traffic data, establishes a traffic network relationship model based on the temporal and spatial feature information, and determines the predicted traffic data corresponding to the preset range based on the traffic network relationship model. Therefore, when performing traffic flow prediction, after acquiring traffic data within the preset range, the method determines the corresponding temporal traffic data based on the traffic data, processes the temporal traffic data using a first LSTM encoder model to determine temporal feature information, processes the temporal traffic data using a second LSTM encoder model to determine periodic feature information, determines temporal feature information based on the temporal and periodic feature information, processes the traffic data using a convolutional neural network to determine the map feature information corresponding to the preset range, and determines road information, road classification information, and / or traffic flow data based on the traffic data. Based on class information and / or traffic flow data, road feature information is determined; based on map feature information and road feature information, spatial feature information is determined; simultaneously, based on road feature information, temporal feature information, and periodic feature information, node feature information is determined; based on node feature information and map feature information, edge feature information is determined; based on edge feature information and traffic flow data, node connection strength information is determined; based on node feature information, edge feature information, and node connection strength information, a target matrix is ​​constructed; based on the target matrix, a graph attention network model is constructed, which is then used as a traffic network relationship model; finally, the target feature representation is input into the target LSTM decoder model, and the target processing data is output from the target LSTM decoder model and input into the target linear layer; based on the target linear layer, predicted traffic data corresponding to a preset range is output, solving the technical problem of low traffic flow prediction accuracy and achieving the technical effect of improving traffic flow prediction accuracy.

[0092] Figure 2 This application provides a traffic flow prediction method flow for its embodiments. Figure 2 .like Figure 2 As shown in the embodiments of this application, the traffic flow prediction method includes:

[0093] S201. Obtain traffic data within a preset range, and determine the time-series traffic data corresponding to the preset range based on the traffic data; process the time-series traffic data based on the first LSTM encoder model to determine the time-series feature information;

[0094] In this embodiment, LSTM refers to Long Short-Term Memory.

[0095] S202. Based on the second LSTM encoder model, the time-series traffic data is divided into N sets of periodic traffic data corresponding to N preset time intervals; where N is a positive integer; periodic feature information is determined based on the N sets of periodic traffic data.

[0096] S203. Process traffic data based on convolutional neural networks to determine map feature information corresponding to a preset range; determine road information, road classification information, and / or traffic flow data based on traffic data;

[0097] S204. Based on road information, road classification information, and / or traffic flow data, determine the road feature vector corresponding to the traffic data; based on the road feature vector, determine the road feature information;

[0098] S205. Determine spatial feature information based on map feature information and road feature information;

[0099] S206. Based on road feature information, temporal feature information, and periodic feature information, determine node feature information; based on node feature information and map feature information, determine edge feature information; based on edge feature information and traffic flow data, determine node connection strength information; based on node feature information, edge feature information, and node connection strength information, construct a target matrix; based on the target matrix, construct a graph attention network model, and determine the graph attention network model as a traffic network relationship model; wherein, the traffic network relationship model is used to output the target feature representation;

[0100] S207. Input the target feature representation into the target LSTM decoder model; output the target processing data based on the target LSTM decoder model, and input the target processing data into the target linear layer; output the predicted traffic data corresponding to the preset range based on the target linear layer.

[0101] Traffic-related data is acquired through steps S201–S207. Spatiotemporal feature encoding is performed using data processing techniques. Two independent LSTM encoders are used to process the traffic data: one for processing time-series data to capture the changing characteristics of traffic flow over time, and the other for extracting the periodic features of traffic flow data. Convolutional neural networks are applied to process map information to extract spatial features and incorporate road features. Graph attention networks are used to model the complex relationships between roads, effectively capturing and strengthening dependencies in the traffic network by learning the relative importance of different road nodes. Combining spatiotemporal features and relationship models, LSTM decoders and linear layers are used to predict future traffic flow.

[0102] Figure 3 The process of the traffic flow prediction method provided in the embodiments of this application Figure 3 .like Figure 3 As shown, in one possible implementation, the time-series traffic data is processed based on the second LSTM encoder model to determine the periodic feature information, including:

[0103] S301. Preprocess the data;

[0104] S302. Determine whether the data is periodic;

[0105] S303. Convert the processed data into a time series format and construct a time series dataset;

[0106] S304. Input the time series dataset into the LSTM model;

[0107] S305 and LSTM models are used to analyze periodic data and extract periodic features.

[0108] Figure 4 The flow chart of the traffic flow prediction method provided in the embodiments of this application Figure 4 .like Figure 4 As shown, in one possible implementation, determining road feature information includes:

[0109] S401. Determine if it is road information;

[0110] S402. Determine the importance of the corresponding road within the entire transportation network;

[0111] S403. Determine whether it is road classification information;

[0112] S404. Extract road classification information, determine the corresponding road type, and assign a code;

[0113] In this embodiment, road types include highways, main roads, and secondary roads.

[0114] S405. Determine if it is traffic flow data;

[0115] S406. Analyze the traffic flow data for each type of road and calculate the corresponding indicators;

[0116] In this embodiment, the indicators include average flow rate and peak flow rate statistics.

[0117] S407. Construct feature vectors;

[0118] S408. Integrate the feature vectors into each data point of the traffic data.

[0119] Figure 5 The flow chart of the traffic flow prediction method provided in the embodiments of this application Figure 5 .like Figure 5 As shown, in one possible implementation, constructing the target matrix includes:

[0120] S501. Determine if it is road information;

[0121] S502. Based on road information, each road is treated as an independent node, and node identification is performed to determine node information;

[0122] S503. Determine whether there are physical connections and / or traffic flow between roads;

[0123] S504. Determine edge feature information based on road connectivity;

[0124] S505. Determine the connection strength between nodes based on traffic flow data, and determine the node connection strength information;

[0125] S506. Determine that there is no connection between two nodes, and the node connection strength is zero.

[0126] S507. Construct the target matrix based on node information, edge feature information, and node connection strength information.

[0127] This application provides a traffic flow prediction method that acquires traffic data within a preset range, determines temporal and spatial feature information based on the traffic data, establishes a traffic network relationship model based on the temporal and spatial feature information, and determines the predicted traffic data corresponding to the preset range based on the traffic network relationship model. Therefore, when performing traffic flow prediction, after acquiring traffic data within the preset range, the method determines the corresponding temporal traffic data based on the traffic data, processes the temporal traffic data using a first LSTM encoder model to determine temporal feature information, processes the temporal traffic data using a second LSTM encoder model to determine periodic feature information, determines temporal feature information based on the temporal and periodic feature information, processes the traffic data using a convolutional neural network to determine the map feature information corresponding to the preset range, and determines road information, road classification information, and / or traffic flow data based on the traffic data. Based on class information and / or traffic flow data, road feature information is determined; based on map feature information and road feature information, spatial feature information is determined; simultaneously, based on road feature information, temporal feature information, and periodic feature information, node feature information is determined; based on node feature information and map feature information, edge feature information is determined; based on edge feature information and traffic flow data, node connection strength information is determined; based on node feature information, edge feature information, and node connection strength information, a target matrix is ​​constructed; based on the target matrix, a graph attention network model is constructed, which is then used as a traffic network relationship model; finally, the target feature representation is input into the target LSTM decoder model, and the target processing data is output from the target LSTM decoder model and input into the target linear layer; based on the target linear layer, predicted traffic data corresponding to a preset range is output, solving the technical problem of low traffic flow prediction accuracy and achieving the technical effect of improving traffic flow prediction accuracy.

[0128] Figure 6 This is a schematic diagram of the traffic flow prediction device provided in an embodiment of this application. The device in this embodiment can be in the form of software and / or hardware. Figure 6 As shown, the traffic flow prediction device 600 provided in this embodiment includes a processing module 601, a building module 602, and a prediction module 603.

[0129] Processing module 601 is used to acquire traffic data within a preset range and determine time feature information and spatial feature information based on the traffic data;

[0130] Module 602 is established to build a traffic network relationship model based on time and spatial feature information;

[0131] The prediction module 603 is used to determine the predicted traffic data corresponding to a preset range based on the traffic network relationship model.

[0132] In one possible implementation, the processing module 601 is further configured to:

[0133] Determine the time-series traffic data corresponding to the preset range based on traffic data;

[0134] The time-series traffic data is processed based on the first LSTM encoder model to determine the time-series feature information;

[0135] The time-series traffic data is processed based on the second LSTM encoder model to determine periodic feature information;

[0136] Time feature information is determined based on time series feature information and periodic feature information.

[0137] In one possible implementation, the processing module 601 is further configured to:

[0138] Based on the second LSTM encoder model, the time-series traffic data is divided into N sets of periodic traffic data corresponding to N preset time intervals; where N is a positive integer;

[0139] Periodic characteristic information is determined based on N sets of periodic traffic data.

[0140] In one possible implementation, the processing module 601 is further configured to:

[0141] Traffic data is processed using convolutional neural networks to determine map feature information corresponding to a preset range;

[0142] Based on traffic data, determine road information, road classification information, and / or traffic flow data;

[0143] Based on road information, road classification information, and / or traffic flow data, determine road characteristic information;

[0144] Spatial feature information is determined based on map feature information and road feature information.

[0145] In one possible implementation, the processing module 601 is further configured to:

[0146] Based on road information, road classification information, and / or traffic flow data, determine the road feature vector corresponding to the traffic data;

[0147] Based on road feature vectors, road feature information is determined.

[0148] In one possible implementation, module 602 is also used for:

[0149] Based on road feature information, temporal feature information, and periodic feature information, node feature information is determined;

[0150] Edge feature information is determined based on node feature information and map feature information;

[0151] Based on edge feature information and traffic flow data, determine the node connection strength information;

[0152] Construct the target matrix based on node feature information, edge feature information, and node connection strength information;

[0153] A graph attention network model is constructed based on the target matrix, and the graph attention network model is determined to be a traffic network relationship model; the traffic network relationship model is used to output the target feature representation.

[0154] In one possible implementation, the prediction module 603 is further used for:

[0155] Input the target feature representation into the target LSTM decoder model;

[0156] The target processing data is output from the target LSTM decoder model and then input into the target linear layer.

[0157] Predicted traffic data corresponding to a preset range is output based on the target linear layer.

[0158] This application provides a traffic flow prediction device that acquires traffic data within a preset range, determines temporal and spatial feature information based on the traffic data, establishes a traffic network relationship model based on the temporal and spatial feature information, and determines the predicted traffic data corresponding to the preset range based on the traffic network relationship model. Therefore, when performing traffic flow prediction, after acquiring traffic data within the preset range, it determines the corresponding temporal traffic data based on the traffic data, processes the temporal traffic data using a first LSTM encoder model to determine temporal feature information, processes the temporal traffic data using a second LSTM encoder model to determine periodic feature information, determines time feature information based on the temporal and periodic feature information, and processes the traffic data using a convolutional neural network to determine the map feature information corresponding to the preset range; it also determines road information, road classification information, and / or traffic flow data based on the traffic data; and it further determines road information, road classification information, and / or traffic flow data based on the road information and road classification information. Based on class information and / or traffic flow data, road feature information is determined; based on map feature information and road feature information, spatial feature information is determined; simultaneously, based on road feature information, temporal feature information, and periodic feature information, node feature information is determined; based on node feature information and map feature information, edge feature information is determined; based on edge feature information and traffic flow data, node connection strength information is determined; based on node feature information, edge feature information, and node connection strength information, a target matrix is ​​constructed; based on the target matrix, a graph attention network model is constructed, which is then used as a traffic network relationship model; finally, the target feature representation is input into the target LSTM decoder model, and the target processing data is output from the target LSTM decoder model and input into the target linear layer; based on the target linear layer, predicted traffic data corresponding to a preset range is output, solving the technical problem of low traffic flow prediction accuracy and achieving the technical effect of improving traffic flow prediction accuracy.

[0159] Figure 7 This is a hardware structure diagram of the traffic flow prediction device provided in an embodiment of this application. Figure 7 As shown, the traffic flow prediction device 700 includes:

[0160] Processor 701 and memory 702;

[0161] The memory stores the instructions that the computer executes;

[0162] The processor executes the computer execution instructions stored in memory 702, causing the traffic flow prediction device to perform the traffic flow prediction method described above.

[0163] It should be understood that the processor 701 described above can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The memory 702 may include high-speed random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk, or optical disc, etc.

[0164] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the traffic flow prediction method described above.

[0165] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0166] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0167] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.

[0168] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.

[0169] When integrated units / modules are implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Unless otherwise specified, the storage unit can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc.

[0170] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, 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. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0171] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.

[0172] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0173] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A traffic flow prediction method, characterized in that, include: The method involves acquiring traffic data within a preset range, and determining temporal and spatial feature information based on the traffic data. Specifically, determining the temporal and spatial feature information based on the traffic data includes: determining time-series traffic data corresponding to the preset range based on the traffic data; processing the time-series traffic data using a first LSTM encoder model to determine temporal feature information; processing the time-series traffic data using a second LSTM encoder model to determine periodic feature information; determining the temporal feature information based on the temporal feature information and the periodic feature information; processing the traffic data using a convolutional neural network to determine map feature information corresponding to the preset range; determining road information, road classification information, and / or traffic flow data based on the traffic data; determining road feature information based on the road information, the road classification information, and / or the traffic flow data; and determining the spatial feature information based on the map feature information and the road feature information. A traffic network relationship model is established based on the temporal and spatial feature information. This establishment includes: determining node feature information based on road feature information, temporal feature information, and periodic feature information; determining edge feature information based on the node feature information and map feature information; determining node connection strength information based on the edge feature information and traffic flow data; constructing a target matrix based on the node feature information, edge feature information, and node connection strength information; and constructing a graph attention network model based on the target matrix, defining the graph attention network model as the traffic network relationship model. The traffic network relationship model is used to output the target feature representation. Determining the predicted traffic data corresponding to the preset range based on the traffic network relationship model, wherein the step of determining the predicted traffic data corresponding to the preset range based on the traffic network relationship model includes: inputting the target feature representation into a target LSTM decoder model; outputting target processing data based on the target LSTM decoder model and inputting the target processing data into a target linear layer; and outputting the predicted traffic data corresponding to the preset range based on the target linear layer.

2. The method according to claim 1, characterized in that, The process of processing the time-series traffic data based on the second LSTM encoder model to determine periodic feature information includes: Based on the second LSTM encoder model, the time-series traffic data is divided into N sets of periodic traffic data corresponding to N preset time intervals; where N is a positive integer; The periodic characteristic information is determined based on N sets of periodic traffic data.

3. The method according to claim 2, characterized in that, The determination of road feature information based on the road information, the road classification information, and / or the traffic flow data includes: Based on the road information, the road classification information, and / or the traffic flow data, determine the road feature vector corresponding to the traffic data; Based on the road feature vector, the road feature information is determined.

4. A traffic flow prediction device, characterized in that, include: A processing module is used to acquire traffic data within a preset range, and determine temporal and spatial feature information based on the traffic data. The determination of temporal and spatial feature information based on the traffic data includes: determining time-series traffic data corresponding to the preset range based on the traffic data; processing the time-series traffic data based on a first LSTM encoder model to determine temporal feature information; processing the time-series traffic data based on a second LSTM encoder model to determine periodic feature information; determining the temporal feature information based on the temporal feature information and the periodic feature information; processing the traffic data based on a convolutional neural network to determine map feature information corresponding to the preset range; determining road information, road classification information, and / or traffic flow data based on the traffic data; determining road feature information based on the road information, the road classification information, and / or the traffic flow data; and determining the spatial feature information based on the map feature information and the road feature information. A module is established to build a traffic network relationship model based on the time feature information and the spatial feature information. The process of building the traffic network relationship model based on the time feature information and the spatial feature information includes: determining node feature information based on the road feature information, the temporal feature information, and the periodic feature information; determining edge feature information based on the node feature information and the map feature information; determining node connection strength information based on the edge feature information and the traffic flow data; constructing a target matrix based on the node feature information, the edge feature information, and the node connection strength information; and constructing a graph attention network model based on the target matrix, and determining the graph attention network model as the traffic network relationship model. The traffic network relationship model is used to output a target feature representation. The prediction module is used to determine the predicted traffic data corresponding to the preset range based on the traffic network relationship model. The step of determining the predicted traffic data corresponding to the preset range based on the traffic network relationship model includes: inputting the target feature representation into a target LSTM decoder model; outputting target processing data based on the target LSTM decoder model and inputting the target processing data into a target linear layer; and outputting the predicted traffic data corresponding to the preset range based on the target linear layer.

5. A traffic flow prediction device, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the traffic flow prediction device to perform the traffic flow prediction method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the traffic flow prediction method as described in any one of claims 1 to 3.