A traffic flow prediction method, device, electronic equipment, and storage medium

By constructing a regional node graph and using a neural network model to fuse node and edge features, the problem of inaccurate traffic flow prediction in existing technologies is solved, achieving more accurate traffic flow prediction and supporting efficient scheduling of remote assistance service systems.

CN115423162BActive Publication Date: 2026-11-17NINGBO LOTUS ROBOTICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211005895.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-22
Publication Date
2026-11-17
Estimated Expiration
2042-08-22

AI Technical Summary

Technical Problem

In existing technologies, traffic flow prediction is based solely on historical data for a region, resulting in incomplete and inaccurate predictions that fail to effectively consider the relationship between traffic flow impacts between regional nodes.

Method used

By constructing a regional node graph, extracting the features of nodes and edges, and using a machine learning neural network model to fuse the features, the traffic flow in the region to be predicted is predicted, taking into account the correlation and influence between regional nodes.

Benefits of technology

This improves the accuracy and comprehensiveness of traffic flow forecasting, which helps in the rational scheduling and dispatching of remote assistance service systems and reduces user waiting time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115423162B_ABST
    Figure CN115423162B_ABST
Patent Text Reader

Abstract

This invention discloses a traffic flow prediction method, device, electronic device, and storage medium, relating to the field of computer technology. The method includes: acquiring a regional node graph corresponding to a node in the region to be predicted; extracting node features of each regional node and target edge features of the corresponding edge of the node to be predicted based on historical traffic volume data of each regional node in the regional node graph; linearly fusing the node features of the node to be predicted with the target edge features of the corresponding edge of the node to be predicted to obtain a fused feature corresponding to the node to be predicted; and predicting the traffic flow of the node to be predicted based on the fused feature. This invention considers the mutual influence of traffic flow between regional nodes, making the traffic flow prediction results of the node to be predicted more comprehensive and accurate. This helps remote assistance service systems to rationally schedule and dispatch remote assistance personnel, while improving the utilization rate of remote intelligent cockpits and reducing user service waiting time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the rapid growth in the number of new energy vehicles equipped with intelligent driving systems in recent years, remote assistance services have emerged in high-traffic areas, such as congested highway sections, to provide users with a better driving and service experience. Remote assistance technology enables remote assistance specialists to remotely control target vehicles in real time from a remote intelligent cockpit, providing users with services such as "cloud-based valet driving" and remote parking.

[0003] Accurate traffic flow prediction for target areas within target time periods helps to better identify potential areas for remote assistance services for peak-traffic vehicles equipped with remote technology. This facilitates the remote assistance service system in scheduling and dispatching remote assistance specialists, while also improving the utilization rate of remote intelligent cockpits and reducing user service waiting time.

[0004] In related technologies, when predicting traffic flow in a target area at a future time, the prediction is based solely on the historical traffic flow data of that area, resulting in an incomplete and inaccurate prediction of regional traffic flow. Summary of the Invention

[0005] To address the problems of existing technologies, embodiments of the present invention provide a traffic flow prediction method, apparatus, electronic device, and storage medium. The technical solution is as follows:

[0006] Firstly, a traffic flow prediction method is provided, the method comprising:

[0007] Obtain the region node graph corresponding to the region node to be predicted. The edges in the region node graph represent the initial association relationship between the region nodes connected by the edges. Each region node in the region node graph includes the region node to be predicted.

[0008] Based on the historical vehicle traffic volume data of each regional node in the regional node map, the node features of each regional node are extracted.

[0009] Based on the regional node graph, target edge features are extracted from the edges corresponding to the nodes to be predicted in the region. The target edge features characterize the degree of influence of the traffic flow of the regional nodes connected by the corresponding edge on the traffic flow of the nodes to be predicted in the region.

[0010] The node features of the node to be predicted are linearly fused with the target edge features of the corresponding edge of the node to be predicted to obtain the fused features corresponding to the node to be predicted.

[0011] The traffic flow of the nodes in the region to be predicted is predicted based on the fusion features corresponding to the nodes in the region to be predicted.

[0012] Optionally, the traffic flow prediction method is implemented based on a traffic flow prediction model, and the step of extracting the target edge features of the corresponding edges of the nodes in the region to be predicted based on the region node graph includes:

[0013] Initial association features are determined based on the edges in the region node graph;

[0014] The initial association features are input into the first side feature extraction network of the traffic flow prediction model for side feature extraction processing to obtain the first association features;

[0015] The first associated feature is input into the attention network of the traffic flow prediction model, and the attention feature is determined through the attention network; the attention feature represents the importance of each edge corresponding to each region node;

[0016] The initial association features and the attention features are linearly fused, and the target edge features corresponding to the nodes in the region to be predicted are obtained based on the fusion result.

[0017] Optionally, the attention network includes a network based on a multi-head attention mechanism; the step of inputting the first associated feature into the attention network of the traffic flow prediction model, and determining the attention feature through the attention network, includes:

[0018] The first associated feature is input into the attention network of the traffic flow prediction model, and each attention head in the attention network determines its corresponding sub-attention feature based on the first associated feature.

[0019] The attention features are obtained by concatenating the sub-attention features corresponding to each attention head.

[0020] Optionally, extracting the node features of each regional node based on the historical vehicle volume data of each regional node in the regional node graph includes:

[0021] The historical vehicle volume data of each regional node in the regional node graph is input into the node feature extraction network of the traffic flow prediction model. The output features of the hidden layer of the node feature extraction network are obtained to obtain the node features of each regional node.

[0022] Optionally, the method further includes training the traffic flow prediction model, wherein training the traffic flow prediction model includes:

[0023] Obtain training samples, which include a sample region node graph corresponding to the sample region node and historical traffic flow data of each region node in the sample region node graph; the training samples carry traffic flow labels corresponding to the sample region nodes.

[0024] The historical traffic flow data of each regional node in the sample area node graph is input into the initial node feature extraction network of the initial traffic flow prediction model to obtain the sample node features of each regional node in the sample area node graph.

[0025] The sample area node graph is input into the initial edge feature extraction network of the initial traffic flow prediction model to obtain the sample edge features of the corresponding edges of the sample area nodes.

[0026] The sample node features corresponding to the sample region node are linearly fused with the sample edge features corresponding to the sample region node to obtain the fused features corresponding to the sample region node.

[0027] Traffic flow is predicted based on the fusion features corresponding to the nodes in the sample area, and the predicted traffic flow of the nodes in the sample area is obtained.

[0028] The parameters of the initial traffic flow prediction model are adjusted based on the predicted traffic flow of the sample area nodes and the traffic flow labels until the preset training termination condition is met, thus obtaining the traffic flow prediction model.

[0029] Optionally, the step of inputting the sample region node graph into the initial edge feature extraction network of the initial traffic flow prediction model to obtain the sample edge features of the edges corresponding to each region node in the sample region node graph includes:

[0030] Initial sample association features are determined based on the edges in the node graph of the sample region;

[0031] The initial sample association features are input into the initial first edge feature extraction network of the initial edge feature extraction network for edge feature extraction processing to obtain the first sample association features;

[0032] The first sample association features are input into the initial attention network of the initial edge feature extraction network, and the sample attention features are determined through the initial attention network; the sample attention features characterize the importance of each edge corresponding to each region node in the sample region node graph;

[0033] The initial sample association features and the sample attention features are linearly fused, and the sample edge features corresponding to each region node in the sample region node graph are obtained based on the fusion result.

[0034] Optionally, adjusting the parameters of the initial traffic flow prediction model based on the predicted traffic flow of the sample area nodes and the traffic flow label until a preset training termination condition is met, thereby obtaining the traffic flow prediction model, includes:

[0035] The loss value is determined based on the difference between the predicted traffic flow of the sample area nodes and the traffic flow label;

[0036] Constraint information is determined based on the sample attention features, and the constraint information is multiplied by the adjustment coefficient to obtain the target constraint condition;

[0037] Based on the loss value and target constraints, the parameters of the initial traffic flow prediction model are adjusted until the preset training termination condition is met, thus obtaining the traffic flow prediction model.

[0038] On the other hand, a traffic flow prediction device is provided, the device comprising:

[0039] The data acquisition module is used to acquire the region node graph corresponding to the region node to be predicted. The edges in the region node graph represent the initial association relationship between the region nodes connected by the edges. Each region node in the region node graph includes the region node to be predicted.

[0040] The first feature extraction module is used to extract the node features of each regional node based on the historical vehicle volume data of each regional node in the regional node map.

[0041] The second feature extraction module is used to extract the target edge features of the corresponding edges of the nodes to be predicted based on the regional node graph; the target edge features characterize the degree of influence of the traffic flow of the regional nodes connected by the corresponding edge on the traffic flow of the nodes to be predicted.

[0042] The feature fusion module is used to linearly fuse the node features of the node in the region to be predicted with the target edge features of the corresponding edge of the node in the region to be predicted, so as to obtain the fused features corresponding to the node in the region to be predicted.

[0043] The traffic flow prediction module is used to predict the traffic flow of the nodes in the area to be predicted based on the fusion features corresponding to the nodes in the area to be predicted.

[0044] Optionally, the traffic flow prediction device predicts traffic flow through a traffic flow prediction model, and the second feature extraction module includes:

[0045] An initial association feature determination module is used to determine initial association features based on the edges in the region node graph;

[0046] The first associated feature extraction module is used to input the initial associated features into the first side feature extraction network of the traffic flow prediction model for side feature extraction processing to obtain the first associated features;

[0047] An attention feature extraction module is used to input the first associated feature into the attention network of the traffic flow prediction model, and determine the attention feature through the attention network; the attention feature represents the importance of each edge corresponding to each region node;

[0048] The target edge feature extraction module is used to linearly fuse the initial association features and the attention features, and obtain the target edge features of the edges corresponding to the nodes in the region to be predicted based on the fusion result.

[0049] Optionally, the attention network includes a network based on a multi-head attention mechanism; the attention feature extraction module includes:

[0050] The sub-attention feature extraction unit is used to input the first associated feature into the attention network of the traffic flow prediction model, and to determine the corresponding sub-attention feature based on the first associated feature by each attention head in the attention network.

[0051] The feature splicing unit is used to splice the sub-attention features corresponding to each attention head to obtain the attention features.

[0052] Optionally, the traffic flow prediction device further includes a training module for training the traffic flow prediction model, the training module comprising:

[0053] The sample acquisition module is used to acquire training samples, which include a sample area node graph corresponding to the sample area node and historical traffic flow data of each area node in the sample area node graph; the training samples carry traffic flow labels corresponding to the sample area nodes.

[0054] The first sample feature extraction module is used to input the historical traffic flow data of each regional node in the sample region node graph into the initial node feature extraction network of the initial traffic flow prediction model to obtain the sample node features of each regional node in the sample region node graph.

[0055] The second sample feature extraction module is used to input the sample area node graph into the initial edge feature extraction network of the initial traffic flow prediction model to obtain the sample edge features of the corresponding edges of the sample area nodes.

[0056] The sample feature fusion module is used to linearly fuse the sample node features corresponding to the sample region node with the sample edge features corresponding to the sample region node to obtain the fused features corresponding to the sample region node.

[0057] The parameter adjustment module is used to predict traffic flow based on the fusion features corresponding to the nodes in the sample area, and obtain the predicted traffic flow of the nodes in the sample area; adjust the parameters of the initial traffic flow prediction model according to the predicted traffic flow of the nodes in the sample area and the traffic flow label, until the preset training termination condition is met, and obtain the traffic flow prediction model.

[0058] Optionally, the second sample feature extraction module includes:

[0059] The initial sample association feature determination module is used to determine the initial sample association features based on the edges in the node graph of the sample region.

[0060] The first sample association feature determination module is used to input the initial sample association features into the initial first side feature extraction network of the initial side feature extraction network for side feature extraction processing to obtain the first sample association features;

[0061] The sample attention feature determination module is used to input the first sample association features into the initial attention network of the initial edge feature extraction network, and determine the sample attention features through the initial attention network; the sample attention features characterize the importance of each edge corresponding to each region node in the sample region node graph;

[0062] The sample edge feature determination module is used to linearly fuse the initial sample association features and the sample attention features, and obtain the sample edge features of each region node in the sample region node graph based on the fusion result.

[0063] Optionally, the parameter adjustment module includes:

[0064] The loss value calculation unit is used to determine the loss value based on the difference between the predicted traffic flow of the sample area node and the traffic flow label;

[0065] The target constraint determination unit is used to determine constraint information based on the sample attention features and multiply the constraint information by the adjustment coefficient to obtain the target constraint.

[0066] The parameter adjustment unit is used to adjust the parameters of the initial traffic flow prediction model based on the loss value and the target constraint until the preset training termination condition is met, thereby obtaining the traffic flow prediction model.

[0067] On the other hand, a server is provided, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the above-described traffic flow prediction method.

[0068] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the traffic flow prediction method as described above.

[0069] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the traffic flow prediction method provided in the various alternative implementations described above.

[0070] The technical solutions of the embodiments of the present invention have the following beneficial effects:

[0071] By identifying the relevant regional node graph for each node in the region to be predicted, the target edge features of the corresponding edges of the nodes in the region to be predicted are fused with the node features of the region to be predicted. Based on the new fused features, the traffic flow of the nodes in the region to be predicted is predicted. The fused features include the weight features of the edges related to the nodes to be predicted, taking into account the mutual influence and correlation of traffic flow between regional nodes. This makes the traffic flow prediction results of the nodes to be predicted more comprehensive and accurate, which helps the remote assistance service system to reasonably schedule and dispatch remote assistance specialists, while improving the utilization rate of the remote intelligent cockpit and reducing user service waiting time. Attached Figure Description

[0072] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0073] Figure 1 This is a flowchart illustrating a traffic flow prediction method in the prior art;

[0074] Figure 2 This is a schematic diagram of the overall framework of a traffic flow prediction method provided in an embodiment of the present invention;

[0075] Figure 3 This is a flowchart illustrating a traffic flow prediction method provided in an embodiment of the present invention;

[0076] Figure 4 This is a schematic diagram of regional nodes for implementing the traffic flow prediction method provided in this embodiment of the invention;

[0077] Figure 5This is a schematic diagram of an optional method for implementing the traffic flow prediction method provided in an embodiment of the present invention;

[0078] Figure 6 This is a schematic diagram of the traffic flow prediction model structure for implementing the traffic flow prediction method provided in this embodiment of the invention;

[0079] Figure 7 This is a structural block diagram of a traffic flow prediction device provided in an embodiment of the present invention;

[0080] Figure 8 This is a hardware structure block diagram of a server provided in an embodiment of the present invention. Detailed Implementation

[0081] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0082] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0083] Because traffic congestion is continuous across regions, congestion in one area often leads to congestion in neighboring areas. Existing traffic flow prediction models are typically based on mesh data structures, focusing on the data characteristics of the nodes within each region to predict traffic flow. For example... Figure 1The flowchart shown illustrates a traffic flow prediction scheme. This scheme collects historical data for a region to be predicted. The collected data exhibits periodicity, including monthly and weekly historical data. An LSTM (Long Short-Term Memory) neural network is used to build and train a model for learning representations of the historical data. LSTM is a type of recurrent neural network suitable for processing and predicting events with long intervals or delays in time series. This scheme incorporates an attention mechanism into the LSTM, considering the weighted influence of each periodic time series, and predicts the traffic flow for the region at the next time point using the region's periodic historical data. However, this scheme only considers the temporal characteristics of traffic flow within a single region node, neglecting the fact that connections between region nodes also possess excellent representational properties. Therefore, traditional traffic flow prediction models cannot effectively represent the traffic flow relationships between region nodes.

[0084] The traffic flow prediction method provided in this invention is based on a neural network model implemented using machine learning. Machine learning is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, and many other disciplines. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.

[0085] See Figure 2 The diagram illustrates the overall framework of a traffic flow prediction method provided by an embodiment of the present invention. The traffic flow prediction model of this embodiment includes a node feature extraction network and an edge feature extraction network. The node feature extraction network is a neural network layer based on node features, and the edge feature extraction network includes a first edge feature extraction network and an attention network, which is an edge-based attention mechanism layer. The node features extracted by the node feature extraction network and the target edge features extracted by the edge feature extraction network are fused to obtain fused features. Traffic flow prediction is then performed on the nodes in the region to be predicted based on these fused features. Detailed steps are described below.

[0086] See Figure 3The diagram illustrates a flow chart of a traffic flow prediction method according to an embodiment of the present invention. It should be noted that while this specification provides the operational steps described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive methods. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment). The traffic flow prediction method of this invention is based on a traffic flow prediction model and may include:

[0087] S301, Obtain the region node graph corresponding to the region node to be predicted. The edges in the region node graph represent the initial association relationship between the region nodes connected by the edges. Each region node in the region node graph includes the region node to be predicted.

[0088] Specifically, each regional node in the regional node graph represents a location that can be used for remote assistance services. See also... Figure 4 The diagram illustrates a regional node diagram of an embodiment of the traffic flow prediction method of the present invention. For example, in a city, there are service points A1, A2, and A3 of shopping mall A, and the same city's highway entrance B. The node to be predicted can be any regional node in the regional node diagram, such as service point A3 of shopping mall A. The collected historical traffic volume data is traffic flow data from highway entrances or shopping mall parking lot entrances, statistically analyzed at set time intervals using a remote assistance service system. This data includes three features: traffic volume, vehicle speed, and lane occupancy. Directed connections between regional nodes indicate that remote assistance services can be provided between the nodes. The initial value of the edges between regional nodes is set to 1 by default, representing the initial association between the regional nodes.

[0089] S302, Based on the historical vehicle traffic volume data of each regional node in the regional node map, extract the node features of each regional node;

[0090] Specifically, the traffic flow prediction method of this invention is implemented based on a traffic flow prediction model, and step S302 includes:

[0091] The historical vehicle volume data of each regional node in the regional node graph is input into the node feature extraction network of the traffic flow prediction model. The output features of the hidden layer of the node feature extraction network are obtained to obtain the node features of each regional node.

[0092] In one possible implementation, the node feature extraction network is a neural network layer based on node features. The node features are represented in matrix form, mapping the historical traffic volume data features of each regional node to an initial node matrix Input. This node matrix has N nodes (the number of nodes is the same as the number of regional nodes in the regional node graph), and each node contains F features (such as traffic volume, vehicle speed, and lane occupancy). Therefore, the size of the node feature matrix is ​​N-by-F. The initial node matrix Input is used as the input matrix of the node feature extraction network. The output of the node feature extraction network is the output matrix of the hidden layer, which is an N-by-F' dimension matrix, where F' represents the hidden state of the node feature extraction network output. The initial node matrix Input is then compared with the weight matrix... Combined, the outputs of the hidden layers can be obtained as an output matrix of size N-by-F':

[0093] H = InputW Input

[0094] The node features of each region node are obtained from the output matrix H, which includes the node features of the region node to be predicted.

[0095] S303, Based on the regional node graph, extract the target edge features of the corresponding edges of the regional nodes to be predicted; the target edge features characterize the degree of influence of the traffic flow of the regional nodes connected by the corresponding edge on the traffic flow of the regional nodes to be predicted.

[0096] This step is implemented based on the edge feature extraction network of the traffic flow prediction model. In one possible implementation, the edge feature extraction network is a self-attention mechanism layer, and step S303 may include:

[0097] Initial association features are determined based on the edges in the region node graph;

[0098] The initial association features are input into the first side feature extraction network of the traffic flow prediction model for side feature extraction processing to obtain the first association features;

[0099] The first associated feature is input into the attention network of the traffic flow prediction model, and the attention feature is determined through the attention network; the attention feature represents the importance of each edge corresponding to each region node;

[0100] The initial association features and the attention features are linearly fused, and the target edge features corresponding to the nodes in the region to be predicted are obtained based on the fusion result.

[0101] Specifically, in one possible implementation, similar to obtaining the initial node matrix based on node features, an initial adjacency matrix is ​​obtained based on the initial association relationships of each region node in the region node graph. This initial adjacency matrix contains the initial association features of the edges corresponding to each region node. Since the initial value of the edges between region nodes is set to 1 by default, the initial adjacency matrix E is obtained.

[0102] E = {e1, e2, ... e} N}, e∈R N

[0103] Where N represents the number of nodes, and each node contains N values. The initial adjacency matrix E is used as the input matrix to the edge feature extraction network of the traffic flow prediction model. In the first edge feature extraction network of this model, the weight matrix W... links ∈R F′×N Parameterization, the initial adjacency matrix E is determined according to tanh(W links E T Perform a linear transformation, where E T Let be the transpose of the initial adjacency matrix E, and tanh be the activation function of the first edge feature extraction network. The output matrix is ​​a first adjacency matrix of size F'-by-N. The first associated feature is obtained from the first adjacency matrix. The first adjacency matrix is ​​expressed as:

[0104]

[0105] The attention network in the input edge feature extraction network is applied to a single region node (such as the node to be predicted), and an attention weight vector a is output:

[0106] a = w attt anh(W links E T )

[0107] This process references Figure 5 , where w att Let w represent a weight vector of size 1-by-F', and the attention weight vector a of size 1-by-N, representing the hidden or potential importance of each edge corresponding to a single node. Further, in this embodiment of the invention, there are N region nodes in the region node graph, therefore the extended weight vector w... att To the weight matrix W att The size of the attention weight vector a is N-by-F', and the attention weight vector a is transformed into an attention weight matrix A of size N-by-N, with the same dimension as the initial adjacency matrix. The attention weight matrix A represents the different potential importance of all edges j of region node i, without considering the node characteristics of the region node itself. The attention weight matrix A is expressed as:

[0108] A = a ij =W att tanh(W links E T )

[0109] In the equation, j is the connecting edge, representing all neighboring nodes of region node i, that is, the first-order nodes of region node i.

[0110] Continue to refer to Figure 5 To ensure the comparability of coefficients for all edges j of region node i, regularization is introduced into the attention network. In one possible implementation, a softmax function is used, representing that for region node i, the sum of the importance of all edges j in that node is 1. The attention weight matrix A is then expressed as:

[0111]

[0112] To obtain an attention weight matrix A with better weight feature performance, a non-linear function, LeakyReLU, is also introduced. In one embodiment, the negative slope of LeakyReLU can be set to 0.2. The expression for the attention weight matrix A can be expanded as follows:

[0113]

[0114] The attention features are obtained from the attention weight matrix A. Then, the target adjacency matrix is ​​obtained based on the second attention matrix A. The attention weight matrix A is multiplied by the initial adjacency matrix E to obtain the target adjacency matrix E. new =AE, based on the target adjacency matrix, the target edge features of each region node in the region node graph can be obtained, including the target edge features of the edges corresponding to the nodes to be predicted. That is, the attention features and the initial association features are linearly fused, and the target edge features of the edges corresponding to the nodes to be predicted are obtained based on the fusion result.

[0115] S304, linearly fuse the node features of the node in the region to be predicted with the target edge features of the corresponding edge of the node in the region to be predicted to obtain the fused features corresponding to the node in the region to be predicted.

[0116] Specifically, in this embodiment of the invention, a fusion feature matrix is ​​obtained by passing the target adjacency matrix and the output matrix H of the nodes in the region to be predicted through a nonlinear function σ, thereby acquiring the fusion features corresponding to the nodes in the region to be predicted. j The initial node features of the nodes in the region to be predicted are represented by the fused feature matrix as follows:

[0117]

[0118] The fusion features obtained in this embodiment of the invention include weight features of edges related to the node to be predicted, and take into account the degree of mutual influence and correlation of traffic flow between regional nodes, making the traffic flow prediction results of the node to be predicted more comprehensive and accurate. This helps the remote assistance service system to reasonably schedule and dispatch remote assistance specialists, while improving the utilization rate of the remote intelligent cockpit and reducing user service waiting time.

[0119] In another possible implementation, to obtain a more stable and accurate attention structure, the attention network includes a network based on a multi-head attention mechanism, and step S303 further includes:

[0120] The first associated feature is input into the attention network of the traffic flow prediction model. Each attention head in the attention network determines its corresponding sub-attention feature based on the first associated feature. The sub-attention features corresponding to each attention head are concatenated to obtain the attention feature.

[0121] Specifically, the number of multi-head attention mechanisms is K. Similar to the self-attention mechanism, each attention head's attention weight matrix A is obtained based on its own attention mechanism. That is, each attention head in the attention network determines its corresponding sub-attention features based on the first associated feature. Then, the sub-attention features are concatenated to obtain the attention features obtained based on the multi-head attention mechanism. These features are then linearly fused with the initial associated feature to obtain the target edge features of the edges corresponding to the nodes in the region to be predicted. Thus, the fused feature matrix corresponding to the nodes in the region to be predicted is represented as follows:

[0122]

[0123] Where || represents cascade splicing. This represents the target adjacency matrix generated by the k-th attention mechanism. This represents the corresponding weight matrix. In the traffic flow prediction model based on the multi-head attention mechanism, the size of the node matrix output by the node feature extraction network is N×KF′, where N represents the number of nodes, K represents the number of heads in the multi-head attention mechanism, and F′ represents the hidden state output by the node feature extraction network.

[0124] S305, predict the traffic flow of the nodes in the region to be predicted based on the fusion features corresponding to the nodes in the region to be predicted.

[0125] Based on this fusion feature, the traffic flow of the nodes in the region to be predicted is predicted. This not only considers the data characteristics of the nodes in the region to be predicted, but also includes the weight characteristics of the edges related to the nodes to be predicted, that is, the degree of mutual influence and correlation of traffic flow between regional nodes, making the traffic flow prediction results of the nodes to be predicted more comprehensive and accurate.

[0126] Furthermore, the traffic flow prediction model used in this embodiment of the invention can also be used to predict the traffic flow of another city B that has not collected relevant data, based on the traffic flow data collected in city A, and then to infer the demand for remote assistance services in city B. This process is similar to the implementation steps of the above embodiments, and will not be repeated here.

[0127] The training of the traffic flow prediction model in this embodiment of the invention is described below. The model structure of the traffic flow prediction model is as follows: Figure 6 As shown. The training process for a traffic flow prediction model may include the following steps:

[0128] (1) Obtain training samples, the training samples include sample area node graphs corresponding to sample area nodes and historical traffic flow data of each area node in the sample area node graph; the training samples carry traffic flow labels corresponding to the sample area nodes.

[0129] Historical traffic flow data can include traffic volume, vehicle speed, lane occupancy, etc. Traffic flow labels can be used to characterize the congestion status of nodes in the sample area using vehicle congestion levels, and the specific settings are determined according to the actual situation.

[0130] (2) Input the historical traffic flow data of each regional node in the sample area node graph into the initial node feature extraction network of the initial traffic flow prediction model to obtain the sample node features of each regional node in the sample area node graph.

[0131] The specific details of extracting sample node features from each region node in the sample region node graph are similar to those in the prediction process in model applications; please refer to the foregoing embodiments of this invention. Figure 3 The relevant content in the method embodiment shown will not be repeated here.

[0132] (3) Input the node graph of the sample area into the initial edge feature extraction network of the initial traffic flow prediction model to obtain the sample edge features of the corresponding edges of the sample area nodes.

[0133] In one possible implementation, the step includes:

[0134] Initial sample association features are determined based on the edges in the node graph of the sample region;

[0135] The initial sample association features are input into the initial first edge feature extraction network of the initial edge feature extraction network for edge feature extraction processing to obtain the first sample association features;

[0136] The first sample association features are input into the initial attention network of the initial edge feature extraction network, and the sample attention features are determined through the initial attention network; the sample attention features characterize the importance of each edge corresponding to each region node in the sample region node graph;

[0137] The initial sample association features and the sample attention features are linearly fused, and the sample edge features corresponding to each region node in the sample region node graph are obtained based on the fusion result.

[0138] The above process is similar to prediction in model applications, as can be found in the foregoing embodiments of this invention. Figure 3 The relevant content in the method embodiment shown will not be repeated here.

[0139] (4) Linearly fuse the sample node features corresponding to the sample region node with the sample edge features corresponding to the sample region node to obtain the fused features corresponding to the sample region node.

[0140] The linear fusion process of the sample node features of the sample region nodes and the sample edge features of the corresponding edges of the sample region nodes is similar to the prediction in model applications, as can be found in the foregoing embodiments of the present invention. Figure 3 The relevant content in the method embodiment shown will not be repeated here.

[0141] (5) Based on the fusion features corresponding to the sample area nodes, traffic flow is predicted to obtain the predicted traffic flow of the sample area nodes.

[0142] (6) Adjust the parameters of the initial traffic flow prediction model according to the predicted traffic flow of the sample area nodes and the traffic flow label until the preset training termination condition is met, and obtain the traffic flow prediction model.

[0143] In one possible implementation, the step includes:

[0144] The loss value is determined based on the difference between the predicted traffic flow of the sample area nodes and the traffic flow label;

[0145] Constraint information is determined based on the sample attention features, and the constraint information is multiplied by the adjustment coefficient to obtain the target constraint condition;

[0146] Based on the loss value and target constraints, the parameters of the initial traffic flow prediction model are adjusted until the preset training termination condition is met, thus obtaining the traffic flow prediction model.

[0147] Specifically, a preset loss function can be used to calculate the loss value based on the traffic flow of the sample region nodes and the traffic flow label. Then, the parameters in the initial traffic flow prediction model are adjusted in the direction of minimizing the loss value until the training termination condition is met, thus completing the training of the traffic flow prediction model. This training termination condition can be that the loss value reaches a preset loss threshold, or that the number of iterations reaches a preset number of iterations. Different loss functions can be selected according to actual needs. In this embodiment of the invention, the preset loss function is the softmax loss function.

[0148]

[0149] Where l represents the loss value, y N The traffic flow label of the node in the sample region represents the true value of the sample, and N represents the number of training samples. This is a traffic flow forecast.

[0150] Furthermore, the traffic flow prediction model trained by machine learning can be described by its "fit" as it learns from the data. A model with fewer regression or classification errors on new samples has a better "fit," but "overfit" can lead to larger prediction errors. The attention features obtained in step (3) may generate similar attention weights after passing through a network structure based on the attention mechanism, resulting in the problem of "overfit." Therefore, a penalty term is introduced, namely, the objective constraint of minimizing the similarity of edges between nodes in the region, to improve the expressiveness and diversity of the traffic flow prediction model. In this embodiment of the invention, the expression of the penalty term P is:

[0151]

[0152] The attention weight matrix corresponding to the attention features of the sample is multiplied by its transpose, and then a unit matrix of the same size is subtracted (to ignore the similarity between a node and its own edge). ||·|| represents the Frobenius norm of the matrix. For example, the Frobenius norm of matrix X is defined as the square root of the sum of the squares of the absolute values ​​of the elements of matrix X. In this embodiment of the invention, an L2 regularization term is used to represent the Frobenius norm. The L2 regularization term is expressed as: w is the weight coefficient vector, and i represents each element of the matrix.

[0153] Subsequently, the penalty term P is multiplied by the adjustment coefficient lambda and used together with the preset loss function to train the traffic flow prediction model. The adjustment coefficient lambda can be adjusted from 0. For different regional nodes, the penalty factor will encourage regional nodes to focus on different edges, prompting each regional node to find the most relevant or most important edges, and then set the weight of other irrelevant edges to 0, that is, ignore meaningless edges and reduce redundant features between every two regional nodes.

[0154] Corresponding to the traffic flow prediction methods provided in the above embodiments, this embodiment of the invention also provides a traffic flow prediction device. Since the traffic flow prediction device provided in this embodiment corresponds to the traffic flow prediction methods provided in the above embodiments, the implementation methods of the aforementioned traffic flow prediction methods are also applicable to the traffic flow prediction device provided in this embodiment, and will not be described in detail in this embodiment.

[0155] Please see Figure 7 The diagram shows a schematic representation of a traffic flow prediction device according to an embodiment of the present invention. This device has the function of implementing the traffic flow prediction method described in the above-described method embodiments. This function can be implemented in hardware or by hardware executing corresponding software. Figure 7 As shown, the device may include:

[0156] The data acquisition module 710 is used to acquire the region node graph corresponding to the region node to be predicted. The edges in the region node graph represent the initial association relationship between the region nodes connected by the edges. Each region node in the region node graph includes the region node to be predicted.

[0157] The first feature extraction module 720 is used to extract the node features of each regional node based on the historical vehicle volume data of each regional node in the regional node map.

[0158] The second feature extraction module 730 is used to extract the target edge features of the corresponding edges of the nodes to be predicted based on the region node graph; the target edge features characterize the degree of influence of the traffic flow of the region nodes connected by the corresponding edge on the traffic flow of the nodes to be predicted.

[0159] The feature fusion module 740 is used to linearly fuse the node features of the node in the region to be predicted with the target edge features of the corresponding edge of the node in the region to be predicted, so as to obtain the fused features corresponding to the node in the region to be predicted.

[0160] The traffic flow prediction module 750 is used to predict the traffic flow of the nodes in the area to be predicted based on the fusion features corresponding to the nodes in the area to be predicted.

[0161] Optionally, the traffic flow prediction device predicts traffic flow through a traffic flow prediction model, and the second feature extraction module 730 includes:

[0162] An initial association feature determination module is used to determine initial association features based on the edges in the region node graph;

[0163] The first associated feature extraction module is used to input the initial associated features into the first side feature extraction network of the traffic flow prediction model for side feature extraction processing to obtain the first associated features;

[0164] An attention feature extraction module is used to input the first associated feature into the attention network of the traffic flow prediction model, and determine the attention feature through the attention network; the attention feature represents the importance of each edge corresponding to each region node;

[0165] The target edge feature extraction module is used to linearly fuse the initial association features and the attention features, and obtain the target edge features of the edges corresponding to the nodes in the region to be predicted based on the fusion result.

[0166] Optionally, the attention network includes a network based on a multi-head attention mechanism; the attention feature extraction module includes:

[0167] The sub-attention feature extraction unit is used to input the first associated feature into the attention network of the traffic flow prediction model, and to determine the corresponding sub-attention feature based on the first associated feature by each attention head in the attention network.

[0168] The feature splicing unit is used to splice the sub-attention features corresponding to each attention head to obtain the attention features.

[0169] Optionally, the traffic flow prediction device further includes a training module for training the traffic flow prediction model. The traffic flow prediction device also includes a training module 760, which comprises:

[0170] The sample acquisition module is used to acquire training samples, which include a sample area node graph corresponding to the sample area node and historical traffic flow data of each area node in the sample area node graph; the training samples carry traffic flow labels corresponding to the sample area nodes.

[0171] The first sample feature extraction module is used to input the historical traffic flow data of each regional node in the sample region node graph into the initial node feature extraction network of the initial traffic flow prediction model to obtain the sample node features of each regional node in the sample region node graph.

[0172] The second sample feature extraction module is used to input the sample area node graph into the initial edge feature extraction network of the initial traffic flow prediction model to obtain the sample edge features of the corresponding edges of the sample area nodes.

[0173] The sample feature fusion module is used to linearly fuse the sample node features corresponding to the sample region node with the sample edge features corresponding to the sample region node to obtain the fused features corresponding to the sample region node.

[0174] The parameter adjustment module is used to predict traffic flow based on the fusion features corresponding to the nodes in the sample area, and obtain the predicted traffic flow of the nodes in the sample area; adjust the parameters of the initial traffic flow prediction model according to the predicted traffic flow of the nodes in the sample area and the traffic flow label, until the preset training termination condition is met, and obtain the traffic flow prediction model.

[0175] Optionally, the second sample feature extraction module includes:

[0176] The initial sample association feature determination module is used to determine the initial sample association features based on the edges in the node graph of the sample region.

[0177] The first sample association feature determination module is used to input the initial sample association features into the initial first side feature extraction network of the initial side feature extraction network for side feature extraction processing to obtain the first sample association features;

[0178] The sample attention feature determination module is used to input the first sample association features into the initial attention network of the initial edge feature extraction network, and determine the sample attention features through the initial attention network; the sample attention features characterize the importance of each edge corresponding to each region node in the sample region node graph;

[0179] The sample edge feature determination module is used to linearly fuse the initial sample association features and the sample attention features, and obtain the sample edge features of each region node in the sample region node graph based on the fusion result.

[0180] Optionally, the parameter adjustment module includes:

[0181] The loss value calculation unit is used to determine the loss value based on the difference between the predicted traffic flow of the sample area node and the traffic flow label;

[0182] The target constraint determination unit is used to determine constraint information based on the sample attention features and multiply the constraint information by the adjustment coefficient to obtain the target constraint.

[0183] The parameter adjustment unit is used to adjust the parameters of the initial traffic flow prediction model based on the loss value and the target constraint until the preset training termination condition is met, thereby obtaining the traffic flow prediction model.

[0184] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0185] This invention provides an electronic device including a processor and a memory. The memory stores at least one instruction or at least one program, which is loaded and executed by the processor to implement the traffic flow prediction method provided in the above method embodiments.

[0186] The memory can be used to store software programs and modules. The processor executes various functional applications and traffic flow prediction by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, applications required for the functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.

[0187] The methods and embodiments provided in this invention can be executed on a computer terminal, server, or similar computing device. Taking running on a server as an example... Figure 8 This is a hardware structure block diagram of a server running a traffic flow prediction method provided in an embodiment of the present invention, as shown below. Figure 8As shown, the server 800 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 810 (CPUs 810 may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), a memory 830 for storing data, and one or more storage media 820 (e.g., one or more mass storage devices) for storing application programs 823 or data 822. The memory 830 and storage media 820 may be temporary or persistent storage. The program stored in the storage media 820 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 810 may be configured to communicate with the storage media 820 and execute the series of instruction operations stored in the storage media 820 on the server 800. Server 800 may also include one or more power supplies 860, one or more wired or wireless network interfaces 850, one or more input / output interfaces 840, and / or one or more operating systems 821, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0188] The input / output interface 840 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 800. In one example, the input / output interface 840 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 840 may be a radio frequency (RF) module for wireless communication with the Internet.

[0189] Those skilled in the art will understand that Figure 8 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 800 may also include... Figure 8 The more or fewer components shown, or having the same Figure 8 The different configurations shown.

[0190] Embodiments of the present invention also provide a computer-readable storage medium, which may be disposed in a server to store at least one instruction or at least one program related to implementing a traffic flow prediction method, wherein the at least one instruction or the at least one program is loaded and executed by the processor to implement the traffic flow prediction method provided in the above-described method embodiments.

[0191] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0192] Embodiments of the present invention also provide a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the traffic flow prediction method provided in the various optional implementations described above.

[0193] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0194] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0195] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0196] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A traffic flow prediction method, characterized in that, The traffic flow prediction method is based on a traffic flow prediction model, and the method includes: Obtain the region node graph corresponding to the region node to be predicted. The edges in the region node graph represent the initial association relationship between the region nodes connected by the edges. Each region node in the region node graph includes the region node to be predicted. Based on the historical vehicle traffic volume data of each regional node in the regional node map, the node features of each regional node are extracted. Based on the regional node graph, target edge features are extracted from the edges corresponding to the nodes to be predicted in the region. The target edge features characterize the degree of influence of the traffic flow of the regional nodes connected by the corresponding edge on the traffic flow of the nodes to be predicted in the region. The node features of the node to be predicted are linearly fused with the target edge features of the corresponding edge of the node to be predicted to obtain the fused features corresponding to the node to be predicted. Predict the traffic flow of the nodes in the area to be predicted based on the fusion features corresponding to the nodes in the area to be predicted. The step of extracting the target edge features of the corresponding edges of the nodes in the region to be predicted based on the region node graph includes: Initial association features are determined based on the edges in the region node graph; The initial association features are input into the first side feature extraction network of the traffic flow prediction model for side feature extraction processing to obtain the first association features; The first associated feature is input into the attention network of the traffic flow prediction model, and the attention feature is determined through the attention network; the attention feature characterizes the importance of each edge corresponding to each region node; the attention network includes a network based on a multi-head attention mechanism; the step of inputting the first associated feature into the attention network of the traffic flow prediction model and determining the attention feature through the attention network includes: The first associated feature is input into the attention network of the traffic flow prediction model, and each attention head in the attention network determines its corresponding sub-attention feature based on the first associated feature. The sub-attention features corresponding to each attention head are concatenated to obtain the attention features; The initial association features and the attention features are linearly fused, and the target edge features corresponding to the nodes in the region to be predicted are obtained based on the fusion result.

2. The traffic flow prediction method according to claim 1, characterized in that, The extraction of node features for each regional node based on historical vehicle volume data of each regional node in the regional node graph includes: The historical vehicle volume data of each regional node in the regional node graph is input into the node feature extraction network of the traffic flow prediction model. The output features of the hidden layer of the node feature extraction network are obtained to obtain the node features of each regional node.

3. The traffic flow prediction method according to any one of claims 1 to 2, characterized in that, The method further includes training the traffic flow prediction model, wherein training the traffic flow prediction model includes: Obtain training samples, which include a sample region node graph corresponding to the sample region node and historical traffic flow data of each region node in the sample region node graph; the training samples carry traffic flow labels corresponding to the sample region nodes. The historical traffic flow data of each regional node in the sample area node graph is input into the initial node feature extraction network of the initial traffic flow prediction model to obtain the sample node features of each regional node in the sample area node graph. The sample area node graph is input into the initial edge feature extraction network of the initial traffic flow prediction model to obtain the sample edge features of the corresponding edges of the sample area nodes. The sample node features corresponding to the sample region node are linearly fused with the sample edge features corresponding to the sample region node to obtain the fused features corresponding to the sample region node. Traffic flow is predicted based on the fusion features corresponding to the nodes in the sample area, and the predicted traffic flow of the nodes in the sample area is obtained. The parameters of the initial traffic flow prediction model are adjusted based on the predicted traffic flow of the sample area nodes and the traffic flow labels until the preset training termination condition is met, thus obtaining the traffic flow prediction model.

4. The traffic flow prediction method according to claim 3, characterized in that, The step of inputting the sample region node graph into the initial edge feature extraction network of the initial traffic flow prediction model to obtain the sample edge features of the edges corresponding to each region node in the sample region node graph includes: Initial sample association features are determined based on the edges in the node graph of the sample region; The initial sample association features are input into the initial first edge feature extraction network of the initial edge feature extraction network for edge feature extraction processing to obtain the first sample association features; The first sample association features are input into the initial attention network of the initial edge feature extraction network, and the sample attention features are determined through the initial attention network; the sample attention features characterize the importance of each edge corresponding to each region node in the sample region node graph; The initial sample association features and the sample attention features are linearly fused, and the sample edge features corresponding to each region node in the sample region node graph are obtained based on the fusion result.

5. The traffic flow prediction method according to claim 4, characterized in that, The step of adjusting the parameters of the initial traffic flow prediction model based on the predicted traffic flow of the sample area nodes and the traffic flow label until a preset training termination condition is met, thereby obtaining the traffic flow prediction model, includes: The loss value is determined based on the difference between the predicted traffic flow of the sample area nodes and the traffic flow label; Constraint information is determined based on the sample attention features, and the constraint information is multiplied by the adjustment coefficient to obtain the target constraint condition; Based on the loss value and target constraints, the parameters of the initial traffic flow prediction model are adjusted until the preset training termination condition is met, thus obtaining the traffic flow prediction model.

6. A traffic flow prediction device, characterized in that, include: The data acquisition module is used to acquire the region node graph corresponding to the region node to be predicted. The edges in the region node graph represent the initial association relationship between the region nodes connected by the edges. Each region node in the region node graph includes the region node to be predicted. The first feature extraction module is used to extract the node features of each regional node based on the historical vehicle volume data of each regional node in the regional node map. The second feature extraction module is used to extract the target edge features of the corresponding edges of the nodes in the region to be predicted based on the region node graph. The target edge feature characterizes the degree of influence of the traffic flow of the region node connected by the corresponding edge on the traffic flow of the region node to be predicted; wherein, the step of extracting the target edge feature of the corresponding edge of the region node to be predicted based on the region node graph includes: determining initial association features based on the edges in the region node graph; inputting the initial association features into the first edge feature extraction network of the traffic flow prediction model for edge feature extraction processing to obtain the first association feature; inputting the first association feature into the attention network of the traffic flow prediction model, and determining the attention feature through the attention network; the attention feature characterizes the importance of each edge corresponding to each region node; the attention network includes a network based on a multi-head attention mechanism; the step of inputting the first association feature into the attention network of the traffic flow prediction model and determining the attention feature through the attention network includes: inputting the first association feature into the attention network of the traffic flow prediction model, and determining the corresponding sub-attention feature based on the first association feature by each attention head in the attention network; concatenating the sub-attention features corresponding to each attention head to obtain the attention feature; linearly fusing the initial association feature and the attention feature, and obtaining the target edge feature of the corresponding edge of the region node to be predicted based on the fusion result. The feature fusion module is used to linearly fuse the node features of the node in the region to be predicted with the target edge features of the corresponding edge of the node in the region to be predicted, so as to obtain the fused features corresponding to the node in the region to be predicted. The traffic flow prediction module is used to predict the traffic flow of the nodes in the area to be predicted based on the fusion features corresponding to the nodes in the area to be predicted.

7. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the steps of the method as claimed in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the steps of the method as claimed in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Traffic prediction method, intelligent terminal and computer readable storage medium

    CN112766551A

  • Traffic flow prediction model and method based on multi-head self-attention mechanism

    CN112990594A