Network traffic prediction method, electronic device and apparatus
By combining an adaptive adjacency matrix graph convolutional network and a bidirectional state-space model with a sparse self-attention model, this approach addresses the shortcomings of existing network traffic prediction models in modeling dynamic topology and temporal features, achieving high-precision and low-latency network traffic prediction suitable for cloud-native architectures and edge devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEBEI UNIV OF ENG
- Filing Date
- 2026-04-02
- Publication Date
- 2026-08-04
AI Technical Summary
Existing network traffic prediction models suffer from insufficient dynamic spatial topology representation capabilities and a lack of consideration for long-range memory and real-time inference in time-series feature modeling when facing dynamic changes in microservice call relationships under cloud-native architecture and high-throughput scenarios in 5G/IoT networks. This results in low prediction accuracy and computational efficiency, making it difficult to meet the real-time requirements of network operation and maintenance.
A graph convolutional network with an adaptive adjacency matrix is used to aggregate spatial features. Temporal features are extracted by combining a bidirectional state space model and a sparse self-attention model. Short-range and long-range features are fused through an adaptive gating network to achieve accurate prediction of network state.
It improves the accuracy and generalization ability of traffic prediction in complex network environments, supports high-precision, low-latency network situational awareness and real-time traffic prediction, and is suitable for deployment on edge devices.
Smart Images

Figure CN121967252B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data network technology, and more specifically, relates to a network traffic prediction method, electronic device and apparatus. Background Technology
[0002] Network traffic prediction is a fundamental core technology in big data analytics, artificial intelligence, and intelligent operations and maintenance (AIOps), widely applied in complex network systems such as cloud computing data centers, 5G / 6G communication networks, large-scale Internet of Things (IoT), and edge computing nodes. This technology aims to deeply analyze historical state data distributed across network topology nodes (such as servers, switches, and base stations), including metrics like network throughput, bandwidth utilization, transmission latency, and packet loss rate, to accurately predict network load status over a future period. Accurate and real-time traffic prediction results provide network management systems with crucial information for congestion warnings and elastic resource scheduling, holding significant engineering value and practical implications for optimizing link bandwidth allocation, reducing server load, and improving overall network service quality.
[0003] With the iterative development of deep learning technology, network traffic prediction modeling has gradually broken free from the limitations of traditional statistical methods (such as ARIMA and Kalman filtering) and entered the data-driven deep learning stage. Addressing the inherent high-dimensional spatiotemporal coupling characteristics of large-scale network traffic data, both academia and industry generally adopt Spatiotemporal Graph Neural Networks (STGNNs) as the mainstream modeling paradigm to achieve joint modeling of spatial and temporal features. In the network space dimension, existing research largely relies on structures such as Graph Convolutional Networks (GCNs) and Graph Attention (GAT) mechanisms, using adjacency matrices constructed based on physical links or fixed logical connections to aggregate features of upstream and downstream network nodes (core switches, edge gateways, etc.). In the temporal evolution dimension, modules such as Long Short-Term Memory Networks (LSTMs), Gated Recurrent Units (GRUs), and Temporal Convolutional Networks (TCNs) are typically integrated to characterize the periodic tidal fluctuations and instantaneous bursts of network traffic load. Some cutting-edge research further introduces the Transformer architecture, leveraging self-attention mechanisms to capture global traffic dependencies in parallel over long historical windows.
[0004] While existing spatiotemporal graph neural network solutions have achieved some success, they are increasingly showing insurmountable technical bottlenecks in two core areas: computational efficiency and topology representation. These bottlenecks are as follows: First, they lack dynamic spatial topology representation capabilities, relying rigidly on static prior structures. Most existing traffic prediction models use pre-built static adjacency matrices, typically constructed based on physical fiber connections or fixed routing tables, lacking the ability to adaptively capture dynamic logical links. In scenarios such as software-defined networking (SDN) and containerized clusters, inter-node traffic interactions are driven by load balancing strategies and upper-layer business logic, exhibiting millisecond-level dynamic reconstruction characteristics. This fixed and rigid graph structure prior cannot accurately represent the surge in implicit logical coupling relationships between nodes during traffic storms, nor can it decouple heterogeneous topology dependencies caused by routine heartbeat detection and periodic data backup at different time scales, leading to distorted spatial feature aggregation and affecting the final prediction accuracy. Second, temporal feature modeling suffers from trade-offs, making it difficult to balance long-range memory and real-time inference. Serial computing architectures based on RNN series (LSTM, GRU) suffer from low training efficiency and slow inference speed when processing high-throughput network traffic data. They are also highly susceptible to gradient vanishing and cannot effectively capture long-term traffic patterns such as weekly or monthly fluctuations. While Transformer-based temporal modeling schemes offer the advantage of parallel computing, the computational overhead and memory usage of their self-attention mechanism increase quadratically with sequence length (O(L...). 2 For fine-grained traffic auditing tasks that require tracing thousands of time steps, such models consume huge amounts of resources and are difficult to deploy on edge devices with limited computing power, such as industrial gateways and edge routers. They cannot meet the stringent timeliness requirements of network operations and maintenance for millisecond-level anomaly detection and real-time traffic prediction. Summary of the Invention
[0005] In view of the above, embodiments of this application provide a network traffic prediction method, electronic device, and apparatus to at least solve one of the above-mentioned technical problems.
[0006] To achieve the above objectives, the technical solution adopted in this application is as follows: Firstly, a network traffic prediction method is provided, including: Obtain network state datasets of multiple time-scale views of the target network; each network state dataset includes network state data of each node in the target network; For the network state dataset of each time scale view, spatial features are aggregated through graph convolutional networks to extract the dynamic topological state features corresponding to each time scale view; the network parameters of the graph convolutional network include an adaptive adjacency matrix, which is obtained by multiplying the source node embedding and the target node embedding of the corresponding time scale view by the transpose; The static topological features of the target network are obtained, and the static topological features and each of the dynamic topological state features are fused through an attention mechanism to obtain spatial fusion features; Based on the spatial fusion characteristics, short-range temporal features are extracted using a bidirectional state-space model; Based on the spatial fusion characteristics, long-range temporal features are extracted using a sparse self-attention model; By using an adaptive gating network, the short-range time series features and the long-range time series features are fused to obtain spatiotemporal fusion features; The node states of the target network are predicted based on the spatiotemporal fusion features.
[0007] In some embodiments, the network traffic prediction method further includes: Acquire historical network state data of each node in the target network to form a spatiotemporal sequence dataset; From the spatiotemporal sequence dataset, fragment data is cyclically extracted at different time steps to obtain network state datasets with multiple time scale views.
[0008] In some embodiments, the network state dataset is at least three, and corresponds to at least three time scales: short-term, daily, and weekly / monthly; the network state data includes traffic sent to other nodes and traffic received from other nodes.
[0009] In some embodiments, obtaining the static topological features of the target network and fusing the static topological features and each of the dynamic topological state features through an attention mechanism to obtain spatial fusion features includes: Based on the physical structure of the target network, topology vectors are obtained as static topology features of the network using the Node2Vec graph representation learning algorithm. ; Calculate attention scores for views at each time scale. , in, For the first The dynamic topological state characteristics of each time-scale view. for The linear transformation weight matrix, for The linear transformation weight matrix, For bias terms, For attention vectors, It is the hyperbolic tangent activation function; Calculate the normalized attention weights for each timescale view based on the attention scores for each timescale view. The dynamic topological state features of the views at each time scale are adaptively weighted and summed, and static graph features are then reinjected into the fusion result through residual connections to obtain spatial fusion features. , in, For layer normalization function, for Alignment projection matrix, To normalize attention weights, It represents the Hadamah accumulation. For the first The dynamic topological state characteristics of a time-scale view, where n is the total number of time-scale views.
[0010] In some embodiments, extracting short-range temporal features based on the spatial fusion features using a bidirectional state-space model includes: The spatial fusion feature Expanding along the time dimension yields the input feature sequence; According to the discrete-time hidden state update equation, the input feature sequence is calculated in a forward-to-back order to obtain the forward feature sequence; According to the discrete-time hidden state update equation, the input feature sequence is calculated in reverse order to obtain the backward feature sequence; The forward feature sequence and the backward feature sequence are concatenated to obtain short-range time-series features. ; The discrete-time hidden state update equation is as follows: in, Let be the hidden state at time step t. This represents the hidden state at time step (t-1). The features are at the t-th time step of the input feature sequence; in, The state transition matrix is a discretized representation. The input driving matrix is discretized. Let A be the time step parameter, B be the state transition matrix, and C be the input driving matrix. It is an identity matrix.
[0011] In some embodiments, the step of extracting long-range temporal features based on the spatial fusion features using a sparse self-attention model includes: The spatial fusion features are linearly transformed and a sparse sampling strategy is applied to obtain a sparse query matrix. sparse bond matrix AND-value matrix V; The long-range time-series characteristics are: , in, This is the scaling factor.
[0012] In some embodiments, the fusion of the short-range time-series features and the long-range time-series features through an adaptive gating network to obtain spatiotemporal fusion features includes: The short-range time-series features and the long-range time-series features are concatenated along the feature channel dimension to obtain a combined vector; The combined vector is input into a linear projection layer and mapped to the (0, 1) interval using a Sigmoid activation function to obtain the gating coefficients. ; in, For the Sigmoid function, This is the weight matrix. It is a short-range time series characteristic. For long-range time series characteristics, For bias terms; Based on the calculated gating coefficient The spatiotemporal fusion features are obtained by performing element-wise dynamic weighted summation and layer normalization on the short-range and long-range time-series features. ; in, This indicates element-wise multiplication. For layer normalization.
[0013] In some embodiments, predicting the node state of the target network based on the spatiotemporal fusion features includes: inputting the spatiotemporal fusion features into a trained feedforward neural network to obtain predicted values of the node state of the target network. The feedforward neural network is a two-layer fully connected network. The first layer performs a nonlinear transformation on the spatiotemporal fusion features through an activation function to obtain intermediate features. The second layer maps the intermediate features to the prediction target time step to obtain the node state prediction value.
[0014] In a second aspect, an electronic device is provided, characterized in that the electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform any of the above-mentioned network traffic prediction methods.
[0015] Thirdly, a network traffic prediction device is provided, comprising: The data acquisition module is used to acquire network state datasets of the target network at multiple time scales; each network state dataset includes network state data of each node in the target network. The convolutional processing module is used to perform spatial feature aggregation on the network state dataset of each time scale view through a graph convolutional network, and extract the dynamic topological state features corresponding to each time scale view. The network parameters of the graph convolutional network include an adaptive adjacency matrix, which is obtained by multiplying the source node embedding and the target node embedding of the corresponding time scale view by the transpose. The fusion processing module is used to acquire the static topological features of the target network and fuse the static topological features and various dynamic topological state features through an attention mechanism to obtain spatial fusion features. The short-range feature extraction module is used to extract short-range temporal features based on spatial fusion features through a bidirectional state-space model. The long-range feature extraction module is used to extract long-range temporal features based on spatial fusion features using a sparse self-attention model. The gating module is used to fuse short-range and long-range time-series features through an adaptive gating network to obtain spatiotemporal fusion features; The prediction output module is used to predict the node states of the target network based on spatiotemporal fusion features.
[0016] The beneficial effects of the embodiments of this application are as follows: Compared with the prior art, the embodiments of this application deeply explore the nonlinear spatiotemporal evolution law of network traffic at multiple time scales, learn the dynamic coupling relationship between nodes based on adaptive topology embedding, and achieve accurate traffic inference by combining long and short time series feature fusion mechanism. It accurately captures the long-range logical coupling mechanism between network nodes and the inducing characteristics of sudden traffic storms, effectively improving the accuracy and generalization ability of multi-step traffic prediction in complex network environments, and providing strong support for building high-precision, low-latency network situation awareness and traffic prediction. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart of the network traffic prediction method provided in Embodiment 1 of the present invention; Figure 2 This is a technical roadmap of the network traffic prediction method provided in Embodiment 2 of the present invention; Figure 3 This is a technical roadmap of the bidirectional state-space model, sparse self-attention model, and adaptive gating network in the network traffic prediction method provided in Embodiment 2 of the present invention. Figure 4 This is a structural diagram of the network traffic prediction device provided in Embodiment 3 of the present invention. Detailed Implementation
[0019] To make the technical problems, technical solutions, and beneficial effects to be solved by this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this application.
[0020] Example 1 Please see Figure 1 The network traffic prediction method provided in the embodiments of this application will now be described. A network traffic prediction method includes the following steps S101 to S107.
[0021] Step S101: Obtain network state datasets of multiple time-scale views of the target network; each network state dataset includes network state data of each node in the target network.
[0022] The network state datasets with multiple time scale views can be obtained by slicing data from the same data source according to different time steps, or they can come from different data sources with different data recording periods. The network state data of each node typically includes at least the traffic sent by the node to other nodes and the traffic received from other nodes.
[0023] As an optional implementation, network state datasets with multiple timescale views are obtained in the following way: Historical network state data of each node in the target network is obtained to form a spatiotemporal sequence dataset; historical network state data is also the network state data before the target prediction time. From the spatiotemporal sequence dataset, fragment data is cyclically extracted at different time steps to obtain network state datasets with multiple time scale views.
[0024] This could include acquiring historical network status data collected by each data acquisition node in the target network.
[0025] As an optional implementation, the network state dataset has at least three parts, and corresponds to at least three time scales: short-term, daily, and weekly / monthly. The network state data includes traffic sent to other nodes and traffic received from other nodes.
[0026] Step S102: For the network state dataset of each time scale view, spatial feature aggregation is performed through graph convolutional networks to extract the dynamic topology state features corresponding to each time scale view. The network parameters of the graph convolutional network include an adaptive adjacency matrix, which is obtained by multiplying the source node embedding and the target node embedding of the corresponding time scale view by transpose. The source node embedding represents the source-end service features of each node in the target network, and the target node embedding represents the receiver-end service features of each node in the target network.
[0027] Specifically, spatial features of the network state datasets at each time scale are aggregated using graph convolutional networks to extract dynamic topological state features corresponding to each time scale view, capturing the coupling relationships between nodes at different time scales. Spatial feature aggregation using graph convolutional networks can effectively aggregate information from first-order neighbors to higher-order neighbors, thereby achieving traffic situation awareness across the entire network.
[0028] The source node embedding represents the source-end service characteristics of each node in the target network, specifically the characteristics of the traffic transmitted from the current node to other nodes under the corresponding time scale view. The target node embedding represents the receiving-end service characteristics of each node in the target network, specifically the characteristics of the traffic received by the current node from other nodes under the corresponding time scale view. The adaptive adjacency matrix is obtained by performing the matrix inner product of the transposes of the source node embedding and the target node embedding under the corresponding time scale view, and can represent the coupling relationship between the nodes in the target network under the corresponding time scale view.
[0029] In practice, the adaptive adjacency matrix can be obtained by multiplying the transposes of the source node embedding and the target node embedding, followed by nonlinear activation and normalization, in order to eliminate background traffic noise interference and simulate the sparse connection characteristics of the real Internet topology.
[0030] In practice, for the network state datasets of each time scale view, spatial features are aggregated separately using graph convolutional networks. This can be done using the same graph convolutional network or different graph convolutional networks.
[0031] Step S103: Obtain the static topology features of the target network, and fuse the static topology features and each dynamic topology state feature through an attention mechanism to obtain spatial fusion features.
[0032] Although step S102 captures the node coupling relationships at their respective time scales by extracting topological state features from different time-scale views using graph convolutional networks, these features lack a unified cross-view interaction mechanism. Furthermore, graph convolutional networks primarily focus on mining dynamic implicit relationships between traffic data, which may lead to "overfitting" during deep learning, thus ignoring the inherent static topological constraints of the target network (such as the underlying physical network architecture) to some extent. To address this issue, step S103 treats the dynamic topological state features of each time-scale view as a set of heterogeneous traffic features and introduces static topological features as prior structural constraints, adaptively fusing heterogeneous traffic features from multiple views.
[0033] After obtaining the spatial fusion features containing multi-scale dynamic flow evolution patterns and physical topology in step S103, the spatial fusion features are input in parallel into the bidirectional state space model and the sparse self-attention model in steps S104 and S105 to collaboratively capture long- and short-range time dependencies.
[0034] Step S104: Based on the spatial fusion characteristics, extract short-range temporal features using a bidirectional state-space model.
[0035] Step S105: Based on the spatial fusion features, extract long-range temporal features using a sparse self-attention model.
[0036] Among them, the bidirectional state-space model and the sparse self-attention model work together to capture long and short-range time dependencies. The short-range time series features focus on local evolution and bidirectional causal inference, while the long-range time series features focus on global long-range dependencies and pattern matching.
[0037] Step S106: Using an adaptive gating network, short-range and long-range time-series features are fused to obtain spatiotemporal fusion features.
[0038] Among them, the adaptive gating network integrates short-range and long-range temporal features to automatically determine the relative importance of "local inference" and "global matching" based on the current feature context.
[0039] Step S107: Predict the node state of the target network based on spatiotemporal fusion features.
[0040] Among them, the spatiotemporal fusion feature can be mapped to the predicted node state value through a feedforward neural network.
[0041] As an optional implementation, spatiotemporal fusion features are input into a trained feedforward neural network to obtain the node state prediction values of the target network; The feedforward neural network is a two-layer fully connected network. The first layer uses an activation function to perform a nonlinear transformation on the spatiotemporal fusion features to obtain intermediate features. The second layer maps the intermediate features to the prediction target time step to obtain the node state prediction value.
[0042] Example 2 This embodiment is a further development based on the above embodiments. For parts not described in detail in this embodiment, please refer to the relevant content in other embodiments.
[0043] This embodiment further elaborates on the core components in Embodiment 1, including the graph convolutional network in step S102, the attention mechanism in step S103, the bidirectional state space model in step S104, the sparse self-attention model in step S105, the adaptive gating network in step S106, and the feedforward neural network in step S107.
[0044] Figure 2 This embodiment presents the technical roadmap. It implements the invention by constructing a network traffic prediction model, using a unified end-to-end training process to collaboratively learn optimal parameters, ensuring smooth transitions between steps and stable overall prediction performance. First, network state data is acquired, followed by data cleaning, normalization, and completion. Then, a multi-view dataset is constructed to obtain a nearest neighbor view dataset, a trend view dataset, and a periodic view dataset. These three view datasets are respectively processed through an attention graph convolutional network (AGCN) and then fused using dynamic multi-graph attention. Subsequently, they are processed in parallel through a bidirectional state-space model and a sparse self-attention model, and then fused using an adaptive gating network. Finally, a feedforward neural network is used to obtain the predicted node state values of the target network.
[0045] The specific training steps are as follows: Data preparation: Historical network state data of the target network is collected and cleaned. Missing data is filled in using linear interpolation. To eliminate differences in data units between different nodes and accelerate model convergence, Z-Score normalization can be used to process the data, as shown in the following formula: in, The average of historical data. Let x be the standard deviation and x be the original data. This is the standardized data.
[0046] Let the historical network state data of the target network topology be... Where N is the number of network device nodes, and F is the feature dimension. This represents the total time step. It is for the predicted target time. The methods for constructing views at three time scales—nearest neighbor (short-term), trend (weekly / monthly), and period (weekly / monthly)—are as follows: Nearest Neighbor (Short-Time) View Construction: This view is used to capture short-term high-frequency traffic jitter and transient burst patterns in the immediate vicinity of the prediction time. Let the length of the nearest neighbor input sequence be... Then the nearest neighbor view network state dataset The construction formula is: In the formula, t represents the current time. This slice directly captures the most recent... Continuous traffic monitoring data at each time step reflects the instantaneous nonlinear correlation of network traffic data at a micro-time scale. Specifically, a single time step can be 0.5 minutes, 1 minute, or 5 minutes. It can be 30, 45, 60, etc.
[0047] Trend (Daily) View Construction: This view is used to capture the daily tidal fluctuations in network traffic (such as traffic peaks during periods of high user activity or traffic patterns during routine nighttime backups). Let the total number of time steps for a short period be... The selected past period number is The length of each trend segment is The trend view network state dataset is composed of traffic data segments from the same point in time over past periods, and its sampling formula is defined as: In the formula, Indicates the first Each cycle corresponds to a specific time and its preceding sequence. The historical traffic subsequence at each time step. This segmented sampling mechanism can effectively extract long-term temporal dependencies in short periods, reflecting the periodic recurrence characteristics of business logic in the time dimension. Specifically, when the time step is 1 minute, the total number of time steps in the short period is... You can choose from 30, 45, 60, 120, etc., the number of cycles. It can be 96, 48, 24, etc.
[0048] Weekly / Monthly View Construction: This view is used to capture long-term, cyclical patterns in network traffic (such as significant differences in traffic patterns between weekdays and weekends, or macro-distribution shifts due to user growth). Let the total number of time steps in a long period be... The selected number of past periods is The length of each periodic segment is Periodic view network state dataset From the past It consists of data segments at the same time in a long period, and its sampling formula is defined as: By introducing long-period slices, the model can learn more macroscopic patterns of network system state evolution, thus compensating for the shortcomings of single nearest neighbor or daily trend information in capturing low-frequency business logic. Specifically, when the time step is 1 minute, the total number of time steps in the long period... You can choose 180, 240, 480, etc., the number of cycles. It could be 56, 42, 21, etc.
[0049] The spatiotemporal sequence data, after standardization and multi-view slicing, is divided into training and validation sets according to a set ratio. These sets are used for model parameter learning and performance monitoring during the training process, respectively, to prevent model overfitting. For example, the training set accounts for 80% of the dataset, and the test set accounts for 20%.
[0050] Model building: In step S102, the convolutional network is constructed.
[0051] Construction of the adaptive adjacency matrix: Randomly initialize two learnable topological embedding dictionaries for N network entity nodes in the network: source node embedding... Embedding the target node ,in, The dimension of the embedding vector is used. The strength of the business logic association between nodes is inferred by matrix multiplication using the transposes of the source node embedding and the target node embedding. The source node embedding and the target node embedding serve as model parameters, which are continuously updated during training using the backpropagation algorithm, thereby adaptively representing the source-end business characteristics and receiver-end reception characteristics of each node in the network traffic forwarding and aggregation process.
[0052] To eliminate background traffic noise interference and simulate the sparse connectivity characteristics of real Internet topology, a nonlinear activation and normalization mechanism is introduced. The inner product of the source node embedding and the target node embedding is used as the node embedding parameter, and an adaptive adjacency matrix is obtained by introducing the nonlinear activation and normalization mechanism. , In the formula, The score determines the degree of traffic correlation between any two network nodes. A higher score indicates a stronger dependence between the two nodes in terms of business logic. The activation function acts as a topological denoising filter, directly setting weak or negative correlations less than 0 in the inner product result to 0, thereby eliminating background noise interference between unrelated nodes in the communication network, enhancing the sparsity of the logical topology graph, and significantly reducing the computational cost of graph convolution operations. Softmax() normalization probabilistically processes the dependency strength of each row, ensuring it satisfies the distribution characteristics (i.e., the sum of elements in each row is 1), ensuring the numerical stability of the multilayer graph neural network during backpropagation. The generated adaptive adjacency matrix... It not only complies with the physical connection architecture of the network, but also incorporates the dynamic business coupling relationships mined from historical traffic.
[0053] Graph convolutional networks can be multi-layer graph convolutional networks, and the convolution propagation function of a multi-layer graph convolutional network is: In the formula, and They represent the first Layer and first The network node feature matrix of the layer, input layer That is, input data for the corresponding view. ; For the adaptive adjacency matrix, the degree matrix represents the adaptive adjacency matrix and is used to perform Laplacian normalization on the adaptive adjacency matrix to prevent feature magnitude explosion after multiple convolutions. Representing the The learnable weight matrix of the layer is used to perform linear transformation and dimension mapping on the aggregated neighbor node traffic patterns; It is a non-linear activation function used to give the model the ability to handle non-linear network topology relationships.
[0054] Graph convolutional networks, through stacking L layers of convolutional operations, enable the model to effectively aggregate information from first-order neighbors to higher-order neighbors, thereby achieving traffic situation awareness across the entire network.
[0055] Construction of the attention mechanism in S103.
[0056] The static topological features of the target network are obtained, and the static topological features and various dynamic topological state features are fused through an attention mechanism to obtain spatial fused features, including: Based on the physical structure of the target network, the topology vectors are obtained as the static topology features of the network through the Node2Vec graph representation learning algorithm. Static topological features As supplementary information to location encoding and physical constraints, it prevents the model from deviating from the real hardware architecture constraints during feature fusion; Calculate attention scores for views at each time scale. , in, Dynamic topological state features The linear transformation weight matrix, Static topological features The linear transformation weight matrix, For bias terms; This is the attention vector, used to map high-dimensional features to scalar scores; The hyperbolic tangent activation function is used to introduce nonlinear interactions and enhance the model's ability to fit nonlinear flow fluctuations. , , , These are learnable parameters; Based on the attention scores of each timescale view, calculate the normalized attention weights for each timescale view; The dynamic topological state features of each timescale view are adaptively weighted and summed, and static graph features are reinjected into the fusion result through residual connections to prevent the loss of topological structure information in the deep network, thus obtaining spatial fusion features. , In the formula, For layer normalization function, Static topological features Alignment projection matrix, To normalize the attention weights, the dynamics reflect the model's dependence on different time scales; It represents the Hadamah accumulation. For the first The dynamic topological state characteristics of a time-scale view, where n is the total number of time-scale views; These are learnable parameters.
[0057] The resulting spatial fusion features contain both multi-scale dynamic flow evolution patterns and robust physical topology information, providing a high-quality spatial embedding that is both flexible and physically robust for subsequent temporal coding.
[0058] The construction of the bidirectional state-space model in step S104.
[0059] Figure 3 The technical approach of the bidirectional state-space model is shown. First, the parameters of the state-space model are discretized. Then, the spatial fusion features are expanded and the forward and backward hidden states are updated separately. Finally, the output features are concatenated to obtain short-range time-series features.
[0060] Specifically, the state-space model used in this embodiment is initially defined in the continuous time domain, and its dynamic characteristic hidden state vector has the first derivative with respect to time. Characterizes the instantaneous rate of change of the hidden state.
[0061] In the formula, A is the state transition matrix, and B is the input driving matrix. It is a hidden state in continuous time. For continuous-time systems.
[0062] Since the network input, when expanded along the time dimension, becomes a discrete-time series, the continuous parameters A and B of the state-space model need to be transformed into parameters suitable for discrete-time inference using the Zero-Order Hold (ZOH) principle. The transformation formula is as follows: In the formula, The state transition matrix is a discretized representation. The input driving matrix is discretized. The time step parameter is a learnable parameter. is the identity matrix; A and B are learnable parameters.
[0063] After obtaining the discretization parameters A and B, the spatial fusion features are... Expanding along the time dimension yields a feature sequence with T time steps. A bidirectional hidden state update is then performed on the obtained feature sequence to fully utilize global temporal context information. Discrete-time hidden state update equation In the formula, Let be the hidden state at time step t. This represents the hidden state at time step (t-1). Let be the feature of the input sequence at time step t.
[0064] Spatial integration features After unfolding, according to The hidden states are updated sequentially to model the causal influence of historical moments on the current moment, capturing the positive temporal dependence of the traffic sequence. The hidden state is updated sequentially backward, incorporating contextual information from future timeframes to enhance the global representation capability of the current timeframe features. The forward and backward output features are then concatenated to obtain short-range temporal features. .
[0065] Construction of the sparse self-attention model in step S105.
[0066] By using a sparse self-attention model to extract long-range temporal features from spatial fusion features, long-distance temporal dependencies in traffic sequences can be captured, thus overcoming the limitations of bidirectional state-space models in long-range modeling.
[0067] Figure 3 The technical route of the sparse self-attention model is shown. Spatial fusion features are sequentially transformed by linear transformation, sparse sampling and attention calculation to obtain long-range temporal features.
[0068] Specifically, to reduce computational complexity, this embodiment employs a sparse sampling strategy. Specifically, the input features are linearly transformed and a sparse sampling strategy is used to compute only the query-key pairs with the highest attention scores, resulting in a sparse query matrix. sparse bond matrix The AND-value matrix V is used to generate a sparse query matrix. sparse bond matrix The three sets of learnable linear projection weight matrices of the sum matrix V are learned during subsequent training.
[0069] Calculate long-range time series characteristics , In the formula, As a scaling factor, it can pull the values back to the gradient-sensitive range, ensuring that the model can be trained normally.
[0070] As an optional implementation approach, a multi-head self-attention mechanism can be further adopted on the basis of the above sparse attention to capture the correlation between time steps that are far apart in the sequence. Those skilled in the art can choose to implement it themselves, and it will not be elaborated here.
[0071] Construction of the adaptive gating network in step S106.
[0072] After processing with the bidirectional state-space model and the sparse self-attention model, short-range time-series features focusing on local evolution and bidirectional causal inference were obtained, respectively. And long-range temporal features that focus on global long-range dependencies and pattern matching. Adaptive gating networks are used to dynamically integrate these two types of complementary features. After learning, adaptive gating networks can automatically determine the relative importance of local inference and global matching based on the current feature context.
[0073] Figure 3 The technical approach of adaptive gating network is shown. Short-range and long-range time-series features are concatenated and then activated to obtain gating coefficients g. Then, the short-range and long-range time-series features are weighted and summed according to the gating coefficients g to obtain spatiotemporal fusion features.
[0074] Specifically, the vector is first concatenated with the vector along the feature channel dimension to obtain a combined vector containing complete spatiotemporal information. This combined vector is then input to a linear projection layer and mapped to the (0, 1) interval using a Sigmoid activation function to obtain the gating coefficients. , In the formula, is the Sigmoid function. For learnable weight matrix, This is a learnable bias term. The closer the value is to 1, the more the model tends to rely on the local evolution trend extracted by the bidirectional state-space model at the current moment; The closer the value is to 0, the more the model tends to utilize the global historical patterns extracted by the sparse self-attention model.
[0075] Then, based on the calculated gating coefficients For short-range time series characteristics With long-range time series characteristics Element-wise dynamic weighted summation is performed. Furthermore, to ensure the stability of the feature distribution, the fused result is subjected to layer normalization: In the formula, This indicates element-wise multiplication. Through this adaptive soft-switching mechanism, the model can capture cyclical patterns using global attention during periods of stable network data, and capture instantaneous dynamics using a state-space model during periods of data mutation, ultimately generating... This refers to highly robust spatiotemporal fusion characteristics.
[0076] The construction of the feedforward neural network in step S107.
[0077] In practice, the first layer of the feedforward neural network amplifies or preserves the dimensionality of the spatiotemporal fusion features output by the adaptive gating network, and then enhances the nonlinear expressive power through an activation function. In the formula, The intermediate features are ReLU(), which is the activation function. The spatiotemporal fusion features are the input. The weight matrix is a learnable matrix. It is a learnable bias vector; The second layer of the feedforward neural network maps the dimensions of the intermediate features to the dimensions of the prediction target: For the target network Each node in the future The state value at each time step The weight matrix is a learnable matrix. It is a learnable bias vector.
[0078] End-to-end training process: Forward propagation computes the predicted output. The pre-divided batch training data is input into the constructed network traffic prediction model. It first passes through the constructed graph convolutional network and attention mechanism, then the bidirectional state space model and sparse self-attention model are input in parallel, and then through an adaptive gating network. Finally, the prediction results of the node network traffic state for the next many steps are obtained through the feedforward neural network.
[0079] Calculate the total loss function. Using the error between the multi-step predicted values of network traffic and the actual labels as the optimization objective, the mean absolute error (MAE) or mean squared error (MSE) is used as the loss function to calculate the cumulative error of the current batch of data at all prediction time steps. This accurately quantifies the degree to which the model's predicted values deviate from the actual physical traffic, guiding the update of the parametric model parameters.
[0080] Backpropagation and gradient calculation. The backpropagation algorithm backpropagates the loss gradient to all learnable parameters of the model. These learnable parameters include the embedding dictionary, weight matrix, bias term, attention vector, and learnable time step designed for each module.
[0081] Parameter update. The Adam optimizer is used, combined with a dynamic learning rate decay mechanism, to uniformly update all the learnable parameters based on the calculated gradient, so that the model iteratively optimizes in the direction of reducing loss and improving prediction accuracy.
[0082] Iterative convergence and model saving. Repeat the forward propagation, loss calculation, backpropagation, and parameter update processes described above. To improve the model's generalization ability and prevent overfitting, an early stopping strategy is introduced during training. After each training epoch, the model performance is evaluated on an independent validation set. If the loss on the validation set does not show a significant decrease within a set patience value (15 epochs), the early stopping mechanism is triggered to terminate training prematurely. After training, the optimal model weight parameters from the validation set are saved for subsequent real-time multi-step traffic prediction in complex online network environments.
[0083] Example 3 This embodiment provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements a network traffic prediction method.
[0084] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device.
[0085] A processor is used to execute computer execution instructions stored in memory to implement a network traffic prediction method; wherein, the processor may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application, and the processor implements the network traffic prediction method by running instructions stored in memory.
[0086] Example 4 This embodiment is a further development based on the above embodiments. For parts not described in detail in this embodiment, please refer to the relevant content in other embodiments.
[0087] This embodiment provides a network traffic prediction device, such as... Figure 4 As shown, the network traffic prediction device in this embodiment includes: a data acquisition module, a convolution processing module, a fusion processing module, a short-range feature extraction module, a long-range feature extraction module, a gating module, and a prediction output module.
[0088] The data acquisition module is used to acquire network state datasets of the target network at multiple time scales; each network state dataset includes network state data of each node in the target network. The convolutional processing module is used to perform spatial feature aggregation on the network state dataset of each time scale view through a graph convolutional network, and extract the dynamic topological state features corresponding to each time scale view. The network parameters of the graph convolutional network include an adaptive adjacency matrix, which is obtained by multiplying the source node embedding and the target node embedding of the corresponding time scale view by the transpose. The fusion processing module is used to acquire the static topological features of the target network and fuse the static topological features and various dynamic topological state features through an attention mechanism to obtain spatial fusion features. The short-range feature extraction module is used to extract short-range temporal features based on spatial fusion features through a bidirectional state-space model. The long-range feature extraction module is used to extract long-range temporal features based on spatial fusion features using a sparse self-attention model. The gating module is used to fuse short-range and long-range time-series features through an adaptive gating network to obtain spatiotemporal fusion features; The prediction output module is used to predict the node states of the target network based on spatiotemporal fusion features.
[0089] As an optional implementation, the network traffic prediction device also includes a raw data acquisition and preprocessing module.
[0090] Raw data acquisition is used to obtain historical network state data of each node in the target network to form a spatiotemporal sequence dataset.
[0091] The preprocessing module is used to cyclically extract fragments of data from the spatiotemporal sequence dataset at different time steps to obtain network state datasets with multiple time scale views.
[0092] The order of the above embodiments of the present invention is merely for description and does not represent the superiority or inferiority of the embodiments.
[0093] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0094] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of modules described above can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules 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 modules, and may be electrical or other forms.
[0095] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A network traffic prediction method, characterized in that, Applied to data networks to capture long-range logical coupling mechanisms between network nodes and the inducing characteristics of sudden traffic storms, including: Obtain network state datasets of multiple time-scale views of the target network; each network state dataset includes network state data of each node in the target network; the network state data includes traffic sent to other nodes and traffic received from other nodes; For the network state dataset of each timescale view, spatial features are aggregated using a graph convolutional network to extract the dynamic topological state features corresponding to each timescale view. The network parameters of the graph convolutional network include an adaptive adjacency matrix, which is obtained by multiplying the source node embedding and the target node embedding of the corresponding timescale view by the transpose. The source node embedding represents the characteristics of the traffic sent by the current node to other nodes under the corresponding timescale view, and the target node embedding represents the characteristics of the traffic received by the current node from other nodes under the corresponding timescale view. The static topology features of the target network are obtained, and the static topology features and each of the dynamic topology state features are fused through an attention mechanism to obtain spatial fusion features; the spatial fusion features contain both multi-scale dynamic traffic evolution patterns and retain robust physical topology information. Based on the spatial fusion characteristics, short-range temporal features are extracted using a bidirectional state-space model; Based on the spatial fusion characteristics, long-range temporal features are extracted using a sparse self-attention model; By using an adaptive gating network, the short-range time series features and the long-range time series features are fused to obtain spatiotemporal fusion features; Predict the node states of the target network based on the spatiotemporal fusion features; The process of obtaining the static topological features of the target network and fusing the static topological features and each of the dynamic topological state features through an attention mechanism to obtain spatial fusion features includes: Based on the physical structure of the target network, topology vectors are obtained as static topology features of the network using the Node2Vec graph representation learning algorithm. ; Calculate attention scores for views at each time scale. , in, For the first The dynamic topological state characteristics of each time-scale view. for The linear transformation weight matrix, for The linear transformation weight matrix, For bias terms, For attention vectors, It is the hyperbolic tangent activation function; Calculate the normalized attention weights for each timescale view based on the attention scores for each timescale view. The dynamic topological state features of the views at each time scale are adaptively weighted and summed, and static graph features are then reinjected into the fusion result through residual connections to obtain spatial fusion features. , in, For layer normalization function, for Alignment projection matrix, To normalize attention weights, It represents the Hadamah accumulation. For the first The dynamic topological state characteristics of a time-scale view, where n is the total number of time-scale views; The method of fusing the short-range and long-range time-series features through an adaptive gating network to obtain spatiotemporal fusion features includes: The short-range time-series features and the long-range time-series features are concatenated along the feature channel dimension to obtain a combined vector; The combined vector is input into a linear projection layer and mapped to the (0, 1) interval using a Sigmoid activation function to obtain the gating coefficients. ; in, For the Sigmoid function, This is the weight matrix. It is a short-range time series characteristic. For long-range time series characteristics, For bias terms; Based on the calculated gating coefficient The spatiotemporal fusion features are obtained by performing element-wise dynamic weighted summation and layer normalization on the short-range and long-range time-series features. ; in, This indicates element-wise multiplication. For layer normalization.
2. The network traffic prediction method as described in claim 1, characterized in that, Also includes: Acquire historical network state data of each node in the target network to form a spatiotemporal sequence dataset; From the spatiotemporal sequence dataset, fragment data is cyclically extracted at different time steps to obtain network state datasets with multiple time scale views.
3. The network traffic prediction method as described in claim 1, characterized in that, The network state dataset consists of at least three datasets, corresponding to at least three time scales: short-term, daily, and weekly / monthly.
4. The network traffic prediction method as described in claim 1, characterized in that, The extraction of short-range temporal features based on the spatial fusion features using a bidirectional state-space model includes: The spatial fusion feature Expanding along the time dimension yields the input feature sequence; According to the discrete-time hidden state update equation, the input feature sequence is calculated in a forward-to-back order to obtain the forward feature sequence; According to the discrete-time hidden state update equation, the input feature sequence is calculated in reverse order to obtain the backward feature sequence; The forward feature sequence and the backward feature sequence are concatenated to obtain short-range time-series features. ; The discrete-time hidden state update equation is as follows: in, Let be the hidden state at time step t. This represents the hidden state at time step (t-1). The features are at the t-th time step of the input feature sequence; in, The state transition matrix is a discretized representation. The input driving matrix is discretized. Let A be the time step parameter, B be the state transition matrix, and C be the input driving matrix. It is an identity matrix.
5. The network traffic prediction method as described in claim 1, characterized in that, The extraction of long-range temporal features based on the spatial fusion features using a sparse self-attention model includes: The spatial fusion features are linearly transformed and a sparse sampling strategy is applied to obtain a sparse query matrix. sparse bond matrix AND-value matrix V; The long-range time-series characteristics are: , in, This is the scaling factor.
6. The network traffic prediction method as described in claim 1, characterized in that, The method of predicting the node state of the target network based on the spatiotemporal fusion features includes: inputting the spatiotemporal fusion features into a trained feedforward neural network to obtain the predicted node state values of the target network; The feedforward neural network is a two-layer fully connected network. The first layer performs a nonlinear transformation on the spatiotemporal fusion features through an activation function to obtain intermediate features. The second layer maps the intermediate features to the prediction target time step to obtain the node state prediction value.
7. An electronic device, characterized in that, The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the network traffic prediction method according to any one of claims 1-6.
8. A network traffic prediction device, characterized in that, A method for performing network traffic prediction according to any one of claims 1-6, comprising: The data acquisition module is used to acquire network state datasets of multiple views of the target network at different time scales; each network state dataset includes network state data of each node of the target network. The convolutional processing module is used to perform spatial feature aggregation on the network state dataset for each time scale view through a graph convolutional network, and extract the dynamic topological state features corresponding to each time scale view; the network parameters of the graph convolutional network include an adaptive adjacency matrix, which is obtained by multiplying the source node embedding and the target node embedding of the corresponding time scale view by the transpose. The fusion processing module is used to acquire the static topological features of the target network and fuse the static topological features and each of the dynamic topological state features through an attention mechanism to obtain spatial fusion features; The short-range feature extraction module is used to extract short-range temporal features based on the spatial fusion features through a bidirectional state-space model. The long-range feature extraction module is used to extract long-range temporal features based on the spatial fusion features using a sparse self-attention model. The gating module is used to fuse the short-range time series features and the long-range time series features through an adaptive gating network to obtain spatiotemporal fusion features; The prediction output module is used to predict the node states of the target network based on the spatiotemporal fusion features.