Traffic flow prediction method based on abnormal graph structure and space-time cycle coupling and related device

The traffic flow prediction method that couples anomaly graph structures with spatiotemporal cycles utilizes L-layer spatiotemporal coding blocks and graph convolution modules to dynamically generate convolution kernel parameters. This solves the problem of insufficient adaptability to periodic changes in traditional traffic flow prediction methods and improves prediction accuracy and adaptability.

CN121999604APending Publication Date: 2026-05-08FOSHAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FOSHAN UNIVERSITY
Filing Date
2025-12-02
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods rely on fixed convolutional structures, which are difficult to dynamically adapt to periodic changes. This results in an inability to accurately capture the differences in features under different modes or states, leading to insufficient prediction accuracy.

Method used

A traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling is adopted. By using an L-layer spatiotemporal coding block and graph convolution module, combined with a phase adaptive hypernetwork structure, convolution kernel parameters are dynamically generated to capture the periodic features of traffic flow. Spatiotemporal features are extracted and predicted through dynamic adjacency matrix and graph convolution module.

Benefits of technology

It improves the accuracy and adaptability of traffic flow forecasting, better captures changes in traffic patterns under different cycles, and enhances the model's adaptability and prediction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121999604A_ABST
    Figure CN121999604A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of traffic flow prediction, in particular to a traffic flow prediction method based on an abnormal graph structure and space-time cycle coupling and a related device. The method comprises the following steps: performing feature embedding processing on original traffic flow data through the data embedding layer to obtain an embedded feature vector; inputting the original traffic flow data and the embedded feature vector into a first-layer space-time coding block of the encoder to obtain a space-time feature vector of the first-layer space-time coding block; performing feature extraction operation on the space-time coding blocks except the first layer of space-time coding block in sequence until the Lth layer of space-time coding block outputs a global space-time feature vector; and outputting the high-dimensional output vector to the decoder, and outputting a prediction result for representing a future traffic flow through the decoder, so that the traffic flow prediction accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of traffic flow prediction technology, and in particular to a traffic flow prediction method and related apparatus based on anomaly graph structure and spatiotemporal cyclic coupling. Background Technology

[0002] Currently, existing traffic flow prediction methods rely on fixed convolutional structures. However, traditional fixed convolutional kernels struggle to adapt to the cyclical changes in traffic flow, resulting in a lack of dynamic adaptation. Traditional convolutional structures extract features from all time periods using static parameters, making it difficult for the model to accurately capture the differences in patterns or states, such as weekday peak hours, off-peak hours, and holiday traffic. Therefore, traditional traffic flow prediction methods suffer from insufficient prediction accuracy. Summary of the Invention

[0003] To address at least one of the aforementioned problems, embodiments of this application provide a traffic flow prediction method and related apparatus based on anomaly graph structure and spatiotemporal cyclic coupling, which can improve the accuracy of traffic flow prediction.

[0004] According to one aspect of the embodiments of this application, a traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling is proposed and applied to a traffic flow prediction model. The traffic flow prediction model includes a data embedding layer, an encoder, and a decoder. The encoder consists of L layers of spatiotemporal coding blocks, and the spatiotemporal coding blocks include a first phase adaptive hypernetwork structure, a graph convolution module, and a second phase adaptive hypernetwork structure. The method includes: The original traffic flow data is processed by feature embedding through the data embedding layer to obtain embedded feature vectors; The original traffic flow data and the embedded feature vector are input into the first layer spatiotemporal coding block of the encoder to obtain the spatiotemporal feature vector of the first layer spatiotemporal coding block; The spatiotemporal coding blocks, except for the first layer spatiotemporal coding block, perform feature extraction operations sequentially until the Lth layer spatiotemporal coding block outputs the global spatiotemporal feature vector; The high-dimensional output vector is output to the decoder, and the decoder outputs the prediction results used to characterize future traffic flow. The spatiotemporal feature vector of the first-layer spatiotemporal coding block is obtained through the following steps: The embedded feature vector is input into the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block to obtain the time feature output by the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block. The time features and the original traffic flow data are input into the graph convolution module to obtain spatial dimension features with positive time feedback output by the graph convolution module of the first layer; The spatial dimension features with positive temporal feedback output by the graph convolution module of the first layer are input into the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block to obtain the spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block. The spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block is then input into the first phase adaptive supernetwork structure of the next layer spatiotemporal coding block. The feature extraction operation includes the following steps: For any spatiotemporal coding block that is not the first layer spatiotemporal coding block, the spatiotemporal feature vector output by the previous layer spatiotemporal coding block is received, and the spatiotemporal feature vector output by the previous layer spatiotemporal coding block is input into the first phase adaptive supernetwork structure of the current layer spatiotemporal coding block to obtain the time feature output by the first phase adaptive supernetwork structure of the current layer spatiotemporal coding block. The temporal features output by the first phase adaptive hypernetwork structure of the current layer spatiotemporal coding block and the original traffic flow data are input into the graph convolution module of the current layer spatiotemporal coding block to obtain the spatial dimension features with positive temporal feedback output by the graph convolution module of the current layer spatiotemporal coding block. The spatial dimension features with temporal positive feedback output by the graph convolution module of the current spatiotemporal coding block are input into the second phase adaptive supernetwork structure of the current spatiotemporal coding block to obtain the spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the current spatiotemporal coding block. The spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the current spatiotemporal coding block is then input into the first phase adaptive supernetwork structure of the next layer spatiotemporal coding block of the current spatiotemporal encoder.

[0005] In the above scheme, the embedded feature vector is input into the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block to obtain the temporal features output by the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block, including: Determine the phase label information of the embedded feature vector; An embedding representation vector is generated based on the embedded feature vector and the phase label information; Dynamic convolution is performed on the embedded representation vector to obtain intermediate features; Gated activation is performed based on the intermediate features to obtain the gated activation feature sequence; The gated feature sequence is averaged and pooled to obtain the temporal features output by the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block.

[0006] In the above scheme, the temporal features and the original traffic flow data are input into the graph convolution module to obtain spatial dimension features with positive temporal feedback output by the graph convolution module of the first layer, including: Construct a differential map signal corresponding to the original traffic flow data to detect abnormal moments where anomalies exist; Multiple anomaly graph structures are obtained based on the detected anomaly moments; The dynamic adjacency fusion matrix is ​​obtained based on each of the aforementioned anomaly graph structures; The dynamic adjacency fusion matrix is ​​normalized to obtain a normalized adjacency matrix; Spatial dimension features with positive temporal feedback are generated based on the normalized adjacency matrix and the temporal features.

[0007] In the above scheme, each of the aforementioned anomaly graph structures corresponds to a single adjacency matrix, and the step of obtaining a dynamic adjacency fusion matrix based on each of the aforementioned anomaly graph structures includes: The adjacency matrices corresponding to each of the aforementioned abnormal graph structures are weighted and fused to obtain the dynamic adjacency fusion matrix.

[0008] In the above scheme, generating spatial dimension features with positive temporal feedback based on the normalized adjacency matrix and the temporal features includes: The spatial dimension feature with positive temporal feedback is obtained by activating the weights of the graph convolution module, the normalized adjacency matrix, and the temporal features using a preset nonlinear ReLU activation function.

[0009] According to one aspect of the embodiments of this application, a traffic flow prediction device based on anomaly graph structure and spatiotemporal cyclic coupling is proposed and applied to a traffic flow prediction model. The traffic flow prediction model includes a data embedding layer, an encoder, and a decoder. The encoder consists of L layers of spatiotemporal coding blocks, and the spatiotemporal coding blocks include a first phase adaptive hypernetwork structure, a graph convolution module, and a second phase adaptive hypernetwork structure. The device includes: The first processing unit is used to perform feature embedding processing on the original traffic flow data through the data embedding layer to obtain an embedded feature vector. The first output unit is used to input the original traffic flow data and the embedded feature vector into the first layer spatiotemporal coding block of the encoder to obtain the spatiotemporal feature vector of the first layer spatiotemporal coding block; The second output unit is used to sequentially perform feature extraction operations on the spatiotemporal coding blocks other than the first layer spatiotemporal coding block until the Lth layer spatiotemporal coding block outputs the global spatiotemporal feature vector. The prediction unit is used to output the high-dimensional output vector to the decoder, and the decoder outputs the prediction result to characterize the future traffic flow. The spatiotemporal feature vector of the first-layer spatiotemporal coding block is obtained through the following steps: The embedded feature vector is input into the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block to obtain the time feature output by the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block. The time features and the original traffic flow data are input into the graph convolution module to obtain spatial dimension features with positive time feedback output by the graph convolution module of the first layer; The spatial dimension features with positive temporal feedback output by the graph convolution module of the first layer are input into the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block to obtain the spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block. The spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block is then input into the first phase adaptive supernetwork structure of the next layer spatiotemporal coding block. The feature extraction operation includes the following steps: For any spatiotemporal coding block that is not the first layer spatiotemporal coding block, the spatiotemporal feature vector output by the previous layer spatiotemporal coding block is received, and the spatiotemporal feature vector output by the previous layer spatiotemporal coding block is input into the first phase adaptive supernetwork structure of the current layer spatiotemporal coding block to obtain the time feature output by the first phase adaptive supernetwork structure of the current layer spatiotemporal coding block. The temporal features output by the first phase adaptive hypernetwork structure of the current layer spatiotemporal coding block and the original traffic flow data are input into the graph convolution module of the current layer spatiotemporal coding block to obtain the spatial dimension features with positive temporal feedback output by the graph convolution module of the current layer spatiotemporal coding block. The spatial dimension features with temporal positive feedback output by the graph convolution module of the current spatiotemporal coding block are input into the second phase adaptive supernetwork structure of the current spatiotemporal coding block to obtain the spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the current spatiotemporal coding block. The spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the current spatiotemporal coding block is then input into the first phase adaptive supernetwork structure of the next layer spatiotemporal coding block of the current spatiotemporal encoder.

[0010] According to one aspect of the embodiments of this application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling as described above. According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including a computer program, the computer program being read and executed by a processor of an electronic device, causing the electronic device to perform the traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling as described above.

[0011] The beneficial effects of this application are as follows: The traffic flow prediction model of this application includes a data embedding layer, an encoder, and a decoder. The encoder consists of L layers of spatiotemporal coding blocks, which include a first phase adaptive hypernetwork structure, a graph convolution module, and a second phase adaptive hypernetwork structure. This application outputs a global spatiotemporal feature vector with a high-dimensional representation through spatiotemporal cyclic learning within the encoder, which is then fed into the decoder for prediction, resulting in high accuracy of the prediction results.

[0012] Specifically, the spatiotemporal cyclic learning within the encoder involves the interaction of spatiotemporal feature vectors between L-layer spatiotemporal coding blocks. The first-layer spatiotemporal coding block obtains its spatiotemporal feature vector using the original traffic flow data and the embedded feature vector. The spatiotemporal feature vector output by the first-layer spatiotemporal coding block is then input into the first phase adaptive supernetwork structure of the second-layer spatiotemporal coding block for feature extraction, enabling the second-layer spatiotemporal coding block to output its own spatiotemporal feature vector. The spatiotemporal feature vector output by the second-layer spatiotemporal coding block is then fed into the first phase adaptive supernetwork structure of the third-layer spatiotemporal coding block, and so on, until the second phase adaptive supernetwork structure of the L-th layer spatiotemporal coding block outputs the final global spatiotemporal feature vector. This completes the spatiotemporal cyclic coupling, and the resulting global spatiotemporal feature vector has good feature representation capabilities. The graph convolution module processes the original traffic flow data and the temporal features output by the first phase adaptive hypernetwork structure to obtain spatial dimension features with positive temporal feedback, thereby completing the time-space interaction. Furthermore, the spatial dimension features with positive temporal feedback are fed back into the second phase adaptive hypernetwork structure, enabling the second phase adaptive hypernetwork structure to complete the time-space-time cyclic coupling. Therefore, the features output by the second phase adaptive hypernetwork structure have good spatiotemporal feature expression capabilities. These features are then fed into the first phase adaptive hypernetwork structure of the next layer spatiotemporal coding block, so that the final L-th layer spatiotemporal coding block outputs a global spatiotemporal feature vector with good expressive capabilities, thereby improving the accuracy of traffic flow prediction results. Attached Figure Description

[0013] Figure 1 This is a system architecture diagram of the traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling provided in the embodiments of this application. Figure 2 A flowchart illustrating the traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling provided in this application embodiment; Figure 3 A logical schematic diagram of the traffic flow prediction model provided in the embodiments of this application; Figure 4 A schematic diagram of the embedded features provided in the embodiments of this application; Figure 5 A block diagram of a traffic flow prediction device based on anomaly graph structure and spatiotemporal cyclic coupling provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation

[0014] To enable those skilled in the art to better understand the solutions of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0015] It should be noted that while some processes described in the specification, claims, and accompanying drawings include multiple steps appearing in a specific order, it should be clearly understood that these steps may not be performed in the order they appear herein, or may be performed in parallel. The step numbers are merely used to distinguish different steps and do not themselves represent any execution order. Furthermore, descriptions such as "first," "second," or "objective" in this document are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. "Multiple" in this document refers to at least two.

[0016] It is worth noting that, in the specific embodiments of this application, raw traffic flow data, embedded feature vectors, spatiotemporal feature vectors, and other related data are involved. When the above embodiments of this application are applied to specific products or technologies, permission or consent from the target object is required, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards. For example, when an embodiment of this application needs to obtain raw traffic flow data, embedded feature vectors, spatiotemporal feature vectors, and other related data, separate permission or consent from the target object can be obtained through pop-up windows or redirection to a confirmation page. After obtaining the separate permission or consent from the target object, the necessary raw traffic flow data, embedded feature vectors, spatiotemporal feature vectors, and other related data for enabling the embodiments of this application to operate normally can then be obtained.

[0017] Please see Figure 1 , Figure 1 This is a system architecture diagram of the traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling provided in this application embodiment. It includes a terminal 140, an Internet connection 130, a gateway 120, a server 110, etc.

[0018] Terminal 140 can take various forms, including desktop computers, laptops, PDAs (personal digital assistants), mobile phones, vehicle terminals, and dedicated terminals. Furthermore, it can be a single device or a collection of multiple devices. For example, multiple desktop computers can be interconnected via a local area network, sharing a single monitor to work collaboratively, forming a single terminal 140. Terminal 140 can communicate with the Internet 130 via wired or wireless means to exchange data.

[0019] Server 110 refers to a computer system capable of providing certain services to terminal 140. Compared to ordinary terminal 140, server 110 has higher requirements in terms of stability, security, and performance. Server 110 can be a single high-performance computer in a network platform, a cluster of multiple high-performance computers, a portion of a single high-performance computer (e.g., a virtual machine), or a combination of portions of multiple high-performance computers (e.g., virtual machines). Server 110 can also communicate with the Internet 130 via wired or wireless means to exchange data.

[0020] Gateway 120, also known as an internetwork connector or protocol converter, is a computer system or device that acts as a translator, enabling network interconnection at the transport layer. It bridges the gap between two systems using different communication protocols, data formats, languages, or even completely different architectures. Gateways can also provide filtering and security functions. Messages sent from terminal 140 to server 110 are forwarded to the corresponding server 110 via gateway 120. Messages sent from server 110 to terminal 140 are also forwarded to the corresponding terminal 140 via gateway 120.

[0021] The following provides a detailed description of the specific implementation methods of the embodiments of this application: Please see Figure 2 , Figure 2 This is a flowchart illustrating the traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling provided in this application embodiment. The traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling can be implemented by server 110 and / or terminal 140. Figure 2 The traffic flow prediction method shown includes: Step 210: Perform feature embedding processing on the original traffic flow data through the data embedding layer to obtain the embedded feature vector; Step 220: Input the original traffic flow data and the embedded feature vector into the first layer spatiotemporal coding block of the encoder to obtain the spatiotemporal feature vector of the first layer spatiotemporal coding block; Step 230: The spatiotemporal coding blocks other than the first layer spatiotemporal coding block perform feature extraction operations sequentially until the Lth layer spatiotemporal coding block outputs the global spatiotemporal feature vector; Step 240: Output the high-dimensional output vector to the decoder, and output the prediction results used to characterize future traffic flow through the decoder.

[0022] The spatiotemporal feature vector of the first-layer spatiotemporal coding block is obtained through the following steps: The embedded feature vector is input into the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block to obtain the time feature output by the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block. The time features and the original traffic flow data are input into the graph convolution module to obtain spatial dimension features with positive time feedback output by the graph convolution module of the first layer; The spatial dimension features with positive temporal feedback output by the graph convolution module of the first layer are input into the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block to obtain the spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block. The spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block is then input into the first phase adaptive supernetwork structure of the next layer spatiotemporal coding block. The feature extraction operation includes the following steps: For any spatiotemporal coding block that is not the first layer spatiotemporal coding block, the spatiotemporal feature vector output by the previous layer spatiotemporal coding block is received, and the spatiotemporal feature vector output by the previous layer spatiotemporal coding block is input into the first phase adaptive supernetwork structure of the current layer spatiotemporal coding block to obtain the time feature output by the first phase adaptive supernetwork structure of the current layer spatiotemporal coding block. The temporal features output by the first phase adaptive hypernetwork structure of the current layer spatiotemporal coding block and the original traffic flow data are input into the graph convolution module of the current layer spatiotemporal coding block to obtain the spatial dimension features with positive temporal feedback output by the graph convolution module of the current layer spatiotemporal coding block. The spatial dimension features with temporal positive feedback output by the graph convolution module of the current spatiotemporal coding block are input into the second phase adaptive supernetwork structure of the current spatiotemporal coding block to obtain the spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the current spatiotemporal coding block. The spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the current spatiotemporal coding block is then input into the first phase adaptive supernetwork structure of the next layer spatiotemporal coding block of the current spatiotemporal encoder.

[0023] The following combination Figure 3 The complete embodiments of this application are explained in detail below: By embedding features into the original traffic flow data, embedded feature vectors are obtained. The original traffic flow data first undergoes a series of preprocessing operations to obtain a high-dimensional representation suitable for deep spatiotemporal feature modeling. Specifically, the traffic flow prediction model (hereinafter referred to as the "model") first performs mean-variance standardization (Z-Score standardization) on the time series of each sensor node to unify the data distribution scale of different nodes and enhance training stability. This normalization process ensures that all input data are mapped to approximately the same numerical range, thereby avoiding model bias caused by differences in the original units between nodes. Its standardization formula is formula (1): (1) in It is raw traffic flow data. It is the mean. It is the standard deviation. After standardization, the input sequences of each node are at the same scale, avoiding high-volume nodes from dominating gradient updates, thereby improving the overall robustness of the model.

[0024] Channel projection: The standardized data still exists in the original physical quantity dimension (such as three channels: flow rate, speed, and occupancy), and its expressive power is insufficient to directly support deep spatiotemporal interaction structures. Therefore, this application further designs a fully connected mapping layer to project the low-dimensional traffic sequence onto the high-dimensional feature space defined by the model. Let the standardized input dimension be... Where T is the number of time steps, N is the number of nodes, and C represents the feature dimensions of traffic, speed, and occupancy, respectively. A fully connected layer (linear transformation) maps the data to a high-dimensional space, yielding a preliminary embedding representation (i.e., the embedding feature vector): d is the preset embedding dimension. This operation improves the expressive power of features and lays the foundation for subsequent embedding fusion.

[0025] This mapping enhances expressive power, and the high-dimensional space allows the model to characterize more complex implicit relationships; it also provides high-quality input to the phase-adaptive supernetwork, making its generated temporal convolution parameters more discriminative.

[0026] The encoder as a whole is composed of several spatio-temporal blocks (ST-Blocks) stacked together. Each ST-Block contains four key steps: 1. Extracting temporal features using a first-phase adaptive supernetwork structure. ; 2. An adaptive dynamic graph structure (i.e., the normalized adjacency matrix described in this application) is constructed based on differential graph signals, dual-threshold anomaly detection, and matching mechanisms. ; 3. Graph convolution module utilizes and Perform diffusion map convolution to obtain spatial features with temporal priors. (That is, spatial dimension features with positive time feedback). Will The second phase adaptive supernetwork structure, fed back into the spatiotemporal coding block of the current layer, obtains high-order temporal features with spatial positive feedback. (That is, the spatiotemporal feature vector output by the current layer), and achieve stable multi-layer stacking through residuals and normalization.

[0027] Multi-layer ST-Block stacking forms the encoder output global spatiotemporal feature vector. It is used as input to the decoder for multi-step parallel prediction.

[0028] Traditional fixed-kernel TSConv convolutional models struggle to dynamically adapt to periodic variations. This is because conventional convolutional structures extract features from all time periods using static parameters, making it difficult to accurately capture the differences in traffic patterns during weekday peak hours, off-peak hours, and holidays. Therefore, this application proposes a phase-adaptive supernetwork structure. By introducing phase periodic embedding and a supernetwork structure, it dynamically generates convolutional kernel parameters, improving the model's adaptive modeling ability for different periodic phases, significantly reducing the number of model parameters, and enhancing interpretability.

[0029] The input to the phase-adaptive temporal hypernetwork is a traffic flow sequence (embedded feature vector). ,in This can be represented as a matrix, where each node has a length of . The input data includes traffic flow sequences. In addition, the input data also includes the phase label information sequence corresponding to the traffic flow sequences. Each time step Each corresponds to a phase label This is used to indicate which traffic mode the current time belongs to (e.g., weekday peak, weekday off-peak, weekend peak, weekend off-peak, etc.).

[0030] The phase-adaptive supernetwork first performs periodic phase embedding. Given the current time... Corresponding periodic phase label Based on a trainable embedding matrix Obtain the phase embedding vector , is represented as: (2) in, For a trainable phase embedding matrix, This represents the total number of all possible phase categories. The dimension of the embedding vector is denoted by . In this way, each time step can be mapped to a low-dimensional phase feature vector to clearly distinguish the different traffic patterns represented by different period phases.

[0031] Obtain the embedding representation vector Then, the model will dynamically generate phase-specific convolutional kernel parameters using a lightweight hypernetwork structure. The hypernetwork is denoted as... The network structure consists of two fully connected layers and a nonlinear activation function (ReLU), with phase embedding vectors. As input, the output is a set of convolution weight parameters. Including convolution kernel weights and bias terms ,Right now: (3) Among them, the convolution kernel weights ; This indicates the number of hidden channels in the model; Kernel width; bias term The hypernetwork structure allows the weight parameters of the convolution kernel to be dynamically adjusted in real time according to different period phases, thereby enabling the convolution operation to capture the characteristics of traffic flow under different phases more accurately.

[0032] Based on the convolution parameters generated by the aforementioned supernetwork, the model further performs a phase-adaptive dynamic convolution operation. Let the first... At each time step, the feature representation of a node is obtained through the convolution kernel parameters. Acts on the input sequence window And add the corresponding bias term. To obtain intermediate features ,Right now: (4) Among them, the symbol " " indicates a length of One-dimensional convolution operation, This indicates that all nodes are within the time window. to The original traffic flow data fragments within. The feature representation obtained after dynamic convolution operation. Dimensions That is Each node in the current time window The d hidden channel features are represented.

[0033] To further improve feature representation capabilities and control information selectivity, a gated activation function is introduced after dynamic convolution, namely: (5) Where ⊙ represents the Hadamard product. This indicates that a nonlinear transformation is performed on the features using the hyperbolic tangent function, and the output value ranges from [value range missing]. between; This indicates that the range generated by the Sigmoid function is... The gating coefficients are used. Feature preservation and noise filtering are achieved through element-wise multiplication, enabling the model to adaptively select important information, suppress irrelevant interference, and enhance the robustness of feature representation.

[0034] Finally, the model analyzes the gated feature sequences. Perform downsampling in the time dimension to obtain a length of Hidden sequence representation (temporal features) ,Right now: (6) The Pooling operation is an average pooling process. If the original sequence length... It can be If divisible, then use the interval. Uniformly select feature representations; if not divisible, use an adaptive average pooling method. Final output. It is a three-dimensional tensor with dimension . ,Right now A node in the hidden passage Dimensional The hidden feature representation is then described. It contains only temporal dimension information and does not involve any spatial adjacency information. It can be directly used as input for subsequent modules of dynamic graph convolutional networks, thereby realizing spatiotemporal interactive learning for traffic flow prediction tasks.

[0035] Compared to traditional fixed convolutional structures, the proposed phase-adaptive supernetwork achieves dynamic switching of convolution kernel parameters according to traffic phases through periodic phase embedding and a dynamic convolution mechanism, significantly improving the model's adaptability to different periodic patterns. Simultaneously, it significantly reduces the number of model parameters, lowers computational resource requirements, and improves the model's prediction accuracy and generalization performance for traffic flow data. Furthermore, the design of this structure allows for seamless integration with existing spatial feature extraction modules, demonstrating good practicality and scalability.

[0036] While urban traffic flow exhibits a periodicity, it can experience sudden abrupt changes during peak hours, traffic accidents, or large events. Directly modeling with a fixed sliding window can easily mix drastically different traffic patterns into the same segment, weakening the model's sensitivity to anomalies. Therefore, this application designs a "differential signal + dual threshold" detection framework. To explicitly consider these anomalous behaviors in spatial modeling, this application employs a "differential signal + dual threshold" mechanism to adaptively divide the time axis and learn adjacency matrices within each sub-segment, thereby constructing a dynamic graph structure that matches the anomalous patterns.

[0037] The normalized dynamic adjacency matrix obtained by online matching and fusion using the constructed dynamic graph structure is input together with the temporal features output by the first phase adaptive supernetwork structure into the graph convolution module, which outputs spatial dimension features with positive temporal feedback. Then, the obtained spatial dimension features with positive temporal feedback are input into the second phase adaptive supernetwork structure of the current layer spatiotemporal coding block, which outputs the spatiotemporal feature vector described in this application.

[0038] (1) Abnormal moment detection mechanism (corresponding to) Figure 3 (Medium differential graph signal) To capture sudden changes in raw traffic flow data over time, anomaly detection (such as...) is introduced. Figure 4 (As shown in the diagram) mechanism.

[0039] Specifically, let's assume the original traffic flow data is as follows: ,in Indicates the number of traffic sensors. This represents the number of time steps (each time step is 5 minutes). Indicates time Traffic flow values ​​for all nodes. First, a time-difference plot signal is constructed to reflect the fluctuations in traffic flow between adjacent time slots; this signal is defined as: (7) Then, the variation characteristics of the differential signal are characterized from two dimensions: one is smoothness, which measures the local consistency of traffic flow in the graph structure. The larger the smoothness index value, the less intense the change in traffic state within that period, which can be represented by the graph Laplace quadratic form. (8) Where L=DA represents the graph Laplacian matrix, A is the prior adjacency matrix, D=diag(A1) is the degree matrix, and L represents the initialization as a prior correlation graph between sensors. The larger S2 is, the stronger the local inconsistency of the sequence in the current graph structure.

[0040] Secondly, there is energy, which measures the overall intensity of signal fluctuations. It is defined by taking the square of the Frobenius norm over time for the differential signal, as shown in the following formula: (9) Based on the two indicators mentioned above, a dual threshold mechanism is introduced to determine the time. Whether a point is an outlier is determined by the following criteria: when the smoothness or energy exceeds a specified threshold, the point is considered an outlier. The determination formula is shown in (10): (10) in These represent the adjustment factors for smoothness and energy, respectively; A threshold set based on experience; the logical "OR" indicates that if either indicator exceeds the threshold, h is considered an abnormal moment. This allows for accurate positioning of the output. This helps determine whether the time point is a sudden flow anomaly caused by morning or evening rush hours, accidents, or other reasons.

[0041] Based on the above mechanism, it is possible to effectively detect abnormal moments of traffic flow changes that are associated with morning and evening peak hours, emergencies, etc.

[0042] (2) Adaptive time partitioning strategy (e.g.) Figure 3(Adaptive anomaly time partitioning in the middle) Based on the detected set of anomaly times, to adapt to the input time dimension required by the encoder (i.e., each input contains 12 time steps (1 hour), the hourly sequence can be divided into T consecutive, non-overlapping subsequences, with the anomaly timestamps as boundaries. Each of the segments Indicates the first Traffic flow data within the segment, and The length of this time period satisfies formula (11): (11) Compared to the traditional fixed sliding window method, this partitioning strategy can more accurately adapt to the actual fluctuation characteristics of traffic flow, avoid the problems of pattern fragmentation or information redundancy caused by manual window settings, and provide more structurally consistent time segments for subsequent graph structure learning and dynamic graph loading.

[0043] (3) Fragment-based graph structure learning (e.g.) Figure 3 (Graph Structure Learning in China) After obtaining multiple subsequences, graph structure learning is performed on each segment separately, and an adjacency matrix reflecting the traffic state within that time period is constructed. It is used to realize data-driven graph structure generation.

[0044] Therefore, we first define a distance matrix between nodes to represent the degree of flow difference between sensors, as shown in formula (12): (12) in, Indicates the first paragraph, no. The node and the first The distance value of the nth node (the nth node in the matrix) element); Indicates the first paragraph, no. Each time step, node The flow rate value; It is the square of the Euclidean distance, which is the sum of the squares of the differences between the two nodes over all time steps in that period.

[0045] Subsequently, the graph structure learning model adopts the following three joint optimization objectives, as shown in formula (13): (13) in: Represents the set of legal adjacency matrices; The first term is the structural smoothing term of the graph signal. The second term is the sparse regularization term, where The definition formula is shown in (14): (14) in , where is the regularization coefficient, controlling the positivity of node degree and the sparsity of the graph, respectively; This represents the sum of the elements in each row, which is the degree vector of all nodes.

[0046] The third term is the time regularization term, which encourages a certain continuity in the graph structure between adjacent time periods; coefficient Used to adjust the degree of its influence.

[0047] Through the aforementioned three-stage strategy for learning time-varying graph structures, the model can dynamically perceive the structural abrupt changes in the traffic system over time and generate a graph structure representation that accurately describes the current traffic state within each fixed-length time window (1 hour, or 12 time steps). Specifically, the model divides each hourly sequence into several segments and independently constructs a corresponding adjacency matrix for each segment. This is to reflect the changes in spatial topology during that time period.

[0048] (4) Online matching and dynamic graph fusion Figure 3 (Matching mechanism) Because the adjacency matrix is ​​generated through adaptive partitioning based on outliers, the time ranges contained in each adjacency matrix are different; that is, the number of adjacency matrices contained in each fixed window is different. The temporal features output by the phase-adaptive hypernetwork are shown below. The normalized abnormal dynamic adjacency matrix (the fused adjacency matrix) is used as the input to the dynamic graph convolutional model. The time steps of the two feature dimensions need to be unified, so we design an online matching mechanism. If the current time window corresponds to multiple graph structures (e.g., one hour divided into three segments), the model automatically loads all relevant adjacency matrices. Then, the learnable weights are weighted and fused using softmax. Let the learnable weights corresponding to each adjacency matrix be... Its normalized expression is: (15) in, For the first Normalized fusion coefficients (weight values) of adjacency matrices. For the first Learnable weight parameters (real numbers) of the adjacency matrices; This represents the number of adjacency matrices in the current time period.

[0049] The final merged adjacency matrix is ​​represented as follows: (16) in, For the current time window The adjacency matrix generated for each sub-segment reflects the traffic structure within that segment; For the first The normalized fusion coefficients of the adjacency matrices (obtained via Softmax); This represents the number of segments within the current time window. The final dynamic adjacency fusion matrix is ​​used as the dynamic adjacency space structure for graph convolution at the current time step.

[0050] This dynamic fusion mechanism ensures the continuity and adaptability of the spatial structure during temporal evolution, significantly improving the model's responsiveness and spatial modeling accuracy in the face of unexpected events (such as traffic control and sudden accidents). The dynamic adjacency matrix is ​​normalized and defined as follows: (17) in, It is an adjacency matrix The degree matrix is ​​calculated as follows: (18) (5) Temporal features + dynamic graph structure → spatial high-dimensional features (graph convolutional layer of flowchart) The evolution of traffic flow is not only influenced by autocorrelation in the time dimension, but also strongly depends on the spatial topology and neighborhood interactions of the road network. To explicitly characterize this spatial dependence in the model, this section introduces standard graph convolution based on the aforementioned temporal features and dynamic graph structure, realizing the mapping and information diffusion from "temporal representation" to "spatial representation".

[0051] Since traffic flow not only exhibits continuous temporal dependencies but is also significantly influenced by road topology and neighborhood interaction effects, temporal features alone cannot reflect spatial structure. Therefore, it is necessary to map temporal features to the spatial domain and use spatial convolution operations to mine the interactive influences between neighboring nodes, thereby obtaining spatial features with both spatiotemporal semantics.

[0052] Based on the above motivations, this application employs standard first-order graph convolution to integrate temporal features. Injected into the dynamic adjacency structure, it completes the information transfer between time and space. Specifically, for each time step t, it will... Viewed as a temporal feature representation of nodes, Viewed as the dynamic spatial topology at the current moment, the node representation is updated using graph convolution: (19) in: This represents the normalized adjacency matrix obtained based on the current dynamic graph structure; Learnable weights for graph convolution; The nonlinear ReLU activation function is used. The matrix multiplication structure in graph convolution ensures that nodes not only retain their own temporal features, but also aggregate temporal representations at the same time from neighboring nodes, realizing the modulation of temporal dynamics by the spatial adjacency structure.

[0053] It is important to highlight the dynamic graph structure. It is jointly generated by anomaly detection and attention weights, and it updates over time. Therefore, graph convolution reflects different spatial dependency structures during computation at different time steps. When the system is in a stationary period, It approximates historical stable patterns; however, when anomalies occur, the adjacency matrix weights of nearby anomalous segments increase significantly, causing spatial convolution to focus more on the node regions surrounding the anomaly propagation, thereby... (Spatial features) inherently possess the capability of "time-driven spatial response". In this way, temporal features are not only propagated to neighboring nodes, but also reorganized into spatial features consistent with the current spatial topology, realizing a collaborative expression of the real traffic structure and sudden patterns, and providing rich context for the next stage of space-time feedback modeling.

[0054] Spatial high-dimensional features → Temporal high-dimensional features (phase-adaptive hypernetwork temporal module in the next layer st-block) A one-way input of temporal features to the spatial module alone is insufficient to characterize the spatiotemporal coupling relationships in complex transportation systems. Therefore, this application further incorporates the spatial features output by graph convolution. Feedback to the temporal modeling module enables the adaptive generation of temporal convolution kernels to be influenced by both phase labels and spatial context, thereby constructing a reverse positive feedback loop of "space → time".

[0055] The specific approach is as follows: after completing the based on Convolution of the graph and obtain Afterwards, As a new time-series input, it is fed again into the phase-adaptive supernetwork. For the spatial-temporal modeling of layer 1, we have: (20) in The phase label is the same as that defined in the previous phase-adaptive hypernetwork. Because... The neighborhood aggregation result on the spatial network at the current moment has already been encoded. When generating convolution kernel parameters, the phase-adaptive hypernetwork not only considers the periodic differences of different time phases, but also re-perceives the "spatial influence relationship of each road segment in the network at this time step," thus obtaining... It can be regarded as a high-order spatiotemporal feature that is simultaneously injected into the context by both time and space, in formula (20), This represents the operation of formulas (2)-(6) above. In other words, in the data interaction between the graph convolution module and the second phase adaptive supernetwork structure, the graph convolution module inputs spatial dimension features with positive temporal feedback to the second phase adaptive supernetwork structure. Then, the above formulas (2)-(6) represent that the input of the first phase adaptive supernetwork structure is the embedded feature vector.

[0056] Thus, the following closed loop is formed inside a single spacetime block: (twenty one) Through this closed-loop mechanism, the model gains the ability to capture the propagation of sudden events, cross-regional traffic linkage, and phase rhythm changes, forming a complete "time → space → time" interaction structure, laying a solid foundation for deep feature stacking.

[0057] 2.4 After stacking multiple spatiotemporal coding blocks, the encoder output is obtained through residual connection and normalization. A single-layer "time-space-time" structure can capture the dynamic coupling between local time segments and neighboring spatial structures, but relying solely on a single-layer structure is insufficient for modeling the cross-timescale dependencies and cross-spatial regional linkages of complex traffic systems. Traffic flow exhibits multi-level and multi-periodic characteristics, ranging from minute-level fluctuations to hourly rhythms and daily pattern changes; simultaneously, the propagation of influences in road networks often spans distances across multiple nodes. Therefore, this application encapsulates the aforementioned closed-loop structure into a reusable spatiotemporal coding block (ST-Block), and stacks multiple ST-Blocks along the depth dimension in the encoder, supplemented by residual connections and normalization, thereby constructing a deep encoder to achieve multi-scale spatiotemporal feature extraction from local to global perspectives.

[0058] In the l-th ST-Block, the model inputs the feature representation of the previous layer's output. (Here, the input is directly fed into the phase-adaptive supernetwork structure of the second-layer ST-Block.) First, the temporal features are generated by the first phase-adaptive supernetwork. Then, spatial features are generated by graph convolution using a dynamic adjacency matrix. This is then fed back to the second phase adaptive supernetwork structure to generate a second time feature. The formula is as follows: (twenty two) To ensure stable gradient flow between layers of different depths and preserve important semantic representations from the previous layer, this study employs residual connections and layer normalization operations. The enhanced temporal features of the current layer are added to the input of the previous layer and then normalized. (twenty three) (twenty four) In this context, formula (23) represents residual connection, and formula (24) represents normalization.

[0059] As the number of layers increases, the model's receptive field expands layer by layer in the temporal dimension, evolving from capturing local short-term fluctuations to modeling long-range dependencies across hours and phases. In the spatial dimension, the stacking of graph convolutions allows nodes to converge spatial information from more distant nodes within a larger topological range, forming a global spatial structure representation across regions. Shallow layers focus on characterizing local bursts and proximity propagation, intermediate layers extract the congestion diffusion trajectory within the region, and high layers summarize the macroscopic rhythm and phase patterns of overall traffic flow, thus forming a complete hierarchical spatiotemporal representation system.

[0060] (25) Finally, the output after stacking L layers Forming the global spatiotemporal feature vector of the encoder This representation integrates multi-dimensional information such as temporal dynamics, spatial topology, anomaly propagation, and phase rhythm. It is a deep spatiotemporal representation with high expressiveness and strong generalization ability, providing sufficient structured input for subsequent decoders to predict future traffic flows.

[0061] Decoder structure: In the aforementioned encoder section, a global spatiotemporal feature vector representation containing multiple semantics, including temporal dynamics, spatial topology, anomaly propagation patterns, and phase rhythms, is obtained through a multi-layer spatiotemporal interaction structure. However, this representation is still in a high-dimensional space and is not suitable for direct use in predicting future traffic conditions. Therefore, the decoder needs to effectively integrate, filter, and map the multi-channel, deep spatiotemporal features from the encoder to achieve the prediction transformation from "high-dimensional spatiotemporal features" to "future traffic sequences." Based on this requirement, this paper designs a decoder framework consisting of channel fusion, multi-head attention-enhanced gating mechanism, residual structure, and parallel convolutional prediction. This framework emphasizes both the model's expressive power and training stability and inference efficiency. 1. Channel fusion and gated feature extraction (GLU) First, the multi-branch spatiotemporal features output by the encoder have high dimensionality after channel concatenation, resulting in information redundancy. To compress redundant information and unify the number of channels, the model first... Convolution integrates features, and its computational expression is shown in (26): (26) HC represents the high-dimensional feature representation after multi-branch splicing of the encoder; HC represents the intermediate feature after channel compression.

[0062] Subsequently, to further enhance the model's ability to dynamically filter features from different spatial regions and time segments, and to more effectively retain or suppress key information, this application introduces a multi-head attention mechanism based on the traditional gated linear unit (GLU). Specifically, the multi-head attention mechanism first learns multiple attention maps separately, assigning weights to different dimensions of the features, thereby achieving deep reorganization and dynamic filtering of feature representations. Its calculation process can be represented as follows: First, the query, key, and value feature representations are obtained through linear mapping: (27) Where h is the number of attention heads, and WiQ, WiK, and WiV are the learnable parameter matrices corresponding to the i-th attention head. Subsequently, attention calculations are performed on each attention head, generating a weighted feature representation: (28) Here, dk is the dimensionality of each attention head. Through this attention operation, different heads can dynamically learn the importance weights of different feature dimensions, thus providing richer feature combinations for the gating mechanism. Subsequently, the features generated by multiple attention heads are concatenated and fused into a unified multi-head attention output through a linear mapping: (29) Where WO is the fusion weight matrix of the multi-head attention output. Based on the multi-head attention features, a GLU gating unit is introduced to further realize the selection and filtering of importance among feature channels: (30) in, The linear transformation weights and bias terms for the feature path are used to generate the feature ontology. The linear transformation weights and bias terms for the gated path are used to generate the channel selection weights. For the Sigmoid function. ⊙ represents element-wise multiplication. This mechanism significantly improves the model's ability to "preserve" and "suppress" features, and can dynamically enhance or weaken the importance weights of corresponding feature dimensions according to the current traffic state features. In particular, it enhances the sensitivity to abnormal traffic states and key spatial area features. Formulas (27)-(30) all belong to multi-layer attention gating mechanisms.

[0063] To further improve the training stability and information integrity of deep networks, the multi-head attention-enhanced GLU output is also residually fused with the features before compression, specifically expressed as follows: This is a feature output by the multi-head attention gating mechanism. This residual connection alleviates the gradient vanishing problem to some extent and enhances the sustainable propagation of features within the network. The above feature representation... The final spatiotemporal interaction fusion representation, output by the decoder, is fed into the subsequent prediction layer for future traffic state estimation.

[0064] Finally, to address the issues of error accumulation and low inference efficiency in traditional autoregressive decoding structures, this paper employs a non-autoregressive structure to achieve parallel prediction of future traffic conditions. Specifically, the aforementioned fused features are input into a one-dimensional convolutional layer, with the kernel size equal to the number of prediction steps, directly outputting the prediction results for all future time steps: (31) in, The final prediction output of the model represents the predicted value of each node (a certain location region) at multiple future time steps.

[0065] The aforementioned decoder architecture, through the introduction of a multi-head attention-enhanced gating mechanism, achieves dynamic perception and adaptive selection of the importance of features across different feature dimensions and spatial regions, significantly improving the model's ability to identify abnormal traffic conditions, key nodes, and important time periods. Simultaneously, the non-autoregressive prediction structure effectively avoids error propagation problems, enhancing the model's inference efficiency and application value in real-world traffic prediction scenarios.

[0066] Please see Figure 5 , Figure 5 This is a schematic diagram of the traffic flow prediction device based on anomaly graph structure and spatiotemporal cyclic coupling provided in an embodiment of this application. The traffic flow prediction device based on anomaly graph structure and spatiotemporal cyclic coupling is applied to a computer device, and may include: The first processing unit 401 is used to perform feature embedding processing on the original traffic flow data through the data embedding layer to obtain an embedded feature vector. The first output unit 402 is used to input the original traffic flow data and the embedded feature vector into the first layer spatiotemporal coding block of the encoder to obtain the spatiotemporal feature vector of the first layer spatiotemporal coding block; The second output unit 403 is used to sequentially perform feature extraction operations on the spatiotemporal coding blocks other than the first layer spatiotemporal coding block until the Lth layer spatiotemporal coding block outputs the global spatiotemporal feature vector. The prediction unit 404 is used to output the high-dimensional output vector to the decoder, and the decoder outputs the prediction result to characterize the future traffic flow. The spatiotemporal feature vector of the first-layer spatiotemporal coding block is obtained through the following steps: The embedded feature vector is input into the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block to obtain the time feature output by the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block. The time features and the original traffic flow data are input into the graph convolution module to obtain spatial dimension features with positive time feedback output by the graph convolution module of the first layer; The spatial dimension features with positive temporal feedback output by the graph convolution module of the first layer are input into the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block to obtain the spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block. The spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block is then input into the first phase adaptive supernetwork structure of the next layer spatiotemporal coding block. The feature extraction operation includes the following steps: For any spatiotemporal coding block that is not the first layer spatiotemporal coding block, the spatiotemporal feature vector output by the previous layer spatiotemporal coding block is received, and the spatiotemporal feature vector output by the previous layer spatiotemporal coding block is input into the first phase adaptive supernetwork structure of the current layer spatiotemporal coding block to obtain the time feature output by the first phase adaptive supernetwork structure of the current layer spatiotemporal coding block. The temporal features output by the first phase adaptive hypernetwork structure of the current layer spatiotemporal coding block and the original traffic flow data are input into the graph convolution module of the current layer spatiotemporal coding block to obtain the spatial dimension features with positive temporal feedback output by the graph convolution module of the current layer spatiotemporal coding block. The spatial dimension features with temporal positive feedback output by the graph convolution module of the current spatiotemporal coding block are input into the second phase adaptive supernetwork structure of the current spatiotemporal coding block to obtain the spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the current spatiotemporal coding block. The spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the current spatiotemporal coding block is then input into the first phase adaptive supernetwork structure of the next layer spatiotemporal coding block of the current spatiotemporal encoder.

[0067] Reference Figure 6 , Figure 6 To implement the structural block diagram of a portion of the terminal 140 in this application embodiment, the terminal 140 includes: a radio frequency (RF) circuit 710, a memory 715, an input unit 730, a display unit 740, a sensor 750, an audio circuit 760, a wireless fidelity (WiFi) module 770, a processor 780, and a power supply 790, among other components. Those skilled in the art will understand that... Figure 6 The terminal 140 structure shown does not constitute a limitation on a mobile phone or computer, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0068] The RF circuit 710 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and processes it with the processor 780; in addition, it transmits uplink data to the base station.

[0069] The memory 715 can be used to store software programs and modules. The processor 780 executes various functional applications of the terminal and traffic flow prediction processing based on anomaly graph structure and spatiotemporal cyclic coupling by running the software programs and modules stored in the memory 715.

[0070] The input unit 730 can be used to receive input numeric or character information, and to generate key signal inputs related to the terminal's settings and function control. Specifically, the input unit 730 may include a touch panel 731 and other input devices 732.

[0071] The display unit 740 can be used to display input or provided information, as well as various menus of the terminal. The display unit 740 may include a display panel 741.

[0072] Audio circuitry 760, speaker 761, and microphone 762 provide an audio interface.

[0073] In this embodiment, the processor 780 included in the terminal 140 can execute the traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling of the previous embodiment.

[0074] The terminal 140 in this application embodiment includes, but is not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, and aircraft. This application embodiment can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.

[0075] Figure 7 This is a partial structural block diagram of a server 110 implementing an embodiment of this application. The server 110 can vary significantly due to different configurations or performance characteristics, and may include one or more central processing units (CPUs) 822 (e.g., one or more processors) and memory 832, and one or more storage media 830 (e.g., one or more mass storage devices) for storing application programs 842 or data 844. The memory 832 and storage media 830 can be temporary or persistent storage. The program stored in the storage media 830 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server 110. Furthermore, the CPU 822 may be configured to communicate with the storage media 830 and execute the series of instruction operations in the storage media 830 on the server 110.

[0076] Server 110 may also include one or more power supplies 826, one or more wired or wireless network interfaces 850, one or more input / output interfaces 858, and / or one or more operating systems 841, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0077] The central processing unit 822 in server 110 can be used to execute the traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling of the present application embodiments.

[0078] This application also provides a computer-readable storage medium for storing program code for executing the traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling of the foregoing embodiments.

[0079] This application also provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, causing the computer device to perform the traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling described above.

[0080] Furthermore, the terms “comprising” and “including”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or apparatus.

[0081] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0082] It should be understood that in the description of the embodiments of this application, "multiple" means two or more, "greater than", "less than", "exceeding" etc. are understood to exclude the number itself, and "above", "below", "within" etc. are understood to include the number itself.

[0083] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0084] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.

[0085] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0086] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0087] It should also be understood that the various implementation methods provided in this application can be combined arbitrarily to achieve different technical effects.

[0088] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0089] The above is a detailed description of the embodiments of this application. However, this application is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.

Claims

1. A traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling, characterized in that, The method is applied to a traffic flow prediction model, which includes a data embedding layer, an encoder, and a decoder. The encoder consists of L layers of spatiotemporal coding blocks, each including a first phase-adaptive hypernetwork structure, a graph convolution module, and a second phase-adaptive hypernetwork structure. The original traffic flow data is processed by feature embedding through the data embedding layer to obtain embedded feature vectors; The original traffic flow data and the embedded feature vector are input into the first layer spatiotemporal coding block of the encoder to obtain the spatiotemporal feature vector of the first layer spatiotemporal coding block; The spatiotemporal coding blocks, except for the first layer spatiotemporal coding block, perform feature extraction operations sequentially until the Lth layer spatiotemporal coding block outputs the global spatiotemporal feature vector; The high-dimensional output vector is output to the decoder, and the decoder outputs the prediction results used to characterize future traffic flow. The spatiotemporal feature vector of the first-layer spatiotemporal coding block is obtained through the following steps: The embedded feature vector is input into the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block to obtain the time feature output by the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block. The time features and the original traffic flow data are input into the graph convolution module to obtain spatial dimension features with positive time feedback output by the graph convolution module of the first layer; The spatial dimension features with positive temporal feedback output by the graph convolution module of the first layer are input into the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block to obtain the spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block. The spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block is then input into the first phase adaptive supernetwork structure of the next layer spatiotemporal coding block. The feature extraction operation includes the following steps: For any spatiotemporal coding block that is not the first layer spatiotemporal coding block, the spatiotemporal feature vector output by the previous layer spatiotemporal coding block is received, and the spatiotemporal feature vector output by the previous layer spatiotemporal coding block is input into the first phase adaptive supernetwork structure of the current layer spatiotemporal coding block to obtain the time feature output by the first phase adaptive supernetwork structure of the current layer spatiotemporal coding block. The temporal features output by the first phase adaptive hypernetwork structure of the current layer spatiotemporal coding block and the original traffic flow data are input into the graph convolution module of the current layer spatiotemporal coding block to obtain the spatial dimension features with positive temporal feedback output by the graph convolution module of the current layer spatiotemporal coding block. The spatial dimension features with temporal positive feedback output by the graph convolution module of the current spatiotemporal coding block are input into the second phase adaptive supernetwork structure of the current spatiotemporal coding block to obtain the spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the current spatiotemporal coding block. The spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the current spatiotemporal coding block is then input into the first phase adaptive supernetwork structure of the next layer spatiotemporal coding block of the current spatiotemporal encoder.

2. The traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling according to claim 1, characterized in that, The embedded feature vector is input into the first phase-adaptive supernetwork structure of the first layer spatiotemporal coding block to obtain the temporal features output by the first phase-adaptive supernetwork structure of the first layer spatiotemporal coding block, including: Determine the phase label information of the embedded feature vector; An embedding representation vector is generated based on the embedded feature vector and the phase label information; Dynamic convolution is performed on the embedded representation vector to obtain intermediate features; Gated activation is performed based on the intermediate features to obtain the gated activation feature sequence; The gated feature sequence is averaged and pooled to obtain the temporal features output by the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block.

3. The traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling according to claim 2, characterized in that, The temporal features and the original traffic flow data are input into the graph convolution module to obtain spatial dimension features with positive temporal feedback output by the graph convolution module of the first layer, including: Construct a differential map signal corresponding to the original traffic flow data to detect abnormal moments where anomalies exist; Multiple anomaly graph structures are obtained based on the detected anomaly moments; The dynamic adjacency fusion matrix is ​​obtained based on each of the aforementioned anomaly graph structures; The dynamic adjacency fusion matrix is ​​normalized to obtain a normalized adjacency matrix; Spatial dimension features with positive temporal feedback are generated based on the normalized adjacency matrix and the temporal features.

4. The traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling according to claim 3, characterized in that, Each of the aforementioned anomaly graph structures corresponds to a single adjacency matrix. The step of obtaining a dynamic adjacency fusion matrix based on each of the aforementioned anomaly graph structures includes: The adjacency matrices corresponding to each of the aforementioned abnormal graph structures are weighted and fused to obtain the dynamic adjacency fusion matrix.

5. The traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling according to claim 3, characterized in that, The step of generating spatial dimension features with positive temporal feedback based on the normalized adjacency matrix and the temporal features includes: The spatial dimension feature with positive temporal feedback is obtained by activating the weights of the graph convolution module, the normalized adjacency matrix, and the temporal features using a preset nonlinear ReLU activation function.

6. A traffic flow prediction device based on anomaly graph structure and spatiotemporal cyclic coupling, characterized in that, An application is made to a traffic flow prediction model, which includes a data embedding layer, an encoder, and a decoder. The encoder consists of L layers of spatiotemporal coding blocks, each including a first phase-adaptive hypernetwork structure, a graph convolution module, and a second phase-adaptive hypernetwork structure. The device includes: The first processing unit is used to perform feature embedding processing on the original traffic flow data through the data embedding layer to obtain an embedded feature vector. The first output unit is used to input the original traffic flow data and the embedded feature vector into the first layer spatiotemporal coding block of the encoder to obtain the spatiotemporal feature vector of the first layer spatiotemporal coding block; The second output unit is used to sequentially perform feature extraction operations on the spatiotemporal coding blocks other than the first layer spatiotemporal coding block until the Lth layer spatiotemporal coding block outputs the global spatiotemporal feature vector. The prediction unit is used to output the high-dimensional output vector to the decoder, and the decoder outputs the prediction result to characterize the future traffic flow. The spatiotemporal feature vector of the first-layer spatiotemporal coding block is obtained through the following steps: The embedded feature vector is input into the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block to obtain the time feature output by the first phase adaptive supernetwork structure of the first layer spatiotemporal coding block. The time features and the original traffic flow data are input into the graph convolution module to obtain spatial dimension features with positive time feedback output by the graph convolution module of the first layer; The spatial dimension features with positive temporal feedback output by the graph convolution module of the first layer are input into the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block to obtain the spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block. The spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the first layer spatiotemporal coding block is then input into the first phase adaptive supernetwork structure of the next layer spatiotemporal coding block. The feature extraction operation includes the following steps: For any spatiotemporal coding block that is not the first layer spatiotemporal coding block, the spatiotemporal feature vector output by the previous layer spatiotemporal coding block is received, and the spatiotemporal feature vector output by the previous layer spatiotemporal coding block is input into the first phase adaptive supernetwork structure of the current layer spatiotemporal coding block to obtain the time feature output by the first phase adaptive supernetwork structure of the current layer spatiotemporal coding block. The temporal features output by the first phase adaptive hypernetwork structure of the current layer spatiotemporal coding block and the original traffic flow data are input into the graph convolution module of the current layer spatiotemporal coding block to obtain the spatial dimension features with positive temporal feedback output by the graph convolution module of the current layer spatiotemporal coding block. The spatial dimension features with temporal positive feedback output by the graph convolution module of the current spatiotemporal coding block are input into the second phase adaptive supernetwork structure of the current spatiotemporal coding block to obtain the spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the current spatiotemporal coding block. The spatiotemporal feature vector output by the second phase adaptive supernetwork structure of the current spatiotemporal coding block is then input into the first phase adaptive supernetwork structure of the next layer spatiotemporal coding block of the current spatiotemporal encoder.

7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling as described in any one of claims 1 to 5.

8. A computer program product, the computer program product comprising a computer program, characterized in that, The computer program is read and executed by the processor of the electronic device, causing the electronic device to perform the traffic flow prediction method based on anomaly graph structure and spatiotemporal cyclic coupling as described in any one of claims 1 to 5.