A network congestion prediction method and an electronic device
By constructing spatiotemporal dual-dimensional features and using an attention mechanism decoder to adjust feature values, the problem of lack of proactive prediction in RDMA networks is solved, enabling proactive prediction and early perception of network congestion trends.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LANGCHAO ELECTRONIC INFORMATION IND CO LTD
- Filing Date
- 2026-06-16
- Publication Date
- 2026-07-14
AI Technical Summary
In existing RDMA networks, there is a lack of proactive prediction capabilities for changes in network state, which makes it impossible to detect and prevent congestion problems in advance.
By collecting the temporal and spatial features of the target network, encoding them using a temporal feature encoder and a spatial feature encoder, and fusing them into a spatiotemporal fusion feature, and then adjusting the feature values through an attention mechanism decoder, proactive prediction of network congestion can be achieved.
It enables proactive prediction of network congestion trends, allowing for early detection of congestion risks before congestion occurs, thus improving the accuracy and robustness of congestion prediction.
Smart Images

Figure CN122395075A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a network congestion prediction method and an electronic device. Background Technology
[0002] With the rapid development of fields such as artificial intelligence, high-performance computing, and cloud computing, the demands for low latency and high throughput in network transmission are becoming increasingly stringent. Remote Direct Memory Access (RDMA) technology, with its kernel bypass and zero-copy characteristics, has become a core transmission technology in high-performance network scenarios. However, as network scale expands and traffic types diversify, congestion problems in RDMA networks are becoming increasingly prominent.
[0003] In related technologies, congestion detection is performed using a single real-time metric, such as queue length detection based on Explicit Congestion Notification (ECN) or delay detection based on Round-Trip Time (RTT). These schemes can only passively trigger regulation after congestion occurs, lacking the ability to proactively predict changes in network status. Summary of the Invention
[0004] This invention provides a network congestion prediction method and an electronic device to at least address the problem of the lack of proactive prediction capability for network state changes in related technologies.
[0005] This invention provides a network congestion prediction method, comprising: collecting operational data of a target network; constructing temporal and spatial features based on the operational data; wherein the temporal features characterize the changes in the link status of the target network over time, and the spatial features characterize the correlation between different nodes or links in the target network; encoding the temporal features using a temporal feature encoder to obtain a temporal feature vector, and encoding the spatial features using a spatial feature encoder to obtain a spatial feature vector; concatenating the temporal and spatial feature vectors to obtain a spatiotemporal fusion feature; adjusting the feature values of each feature dimension in the spatiotemporal fusion feature according to the importance of each feature dimension for congestion prediction using an attention mechanism decoder to obtain an adjusted spatiotemporal fusion feature; and determining the congestion prediction result based on the adjusted spatiotemporal fusion feature.
[0006] This invention also provides a network congestion prediction device, comprising: a construction unit for collecting operational data of a target network and constructing temporal and spatial features based on the operational data; wherein the temporal features characterize the changes in the link status of the target network over time, and the spatial features characterize the correlation between different nodes or links in the target network; an encoding unit for encoding the temporal features using a temporal feature encoder to obtain a temporal feature vector, and encoding the spatial features using a spatial feature encoder to obtain a spatial feature vector; a splicing unit for splicing the temporal feature vector and the spatial feature vector to obtain a spatiotemporal fusion feature; an adjustment unit for adjusting the feature values of each feature dimension in the spatiotemporal fusion feature according to the importance of each feature dimension in the spatiotemporal fusion feature for congestion prediction using an attention mechanism decoder to obtain an adjusted spatiotemporal fusion feature; and a determination unit for determining the congestion prediction result based on the adjusted spatiotemporal fusion feature.
[0007] The present invention also provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described network congestion prediction methods.
[0008] The present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described network congestion prediction methods.
[0009] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described network congestion prediction methods.
[0010] This invention constructs a spatiotemporal dual-dimensional feature model by simultaneously collecting temporal and spatial features of the target network. This model characterizes the evolution of link states over time and the correlations between different nodes or links within the network. Based on this, a temporal feature encoder and a spatial feature encoder encode the two types of features respectively and fuse them into a spatiotemporal fusion feature. Then, an attention mechanism decoder adjusts the feature values of each feature dimension according to its importance for congestion prediction. Finally, the congestion prediction result is determined based on the adjusted spatiotemporal fusion feature. This invention comprehensively depicts the network's operational state from both spatiotemporal dimensions, enabling congestion prediction to go beyond the real-time indicators of a single link and integrate historical time-series trends with topological spatial correlations. The attention mechanism decoder dynamically adjusts feature values according to the importance of each feature dimension for congestion prediction, allowing the model to focus on features that are more representative of congestion prediction. Therefore, this invention achieves proactive prediction of network congestion trends, enabling the early detection of congestion risks before they occur. Attached Figure Description
[0011] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a flowchart of a network congestion prediction method provided in an embodiment of the present invention.
[0013] Figure 2 A flowchart of another network congestion prediction method provided in an embodiment of the present invention.
[0014] Figure 3 This is an architecture diagram of an application embodiment of the present invention.
[0015] Figure 4 This is a structural diagram of an LSTM model provided in an application embodiment of the present invention.
[0016] Figure 5 This is a structural diagram of a network congestion prediction device provided in an embodiment of the present invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0018] It should be noted that, in the description of this invention, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., used in this invention are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0019] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0020] The specific application environment architecture or specific hardware architecture on which the network congestion prediction method depends is described here.
[0021] This invention provides a network congestion prediction method, and the method is described in detail below, along with its execution flow. See also... Figure 1 The present invention provides a flowchart of a network congestion prediction method.
[0022] S101: Collect operational data of the target network and construct time-dimensional and spatial-dimensional features based on the operational data; among them, the time-dimensional features are used to characterize the changes in the link status of the target network over time, and the spatial-dimensional features are used to characterize the correlation between different nodes or links in the target network.
[0023] The target network can be a network built using RDMA technology. Operational data refers to various performance counters and status parameters collected in real time from network devices (such as switches and server network cards). Time-dimensional characteristics are a set of indicators used to describe the dynamic changes of a single communication link at different times, reflecting the evolution of link load, latency fluctuations, etc., over time. Spatial-dimensional characteristics are a set of indicators used to describe the mutual influence between different nodes or links in the network topology, reflecting the characteristics of congestion propagation and diffusion in the network.
[0024] In this step, a data acquisition module is first deployed on the switches or terminal devices of the target network to periodically collect various operational data at a preset sampling frequency. Then, the collected raw data undergoes feature engineering to construct temporal and spatial features. Temporal features focus on the historical evolution trajectory of a single link, such as the gradual increase in link utilization and the escalating trend of latency fluctuations. This information helps capture gradual signals before congestion occurs. Spatial features focus on the lateral relationships in the network topology, such as the mutual influence between multiple ports under the same switch chip and the congestion propagation paths between adjacent links. This information helps identify the risk of congestion spread. By constructing both types of features simultaneously, a more comprehensive information foundation is provided for subsequent congestion prediction than a single indicator.
[0025] S102: The temporal feature vector is obtained by encoding the temporal dimension features through the temporal feature encoder, and the spatial feature vector is obtained by encoding the spatial dimension features through the spatial feature encoder.
[0026] The temporal feature encoder is a neural network model specifically designed for processing time-series data. Its core function is to extract higher-level temporal dependencies from the original temporal dimension features. The spatial feature encoder is a neural network model designed for processing spatially correlated data. Its core function is to extract higher-level spatial correlation features from the original spatial dimension features. The temporal feature vector is the numerical vector representation of temporal patterns output by the temporal feature encoder, and the spatial feature vector is the numerical vector representation of spatial correlation patterns output by the spatial feature encoder.
[0027] In this step, the temporal dimension features are input into the temporal feature encoder, which automatically learns the dependencies in the temporal dimension, such as how the link state at past moments affects the state at present and future moments, thus outputting a compact temporal feature vector. Simultaneously, the spatial dimension features are input into the spatial feature encoder, which automatically learns the correlations in the spatial dimension, such as how the queue states of multiple ports affect each other and how congestion is propagated between adjacent links, thus outputting a compact spatial feature vector. Through separate encoding, the information in the temporal and spatial dimensions is transformed into a vector representation in a unified format, facilitating subsequent fusion processing.
[0028] S103: Concatenate the temporal feature vector with the spatial feature vector to obtain the spatiotemporal fusion feature.
[0029] Among them, the spatiotemporal fusion feature is a high-dimensional vector that integrates temporal and spatial information. It includes both the dynamic laws of the evolution of a single link over time and the spatial correlation characteristics between different nodes or links in the network topology.
[0030] In this step, the temporal and spatial feature vectors are concatenated end-to-end along their dimensionality to form a higher-dimensional spatiotemporal fusion feature. For example, if the temporal feature vector has a dimension of 256 and the spatial feature vector has a dimension of 64, the resulting spatiotemporal fusion feature will have a dimension of 320. Through this concatenation operation, temporal and spatial information are integrated into a single feature representation, enabling subsequent processing modules to utilize both types of information simultaneously for congestion prediction. This fusion method preserves the complete information of both temporal and spatial features, avoiding information loss.
[0031] S104: The attention mechanism decoder adjusts the feature values of each feature dimension in the spatiotemporal fusion feature according to the importance of each feature dimension in congestion prediction to obtain the adjusted spatiotemporal fusion feature.
[0032] The attention mechanism decoder is a neural network module based on the attention mechanism. Its core function is to evaluate the importance of each dimension of the input features to the prediction task and dynamically adjust the feature values of each dimension based on the evaluation results. The adjusted spatiotemporal fusion features are feature vectors after the above adjustment process, in which feature dimensions that are more valuable for congestion prediction are enhanced, while feature dimensions that contribute less to the prediction are weakened.
[0033] In this step, the spatiotemporal fusion features are input into the attention mechanism decoder. The attention mechanism decoder first evaluates the importance of each feature dimension in the spatiotemporal fusion features to congestion prediction, and then dynamically adjusts the feature values of each feature dimension based on the evaluation results. After the above adjustment, the feature values of features strongly correlated with congestion precursors (such as rapid queue growth, increased latency jitter, etc.) are enhanced, while features weakly correlated with congestion are weakened. This dynamic adjustment mechanism enables the model to adaptively adjust the feature representation according to the current network state, thereby improving the accuracy and robustness of congestion prediction.
[0034] As a feasible implementation method, the attention mechanism decoder adjusts the feature values of each feature dimension in the spatiotemporal fusion feature according to the importance of each feature dimension to congestion prediction to obtain the adjusted spatiotemporal fusion feature. This includes: in the attention mechanism decoder, determining the importance score corresponding to each feature dimension in the spatiotemporal fusion feature; wherein, the importance score is used to characterize the importance of the corresponding feature dimension to congestion prediction; and using the importance scores corresponding to each feature dimension to perform weighted processing on each feature dimension in the spatiotemporal fusion feature to obtain the adjusted spatiotemporal fusion feature.
[0035] In practical implementation, the attention mechanism decoder first determines the importance score corresponding to each feature dimension in the spatiotemporal fusion feature. This importance score is used to quantify the importance of the corresponding feature dimension for congestion prediction. Then, the importance scores of each feature dimension are used to weight each feature dimension in the spatiotemporal fusion feature, that is, the feature dimension with a higher importance score has a larger weight in the fusion feature, and the feature dimension with a lower importance score has a smaller weight. This achieves differentiated adjustment of different feature dimensions, resulting in the adjusted spatiotemporal fusion feature.
[0036] As a feasible implementation method, determining the importance score corresponding to each feature dimension in the spatiotemporal fusion feature includes: inputting the spatiotemporal fusion feature into a batch normalization layer for normalization processing to obtain the normalized spatiotemporal fusion feature; mapping the normalized spatiotemporal fusion feature to a query vector through a learnable query weight matrix and query bias term, and mapping the normalized spatiotemporal fusion feature to a key vector through a learnable key weight matrix and key bias term; obtaining the original importance score corresponding to each feature dimension by calculating the similarity between the query vector and the key vector; normalizing the original importance score corresponding to each feature dimension to obtain the importance score corresponding to each feature dimension; accordingly, weighting each feature dimension in the spatiotemporal fusion feature using the importance score corresponding to each feature dimension to obtain the adjusted spatiotemporal fusion feature, including: weighting each feature dimension in the normalized spatiotemporal fusion feature using the importance score corresponding to each feature dimension to obtain the weighted spatiotemporal fusion feature; inputting the weighted spatiotemporal fusion feature into a unidirectional long short-term memory network to obtain the adjusted spatiotemporal fusion feature.
[0037] Batch normalization layers are a standardization technique used in neural network training and inference. Their function is to adjust the input feature distribution to zero mean and unit variance, eliminating dimensional differences and numerical range differences between different features, and avoiding the curse of dimensionality caused by data sparsity in high-dimensional feature spaces. Query vectors and key vectors are two core elements in the attention mechanism: the query vector represents the content features that the current prediction task needs to focus on, and the key vector represents the attribute features of each feature dimension in the input features. Similarity measures the degree of matching between the query vector and the key vector, reflecting the importance of each feature dimension to the current prediction task. The importance score is the normalized similarity value, ranging from 0 to 1, representing the overall weight proportion of each feature item. Unidirectional Long Short-Term Memory (LSTM) networks are a special type of recurrent neural network used to capture short-term trends of features over time.
[0038] In this implementation, the spatiotemporal fusion features are first batch normalized to make the feature distribution more uniform and the gradient update more stable, avoiding gradient explosion or vanishing problems caused by high dimensionality and improving model training efficiency. Then, the normalized features are mapped to query vectors using a learnable query weight matrix and query bias term, and simultaneously mapped to key vectors using a learnable key weight matrix and key bias term. Next, the similarity between the query vector and the key vector is calculated to obtain the original feature importance score, and the original feature importance scores for each feature dimension are normalized to obtain the importance score for each feature dimension. The physical meaning of the importance score is: the degree of contribution of each feature dimension to congestion prediction under the current network state. For example, when the network is close to congestion, the weights of features related to ECN label frequency and queue occupancy rate will increase significantly. Then, the original normalized features are weighted and scaled feature by feature using the importance score; features with high weights are amplified, and features with low weights are reduced, allowing the model to focus on key features. Finally, the weighted features are input into a unidirectional long short-term memory network to capture the changing trends of the features in a short period of time and output the enhanced spatiotemporal fusion features.
[0039] As can be seen, this implementation solves the problem of dimensional differences in high-dimensional features through batch normalization, achieves adaptive feature selection through dynamically calculated attention weights, and further extracts short-term trend information of features through a unidirectional long short-term memory network, providing higher quality feature representation for subsequent congestion prediction.
[0040] As a feasible implementation method, the query weight matrix, query bias term, key weight matrix, and key bias term are learnable parameters that are iteratively updated through backpropagation.
[0041] Learnable parameters refer to the parameters that are continuously adjusted and optimized during model training using the backpropagation algorithm. Their initial values can be randomly set, and they are continuously updated as training data is input and the loss function is calculated, gradually improving the model's predictive performance. Backpropagation is a neural network training algorithm based on gradient descent, which updates parameter values along the gradient descent direction by calculating the partial derivatives of the loss function with respect to each parameter.
[0042] In this implementation, the query weight matrix, query bias term, key weight matrix, and key bias term are not fixed constants, but learnable parameters that are iteratively updated through backpropagation during model training. During the training phase, a large amount of historical network data labeled with congestion states is used to calculate the difference between the model's predictions and the true labels (i.e., the loss value). Then, the loss value is backpropagated layer by layer using the backpropagation algorithm to update all learnable parameters, including these weight matrices and bias terms. After sufficient training, these parameters enable the model to automatically learn feature priorities under different congestion stages based on different input features. During the inference phase, using the trained parameters, the model can calculate the query vector and key vector in real time based on the current input features, thereby obtaining dynamic weights that change with the link state.
[0043] As can be seen, this implementation method enables the model to automatically learn congestion prediction knowledge from historical data through backpropagation and iterative updates of learnable parameters, and adjusts feature weights in real time according to the current network state, thus achieving true dynamic weight allocation. Compared with fixed weight schemes, this significantly improves the ability to identify congestion precursors.
[0044] S105: Determine congestion prediction results based on adjusted spatiotemporal fusion features.
[0045] Among them, the congestion prediction result refers to the judgment on whether congestion will occur in the target network within a specific time window in the future.
[0046] In this step, the adjusted spatiotemporal fusion features are input into the prediction output layer, which maps the high-dimensional enhanced features to specific congestion state categories and outputs the final prediction result. The prediction result can be presented in various forms, such as binary classification (congested or not congested), ternary classification (no congestion, congestion precursors, congested), or continuous values (congestion probability or congestion intensity). Based on this prediction result, the network control system can take corresponding congestion control measures in advance, such as adjusting the transmission rate, changing the routing path, and triggering priority scheduling, thereby proactively intervening before congestion actually occurs.
[0047] As a feasible implementation method, the congestion prediction result is determined based on the adjusted spatiotemporal fusion features, including: mapping the enhanced spatiotemporal fusion features to a dimension vector with the same number of congestion state categories through a fully connected layer; normalizing the dimension vector to obtain the probability distribution of each congestion state; and selecting the congestion state with the highest probability as the congestion prediction result based on the probability distribution of each congestion state.
[0048] A fully connected layer is a neural network layer in which each neuron is connected to all dimensions of the input vector, used to linearly map input features to the output space. Congestion state categories refer to predefined congestion levels, including three categories: no congestion, congestion precursors, and congested. No congestion indicates that the link is idle or stable, and the queue length is normal; congestion precursors indicate that queues are starting to form but are not yet completely blocked, serving as an early warning signal of impending congestion; congested indicates severe queue backlog, link blockage, and a significant decrease in data transmission performance. The probability distribution refers to the likelihood of each congestion state predicted by the model, with the sum of the probabilities of all categories being 1.
[0049] In this implementation, the adjusted spatiotemporal fusion features are first input into a fully connected layer. The output dimension of this fully connected layer is equal to the number of congestion state categories, i.e., 3-dimensional, corresponding to the original scores of the three categories: no congestion, congestion precursors, and congested. Then, a flexible maximum function is applied to normalize these three scores, converting them into three probability values between 0 and 1, summing to 1. These represent the probability of no congestion, congestion precursors, or congestion occurring within a preset time window. Finally, the category with the highest probability value is selected as the final congestion prediction result. For example, if the model outputs three probabilities: no congestion 0.1, congestion precursors 0.75, and congested 0.15, then the highest probability, congestion precursors, is taken as the prediction result, indicating that the model judges the network will enter a congestion precursor state within approximately 5 milliseconds.
[0050] The network congestion prediction method provided in this invention constructs a spatiotemporal dual-dimensional feature set by simultaneously collecting temporal and spatial features of the target network. This feature set characterizes the evolution of link states over time and the correlations between different nodes or links in the network. Based on this, a temporal feature encoder and a spatial feature encoder encode and fuse the two types of features into a spatiotemporal fusion feature set. Then, an attention mechanism decoder adjusts the feature values of each feature dimension according to its importance to congestion prediction. Finally, the congestion prediction result is determined based on the adjusted spatiotemporal fusion feature set. This invention comprehensively depicts the network's operational state from both spatiotemporal dimensions, enabling congestion prediction to go beyond the real-time indicators of a single link and integrate historical time-series trends with topological spatial correlations. The attention mechanism decoder dynamically adjusts feature values according to the importance of each feature dimension to congestion prediction, allowing the model to focus on features that are more representative of congestion prediction. Therefore, this invention achieves proactive prediction of network congestion trends, enabling the detection of congestion risks before they occur.
[0051] This invention discloses a network congestion prediction method. Compared to the previous embodiment, this embodiment further explains and optimizes the technical solution. For details, please refer to... Figure 2 The flowchart of another network congestion prediction method provided in this embodiment of the invention.
[0052] S201: Collect the operational data of the target network, and construct the time dimension features corresponding to the first time window and the spatial dimension features corresponding to the second time window based on the operational data.
[0053] The first time window is the length of the time interval used to construct time-dimensional features. Due to the rapid changes in network traffic, the first time window is set to be relatively short to capture rapid changes in traffic. The second time window is the length of the time interval used to construct spatial-dimensional features. Since spatial features such as port queues and adjacent links change relatively slowly, the second time window can be set to be relatively long.
[0054] In this step, the lengths of the first and second time windows are first determined, with the first time window being shorter than the second. Then, according to the period of the first time window, the temporal dimension features corresponding to that window are collected and calculated within each first time window. Simultaneously, according to the period of the second time window, the spatial dimension features corresponding to that window are collected and calculated within each second time window. This differentiated time window design allows the temporal dimension features to be captured at a higher rate.
[0055] As a feasible implementation method, the time dimension features include any one or a combination of any of the following: link bandwidth utilization, round-trip time jitter, congestion marking frequency, and transmission window change rate.
[0056] Link bandwidth utilization refers to the ratio of the actual bandwidth used by the link to the total bandwidth of the link, reflecting the link's load level. Round-Trip Time Jitter is the standard deviation of the Round-Trip Time (RTT), reflecting the degree of latency fluctuation and serving as a strong signal of impending congestion. Congestion Marking Frequency refers to the number of times a switch performs Explicit Congestion Notification (ECN) marking on data packets per unit time, directly reflecting the degree of congestion in the switch's queue. Transmission Window Change Rate is the ratio of the current transmission window size to the transmission window size at the previous moment, reflecting the extent of the sender's adjustment to the traffic rate.
[0057] In this embodiment, the time dimension feature can include any one or more of the four features mentioned above. The specific features included can be selected based on the actual application scenario and computing resources. For example, in scenarios with sufficient computing resources, all four features can be collected simultaneously to obtain the most comprehensive time-series information; on edge devices with limited computing resources, one or two of the most critical features can be selected to reduce computational overhead.
[0058] As a feasible implementation method, operational data of the target network is collected, and time-dimensional features corresponding to the first time window are constructed based on the operational data. These features include: collecting the actual bandwidth used by the link and the total bandwidth within the fourth time window every first time window, calculating the ratio of the actual bandwidth used by the link to the total bandwidth to obtain the link bandwidth utilization rate, and / or collecting the round-trip delay within the fourth time window every first time window, calculating the standard deviation of the round-trip delay to obtain the round-trip delay jitter value, and / or collecting the number of times the switch performs explicit congestion marking on data packets per unit time, calculating the average number of explicit congestion markings within the first time window to obtain the congestion marking frequency, and calculating the ratio of the current sending window size to the previous sending window size every first time window to obtain the sending window change rate; and constructing time-dimensional features corresponding to the first time window based on the link bandwidth utilization rate, and / or the round-trip delay jitter value, and / or the congestion marking frequency, and / or the sending window change rate.
[0059] The fourth time window is a time interval used to calculate specific characteristic indicators. Its length can be equal to or different from the first time window. In this embodiment, the fourth time window is used to collect the raw data required to calculate link bandwidth utilization and round-trip time jitter. The sending window refers to the maximum amount of data that the sender is currently allowed to send at once but has not yet been acknowledged.
[0060] In this embodiment, the link bandwidth utilization rate is constructed as follows: at the beginning of each first time window, the actual bandwidth used by the link and the total physical bandwidth of the link within the fourth time window are collected, the ratio of the actual bandwidth used to the total bandwidth is calculated, and the ratio is averaged to obtain the link bandwidth utilization rate. The round-trip delay jitter value is constructed as follows: at the beginning of each first time window, multiple round-trip delay samples are collected within the fourth time window, and the standard deviation of these samples is calculated to obtain the round-trip delay jitter value. The congestion marking frequency is constructed as follows: the number of times the switch performs ECN marking on data packets per unit time (e.g., 1 millisecond) is counted, and then the average of these counts within each first time window is calculated. The sending window change rate is constructed as follows: at the beginning of each first time window, the size of the current sending window is obtained, and its ratio to the size of the sending window at the previous moment is calculated.
[0061] For example, suppose the first time window is 5 milliseconds and the fourth time window is 10 milliseconds. Every 5 milliseconds, the model collects bandwidth usage and round-trip time (RTT) data from the past 10 milliseconds, calculating bandwidth utilization and RTT jitter respectively; simultaneously, it calculates the average number of ECN markings within the past 5 milliseconds; and also calculates the ratio of the current sending window to the sending window 5 milliseconds ago. These four feature values are then combined into a four-dimensional feature vector (if all four features are collected), serving as the time dimension feature corresponding to the first time window.
[0062] As a feasible implementation method, spatial dimension features include any one or a combination of several of the following: the average occupancy rate of multiple port queues under the same chip of the switch, the congestion status of adjacent links, and the bandwidth ratio of different types of traffic on the current link.
[0063] The average queue occupancy rate of multiple ports under the same chip in a switch refers to the arithmetic mean of the queue occupancy rates of multiple ports managed by the same switching chip, used to identify the spread trend of local congestion. Adjacent links refer to the links between the current switch and the next directly connected switch; the congestion status of adjacent links reflects the propagation path of congestion in the network. The bandwidth share of different traffic types refers to the proportion of bandwidth allocated to different traffic types (such as compute traffic, storage traffic, management traffic, etc.) according to service priority, relative to the total bandwidth.
[0064] As a feasible implementation method, operational data of the target network is collected, and spatial dimension features corresponding to the second time window are constructed based on the operational data. This includes: collecting the queue length of each port under the same chip of the switch every second time window, calculating the ratio between the queue length of each port and the maximum queue depth as the queue occupancy rate of each port, and calculating the average queue occupancy rate of all ports under the same chip of the switch to obtain the average queue occupancy rate of multiple ports under the same chip of the switch; and / or, collecting the target queue occupancy rate of the ports at both ends of adjacent links every second time window, comparing the target queue occupancy rate with a preset first threshold and a second threshold, and determining the congestion status of adjacent links based on the comparison results; and / or, collecting the number of bytes of different types of traffic on the current link every second time window, calculating the ratio of the number of bytes of a single type of traffic to the total number of bytes of traffic on the current link to obtain the bandwidth ratio of different types of traffic on the current link; and constructing the spatial dimension features of the second time window based on the average queue occupancy rate of multiple ports under the same chip of the switch corresponding to the second time window, and / or the congestion status of adjacent links, and / or the bandwidth ratio of different types of traffic on the current link.
[0065] In this implementation, the spatial dimension features are constructed using a second time window as the period. For the average queue occupancy rate of multiple ports under the same chip in the switch: within each second time window, the current queue length and maximum queue depth of all valid ports under the same chip are read from the switch. The queue length refers to the number of data packets currently queued for transmission in the switch port buffer (in terms of packets or bytes), and the maximum queue depth refers to the maximum number of data packets that the switch port buffer can hold (i.e., the total depth). For each port, the ratio of the queue length to the maximum queue depth is calculated to obtain the queue occupancy rate of that port. The queue occupancy rate reflects the fill level of the port buffer. Then, the average queue occupancy rate of all ports is calculated.
[0066] Queue utilization rate of a single port The average value of all ports of the same chip , where N is the total number of valid ports under this chip.
[0067] For congestion status of adjacent links: The queue occupancy rate of the ports at both ends of the adjacent link is collected and compared with a preset first threshold and second threshold. Based on the comparison result, the link status is marked as no congestion, pre-congestion, or congested. For bandwidth proportion of different types of traffic: The number of bytes of traffic of various service types on the current link is collected, and the proportion of each type of traffic bytes to the total traffic bytes is calculated. For example, traffic that is usually characterized by large bursts, high latency sensitivity, and high tendency to cause congestion is considered more likely to have a higher proportion, indicating a greater risk of congestion. This helps the model make more accurate congestion predictions based on service type. Finally, these features are combined as the spatial dimension features corresponding to the second time window.
[0068] As a feasible implementation method, the target queue occupancy rate is compared with a preset first threshold and a second threshold, and the congestion status of adjacent links is determined based on the comparison result. This includes: when the target queue occupancy rate is less than the first threshold, the congestion status of adjacent links is marked as no congestion; when the target queue occupancy rate is greater than or equal to the first threshold and less than the second threshold, the congestion status of adjacent links is marked as a congestion precursor; when the target queue occupancy rate is greater than or equal to the second threshold, the congestion status of adjacent links is marked as congested; wherein, if the congestion status of any port of an adjacent link is a congestion precursor or congested, the congestion status of the adjacent link is determined as the corresponding congestion precursor or congested.
[0069] The first and second thresholds are pre-defined queue occupancy thresholds used to classify congestion levels. The first threshold corresponds to the warning line when congestion begins to appear, and the second threshold corresponds to the danger line when congestion is severe and queues are close to overflowing. Adjacent links are connected by two ports, and congestion on either port can affect the transmission performance of the entire link.
[0070] In this implementation, the queue occupancy rates of the ports at both ends of an adjacent link are first obtained. The queue occupancy rate of each port is then compared with a first threshold (e.g., 40%) and a second threshold (e.g., 70%). For a single port: if the queue occupancy rate is less than 40%, it is marked as no congestion (e.g., 0); if it is between 40% and 70%, it is marked as a precursor to congestion (e.g., 1); if it is greater than or equal to 70%, it is marked as congested (e.g., 2). Then, for the entire adjacent link, as long as the congestion status of any one of its ports is either a precursor to congestion or already congested, the congestion status of that link is determined to be the corresponding status. In other words, the link is only marked as no congestion when both ports are marked as no congestion.
[0071] For example, consider ports A and B at the ends of an adjacent link. Port A has a queue occupancy rate of 50% (a precursor to congestion), while port B has a queue occupancy rate of 25% (no congestion). Because port A is in a precursor to congestion state, the entire adjacent link is marked as a precursor to congestion. Only when both ports A and B are in a no-congestion state (both less than 40%) is the link marked as no-congestion.
[0072] As can be seen, this implementation method subdivides the congestion state into three levels by using dual thresholds, making the congestion warning more accurate. At the same time, by adopting a conservative judgment strategy for any port, it can promptly identify the risk of congestion propagating along the link, enabling the model to have the topology awareness capability to provide early warning of upstream congestion to downstream.
[0073] S202: Arrange the time dimension features corresponding to multiple first time windows within the preset third time window in chronological order to obtain the time series input vector corresponding to the third time window, and input the time series input vector corresponding to the third time window into the time feature encoder to obtain the time feature vector.
[0074] The third time window is a longer time interval than the first time window, used to aggregate features from multiple first time windows to form a complete time series sample. The time series input vector is a sequence of data formed by arranging the time dimension features of all first time windows within the third time window in chronological order.
[0075] In this step, the length of the third time window is first defined. Within the third time window, multiple consecutive first time windows are included, each corresponding to a time-dimensional feature vector. These feature vectors are arranged sequentially from earliest to latest time, forming a three-dimensional time series input vector with dimensions of (number of time steps × feature dimension of each time step). Then, this time series input vector is fed into a time feature encoder, which extracts the global temporal dependencies within the entire time window and outputs a time feature vector.
[0076] For example, assuming the first time window is 5 milliseconds and the third time window is 100 milliseconds, then each third time window contains 20 first time windows. Each first time window corresponds to a 4-dimensional time feature vector (if all four features are collected), then the dimension of the time series input vector is 20 × 4 = 80 dimensions. The features from these 20 5-millisecond windows are input into a time feature encoder in chronological order, and the encoder outputs a 256-dimensional time feature vector.
[0077] As a feasible implementation method, the time series input vector corresponding to the third time window is input into a time feature encoder to obtain a time feature vector, including: inputting the time series input vector corresponding to the third time window into a forward long short-term memory network and a backward long short-term memory network respectively; wherein, the forward long short-term memory network traverses the time series input vector in forward time order and outputs the forward hidden state, and the backward long short-term memory network traverses the time series input vector in reverse time order and outputs the backward hidden state; the forward hidden state and the backward hidden state are concatenated to obtain the time feature vector.
[0078] Among them, the Feedforward Long Short-Term Memory (LSTM) network is a recurrent neural network that processes sequential data in forward chronological order, enabling it to learn information dependencies from past moments to the present moment. The Feedback Long Short-Term Memory (LSTM) network is a recurrent neural network that processes sequential data in reverse chronological order, enabling it to learn information dependencies from future moments to the present moment. The hidden state is the feature vector output by the LSTM network at each time step, containing sequence information from that time step and the preceding (or following) moments.
[0079] In this implementation, the time series input vector is simultaneously fed into both the forward LSTM and backward LSTM branches. In the forward LSTM branch, the network starts from the first time step and iterates sequentially towards the last time step, outputting a hidden state at each time step. The hidden state of the last time step is then taken as the forward hidden state, which contains the temporal information of the entire sequence from the past to the present. In the backward LSTM branch, the network starts from the last time step and iterates sequentially towards the first time step, taking the hidden state of the last time step as the backward hidden state. This vector contains the temporal information of the entire sequence from the future to the present. Then, the forward and backward hidden states are concatenated in the dimensional direction to form a time feature vector with doubled dimensions. This vector simultaneously contains bidirectional temporal dependencies from the past to the future and from the future to the past.
[0080] As can be seen, bidirectional LSTM can simultaneously learn the bidirectional temporal dependencies between the past and present, and the future and present, enabling the model to capture sudden changes in traffic and short-term bursts. This results in higher accuracy, stronger stability, and earlier predictions compared to traditional single LSTM. Forward LSTM focuses on how historical trends influence the present, while backward LSTM focuses on how subsequent information relates to the present. The fusion of bidirectional information enhances the temporal encoding capability of features at the current moment.
[0081] S203; The spatial dimension features corresponding to multiple second time windows within the preset third time window are fused to obtain the fused spatial features corresponding to the third time window. The fused spatial features corresponding to the third time window are input into the spatial feature encoder to obtain the spatial feature vector.
[0082] The fusion of spatial dimension features refers to the operation of merging the spatial dimension features of multiple second time windows contained within the third time window into a single feature vector. Since the length of the second time window is usually greater than that of the first time window, the number of sampling points for spatial dimension features is less than the number of sampling points for temporal dimension features within the same third time window.
[0083] In this step, the spatial dimension feature vectors corresponding to all second time windows within the third time window are first obtained. Since these feature vectors correspond to different time points, they need to be fused into a unified feature vector as input to the spatial feature encoder. The fusion method can be averaging, maximizing, or using a more complex fusion network. After fusion processing, a fused spatial feature corresponding to the third time window is obtained. This fused spatial feature is then input into the spatial feature encoder, which extracts high-level spatial correlation features and outputs a spatial feature vector.
[0084] For example, assuming the second time window is 20 milliseconds and the third time window is 100 milliseconds, then each third time window contains 5 second time windows, and each second time window corresponds to a spatial dimension feature vector (assuming the dimension is j). These 5 spatial dimension feature vectors are averaged to obtain a j-dimensional fused spatial feature, which is then input into a spatial feature encoder to output a 64-dimensional spatial feature vector.
[0085] As a feasible implementation method, the fused spatial features corresponding to the third time window are input into the spatial feature encoder to obtain the spatial feature vector, including: inputting the spatial dimension features corresponding to the third time window into the first fully connected layer for dimensionality upscaling and feature fusion, and obtaining the first intermediate feature vector after processing by the first activation function; inputting the first intermediate feature vector into the second fully connected layer to map to the target dimension, and obtaining the spatial feature vector after processing by the second activation function.
[0086] Fully connected layers are fundamental building blocks in neural networks, connecting each input neuron to each output neuron. Dimensionality upscaling refers to mapping low-dimensional feature vectors to a higher-dimensional space to enhance feature representation. Feature fusion refers to the combination of spatial features from different sources through the weight matrix of fully connected layers during dimensionality upscaling, forming new composite features. Activation functions are used to introduce nonlinear transformations, enabling neural networks to learn complex nonlinear relationships. The Rectified Linear Unit (ReLU) is a commonly used activation function, outputting max(0, x), and offers advantages such as computational simplicity and mitigating gradient vanishing.
[0087] In this embodiment, the spatial feature encoder employs a two-layer fully connected network structure. The first fully connected layer receives the fused spatial features as input, upscales them to a higher dimension (e.g., 128 dimensions) using a weight matrix, and then processes them through a ReLU activation function to output a first intermediate feature vector. The purpose of upscaling is to map the original spatial features to a higher-dimensional feature space, enabling the model to learn richer feature combinations and interactions. The second fully connected layer receives the first intermediate feature vector as input, maps it to the target dimension (e.g., 64 dimensions) using a weight matrix, and then processes it through a ReLU activation function to output the final spatial feature vector. The purpose of dimensionality reduction is to control the dimensionality of the feature vector, facilitating subsequent concatenation with the temporal feature vector.
[0088] S204: Concatenate the temporal feature vector with the spatial feature vector to obtain the spatiotemporal fusion feature.
[0089] S205: The attention mechanism decoder adjusts the feature values of each feature dimension in the spatiotemporal fusion feature according to the importance of each feature dimension in congestion prediction to obtain the adjusted spatiotemporal fusion feature.
[0090] S205: Determine congestion prediction results based on adjusted spatiotemporal fusion features.
[0091] The network congestion prediction method provided in this embodiment constructs differentiated first and second time windows, collecting temporal features at a higher frequency and spatial features at a lower frequency, respectively. This fully considers the characteristics of network traffic changes. Temporal features change rapidly, requiring high-frequency sampling to capture precursor signals of sudden traffic bursts, while spatial features change relatively slowly, allowing for a lower sampling frequency to save computational resources. By fusing multiple spatial sampling points within a third time window, alignment of high-frequency temporal features and low-frequency spatial features on the time axis is achieved, enabling effective fusion of the two types of information. Therefore, this embodiment constructs a two-layer time window system that covers the complete temporal characteristics of sudden traffic bursts from remote direct memory access while adapting to the computational resource limitations of edge devices such as switches, balancing prediction accuracy and inference latency.
[0092] Based on the above embodiments, the method further includes: adjusting the acquisition parameters of the time dimension features and / or the acquisition parameters of the spatial dimension features according to the congestion prediction results; wherein, the acquisition parameters include the length of the first time window, the length of the second time window, the sampling frequency of the time dimension features, and the sampling frequency of the spatial dimension features.
[0093] In this implementation, after outputting the congestion prediction result, the model feeds the result back to the data acquisition module. The data acquisition module dynamically adjusts subsequent acquisition parameters based on the prediction result. The adjustment principle is: when an increased congestion risk is predicted, the acquisition window is shortened and the sampling frequency is increased to monitor network state changes more intensively; when the network is predicted to be in a stable, congestion-free state, the acquisition window is extended and the sampling frequency is reduced to reduce the overhead of computing resources and network bandwidth.
[0094] As can be seen, this implementation achieves adaptive adjustment of the acquisition parameters, densifies sampling in high-risk areas to ensure prediction accuracy, and reduces sampling frequency in low-risk areas to save resources, thus achieving a dynamic balance between prediction accuracy and computational overhead.
[0095] As a feasible implementation method, the acquisition parameters of the time dimension features and / or the acquisition parameters of the spatial dimension features are adjusted according to the congestion prediction results, including: when the congestion prediction result is a congestion precursor or congestion has occurred, the length of the first time window and / or the second time window is reduced, and / or the sampling frequency of the time dimension features and / or the spatial dimension features is increased; when the congestion prediction result is no congestion, the length of the first time window and / or the second time window is increased, and / or the sampling frequency of the time dimension features and / or the spatial dimension features is decreased.
[0096] In this implementation, a discrete adjustment strategy is adopted, with adjustments made in stages according to the type of congestion. Specifically, three collection modes are defined: normal mode (no congestion), early warning mode (pre-congestion state), and emergency mode (congested state). In normal mode, a longer first time window (e.g., 10 milliseconds) and a shorter second time window (e.g., 40 milliseconds) are used to maintain basic monitoring with minimal resource overhead. When the prediction result changes to pre-congestion, the system switches to early warning mode, shortening the first time window to 5 milliseconds and the second time window to 20 milliseconds, and increasing the sampling frequency accordingly. When the prediction result changes to congested, the system switches to emergency mode, further shortening the first time window to 2 milliseconds and the second time window to 10 milliseconds, and increasing the sampling frequency to the highest level.
[0097] As can be seen, the tiered adjustment strategy is simple to implement, has low computational overhead, and is easy to deploy on network devices such as switches; at the same time, it provides differentiated responses based on the severity of congestion, offering the most intensive monitoring data when congestion worsens, and enabling timely congestion control decisions.
[0098] As another feasible implementation, adjusting the acquisition parameters of the time dimension features and / or the acquisition parameters of the spatial dimension features according to the congestion prediction results includes: continuously adjusting the length of the first time window and / or the second time window according to the congestion probability value in the congestion prediction results, wherein the congestion probability value is negatively correlated with the length of the time window.
[0099] The congestion probability value refers to the probability of a certain congestion state (such as congested) output by the model, and its value ranges from 0 to 1. A negative correlation means that the larger the congestion probability value, the smaller the time window length; conversely, the smaller the congestion probability value, the larger the time window length.
[0100] In this implementation, a continuous adjustment strategy is adopted, and the congestion probability value output by the model is directly used as the adjustment coefficient to calculate the current time window length. For example, the formula for calculating the time window length can be defined as: Window length = Baseline window length × (1 - Congestion probability value). When the congestion probability value is 0, the window length is equal to the baseline window length (maximum value); when the congestion probability value is 0.5, the window length is shortened to half of the baseline window length; when the congestion probability value is 1, the window length approaches 0 (minimum value). Of course, more complex mapping functions, such as exponential decay functions or piecewise linear functions, can also be used.
[0101] It is evident that the continuous adjustment strategy is smoother than discrete tiering, avoiding data inconsistency issues caused by sudden changes in collected parameters. Furthermore, the adjustment magnitude is precisely linked to the level of congestion risk, achieving an optimal match between resource allocation and risk level, further enhancing the precision of adaptive adjustment.
[0102] The following describes an application embodiment provided by the present invention, such as... Figure 3 As shown, it includes an input layer, a three-segment core architecture, and an output layer. The three-segment core architecture includes a temporal feature encoder, a spatial feature fusion unit, and an attention mechanism decoder.
[0103] By inputting temporal features as input vectors into a temporal feature encoder, and using a bidirectional LSTM model based on multi-dimensional features, the model simultaneously learns the temporal dependencies between the past and present, and the future and present, capturing traffic surges and short-term bursts to predict congestion probability or intensity within the next 5ms. This is more accurate, earlier, and more stable than traditional single LSTM or single-index predictions.
[0104] The forget gate, input gate, and output gate are the core components of each LSTM cell in a bidirectional LSTM, existing in both the forward and backward LSTM branches. To ensure the number of samples in the input temporal feature encoder, a 100ms time window (reaching 20 sampling points) is used as the input window of the LSTM model. Simultaneously, a 10ms fine-grained sub-window designed for the temporal dimension features, as described earlier, together construct a "dual-layer time window" system. This system covers the complete temporal features of RDMA burst traffic while adapting to the edge computing resources of the switch, balancing prediction accuracy and inference latency.
[0105] Input at the current time This represents the 4-dimensional feature vector at time t (bandwidth utilization, RTT jitter, ECN tagging frequency, and transmit window change rate). The hidden state from the previous time step. This is the short-term congestion feature vector output by the LSTM at time t-1 (containing instantaneous congestion indicators at time t-1, such as queue growth rate). The cell state at the previous time step. This represents the long-term congestion memory of the LSTM at time t-1 (including congestion trends over the past 100ms, such as the cumulative effect of RDMA burst traffic, including historical cumulative values of bandwidth utilization, RTT jitter, etc.). Weight matrix. This is the parameter matrix used for model training. It consists of parameters specific to RDMA traffic characteristics, rather than general LSTM parameters. For example, ECN features have higher weights, thus improving the model's ability to identify precursors to RDMA traffic congestion. Bias terms. These are the bias parameters used for model training and learning.
[0106] LSTM model structure as follows Figure 4As shown. Forget Gate: Determines how much historical congestion memory to discard, i.e., the information carried by the previous time unit—should it be forgotten? How much should be forgotten? It directly outputs a weight vector of 0-1, adapting to the high burst and long stable traffic characteristics of RDMA, automatically discarding redundant historical memory during stable periods (such as the stable RTT value when there is no congestion), and only retaining key features during burst periods (such as a sudden increase in ECN markers). The specific calculation formula is as follows: , For the output of the forget gate, Here is the weight matrix for the forget gate. This is the bias term for the forget gate. Input gate: Determines how much new feature information to store, such as prioritizing the storage of ECN tags, queue occupancy rates, and other congestion precursor features, and reinforcing the storage weight of high-value features. The specific calculation is as follows: , The output of the input gate, Here is the weight matrix of the input gate. The input gate bias term, represented by the formula above, indicates the input gate opening and closing, determining the proportion of new feature information stored. The candidate cell state is a temporary state used to generate new feature information to be stored, containing the current input. Hidden state from the previous moment Potentially valuable features were extracted, but it has not yet been decided which information will actually be incorporated into the long-term cell state. The specific calculations are as follows: , Candidate cell state, This is the weight matrix for the candidate cell states. The bias term for candidate cell states is used in the above formula to generate candidate cell states, i.e., new congestion feature information to be stored. The output gate determines how much new feature information is output, controlling the output ratio of cell states and only selecting features crucial to congestion prediction to generate hidden states. The specific calculations are as follows: , For the output of the output gate, This is the weight matrix of the output gate. The above formula represents the output gate's bias term, indicating the opening and closing of the output gate and determining the output ratio. , Given the cell state at time t, the above formula updates the cell state by incorporating forgotten information and newly input feature information. , Given the short-term congestion feature vector at time t, the above formula generates the current hidden state. As the final output of the LSTM layer, it is directly fed into the fully connected layer to calculate the probability distribution of no congestion / congestion precursors / congestion, ensuring the real-time performance of RDMA congestion prediction.
[0107] Based on the calculation formulas for the forget gate, input gate, and output gate, forward LSTM and backward LSTM models are constructed respectively. Forward LSTM: The time dimension features are traversed in the order from past to present, with a total of 20 sampling points within a 100ms time window. Learn the congestion characteristics and trends over the past 100ms and output the results at each step. (A total of 20 128-dimensional) Take the last step. of (128-dimensional). Backward LSTM: The order of traversing the time dimension features is from present to past, i.e., from... Learn the contextual dependencies of subsequent time steps on previous time steps within a 100ms window, and similarly output the time step for each step. (A total of 20 128-dimensional) Take the last step. of (128 dimensions). [The rest of the text appears to be incomplete and requires further context.] and By concatenating the vectors, a 256-dimensional time feature vector is obtained. This is a global feature of the entire timing window.
[0108] Spatial features are input into the spatial feature fusion unit. The original spatial features include the queue occupancy rate of the same chip port of the switch, the congestion status of adjacent links, and the proportion of traffic types, with an initial dimension of j. The original spatial features are input into a two-layer fully connected network, and the final output is a 64-dimensional vector. The specific calculation is as follows: First layer fully connected (dimensionality increase + feature fusion). The second layer is fully connected (mapped to the target dimension). ,in, The j-dimensional original spatial feature vector (input); The first layer fully connected weight matrix has a dimension of 128×j (increasing the dimension to 128 dimensions to enhance feature representation). This is the bias term for the first layer fully connected layer, with a dimension of 128×1; The second fully connected layer weight matrix has a dimension of 64×128 (reduced to 64 dimensions to control the dimensionality). This is the bias term for the second fully connected layer, with a dimension of 64×1; Activation functions that address the vanishing gradient problem and preserve nonlinear relationships in spatial features (such as the nonlinear relationship between port queues and adjacent link congestion). This is the output 64-dimensional spatial feature vector (core output).
[0109] 256 dimensions of time features 64-dimensional spatial features By concatenating the data into a 320-dimensional vector, the RDMA traffic trend (256 dimensions) within a 100ms time window is fused with the real-time spatial status (64 dimensions) of the switch's multi-port / adjacent link / traffic type. This solves the problem that LSTM can only model time sequence and cannot perceive hardware topology. For example, even if the time sequence features show "current port queue is normal", but the spatial features show "adjacent link ECN marking rate increases sharply", the model can still predict congestion.
[0110] The concatenated feature vectors have high dimensionality. In high-dimensional feature spaces, data is sparse, feature dimensions vary greatly, and the model struggles to learn effective patterns. A Batch Normalization (BN) layer is needed to normalize the vectors, avoiding the curse of dimensionality and dimensionality issues, resulting in a more uniform feature distribution. This allows the model to effectively learn feature patterns across all dimensions; simultaneously, it makes gradient updates more stable, preventing gradient explosion / vanishing caused by high dimensionality and improving model training efficiency.
[0111] The attention mechanism decoder uses a feature-level attention mechanism to dynamically allocate feature weights, specifically as follows: Constructing the query vector: The 320-dimensional fused features output from the BN layer are weighted by a weight matrix. The mapping is a 320-dimensional query vector Q, representing the core task objective of RDMA congestion prediction, as follows: ,in, The input is the 320-dimensional fused feature output by the BN layer. The query weight matrix is learnable (dimension: 320×320), and during training, it learns which features the congestion prediction task focuses on. To query the bias items (dimension: 320×1); The output is a 320-dimensional query vector (representing the feature preferences for the congestion prediction task).
[0112] Dynamically calculate feature importance scores: Map the 320-dimensional fused features output from the Batch Normalization (BN) layer to a 320-dimensional key vector K. Calculate the similarity between Q and K to obtain the importance score for each feature item. Details are as follows: , , ,in, It is a learnable key vector weight matrix (dimension: 320×320). For key bias terms, To output the original similarity scores for each of the 320 features, To pass The similarity score is globally normalized to 0-1 for each feature, representing the overall weight percentage of each feature.
[0113] Feature weighting: The original fused features are scaled item by item using the calculated weights. Features with high weights have their values amplified, while features with low weights have their values reduced, as detailed below: .
[0114] Training optimization: Iteratively update attention parameters through backpropagation ( / / / This approach allows the model to learn the feature priorities of different congestion stages, calculates weights in real time based on current feature values, and dynamically allocates weights as the link state changes. Compared to a fixed-weight approach, this design improves the model's ability to identify early signs of RDMA congestion.
[0115] One-way LSTM maps the future: Taking 320-dimensional weighted features as input, the temporal memory capability of the one-way LSTM is used to capture the short-term trend of the features, and finally outputs a 128-dimensional hidden state. .
[0116] The output layer will contain the 128-dimensional hidden state output by the LSTM. The congestion prediction value for the next 5ms is mapped to the value through a fully connected layer and an activation function. The specific calculation is as follows: the fully connected layer reduces the dimensionality, mapping the 128-dimensional hidden state to a 3-dimensional vector. (Corresponding to 3 congestion states: no congestion, congestion precursors, and congestion). ,in, The dimension is 3×128. The dimension is 3×1; softmax normalization (probability distribution) transforms the 3-dimensional vector Probability distribution of transitioning to a congested state (Total = 1) , where the matrix middle, This indicates the probability of no congestion in the next 5ms; This indicates the probability of congestion precursors in the next 5ms; This represents the probability that congestion will occur within the next 5ms. The state with the highest probability is taken as the final prediction result.
[0117] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0118] Embodiments of the present invention also provide a network congestion prediction device, see [link to related document]. Figure 5 The present invention provides a structural diagram of a network congestion prediction device.
[0119] The construction unit 100 is used to collect the operational data of the target network and construct time-dimensional features and spatial-dimensional features based on the operational data. The time-dimensional features are used to characterize the changes in the link status of the target network over time, and the spatial-dimensional features are used to characterize the correlation between different nodes or links in the target network.
[0120] The encoding unit 200 is used to encode the time dimension features through a time feature encoder to obtain a time feature vector, and to encode the spatial dimension features through a spatial feature encoder to obtain a spatial feature vector.
[0121] The splicing unit 300 is used to splice the temporal feature vector and the spatial feature vector to obtain the spatiotemporal fusion feature.
[0122] The adjustment unit 400 is used to adjust the feature values of each feature dimension in the spatiotemporal fusion feature according to the importance of each feature dimension in the spatiotemporal fusion feature for congestion prediction through the attention mechanism decoder to obtain the adjusted spatiotemporal fusion feature.
[0123] Unit 500 is used to determine the congestion prediction result based on the adjusted spatiotemporal fusion features.
[0124] The network congestion prediction device provided in this invention constructs a spatiotemporal dual-dimensional feature set by simultaneously collecting temporal and spatial features of the target network. This feature set characterizes the evolution of link states over time and the correlations between different nodes or links in the network. Based on this, a temporal feature encoder and a spatial feature encoder encode and fuse the two types of features into a spatiotemporal fusion feature set. Then, an attention mechanism decoder adjusts the feature values of each feature dimension according to its importance for congestion prediction. Finally, the congestion prediction result is determined based on the adjusted spatiotemporal fusion feature set. This invention comprehensively depicts the network's operational state from both spatiotemporal dimensions, enabling congestion prediction to go beyond the real-time indicators of a single link and integrate historical time-series trends with topological spatial correlations. The attention mechanism decoder dynamically adjusts feature values according to the importance of each feature dimension for congestion prediction, allowing the model to focus on features that are more representative of congestion prediction. Therefore, this invention achieves proactive prediction of network congestion trends, enabling the early detection of congestion risks before they occur.
[0125] Based on the above embodiments, as a preferred implementation, the adjustment unit 400 is specifically used to: determine the importance score corresponding to each feature dimension in the spatiotemporal fusion feature in the attention mechanism decoder; wherein, the importance score is used to characterize the importance of the corresponding feature dimension to congestion prediction; and use the importance score corresponding to each feature dimension to perform weighted processing on each feature dimension in the spatiotemporal fusion feature to obtain the adjusted spatiotemporal fusion feature.
[0126] Based on the above embodiments, as a preferred implementation, the adjustment unit 400 is specifically used for: in the attention mechanism decoder, inputting the spatiotemporal fusion features into a batch normalization layer for normalization processing to obtain normalized spatiotemporal fusion features; mapping the normalized spatiotemporal fusion features to query vectors through a learnable query weight matrix and query bias term, and mapping the normalized spatiotemporal fusion features to key vectors through a learnable key weight matrix and key bias term; obtaining the original importance score corresponding to each feature dimension by calculating the similarity between the query vector and the key vector; normalizing the original importance score corresponding to each feature dimension to obtain the importance score corresponding to each feature dimension; weighting each feature dimension in the normalized spatiotemporal fusion features using the importance score corresponding to each feature dimension to obtain weighted spatiotemporal fusion features; and inputting the weighted spatiotemporal fusion features into a unidirectional long short-term memory network to obtain adjusted spatiotemporal fusion features.
[0127] Based on the above embodiments, as a preferred implementation, the query weight matrix, query bias term, key weight matrix, and key bias term are learnable parameters that are iteratively updated through backpropagation.
[0128] Based on the above embodiments, as a preferred implementation, the construction unit 100 includes: a construction subunit, used to collect the running data of the target network and construct the time dimension features corresponding to the first time window and the spatial dimension features corresponding to the second time window based on the running data; an arrangement subunit, used to arrange the time dimension features corresponding to multiple first time windows in a preset third time window in chronological order to obtain the time series input vector corresponding to the third time window; and a fusion subunit, used to fuse the spatial dimension features corresponding to multiple second time windows in a preset third time window to obtain the fused spatial features corresponding to the third time window.
[0129] Based on the above embodiments, as a preferred implementation, the time dimension features include any one or a combination of any of the following: link bandwidth utilization, round-trip time jitter value, congestion marking frequency, and transmission window change rate.
[0130] Based on the above embodiments, as a preferred implementation, the sub-unit is specifically used for: collecting the actual bandwidth used by the link and the total bandwidth within the fourth time window every first time window, calculating the ratio of the actual bandwidth used by the link to the total bandwidth to obtain the link bandwidth utilization rate, and / or collecting the round-trip delay within the fourth time window every first time window, calculating the standard deviation of the round-trip delay to obtain the round-trip delay jitter value, and / or collecting the number of times the switch performs explicit congestion marking on data packets per unit time, calculating the average value of the number of explicit congestion markings within the first time window to obtain the congestion marking frequency, calculating the ratio of the current sending window size to the previous sending window size every first time window to obtain the sending window change rate; and constructing the time dimension features corresponding to the first time window based on the link bandwidth utilization rate, and / or the round-trip delay jitter value, and / or the congestion marking frequency, and / or the sending window change rate corresponding to the first time window.
[0131] Based on the above embodiments, as a preferred implementation, the spatial dimension features include any one or a combination of several of the following: the average occupancy rate of multiple port queues under the same chip of the switch, the congestion status of adjacent links, and the bandwidth ratio of different types of traffic on the current link.
[0132] Based on the above embodiments, as a preferred implementation, the sub-unit is specifically used for: collecting the queue length of each port under the same chip of the switch every second time window, calculating the ratio between the queue length of each port and the maximum queue depth as the queue occupancy rate of each port, and calculating the average of the queue occupancy rates of all ports under the same chip of the switch to obtain the average queue occupancy rate of multiple ports under the same chip of the switch, and / or, collecting the target queue occupancy rate of the ports at both ends of adjacent links every second time window, comparing the target queue occupancy rate with a preset first threshold and a second threshold, determining the congestion state of adjacent links based on the comparison result, and / or, collecting the number of bytes of different types of traffic on the current link every second time window, calculating the ratio of the number of bytes of a single type of traffic to the total number of bytes of traffic on the current link to obtain the bandwidth ratio of different types of traffic on the current link, and constructing the spatial dimension features of the second time window based on the average queue occupancy rate of multiple ports under the same chip of the switch corresponding to the second time window, and / or, the congestion state of adjacent links, and / or, the bandwidth ratio of different types of traffic on the current link.
[0133] Based on the above embodiments, as a preferred implementation, the sub-unit is specifically used for: marking the congestion status of adjacent links as no congestion when the target queue occupancy rate is less than a first threshold; marking the congestion status of adjacent links as a pre-congestion condition when the target queue occupancy rate is greater than or equal to the first threshold and less than a second threshold; and marking the congestion status of adjacent links as congested when the target queue occupancy rate is greater than or equal to the second threshold. Wherein, if the congestion status of any port of an adjacent link is a pre-congestion condition or congested, then the congestion status of the adjacent link is determined as the corresponding pre-congestion condition or congested.
[0134] Based on the above embodiments, as a preferred implementation, the encoding unit 200 includes: a first encoding subunit, used to input the time series input vector corresponding to the third time window into the time feature encoder to obtain a time feature vector; and a second encoding subunit, used to input the fused spatial features corresponding to the third time window into the spatial feature encoder to obtain a spatial feature vector.
[0135] Based on the above embodiments, as a preferred implementation, the first encoding subunit is specifically used to: input the time series input vector corresponding to the third time window into the forward long short-term memory network and the backward long short-term memory network respectively; wherein, the forward long short-term memory network traverses the time series input vector in ascending time order and outputs the forward hidden state, and the backward long short-term memory network traverses the time series input vector in reverse time order and outputs the backward hidden state; and concatenate the forward hidden state and the backward hidden state to obtain the time feature vector.
[0136] Based on the above embodiments, as a preferred implementation, the second encoding subunit is specifically used to: input the spatial dimension features corresponding to the third time window into the first fully connected layer for dimensionality upscaling and feature fusion, and obtain the first intermediate feature vector after processing by the first activation function; input the first intermediate feature vector into the second fully connected layer to map it to the target dimension, and obtain the spatial feature vector after processing by the second activation function.
[0137] Based on the above embodiments, as a preferred implementation, the determining unit 500 is specifically used to: map the adjusted spatiotemporal fusion features through a fully connected layer into a dimension vector equal to the number of congestion state categories; normalize the dimension vector to obtain the probability distribution of each congestion state; and select the congestion state with the highest probability as the congestion prediction result based on the probability distribution of each congestion state.
[0138] For a description of the features in the embodiment corresponding to the network congestion prediction device, please refer to the relevant description of the embodiment corresponding to the network congestion prediction method, which will not be repeated here.
[0139] Embodiments of the present invention also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the network congestion prediction method embodiments described above.
[0140] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program configured to execute the steps in any of the network congestion prediction method embodiments described above when running.
[0141] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0142] Embodiments of the present invention also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described network congestion prediction method embodiments.
[0143] Embodiments of the present invention also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described network congestion prediction method embodiments.
[0144] Any of the components, modules, units, parts, methods, and operations described herein can be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or any combination thereof. Alternatively or additionally, any functionality described herein can be performed at least in part by one or more hardware logic components, such as, but not limited to, a central processing unit (CPU), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), an application-specific standard product (ASSP), a system-on-a-chip (SoC), a complex programmable logic device (CPLD), a microprocessor (MCU), etc. The terms "system," "computing device," or "apparatus" as used herein encompass various means, devices, and machines for processing data, including, for example, one or more programmable processors, computers, SoCs, or combinations thereof. The apparatus may also include code that creates an execution environment for the computer program in question, such as code constituting processor firmware, a protocol stack, a database management system, an operating system, a cross-platform runtime environment, a virtual machine, or one or more combinations thereof. The aforementioned computer program (also known as a program, software, software application, app, script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and can be deployed in any form, including as a standalone program or as a module, component, subroutine, object, or other unit suitable for a computing environment.
[0145] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0146] The present invention provides a detailed description of a network congestion prediction method and an electronic device. Specific examples have been used to illustrate the principles and implementation methods of the invention. The descriptions of these embodiments are merely illustrative of the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to the invention without departing from its principles, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A network congestion prediction method, characterized in that, include: The operation data of the target network is collected, and time-dimensional features and spatial-dimensional features are constructed based on the operation data; wherein, the time-dimensional features are used to characterize the changes in the link status of the target network over time, and the spatial-dimensional features are used to characterize the correlation between different nodes or links in the target network; The temporal feature vector is obtained by encoding the temporal dimension feature through a temporal feature encoder, and the spatial feature vector is obtained by encoding the spatial dimension feature through a spatial feature encoder. The spatiotemporal fusion feature is obtained by concatenating the temporal feature vector with the spatial feature vector. The attention mechanism decoder adjusts the feature values of each feature dimension in the spatiotemporal fusion feature according to the importance of each feature dimension in congestion prediction to obtain the adjusted spatiotemporal fusion feature. The congestion prediction result is determined based on the adjusted spatiotemporal fusion features.
2. The network congestion prediction method according to claim 1, characterized in that, The attention mechanism decoder adjusts the feature values of each feature dimension in the spatiotemporal fusion feature according to the importance of each feature dimension to congestion prediction, resulting in an adjusted spatiotemporal fusion feature, including: In the attention mechanism decoder, the importance score corresponding to each feature dimension in the spatiotemporal fusion features is determined; wherein, the importance score is used to characterize the degree of importance of the corresponding feature dimension to congestion prediction; The spatiotemporal fusion features are weighted by using the importance scores corresponding to each feature dimension to obtain the adjusted spatiotemporal fusion features.
3. The network congestion prediction method according to claim 2, characterized in that, Determining the importance score corresponding to each feature dimension in the spatiotemporal fusion features includes: The spatiotemporal fusion features are input into the batch normalization layer for normalization processing to obtain the normalized spatiotemporal fusion features. The normalized spatiotemporal fusion features are mapped into query vectors using a learnable query weight matrix and query bias term, and the normalized spatiotemporal fusion features are mapped into key vectors using a learnable key weight matrix and key bias term. By calculating the similarity between the query vector and the key vector, the original importance scores corresponding to each feature dimension are obtained; The original importance scores corresponding to each feature dimension are normalized to obtain the importance scores corresponding to each feature dimension. Accordingly, the importance scores corresponding to each feature dimension are used to weight each feature dimension in the spatiotemporal fusion feature to obtain the adjusted spatiotemporal fusion feature, including: The weighted spatiotemporal fusion features are obtained by weighting each feature dimension in the normalized spatiotemporal fusion features using the importance scores corresponding to each feature dimension. The weighted spatiotemporal fusion features are input into a unidirectional long short-term memory network to obtain the adjusted spatiotemporal fusion features.
4. The network congestion prediction method according to claim 3, characterized in that, The query weight matrix, the query bias term, the key weight matrix, and the key bias term are learnable parameters that are iteratively updated through backpropagation.
5. The network congestion prediction method according to claim 1, characterized in that, Collect operational data of the target network, and construct temporal and spatial features based on the operational data, including: Collect operational data of the target network, and construct time dimension features corresponding to the first time window and spatial dimension features corresponding to the second time window based on the operational data; Arrange the time dimension features corresponding to multiple first time windows within a preset third time window in chronological order to obtain the time series input vector corresponding to the third time window; The spatial dimension features corresponding to multiple second time windows within a preset third time window are fused to obtain the fused spatial features corresponding to the third time window.
6. The network congestion prediction method according to claim 5, characterized in that, The time-dimensional features include any one or a combination of any of the following: link bandwidth utilization, round-trip time jitter, congestion marking frequency, and transmission window change rate.
7. The network congestion prediction method according to claim 6, characterized in that, Collect operational data of the target network, and construct time-dimensional features corresponding to the first time window based on the operational data, including: Every first time window, the actual bandwidth used by the link and the total bandwidth within the fourth time window are collected, and the link bandwidth utilization rate is calculated by the ratio of the actual bandwidth used by the link to the total bandwidth. And / or, every first time window, the round-trip delay within the fourth time window is collected, and the standard deviation of the round-trip delay is calculated to obtain the round-trip delay jitter value; And / or, collect the number of times the switch performs explicit congestion marking on data packets per unit time, calculate the average number of explicit congestion markings within the first time window to obtain the congestion marking frequency, and calculate the ratio of the current sending window size to the previous sending window size every first time window to obtain the sending window change rate. The time dimension features corresponding to the first time window are constructed based on the link bandwidth utilization rate corresponding to the first time window, and / or the round-trip delay jitter value, and / or the congestion marking frequency, and / or the transmission window change rate.
8. The network congestion prediction method according to claim 5, characterized in that, The spatial dimension features include any one or a combination of several of the following: the average occupancy rate of multiple port queues under the same chip of the switch, the congestion status of adjacent links, and the bandwidth ratio of different types of traffic on the current link.
9. The network congestion prediction method according to claim 8, characterized in that, Collect operational data of the target network, and construct spatial dimension features corresponding to the second time window based on the operational data, including: Every second time window, the queue length of each port under the same chip of the switch is collected, the ratio between the queue length of each port and the maximum queue depth is calculated as the queue occupancy rate of each port, and the average queue occupancy rate of all ports under the same chip of the switch is calculated to obtain the average queue occupancy rate of multiple ports under the same chip of the switch. And / or, every second time window, the target queue occupancy rate of the ports at both ends of the adjacent link is collected, the target queue occupancy rate is compared with a preset first threshold and a second threshold, and the congestion status of the adjacent link is determined based on the comparison result; And / or, every second time window, collect the number of bytes of different types of traffic on the current link, calculate the ratio of the number of bytes of a single type of traffic to the total number of bytes of traffic on the current link, and obtain the bandwidth ratio of different types of traffic on the current link; The spatial dimension features of the second time window are constructed based on the average occupancy rate of multiple port queues under the same chip of the switch corresponding to the second time window, and / or the congestion status of adjacent links, and / or the bandwidth ratio of different types of traffic on the current link.
10. The network congestion prediction method according to claim 8, characterized in that, The target queue occupancy rate is compared with a preset first threshold and a second threshold, and the congestion status of adjacent links is determined based on the comparison result, including: When the target queue occupancy rate is less than the first threshold, the congestion status of the adjacent link is marked as no congestion; When the target queue occupancy rate is greater than or equal to the first threshold and less than the second threshold, the congestion status of the adjacent link is marked as a congestion precursor. When the target queue occupancy rate is greater than or equal to the second threshold, the congestion status of the adjacent link is marked as congested; If the congestion status of any port of an adjacent link is a pre-congestion sign or already congested, then the congestion status of the adjacent link is determined as the corresponding pre-congestion sign or already congested.
11. The network congestion prediction method according to claim 5, characterized in that, The temporal feature vector is obtained by encoding the temporal dimension features using a temporal feature encoder, and the spatial feature vector is obtained by encoding the spatial dimension features using a spatial feature encoder, including: The time series input vector corresponding to the third time window is input into the time feature encoder to obtain the time feature vector; The fused spatial features corresponding to the third time window are input into the spatial feature encoder to obtain the spatial feature vector.
12. The network congestion prediction method according to claim 11, characterized in that, The time series input vector corresponding to the third time window is input into the time feature encoder to obtain the time feature vector, including: The time series input vector corresponding to the third time window is input into the forward long short-term memory network and the backward long short-term memory network respectively; wherein, the forward long short-term memory network traverses the time series input vector in forward time order and outputs the forward hidden state, and the backward long short-term memory network traverses the time series input vector in reverse time order and outputs the backward hidden state. The forward hidden state and the backward hidden state are concatenated to obtain the time feature vector.
13. The network congestion prediction method according to claim 11, characterized in that, The fused spatial features corresponding to the third time window are input into the spatial feature encoder to obtain a spatial feature vector, including: The spatial dimension features corresponding to the third time window are input into the first fully connected layer for dimensionality upscaling and feature fusion. After processing by the first activation function, the first intermediate feature vector is obtained. The first intermediate feature vector is input into the second fully connected layer and mapped to the target dimension. After processing by the second activation function, the spatial feature vector is obtained.
14. The network congestion prediction method according to claim 1, characterized in that, The congestion prediction result is determined based on the adjusted spatiotemporal fusion features, including: The adjusted spatiotemporal fusion features are mapped to a dimension vector equal to the number of congestion state categories through a fully connected layer; The dimensional vector is normalized to obtain the probability distribution of each congestion state; Based on the probability distribution of each congestion state, the congestion state with the highest probability is selected as the congestion prediction result.
15. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the network congestion prediction method as described in any one of claims 1 to 14 when executing the computer program.