A method and apparatus for traffic prediction based on bidirectional spatiotemporal attention and multi-cycle fusion
Patent Information
- Application Number
- CN202610688637.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-19
- Publication Date
- 2026-09-22
AI Technical Summary
传统统计模型依赖平稳线性假设,难以拟合复杂波动;机器学习模型对长期时序依赖与基站间空间拓扑建模不足
[0027]第五方面,提供了一种计算机程序产品,所述计算机程序产品存储有指令,所述指令在由计算机执行时使得所述计算机实施第一方面或第二方面所述的方法。
Smart Images

Figure CN122802928A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a traffic prediction method and apparatus based on bidirectional spatiotemporal attention and multi-cycle fusion. Background Technology
[0002] With the large-scale deployment of 5G and IoT, network traffic exhibits strong nonlinearity, non-stationarity, and highly dynamic spatiotemporal correlation characteristics. Traditional statistical models rely on stationary linear assumptions, making it difficult to fit complex fluctuations; machine learning models are insufficient in modeling long-term temporal dependencies and spatial topology between base stations. Although existing graph neural network spatiotemporal models explicitly model spatial dependencies, they still suffer from key shortcomings such as missing bidirectional temporal extraction, rigid attention mechanisms, reliance on manual architecture design, and a lack of interpretability in prediction results.
[0003] Therefore, how to provide a high-precision, adaptive, and interpretable 5G traffic prediction method is a technical problem that urgently needs to be solved. Summary of the Invention
[0004] This invention provides a traffic prediction method and apparatus based on bidirectional spatiotemporal attention and multi-cycle fusion, which can provide a high-precision, adaptive and interpretable 5G traffic prediction method.
[0005] Firstly, a traffic prediction method based on bidirectional spatiotemporal attention and multi-period fusion is provided, comprising: acquiring traffic data from multiple detection points within a target area; obtaining traffic data subsequences of detection points at different time scales based on the traffic data; obtaining traffic spatiotemporal feature representation vectors of the target area at different time scales using a bidirectional spatiotemporal prediction unit based on the traffic data subsequences and spatial topology map; wherein, the spatial topology map represents the spatial correlation between detection points, the traffic spatiotemporal feature representation vectors represent the traffic feature information of all detection points at a time scale, and the bidirectional spatiotemporal prediction unit is used to extract spatial topological dependence and bidirectional temporal context features from the traffic subsequences at a single time scale, and dynamically enhance them through a dual attention mechanism to generate the spatiotemporal feature representation vector corresponding to that time scale; fusing the traffic spatiotemporal feature representation vectors of detection points at different time scales across time scales to generate a high-order spatiotemporal representation vector, wherein the high-order spatiotemporal representation vector represents the traffic latent feature map after time scale fusion; and determining the traffic prediction result of the target area at the target time based on the high-order spatiotemporal representation vector.
[0006] In this way, by combining bidirectional temporal modeling and graph convolutional spatial aggregation with adaptive fusion of features at multiple time scales, the accuracy and robustness of traffic prediction are improved; the introduction of neural architecture search enables automatic optimization of model structure, reducing manual design costs and enhancing scenario adaptability; the interpretability design based on spatial influence coefficients supports the tracing of traffic peak causes and the identification of key nodes; and the prediction results and influence analysis work together to support proactive deployment of network operation and maintenance.
[0007] In one possible implementation, based on traffic data, subsequences of traffic data for each detection point at different time scales are obtained, including: Based on traffic data, obtain the first timescale subsequence closest to the predicted target time, the second timescale subsequence of the day before that is in the same time period as the predicted target time, and the third timescale subsequence of the week before that is in the same time period as the predicted target time.
[0008] In this way, by dividing the data into three categories of subsequences—recent, daily, and weekly—the model captures the changing patterns of traffic at different time granularities, such as short-term bursts, diurnal repetitions, and weekly cycles, thus achieving coordinated coverage of multi-scale time series features. When the pattern of a single cycle is disturbed, the other scales can still provide effective references, enhancing the robustness of the model in irregular scenarios. At the same time, all subsequences are extracted from the same original sequence with a fixed offset, resulting in simple data organization and ease of implementation.
[0009] In one possible implementation, based on the traffic data subsequences and spatial topology map, a bidirectional spatiotemporal prediction unit is used to obtain the spatiotemporal feature representation vectors of traffic in the target area at different time scales, including: The first time-scale subsequence and the spatial topology map are respectively input into the first bidirectional spatiotemporal prediction unit to obtain the first spatiotemporal feature representation vector; The second time-scale subsequence and the spatial topology map are respectively input into the second bidirectional spatiotemporal prediction unit to obtain the second spatiotemporal feature representation vector; The third time-scale subsequence and the spatial topology map are respectively input into the third bidirectional spatiotemporal prediction unit to obtain the third spatiotemporal feature representation vector.
[0010] In this way, subsequences at different time scales are input into independent branches for processing, allowing each branch to focus on feature learning at its corresponding scale and avoiding cross-scale information interference; the identical structure facilitates implementation and expansion, and parallel execution can improve computational efficiency; independent outputs provide a flexible foundation for subsequent adaptive fusion.
[0011] In one possible implementation, the bidirectional spatiotemporal prediction unit includes a graph convolutional network, a temporal feature extraction network, and an attention enhancement network; Based on the traffic data subsequences and spatial topology map, using a bidirectional spatiotemporal prediction unit, the spatiotemporal feature representation vectors of traffic in the target area at different time scales are obtained, including: The spatial topology graph is input into the graph convolutional network to obtain spatial topology dependency information, which includes feature information of detection points as nodes and neighboring nodes between each detection point. For the traffic data subsequence, a time feature extraction network is used to process it in both forward and backward directions, generating forward hidden state sequences and backward hidden state sequences respectively. The forward hidden state sequences and backward hidden state sequences at the corresponding time are then concatenated to obtain a hidden vector representation containing bidirectional contextual information. By using the spatial attention mechanism in the attention-enhanced network, the spatial attention weight matrix is obtained by learning the correlation information between different spatial nodes based on spatial topological dependency information. The temporal attention weight matrix is obtained by learning the correlation weight between latent vector representations based on the temporal attention mechanism in the attention-enhanced network. Based on the spatial attention matrix and the temporal attention matrix, the spatiotemporal feature representation vector of the flow is obtained.
[0012] In this way, through joint modeling of graph convolutional networks and bidirectional temporal networks, spatial dependencies and bidirectional contextual information between detection points are extracted simultaneously; spatial attention and temporal attention mechanisms are used to enhance the contributions of key regional nodes and key historical moments, respectively; finally, a spatiotemporal feature representation vector of traffic that integrates spatial topology, temporal context and attention enhancement is generated, providing high-quality feature input for multi-scale fusion.
[0013] In one possible implementation, the spatiotemporal feature representation vectors of traffic flow at different time scales of the detection points are fused across time scales to generate a higher-order spatiotemporal representation vector, including: A weighted fusion layer is adopted, which sums the spatiotemporal feature representation vectors of traffic at the corresponding time scales according to the weight matrix corresponding to each time scale, to obtain the high-order spatiotemporal representation vector.
[0014] In one possible implementation, the traffic prediction results for the target area within the prediction time period are determined based on the high-order spatiotemporal representation vector, including: The high-order spatiotemporal representation vector is input into the fully connected layer and mapped to the target output dimension through linear transformation to predict the traffic forecast results of the target area within a time period.
[0015] In this way, the fully connected layer completes the mapping from features to predicted values through linear transformation, which is simple in structure and has low computational cost; it can be seamlessly embedded into the end-to-end training process to ensure smooth gradient backpropagation and joint optimization; and it constrains the model capacity in the output stage based on deep features, which helps to suppress overfitting and improve generalization stability.
[0016] In one possible implementation, prior to utilizing the bidirectional spatiotemporal prediction unit, the following is also included: The internal structural configuration of the bidirectional spatiotemporal prediction unit is determined through neural architecture search; Neural architecture search is performed in a predefined operation search space, which includes various attention mechanism types, various graph convolution operator types, and various pooling strategy types. Sample candidate structure combinations from the operation search space, select the structure configuration that enables the bidirectional spatiotemporal prediction unit to achieve optimal performance, and use the structure configuration with optimal performance to instantiate the bidirectional spatiotemporal prediction unit.
[0017] In this way, by automatically searching for the optimal combination of attention mechanism, graph convolution operator and pooling strategy in the preset operation space, the cost of structural design is reduced, replacing manual experience selection; the searched configuration has a higher degree of matching with the current data distribution, enhancing the model's generalization ability in multiple scenarios; global joint search helps to discover efficient structural combinations and achieve end-to-end optimization.
[0018] Secondly, a traffic prediction device based on bidirectional spatiotemporal attention and multi-cycle fusion is provided, comprising: The first processing module is used to acquire traffic data from multiple detection points within the target area, and based on the traffic data, to obtain traffic data subsequences of the detection points at different time scales; The second processing module is used to obtain the spatiotemporal feature representation vector of the target area at different time scales based on the traffic data subsequence and spatial topology map using a bidirectional spatiotemporal prediction unit. The spatial topology map represents the spatial relationship between detection points, and the traffic spatiotemporal feature representation vector represents the traffic feature information of all detection points at a time scale. The bidirectional spatiotemporal prediction unit is used to extract spatial topological dependence and bidirectional temporal context features from the traffic subsequence at a single time scale, and dynamically enhance them through a dual attention mechanism to generate the spatiotemporal feature representation vector corresponding to that time scale. The third processing module is used to fuse the spatiotemporal feature representation vectors of the flow at different time scales of the detection points across time scales to generate a high-order spatiotemporal representation vector, wherein the high-order time representation vector represents the latent feature map of the flow after time scale fusion. The fourth processing module is used to determine the traffic prediction result of the target area at the target time based on the high-order spatiotemporal representation vector.
[0019] In one possible implementation, the first processing module is used to obtain, based on traffic data, a first timescale subsequence closest to the target time of prediction, a second timescale subsequence of the previous day that is in the same time period as the target time of prediction, and a third timescale subsequence of the previous week that is in the same time period as the target time of prediction.
[0020] In one possible implementation, the second processing module is used to input the first time-scale subsequence and the spatial topology map into the first bidirectional spatiotemporal prediction unit to obtain the first spatiotemporal feature representation vector. The second time-scale subsequence and the spatial topology map are respectively input into the second bidirectional spatiotemporal prediction unit to obtain the second spatiotemporal feature representation vector; The third time-scale subsequence and the spatial topology map are respectively input into the third bidirectional spatiotemporal prediction unit to obtain the third spatiotemporal feature representation vector.
[0021] In one possible implementation, the bidirectional spatiotemporal prediction unit includes a graph convolutional network, a temporal feature extraction network, and an attention enhancement network; The second processing module is used to input the spatial topology graph into the graph convolutional network to obtain spatial topology dependency information, which includes feature information of detection points as nodes and neighboring nodes between each detection point. For the traffic data subsequence, a time feature extraction network is used to process it in both forward and backward directions, generating forward hidden state sequences and backward hidden state sequences respectively. The forward hidden state and backward hidden state at the corresponding time are then concatenated to obtain a hidden vector representation containing bidirectional contextual information. By using the spatial attention mechanism in the attention-enhanced network, the spatial attention weight matrix is obtained by learning the correlation information between different spatial nodes based on spatial topological dependency information. The temporal attention weight matrix is obtained by learning the correlation weight between latent vector representations based on the temporal attention mechanism in the attention-enhanced network. Based on the spatial attention matrix and the temporal attention matrix, the spatiotemporal feature representation vector of the flow is obtained.
[0022] In one possible implementation, the third processing module is used to employ a weighted fusion layer to perform a weighted summation of the spatiotemporal feature representation vectors of the traffic flow at each time scale based on the weight matrix corresponding to each time scale, thereby obtaining a higher-order spatiotemporal representation vector.
[0023] In one possible implementation, the fourth processing module is used to input the high-order spatiotemporal representation vector into the fully connected layer, and map it to the target output dimension through a linear transformation to predict the traffic prediction results of the target region within the time period.
[0024] In one possible implementation, the second processing module is used to determine the internal structural configuration of the bidirectional spatiotemporal prediction unit through neural architecture search; Neural architecture search is performed in a predefined operation search space, which includes various attention mechanism types, various graph convolution operator types, and various pooling strategy types. Sample candidate structure combinations from the operation search space, select the structure configuration that enables the bidirectional spatiotemporal prediction unit to achieve optimal performance, and use the structure configuration with optimal performance to instantiate the bidirectional spatiotemporal prediction unit.
[0025] Thirdly, an electronic device is provided, comprising: one or more processors; one or more memories; and one or more programs, wherein the one or more programs are stored in the one or more memories, and the one or more programs include instructions that, when executed by the one or more processors, cause the configured device to perform the method as described in the first aspect.
[0026] Fourthly, a computer storage medium is provided, the computer storage medium storing instructions that, when executed by a computer, cause the computer to perform the method described in the first aspect or the second aspect.
[0027] Fifthly, a computer program product is provided, the computer program product storing instructions that, when executed by a computer, cause the computer to perform the method described in the first aspect or the second aspect.
[0028] The beneficial effects of the second to fifth aspects can be referred to the introduction of the beneficial effects of the first aspect above, and will not be repeated here. Attached Figure Description
[0029] Figure 1 This is a flowchart illustrating the traffic prediction method based on bidirectional spatiotemporal attention and multi-cycle fusion provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of the Bi-LSTM structure provided in an embodiment of the present invention; Figure 3 A schematic diagram of the FTatt all-around time attention mechanism provided in this embodiment of the invention; Figure 4 This is a schematic diagram of the overall framework of the spatial graph convolutional network Bi-ASTGCN with attention mechanism provided in the embodiments of the present invention; Figure 5 This is a schematic diagram of the search space of the spatial attention network model provided in the embodiments of the present invention; Figure 6 This is a schematic diagram of the TS-NAS model architecture provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of different street influence matrices provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of a three-dimensional visualization rendering of the predicted traffic demand provided by an embodiment of the present invention; Figure 9This is another flowchart illustrating a traffic prediction method based on bidirectional spatiotemporal attention and multi-period fusion, as shown in an embodiment of the present invention. Figure 10 This is a schematic diagram of a flow prediction device 1010 based on bidirectional spatiotemporal attention and multi-cycle fusion, which can be used to implement the method of the present invention; Figure 11 This is a schematic diagram of an electronic device provided by the present invention. Detailed Implementation
[0030] The solutions provided by the embodiments of the present invention will now be described with reference to the accompanying drawings. In the embodiments of the present invention, "multiple" refers to two or more objects, and "various kinds" refers to two or more types. Terms such as "first," "second," etc., are only used to distinguish similar objects and are not necessarily used to describe a specific order or number of objects.
[0031] First, the relevant technical terms involved in the technical solution provided by this invention will be introduced.
[0032] With the large-scale deployment of fifth-generation mobile communication technology (5G) and the Internet of Things (IoT), mobile network traffic data exhibits significant nonlinear, non-stationary, and highly dynamic spatiotemporal correlation characteristics. Traditional traffic forecasting methods face severe challenges in processing such complex data, specifically in the following aspects: Early widely adopted statistical models, such as the Autoregressive Moving Average (ARIMA) and Vector Autoregressive (VAR) models, typically relied on assumptions of data stationarity and linear relationships. However, traffic distribution in 5G scenarios is highly susceptible to sudden changes in user behavior, unexpected business activity, and mobility, exhibiting strong non-stationar and non-linear fluctuations. This makes it difficult for the aforementioned statistical models to effectively fit the actual data distribution, resulting in significant bottlenecks in prediction accuracy.
[0033] To address nonlinear problems, classic machine learning algorithms such as Support Vector Machine (SVM) and Limit Gradient Boosting have been introduced. While these models possess a certain ability to map nonlinear data, they have inherent limitations when processing communication traffic data: on the one hand, their ability to capture the long-term temporal dependencies implicit in sequential data is limited; on the other hand, they lack explicit modeling mechanisms for the complex topological structures (i.e., spatial dependencies) between spatial entities such as base stations and detection points, making it difficult to effectively utilize the mutual influence between regions to improve prediction accuracy.
[0034] The emergence of recurrent neural network variants such as Long Short-Term Memory (LSTM) networks and Gated Recurrent Units (GRUs) has significantly improved the ability to capture time dependencies in time series forecasting. However, these models still have two limitations: First, standard recurrent networks typically employ a unidirectional time series processing mechanism, which can only infer the future based on past information, ignoring the potential contribution of future context information to the inference of the current state (i.e., the lack of bidirectional context information); second, the model's processing objects are limited to single time series or isolated nodes, completely ignoring the spatial correlation dimension between base stations based on physical distance, signal coverage, or logical routing connections.
[0035] To compensate for the lack of spatial modeling capabilities, current research trends are shifting towards using graph neural networks (GNNs) to construct spatiotemporal prediction models. These methods abstract base stations or monitoring nodes in the network as vertices of a graph, constructing adjacency matrices through physical or logical connections, thereby achieving explicit embedding and learning of spatial dependencies. Typical models such as Diffused Convolutional Recurrent Neural Networks (DCRNNs) and Spatiotemporal Graph Convolutional Networks (STGCNs) have made some progress in prediction performance, but the following key technical problems still urgently need to be solved in practical applications.
[0036] Existing architectures mostly continue with unidirectional RNNs or ordinary temporal convolutions, failing to construct effective bidirectional temporal feature extraction pathways. This results in insufficient utilization of global temporal context information, limiting further improvements in prediction accuracy. While some models introduce attention mechanisms to enhance the extraction weights of key features, their computational forms are mostly limited to fixed additive or dot-product attention patterns. Faced with diverse network topologies and traffic patterns, a single attention paradigm cannot guarantee that it is the optimal feature aggregation strategy in all dataset scenarios.
[0037] Existing spatiotemporal prediction model architectures heavily rely on human expert experience for design and optimization, lacking mechanisms to automatically search for optimal combinations of spatiotemporal features for different data distribution characteristics or specific prediction tasks. Faced with diverse urban scenarios or business characteristics, the generalization ability and deployment efficiency of fixed architectures are limited.
[0038] Current graph neural network prediction models generally exhibit "black box" characteristics, lacking transparent mapping logic between model weights and network topology, as well as the causes of traffic peaks. Operations personnel cannot clearly trace why the model predicts high or low traffic values for specific areas, which constitutes a significant application obstacle in network operations and resource scheduling scenarios that rely on trust in decision-making.
[0039] To address the problems in existing technologies, this application provides a bidirectional spatiotemporal graph neural network traffic prediction method based on neural architecture search, which solves the shortcomings of existing 5G traffic prediction technologies, such as insufficient spatiotemporal feature extraction, rigid model structure, and weak interpretability. The technical solution is described in detail below with specific steps and network structure.
[0040] Figure 1 This is a flowchart illustrating a traffic prediction method based on bidirectional spatiotemporal attention and multi-cycle fusion, as shown in an embodiment of the present invention. Figure 1 As shown, it includes the following steps: In S1, traffic data is collected and preprocessed.
[0041] Multiple traffic monitoring points and corresponding communication equipment are deployed within a designated geographical area to continuously collect network traffic time-series data over several days.
[0042] For example, traffic records from 40 monitoring points and 348 devices over 59 consecutive days were collected as the raw dataset. For missing values and outliers identified during the data collection process, linear interpolation was used to repair the data, ensuring the integrity and continuity of the input data.
[0043] In S2, construct the spatial topology graph structure.
[0044] Each detection point is abstracted as a node in a graph structure. An adjacency matrix is constructed based on the geographical proximity or communication association strength between nodes, forming a spatial topology graph for graph neural network computation. This graph structure explicitly defines the spatial dependencies of traffic between regions, providing a foundation for subsequent spatial feature extraction.
[0045] In S3, multi-cycle time components are divided.
[0046] The network traffic time-series data is divided into three independent input components along the time axis: a recent component, which selects data from the time period closest to the target prediction time; a daily component, which selects data from the day before the target prediction time; and a weekly component, which selects data from the week before the target prediction time.
[0047] In S4, multi-period features are processed in parallel.
[0048] The input components, including recent-term components, daily-cycle components, and weekly-cycle components, are input into three parallel processing branches with identical structures but whose parameters can be shared or independent. The core computational unit of each branch is a bidirectional spatiotemporal prediction unit, Bi-STBlock, used to independently extract the spatiotemporal feature representation of the corresponding periodic sequence.
[0049] Specifically, the internal structure of the Bi-ST Block, a bidirectional spatiotemporal prediction unit, includes a graph convolutional network (GCN). For the adjacency matrix, the GCN aggregates the feature information of each node and its neighboring nodes to extract the spatial topological dependencies between detection points.
[0050] The Bi-ST Block, a bidirectional spatiotemporal prediction unit, also includes a bidirectional long short-term memory network (Bi-LSTM). For the input time series, the forward LSTM layer processes the sequence from front to back, generating a forward hidden state sequence; the backward LSTM layer processes the sequence from back to front, generating a backward hidden state sequence. Finally, the forward and backward hidden state sequences at corresponding times are concatenated to obtain a hidden vector representation containing complete contextual information. This design enables the model to utilize both past and future temporal information simultaneously, enhancing its ability to model long-term dependencies.
[0051] Below is the computational formula for the Bidirectional Long Short-Term Memory (Bi-LSTM) network: In the above formula, These are three tensors, representing the update gate, forget gate, and output gate. It is a memory vector. This is a graph convolution operation.
[0052] Figure 2 This is a schematic diagram of the Bi-LSTM structure. Figure 2 In this method, X0, X1, and X2 are used as sequential time series data. The forward LSTM-L is then input into X0, X1, and X2 respectively to generate three vectors. The backward LSTM-R is fed with X0, X1, and X2 respectively to produce three vectors. Finally, the forward and backward implicit vectors are concatenated to obtain... It contains both forward and backward information.
[0053] The Bi-ST Block, a bidirectional spatiotemporal prediction unit, also includes two complementary attention mechanisms to dynamically enhance the representation of key features. The first is Spatial Attention, which learns the correlation strength between different spatial nodes, enabling the model to automatically focus on regional nodes that are more critical to the current prediction. The second is Fully Temporal Attention, which calculates the correlation weights between historical time slices, achieving dynamic attention allocation along the temporal dimension.
[0054] The Fully Temporal Attention (FTAT) mechanism. The calculation method for the temporal attention mechanism is as follows: Among them, matrix elements in The value represents the node i and j The strength of the interdependence, where U is the learned parameter. For the matrix... Normalization is performed to obtain the temporal attention matrix. .
[0055] Figure 3 This is a structural diagram of the FTatt mechanism, a comprehensive time-attention mechanism. Figure 3 As shown, in the omnidirectional temporal attention mechanism, the correlation matrix formula for predicting the r-1 time slice sequence is as follows: Spatial attention learns the spatial correlation strength between different nodes. Full-time attention calculates the correlation between historical time slices, enabling dynamic temporal weight allocation.
[0056] Furthermore, when multiple Bi-ST Blocks are stacked, residual connections can be introduced between modules to alleviate the vanishing gradient problem in deep network training and preserve the effective information in the original input.
[0057] Figure 4 This is a schematic diagram of the overall framework of the Bi-ASTGCN spatial graph convolutional network with an attention mechanism. (See diagram for example.) Figure 4 As shown, the spatial graph convolutional network with attention mechanism consists of three spatial model Bi-ST blocks with the same structure. Each spatial model contains a spatial attention mechanism and a spatial convolutional network. Each independent component outputs the corresponding prediction value through four spatiotemporal modules.
[0058] The three date sequences extracted along the time axis are used as the recent-term component, daily-period component, and weekly-period component in the model. , and It serves as the input to the spatial graph convolutional network Bi-ASTGCN, which has an attention mechanism.
[0059] The Bi-ST Block output of each parallel branch is the spatiotemporal feature representation vector or feature matrix of the corresponding periodic component. Each output retains the spatiotemporal dependencies and attention enhancement information extracted within the corresponding period, and its dimension is consistent with the prediction target.
[0060] In S5, multi-period prediction results are fused.
[0061] The three spatiotemporal feature representation vectors output in parallel from the above steps are integrated through a learnable weighted fusion layer. The fusion process uses the following formula: The output results of the three components and By combining the parameter matrices and fusing the results, the final prediction result is obtained. .
[0062] in, It is the Hadamard product, which represents the element-wise multiplication of matrices. , , It should be consistent with the dimension of the prediction target.
[0063] Its components have the same learnable weight matrix with identical feature dimensions, which can be automatically adjusted during training to optimize the fusion effect.
[0064] This fusion mechanism enables the model to adaptively weigh the contribution of different time-period patterns to the final prediction. For example, in irregular scenarios such as holidays, the model can automatically increase the weight of the periodic component; while in sudden traffic events, the weight of the recent component will be strengthened.
[0065] It outputs a unified high-order spatiotemporal representation vector or matrix that integrates three types of time-scale information: recent mutations, daily repetition, and weekly inertia, while maintaining the original node dimension and the prediction target dimension, which will serve as the direct input for subsequent prediction layers.
[0066] Furthermore, before step S4, when using the bidirectional spatiotemporal prediction unit Bi-ST Block, the structure of the bidirectional spatiotemporal prediction unit can also be determined through the neural architecture search mechanism TS-NAS.
[0067] Figure 5 This is a schematic diagram of the search space of a spatial attention network model. For example... Figure 5 As shown, , , , , , Different spatial attention types are represented by the search controller through the initialized vector and neural architecture. The generated sequence information is used to predict the type of spatial attention mechanism that needs to be used. This represents the characteristic features of information transmission.
[0068] Attention in the search space can be defined as follows: , ,in, Dot product attention model.
[0069] Scaling dot product attention model This indicates that a fixed value is typically required. In search models, it is used as a learning parameter. d .
[0070] It is a bilinear attention model, and also a learnable weight matrix. .
[0071] It is an additive model, where, It is a key-value pair attention mechanism model.
[0072] ,Right now Through and Obtained.
[0073] In summary, the TS-NAS model architecture is described as follows: Figure 6 As shown, the model's data is represented as By calculating the relationships between them, the graph structure can be represented as A. Then, the graph features and X are input into the convolutional space, which is similar to the attention search space. A suitable convolutional module is selected using a neural network search mechanism, with the selection criterion being to optimize the prediction model. Next, the output of the convolutional space is input into the pooling search space. The pooling module can be... , , or The TS-NAS model uses a neural network search mechanism to select appropriate temporal convolutional modules, with the selection criterion being to achieve the optimal prediction model. Then, it uses fully connected layers and softmax operations to obtain the prediction results.
[0074] A diverse search space for spatial and temporal attention is constructed, including various attention variants such as dot product, scaled dot product, bilinear, addition, and key-value pairs. A Neural Architecture Search (NAS) controller is introduced to automatically select the optimal combination of attention mechanisms and convolutional modules, while simultaneously searching for pooling strategies (such as average pooling and max pooling) to achieve end-to-end model structure optimization.
[0075] In S6, the predicted future traffic values are output.
[0076] The high-order spatiotemporal representation vector generated in step S5 is input into the fully connected layer and mapped to the target output dimension through linear transformation. Finally, the network traffic prediction value of each detection point in the future specified time period is obtained, forming a prediction result matrix.
[0077] Figure 7 This is a schematic diagram of different street influence matrices provided in an embodiment of the present invention, such as... Figure 7 As shown, within the study area, the selected detection points are the most influential, meaning that changes in the traffic flow at a given node directly affect the traffic flow changes at surrounding nodes in the next moment. By observing the traffic conditions at these influential detection points, and providing artificial intervention for future changes in the affected detection points, this approach offers valuable scientific reference for traffic management.
[0078] For example, if checkpoint A is a point with significant influence in the area, and 5G traffic is high and traffic congestion is severe at point A at the current moment, some vehicles that come to acquire customers can wait around several checkpoints with strong relevance. This can reduce congestion, accurately meet the needs of acquiring customers, and avoid the bad cycle of wasting time and passenger resources by customers canceling their wait due to excessively long waiting times caused by congestion.
[0079] Specifically, based on the model's internal parameters, such as the influence matrix formula, any node is quantified. i Historical traffic to other nodes j The impact strength of future forecasts is used to generate a spatial influence matrix. High-influence nodes are then selected for hotspot identification and resource early warning.
[0080] The spatial influence coefficient of a detection point studies the magnitude of its impact on the future 5G traffic trends of surrounding nodes. A larger influence matrix coefficient indicates a greater influence of that point on its surrounding nodes. The influence matrix coefficient is calculated, and the 5G traffic of detection points with higher coefficients is prioritized. If the 5G traffic at a point increases, resource adjustments can be made in advance to ensure emergency preparedness.
[0081] In practical applications, traffic data from 40 5G traffic monitoring points and a total of 348 data acquisition devices over 59 consecutive days were used as the experimental data source. During data preprocessing, linear interpolation was used to impute missing and outlier values, and the dataset was divided into a training set (60%), a validation set (20%), and a test set (20%) in chronological order. The Adam optimizer was used for model training with a learning rate of 0.0001, and the computing platform was a GTX 1080Ti graphics processor. The model's input was a multi-period historical traffic sequence, and the output was the predicted 5G traffic for each monitoring point within the next hour.
[0082] To visually demonstrate the predictive performance of the proposed graph neural network model for 5G traffic, such as... Figure 8 A 3D model of the predicted 5G traffic demand at the detection points was created. The specific method is as follows: The study area was discretized into N×N grid cells, where grid cells containing roads were assigned a value of 1, and non-road grid cells were assigned a value of 0. Based on this, the 5G traffic demand values identified at each detection point replaced the original base value of 1 in the road grid. The predicted traffic demand was then visualized and rendered in 3D to obtain... Figure 8 This diagram visually presents the spatial distribution of 5G traffic, providing a visual basis for network planning and resource scheduling decisions.
[0083] Through the above steps, the spatial modeling capability of graph convolutional networks, the temporal context capture capability of bidirectional LSTM, and the feature enhancement capability of dual attention mechanism are effectively integrated. Furthermore, through multi-cycle parallel processing and adaptive fusion strategies, the accuracy and generalization performance of network traffic prediction are significantly improved.
[0084] Figure 9 This is another flowchart illustrating a traffic prediction method based on bidirectional spatiotemporal attention and multi-cycle fusion, as shown in an embodiment of the present invention. Figure 9 As shown, it includes the following steps: In step 910, traffic flow data of multiple detection points within the target area are acquired, and based on the traffic flow data, traffic flow data subsequences of the detection points at different time scales are obtained.
[0085] In some embodiments, based on traffic data, traffic data subsequences of detection points at different time scales are obtained, including: Based on traffic data, obtain the first timescale subsequence closest to the predicted target time, the second timescale subsequence of the day before that is in the same time period as the predicted target time, and the third timescale subsequence of the week before that is in the same time period as the predicted target time.
[0086] By dividing the data into three subsequences—recent, daily, and weekly—the model captures the changing patterns of traffic at different time granularities, such as short-term bursts, diurnal repetitions, and weekly cycles, thus achieving coordinated coverage of multi-scale time-series features. When the pattern of a single cycle is disturbed, the other scales can still provide effective references, enhancing the robustness of the model in irregular scenarios. At the same time, all subsequences are extracted from the same original sequence with a fixed offset, resulting in concise data organization and ease of implementation.
[0087] In step 920, based on the traffic data subsequence and spatial topology map, a bidirectional spatiotemporal prediction unit is used to obtain the traffic spatiotemporal feature representation vector of the target area at different time scales.
[0088] The spatial topology graph represents the spatial relationships between detection points. The flow spatiotemporal feature representation vector represents the flow characteristic information of all detection points at a given time scale.
[0089] The bidirectional spatiotemporal prediction unit is used to extract spatial topological dependence and bidirectional temporal context features from a single time scale flow subsequence, and dynamically enhances them through a dual attention mechanism to generate the spatiotemporal feature representation vector corresponding to that time scale.
[0090] In some embodiments, step 920 includes the following steps: The first time-scale subsequence and the spatial topology map are respectively input into the first bidirectional spatiotemporal prediction unit to obtain the first spatiotemporal feature representation vector; The second time-scale subsequence and the spatial topology map are respectively input into the second bidirectional spatiotemporal prediction unit to obtain the second spatiotemporal feature representation vector; The third time-scale subsequence and the spatial topology map are respectively input into the third bidirectional spatiotemporal prediction unit to obtain the third spatiotemporal feature representation vector.
[0091] In this way, subsequences at different time scales are input into independent branches for processing, allowing each branch to focus on feature learning at its corresponding scale and avoiding cross-scale information interference; the identical structure facilitates implementation and expansion, and parallel execution can improve computational efficiency; independent outputs provide a flexible foundation for subsequent adaptive fusion.
[0092] In some embodiments, the bidirectional spatiotemporal prediction unit includes a graph convolutional network, a temporal feature extraction network, and an attention enhancement network. A first spatiotemporal feature representation vector, a second spatiotemporal feature representation vector, and a third spatiotemporal feature representation vector can be input into the bidirectional spatiotemporal prediction unit, respectively. The following description uses one of these inputs as an example and includes the following steps: The spatial topology graph is input into the graph convolutional network to obtain spatial topology dependency information, which includes feature information of detection points as nodes and neighboring nodes between detection points.
[0093] For the traffic data subsequence, a time feature extraction network is used to process it in both forward and backward directions, generating forward hidden state sequences and backward hidden state sequences respectively. The forward hidden state sequences and backward hidden state sequences at the corresponding time are then concatenated to obtain a hidden vector representation containing bidirectional contextual information.
[0094] By using the spatial attention mechanism in the attention-enhanced network, the spatial attention weight matrix is obtained by learning the correlation information between different spatial nodes based on spatial topological dependency information. The temporal attention weight matrix is obtained by learning the correlation weight between latent vector representations based on the temporal attention mechanism in the attention-enhanced network.
[0095] Based on the spatial attention matrix and the temporal attention matrix, the spatiotemporal feature representation vector of the flow is obtained.
[0096] In this way, through joint modeling of graph convolutional networks and bidirectional temporal networks, spatial dependencies and bidirectional contextual information between detection points are extracted simultaneously; spatial attention and temporal attention mechanisms are used to enhance the contributions of key regional nodes and key historical moments, respectively; finally, a spatiotemporal feature representation vector of traffic that integrates spatial topology, temporal context and attention enhancement is generated, providing high-quality feature input for multi-scale fusion.
[0097] It should be noted that, in some embodiments, the following is included before utilizing the bidirectional spatiotemporal prediction unit: The internal structural configuration of the bidirectional spatiotemporal prediction unit is determined through neural architecture search.
[0098] The neural architecture search is performed in a predefined operation search space, which includes various attention mechanism types, various graph convolution operator types, and various pooling strategy types.
[0099] Sample candidate structure combinations from the operation search space, select the structure configuration that enables the bidirectional spatiotemporal prediction unit to achieve optimal performance, and use the structure configuration with optimal performance to instantiate the bidirectional spatiotemporal prediction unit.
[0100] In this way, by automatically searching for the optimal combination of attention mechanism, graph convolution operator and pooling strategy in the preset operation space, the cost of structural design is reduced, replacing manual experience selection; the searched configuration has a higher degree of matching with the current data distribution, enhancing the model's generalization ability in multiple scenarios; global joint search helps to discover efficient structural combinations and achieve end-to-end optimization.
[0101] In step 930, the spatiotemporal feature representation vectors of the flow at different time scales of the detection points are fused across time scales to generate a high-order spatiotemporal representation vector.
[0102] Among them, the higher-order time representation vector represents the traffic latent feature map after time-scale fusion.
[0103] In some embodiments, a weighted fusion layer can be used to sum the spatiotemporal feature representation vectors of traffic at the corresponding time scales according to the weight matrix corresponding to each time scale, so as to obtain a higher-order spatiotemporal representation vector.
[0104] In step 940, the flow prediction result of the target area at the target time is determined based on the higher-order spatiotemporal representation vector.
[0105] Specifically, the high-order spatiotemporal representation vector is input into the fully connected layer and mapped to the target output dimension through linear transformation to predict the traffic forecast results of the target region within a time period.
[0106] In this way, the fully connected layer completes the mapping from features to predicted values through linear transformation, which is simple in structure and has low computational cost; it can be seamlessly embedded into the end-to-end training process to ensure smooth gradient backpropagation and joint optimization; and it constrains the model capacity in the output stage based on deep features, which helps to suppress overfitting and improve generalization stability.
[0107] In summary, based on the above embodiments, by automatically searching for the optimal combination of attention mechanism, graph convolution operator and pooling strategy in the preset operation space, the manual experience selection is replaced, reducing the cost of structural design; the searched configuration has a higher matching degree with the current data distribution, enhancing the model's generalization ability in multiple scenarios; global joint search helps to discover efficient structural combinations and achieve end-to-end optimization.
[0108] Next, based on the methods in the above embodiments, a traffic prediction device based on bidirectional spatiotemporal attention and multi-cycle fusion provided by the present invention will be introduced.
[0109] Figure 10 This is a schematic diagram of a flow prediction device 1010 based on bidirectional spatiotemporal attention and multi-period fusion, which can be used to implement the method of the present invention. (See attached diagram) Figure 10 As shown, the traffic prediction device 1010 based on bidirectional spatiotemporal attention and multi-cycle fusion includes multiple processing modules.
[0110] The first processing module is used to acquire traffic data from multiple detection points within the target area, and based on the traffic data, to obtain traffic data subsequences of the detection points at different time scales.
[0111] The second processing module is used to obtain the spatiotemporal feature representation vector of the target area at different time scales based on the traffic data subsequence and spatial topology map using a bidirectional spatiotemporal prediction unit. The spatial topology map represents the spatial correlation between detection points, and the traffic spatiotemporal feature representation vector represents the traffic feature information of all detection points at a time scale. The bidirectional spatiotemporal prediction unit is used to extract spatial topological dependence and bidirectional temporal context features from the traffic subsequence at a single time scale, and dynamically enhance them through a dual attention mechanism to generate the spatiotemporal feature representation vector corresponding to that time scale.
[0112] The third processing module is used to fuse the spatiotemporal feature representation vectors of the flow at different time scales of the detection points across time scales to generate a high-order spatiotemporal representation vector, wherein the high-order time representation vector represents the latent feature map of the flow after time scale fusion.
[0113] The fourth processing module is used to determine the traffic prediction result of the target area at the target time based on the high-order spatiotemporal representation vector.
[0114] In some embodiments, the first processing module is used to obtain, based on traffic data, a first timescale subsequence closest to the predicted target time, a second timescale subsequence of the previous day that is in the same time period as the predicted target time, and a third timescale subsequence of the previous week that is in the same time period as the predicted target time.
[0115] In one possible implementation, the second processing module is used to input the first time-scale subsequence and the spatial topology map into the first bidirectional spatiotemporal prediction unit to obtain the first spatiotemporal feature representation vector.
[0116] The second time-scale subsequence and the spatial topology map are respectively input into the second bidirectional spatiotemporal prediction unit to obtain the second spatiotemporal feature representation vector.
[0117] The third time-scale subsequence and the spatial topology map are respectively input into the third bidirectional spatiotemporal prediction unit to obtain the third spatiotemporal feature representation vector.
[0118] In one possible implementation, the bidirectional spatiotemporal prediction unit includes a graph convolutional network, a temporal feature extraction network, and an attention enhancement network.
[0119] The second processing module is used to input the spatial topology graph into the graph convolutional network to obtain spatial topology dependency information, which includes feature information of detection points as nodes and neighboring nodes between detection points.
[0120] For the traffic data subsequence, a time feature extraction network is used to process it in both forward and backward directions, generating forward hidden state sequences and backward hidden state sequences respectively. The forward hidden state and backward hidden state at the corresponding time are then concatenated to obtain a hidden vector representation containing bidirectional contextual information.
[0121] By using the spatial attention mechanism in the attention-enhanced network, the spatial attention weight matrix is obtained by learning the correlation information between different spatial nodes based on spatial topological dependency information. The temporal attention weight matrix is obtained by learning the correlation weight between latent vector representations based on the temporal attention mechanism in the attention-enhanced network.
[0122] Based on the spatial attention matrix and the temporal attention matrix, the spatiotemporal feature representation vector of the flow is obtained.
[0123] In one possible implementation, the third processing module is used to employ a weighted fusion layer to perform a weighted summation of the spatiotemporal feature representation vectors of the traffic flow at each time scale based on the weight matrix corresponding to each time scale, thereby obtaining a higher-order spatiotemporal representation vector.
[0124] In one possible implementation, the fourth processing module is used to input the high-order spatiotemporal representation vector into the fully connected layer, and map it to the target output dimension through a linear transformation to predict the traffic prediction results of the target region within the time period.
[0125] In one possible implementation, the second processing module is used to determine the internal structural configuration of the bidirectional spatiotemporal prediction unit through neural architecture search.
[0126] The neural architecture search is performed in a predefined operation search space, which includes various attention mechanism types, various graph convolution operator types, and various pooling strategy types.
[0127] Sample candidate structure combinations from the operation search space, select the structure configuration that enables the bidirectional spatiotemporal prediction unit to achieve optimal performance, and use the structure configuration with optimal performance to instantiate the bidirectional spatiotemporal prediction unit.
[0128] Those skilled in the art will readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, the present invention can be implemented in hardware or a combination of hardware and computer software. Whether a function is implemented in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the present invention.
[0129] It should be noted that, Figure 10 The division of modules / units is illustrative and represents only one logical functional division; in actual implementation, other division methods are possible. For example, two or more functions can be integrated into a single data acquisition module. The integrated modules described above can be implemented either in hardware or as software functional modules.
[0130] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-mentioned methods for topology discovery of optical switches in an optoelectronic converged network. That is, an electronic device according to an embodiment of the present invention may include, but is not limited to: a processor and a memory; the memory is used to store the computer program; the processor is used to execute a traffic prediction method based on bidirectional spatiotemporal attention and multi-cycle fusion as shown in any embodiment of the present invention by calling the computer program.
[0131] In one alternative embodiment, an electronic device is provided, such as Figure 11 As shown, Figure 11The illustrated electronic device 1100 includes a processor 1101 and a memory 1103. The processor 1101 and the memory 1103 are connected, for example, via a bus 1102. Optionally, the electronic device 1100 may further include a transceiver 1104, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 1104 is not limited to one type, and the structure of the electronic device 1100 does not constitute a limitation on the embodiments of the present invention.
[0132] Processor 1101 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this invention. Processor 1101 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0133] Bus 1102 may include a path for transmitting information between the aforementioned components. Bus 1102 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 1102 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 11 The bus 1102 is represented by only one thick line, but this does not mean that there is only one bus or one type of bus.
[0134] The memory 1103 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0135] The memory 1103 is used to store application code (computer program) for executing the present invention, and its execution is controlled by the processor 1101. The processor 1101 is used to execute the application code stored in the memory 1103 to implement the content shown in the foregoing method embodiments.
[0136] Among them, electronic devices can also be terminal devices, which can be any device that can install applications, including at least one of smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, smart TVs, and smart in-vehicle devices.
[0137] It should be noted that, Figure 11 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0138] An embodiment of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-mentioned traffic prediction methods based on bidirectional spatiotemporal attention and multi-period fusion.
[0139] Alternatively, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, a floppy disk, and an optical data storage device, etc.
[0140] In an exemplary embodiment, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the aforementioned traffic prediction method based on bidirectional spatiotemporal attention and multi-period fusion.
[0141] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0142] It should be understood that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0143] The computer-readable storage medium provided in this invention can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EEPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0144] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform a traffic prediction method based on bidirectional spatiotemporal attention and multi-period fusion as shown in the above embodiments.
[0145] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.
[0146] It should be noted that the terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and represent a limitation on a specific order or sequence. Where appropriate, the order of use for similar objects can be interchanged so that the embodiments of the invention described herein can be implemented in an order other than that shown or described.
[0147] Those skilled in the art will recognize that this invention can be implemented as a system, method, or computer program product. Therefore, this invention can be specifically implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, this invention can also be implemented as a computer program product contained in one or more computer-readable media, which includes computer-readable program code.
[0148] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A traffic prediction method based on bidirectional spatiotemporal attention and multi-cycle fusion, characterized in that, Includes the following steps: Acquire traffic data from multiple detection points within the target area, and based on the traffic data, obtain traffic data subsequences of the detection points at different time scales; Based on the traffic data subsequence and spatial topology map, a bidirectional spatiotemporal prediction unit is used to obtain the traffic spatiotemporal feature representation vector of the target area at different time scales. The spatial topology map represents the spatial correlation between the detection points, and the traffic spatiotemporal feature representation vector represents the traffic feature information of all detection points at a time scale. The bidirectional spatiotemporal prediction unit is used to extract spatial topological dependence and bidirectional temporal context features from the traffic subsequence at a single time scale, and dynamically enhances them through a dual attention mechanism to generate the spatiotemporal feature representation vector corresponding to that time scale. The flow spatiotemporal feature representation vectors of the detection points at different time scales are fused across time scales to generate a high-order spatiotemporal representation vector, wherein the high-order time representation vector represents the latent feature map of the flow after time scale fusion. Based on the higher-order spatiotemporal representation vector, the predicted flow rate of the target region at the predicted target time is determined.
2. The method according to claim 1, characterized in that, The step of obtaining subsequences of traffic data at different time scales for the detection point based on the traffic data includes: Based on the traffic data, a first timescale subsequence closest to the predicted target time, a second timescale subsequence of the previous day that is in the same time period as the predicted target time, and a third timescale subsequence of the previous week that is in the same time period as the predicted target time are obtained.
3. The method according to claim 2, characterized in that, The step of obtaining the spatiotemporal feature representation vector of the target region's traffic flow at different time scales using a bidirectional spatiotemporal prediction unit based on the traffic flow data subsequence and spatial topology map includes: The first time-scale subsequence and the spatial topology map are respectively input into the first bidirectional spatiotemporal prediction unit to obtain the first spatiotemporal feature representation vector; The second timescale subsequence and the spatial topology map are respectively input into the second bidirectional spatiotemporal prediction unit to obtain the second spatiotemporal feature representation vector; The third time-scale subsequence and the spatial topology map are respectively input into the third bidirectional spatiotemporal prediction unit to obtain the third spatiotemporal feature representation vector.
4. The method according to claim 1, characterized in that, The bidirectional spatiotemporal prediction unit includes a graph convolutional network, a temporal feature extraction network, and an attention enhancement network; The step of obtaining the spatiotemporal feature representation vector of the target region's traffic flow at different time scales using a bidirectional spatiotemporal prediction unit based on the traffic flow data subsequence and spatial topology map includes: The spatial topology graph is input into the graph convolutional network to obtain spatial topology dependency information, which includes feature information of the detection points as nodes and the neighboring nodes between each detection point. For the traffic data subsequence, the time feature extraction network is used to process it from both forward and backward directions to generate forward hidden state sequences and backward hidden state sequences respectively. The forward hidden state sequences and backward hidden state sequences at the corresponding time are then concatenated to obtain a hidden vector representation containing bidirectional context information. By using the spatial attention mechanism in the attention enhancement network, the spatial topological dependency information is used to learn the correlation information between different spatial nodes to obtain the spatial attention weight matrix. By using the temporal attention mechanism in the attention enhancement network, the correlation weight between the latent vector representations is learned to obtain the temporal attention weight matrix. The spatiotemporal feature representation vector of the flow is obtained based on the spatial attention matrix and the temporal attention matrix.
5. The method according to claim 1, characterized in that, The spatiotemporal feature representation vectors of the flow at different time scales of the detection points are fused across time scales to generate a high-order spatiotemporal representation vector, including: A weighted fusion layer is used to sum the spatiotemporal feature representation vectors of traffic flow at the corresponding time scales according to the weight matrices corresponding to each time scale, so as to obtain the higher-order spatiotemporal representation vector.
6. The method according to claim 1, characterized in that, The step of determining the traffic prediction result for the target area within the prediction time period based on the higher-order spatiotemporal representation vector includes: The high-order spatiotemporal representation vector is input into the fully connected layer and mapped to the target output dimension through linear transformation to predict the traffic forecast result of the target region within the time period.
7. The method according to claim 1, characterized in that, Prior to utilizing the bidirectional spatiotemporal prediction unit, the method further includes: The internal structural configuration of the bidirectional spatiotemporal prediction unit is determined through neural architecture search; The neural architecture search is performed in a predefined operation search space, which includes various attention mechanism types, various graph convolution operator types, and various pooling strategy types. Candidate structure combinations are sampled from the operation search space, and a structure configuration that enables the bidirectional spatiotemporal prediction unit to achieve optimal performance is selected. The structure configuration with optimal performance is then used to instantiate the bidirectional spatiotemporal prediction unit.
8. A flow prediction device based on bidirectional spatiotemporal attention and multi-cycle fusion, characterized in that, include: The first processing module is used to acquire traffic data from multiple detection points within the target area, and based on the traffic data, to obtain traffic data subsequences of the detection points at different time scales; The second processing module is used to obtain the spatiotemporal feature representation vector of the target area at different time scales based on the traffic data subsequence and spatial topology map using a bidirectional spatiotemporal prediction unit. The spatial topology map represents the spatial correlation between the detection points, and the spatiotemporal feature representation vector represents the traffic feature information of all detection points at a given time scale. The bidirectional spatiotemporal prediction unit is used to simultaneously extract spatial topological dependence and bidirectional temporal context features from the traffic subsequence at a single time scale, and dynamically enhances these features through a dual attention mechanism to generate the spatiotemporal feature representation vector corresponding to that time scale. The third processing module is used to fuse the traffic spatiotemporal feature representation vectors of the detection points at different time scales across time scales to generate a high-order spatiotemporal representation vector, wherein the high-order time representation vector represents the traffic latent feature map after time scale fusion. The fourth processing module is used to determine the traffic prediction result of the target area at the target time based on the higher-order spatiotemporal representation vector.
9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the traffic prediction method based on bidirectional spatiotemporal attention and multi-cycle fusion as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to enable the computer to implement the traffic prediction method based on bidirectional spatiotemporal attention and multi-period fusion as described in any one of claims 1 to 7.