A traffic flow prediction method and system based on auxiliary node enhanced spatiotemporal perception

By selecting the auxiliary nodes with the highest correlation to the target node and combining the features of temporal and spatial attention mechanisms, the problem of the difficulty in reflecting the correlation between non-adjacent nodes in traffic flow prediction is solved, thereby improving prediction accuracy and efficiency. It is applicable to urban traffic management and public safety.

CN119851464BActive Publication Date: 2025-11-04WUHAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411876266.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-11-04
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

Existing traffic flow prediction models struggle to accurately reflect the correlation between non-adjacent nodes when dealing with complex urban traffic systems, resulting in insufficient prediction accuracy. Furthermore, they neglect the heterogeneity between nodes, affecting the accuracy of the prediction results.

Method used

By selecting auxiliary nodes with the highest correlation to the target node, and combining point-by-point embedding and global embedding methods, the node features are fused using temporal attention and spatial interactive attention mechanisms to improve the accuracy of traffic flow prediction.

Benefits of technology

It significantly improves the accuracy and computational efficiency of traffic flow forecasting, adapts to complex traffic flow changes, and supports the stable operation and management of urban transportation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119851464B_ABST
    Figure CN119851464B_ABST
Patent Text Reader

Abstract

The application discloses a traffic flow prediction method and system based on auxiliary node enhanced space-time perception, and the method comprises the following steps: acquiring the positions and traffic flow sequences of nodes; selecting a target node, calculating the distances between the target node and other nodes, and selecting several nodes with distances less than a preset distance threshold or the first several nodes with the smallest distances as auxiliary nodes; embedding the traffic flow sequence of the target node point by point to extract local features; embedding the traffic flow sequences of the target node and the auxiliary nodes to extract global features; fusing the local features and the global features of the target node by using a time attention mechanism to obtain multi-scale features of the target node, and fusing the multi-scale features of the target node and the global features of the auxiliary nodes by using a space interaction attention mechanism to obtain fused features; and predicting the traffic flow of the target node at the next moment based on the fused features. The application improves the accuracy of flow prediction.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of traffic flow prediction, in particular to a traffic flow prediction method and system based on auxiliary node enhanced spatio-temporal perception. BACKGROUND

[0002] With the rapid advancement of global urbanization, the population and the number of vehicles in cities are increasing year by year, and the problem of traffic congestion is becoming increasingly serious. Intelligent transportation system (ITS) as an important technical means to alleviate urban traffic pressure, gradually plays an indispensable role in modern cities. Intelligent transportation system is an integrated system that combines information technology, communication technology, sensor network and control technology, which can realize efficient information exchange and collaborative control between roads, vehicles and traffic management, aiming to improve the smoothness of traffic flow and travel safety.

[0003] Among the various functional modules of intelligent transportation system, the traffic flow prediction system as a core component undertakes the key tasks of traffic data collection, analysis and prediction. Through the collection of real-time road data, the analysis of historical data and the application of various machine learning algorithms, the system can predict the traffic flow and congestion conditions of different road sections in the future. Accurate traffic prediction not only helps drivers plan the best route before departure, reducing the time wasted due to traffic jams, but also helps freight logistics companies optimize their travel arrangements and reduce transportation costs. At the same time, traffic prediction information can also provide scientific basis for traffic management departments, so that they can timely deploy management personnel, adjust signal light duration, optimize road network structure, and respond to emergencies in the event of sudden conditions, thereby improving the overall traffic efficiency and the operation ability of the city.

[0004] However, modern transportation systems have highly nonlinear and dynamic characteristics, and traditional mathematical statistical models and machine learning models often have difficulty in meeting the demand in terms of prediction accuracy, so more and more research has turned to deep learning models such as convolutional neural network (CNN), recurrent neural network (RNN), graph neural network (GNN) and graph convolution network (GCN). These deep learning methods can capture spatial correlation using the features of adjacent nodes, but in the actual road network structure, there may be strong correlation between some non-adjacent nodes, which may lead to the fact that the graph structure cannot truly reflect the actual dependency relationship, and even cause key information to be ignored or lost. In addition, GNN tends to treat all nodes equally in the prediction process, ignoring the heterogeneity between variables. Although nodes with similar trends help improve prediction performance, nodes with different trends may adversely affect the prediction results, thereby reducing the overall prediction accuracy. SUMMARY

[0005] The application aims to provide a traffic flow prediction method and system based on auxiliary node enhanced spatio-temporal perception, which screens the auxiliary nodes with the highest relevance to the target node in the traffic flow sequence to reduce the interference of irrelevant nodes on the prediction accuracy and realizes accurate prediction of traffic flow data.

[0006] In a first aspect of the application, a traffic flow prediction method based on auxiliary node enhanced spatio-temporal perception is provided, which comprises:

[0007] S101, obtaining the positions of each node and the traffic flow sequence;

[0008] S102, selecting a target node, calculating the distance between the target node and other nodes according to the positions of each node, and selecting a number of nodes with a distance less than a preset distance threshold or a number of nodes with the smallest distance as auxiliary nodes;

[0009] S103, embedding the traffic flow sequence of the target node point by point to extract the local features of the target node;

[0010] S104, respectively performing variable embedding on the traffic flow sequences of the target node and the auxiliary nodes to extract the global features of the target node and the auxiliary nodes;

[0011] S105, using a time attention mechanism to fuse the local features and global features of the target node to obtain multi-scale features of the target node, and using a spatial interaction attention mechanism to fuse the multi-scale features of the target node and the global features of the auxiliary nodes to obtain fusion features;

[0012] S106, predicting the traffic flow of the target node at the next moment based on the fusion features.

[0013] In some embodiments, step S101 further comprises:

[0014] The traffic flow sequence data of each node is normalized, and the specific formula is as follows:

[0015]

[0016] wherein, X norm is the normalized value, X is the original traffic flow data, X max is the maximum value in the original traffic flow data, and X min is the minimum value in the original traffic flow data.

[0017] In some embodiments, step S103 comprises:

[0018] The traffic flow sequence of the auxiliary node is globally encoded, and the traffic flow sequence of the target node is sampled and combined with point-by-point encoding and global encoding; the point-by-point encoding is used to extract the local features of the traffic flow sequence, and the global encoding provides the spatio-temporal information of the target node and the auxiliary node to enhance the perception of traffic flow changes;

[0019] Point-by-point embedding: the local feature extraction is performed on the traffic flow sequence of the target node, i.e., the traffic flow sequence {X i t-T+1 ,...,X i t} of the target node is embedded by point-by-point operation to extract the fine-grained expression of the historical traffic flow information of the target node, and the calculation formula is as follows:

[0020] P i =Point-Embedding(X i t-T+1 ,...,X i t )

[0021] wherein, is the feature vector of the traffic flow sequence of the target node X i after the point-by-point encoding, X i t is the traffic flow data of the target node X i at t time, and T represents the data amount of the traffic flow sequence of the target node; represents a matrix with t time steps and D features; Point-Embedding represents a point-by-point encoding function;

[0022] Variable embedding: the global feature extraction is performed on the traffic flow sequences of the target node and the auxiliary node, the traffic flow sequence is embedded as a whole variable token, and the dynamic change rule of the traffic flow is better reflected by globally expressing and processing the traffic flow sequence, so as to improve the data capturing ability of the model; the global encoding is expressed by the following formula:

[0023]

[0024] wherein, is the traffic flow sequence of the target node, is the traffic flow sequence of the jth auxiliary node corresponding to the target node, V i , is the feature vector of the two after the global encoding, which contains the global information of the historical traffic flow; represents a 1*D feature matrix, and D is the feature dimension; VariatEmbedding is a global encoding function.

[0025] In some embodiments, step S104 comprises:

[0026] The time attention mechanism extracts the correlation of the target node in the time dimension, i.e., combines the local encoding information and the global encoding information of the target node to extract multi-scale features, and effectively captures the time dynamic changes of the traffic flow;

[0027] The input sequence [P i ,V i ] generates the query Q i , the key K i and the value V i through different linear mappings, and the time attention mechanism is used to calculate the correlation of the internal time sequence of the target node:

[0028]

[0029] Wherein, the feature matrix Q i l ,K i l ,V i l is obtained by fusing the point-by-point encoding information of the target node with the global encoding information and then passing through a fully connected layer in the lth layer of the model, is the weight matrix of the fully connected layer, represents the bias, d k is the feature dimension; Attn l is the output of the time attention mechanism in the lth layer of the model, i.e., the multi-scale feature; Softmax() represents the Softmax function.

[0030] In some embodiments, step S105 comprises:

[0031] The spatial interaction attention mechanism is introduced to fuse the spatio-temporal information of the target node and the auxiliary node; based on the cross-attention mechanism, the information between different sequences is associated to improve the spatial modeling accuracy of the traffic flow prediction;

[0032] The multi-scale feature of the target node and the feature vector of the auxiliary node after global encoding are taken as inputs to extract the spatial correlation between nodes, and different weights are assigned to realize effective fusion of information, and the specific formula is as follows:

[0033]

[0034] Wherein, the feature matrix Q icross l ,K icross l ,V icrossl is obtained by fusing the target node and the auxiliary node information in the model lth layer and then passing through a fully connected layer, is a weight matrix of the fully connected layer, represents a bias, d k is a feature dimension; Attn cross l is the output of the spatial interaction attention mechanism of the model lth layer, that is, the fused feature; Softmax() represents a Softmax function.

[0035] In some embodiments, step S106 includes:

[0036] The fused feature is sequentially input to a feedforward layer, a projection layer and a linear layer, inference is performed from the feature representation, and the traffic flow of the target node at the next time is generated.

[0037] In some embodiments, the loss function adopts a SmoothL1 loss function, and the formula is as follows:

[0038]

[0039] wherein x is a predicted value of the model, y is a true value, β is a hyperparameter, and SmoothL1Loss(x, y) is a model loss;

[0040] The traffic flow prediction model sets the number of layers to 3, the batch size of each layer to 32, the hidden layer dimension to 64, the number of attention heads to 8, and the feedforward layer dimension to 256.

[0041] According to a second aspect of the present application, a traffic flow prediction system based on auxiliary node enhanced spatiotemporal perception is provided for implementing the traffic flow prediction method based on auxiliary node enhanced spatiotemporal perception according to any one of the first aspect, and the system comprises:

[0042] A data acquisition module is configured to acquire the positions of the nodes and the traffic flow sequences.

[0043] An auxiliary node selection module is configured to select a target node, calculate the distances between the target node and other nodes according to the positions of the nodes, and select a plurality of nodes with distances less than a preset distance threshold or a plurality of nodes with the smallest distances as auxiliary nodes.

[0044] A node embedding module is configured to perform point-by-point embedding on the traffic flow sequence of the target node, extract local features of the target node, and perform variable embedding on the traffic flow sequences of the target node and the auxiliary nodes respectively, and extract global features of the target node and the auxiliary nodes.

[0045] The time correlation modeling module is configured to fuse the local features and the global features of the target node by using a time attention mechanism to obtain multi-scale features of the target node.

[0046] The space dependency modeling module is configured to fuse the multi-scale features of the target node and the global features of the auxiliary nodes by using a space interaction attention mechanism to obtain fused features.

[0047] The prediction output layer module is configured to predict the traffic flow of the target node at the next time based on the fused features.

[0048] According to a third aspect of the present application, an electronic device is provided, comprising a processor and a memory, the memory storing programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the steps of the traffic flow prediction method based on auxiliary node enhanced spatiotemporal perception according to any one of the first aspect.

[0049] According to a fourth aspect of the present application, a readable storage medium is provided, and the readable storage medium stores programs or instructions, and the programs or instructions are executed by the processor to implement the steps of the traffic flow prediction method based on auxiliary node enhanced spatiotemporal perception according to any one of the first aspect.

[0050] Overall, the traffic flow prediction method and system based on auxiliary node enhanced spatiotemporal perception conceived by the present application have significant technical advantages compared to the prior art, especially in terms of prediction accuracy, computational efficiency, adaptability and flexibility.

[0051] (1) Improved prediction accuracy: The present application accurately identifies the auxiliary nodes with the highest relevance to the target node through the auxiliary node selection module, enhancing the spatial dependency modeling capability of the target node and significantly improving the accuracy of flow prediction.

[0052] (2) Efficient processing capability: The present application combines point-by-point encoding and global encoding methods based on global encoding to effectively extract local and global feature information of the nodes, thereby deeply mining complex spatial dependency relationships while maintaining high computational efficiency, improving the computational efficiency of long-term traffic flow prediction.

[0053] (3) Spatiotemporal feature fusion: The present application effectively fuses the spatial and temporal information of the target node and the auxiliary nodes through the spatiotemporal attention module, capturing the complex dependency relationship between them, ensuring excellent performance in long-term prediction tasks and adapting to complex traffic flow change requirements.

[0054] (4) Wide range of applications: The present application has strong adaptability in intelligent traffic flow prediction, can provide accurate flow prediction for urban traffic systems, support supply and demand balance and stable operation of the traffic system, and is suitable for multiple application fields such as urban planning, traffic management and public safety.

[0055] In summary, the present application provides an innovative traffic flow prediction solution and system, which has significant advantages in long-term prediction accuracy, computational efficiency and adaptability, and provides strong support for the development of modern intelligent transportation systems. BRIEF DESCRIPTION OF DRAWINGS

[0056] Figure 1 A flowchart of a traffic flow prediction method based on auxiliary node enhanced spatiotemporal perception provided for an embodiment of the present application;

[0057] Figure 2 A schematic diagram of an auxiliary node selection module provided for an embodiment of the present application;

[0058] Figure 3 A node embedding process diagram provided for an embodiment of the present application;

[0059] Figure 4 A spatiotemporal attention network module diagram provided for an embodiment of the present application;

[0060] Figure 5 An architecture diagram of a traffic flow prediction system based on auxiliary node enhanced spatiotemporal perception provided for an embodiment of the present application;

[0061] Figure 6 A hardware structure schematic diagram of a computer device provided for an embodiment of the present application. DETAILED DESCRIPTION

[0062] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present application.

[0063] Obviously, the accompanying drawings in the following description are only some examples or embodiments of the present application, and for those of ordinary skill in the art, the present application can be applied to other similar scenarios without creative labor. In addition, it can be understood that although the efforts made in this development process can be complex and lengthy, for those of ordinary skill in the art related to the content disclosed in the present application, some design, manufacture or production changes based on the technical content disclosed in the present application are only routine technical means, and should not be understood as insufficient disclosure of the present application.

[0064] Reference to an "embodiment" in this application means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily mutually exclusive of one another. It is expressly understood that that the embodiments described herein are merely examples from a multitude of possible embodiments, myriad of possible combinations, and multitude of possible permutations.

[0065] Unless otherwise defined, technical terms and scientific terms used in the present application shall have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. Unless otherwise defined, the terms "one", "a", "an", "the" and like terms referring to an element will not be limited to the singular but can comprise one or more elements unless otherwise indicated. The terms "including", "containing", "having", and the like are not intended to be limiting and are understood to mean "comprising". The terms "connected", "coupled", or the like, unless otherwise defined, are not limited to direct or physical connections or attachments, but can include indirect coupling or association. The term "multiple" means two or more. The term "and / or" describes associated objects in association with each other, which means that there can be three relationships, for example, "A and / or B" can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally means that the associated objects are in an "or" relationship. The terms "first", "second", "third", and the like are merely used to distinguish similar objects, and do not represent a specific order of the objects.

[0066] The application provides a traffic flow prediction method and system using auxiliary nodes for local and global feature capture, which realizes dependency modeling of data by selecting auxiliary nodes in multi-element space-time sequence data, and is suitable for multiple application fields such as urban planning, traffic management and public safety.

[0067] The application embodiment provides a traffic flow prediction method based on auxiliary node enhanced space-time perception, which solves the problem of insufficient dependency modeling capability of multi-node traffic flow data and improves the prediction accuracy. Figure 1 A flowchart of a traffic flow prediction method based on auxiliary node enhanced space-time perception provided by the application embodiment is shown in Figure 1 As shown in the figure, the method comprises the following steps:

[0068] S101, acquiring the positions of each node and the traffic flow sequence;

[0069] S102、Select the target node, calculate the distance between the target node and other nodes according to the position of each node, and select several nodes with a distance less than a preset distance threshold or the first several nodes with the smallest distance as auxiliary nodes;

[0070] S103, point-by-point embedding of the traffic flow sequence of the target node is performed to extract the local features of the target node;

[0071] S104, variable embedding is performed on the traffic flow sequences of the target node and the auxiliary nodes to extract the global features of the target node and the auxiliary nodes;

[0072] S105, the local features and the global features of the target node are fused by using a time attention mechanism to obtain multi-scale features of the target node, and the multi-scale features of the target node and the global features of the auxiliary nodes are fused by using a spatial interaction attention mechanism to obtain fusion features;

[0073] S106, predicting the traffic flow of the target node at the next moment based on the fusion features.

[0074] Specifically, the specific technical solutions include the following modules and steps:

[0075] Step S101, collecting traffic flow data and performing data preprocessing: obtaining node information and distance related data from the traffic data set, and recording traffic flow. Normalization processing is used to unify the data scale and eliminate the dimensional difference of the feature. The specific formula is as follows:

[0076]

[0077] wherein, X norm is the normalized value, X is the original traffic flow data, X max is the maximum value in the training data, and X min is the minimum value in the training data.

[0078] Step S102, auxiliary node selection module design: an auxiliary node selection module is designed to extract spatial features. As shown in Figure 2 , based on the target node flow sequence, the other nodes with the highest relevance to the target node are calculated to capture the spatial dependence relationship. This module uses Euclidean distance to divide the feature space and selects the auxiliary nodes related to the target node. The specific calculation formula of the distance is as follows:

[0079]

[0080] n=[1,...,N],n≠i

[0081] Wherein, i is the target node number, n is the other node number, the embodiment of the application adopts the Euclidean distance formula to calculate the distance between nodes, that is, realized by Dis function.

[0082] After calculating the distance between all target nodes and other nodes, the distance set is obtained, and the distance set is sorted from small to large by Argsort function to obtain sorted_distances, and the specific formula is as follows:

[0083] (d 1→i ,d 2→i ,...,d N→i )=Argsort(distances)

[0084] sorted_distances=(d 1→i ,d 2→i ,...,d N→i )

[0085] Wherein, (d 1→i ,d 2→i ,...,d N→i ) represents the sorted distance value.

[0086] Then select the auxiliary node. For example, set a preset distance threshold, and select the node with a distance value less than the preset distance threshold as the auxiliary node of the target node. For another example, select the first several nodes with the smallest distance value as the auxiliary node; for example, select the first 5 nodes with the smallest distance value as the auxiliary node of the target node.

[0087] Finally, the traffic flow information of the corresponding auxiliary node is obtained by the selected node index

[0088] Step S103, node embedding module design: the auxiliary node is globally coded, and the target node adopts the method of combining point-by-point and global coding, as shown in Figure 3 Point-by-point coding is used to extract local features of historical traffic, and global coding provides spatiotemporal information of target nodes and auxiliary nodes to enhance the perception of traffic flow changes.

[0089] (1) Point-by-point embedding: local feature extraction is performed on the historical traffic information of the target node in the traffic sequence. Specifically, the Point-by-point operation is embedded to extract fine-grained expression of node historical information, and the related calculation formula is as follows:

[0090] P i =Point-Embedding(X i t-T+1 ,...,X it )

[0091] wherein, is the target node X i Point-embedded vector, Point-Embedding represents the point-embedding function.

[0092] (2) Variable embedding: In the traffic sequence, both the target and auxiliary nodes are subjected to global feature extraction operation, and the traffic sequence features are embedded as a whole variable token. Through global expression and processing, the dynamic change law of traffic flow can be better reflected, and the data capturing ability of the model can be improved. The specific operation of global coding can be represented by the following formula:

[0093]

[0094] wherein, is the historical traffic information of the target node, is the historical traffic information of the jth auxiliary node corresponding to the target node, V i , is the feature vector after global coding, which contains the global information of historical traffic, and VariatEmbedding is the global coding function.

[0095] Step S104, time correlation modeling module design: the time correlation of the target node in the time dimension is extracted through the time attention mechanism, as shown in Figure 4 . This module combines the local and global coding information of the target node to extract multi-scale features and effectively capture the time dynamic changes of traffic.

[0096] The time attention module generates query Q i , key K i and value V i from the input sequence [P i , V i ] through different linear mappings, uses self-attention mechanism to calculate the correlation of the internal time sequence of the node, and the calculation formula is as follows:

[0097]

[0098] wherein, the feature matrix Q i l of the target node, i l i l is represented as in the lth layer of the model, which is obtained through the fusion of point-encoding information and global coding information and then through the fully connected layer; is the weight matrix of the fully connected layer, represents the bias, d​k is the feature dimension, Attn l is the output of the l-th layer temporal attention module.

[0099] Step S105, the spatial dependency modeling module is designed: a spatial interaction attention mechanism is introduced to fuse the spatio-temporal information of the target node and the auxiliary node, as shown in Figure 4 . This module is based on the cross-attention mechanism, which correlates the information between different sequences to improve the spatial modeling accuracy of traffic flow prediction.

[0100] The processed target node vector and the globally encoded auxiliary node vector are taken as inputs to extract the spatial correlation between nodes and achieve effective fusion of information by assigning different weights. The specific formula is as follows:

[0101]

[0102] wherein the feature matrix Q icross l ,K icross l ,V icross l is represented as in the l-th layer of the model, after the target node and auxiliary node information fusion, through the fully connected layer to obtain is the weight matrix of the fully connected layer, represents the bias, d k is the feature dimension, Attn cross l is the output of the l-th layer spatial interaction attention module.

[0103] Step S106, the prediction output layer is designed: through the projection layer and the linear layer, the prediction result of the future traffic flow is generated from the feature representation, and the long-term traffic flow prediction value is output. As shown in Figure 1 , the projection layer and the linear layer together constitute the prediction head, and there is a feedforward layer before the prediction head.

[0104] Step S107, model training and optimization: the traffic flow prediction model is implemented using Python code, and the experiment is performed on Pytorch. By optimizing the hyperparameters of the model, the optimal hyperparameters are selected to make the prediction accuracy of the model more accurate, and the related technical solutions are as follows:

[0105] (1) Loss function: SmoothL1 loss function is adopted, which combines the advantages of L1 loss (absolute error) and L2 loss (mean square error). When the error is small, it is similar to L2 loss, and when the error is large, it is similar to L1 loss, so it is more robust than using L1 or L2 loss alone. Its formula is as follows:

[0106]

[0107] where x is the predicted value of the model, y is the true value, and β is a hyperparameter with a default value of 1.

[0108] (2) Model parameters: The proposed traffic flow prediction model sets the number of layers to 3, the batch size of each layer to 32, the hidden layer dimension to 64, the number of attention heads to 8, and the feedforward layer dimension to 256. In the training process, the number of iterations of the model is set to 150.

[0109] (3) Optimization algorithm: The Adam optimization algorithm is used for model training to accelerate convergence and improve prediction performance.

[0110] (4) Hyperparameter adjustment: The initial learning rate is set to 0.001, and the learning rate is automatically updated to optimize model performance.

[0111] Step S108, model evaluation: The prediction effect of the prediction model is tested through performance evaluation and comparative experiments. Performance indicators such as absolute error and mean square error are used to evaluate the prediction effect of the model.

[0112]

[0113] where y i t is the true value of the i th node in the data set at time t, is the predicted value output by the model at that time.

[0114] The model proposed in this embodiment and widely used baseline models and SOTA models are compared.

[0115] Three data sets are selected for the data set, and the detailed information is shown in Table 1. In the experiment, three types of models, namely classical traditional models, graph neural network-based models, and deep learning models based on Transformer, are selected as benchmark models. These models represent different technical routes in the current traffic flow prediction field and can provide comprehensive comparative evaluation. The comparison results are shown in Table 2.

[0116] Table 1 Data set description table

[0117]

[0118] According to the prediction results shown in Table 2, it can be clearly seen that the model of the present application has achieved the best results on E MAE , E MAPE , and E RMSE , and the average has reached the best effect. Compared with SATEFormer, the E MAE and E RMSE ​The prediction performance is reduced by 8.66%, 4.80% and 10.13%, 8.75% respectively, verifying the effectiveness and generalization ability of the model. This is due to the effective use of auxiliary nodes to assist in prediction, thereby extracting the global features of the variables, and carefully considering the local features of the target node, by fusing the local and global features of the nodes, enhancing the perception ability of the spatio-temporal attention network, and improving the prediction accuracy. In summary, the model proposed in the present application can provide reliable prediction results in long-term demand traffic flow prediction, and achieve better performance than other baseline methods.

[0119] Table 2 prediction performance comparison experiment table

[0120]

[0121] It should be noted that the steps shown in the above flow or the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from here. For example, step S103 can be before step S104, or after step S104.

[0122] The embodiments of the present application also provide a point cloud generation device and a classification device, which are used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the terms "module", "unit", "sub-unit" and the like can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, hardware, or a combination of software and hardware implementation is also possible and contemplated.

[0123] Figure 5 is the structural block diagram of the traffic flow prediction system based on auxiliary node enhanced spatio-temporal perception of the embodiments of the present application. Unlike the traditional method of constructing a spatio-temporal graph network relying on proximity, the present application reduces the interference of irrelevant nodes on prediction accuracy by screening the auxiliary nodes with the highest relevance to the target node in the traffic flow sequence. As shown in Figure 5 The system comprises a data acquisition module 201, an auxiliary node selection module 202, a node embedding module 203, a time correlation modeling module 204, a spatial dependency modeling module 205 and a prediction output layer module 206;

[0124] The data acquisition module 201 is configured to acquire the positions and traffic flow sequences of the nodes.

[0125] The auxiliary node selection module 202 is configured to select a target node, calculate distances between the target node and other nodes according to positions of the nodes, and select a plurality of nodes with distances less than a preset distance threshold or a plurality of nodes with the smallest distances as auxiliary nodes.

[0126] The node embedding module 203 is configured to perform point-by-point embedding on a traffic flow sequence of the target node, extract local features of the target node, and perform variable embedding on the traffic flow sequences of the target node and the auxiliary nodes respectively, to extract global features of the target node and the auxiliary nodes. The module is configured to process differences between the target node and the auxiliary nodes, embed local and global information of the target node and global information of the auxiliary nodes into a model, to enhance spatiotemporal features.

[0127] The time correlation modeling module 204 is configured to fuse the local features and the global features of the target node by using a time attention mechanism, to obtain multi-scale features of the target node. The module is configured to extract time correlation of the target node, to improve processing accuracy of time features.

[0128] The spatial dependency modeling module 205 is configured to fuse the multi-scale features of the target node and the global features of the auxiliary nodes by using a spatial interaction attention mechanism, to obtain fused features. The module is configured to fuse global information of the auxiliary nodes and information of the target node, to capture interaction between the two, and to enhance prediction performance of long-time traffic flow.

[0129] The prediction output layer module 206 is configured to predict traffic flow of the target node at a next time based on the fused features.

[0130] Through coordinated operation of the above modules, accurate prediction of traffic flow data is achieved, which is applicable to fields such as city planning, traffic management and public security.

[0131] It should be noted that each of the above modules can be a functional module or a program module, which can be implemented by software or hardware. For the modules implemented by hardware, each of the above modules can be located in the same processor; or each of the above modules can also be located in different processors in any combination.

[0132] In addition, the traffic flow prediction method based on auxiliary node enhanced spatiotemporal perception described above can be implemented by a computer device. Figure 1 The hardware structure of the computer device of the embodiment of the present application is shown in FIG. 3. As shown in the figure, the device can include a processor 301 and a memory 302 storing computer program instructions. Figure 6 Figure 6

[0133] ​​In particular, the processor 301 can include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to perform one or more of the embodiments of the application.

[0134] The memory 302 can include a mass storage for data or instructions. By way of example, and without limitation, the memory 302 can include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), a flash memory, a compact disc read only memory (CD-ROM), a digital versatile disc read only memory (DVD-ROM), a magnetic tape, or a Universal Serial Bus (USB) drive or a combination of two or more of these. The memory 302 can be removable and / or non-removable (or fixed) as appropriate. The memory 302 can be internal or external as appropriate. In a particular embodiment, the memory 302 is a non-volatile memory. In a particular embodiment, the memory 302 includes a Read-Only Memory (ROM) and a Random-Access Memory (RAM). The ROM can be a mask-programmed ROM, a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), an Electrically Alterable ROM (EAROM), or a FLASH memory, or a combination of two or more of these, as appropriate. The RAM can be a Static Random-Access Memory (SRAM) or a Dynamic Random-Access Memory (DRAM), which can be a Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), an Extended Data Output Dynamic Random-Access Memory (EDODRAM), a Synchronous Dynamic Random-Access Memory (SDRAM), or the like, as appropriate.

[0135] The memory 302 can be used to store or buffer various data files required for processing and / or communication, and possible computer program instructions executed by the processor 301.

[0136] The processor 301 reads and executes the computer program instructions stored in the memory 302 to implement any one of the above-mentioned embodiments of the traffic flow prediction method based on auxiliary node enhanced spatio-temporal perception.

[0137] In some embodiments, the point cloud generation device can further include a communication interface 303 and a bus 300. As shown in the figure, the processor 301, the memory 302, and the communication interface 303 are connected through the bus 300 and complete communication with each other. Figure 6

[0138] The communication interface 303 is used to realize the communication between various modules, devices, units and / or equipment in the embodiments of the present application. The communication interface 303 can also realize data communication with other components, such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations, etc.

[0139] ​Bus 300 includes hardware, software, or both, to couple components of the point cloud generation device to each other in the manner described. While bus 300 is illustrated as a single bus, bus 300 can include one or more buses functioning as described and / or one or more other types of interconnections. Bus 300 includes, but is not limited to, at least one of a data bus, an address bus, a control bus, an expansion bus, a local bus, and the like. By way of example and not limitation, bus 300 can include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or another suitable bus or combination of two or more of these. Where appropriate, bus 300 can include one or more buses. Although a particular bus is described and illustrated, this application contemplates any suitable bus or interconnect.

[0140] The computer device can execute the traffic flow prediction method based on auxiliary node enhanced spatiotemporal perception in the embodiments of the application according to the traffic flow sequence data of each node, so as to realize the traffic flow prediction method based on auxiliary node enhanced spatiotemporal perception described in combination with Figure 1 The traffic flow prediction method based on auxiliary node enhanced spatiotemporal perception is described.

[0141] In addition, in combination with the traffic flow prediction method based on auxiliary node enhanced spatiotemporal perception in the above embodiments, an embodiment of the present application can provide a computer readable storage medium for implementation. The computer readable storage medium has computer program instructions stored thereon; the computer program instructions are executed by a processor to implement any one of the traffic flow prediction methods based on auxiliary node enhanced spatiotemporal perception in the above embodiments.

[0142] It should be noted that any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the description. In addition, according to the needs of implementation, each step / component described in the present application can be split into more steps / components, or two or more steps / components or part of the operation of the steps / components can be combined into a new step / component, so as to achieve the purpose of the present application.

[0143] Those skilled in the art can easily understand that the above embodiments only express several embodiments of the present application, and the description is more specific and detailed, but it cannot be understood as a limitation on the scope of the patent. It should be noted that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of the present application. Therefore, the scope of protection of the patent of the present application should be subject to the appended claims.

Claims

1. A traffic flow prediction method based on auxiliary node enhanced spatio-temporal awareness, characterized in that, The method includes: S101. Obtain the location of each node and the traffic flow sequence; S102. Select target nodes, calculate the distance between the target node and other nodes based on the position of each node, and select several nodes whose distance is less than a preset distance threshold or the first few nodes with the smallest distance as auxiliary nodes. S103. Embed the traffic flow sequence of the target node point-by-point to extract the local features of the target node; including: A method combining point-by-point encoding and global encoding is proposed to perform global encoding on the traffic flow sequence of auxiliary nodes and to sample the traffic flow sequence of target nodes. Point-by-point encoding is used to extract local features of the traffic flow sequence, while global encoding provides spatiotemporal information of target nodes and auxiliary nodes to enhance the perception of traffic flow changes. Pointwise embedding: local feature extraction is performed on the traffic flow sequence of the target node, that is, the traffic flow sequence of the target node is embedded as a feature vector Pointwise operation is performed for embedding to extract the fine-grained expression of the historical traffic flow information of the target node, and the calculation formula is as follows: in, The target node The feature vector of the traffic flow sequence after point-by-point encoding. The target node exist Traffic flow data at any time The amount of data representing the traffic flow sequence of the target node; Let represent a matrix with t time steps and D features; This represents a point-by-point encoding function; Variable embedding: Global feature extraction is performed on the traffic flow sequences of both the target node and auxiliary nodes. The traffic flow sequence is embedded as a whole variable token. By globally representing and processing it, the dynamic changes in traffic flow can be better reflected, improving the model's ability to capture data. The global encoding is represented by the following formula: in, For the traffic flow sequence of the target node, It is the first corresponding to the target node Traffic flow sequence of auxiliary nodes It is the feature vector after both have been globally encoded, containing global information about historical traffic flow; Represent a The feature matrix, where D is the feature dimension; This is a global encoding function; S104. Variable embedding is performed on the traffic flow sequences of the target node and the auxiliary node respectively to extract the global features of the target node and the auxiliary node. S105. The local and global features of the target node are fused using the temporal attention mechanism to obtain the multi-scale features of the target node, and the multi-scale features of the target node and the global features of the auxiliary node are fused using the spatial interaction attention mechanism to obtain the fused features. S106. Predict the traffic flow of the target node at the next time step based on the fusion features.

2. The traffic flow prediction method based on auxiliary node-enhanced spatiotemporal perception according to claim 1, characterized in that, Step S101 also includes: The traffic flow sequence data for each node is normalized using the following formula: in, Normalized value For raw traffic flow data, The maximum value in the original traffic flow data. This is the minimum value in the original traffic flow data.

3. The traffic flow prediction method based on auxiliary node-enhanced spatiotemporal perception according to claim 1, characterized in that, Step S104 includes: The temporal attention mechanism is used to extract the relevance of target nodes in the time dimension, that is, to combine the local and global coding information of target nodes to extract multi-scale features and effectively capture the temporal dynamic changes of traffic flow. From the input sequence Generate queries using different linear mappings ,key Sum The time attention mechanism is used to calculate the correlation of time series within the target node: Among them, the feature matrix of the target node In the model number In this layer, the result is obtained by fusing the point-by-point encoded information of the target node with the global encoded information and then passing it through a fully connected layer. This is the weight matrix of the fully connected layer. Represents deviation, It is the feature dimension; It is the model number The output of the layer-time attention mechanism, i.e., multi-scale features; express function.

4. The traffic flow prediction method based on auxiliary node-enhanced spatiotemporal perception according to claim 3, characterized in that, Step S105 includes: A spatial interactive attention mechanism is introduced to integrate the spatiotemporal information of target nodes and auxiliary nodes; based on the cross-attention mechanism, information between different sequences is associated to improve the spatial modeling accuracy of traffic flow prediction. The multi-scale features of the target node and the globally encoded feature vectors of the auxiliary nodes are used as input to extract the spatial correlation between the nodes. By assigning different weights, the information is effectively fused. The specific formula is as follows: Among them, the feature matrix of the target node In the model number In this layer, the information is obtained by fusing the target node and auxiliary node information and then passing it through a fully connected layer. This is the weight matrix of the fully connected layer. Represents deviation, It is the feature dimension; It is the model number The output of the layer-space interactive attention mechanism, i.e., the fused features; express function.

5. The traffic flow prediction method based on auxiliary node-enhanced spatiotemporal perception according to claim 1, characterized in that, Step S106 includes: The fused features are sequentially input into the feedforward layer, projection layer, and linear layer, and inference is performed from the feature representation to generate the traffic flow of the target node at the next time step.

6. The traffic flow prediction method based on auxiliary node-enhanced spatiotemporal perception according to claim 5, characterized in that, The loss function adopts The loss function is expressed in the following formula: in, The predicted value of the model. For the true value, It is a hyperparameter. It is the model loss; The traffic flow prediction model is set with 3 layers, a batch size of 32 for each layer, a hidden layer dimension of 64, 8 attention heads, and a feedforward layer dimension of 256.

7. A traffic flow prediction system based on auxiliary node enhanced spatiotemporal perception for implementing the traffic flow prediction method based on auxiliary node enhanced spatiotemporal perception as described in any one of claims 1 to 6, characterized in that, The system includes: The data acquisition module is used to acquire the location of each node and the traffic flow sequence; The auxiliary node selection module is used to select target nodes, calculate the distance between the target node and other nodes based on the position of each node, and select several nodes whose distance is less than a preset distance threshold or the first few nodes with the smallest distance as auxiliary nodes. The node embedding module is used to embed the traffic flow sequence of the target node point by point, extract the local features of the target node, and embed variables into the traffic flow sequences of the target node and auxiliary nodes respectively, extracting the global features of the target node and auxiliary nodes. The temporal correlation modeling module is used to fuse the local and global features of the target node using a temporal attention mechanism to obtain the multi-scale features of the target node. The spatial dependency modeling module is used to fuse the multi-scale features of the target node and the global features of the auxiliary node using a spatial interaction attention mechanism to obtain fused features; The prediction output layer module is used to predict the traffic flow of the target node at the next time step based on the fused features.

8. An electronic device, characterized in that, include: The processor and memory, wherein the memory stores a program or instructions that can run on the processor, and when the program or instructions are executed by the processor, implement the steps of the traffic flow prediction method based on auxiliary node-enhanced spatiotemporal perception as described in any one of claims 1 to 6.

9. A readable storage medium, characterized in that, It stores programs or instructions, which, when executed by a processor, implement the steps of the traffic flow prediction method based on auxiliary node-enhanced spatiotemporal perception as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Route recommendation model training method and device, equipment and medium

    CN111782974A

  • Graph clustering method and device based on self-supervised graph neural network, and storage medium

    CN113221950A