Traffic flow prediction method based on dynamic multi-graph hybrid expert graph neural network

By constructing distance-based graphs and knowledge graphs based on graphs, combined with dynamic multi-graph hybrid expert graph neural networks, the existing traffic flow prediction methods are solved in the poor effect of dealing with complex spatial and spatial changes and heterogeneous features, and more efficient and flexible traffic flow prediction is achieved.

CN120108178APending Publication Date: 2025-06-06TSINGHUA UNIVERSITY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510263762.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-06
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The existing traffic flow prediction methods are not effective in dealing with complex spatial and spatial variations and heterogeneous features, especially in terms of remote spatial correlation and diversified feature distribution.

Method used

Using a dynamic multi-graph hybrid expert graph neural network method, by constructing distance-based graphs and knowledge graphs, combining traffic flow sequences, the appropriate expert model is dynamically selected to process different types of subgraphs, thereby predicting traffic flow.

Benefits of technology

This method can more comprehensively capture the multi-dimensional correlation of traffic flow, improve the accuracy and flexibility of prediction, adapt to the characteristics of different regions, and enhance the generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120108178A_ABST
    Figure CN120108178A_ABST
Patent Text Reader

Abstract

The invention provides a traffic flow prediction method based on a dynamic multi-graph hybrid expert graph neural network. The method can perform feature extraction and flow prediction for different road types and regional features. The method comprises the following steps: obtaining a road network map; obtaining respective traffic flow sequences of N road sections corresponding to the N nodes; for the road network map, constructing a distance-based map according to the distance correlation between every two road sections in the N road sections; obtaining respective attributes of the N road sections and semantic correlation between every two road sections in the N road sections, and constructing a graph based on a knowledge graph; and according to the distance-based graph, the knowledge graph-based graph and the respective traffic flow sequences of the N road sections, predicting respective estimated traffic flows of the N road sections at the next moment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a traffic flow prediction method based on a dynamic multi-graph hybrid expert graph neural network. Background Art

[0002] With the increase in the number of vehicles and the complexity of traffic in large and medium-sized cities in modern society, intelligent transportation systems (ITS) are crucial to the development of cities. Traffic forecasting is an indispensable task in intelligent transportation systems, which mainly uses historical traffic data recorded by sensors on the road to predict the future. Therefore, accurate and efficient prediction can not only guide tourists to travel, but also assist the government to avoid traffic congestion. With the rise of artificial intelligence technology, many works on traffic flow forecasting have been proposed. Its goal is to predict future traffic conditions based on past traffic time series reported by sensors installed on the road (such as cameras and radar speed sensors). In recent decades, researchers have made extensive efforts on this task and proposed many traditional algorithms based on statistics and shallow machine learning, such as autoregressive integrated moving average (ARIMA), vector autoregression (VAR), support vector regression (SVR), and Kalman filter. However, traffic forecasting is challenging for these traditional methods due to the very complex spatiotemporal evolution of real-world traffic systems. With the development of deep learning in various fields, neural networks that can simultaneously mine spatiotemporal information have become the mainstream of traffic prediction, such as DCRNN (Diffusion Convolutional Recurrent Neural Network) using gated recurrent units (GRU) and graph convolutional networks (GCN) and STGCN (Spatio-Temporal Graph Convolutional Network) combining GCN and causal convolutional networks. These works can be collectively referred to as spatiotemporal neural networks.

[0003] However, the prediction effect of spatiotemporal neural network in some areas or road sections is poor, which in turn affects the overall prediction performance. Therefore, a more adaptive and flexible model architecture is needed for traffic flow prediction. Summary of the invention

[0004] According to a first aspect of an embodiment of the present disclosure, a traffic flow prediction method based on a dynamic multi-graph hybrid expert graph neural network is provided, comprising: Obtain a road network graph, wherein the road network graph includes N nodes, each node represents a road section, an edge between two nodes represents a connection relationship between the road sections, and N is an integer greater than 2; Obtaining the traffic flow sequences of the N road sections corresponding to the N nodes, wherein the traffic flow sequence of each road section includes: the actual traffic flow collected by the road sensors deployed on the road section at H moments; For the road network graph, according to the distance correlation between every two road sections in the N road sections, a distance-based graph is constructed, wherein the distance-based graph includes N nodes, each node represents a road section, and an edge between two nodes indicates that there is a distance correlation between the road sections; Obtaining the attributes of each of the N road segments and the semantic correlation between every two road segments in the N road segments, and constructing a graph based on the knowledge graph, wherein the graph based on the knowledge graph includes N nodes, each node represents a road segment, and an edge between two nodes indicates that there is a semantic correlation between the road segments; According to the distance-based graph, the knowledge graph-based graph, and the traffic flow sequences of each of the N road sections, a pre-trained dynamic multi-graph hybrid expert graph neural network is used to process the traffic flow sequences of each of the N road sections, thereby obtaining a distance-based vector representation and a knowledge graph-based vector representation of each of the N road sections; According to the knowledge graph-based vector representation and the distance-based vector representation of each of the N road sections, the estimated traffic flow of each of the N road sections at the next moment is predicted.

[0005] Optionally, the attributes of each of the N road segments include at least one or more of the following: road type, surrounding facilities POI, historical events, and weather conditions; the semantic relevance includes one or more of the following: shared POI, affected by the same historical event; the attributes of each of the N road segments and the semantic relevance between every two road segments in the N road segments are obtained, and a graph based on the knowledge graph is constructed, including: Building a knowledge graph-based graph ,in, is the set of all nodes in the graph based on the knowledge graph, represents the N road nodes, Represents multiple POI nodes, Represents multiple event nodes, is the set of all relations in the graph based on the knowledge graph, Indicates that the road sections corresponding to the two nodes belong to the same type of roads. Indicates that the road sections corresponding to the two nodes share the same POI. Indicates that the road sections corresponding to the two nodes are affected by the same historical event; For the N road nodes, construct a road subgraph, wherein the road subgraph includes all road nodes and adjacent relationships or attribute similarity relationships between all road nodes; For the multiple POI nodes, construct a POI subgraph, wherein the POI subgraph includes POI sharing relationships between all POI nodes and all road nodes, and the POI subgraph is used to capture the impact of POI facilities on traffic flow of road nodes; For all event nodes, an event subgraph is constructed, wherein the event subgraph includes all event nodes and the relationships among all road nodes affected by the same event.

[0006] Optionally, build a graph based on the knowledge graph ,include: Acquire data related to the N road nodes, where the data related to each road node includes: attributes of the road section corresponding to the road node; Acquire data related to the plurality of POI nodes, wherein the data related to each POI node includes: a POI facility near any road among the N road nodes; Acquire data related to the multiple event nodes, where the data related to each event node includes: a historical event involved in any road among the N road nodes; Obtaining data related to the relationship, including: the relationship between road segments of the same type, whether the road segments share the same POI, and whether the road segments share the same historical events; Performing attribute labeling on the N road nodes; The POI nodes are associated with road nodes based on the data associated with the plurality of POI nodes, and the event nodes are associated with road nodes based on the data associated with the plurality of event nodes.

[0007] Optionally, after constructing a distance-based graph for the road network graph according to the distance correlation between every two road segments in the N road segments, the method further includes: Divide the distance-based graph into M distance-based subgraphs; According to the distance-based graph and the traffic flow sequences of the N road sections, a pre-trained dynamic multi-graph hybrid expert graph neural network is used to process and obtain a distance-based vector representation of the N road sections, including: According to the multiple distance-based subgraphs and the respective traffic flow sequences of the N road sections, the mth distance-based subgraph and the respective traffic flow sequences of the N road sections are processed by an mth expert graph neural network in a first branch of a pre-trained dynamic multi-graph hybrid expert graph neural network, where m ranges from 1 to M, and M represents the total number of expert graph neural networks in the first branch; Determining the weights of the processing results of M expert graph neural networks through the gating network in the first branch, wherein the parameters of the M expert graph neural networks are different from each other; According to the weights output by the gated network in the first branch, weighted fusion is performed on the processing results of the M expert graph neural networks to obtain distance-based vector representations of each of the N road sections.

[0008] Optionally, the graph based on the knowledge graph includes Q subgraphs based on the knowledge graph; the subgraphs based on the knowledge graph include at least the road subgraph, the POI subgraph and the event subgraph; according to the graph based on the knowledge graph and the traffic flow sequences of each of the N road sections, a pre-trained dynamic multi-graph hybrid expert graph neural network is used for processing to obtain a vector representation based on the knowledge graph for each of the N road sections, including: According to the subgraph based on the knowledge graph and the traffic flow sequences of the N road sections, the qth expert graph neural network in the second branch of the pre-trained dynamic multi-graph hybrid expert graph neural network processes the qth subgraph based on the knowledge graph and the traffic flow sequences of the N road sections, where the value of q ranges from 1 to Q, and Q represents the total number of expert graph neural networks in the second branch; Determining the weights of the processing results of the Q expert graph neural networks through the gating network in the second branch, wherein the parameters of the Q expert graph neural networks are different from each other; According to the weights output by the gated network in the second branch, the processing results of the Q expert graph neural networks are weightedly fused to obtain a vector representation based on the knowledge graph for each of the N road sections.

[0009] Optionally, the pre-trained dynamic multi-graph hybrid expert graph neural network is a dynamic multi-graph hybrid expert graph neural network based on knowledge distillation; in the dynamic multi-graph hybrid expert graph neural network of knowledge distillation, the sub-network that processes the distance-based graph is a teacher model, and the sub-network that processes the knowledge graph-based graph is a student model; The student model aims to learn the distance-based vector representation of each of the N road segments output by the teacher model, and outputs the knowledge graph-based vector representation of each of the N road segments.

[0010] Optionally, the training process of the dynamic multi-graph hybrid expert graph neural network based on knowledge distillation includes a training phase and a fine-tuning phase; the method further includes: In the training phase, a first loss function value is obtained according to the estimated traffic flow of each of the N sample road sections at the next moment and the actual traffic flow of each of the N sample road sections at the next moment, and based on the first loss function value, the parameters of the dynamic multi-graph hybrid expert graph neural network based on knowledge distillation to be trained are updated; In the fine-tuning stage, a distillation loss value is obtained according to the distance-based vector representation and the knowledge graph-based vector representation of each of the N sample road sections, and based on the first loss function value, the parameters of the trained dynamic multi-graph hybrid expert graph neural network based on knowledge distillation are fine-tuned.

[0011] Optionally, predicting the estimated traffic flow of each of the N road sections at the next moment according to the knowledge graph-based vector representation and the distance-based vector representation of each of the N road sections includes: Based on the Manhattan self-attention mechanism, the knowledge graph-based vector representation and the distance-based vector representation of each of the N road sections are fused to obtain a final vector representation of each of the N road sections; Based on the final vector representation of each of the N road sections, the estimated traffic flow of each of the N road sections at the next moment is predicted.

[0012] According to a second aspect of an embodiment of the present disclosure, a traffic flow prediction device based on a dynamic multi-graph hybrid expert graph neural network is provided, comprising: A first acquisition module is used to obtain a road network graph, wherein the road network graph includes N nodes, each node represents a road section, and an edge between two nodes represents a connection relationship between the road sections, and N is an integer greater than 2; The second acquisition module is used to obtain the traffic flow sequence of each of the N road sections corresponding to the N nodes, and the traffic flow sequence of each road section includes: the actual traffic flow collected by the road sensors deployed on the road section at H time points; A first construction module is used to construct a distance-based graph for the road network graph according to the distance correlation between every two road segments in the N road segments, wherein the distance-based graph includes N nodes, each node represents a road segment, and an edge between two nodes indicates that there is a distance correlation between the road segments; A second construction module is used to obtain the attributes of each of the N road segments and the semantic correlation between every two road segments in the N road segments, and construct a graph based on the knowledge graph, wherein the graph based on the knowledge graph includes N nodes, each node represents a road segment, and an edge between two nodes indicates that there is a semantic correlation between the road segments; An expert processing module, configured to process the distance-based graph, the knowledge graph-based graph, and the traffic flow sequences of the N road sections through a pre-trained dynamic multi-graph hybrid expert graph neural network to obtain distance-based vector representations and knowledge graph-based vector representations of the N road sections; The traffic prediction module is used to predict the estimated traffic flow of each of the N road sections at the next moment based on the knowledge graph-based vector representation and the distance-based vector representation of each of the N road sections.

[0013] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the traffic flow prediction method based on a dynamic multi-graph hybrid expert graph neural network as described in the first aspect are implemented.

[0014] According to the fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the traffic flow prediction method based on a dynamic multi-graph hybrid expert graph neural network as described in the first aspect are implemented.

[0015] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps of the traffic flow prediction method based on a dynamic multi-graph hybrid expert graph neural network described in the first aspect are implemented.

[0016] The present disclosure captures the multi-dimensional correlation of traffic flow by combining a distance-based graph and a knowledge graph-based graph; the distance-based graph can model the spatial correlation between adjacent nodes, while the knowledge graph-based graph can capture the correlation between nodes that are remote but have similar traffic flow characteristics; the fusion of the two can more comprehensively reflect the spatiotemporal relationship of traffic flow and effectively make up for the shortcomings of traditional methods, especially the limitations of traditional methods in dealing with remote spatial correlation. A dynamic multi-graph hybrid expert model is adopted to dynamically select suitable expert models to process different types of subgraphs based on the characteristics of the road section and the regional division; the model can select the most suitable submodel for prediction according to the characteristics of different regions, which improves the accuracy and flexibility of the prediction; and overcomes the problem that the traditional single GCN model is difficult to handle heterogeneous features at the same time. The graph structure based on the knowledge graph can provide additional semantic information for the graph neural network, such as road type, surrounding facilities, weather conditions and other factors. This information can help the model understand the traffic flow change law of different sections under specific conditions, so that the model not only relies on physical adjacency, but also effectively integrates semantic and attribute information, and enhances the model's ability to predict traffic flow changes. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the description of the embodiments of the present disclosure will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 It is a schematic diagram of the steps of a traffic flow prediction method based on a dynamic multi-graph hybrid expert graph neural network shown in an embodiment of the present disclosure; Figure 2 It is a structural schematic diagram of a dynamic multi-graph hybrid expert graph neural network provided by an embodiment of the present disclosure; Figure 3 This is a schematic diagram of a dynamic multi-graph hybrid expert graph neural network shown in an embodiment of the present disclosure. Figure 4 It is a block diagram of a traffic flow prediction device based on a dynamic multi-graph hybrid expert graph neural network shown in an embodiment of the present disclosure; Figure 5 It is a schematic diagram of an electronic device proposed in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0020] The terms "first", "second", etc. in the specification and claims of the present disclosure are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present disclosure can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0021] This application found that the traffic flow prediction accuracy of most existing methods is not high due to the following reasons: 1) Most existing methods focus on propagating spatial information through distance-based graphs, i.e., the closer the sensors deployed on the road are, the stronger the correlation of the traffic time series recorded by these sensors. However, distance-based graphs ignore long-range spatial correlations, i.e., the useful spatial information between distant but similar traffic time series is not fully modeled.

[0022] 2) Existing methods cannot solve the problem that different road nodes or regional subgraphs have different feature distributions and change patterns. Input data is usually represented in the form of a road network graph, where nodes represent road sections or intersections, and edges represent the connection relationship between road sections. However, due to differences in geographical location, road functions, traffic patterns, vehicle density and other factors of different road sections and regions, these nodes and subgraphs often present highly heterogeneous feature distributions and dynamic change patterns. There are significant differences in traffic flow, vehicle speed, and traffic flow change patterns for different types of road nodes.

[0023] 3) There are also significant differences in sub-graph features in different regions. The traditional GCN model uses a unified convolution operation to extract features from the entire graph, but this single model architecture is difficult to adapt to the diverse feature distribution and change patterns of different regions at the same time, which may lead to poor prediction results of the model in certain areas or sections, thus affecting the overall prediction performance.

[0024] To solve the above problems, the present disclosure provides a traffic flow prediction method based on a dynamic multi-graph hybrid expert graph neural network, which can accurately predict the traffic flow changes of different road sections under complex spatiotemporal conditions.

[0025] Figure 1 It is a schematic diagram of the steps of a traffic flow prediction method based on a dynamic multi-graph hybrid expert graph neural network shown in an embodiment of the present disclosure.

[0026] Step S11: Obtain a road network graph, wherein the road network graph includes N nodes, each node represents a road section, an edge between two nodes represents a connection relationship between road sections, and N is an integer greater than 2.

[0027] The road network graph is constructed as a graph containing N nodes, where each node represents a road segment, and the edges between nodes represent the actual physical connection relationship between these road segments. N is an integer greater than 2, which means that at least two road segments are involved, and the number of nodes in the road network graph can vary depending on the specific application. The construction of the road network graph can refer to the relevant technology.

[0028] The present invention forms a topological structure of a road network with sensors. ,in represents a node set (i.e., a road set), represents the edge set (i.e. the set of road connections), Represents the adjacency matrix. Indicates the number of roads.

[0029] Step S12: Obtaining the traffic flow sequences of the N road sections corresponding to the N nodes, wherein the traffic flow sequence of each road section includes: the actual traffic flow collected by the road sensors deployed on the road section at H moments.

[0030] For each node (i.e., each road section), the corresponding traffic flow sequence is collected. The traffic flow sequence consists of actual traffic flow data collected by sensors installed on each road section at multiple times (H times). The traffic flow data at each time reflects the traffic conditions of the road section, such as vehicle flow, vehicle speed, etc. Traffic flow prediction is performed based on the collected traffic flow data.

[0031] The actual traffic flow collected at time t can be used To express, including nodes, of which In the present invention, traffic flow can be represented by traffic flow sequence. To express.

[0032] Step S13: For the road network graph, a distance-based graph is constructed according to the distance correlation between every two road sections in the N road sections. The distance-based graph includes N nodes, each node represents a road section, and the edge between two nodes indicates that there is a distance correlation between the road sections.

[0033] The distance-based graph is constructed based on the physical distance correlation between road segments. By calculating the physical distance between each two road segments, a graph is constructed, in which nodes represent road segments and edges represent the spatial distance correlation between road segments. Specifically, when the actual distance between two road segments is less than a preset distance, the two road segments are judged to be relatively close to each other and can be considered to have distance correlation; when the actual distance between two road segments is greater than or equal to the preset distance, the two road segments are judged to be relatively far from each other and can be considered to have no distance correlation.

[0034] The distance-based graph reflects the spatial relationship between road segments. Specifically, adjacent road segments usually have strong correlation in traffic flow, so their corresponding nodes are connected by edges in the distance-based graph.

[0035] Step S14: Obtain the attributes of each of the N road sections and the semantic correlation between every two of the N road sections, and construct a graph based on the knowledge graph, wherein the graph based on the knowledge graph includes N nodes, each node represents a road section, and the edge between two nodes indicates the existence of semantic correlation between the road sections.

[0036] Graphs based on knowledge graphs can effectively make up for the shortcomings of traditional distance-based graphs. By capturing the attribute similarities and semantic associations between distant nodes, they can improve the modeling capabilities of graph neural networks in tasks such as traffic flow prediction.

[0037] The graph based on the knowledge graph generates the graph structure by obtaining the attribute information of each road segment and the semantic correlation between different road segments. For example, some road segments may have similar traffic flow patterns due to similar surrounding environments (such as commercial areas, residential areas, etc.). The model uses this semantic association to enhance the accuracy of traffic prediction.

[0038] The attribute information of a road section includes road type, surrounding facility POIs, historical events, weather conditions, etc.; the semantic information of a road section includes shared POIs, those affected by the same event, etc. The graph based on the knowledge graph can associate road nodes with their attributes and semantic relationships to form a richer graph structure. For example, even if highway nodes are not geographically adjacent, they can be connected through the "same road" relationship because they have similar traffic flow characteristics and traffic rules; similarly, if road nodes in different cities are connected to similar commercial center POIs, they can also establish semantic connections through the "shared POI" relationship. In addition, by connecting road nodes affected by the same traffic accident or bad weather, a "shared event" graph can be constructed to capture the impact pattern of events on traffic flow changes.

[0039] Step S15: According to the distance-based graph, the knowledge graph-based graph and the traffic flow sequences of each of the N road sections, a pre-trained dynamic multi-graph hybrid expert graph neural network is used to process them to obtain a distance-based vector representation and a knowledge graph-based vector representation of each of the N road sections.

[0040] The dynamic multi-graph hybrid expert graph neural network learns the vector representation of each road segment based on the information in each graph, such as the spatial distance relationship corresponding to the distance-based graph and the semantic relationship corresponding to the knowledge graph-based graph. The distance-based vector representation is obtained through the distance-based graph, and the knowledge graph-based vector representation is obtained through the knowledge graph-based graph. The vector representation is used to extract the node relationship and feature information in the graph structure.

[0041] The dynamic multi-graph hybrid expert graph neural network can dynamically select expert models. When faced with different types of graph structures, the most suitable graph neural network expert will be dynamically selected for processing based on the characteristics of the road sections in the graph structure. The strategy of dynamically selecting graph neural networks based on the characteristics of nodes in the graph structure can flexibly adapt to different traffic flow patterns and improve the accuracy of predictions.

[0042] Step S16: predicting the estimated traffic flow of each of the N road sections at the next moment according to the knowledge graph-based vector representation and the distance-based vector representation of each of the N road sections.

[0043] The task of this disclosure is to use the known historical time period Traffic flow observations ={ } and road network diagram Let's learn a function , to predict the future time period Traffic flow observations , future time period The true value of traffic flow is . It can be specifically expressed by the following formula:

[0044] The distance-based vector representation in the present disclosure captures the physical distance and spatial dependency between road segments, while the knowledge graph-based vector representation takes into account semantic information such as the attributes, type, and surrounding environment of the road segment.

[0045] The distance-based vector representation obtained by the distance-based graph and the knowledge-graph-based vector representation obtained by the knowledge-graph-based graph can obtain a multi-graph model containing long-range dependencies, so that the graph neural network can more comprehensively model the complex dynamic changes in traffic scenes, thereby learning a more accurate function To predict the future time period Traffic flow observations .

[0046] By adopting the embodiments of the present disclosure, by combining the distance-based graph and the knowledge graph-based graph, the traffic flow prediction not only depends on the spatial relationship of the physical distance, but also takes into account the semantic similarity between road sections, thereby improving the accuracy of the traffic flow prediction. The design of the dynamic multi-graph hybrid expert graph neural network enables it to process multiple types of graph structure data, including distance-based graphs and knowledge graph-based graphs, so that it can adapt to different traffic network structures and characteristics, and enhance the generalization ability of the model.

[0047] Figure 2This is a schematic diagram of the structure of a dynamic multi-graph hybrid expert graph neural network provided by an embodiment of the present disclosure. Figure 2 As shown, at the input, Figure 2 The traffic flow sequence on the left is first processed by the Attention mechanism to capture the important time series information in the sequence, and then it is transformed through multiple MLP (Multilayer Perceptron) networks to extract the features of the time series data. After the weighted sum operation, the generated features are input into the DMGMoE-GCN model (i.e., dynamic multi-graph hybrid expert graph neural network) for graph convolution operation to extract node relationships and feature information in different graph structures (distance-based graphs, knowledge graph-based graphs). Finally, the generated features are used for prediction tasks or other subsequent operations in the output layer.

[0048] Among them, the Attention mechanism is used to extract time information using the multi-step time dependency module. This is because the representation of the current time step will be affected by multiple historical time steps, so it is necessary to The hidden states of each time step are calculated, but the previous The importance of each time step is inconsistent, so different weights need to be added to different time steps and summed. In the present disclosure, the actual traffic flow collected at H moments is not as important as the estimated traffic flow, and the traffic flow collected at different moments needs to be weighted to different degrees.

[0049] The Attention mechanism can capture important timing information in the sequence according to the following formula:

[0050]

[0051] is the output of the input layer, which will be input into the DMGMoE-GCN module.

[0052] Among them, the MLP network can be used to perform feature conversion and extract the features of time series data through the following formula:

[0053] , , and , These are all learnable parameters.

[0054] In addition, in order to make the input shape consistent with the model space, A fully connected input layer is used to project it into a high-dimensional space, and at the same time, a sub-attention layer is passed to obtain all time dependencies.

[0055] In an optional embodiment, the attributes of each of the N road segments include at least one or more of the following: road type, surrounding facilities POI, historical events, and weather conditions; the semantic relevance includes one or more of the following: shared POI, affected by the same historical event; the attributes of each of the N road segments and the semantic relevance between every two road segments in the N road segments are obtained, and a graph based on the knowledge graph is constructed, including: Building a knowledge graph-based graph ,in, is the set of all nodes in the graph based on the knowledge graph, represents the N road nodes, Represents multiple POI nodes, Represents multiple event nodes, is the set of all relations in the graph based on the knowledge graph, Indicates that the road sections corresponding to the two nodes belong to the same type of roads. Indicates that the road sections corresponding to the two nodes share the same POI. Indicates that the road sections corresponding to the two nodes are affected by the same historical event; For the N road nodes, construct a road subgraph, wherein the road subgraph includes all road nodes and adjacent relationships or attribute similarity relationships between all road nodes; For the multiple POI nodes, construct a POI subgraph, wherein the POI subgraph includes POI sharing relationships between all POI nodes and all road nodes, and the POI subgraph is used to capture the impact of POI facilities on traffic flow of road nodes; For all event nodes, an event subgraph is constructed, wherein the event subgraph includes all event nodes and the relationships among all road nodes affected by the same event.

[0056] The knowledge graph can contain road nodes and their attributes, such as road type, geographical location, surrounding facilities (POI), historical traffic data, weather conditions, accident records, etc.; it can also contain semantic relationships between nodes, such as "roads with similar functions", "road sections in the same area", etc. It includes the node sets of all node types and the relationship sets of all relationship types in the graph based on the knowledge graph.

[0057] Node types include road nodes , POI node And event nodes .

[0058] Road Node : Represents a road section, intersection or area in a traffic network, such as a highway, main road, residential road, etc. Road nodes usually include characteristics such as road type, length, speed limit, and traffic volume. Noted as: ,in Indicates The feature vector of a road node.

[0059]

[0060] POI Node : Indicates points of interest around the road. For example, commercial areas, schools, hospitals, parking lots, etc., which may affect the flow of surrounding roads. Denoted as: ,in Indicates The feature vector of a POI node.

[0061]

[0062] Event Node :Represents traffic-related events, such as traffic accidents, construction, bad weather, etc. Event nodes have an impact on the traffic flow of related roads. ,in Indicates The feature vector of each event node.

[0063]

[0064] Relationship types mainly include similar road relationships, shared POI relationships, and shared event relationships. Relationship types represent the connection methods between different nodes.

[0065] Similar road relationships : Represents the relationship between road nodes of the same type. For example, between highway nodes and between residential roads. These relationships are used to describe the topological structure of roads.

[0066]

[0067] Shared POI relationships : Indicates that two roads are connected to the same POI. For example, two roads are connected to the same shopping mall. This relationship can reflect the traffic impact between the road and the surrounding facilities.

[0068]

[0069] Shared event relationships : Indicates that two roads are affected by the same event. For example, a traffic accident or construction event may affect multiple road nodes at the same time.

[0070]

[0071] On the basis of the graph based on the knowledge graph, the subgraphs are divided according to the node types, and the nodes in the graph are divided by type to obtain different subgraphs.

[0072] Construct a road subgraph for road nodes , the road subgraph contains all road nodes and the adjacent relationships between roads of the same type, where is a set of road nodes, It is a set of edges that represent the adjacent relationship between roads of the same type. It represents the edge connecting two road nodes, which represents the direct connection or adjacent relationship between the two roads. The road subgraph can understand the connection mode and relationship between each road. For example, if a main road is blocked, the flow of other adjacent roads may also be affected. This adjacent relationship is reflected in the road subgraph.

[0073] Construct POI subgraph for POI nodes , the POI subgraph includes the POI subgraph including all POI nodes and the POI sharing relationship between all road nodes. It is a collection of POI nodes, each of which represents a specific facility, such as a shopping mall, a hospital, a school, etc. It is the set of edges between road nodes that share the same POI node, which refers to the relationship between road nodes and POI nodes, indicating which roads share relationships with which POIs. The POI subgraph can help capture the impact of facilities on road traffic flow. For example, a shopping mall in a commercial area may cause a significant increase in traffic flow on surrounding roads during a specific period, while roads near certain residential areas may not be affected in the same way.

[0074] Construct an event subgraph for event nodes , the event subgraph includes all event nodes and the relationships between road nodes affected by the same event. is a collection of event nodes, It is the set of edges between road nodes affected by the same event. The event subgraph is used to capture the impact of traffic events on traffic flow. For example, when a traffic accident occurs, traffic flow may be temporarily reduced or completely blocked; and in severe weather (such as heavy snow), the flow of all roads may be affected to some extent.

[0075] By adopting the embodiments of the present disclosure and constructing a graph based on a knowledge graph, various types of information required for traffic flow prediction (such as road types, facilities, events, etc.) can be systematically and structured through nodes and relationships, so that traffic flow prediction does not only rely on a single data source, but can simultaneously consider the influence of multiple dimensions, thereby improving the prediction accuracy. Attributes such as road type, POI, historical events, and weather conditions provide rich contextual information for each road section, helping the model to deeply understand the traffic pattern of the road section under different conditions. The synergy of multiple subgraphs enables the model to analyze traffic flow from multiple perspectives and synthesize various information to obtain more accurate prediction results. By jointly modeling road subgraphs, POI subgraphs, and event subgraphs, the model can simultaneously consider the road network structure, the distribution of facilities, and the impact of emergencies. The present disclosure can not only consider static road attributes (such as road types), but also dynamically adjust and adapt to different environments (such as real-time weather, emergencies), so the prediction accuracy and adaptability in different scenarios are significantly improved.

[0076] In an optional embodiment, a graph based on a knowledge graph is constructed. ,include: Acquire data related to the N road nodes, where the data related to each road node includes: attributes of the road section corresponding to the road node; Acquire data related to the plurality of POI nodes, wherein the data related to each POI node includes: a POI facility near any road among the N road nodes; Acquire data related to the multiple event nodes, where the data related to each event node includes: a historical event involved in any road among the N road nodes; Obtaining data related to the relationship, including: the relationship between road segments of the same type, whether the road segments share the same POI, and whether the road segments share the same historical events; Performing attribute labeling on the N road nodes; The POI nodes are associated with road nodes based on the data associated with the plurality of POI nodes, and the event nodes are associated with road nodes based on the data associated with the plurality of event nodes.

[0077] Road type data can be obtained through Geographic Information System (GIS) or traffic management platform, such as highways, urban main roads and branch roads. The road type can be used to determine the road's capacity, traffic flow characteristics and driving speed. For example, highways generally have higher speeds and larger traffic, while branch roads have lower speeds and usually smaller traffic. Different types of roads have different weights and influences in traffic forecasting.

[0078] POI data can be obtained through map service platforms, such as OpenStreetMap, Google Maps API, etc. POI usually refers to facilities or locations that have a significant impact on traffic flow, such as commercial centers, hospitals, schools, shopping centers, etc. The type and distribution of POIs have a significant impact on traffic flow. For example, commercial centers and shopping centers usually increase traffic on surrounding roads during holidays or promotions, while the opening and closing hours of schools may cause greater traffic pressure on nearby roads.

[0079] Traffic event data mainly comes from real-time traffic data platforms (such as various traffic monitoring platforms, road condition query platforms) and traffic reports released by the government. Event types include traffic accidents, construction, bad weather (such as heavy rain, heavy snow, etc.), etc. These events will have a direct impact on traffic flow.

[0080] After collecting the road type data, POI data and traffic event data, these data are processed. This mainly includes the following aspects: Add attributes to each road node: to accurately describe the characteristics of the road and factors affecting traffic flow. The marked attributes include: road type (highway, urban main road, branch road, etc.), road length, speed limit information.

[0081] Extract POI data and associate POI nodes with nearby road nodes to give relevant attributes to POI nodes and establish a connection relationship with surrounding roads. Through this association, the impact of POI on surrounding traffic flow can be analyzed. By calculating the geographical distance between POI and road nodes, the most relevant road node for each POI is found. Generally, surrounding roads can be associated with POI nodes within a certain radius (such as 500 meters or 1 kilometer), thereby building a shared relationship between POI and roads.

[0082] Organize traffic event data and associate road segments affected by the event: Use geographic information technology to identify which road nodes are affected by a specific event. For example, if a traffic accident occurs, mark the road node where the accident occurred and identify the adjacent road nodes affected by the event.

[0083] Through the collection and preprocessing of the aforementioned data, the nodes and relationships in the graph based on the knowledge graph are constructed.

[0084] By adopting the embodiments of the present disclosure, by collecting relevant data from multiple sources, it can be ensured that the constructed knowledge graph has a broad and comprehensive information basis. In the process of data preprocessing, by accurately marking road nodes, extracting POI data and associating them, the original data can be effectively converted into information that can be used by the model, thereby improving the structuring and operability of the data. Through the steps of data collection and preprocessing, the knowledge graph finally constructed will contain information of multiple dimensions and can accurately represent various nodes, relationships and their attributes involved in traffic flow prediction. The establishment of the knowledge graph makes the connection between data more intuitive and easy to analyze, thereby improving the performance of the traffic flow prediction system.

[0085] Multi-graph mixed expert graph neural network is a mixture of experts (MoE) model.

[0086] Dynamic multi-graph hybrid expert graph neural network solves complex tasks by dynamically selecting the most suitable expert graph neural network. It uses multiple specially trained expert graph neural networks, each of which is responsible for processing a specific part of the input space, and the gating network is responsible for deciding which expert graph neural networks should be activated for each input instance.

[0087] For a given input , prediction output of dynamic multi-graph hybrid expert graph neural network It is expressed as:

[0088] in, represents the number of expert graph neural networks, Represents the gating network for The output weight of an expert graph neural network represents the probability or weight of selecting the expert graph neural network. It is Expert graph neural network for input Output.

[0089] In an optional embodiment, after constructing a distance-based graph according to the distance correlation between every two road sections in the N road sections for the road network graph, the method further includes: Divide the distance-based graph into M distance-based subgraphs; According to the distance-based graph and the traffic flow sequences of the N road sections, a pre-trained dynamic multi-graph hybrid expert graph neural network is used to process and obtain a distance-based vector representation of the N road sections, including: According to the multiple distance-based subgraphs and the respective traffic flow sequences of the N road sections, the mth distance-based subgraph and the respective traffic flow sequences of the N road sections are processed by an mth expert graph neural network in a first branch of a pre-trained dynamic multi-graph hybrid expert graph neural network, where m ranges from 1 to M, and M represents the total number of expert graph neural networks in the first branch; Determining the weights of the processing results of M expert graph neural networks through the gating network in the first branch, wherein the parameters of the M expert graph neural networks are different from each other; According to the weights output by the gated network in the first branch, weighted fusion is performed on the processing results of the M expert graph neural networks to obtain distance-based vector representations of each of the N road sections.

[0090] The construction of the distance-based graph can refer to related technologies. After obtaining the distance-based graph, the distance-based graph is divided into multiple distance-based subgraphs to simplify the calculation and enhance the fine-grained learning ability of the model. Each subgraph contains part of the road section, and each subgraph is calculated independently during the processing of the graph neural network.

[0091] Each expert graph neural network processes a distance-based subgraph and combines the traffic flow sequence of each road section to learn the spatiotemporal laws of traffic flow. Different expert graph neural networks process a corresponding subgraph in a targeted manner.

[0092] Different expert graph neural networks correspond to a GCN model, and different expert graph neural networks have different convolution kernels or graph convolution modules.

[0093] Considering that the expert graph neural networks are different from each other, the GCN model corresponding to the j-th expert graph neural network is calculated according to the following formula Each node in Update the features:

[0094] in, It is Experts in The node characteristics of the layer, It is The learning weight matrix corresponding to the experts is is an element in the adjacency matrix, representing the node With Node The connection relationship (edge ​​weight), is the activation function.

[0095] Each expert can have multiple convolutional layers, so the GCN model corresponding to the expert graph neural network has a multi-layer GCN structure to capture the complex features in the graph layer by layer. The expert graph neural network can be designed as a deep GCN stack, allowing information to propagate between multiple levels.

[0096] The main task of the gating network in the first branch is to determine the importance of the processing results of different expert graph neural networks in the final output by calculating the weights of each expert graph neural network. The gating network can automatically learn the weights of each expert graph neural network. The gating network automatically selects the most suitable weight distribution based on the processing results of different subgraphs, and determines the contribution of each expert graph neural network to the final output. This can avoid excessive interference of some expert graph neural networks due to mismatched data characteristics, and ensure the optimality of the output results.

[0097] In the weighted fusion stage, the weights calculated by the gating network determine the influence of the results of each expert network on the final prediction result. The output of each expert network will be weighted and fused according to the weights output by the gating network. The final result is a weighted output that combines the advantages of multiple expert networks. The weighted fusion operation can fuse the processing results of M expert graph neural networks according to the weights output by the gating network to obtain the distance-based vector representation of the final N road sections. These distance-based vector representations can capture the traffic flow characteristics of each road section and serve as input in the subsequent prediction stage.

[0098] Specifically, assuming there is Expert graph neural networks (i.e. different GCN variants), the output of the gating network is a graph with a length of Vector , indicating a node Select Expert The weight of . Through the softmax activation function, the output of the gating network is expressed by the following formula:

[0099] in, represents the learned weight matrix, is the input feature dimension, represents the learnable bias term, is the input feature vector.

[0100] Each expert graph neural network has a corresponding GCN model to process the features corresponding to the input subgraph. Expert Graph Neural Network for Nodes The v output is :

[0101] in, Is a node The input features of represents the graph adjacency matrix, It is A network of experts.

[0102] Final Node The output of needs to consider the contribution of each expert graph neural network to the final output, that is, to perform a weighted summation of the outputs of all expert graph neural networks. The final output can be expressed by the following formula:

[0103] in, Is a node Select Expert The weight of Be an expert At the node Output. Through weighted aggregation, the final distance-based vector of the node is represented as . By adopting the embodiments of the present disclosure, the computational complexity can be reduced by dividing the graph based on distance, so that each subgraph can focus on the road sections and traffic characteristics within a relatively small range, which not only helps to reduce the consumption of computing resources, but also can perform efficient traffic prediction in a small range, improving the operating efficiency and prediction speed of the model. Through the multi-expert model, the system can process different traffic modes in parallel, enhancing the diversity and adaptability of the model. Each expert can optimize the learning for the subgraph and data set he is responsible for, thereby improving the processing accuracy. The introduction of the gating network can flexibly perform weighted fusion on the outputs of different expert networks, so that the most effective expert network processing results can be dynamically selected, thereby reducing unnecessary interference and improving prediction accuracy.

[0104] Wherein, in an optional embodiment, the graph based on the knowledge graph includes Q subgraphs based on the knowledge graph; the subgraph based on the knowledge graph includes at least the road subgraph, the POI subgraph and the event subgraph; according to the graph based on the knowledge graph and the traffic flow sequences of each of the N road sections, a pre-trained dynamic multi-graph hybrid expert graph neural network is used for processing to obtain a vector representation based on the knowledge graph for each of the N road sections, including: According to the subgraph based on the knowledge graph and the traffic flow sequences of the N road sections, the qth expert graph neural network in the second branch of the pre-trained dynamic multi-graph hybrid expert graph neural network processes the qth subgraph based on the knowledge graph and the traffic flow sequences of the N road sections, where the value of q ranges from 1 to Q, and Q represents the total number of expert graph neural networks in the second branch; Determining the weights of the processing results of the Q expert graph neural networks through the gating network in the second branch, wherein the parameters of the Q expert graph neural networks are different from each other; According to the weights output by the gated network in the second branch, the processing results of the Q expert graph neural networks are weightedly fused to obtain a vector representation based on the knowledge graph for each of the N road sections.

[0105] For each subgraph in the knowledge graph, the pre-trained expert graph neural network will process these subgraphs and the traffic flow sequences of each road section respectively. Each subgraph has an independent expert graph neural network for learning, and the parameters of each expert graph neural network are different, which means that each expert can process unique information. Specifically, the expert graph neural network for the road subgraph can process the traffic flow of the road network and the structural characteristics of the road network; the expert graph neural network for the POI subgraph can process the flow relationship between the surrounding points of interest and predict the interaction between traffic flow and specific POI locations; the expert graph neural network for the event subgraph can focus on event information and learn the impact of emergencies on traffic flow.

[0106] Different expert graph neural networks correspond to a GCN model, and different expert graph neural networks have different convolution kernels or graph convolution modules.

[0107] Considering that the expert graph neural networks are different from each other, the GCN model corresponding to the j-th expert graph neural network is calculated according to the following formula Each node in Update the features:

[0108] in, It is Experts in The node characteristics of the layer, It is The learning weight matrix corresponding to the experts is is an element in the adjacency matrix, representing the node With Node The connection relationship (edge ​​weight), is the activation function.

[0109] Each expert can have multiple convolutional layers, so the GCN model corresponding to the expert graph neural network has a multi-layer GCN structure to capture the complex features in the graph layer by layer. The expert graph neural network can be designed as a deep GCN stack, allowing information to propagate between multiple levels.

[0110] The gating network in the second branch is responsible for automatically learning weights based on the processing results of each expert graph neural network. The gating network automatically adjusts the weights based on the output value of each expert to determine which experts' outputs should be emphasized and which can be ignored. Specifically, during the weighted fusion process, the gating network assigns weights to each expert based on their contribution to the traffic flow prediction of the road section. For example, in some scenarios, a specific subgraph (such as an event subgraph) may have a greater impact on traffic flow prediction, and the gating network will automatically enhance the weight of this expert. Conversely, if a subgraph information is not important, the gating network will reduce its weight, thereby improving the prediction effect of the model.

[0111] According to the weights given by the gating network, the output results of the Q expert networks are weighted and fused to obtain the final vector representation based on the knowledge graph. These vector representations contain the relationship between the road segment and other related information (such as POI, events, etc.). The final vector representation based on the knowledge graph can provide input for subsequent traffic flow prediction tasks and help predict the traffic flow of each road segment.

[0112] Specifically, assuming there are Q expert graph neural networks (i.e., different GCN variants), the output of the gating network is a vector of length Q , indicating a node Select Expert The weight of . Through the softmax activation function, the output of the gating network is expressed by the following formula:

[0113] in, represents the learned weight matrix, is the input feature dimension, represents the learnable bias term, is the input feature vector.

[0114] Each expert graph neural network has a corresponding GCN model to process the features corresponding to the input subgraph. Expert Graph Neural Network for Nodes The v output is :

[0115] in, Is a node The input features of represents the graph adjacency matrix, It is A network of experts.

[0116] Final Node The output of needs to consider the contribution of each expert graph neural network to the final output, that is, to perform a weighted summation of the outputs of all expert graph neural networks. The final output can be expressed by the following formula:

[0117] in, Is a node Select Expert The weight of Be an expert At the node Output. Through weighted aggregation, the final knowledge graph-based vector representation of the node is . By adopting the embodiments of the present disclosure, by introducing road, POI and event subgraphs, the present disclosure can comprehensively consider different types of information sources, so that traffic flow can be analyzed from multiple angles. For each subgraph based on the knowledge graph (such as road subgraph, POI subgraph, event subgraph, etc.), there will be a dedicated expert graph neural network for processing. Different expert graph networks focus on processing specific types of data and extracting the relevant features between each subgraph and traffic flow, which can deeply understand the impact of each information source on traffic flow. The gated network dynamically adjusts the weight of each expert network according to the processing effect of the expert graph neural network. The weight adjustment mechanism of the gated network enables the present disclosure to automatically adapt to different traffic modes according to real-time data.

[0118] Wherein, in an optional embodiment, the pre-trained dynamic multi-graph hybrid expert graph neural network is a dynamic multi-graph hybrid expert graph neural network based on knowledge distillation; in the dynamic multi-graph hybrid expert graph neural network of knowledge distillation, the sub-network that processes the distance-based graph is a teacher model, and the sub-network that processes the knowledge graph-based graph is a student model; The student model aims to learn the distance-based vector representation of each of the N road segments output by the teacher model, and outputs the knowledge graph-based vector representation of each of the N road segments.

[0119] Knowledge distillation is a method of model compression and transfer learning, in which a larger "teacher model" transfers its knowledge, including the probability distribution of outputs, features, or intermediate layer outputs, to a smaller "student model". By having the student model imitate the behavior of the teacher model, the student model can achieve higher performance while ensuring lower computational complexity.

[0120] The teacher model is a subnetwork responsible for processing distance-based graphs, including M expert graph neural networks in the first branch of the dynamic multi-graph hybrid expert graph neural network and the gating network in the first branch; the student model is a subnetwork responsible for processing knowledge graph-based graphs, including Q expert graph neural networks in the second branch of the dynamic multi-graph hybrid expert graph neural network and the gating network in the second branch.

[0121] Figure 3 Schematic diagram of a dynamic multi-graph hybrid expert graph neural network shown in an embodiment of the present disclosure. Figure 3 As shown, the dynamic multi-graph hybrid expert graph neural network in the present disclosure includes two branches, the first branch is a teacher module, and the second branch is a student module. The teaching module processes the graph structure generated based on the actual node distance, that is, the distance-based graph in the present disclosure; the student module is used to process the knowledge graph graph structure generated based on road type, surrounding facility POI, historical events, and weather conditions, that is, the knowledge graph-based graph in the present disclosure. In the first branch corresponding to the teacher model, the distance-based graph is divided into multiple distance-based subgraphs, and then each distance-based subgraph is processed by the expert graph neural network corresponding to the distance-based subgraph to obtain a distance-based vector representation. In the second branch corresponding to the student model, the knowledge graph-based graph is divided into multiple knowledge graph-based subgraphs, and then each knowledge graph-based subgraph is processed by the expert graph neural network corresponding to the knowledge graph-based subgraph to obtain a knowledge graph-based vector representation. When the student model generates a knowledge graph-based vector representation for a knowledge graph-based graph, it learns information from the teacher model to enrich the information representation included in the vector generated by it.

[0122] The task of the student model is to learn how to process graph data using semantic relationships in the knowledge graph, such as potential patterns of traffic flow, the impact of events, etc. The student model learns how to transform its knowledge graph-based features into knowledge graph-based vector representations by imitating the output of the teacher model.

[0123] In the process of knowledge distillation, the goal of the student model is to learn the distance-based vector representation output by the teacher model, which means that the student model must not only extract features from the information in the knowledge graph, but also make its output consistent with the distance-based vector generated by the teacher model as much as possible.

[0124] Specifically, the student model adjusts its weights by minimizing the difference between the teacher model and the student model, thereby "mimicking" the behavior of the teacher model. Specifically, the difference between the teacher model and the student model can be minimized through the knowledge distillation loss function.

[0125] This knowledge distillation process helps the student model to learn from the deep features captured by the teacher model for distance-based graphs when processing knowledge-graph-based graphs, thereby improving its ability to process complex graph data.

[0126] By adopting the embodiments of the present disclosure, through knowledge distillation, the student model can transfer the knowledge learned from different graph structures and features when learning the teacher model, so that the student model can not only learn useful features from the data, but also show good adaptability in a variety of complex situations. The teacher model is responsible for processing the distance-based graph, and the student model is responsible for processing the knowledge graph-based graph. Through knowledge distillation, the student model learns the distance-based vector representation output by the teacher model, which can make the student model have stronger expression ability and enhance the prediction ability of complex traffic flow change patterns.

[0127] Wherein, in an optional embodiment, the training process of the dynamic multi-graph hybrid expert graph neural network based on knowledge distillation includes a training phase and a fine-tuning phase; the method further includes: In the training phase, a first loss function value is obtained according to the estimated traffic flow of each of the N sample road sections at the next moment and the actual traffic flow of each of the N sample road sections at the next moment, and based on the first loss function value, the parameters of the dynamic multi-graph hybrid expert graph neural network based on knowledge distillation to be trained are updated; In the fine-tuning stage, a distillation loss value is obtained according to the distance-based vector representation and the knowledge graph-based vector representation of each of the N sample road sections, and based on the first loss function value, the parameters of the trained dynamic multi-graph hybrid expert graph neural network based on knowledge distillation are fine-tuned.

[0128] In the training phase, when updating the parameters of the knowledge distillation-based dynamic multi-graph hybrid expert graph neural network to be trained, the loss function used in the present disclosure is the mean absolute loss, and the parameters are updated end-to-end through back-propagation to minimize the loss.

[0129] Specifically, the first loss function value can be calculated by the estimated traffic flow of each of the N sample sections at the next moment and the actual traffic flow of each of the N sample sections at the next moment, which can be calculated by the following formula:

[0130] The first loss function value reflects the error of the dynamic multi-graph hybrid expert graph neural network based on knowledge distillation to be trained in traffic flow prediction, where: represents the traffic flow observation value predicted by the knowledge distillation-based dynamic multi-graph hybrid expert graph neural network for the i-th road section at the future time t; represents the actual value of traffic flow collected by the sensor deployed on the i-th road section at the future time t; Indicates future time period The number of moments included.

[0131] By continuously calculating the first loss function and optimizing the parameters of the dynamic multi-graph hybrid expert graph neural network based on knowledge distillation to be trained, a trained dynamic multi-graph hybrid expert graph neural network based on knowledge distillation is obtained.

[0132] The goal of the fine-tuning phase is to further optimize the trained dynamic multi-graph hybrid expert graph neural network based on knowledge distillation. By fine-tuning the sub-networks in the dynamic multi-graph hybrid expert graph neural network based on knowledge distillation, its accuracy and robustness in traffic flow prediction tasks can be improved.

[0133] During the fine-tuning phase, optimization relies on the distillation loss value. The distillation loss value is calculated by comparing the difference between the knowledge graph-based vector representation output by the student model and the distance-based vector representation output by the teacher model. The distillation loss value reflects whether the student model has accurately learned the knowledge output by the teacher model.

[0134] The distillation loss value can be calculated by the following formula:

[0135] in, , are learnable parameters, which belong to the parameters of the trained dynamic multi-graph hybrid expert graph neural network based on knowledge distillation that need to be micro-tao, represents the distance-based vector output by the teacher model, A knowledge graph-based vector representation of the student model output.

[0136] The total loss is determined by combining the distillation loss value and the first loss function value. The total loss can be determined by the following formula:

[0137] in, is the weight coefficient, which controls the relative importance of the two parts of loss.

[0138] By combining the distillation loss value and the total loss obtained by the first loss function value, the parameters of the trained dynamic multi-graph hybrid expert graph neural network based on knowledge distillation are fine-tuned.

[0139] By adopting the embodiments of the present disclosure, the combination of the training phase and the fine-tuning phase makes the training process more gradual and refined. Through the training phase, the basic laws of traffic flow can be learned from a global level; and through the fine-tuning phase, its performance in specific tasks and scenarios can be further optimized based on the learned laws. Such phased training can effectively improve the convergence speed and final prediction accuracy of the model. The training phase focuses on the overall traffic flow prediction capability, while the fine-tuning phase introduces knowledge distillation to enable the model to show greater accuracy and robustness in dealing with complex traffic flow changes, graph structure dependencies, cross-domain tasks, etc.

[0140] In an optional embodiment, predicting the estimated traffic flow of each of the N road sections at the next moment according to the knowledge graph-based vector representation and the distance-based vector representation of each of the N road sections includes: Based on the Manhattan self-attention mechanism, the knowledge graph-based vector representation and the distance-based vector representation of each of the N road sections are fused to obtain a final vector representation of each of the N road sections; Based on the final vector representation of each of the N road sections, the estimated traffic flow of each of the N road sections at the next moment is predicted.

[0141] By combining the Manhattan self-attention mechanism, physical distance information and semantic relationship information can be effectively fused. For the distance-based vector representation and the knowledge graph-based vector representation corresponding to the same node, the Manhattan distance between the two vector representations is calculated. The smaller the Manhattan distance, the greater the similarity between the two, and vice versa.

[0142] Manhattan distance can be determined using the following formula:

[0143] in, are two vectors, and are the first A quantity.

[0144] The main reason why the present disclosure uses Manhattan attention is that the present disclosure uses the Manhattan distance between the query and the key to replace the dot product operation of the query and the key in the standard attention mechanism to measure the similarity between the two.

[0145] The attention score calculation formula of Manhattan self-attention is:

[0146] Among them, the negative sign is used to convert Manhattan distance to similarity (the smaller the distance, the higher the similarity). This is because the smaller the Manhattan distance means the more similar the two vectors are. In the Manhattan self-attention mechanism, it is usually hoped that nodes with higher similarity can have a greater impact on the final output, so the negative sign is used to ensure that a smaller distance corresponds to a higher similarity. represents the distance-based vector representation of the i-th road segment, Represents the knowledge graph-based vector representation of the i-th road segment.

[0147] The scores are then normalized using the softmax function so that they are in the range [0,1] and sum to 1. The final output is :

[0148]

[0149] in, Represents the knowledge graph-based vector representation of the i-th road segment.

[0150] Using the embodiments of the present disclosure, Manhattan self-attention dynamically adjusts the weighting of features corresponding to different nodes by calculating the distance between nodes, so that features between similar nodes are given higher weights. Ultimately, the vector representation after integrating the vector representation based on the knowledge graph and the vector representation based on the distance can more comprehensively capture the complex dependencies between nodes and improve the prediction and generalization capabilities of the model.

[0151] After fusing the knowledge graph-based vector representation and the distance-based vector representation through Manhattan self-attention, the final vector representation of each of the N road sections is obtained and input into the output layer. The output layer predicts the traffic flow of each of the N road sections at the next moment.

[0152] Based on the same technical concept, the present disclosure provides a traffic flow prediction device based on a dynamic multi-graph hybrid expert graph neural network. Figure 4 1 is a block diagram of a traffic flow prediction device based on a dynamic multi-graph hybrid expert graph neural network shown in an embodiment of the present disclosure. Figure 4 As shown, the device comprises: A first acquisition module 410 is used to obtain a road network graph, wherein the road network graph includes N nodes, each node represents a road section, and an edge between two nodes represents a connection relationship between road sections, and N is an integer greater than 2; The second acquisition module 420 is used to obtain the traffic flow sequence of each of the N road sections corresponding to the N nodes, and the traffic flow sequence of each road section includes: the actual traffic flow collected by the road sensors deployed on the road section at H time points; A first construction module 430 is configured to construct a distance-based graph for the road network graph according to the distance correlation between every two road segments in the N road segments, wherein the distance-based graph includes N nodes, each node represents a road segment, and an edge between two nodes indicates that there is a distance correlation between the road segments; A second construction module 440 is used to obtain the attributes of each of the N road segments and the semantic correlation between every two road segments in the N road segments, and construct a graph based on the knowledge graph, wherein the graph based on the knowledge graph includes N nodes, each node represents a road segment, and an edge between two nodes indicates that there is a semantic correlation between the road segments; The expert processing module 450 is used to process the distance-based graph, the knowledge graph-based graph and the traffic flow sequences of the N road sections through a pre-trained dynamic multi-graph hybrid expert graph neural network to obtain a distance-based vector representation and a knowledge graph-based vector representation of the N road sections; The traffic prediction module 460 is used to predict the estimated traffic flow of each of the N road sections at the next moment based on the knowledge graph-based vector representation and the distance-based vector representation of each of the N road sections.

[0153] The present disclosure also provides an electronic device, referring to Figure 5 , Figure 5 is a schematic diagram of an electronic device proposed in an embodiment of the present disclosure. Figure 5 As shown, the electronic device 500 includes: a memory 510 and a processor 520. The memory 510 and the processor 520 are connected via a bus communication. A computer program is stored in the memory 510. The computer program can be run on the processor 520 to implement the steps in the traffic flow prediction method based on the dynamic multi-graph hybrid expert graph neural network disclosed in the embodiment of the present disclosure.

[0154] The embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the traffic flow prediction method based on a dynamic multi-graph hybrid expert graph neural network disclosed in the embodiment of the present disclosure are implemented.

[0155] The embodiment of the present disclosure also provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps in the traffic flow prediction method based on a dynamic multi-graph hybrid expert graph neural network disclosed in the embodiment of the present disclosure are implemented.

[0156] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0157] It should be understood by those skilled in the art that the embodiments of the present disclosure may be provided as methods, devices or computer program products. Therefore, the embodiments of the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0158] The embodiments of the present disclosure are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic devices, and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0159] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0160] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0161] Although some embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiment and all changes and modifications that fall within the scope of the present disclosure.

[0162] The above is a detailed introduction to the traffic flow prediction method based on a dynamic multi-graph hybrid expert graph neural network provided by the present disclosure. This article uses specific examples to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method of the present disclosure and its core idea; at the same time, for general technical personnel in this field, according to the ideas of the present disclosure, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present disclosure.

Claims

1. A traffic flow prediction method based on dynamic multi-graph hybrid expert graph neural network, characterized in that: include: Obtain a road network graph, wherein the road network graph includes N nodes, each node represents a road section, an edge between two nodes represents a connection relationship between the road sections, and N is an integer greater than 2; Obtaining the traffic flow sequences of the N road sections corresponding to the N nodes, wherein the traffic flow sequence of each road section includes: the actual traffic flow collected by the road sensors deployed on the road section at H moments; For the road network graph, according to the distance correlation between every two road sections in the N road sections, a distance-based graph is constructed, wherein the distance-based graph includes N nodes, each node represents a road section, and an edge between two nodes indicates that there is a distance correlation between the road sections; Obtaining the attributes of each of the N road segments and the semantic correlation between every two road segments in the N road segments, and constructing a graph based on the knowledge graph, wherein the graph based on the knowledge graph includes N nodes, each node represents a road segment, and an edge between two nodes indicates that there is a semantic correlation between the road segments; According to the distance-based graph, the knowledge graph-based graph, and the traffic flow sequences of each of the N road sections, a pre-trained dynamic multi-graph hybrid expert graph neural network is used to process the traffic flow sequences of each of the N road sections, thereby obtaining a distance-based vector representation and a knowledge graph-based vector representation of each of the N road sections; According to the knowledge graph-based vector representation and the distance-based vector representation of each of the N road sections, the estimated traffic flow of each of the N road sections at the next moment is predicted.

2. The method according to claim 1, characterized in that The attributes of each of the N road segments include at least one or more of the following: road type, surrounding facilities POI, historical events, and weather conditions; the semantic relevance includes one or more of the following: shared POI, affected by the same historical event; the attributes of each of the N road segments and the semantic relevance between every two road segments in the N road segments are obtained, and a graph based on the knowledge graph is constructed, including: Building a knowledge graph-based graph ,in, is the set of all nodes in the graph based on the knowledge graph, represents the N road nodes, Represents multiple POI nodes, Represents multiple event nodes, is the set of all relations in the graph based on the knowledge graph, Indicates that the road sections corresponding to the two nodes belong to the same type of roads. Indicates that the road sections corresponding to the two nodes share the same POI. Indicates that the road sections corresponding to the two nodes are affected by the same historical event; For the N road nodes, construct a road subgraph, wherein the road subgraph includes all road nodes and adjacent relationships or attribute similarity relationships between all road nodes; For the multiple POI nodes, construct a POI subgraph, wherein the POI subgraph includes POI sharing relationships between all POI nodes and all road nodes, and the POI subgraph is used to capture the impact of POI facilities on traffic flow of road nodes; For all event nodes, an event subgraph is constructed, wherein the event subgraph includes all event nodes and the relationships among all road nodes affected by the same event.

3. The method according to claim 2, characterized in that Building a knowledge graph-based graph ,include: Acquire data related to the N road nodes, where the data related to each road node includes: attributes of the road section corresponding to the road node; Acquire data related to the plurality of POI nodes, wherein the data related to each POI node includes: a POI facility near any road among the N road nodes; Acquire data related to the multiple event nodes, where the data related to each event node includes: a historical event involved in any road among the N road nodes; Obtaining data related to the relationship, including: the relationship between road segments of the same type, whether the road segments share the same POI, and whether the road segments share the same historical events; Performing attribute labeling on the N road nodes; The POI nodes are associated with road nodes based on the data associated with the plurality of POI nodes, and the event nodes are associated with road nodes based on the data associated with the plurality of event nodes.

4. The method according to claim 1, characterized in that: After constructing a distance-based graph according to the distance correlation between every two road segments in the N road segments for the road network graph, the method further includes: Divide the distance-based graph into M distance-based subgraphs; According to the distance-based graph and the traffic flow sequences of the N road sections, a pre-trained dynamic multi-graph hybrid expert graph neural network is used to process and obtain a distance-based vector representation of the N road sections, including: According to the multiple distance-based subgraphs and the respective traffic flow sequences of the N road sections, the mth distance-based subgraph and the respective traffic flow sequences of the N road sections are processed by an mth expert graph neural network in a first branch of a pre-trained dynamic multi-graph hybrid expert graph neural network, where m ranges from 1 to M, and M represents the total number of expert graph neural networks in the first branch; Determining the weights of the processing results of M expert graph neural networks through the gating network in the first branch, wherein the parameters of the M expert graph neural networks are different from each other; According to the weights output by the gated network in the first branch, weighted fusion is performed on the processing results of the M expert graph neural networks to obtain distance-based vector representations of each of the N road sections.

5. The method according to claim 2, characterized in that: The graph based on the knowledge graph includes Q subgraphs based on the knowledge graph, where Q is an integer greater than 1; the subgraph based on the knowledge graph includes at least the road subgraph, the POI subgraph, and the event subgraph; according to the graph based on the knowledge graph and the traffic flow sequences of the N road sections, a pre-trained dynamic multi-graph hybrid expert graph neural network is used to process and obtain a vector representation based on the knowledge graph for each of the N road sections, including: According to the subgraph based on the knowledge graph and the traffic flow sequences of the N road sections, the qth expert graph neural network in the second branch of the pre-trained dynamic multi-graph hybrid expert graph neural network processes the qth subgraph based on the knowledge graph and the traffic flow sequences of the N road sections, where the value of q ranges from 1 to Q, and Q represents the total number of expert graph neural networks in the second branch; Determining the weights of the processing results of the Q expert graph neural networks through the gating network in the second branch, wherein the parameters of the Q expert graph neural networks are different from each other; According to the weights output by the gated network in the second branch, the processing results of the Q expert graph neural networks are weightedly fused to obtain a vector representation based on the knowledge graph for each of the N road sections.

6. The method according to claim 3 or 5, characterized in that: The pre-trained dynamic multi-graph hybrid expert graph neural network is a dynamic multi-graph hybrid expert graph neural network based on knowledge distillation; in the dynamic multi-graph hybrid expert graph neural network of knowledge distillation, the sub-network that processes the distance-based graph is a teacher model, and the sub-network that processes the knowledge graph-based graph is a student model; The student model aims to learn the distance-based vector representation of each of the N road segments output by the teacher model, and outputs the knowledge graph-based vector representation of each of the N road segments.

7. The method according to claim 6, characterized in that The training process of the dynamic multi-graph hybrid expert graph neural network based on knowledge distillation includes a training phase and a fine-tuning phase; the method also includes: In the training phase, a first loss function value is obtained according to the estimated traffic flow of each of the N sample road sections at the next moment and the actual traffic flow of each of the N sample road sections at the next moment, and based on the first loss function value, the parameters of the dynamic multi-graph hybrid expert graph neural network based on knowledge distillation to be trained are updated; In the fine-tuning stage, a distillation loss value is obtained according to the distance-based vector representation and the knowledge graph-based vector representation of each of the N sample road sections, and based on the first loss function value, the parameters of the trained dynamic multi-graph hybrid expert graph neural network based on knowledge distillation are fine-tuned.

8. The method according to claim 1, characterized in that Predicting the estimated traffic flow of each of the N road sections at the next moment according to the knowledge graph-based vector representation and the distance-based vector representation of each of the N road sections, including: Based on the Manhattan self-attention mechanism, the knowledge graph-based vector representation and the distance-based vector representation of each of the N road sections are fused to obtain a final vector representation of each of the N road sections; Based on the final vector representation of each of the N road sections, the estimated traffic flow of each of the N road sections at the next moment is predicted.

9. A traffic flow prediction device based on a dynamic multi-graph hybrid expert graph neural network, characterized in that: include: A first acquisition module is used to obtain a road network graph, wherein the road network graph includes N nodes, each node represents a road section, and an edge between two nodes represents a connection relationship between the road sections, and N is an integer greater than 2; The second acquisition module is used to obtain the traffic flow sequence of each of the N road sections corresponding to the N nodes, and the traffic flow sequence of each road section includes: the actual traffic flow collected by the road sensors deployed on the road section at H time points; A first construction module is used to construct a distance-based graph for the road network graph according to the distance correlation between every two road segments in the N road segments, wherein the distance-based graph includes N nodes, each node represents a road segment, and an edge between two nodes indicates that there is a distance correlation between the road segments; A second construction module is used to obtain the attributes of each of the N road segments and the semantic correlation between every two road segments in the N road segments, and construct a graph based on the knowledge graph, wherein the graph based on the knowledge graph includes N nodes, each node represents a road segment, and an edge between two nodes indicates that there is a semantic correlation between the road segments; An expert processing module, configured to process the distance-based graph, the knowledge graph-based graph, and the traffic flow sequences of the N road sections through a pre-trained dynamic multi-graph hybrid expert graph neural network to obtain distance-based vector representations and knowledge graph-based vector representations of the N road sections; The traffic prediction module is used to predict the estimated traffic flow of each of the N road sections at the next moment based on the knowledge graph-based vector representation and the distance-based vector representation of each of the N road sections.

10. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the traffic flow prediction method based on a dynamic multi-graph hybrid expert graph neural network as described in any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Abnormity monitoring method and device for road traffic network, and storage medium

    CN120526323A

  • Traffic flow prediction method and system based on dynamic perception expert network

    CN121686770A