A method and apparatus for generating flow rate

CN120935037BActive Publication Date: 2026-08-11TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0003]然而,现有的流级流量建模方法中,直接采用同质性假设与独立性假设,并没有充分考虑不同应用类型及IP对之间的分布差异与时序依赖特性,由此可能会导致生成流量与真实流量存在显著偏差,或者在复杂网络场景下无法准确反映实际流量行为,从而影响网络性能评估与优化方案的有效性

Benefits of technology

[0032] The flow-level traffic generation method and apparatus of this invention first employs a conditional variational autoencoder to construct a traffic distribution model, capturing the heterogeneous distribution characteristics of traffic size and arrival interval for different IP pairs. Then, a conditionally gated recurrent unit is designed for sequence modeling to parse the temporal dependencies between flows. To balance convergence, accuracy, and coverage, training is performed using a dynamically weighted loss function. During generation, the method uses the required path load as a condition to generate the corresponding traffic size distribution vector, and then inputs the traffic size distribution vector as the initial hidden vector into the conditionally gated recurrent unit to generate flow-level traffic patterns. A block-based generation strategy is employed to balance temporal accuracy and computational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120935037B_ABST
    Figure CN120935037B_ABST
Patent Text Reader

Abstract

This invention proposes a flow-level traffic generation method and apparatus. The method first employs a conditional variational autoencoder to construct a traffic distribution model, capturing the heterogeneous distribution characteristics of traffic size and arrival intervals for different IP pairs. Then, a conditionally gated recurrent unit is designed for sequence modeling to parse the temporal dependencies between flows. To balance convergence, accuracy, and coverage, this method uses a dynamically weighted loss function for training. During generation, the method uses the required path load as a condition to generate the corresponding traffic size distribution vector. This traffic size distribution vector is then used as the initial hidden vector and input into the conditionally gated recurrent unit to generate flow-level traffic patterns. A block-based generation strategy is employed to balance temporal accuracy and computational efficiency. This method can generate high-fidelity, high-coverage synthetic traffic, providing reliable input for network performance evaluation and device parameter optimization while protecting data privacy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network security, and in particular to a traffic generation method and apparatus. Background Technology

[0002] Network traffic modeling, as a crucial foundation for network performance evaluation and optimization research, is widely applied in data center networks, novel protocol verification, and network telemetry. With the diversification of network applications and the increasing complexity of traffic characteristics, flow-level traffic modeling has gradually become a research focus. Its technical system covers the entire process from traffic feature extraction and distribution modeling to time-dependent modeling. Specifically, existing flow-level modeling methods typically include three categories: traffic matrix modeling, packet-level modeling, and flow-level modeling. While flow-level modeling has higher value in practical applications, its research is still in its early stages. It mainly relies on independent sampling of flow size and arrival intervals, generating traffic through exponential and global distribution modeling, involving key steps such as traffic classification, feature discretization, and sequence generation.

[0003] However, existing flow-level traffic modeling methods directly employ homogeneity and independence assumptions, failing to adequately consider the distributional differences and temporal dependencies among different application types and IP pairs. This can lead to significant deviations between generated and actual traffic, or an inability to accurately reflect real traffic behavior in complex network scenarios, thus affecting the effectiveness of network performance evaluation and optimization schemes. Specifically, the distribution of flow size in actual traffic exhibits significant heterogeneity across applications and within a single application, and there is a long-range dependency between flow arrival interval and flow size. Traditional methods, by ignoring these characteristics, result in severely distorted generated traffic, amplifying evaluation errors by 4 to 17 times, making it difficult to meet the needs of high-precision network research. Traditional methods sacrifice too much detail in pursuit of simplicity, necessitating a more complex traffic model that can capture finer features (such as heterogeneity and temporal dependencies). Summary of the Invention

[0004] The present invention aims to at least partially solve one of the technical problems in the related art.

[0005] In real-world network environments, flow-level traffic exhibits strong heterogeneity in distribution and non-independent arrival time patterns. Methods that directly generate traffic based on random sampling of statistical characteristics suffer from severe distortion. This invention proposes a flow-level traffic generation method that decouples distribution modeling and sequence modeling. It first generates a flow size distribution vector and then generates specific flow sizes and arrival time series, achieving high-fidelity and high-coverage traffic generation.

[0006] Another object of the present invention is to provide a flow-level flow generation device.

[0007] To achieve the above objectives, the present invention provides a method for generating flow rate, comprising:

[0008] S1, the original flow data is divided into flow units based on the five-tuple, and the size and arrival interval features of each flow are extracted. The dynamic equal-frequency bucketing algorithm is used to discretize the feature values ​​into distribution vectors.

[0009] S2, the distribution vector is input into the conditional variational autoencoder to generate latent variables that follow a standard normal distribution, and load-aware modeling of flow size distribution under different application scenarios is achieved by dynamically adjusting the weights of KL divergence and reconstruction loss.

[0010] S3, decode the latent variable into a flow size distribution vector, and use it as the initial hidden state input condition gating loop unit. Generate flow size and arrival interval time series autoregressively through update gate and reset gate mechanism to capture the time-series dependency characteristics in real traffic.

[0011] S4 dynamically weights the training process based on the Jensen-Shannon divergence and sequence length of the traffic sequence, and randomly samples the output probability distribution during the generation process to improve the model convergence efficiency and enhance the diversity and coverage of the generated traffic.

[0012] The flow-level flow generation method of this invention may also have the following additional technical features:

[0013] In one embodiment of the present invention, the step of dividing the original flow data into flow units based on 5-tuples, extracting the size and arrival interval features of each flow, and discretizing the feature values ​​into a distribution vector using a dynamic equal-frequency bucketing algorithm includes:

[0014] S11, map the size and arrival interval of each stream unit to multiple independent equal-frequency buckets, where the boundary of each bucket is adaptively adjusted according to the cumulative frequency of the current stream set to ensure that the number of samples in each bucket is approximately equal;

[0015] S12, by configuring the management database, the flow units are labeled with application types and classified into corresponding application scenarios according to IP address information, so as to realize independent modeling of traffic characteristics under different application scenarios.

[0016] In one embodiment of the present invention, the step of inputting the distribution vector into a conditional variational autoencoder to generate latent variables that follow a standard normal distribution, and dynamically adjusting the weights of the KL divergence and reconstruction loss to achieve load-aware modeling of flow size distribution under different application scenarios, includes:

[0017] S21, the flow load L is input as a condition variable into the encoder and decoder, and the load information is fused with the distribution vector through a multilayer perceptron to generate a flow size distribution that matches the actual load;

[0018] S22, dynamically adjust the weight ratio of KL divergence loss and reconstruction loss according to the training phase.

[0019] In one embodiment of the present invention, the step of decoding the latent variable into a flow size distribution vector and using it as an initial hidden state input condition gating loop unit, and generating a flow size and arrival interval time series autoregressively through update gate and reset gate mechanisms to capture the temporal dependency characteristics in real traffic, includes:

[0020] S31, the flow size distribution vector and arrival interval distribution vector are converted into low-dimensional hidden vectors through the embedding module, and the hidden vectors are used as the initial hidden state of the conditional gated loop unit;

[0021] S32 utilizes the update gate of the conditional gating loop unit to control the retention ratio of the current hidden state to the historical state, and filters historical information that is irrelevant to the current flow by resetting the gate, so as to achieve accurate modeling of complex temporal patterns.

[0022] In one embodiment of the present invention, the step of dynamically weighting the training process based on the Jensen-Shannon divergence and sequence length of the traffic sequence, and randomly sampling according to the output probability distribution during the generation process to improve model convergence efficiency and enhance the diversity and coverage of generated traffic, further includes:

[0023] S41, calculate the Jensen-Shannon divergence between each flow sequence and its true distribution, and use the product of the divergence value and the sequence length as the weight of the sequence in training, so as to improve the model's ability to fit long sequences with high dependence.

[0024] S42, when the conditionally gated loop unit generates the flow size and arrival interval for each step, performs random sampling based on the output probability distribution instead of selecting the maximum probability value, in order to avoid the generated flow being highly similar to the original data.

[0025] In one embodiment of the present invention, it further includes:

[0026] S5 divides the generated flow sequence into blocks according to the preset block length. After each block is generated, only the last flow unit of the block is retained as the initial hidden state of the next block, and the historical sequence is cleared. An infinitely long flow sequence is generated by iterative splicing to avoid the gradient vanishing problem caused by long sequence dependencies while preserving the local temporal structure.

[0027] To achieve the above objectives, another aspect of the present invention provides a flow-level flow generation device, comprising:

[0028] The flow partitioning and feature discretization module is used to partition the original flow data into flow units based on the five-tuple, extract the size and arrival interval features of each flow, and use the dynamic equal-frequency bucketing algorithm to discretize the feature values ​​into distribution vectors.

[0029] The conditional variational autoencoder modeling module is used to input the distribution vector into the conditional variational autoencoder to generate latent variables that follow a standard normal distribution, and to realize load-aware modeling of flow size distribution under different application scenarios by dynamically adjusting the weights of KL divergence and reconstruction loss.

[0030] The conditional gated loop unit generation module is used to decode the latent variables into a flow size distribution vector and input it as the initial hidden state into the conditional gated loop unit. The module generates a flow size and arrival interval time series in an autoregressive manner through update gate and reset gate mechanisms to capture the temporal dependency characteristics in the real flow.

[0031] The dynamic weighting and diversity enhancement module is used to dynamically weight the training process based on the Jensen-Shannon divergence and sequence length of the traffic sequence, and to randomly sample according to the output probability distribution during the generation process, so as to improve the model convergence efficiency and enhance the diversity and coverage of the generated traffic.

[0032] The flow-level traffic generation method and apparatus of this invention first employs a conditional variational autoencoder to construct a traffic distribution model, capturing the heterogeneous distribution characteristics of traffic size and arrival interval for different IP pairs. Then, a conditionally gated recurrent unit is designed for sequence modeling to parse the temporal dependencies between flows. To balance convergence, accuracy, and coverage, training is performed using a dynamically weighted loss function. During generation, the method uses the required path load as a condition to generate the corresponding traffic size distribution vector, and then inputs the traffic size distribution vector as the initial hidden vector into the conditionally gated recurrent unit to generate flow-level traffic patterns. A block-based generation strategy is employed to balance temporal accuracy and computational efficiency.

[0033] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0034] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0035] Figure 1 This is a flowchart of a flow-level flow generation method according to an embodiment of the present invention;

[0036] Figure 2 This is an architecture diagram of a flow-level traffic generation method according to an embodiment of the present invention;

[0037] Figure 3 This is an algorithm diagram for generating traffic in an adaptive system according to an embodiment of the present invention;

[0038] Figure 4 This is a structural diagram of a flow-level flow generation device according to an embodiment of the present invention. Detailed Implementation

[0039] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0040] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. 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 skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0041] The flow-level flow generation method and apparatus according to embodiments of the present invention are described below with reference to the accompanying drawings.

[0042] Figure 1 This is a flowchart of a flow-level flow generation method according to an embodiment of the present invention, such as... Figure 1 As shown, it includes:

[0043] S1 divides the original flow data into flow units based on the quintuple and extracts the size and arrival interval features of each flow. The dynamic equal-frequency bucketing algorithm is used to discretize the feature values ​​into distribution vectors to preserve the heterogeneous distribution characteristics of the real flow.

[0044] Specifically, in step 1, the system first divides the raw traffic data into flow units based on the 5-tuple (source IP, destination IP, source port, destination port, protocol). The 5-tuple serves as a unique identifier for network flows, effectively distinguishing different communication sessions and enabling refined traffic modeling. In its implementation, the system employs a time-window-based sliding aggregation strategy, grouping data packets according to the 5-tuple and calculating the start time, duration (i.e., flow lifespan), and flow size (i.e., the total number of bytes or packets in the flow) for each flow. This process is typically completed within a traffic parsing engine, such as using the DPDK or Pcap library for high-speed packet processing. The time window size can be set according to the actual network load, typically between 100ms and 1s, to balance real-time performance and flow integrity.

[0045] After stream unit partitioning, the system further extracts two core features for each stream: FlowSize and Inter-Arrival Time (IAT). Flow size characterizes the load characteristics of the communication content, while IAT reflects the temporal relationship between streams. To preserve the heterogeneous distribution characteristics of real traffic, the system employs a Dynamic Equal-Frequency Binning algorithm to discretize these two continuous features. Dynamic Equal-Frequency Binning adaptively adjusts the bin boundaries to ensure that the number of samples in each bin is approximately equal, thus avoiding the loss of distribution information caused by fixed binning. In this invention, the flow size and IAT features are each discretized into 200 bins, with each bin corresponding to a discretization dimension, ultimately constructing two distribution vectors of length 200, representing the frequency distribution of flow size and IAT, respectively.

[0046] Furthermore, leveraging the application labeling capabilities of the Configuration Management Database (CMDB), the system categorizes traffic into specific application scenarios (such as video streaming, file transfer, and web browsing) based on IP addresses, achieving isolated processing of traffic from different applications. This classification strategy is based on the mapping relationship between IP addresses and application tags, typically employing rule-based or machine learning-based classification methods, such as application identification based on IP geolocation, port characteristics, or deep packet inspection (DPI) technology. Through application isolation, the system can train dedicated models for different types of traffic, thereby improving the models' specificity and generalization capabilities.

[0047] This step plays a crucial role in data preprocessing and feature extraction within the overall technical solution, providing a structured and discretized input representation for subsequent distribution modeling and time-series modeling. By preserving the heterogeneous distribution characteristics of real traffic, the system effectively avoids modeling biases caused by homogeneity assumptions in traditional methods, laying a solid data foundation for high-fidelity traffic generation.

[0048] Furthermore, S1 includes:

[0049] S11 maps the size and arrival interval of each flow unit to multiple independent equal-frequency buckets, where the boundary of each bucket is adaptively adjusted according to the cumulative frequency of the current flow set to ensure that the number of samples in each bucket is approximately equal.

[0050] Specifically, the system employs a dynamic equal-frequency bucketing algorithm to discretize the flow size and inter-arrival time of each flow unit, constructing a corresponding distribution vector. The core of this algorithm lies in adaptively adjusting the bucket boundaries to ensure that the number of samples in each bucket is approximately equal, thereby preserving the original data distribution characteristics while improving the accuracy and robustness of subsequent modeling.

[0051] In some implementations, the system first parses and aggregates the raw traffic data using a five-tuple (source IP, destination IP, source port, destination port, protocol), dividing the packets into independent flow units and calculating the size and arrival interval of each flow. Subsequently, for each flow set (such as a specific IP pair or application category), the system performs independent equal-frequency binning based on flow size and arrival interval, dividing each dimension into 200 bins. The bin boundaries are dynamically calculated using the cumulative frequency distribution function (CDF), that is, based on the current flow set's size or the sorted value of the interval, the data is divided into 200 equal-frequency intervals, each containing approximately 1 / N of the sample size (N being the total number of flows), thus achieving equal-frequency binning.

[0052] Optionally, the system introduces a boundary smoothing mechanism during the bucketing process to avoid discontinuities in bucket boundaries caused by abrupt changes in data distribution. For example, linear interpolation or kernel density estimation (KDE) is used to assist in determining boundary points, ensuring that the bucketing process has good generalization ability across different flow sets. In addition, the system preserves the long-tail characteristics of the original data, avoiding the compression or loss of tail data caused by traditional fixed bucketing (such as equal-width bucketing) through the bucketing method.

[0053] Furthermore, this step provides structured input for subsequent conditional variational autoencoder (CVAE) modeling, enabling the model to learn the differences in flow characteristics under different application scenarios based on discretized distribution vectors, thereby effectively addressing the modeling bias caused by the homogeneity assumption in traditional methods. This bucketing strategy is applicable to various scenarios such as data center traffic, enterprise network traffic, and mobile network traffic in practical applications, and it shows significant advantages, especially in processing traffic data with high heterogeneity and long-tail distribution.

[0054] S12, by configuring the management database, the flow units are labeled with application types and classified into corresponding application scenarios according to IP address information, so as to realize independent modeling of traffic characteristics under different application scenarios.

[0055] Specifically, the system uses a Configuration Management Database (CMDB) to label flow units by application type and categorizes flows to corresponding application scenarios based on IP address information, thereby achieving independent modeling of traffic characteristics under different application scenarios. The technical principle behind this step is based on the five-tuple of network traffic (source IP, destination IP, source port, destination port, protocol) to perform fine-grained flow segmentation, aggregating raw traffic data into independent flow units. Each flow unit contains key features such as flow size and inter-arrival time. In the structured processing stage, the system uses a dynamic equal-frequency bucketing algorithm to discretize flow size and inter-arrival time, dividing continuous feature values ​​into 200 buckets. This ensures that the number of samples in each bucket is approximately equal, thus fully preserving the long-tail characteristics of the original distribution and avoiding the loss of feature information caused by traditional fixed bucketing methods.

[0056] Regarding application type labeling, the system calls the application tag interface in the CMDB to match predefined application scenario tags (such as web access, video streaming, database interaction, etc.) based on the source and destination IP addresses, thus mapping stream units to specific business applications. This mapping process is typically based on static configuration or dynamic discovery mechanisms of IP addresses and business systems, supporting a multi-level tag system (such as first-level business type, second-level subsystem type) to improve the granularity and accuracy of classification. In some implementations, port information and protocol type can be combined for auxiliary judgment to further enhance the robustness of classification.

[0057] This step plays a crucial role in the overall technical solution, providing structured and clearly categorized input data for subsequent distributed and temporal modeling. By isolating traffic according to application scenarios, the system can model the traffic characteristics of different services separately, effectively solving the modeling bias problem caused by homogeneity assumptions in traditional methods. Furthermore, this step significantly improves the model's scalability and training efficiency, laying a solid foundation for achieving high-fidelity, high-coverage flow-level traffic generation.

[0058] In one embodiment of the present invention, this step is traffic feature extraction and structuring processing, corresponding to... Figure 2 The first step, distribution extraction, includes the following three sub-steps and functional modules.

[0059] 1. First, the raw traffic data is finely distinguished based on the five-tuple (source IP, destination IP, source port, destination port, protocol), the data packets are aggregated into independent flow units, and the start time, duration and size of each flow are calculated to facilitate subsequent training and verification.

[0060] 2. Subsequently, the application labeling function of the Configuration Management Database (CMDB) is invoked to classify traffic into specific application scenarios based on IP address, thereby achieving isolated processing of traffic from different applications. This classification strategy allows the system to train a dedicated traffic generation model only for a single application category, effectively reducing model complexity, improving training efficiency, and enhancing system scalability.

[0061] 3. Finally, the system extracts the flow size distribution and arrival interval distribution features of each IP pair, and uses a dynamic equal-frequency bucketing algorithm to discretize the continuous distribution values. By adaptively adjusting the bucket boundaries, the data distribution of each bucket is ensured to be relatively uniform, which not only fully preserves the long-tail characteristics of the original distribution, but also avoids the feature loss caused by traditional fixed bucketing.

[0062] This invention first parses the raw traffic data, extracting flow size and arrival interval data defined by quintuples. Then, it discretizes the continuous size and arrival interval feature values ​​into 200 buckets, constructing a distribution vector. Subsequently, it uses a configuration management database to classify traffic by application type, improving the model's relevance. These three sub-steps collaboratively extract core flow-level features from the raw traffic data, obtaining the true distribution of the discretized vector representation from real traffic, thus laying the data foundation for subsequent modeling.

[0063] S2, the distribution vector is input into the conditional variational autoencoder to generate latent variables that follow a standard normal distribution, and load-aware modeling of flow size distribution under different application scenarios is achieved by dynamically adjusting the weights of KL divergence and reconstruction loss.

[0064] Specifically, this invention employs a Conditional Variational Autoencoder (CVAE) to model the flow size distribution vector, generating latent variables that follow a standard normal distribution. By dynamically adjusting the weights of the KL divergence and reconstruction loss, it achieves load-aware modeling of the flow size distribution under different application scenarios. The core of this step lies in introducing the flow load L as a conditional variable into the encoder and decoder, thereby establishing a mapping relationship between distribution characteristics and load state in the latent space.

[0065] At the technical implementation level, CVAE consists of an encoder and a decoder. The encoder encodes the stream size distribution vector x extracted in step S1 into a conditional latent variable z, the distribution of which is constrained to a standard normal distribution N(0,I).

[0066] At the parameter level, model training employs a joint loss function, including reconstruction loss (such as cross-entropy loss or mean squared error) and KL divergence loss. Reconstruction loss measures the difference between the generated distribution and the true distribution, while KL divergence constrains the distribution of the latent variable z to approximate a standard normal distribution, thereby enhancing generation diversity.

[0067] At the application scenario level, this step can perform load-aware modeling for different application types (such as HTTP, FTP, video streaming, etc.). By taking the traffic load L (such as CPU utilization, bandwidth utilization, etc.) as input, the model can generate a flow size distribution that matches the current load characteristics based on the actual network status, thereby supporting high-fidelity traffic simulation in scenarios such as network performance evaluation and congestion control algorithm testing.

[0068] The technical advantage of this step lies in its ability to accurately model the heterogeneity of flow size distribution by introducing conditional variables and a dynamic weighting mechanism, while ensuring the continuity and diversity of the latent space. Compared to traditional independent sampling methods based on global distribution, this scheme significantly improves the realism and adaptability of flow generation, providing high-quality distribution priors for subsequent time-series modeling and flow generation. It is a key supporting component of the entire divide-and-conquer modeling framework.

[0069] Furthermore, S2 includes:

[0070] S21, the flow load L is input as a condition variable into the encoder and decoder, and the load information is fused with the distribution vector through a multilayer perceptron to generate a flow size distribution that matches the actual load.

[0071] Specifically, this step is based on the Conditional Variational Autoencoder (CVAE) architecture, the core of which is to inject the load L as conditional information into the encoding and decoding process of the model, thereby achieving accurate modeling of the flow size distribution under different load scenarios.

[0072] In some implementations, the flow load L can be represented as a scalar or low-dimensional vector, such as the average flow rate per unit time, peak flow intensity, or flow fluctuation coefficient over a specific time period. This condition variable is nonlinearly mapped through an MLP module to generate a feature representation that matches the dimension of the distribution vector. This fusion process employs gating or attention mechanisms to enhance the ability of the condition variable L to model the distribution.

[0073] This step plays a crucial role in the entire system. By using the load L as a conditional variable, the model can generate corresponding flow size distributions based on different network load scenarios, thereby breaking the assumption of "globally homogeneous distribution" in traditional methods and significantly improving the fidelity and applicability of traffic generation. In practical applications, this mechanism can support network simulation systems in dynamically generating matching traffic patterns based on real-time load, providing high-fidelity data support for network performance evaluation, congestion control algorithm testing, and other applications.

[0074] S22, dynamically adjust the weight ratio of KL divergence loss and reconstruction loss according to the training phase.

[0075] Specifically, in the training phase of this invention, dynamically adjusting the weight ratio of KL divergence loss and reconstruction loss is a key optimization strategy aimed at alleviating the "posterior collapse" problem commonly found in variational autoencoders (VAEs) and improving the stability and generation quality of the model in modeling flow size distributions. In some implementations, this strategy introduces a weight coefficient α that increases with each training epoch, gradually increasing the weight of the KL divergence loss from an initial 0.1 to a final 0.9. This prioritizes optimizing the reconstruction loss in the early stages of training, ensuring that the model can quickly learn the local structural features of the input distribution. In the later stages of training, the constraint effect of the KL divergence loss is gradually strengthened, causing the distribution of the latent variable z to be closer to the standard normal distribution, enhancing generation diversity and preventing the model from degenerating into a deterministic mapping that only depends on the input.

[0076] This dynamic weighting mechanism plays a crucial role in practical applications, particularly in the flow size distribution modeling stage based on conditional variational autoencoders. Because the flow size distribution in real-world traffic data exhibits significant heterogeneity, introducing strong KL constraints too early in the training phase can lead to the model's inability to effectively fit the input distribution, thus affecting generation accuracy. By gradually increasing the KL weights, the model can maintain its reconstruction capability while progressively introducing distribution constraints, achieving a reasonable distribution of the latent space and diversity in generated samples.

[0077] In one embodiment of the invention, this step is for modeling the flow size distribution based on a conditional variational autoencoder. Corresponding to Figure 2 The second model inference includes the following three sub-steps:

[0078] 1) Distribution vector encoding and latent space constraints: Discretized distribution vectors are input into the encoder, and dimensionality is reduced to low-dimensional latent variables through nonlinear transformation. To ensure generation diversity, z is forced to follow a standard normal distribution, and its distribution bias is quantified using KL divergence. This design enables the latent space to have continuity, supporting the generation of new distributions from any z, thus overcoming the limitation of original data reproduction.

[0079] 2) A dynamic weighted training strategy is employed, where the loss function integrates reconstruction loss and KL divergence loss, balancing the two through dynamic weight adjustments: Initially, the KL divergence weight is reduced to minimize reconstruction error and accelerate model convergence; as training progresses, the KL divergence weight is gradually increased, forcing the latent variable distribution to approximate a standard normal distribution. This mechanism alleviates the common "posterior collapse" problem in VAE training and improves training efficiency.

[0080] 3) Conditional extension and heterogeneity modeling: The traffic load L is injected as a conditional variable into the encoder and decoder to construct a conditional variational autoencoder, so that the generated distribution is simultaneously controlled by the latent variable z and the load L.

[0081] This step reconstructs the distribution by deriving latent variables from the true distribution, thereby capturing the differences in flow size distribution among different IP pairs in bank data and completely overcoming the shortcomings of traditional globally homogeneous distributions. The conditional variational autoencoder used in this step is expressed as follows:

[0082] z = Encoder(M1(x) + M2(L))

[0083] y = Decoer(M3(z) + M4(L))

[0084]

[0085] Where x and y are the original input distribution and the reconstructed output distribution, respectively, z is the latent variable, L is the network load, and M represents the multilayer perceptron.

[0086] It is understood that, in this embodiment of the invention, the size distribution vector extracted in step S1 is used as input, and the autoencoder is required to reconstruct a similar distribution vector. At the same time, the intermediate condition vector is required to be close to a normal distribution, thus solving the problem of the failure of the homogenization assumption.

[0087] S3, decode the latent variable into a flow size distribution vector, and use it as the initial hidden state input condition gating loop unit. Through update gate and reset gate mechanism, autoregressively generate flow size and arrival interval time series to capture the time-series dependency characteristics in real traffic.

[0088] Specifically, in step S3, the flow temporal dependency modeling based on the Conditional Gated Recurrent Unit (cGRU) is a key step in achieving high-fidelity flow-level flow generation. This step decodes the flow size distribution vector generated in step S2 into latent variables and uses them as the initial hidden state of the cGRU, thereby introducing conditional constraints on distribution characteristics during sequence generation and effectively modeling the temporal dependencies in real flow.

[0089] In some implementations, the latent variable z is reconstructed by the decoder into a flow size distribution vector x', which consists of 200 discrete buckets, each corresponding to the frequency distribution within a specific flow size range. This distribution vector is then mapped to an initial hidden state h0 with the same dimension as the cGRU hidden state, typically using a fully connected layer (MLP) for dimensionality transformation and feature fusion. The input sequence of the cGRU contains joint features of the current flow size and arrival interval at each step, and is generated progressively through an autoregressive approach, where the output of each step serves as the input for the next, forming a closed-loop generation mechanism.

[0090] This step plays a crucial role in the overall technical solution, combining the heterogeneity of distributed modeling with the temporal dependency of sequence modeling. It significantly improves the authenticity and diversity of generated traffic, providing a stable and semantically meaningful initial state for subsequent block-based iterative generation. It is the core technical support for achieving high-fidelity stream-level traffic generation.

[0091] Furthermore, S3 includes:

[0092] S31, the flow size distribution vector and arrival interval distribution vector are converted into low-dimensional hidden vectors through the embedding module, and the hidden vectors are used as the initial hidden state of the conditional gated loop unit.

[0093] Specifically, this step involves converting the flow size distribution vector and arrival interval distribution vector into low-dimensional latent vectors through an embedding module, and using these latent vectors as the initial hidden state of a Conditional Gated Recurrent Unit (GRU). The core objective is to compress high-dimensional, discretized distribution features into a low-dimensional representation with semantic information, thereby providing an effective initial state for subsequent temporal modeling and enhancing the fidelity of generated flows in terms of temporal dependence and heterogeneity.

[0094] In some implementations, the embedding module employs a fully connected neural network (MLP) structure with an input dimension of 200 (corresponding to the length of the distribution vector after dynamic equal-frequency binning in step S1) and an output low-dimensional latent vector of 64 or 128 dimensions. The embedding process uses non-linear activation functions (such as ReLU or Tanh) to achieve feature compression and semantic mapping, ensuring that the latent vector retains the key statistical properties of the original distribution, such as long-tailed distribution, kurtosis, and skewness. During training, the embedding module optimizes parameters through backpropagation to minimize the reconstruction error (such as mean squared error, MSE, or cross-entropy loss) between the distribution vector and the reconstructed latent vector.

[0095] Furthermore, the flow size distribution vector and the arrival interval distribution vector are embedded independently to preserve their independence in the semantic space. The embedded latent vectors are then concatenated or weighted and fused to serve as the initial hidden state (h0) of the conditional GRU. This initial state injection method ensures that the sequence generation process is always constrained by the distribution features, thereby avoiding the flow distortion problem caused by ignoring distribution heterogeneity in traditional methods.

[0096] Regarding parameter settings, the hidden layers of the embedding module are typically set to two layers, with 128 and 64 nodes per layer, respectively, and the activation function is Leaky ReLU to enhance the model's nonlinear expressive power. The hidden layer dimension of the conditional GRU is kept consistent with the embedding output dimension to achieve state space alignment. This step acts as a bridge in the traffic generation process, effectively connecting distribution modeling and sequence modeling, laying the foundation for generating traffic sequences with realistic temporal dependency structures.

[0097] S32 utilizes the update gate of the conditional gating loop unit to control the retention ratio of the current hidden state to the historical state, and filters historical information that is irrelevant to the current flow by resetting the gate, so as to achieve accurate modeling of complex temporal patterns.

[0098] Specifically, this step introduces update gate and reset gate mechanisms to achieve dynamic control and filtering of historical state information, thereby accurately modeling complex timing patterns such as "control flow-data flow coupling".

[0099] In this step, the hidden state dimension of cGRU is typically set to 128 or 256 to balance model complexity and expressive power. The input feature dimension is 400 (200 flow size buckets + 200 arrival interval buckets), and a non-linear mapping is performed using a multilayer perceptron (MLP). During training, the model uses real flow sequences as supervision signals and models the temporal dependency structure by minimizing the cross-entropy loss of flow size and arrival interval.

[0100] In practical applications, this step can be deployed in data center network simulation platforms or network performance evaluation systems to generate flow-level traffic sequences with realistic temporal characteristics. Its technical value lies in effectively modeling the long-range dependency between flow size and arrival interval through a gating mechanism, overcoming the limitations of the traditional independent and identically distributed assumption, and significantly improving the realism of traffic generation and the evaluation accuracy of downstream tasks.

[0101] In one embodiment of the present invention, the present invention is based on flow timing dependency modeling of conditionally gated loop units, corresponding to Figure 2 The second model inference includes the following two sub-steps:

[0102] 1. Conditional injection mechanism: The flow size distribution vector and arrival interval distribution vector are embedded into the initial hidden state of the conditional gated loop unit through the size-to-hidden vector module, so that the sequence generation process is always constrained by the distribution characteristics and the heterogeneity of the original flow is preserved.

[0103] 2. Gated dependency capture: The update gate and reset gate of the conditional gating loop unit are used to dynamically adjust the transmission of historical information: the update gate controls the retention ratio of historical state, and the reset gate filters irrelevant historical information. Through gating collaboration, complex patterns such as "control flow-data flow coupling" (small flow followed by large flow) are accurately modeled.

[0104] This step reconstructs the flow sequence based on the true distribution, extracts the temporal dependencies of the true flow, and addresses the failure of the independence distribution assumption. The conditional gated cyclic unit formula used in this step is expressed as follows:

[0105] r t =σ(W xr x t +W hr h t-1 +b r )

[0106] z t =σ(W xz x t +W hz h t-1 +b z )

[0107]

[0108] Where, x t h represents the current input. t-1 Represents the previous hidden state, W and b represent the weight matrix and bias value, respectively, and r represents the previous hidden state. t Represents resetting the door, z t Represents the door update. h represents the alternative hidden state. t This is the current hidden state. and (s) t ,t t ) represent the reconstructed and actual current stream size and interval, respectively. σ represents the sigmoid activation function, ⊙ represents element-wise multiplication, and M represents a multilayer perceptron.

[0109] Therefore, this step uses the generated distribution vector as the initial latent vector and utilizes the conditionally gated cyclic unit to autoregressively generate the sequence of flow size and arrival time intervals to capture the temporal dependence characteristics of the actual flow.

[0110] S4 dynamically weights the training process based on the Jensen-Shannon divergence and sequence length of the traffic sequence, and randomly samples the output probability distribution during the generation process to improve the model convergence efficiency and enhance the diversity and coverage of the generated traffic.

[0111] At the technical implementation level, the dynamic weighting strategy first calculates the JSD value for each flow sequence to measure the temporal dependency between its flow size and arrival interval. As a symmetric measure of the similarity between two probability distributions, JSD effectively reflects the existence of complex dependency structures such as "control flow-data flow coupling" in the sequence. In some implementations, JSD calculation is based on the difference between the true sequence distribution and the distribution under the independent and identically distributed assumption; a larger value indicates a stronger temporal dependency. Simultaneously, the system introduces a sequence length factor, assigning higher training weights to longer sequences to ensure that the model maintains structural integrity and pattern consistency when generating long flow sequences. Specifically, the weight of each sequence in the training loss function can be expressed as w. i , where α and β are adjustable parameters used to balance the effects of dependence on strength and length.

[0112] During the generation phase, the system employs a probabilistic sampling mechanism instead of the traditional greedy decoding (i.e., taking the maximum probability value). Specifically, after determining the probability distribution of the output stream size and arrival interval at each step, the Conditionally Gated Recurrent Unit (GRU) generates specific values ​​by randomly sampling from this distribution (e.g., Gumbel-Softmax sampling or direct discrete sampling). This approach preserves the statistical properties of the original distribution while introducing randomness into the generation process, significantly improving the diversity and coverage of the generated traffic and preventing the model from merely replicating common patterns from the training data.

[0113] This step acts as a bridge in the entire system, connecting the distribution modeling and sequence generation stages. Through dynamic weighting, the model can focus more on long sequences with complex dependency structures, thereby improving overall training efficiency and generalization ability; while the random sampling mechanism effectively avoids the repetition of generated traffic, enhancing the model's practicality and privacy protection capabilities. In practical applications, this strategy is suitable for scenarios requiring high-fidelity traffic synthesis, such as data centers and enterprise networks, and has significant advantages, especially in traffic scheduling, cache optimization, and network performance evaluation.

[0114] Furthermore, S4 includes:

[0115] S41, calculate the Jensen-Shannon divergence between each flow sequence and its true distribution, and use the product of the divergence value and the sequence length as the weight of the sequence in training, so as to improve the model's ability to fit long sequences with high dependence.

[0116] Understandably, the system employs a probabilistic random sampling mechanism during training, rather than the traditional argmax approach of taking the maximum probability value. In each step of sequence generation, the model outputs a probability distribution, and the system performs Gumbel-Softmax sampling or Categorical sampling based on this distribution to obtain diverse flow sizes and arrival intervals. This mechanism effectively avoids the problem of generated results being highly similar to real data, reduces the risk of privacy leaks, and simultaneously improves the coverage and generalization ability of generated traffic.

[0117] This step plays a crucial optimization role in the overall technical solution. By dynamically adjusting the training weights, it enhances the model's ability to fit long sequences and strongly dependent patterns, thereby significantly improving the temporal fidelity and structural stability of the generated traffic. Experiments show that this strategy can reduce the KL divergence of the model in long sequence generation tasks by more than 15%, while improving the accuracy and diversity of sequence reconstruction.

[0118] S42, when the conditionally gated loop unit generates the flow size and arrival interval for each step, performs random sampling based on the output probability distribution instead of selecting the maximum probability value, in order to avoid the generated flow being highly similar to the original data, thereby reducing the risk of privacy leakage.

[0119] Specifically, when the Conditional Gated Recurrent Unit (GRU) generates the flow size and arrival interval for each step, it employs a random sampling mechanism based on the output probability distribution, rather than selecting the maximum probability value (argmax) in traditional methods. This is a key technical means for achieving high fidelity and privacy protection in the flow sequence generation stage of this invention. The technical implementation principle of this step is based on uncertainty modeling of the probabilistic generation model. It aims to break the strong correspondence between the generated flow and the original data by introducing randomness, thereby preserving the statistical characteristics of real flow while avoiding high similarity between the generated result and the original sample, thus reducing the risk of privacy leakage.

[0120] In terms of specific operation, the conditional GRU generates a discretized joint probability distribution of flow size and arrival interval at each output step, typically represented as a probability quality function (PMF) or probability density function (PDF). In this invention, this distribution is normalized by the GRU's output layer using a Softmax function or Gumbel-Softmax approximation, forming a distribution vector of dimension 200 (corresponding to the 200 buckets in the dynamic equal-frequency bucketing in step S1). During the generation process, the system does not use the argmax operation to select the highest probability value, but instead performs random sampling based on this distribution, for example, using Categorical sampling or Gumbel-Softmax sampling methods, to obtain flow size and arrival interval values ​​with randomness. This sampling method introduces diversity into the generation process, ensuring that each generated flow has a certain degree of random variation while satisfying the characteristics of the original distribution, thereby avoiding the direct replication of the original data.

[0121] From a technical perspective, the sampling process in this step is typically controlled by a temperature parameter during the training phase. Lower temperatures result in sampling results closer to the maximum probability value, while higher temperatures lead to more random sampling. In this invention, the temperature parameter is set between 0.8 and 1.2 to achieve a balance between generation fidelity and diversity. Furthermore, the output dimension of this step is 200, consistent with the bucketing strategy in step 1, ensuring that the generated traffic statistically matches the real data.

[0122] In practical applications, this step is widely used in data center network simulation, network performance evaluation, and security testing. Through a random sampling mechanism, the system can generate a large number of traffic samples with realistic statistical characteristics that do not duplicate the original data, thus effectively avoiding data privacy issues while meeting research needs. This mechanism has significant privacy protection value, especially in modeling sensitive business traffic (such as banking and healthcare).

[0123] The technical advantages of this step are twofold: firstly, it improves the coverage and diversity of generated traffic, preventing the model from getting stuck in local pattern repetition; secondly, by breaking the strong correspondence with the original data, it significantly reduces the possibility of privacy leaks. Compared to traditional deterministic generation methods, the random sampling strategy of this invention effectively improves the unpredictability and security of generated traffic while maintaining traffic statistical characteristics (such as mean, variance, and long-tail distribution), providing a solid guarantee for high-fidelity, low-risk flow-level traffic generation.

[0124] In one embodiment of the present invention, this step is training with dynamic weighting and random sampling, corresponding to... Figure 2 The process of loss calculation (③) and model update (④) includes the following two steps:

[0125] 1. The dependency-aware weighting strategy quantifies the temporal dependency strength of each traffic sequence based on JS divergence. At the same time, it combines the sequence length factor (long sequences need higher weights to maintain structural integrity) to assign higher weights to long sequences with high dependency. This mechanism significantly improves the model's ability to capture complex temporal patterns (such as "control flow-data flow coupling") and accelerates model training convergence.

[0126] 2. A probabilistic sampling mechanism is employed. When generating the flow size and arrival interval at each step in the conditionally gated recurrent unit, random sampling is performed based on the output probability distribution (rather than selecting the highest probability value). This ensures that the generated traffic maintains the original distribution characteristics while avoiding duplication with the original traffic, improving the coverage of the generated traffic and effectively addressing the privacy leakage risks caused by traditional deterministic generation. This step overcomes the bottlenecks of long-sequence training instability and insufficient generation diversity, providing technical support for industrial-grade high-fidelity traffic generation.

[0127] In this embodiment of the invention, during model training, the sequence is weighted according to the Jensen-Shannon divergence, giving sequences with strong temporal characteristics a greater training weight. Sequence length is also weighted to avoid overfitting of short sequences. To increase the comprehensiveness of training, the output distribution obtained in the above steps is sampled instead of its maximum value to generate specific flow rates, thus accelerating model convergence.

[0128] Furthermore, it also includes:

[0129] S5 divides the generated flow sequence into blocks according to the preset block length. After each block is generated, only the last flow unit of the block is retained as the initial hidden state of the next block, and the historical sequence is cleared. An infinitely long flow sequence is generated by iterative splicing to avoid the gradient vanishing problem caused by long sequence dependencies while preserving the local temporal structure.

[0130] Specifically, this step involves dividing the generated flow sequence into blocks according to a preset block length (e.g., 200 flow units). After each block is generated, only the state of the last flow unit in that block is retained as the initial hidden state of the next block, and the historical sequence is cleared. This effectively alleviates the gradient vanishing problem caused by long sequence dependencies while maintaining the local temporal structure.

[0131] At the technical implementation level, this step is based on iterative generation of a trained Conditional Gated Recurrent Unit (GRU) model. Specifically, the system first samples a latent variable z from a standard normal distribution, combines it with the user-specified network load L, and inputs it to the decoder of a trained Conditional Variational Autoencoder (CVAE) to generate the corresponding stream size distribution vector and arrival interval distribution vector. These two distribution vectors are then used as conditional variables to initialize the hidden state h of the Conditional GRU. oThis guides the sequence generation process. In the autoregressive generation process, each step outputs the size and arrival interval of the current stream unit and uses this stream unit as the input for the next step, thus realizing the step-by-step construction of the sequence.

[0132] To avoid the vanishing or exploding gradient problem during long sequence generation, the system employs a block-based iterative mechanism. When the generation reaches a preset block length (e.g., 200), only the hidden state ht of the last stream unit is retained as the initial state h of the next block. o The system then clears the previous historical sequence. This mechanism limits the sequence length, allowing the model to effectively capture local temporal dependencies (such as burst traffic and flow size clustering) within each block, while avoiding the problem of hidden state information decaying over time in traditional end-to-end generation. During the iterative splicing process, the system maintains context continuity through state propagation, thereby achieving the synthesis of infinitely long traffic sequences.

[0133] Regarding parameter settings, the block length is typically set to 200 to 500 flow units, depending on the complexity of the traffic patterns in the target application scenario. The dimension of the hidden state is generally set to 128 or 256 to balance the model's expressive power and computational efficiency. Furthermore, the system supports dynamic adjustment of the block length and hidden state dimension to adapt to different network topologies and load requirements.

[0134] In one embodiment of the present invention, for block-based iterative traffic generation, corresponding to Figure 2 Traffic generation process and Figure 3 The proposed traffic generation algorithm first samples latent variables from a standard normal distribution as the starting point for generation. This, combined with user-specified traffic load conditions, is input to the decoder to dynamically generate the flow size distribution and arrival interval distribution. Subsequently, the hidden state of the conditionally gated recurrent unit is initialized using the distribution vector as a condition, and flow units (flow size + arrival interval) are generated sequentially through an autoregressive loop. To overcome the dependency propagation bottleneck of ultra-long sequences, a block generation mechanism is adopted: after generating a sequence of a fixed length (e.g., 200 flows), only the last flow unit is retained as the initial state of the new block, and the historical sequence is cleared. Infinitely long traffic synthesis is achieved through iterative concatenation. This design preserves local temporal structure (such as the burst characteristics of continuous large flow clusters) while avoiding the gradient vanishing problem caused by traditional single-generation.

[0135] This step samples the data from the normal distribution based on the required load as an intermediate vector, and uses the decoder part of the autoencoder in step S2 to generate a distribution vector; the partial vector is used as the initial hidden vector, and the traffic sequence is generated step by step in a block manner using the cyclic unit in step S3.

[0136] In summary, this invention achieves a revolutionary improvement in network performance evaluation and optimization by breaking through the limitations of traditional modeling's assumptions of homogeneity and independence. The method first reveals two core characteristics of real traffic based on production environment data analysis: distribution heterogeneity and temporal dependency. Empirical studies show that traditional methods, by ignoring these characteristics, lead to a 4-17 fold increase in network evaluation error. To address this, Encore innovatively adopts a two-stage modeling architecture: In the distribution modeling stage, a conditional variational autoencoder is introduced, using traffic load as a conditional variable input. Diversity and accuracy are generated by dynamically adjusting the weights of KL divergence and reconstruction loss, thus solving the distribution heterogeneity problem. In the sequence modeling stage, a conditional gated recurrent unit is designed to embed the distribution vector into the initial hidden state, using update / reset gate mechanisms to capture temporal patterns such as "large flow clusters." A block-based iterative generation strategy solves the long sequence dependency problem, maintaining high accuracy even when generating long sequences. This framework achieves a closed loop from traffic feature extraction and distribution / temporal decoupling modeling to high-fidelity generation, providing a reliable data foundation for data center network optimization.

[0137] The beneficial effects of this invention are as follows:

[0138] This invention is a high-fidelity flow-level traffic generation model that integrates multiple modules such as conditional variational autoencoders, conditional gated cyclic units, and configuration management databases. The generated traffic has high realism and coverage, providing conditions for downstream network research.

[0139] Conditional variational autoencoders capture the heterogeneity of traffic distribution and greatly reduce the error of distribution modeling by dynamically adjusting the KL divergence weights to balance reconstruction accuracy and distribution diversity, thereby increasing the diversity of generated traffic.

[0140] The gated loop unit overturns the traditional assumption of temporal independence, captures the long-range dependency structure between flow size and arrival interval, and generates flow that retains temporal characteristics and is therefore highly realistic, improving the accuracy of downstream tasks.

[0141] Dynamic weight training assigns more weights to long sequences and highly dependent sequences, accelerating global convergence of the model and improving training stability.

[0142] This invention requires only a small amount of data for training, reducing the risk of privacy leaks and the cost of data collection, and greatly facilitating academic research in obtaining real traffic patterns.

[0143] To achieve the above embodiments, such as Figure 4 As shown, this embodiment also provides a flow-level flow generation device 10, including:

[0144] The flow partitioning and feature discretization module 100 is used to partition the original flow data into flow units based on the five-tuple, extract the size and arrival interval features of each flow, and discretize the feature values ​​into distribution vectors using the dynamic equal-frequency bucketing algorithm.

[0145] The conditional variational autoencoder modeling module 200 is used to input the distribution vector into the conditional variational autoencoder to generate latent variables that follow a standard normal distribution, and to realize load-aware modeling of flow size distribution under different application scenarios by dynamically adjusting the weights of KL divergence and reconstruction loss.

[0146] The conditional gated loop unit generation module 300 is used to decode the latent variable into a flow size distribution vector and input it as the initial hidden state into the conditional gated loop unit. The flow size and arrival interval time series are generated autoregressively through the update gate and reset gate mechanism to capture the temporal dependency characteristics in the real flow.

[0147] The dynamic weighting and diversity enhancement module 400 is used to dynamically weight the training process based on the Jensen-Shannon divergence and sequence length of the traffic sequence, and to randomly sample according to the output probability distribution during the generation process, so as to improve the model convergence efficiency and enhance the diversity and coverage of the generated traffic.

[0148] Furthermore, the flow partitioning and feature discretization module is also used for:

[0149] The size and arrival interval of each stream unit are mapped to multiple independent equal-frequency buckets, where the boundary of each bucket is adaptively adjusted according to the cumulative frequency of the current stream set to ensure that the number of samples in each bucket is approximately equal.

[0150] By configuring and managing the database, the flow units are labeled with application types and classified into corresponding application scenarios based on IP address information, so as to achieve independent modeling of traffic characteristics under different application scenarios.

[0151] Furthermore, the conditional variational autoencoder modeling module is also used for:

[0152] The flow load L is input as a condition variable into the encoder and decoder. The load information is fused with the distribution vector through a multilayer perceptron to generate a flow size distribution that matches the actual load.

[0153] The weight ratio of KL divergence loss to reconstruction loss is dynamically adjusted during the training phase.

[0154] Furthermore, the condition-gated loop unit generation module is also used for:

[0155] The flow size distribution vector and arrival interval distribution vector are converted into low-dimensional latent vectors through the embedding module, and the latent vectors are used as the initial hidden state of the conditional gated loop unit.

[0156] By utilizing the update gate of the conditional gating loop unit to control the retention ratio of the current hidden state to the historical state, and by filtering historical information that is irrelevant to the current flow through the reset gate, accurate modeling of complex temporal patterns can be achieved.

[0157] Furthermore, the dynamic weighting and diversity enhancement module is also used for:

[0158] Calculate the Jensen-Shannon divergence between each flow sequence and its true distribution, and use the product of the divergence value and the sequence length as the weight of the sequence in training to improve the model's ability to fit long sequences with high dependencies.

[0159] When the conditionally gated loop unit generates the flow size and arrival interval for each step, it performs random sampling based on the output probability distribution instead of selecting the maximum probability value, in order to avoid the generated flow being highly similar to the original data.

[0160] Furthermore, it also includes:

[0161] The sequence iterative splicing module is used to divide the generated traffic sequence into blocks according to a preset block length. After each block is generated, only the last flow unit of the block is retained as the initial hidden state of the next block, and the historical sequence is cleared. By iteratively splicing, an infinitely long traffic sequence is generated, so as to avoid the gradient vanishing problem caused by long sequence dependencies while preserving the local temporal structure.

[0162] The flow-level traffic generation device according to embodiments of the present invention effectively alleviates the gradient vanishing problem in long sequence generation by dividing the traffic sequence into blocks and iteratively splicing them together, using the last flow unit of each block as the initial hidden state of the next block. Under the premise of maintaining the consistency of local temporal structure, it achieves longer and more stable high-fidelity flow-level traffic generation, further improving the reliability and applicability of network performance evaluation and optimization.

[0163] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0164] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

Claims

1. A flow level traffic generation method, characterized by, include: S1, the original flow data is divided into flow units based on the five-tuple, and the size and arrival interval features of each flow are extracted. The dynamic equal-frequency bucketing algorithm is used to discretize the feature values ​​into distribution vectors. S2, the distribution vector is input into the conditional variational autoencoder to generate latent variables that follow a standard normal distribution. The flow load L is used as a condition variable and input into the encoder and decoder respectively. The load information is fused with the distribution vector through a multilayer perceptron to generate a flow size distribution that matches the actual load. The weight ratio of KL divergence loss and reconstruction loss is dynamically adjusted according to the training phase to realize load-aware modeling of flow size distribution under different application scenarios. S3, decode the latent variable into a flow size distribution vector, and use it as the initial hidden state input condition gating loop unit. Generate flow size and arrival interval time series autoregressively through update gate and reset gate mechanism to capture the time-series dependency characteristics in real traffic. S4 dynamically weights the training process based on the Jensen-Shannon divergence and sequence length of the traffic sequence, and randomly samples according to the output probability distribution during the generation process to improve model convergence efficiency and enhance the diversity and coverage of generated traffic. Specifically, the Jensen-Shannon divergence between each traffic sequence and the corresponding true distribution is calculated, and the product of the corresponding divergence value and the sequence length is used as the weight of the sequence in training to improve the model's ability to fit long sequences with high dependencies. When generating the flow size and arrival interval at each step in the conditionally gated recurrent unit, random sampling is performed based on the output probability distribution instead of selecting the maximum probability value to avoid the generated traffic being highly similar to the original data.

2. The method of claim 1, wherein, The process involves dividing the original traffic data into flow units based on 5-tuples, extracting the size and arrival interval features of each flow, and discretizing the feature values ​​into a distribution vector using a dynamic equal-frequency bucketing algorithm, including: S11, map the size and arrival interval of each flow unit to multiple independent equal-frequency buckets, wherein the boundary of each bucket is adaptively adjusted according to the cumulative frequency of the current flow set to ensure that the number of samples in each bucket is equal; S12, by configuring the management database, the flow units are labeled with application types and classified into corresponding application scenarios according to IP address information, so as to realize independent modeling of traffic characteristics under different application scenarios.

3. The method of claim 1, wherein, The process of decoding the latent variables into a flow size distribution vector and using it as the initial hidden state input condition gated loop unit, and then using update gates and reset gates to autoregressively generate flow size and arrival interval time series to capture the temporal dependency characteristics in real traffic, includes: S31, the flow size distribution vector and arrival interval distribution vector are converted into low-dimensional hidden vectors through the embedding module, and the hidden vectors are used as the initial hidden state of the conditional gated loop unit; S32 utilizes the update gate of the conditional gating loop unit to control the retention ratio of the current hidden state to the historical state, and filters historical information that is irrelevant to the current flow by resetting the gate, so as to achieve accurate modeling of complex temporal patterns.

4. The method of claim 1, wherein, Also includes: S5 divides the generated flow sequence into blocks according to the preset block length. After each block is generated, only the last flow unit of the block is retained as the initial hidden state of the next block, and the historical sequence is cleared. An infinitely long flow sequence is generated by iterative splicing to avoid the gradient vanishing problem caused by long sequence dependencies while preserving the local temporal structure.

5. A flow rate generation device, characterized in that, include: The flow partitioning and feature discretization module is used to partition the original flow data into flow units based on the five-tuple, extract the size and arrival interval features of each flow, and use the dynamic equal-frequency bucketing algorithm to discretize the feature values ​​into distribution vectors. The conditional variational autoencoder modeling module is used to input the distribution vector into the conditional variational autoencoder to generate latent variables that follow a standard normal distribution. The flow load L is used as a conditional variable and input into the encoder and decoder respectively. The load information is fused with the distribution vector through a multilayer perceptron to generate a flow size distribution that matches the actual load. The weight ratio of KL divergence loss and reconstruction loss is dynamically adjusted according to the training phase to realize load-aware modeling of flow size distribution under different application scenarios. The conditional gated loop unit generation module is used to decode the latent variables into a flow size distribution vector and input it as the initial hidden state into the conditional gated loop unit. The module generates a flow size and arrival interval time series in an autoregressive manner through update gate and reset gate mechanisms to capture the temporal dependency characteristics in the real flow. The dynamic weighting and diversity enhancement module dynamically weights the training process based on the Jensen-Shannon divergence and sequence length of the traffic sequences, and randomly samples the generated traffic based on the output probability distribution during the generation process. This improves model convergence efficiency and enhances the diversity and coverage of the generated traffic. Specifically, the Jensen-Shannon divergence between each traffic sequence and its true distribution is calculated, and the product of this divergence value and the sequence length is used as the weight of that sequence during training to improve the model's ability to fit long sequences with high dependencies. When the conditionally gated recurrent unit generates the flow size and arrival interval at each step, random sampling is performed based on the output probability distribution instead of selecting the maximum probability value to avoid the generated traffic being highly similar to the original data.

6. The apparatus as claimed in claim 5, characterized in that, The flow partitioning and feature discretization module is also used for: The size and arrival interval of each stream unit are mapped to multiple independent equal-frequency buckets, where the boundary of each bucket is adaptively adjusted according to the cumulative frequency of the current stream set to ensure that the number of samples in each bucket is equal. By configuring and managing the database, the flow units are labeled with application types and classified into corresponding application scenarios based on IP address information, so as to achieve independent modeling of traffic characteristics under different application scenarios.

7. The apparatus as claimed in claim 5, characterized in that, The condition-gated loop unit generation module is also used for: The flow size distribution vector and arrival interval distribution vector are converted into low-dimensional latent vectors through the embedding module, and the latent vectors are used as the initial hidden state of the conditional gated loop unit. By utilizing the update gate of the conditional gating loop unit to control the retention ratio of the current hidden state to the historical state, and by filtering historical information that is irrelevant to the current flow through the reset gate, accurate modeling of complex temporal patterns can be achieved.

Citation Information

Patent Citations

  • Private domain live broadcast room hotspot prediction and adaptive routing method based on swarm intelligence

    CN119254688A

  • Method and system for generating synthetic feature vectors from real, labelled feature vectors in artificial intelligence training of a big data machine to defend

    US20190132343A1