Dynamic pressure test scene generation method and system driven by multi-modal data
By encoding and integrating user behavior logs, API call sequences, and performance metrics using a multimodal data-driven approach, the problem of static scenario modeling and dynamic adaptation in complex distributed systems by existing stress testing tools is solved. This achieves improved simulation accuracy and dynamic adaptability, and optimizes resource utilization.
Patent Information
- Application Number
- CN202511168183.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-11-14
AI Technical Summary
Existing stress testing tools suffer from several drawbacks when facing modern complex distributed systems, including defects in static scenario modeling, scenario distortion due to the single data source, insufficient dynamic adaptation capabilities, low simulation accuracy, and low reproducibility of abnormal scenarios. These issues make it difficult to meet the testing needs of complex systems.
A multimodal data-driven approach is adopted. By encoding and fusing user behavior logs, full-link API call sequences and performance metrics from multiple sources, a graph attention network is constructed to generate an aligned event tuple sequence. This sequence is then dynamically adjusted in conjunction with real-time monitoring data to generate a stress test scenario.
It achieves improvements in high simulation accuracy, dynamic adaptability, and anomaly reproduction capability, reduces the error rate between simulated traffic and real business fluctuations, optimizes resource utilization, and provides a more efficient stress testing solution.
Smart Images

Figure CN120950361A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software performance testing technology, and in particular to a method and system for generating dynamic stress test scenarios driven by multimodal data. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] In the field of software performance testing, traditional stress testing tools (such as JMeter, LoadRunner, and Gatling) have long faced the following core technical bottlenecks, making it difficult for them to meet the testing needs of modern complex distributed systems.
[0004] 1. Inherent defects of static scene modeling.
[0005] Fixed script mechanism: Existing tools rely on manually written test scripts or simple parameterized configurations (such as CSV datasets), which cannot reflect the dynamic time-varying characteristics of real business traffic. For example, during the Double 11 promotion on e-commerce platforms, the number of user requests may show a pulse-like explosive growth (peak QPS is more than 10 times that of daily levels), while traditional tools can only simulate through step-by-step pressure increase, and cannot reproduce the steep curve of instantaneous traffic surge.
[0006] Periodic fluctuation distortion: For businesses with significant tidal effects (such as the morning and evening peak hours of online education platforms), traditional time series forecasting models (such as ARIMA) do not consider the migration of user behavior patterns, resulting in a significant phase difference between the load test and the actual traffic distribution.
[0007] 2. Scene distortion caused by the single source of data.
[0008] Dimensional fragmentation: Existing solutions can only utilize a single data source (such as historical access logs or preset rules), ignoring key related dimensions across the entire business chain: User behavior dimension: The temporal correlation of user operation sequences (such as browsing → adding to cart → payment) is not modeled; System dependency dimension: The topological relationship of API call chains under a microservice architecture is not included (such as order service depending on inventory service, payment gateway, etc.); Infrastructure dimension: The dynamic mapping between server load (CPU / memory / disk IOPS) and business throughput is not associated.
[0009] Missing anomaly patterns: Traditional fault injection tools (such as Chaos Monkey) only support randomized fault triggering and cannot reproduce business anomaly scenarios that are highly coupled with real fault patterns (such as order timeout backlog caused by slow database queries).
[0010] 3. Technological gaps in dynamic adaptation capabilities.
[0011] Adjusting for lag: During load testing, script parameters (such as user concurrency and request interval) need to be manually modified, making it impossible to achieve closed-loop feedback control with real-time monitoring metrics (such as system throughput and error rate).
[0012] Lack of adaptive mechanism: Existing dynamic adjustment schemes (such as threshold-based linear boost) do not establish a causal model between business fluctuations and resource consumption, resulting in a significant lag in parameter adjustment (usually on the order of minutes).
[0013] 4. Quantitative defects in simulation accuracy.
[0014] Error accumulation effect: In long-term stress testing (such as 24-hour stability testing), traditional methods fail to consider the non-stationary characteristics of business fluctuations, resulting in a continuous increase in the KL divergence between the traffic curve and the real scenario, ultimately leading to an error rate that generally exceeds 15%.
[0015] Low reproducibility of abnormal scenarios: The accuracy of reproducing complex failure modes (such as service avalanche + cache breakdown) is less than 60%, which is significantly lower than the actual failure rate in the production environment.
[0016] Existing time-series forecasting-based stress testing methods have the following limitations: Single-modal input: They rely solely on historical access logs for traffic prediction, without integrating multi-dimensional data such as API call chains and infrastructure performance; Static topology assumption: They assume fixed service dependencies, making them unable to adapt to dynamic service mesh topology changes in a serverless architecture; Open-loop control defects: They lack a feedback link with the real-time monitoring system, causing the prediction model to fail when business changes occur. Summary of the Invention
[0017] To address the aforementioned issues, this invention proposes a multimodal data-driven dynamic stress test scenario generation method and system, which significantly improves simulation accuracy, dynamic adaptability, anomaly reproduction capability, and resource utilization, providing an efficient and reliable solution for performance testing of modern complex distributed systems.
[0018] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for generating dynamic stress test scenarios driven by multimodal data, comprising: The acquired user behavior logs, end-to-end API call sequences, and performance metrics are encoded separately; among them, user behavior logs include user operation logs and user sessions; After extracting and matching user operation logs and the entire API call sequence, an aligned event pair sequence is generated. Feature enhancement is performed on each aligned event pair to obtain a local feature vector. Statistical features are extracted for each user session. A graph attention network is constructed using statistical features as nodes and the similarity between nodes as edges to identify user types and obtain a group feature matrix. A global association matrix is obtained based on the mapping between business load and resource consumption. The user session feature matrix and the group feature matrix are concatenated to generate group enhanced features. The group enhanced features are multiplied with the global correlation matrix to obtain system-level risk features. The local feature vectors are concatenated with the encoded user behavior logs. The system-level risk features are concatenated with the encoded performance indicators. The concatenated user behavior logs and performance indicators, as well as the encoded full-link API call sequence, are fused from multiple sources. The initial sequence of load testing parameters is generated based on the obtained multi-source fusion dataset, and the load testing scenario is generated after dynamic adjustment based on real-time monitoring data.
[0019] As an alternative implementation, the process of encoding user behavior logs includes: mapping user operation logs into 768-dimensional vectors and automatically segmenting user sessions; The process of encoding the entire API call sequence includes: constructing a heterogeneous graph neural network, with node types including services, interfaces, and databases, and edge types including calls, dependencies, and data transfers.
[0020] Performance metrics include server-level metrics, container-level metrics, and network-level metrics. Server-level metrics include CPU utilization, memory paging rate, disk IOPS, and latency. Container-level metrics include the Pod resource quota versus PVC storage volume throughput. Network-level metrics include the TCP retransmission rate versus connection establishment latency. The process of encoding performance metrics includes: using a temporal convolutional network to extract temporal patterns and outputting feature vectors of the same dimension as the user behavior log encoding.
[0021] As an alternative implementation, the process of obtaining local feature vectors includes: introducing business constraints when defining the cost matrix, namely: the operation event must be earlier than or equal to the corresponding API call event, and designing the maximum allowable time offset.
[0022] As an alternative implementation, the process of constructing a graph attention network includes: Statistical features are extracted for each user session, including: operation frequency distribution, temporal entropy, and device fingerprint features; Initial edge weights are calculated using cosine similarity, and business rule corrections are introduced: edge weights for users with fingerprints from the same device are increased by 0.2, and edge weights for users with temporal entropy differences of <0.1 are increased by 0.1. A multi-head attention mechanism is adopted, in which each head learns a different similarity metric, and the final edge weight is the weighted sum of the attention weights of each head.
[0023] As an alternative implementation method, the process of generating a stress testing scenario includes: A baseline traffic model is constructed by decoupling periodic components and detecting trend abrupt changes, and a traffic matrix that conforms to the actual business ratio is obtained by adding KL divergence constraint terms and proportional constraint terms. Built-in fault mode templates, each with a configured feature fingerprint library to generate realistic anomaly features, and gradient penalty terms are added to stabilize training.
[0024] As an alternative implementation method, the process of generating a stress test scenario also includes: using a PID reinforcement learning algorithm to predict traffic, calculating the KL divergence between the predicted traffic and the actual monitored traffic in real time, and triggering dynamic adjustment when it exceeds a set threshold.
[0025] Secondly, the present invention provides a multimodal data-driven dynamic stress test scenario generation system, comprising: The encoding module is configured to encode the acquired user behavior logs, end-to-end API call sequences, and performance metrics respectively; among which, the user behavior logs include user operation logs and user sessions; The three-level fusion module is configured to extract and match user operation logs and full-link API call sequences through event extraction, generate an aligned event pair sequence, perform feature enhancement on each aligned event pair to obtain a local feature vector, extract statistical features for each user session, construct a graph attention network with statistical features as nodes and similarity between nodes as edges to identify user types and obtain a group feature matrix, and obtain a global association matrix based on the mapping between business load and resource consumption. The multi-source fusion module is configured to concatenate the user session feature matrix and the group feature matrix to generate group enhanced features, perform matrix multiplication of the group enhanced features and the global correlation matrix to obtain system-level risk features, concatenate the local feature vector with the encoded user behavior log, concatenate the system-level risk features with the encoded performance indicators, and perform multi-source fusion of the concatenated user behavior log and performance indicators, as well as the encoded full-link API call sequence. The generation module is configured to generate an initial sequence of load testing parameters based on the obtained multi-source fusion dataset, and then generate a load testing scenario after dynamic adjustment based on real-time monitoring data.
[0026] Thirdly, the present invention provides an electronic device including a memory and a processor, and computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the method described in the first aspect.
[0027] Fourthly, the present invention provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the method described in the first aspect.
[0028] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect.
[0029] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention proposes a multimodal data-driven dynamic stress test scenario generation method, solving the problems of how to construct high-fidelity business scenarios through the fusion of multi-source heterogeneous data (user behavior logs, API call chains, performance baselines); how to achieve real-time dynamic adjustment of stress test parameters to reduce the error rate between simulated traffic and real business fluctuations; and how to automatically generate complex stress test scenarios including sudden traffic surges and service failures. Compared with traditional stress testing techniques, this method achieves significant technological breakthroughs and enhanced application value.
[0030] 1. Improved simulation accuracy: By integrating multi-source information such as user behavior logs, API call chains, and historical performance data, a stress testing scenario that closely resembles real business fluctuations can be constructed. Traditional methods often result in high error rates for scenario parameters due to single data sources and static models. However, this invention significantly reduces the error rate through multi-modal feature fusion and dynamic adjustment mechanisms, enabling more accurate reproduction of user operation sequences, service call topologies, and system load changes.
[0031] 2. Enhanced Dynamic Adaptability: Traditional stress testing tools often fail to reflect the true performance of the system in a timely manner when faced with sudden traffic surges or abnormal events due to delayed adjustments. This invention achieves millisecond-level response speeds through real-time data acquisition and dynamic parameter adjustment mechanisms, enabling rapid adaptation to sudden changes in business traffic and ensuring that the stress testing scenario remains highly synchronized with actual business fluctuations.
[0032] 3. Improved Anomaly Reproduction Capability: This invention incorporates multiple fault mode templates and combines them with advanced technologies such as generative adversarial networks to generate realistic anomaly features, significantly improving the accuracy of anomaly scenario reproduction. Traditional methods, due to their simple fault injection mechanisms, often fail to reproduce complex scenarios highly coupled with real fault modes. This invention, however, utilizes dynamic scenario decoupling generation technology to achieve independent control and flexible combination of baseline traffic and anomaly events, providing strong support for system resilience testing.
[0033] 4. Optimized resource utilization: Traditional stress testing often leads to resource waste due to scenario distortion or delayed adjustments. This invention, through lightweight online inference technology and adaptive control modules, reduces model inference latency and resource consumption while ensuring accuracy, thereby improving the utilization of the stress testing cluster and saving hardware investment costs.
[0034] Advantages of additional aspects 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
[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0036] Figure 1 This is a flowchart of the method for generating dynamic stress test scenarios driven by multimodal data provided in Embodiment 1 of the present invention. Detailed Implementation
[0037] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0038] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0039] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form as well. Furthermore, it should be understood that the terms “comprising” and “including”, and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0040] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0041] Example 1 This embodiment proposes a multimodal data-driven dynamic stress test scenario generation method, which achieves end-to-end closed-loop control from data acquisition to scenario execution through a layered architecture, such as... Figure 1 As shown, it specifically includes: The acquired user behavior logs, end-to-end API call sequences, and performance metrics are encoded separately; among them, user behavior logs include user operation logs and user sessions; After extracting and matching user operation logs and the entire API call sequence, an aligned event pair sequence is generated. Feature enhancement is performed on each aligned event pair to obtain a local feature vector. Statistical features are extracted for each user session. A graph attention network is constructed using statistical features as nodes and the similarity between nodes as edges to identify user types and obtain a group feature matrix. A global association matrix is obtained based on the mapping between business load and resource consumption. The user session feature matrix and the group feature matrix are concatenated to generate group enhanced features. The group enhanced features are multiplied with the global correlation matrix to obtain system-level risk features. The local feature vectors are concatenated with the encoded user behavior logs. The system-level risk features are concatenated with the encoded performance indicators. The concatenated user behavior logs and performance indicators, as well as the encoded full-link API call sequence, are fused from multiple sources. The initial sequence of load testing parameters is generated based on the obtained multi-source fusion dataset, and the load testing scenario is generated after dynamic adjustment based on real-time monitoring data.
[0042] The method of this embodiment will be described in detail below.
[0043] I. Multi-source data acquisition layer: Construct a three-dimensional data acquisition network covering user behavior, system interaction, and infrastructure to solve the problem of single data source in traditional solutions.
[0044] Specifically: 1. Collection of user behavior logs: Deploy non-intrusive JavaScript probes to capture front-end user operation logs (such as clicks, inputs, and navigation) and user session-level time-series characteristics; stream the logs to the data lake via Kafka, store them in Delta Lake format, and support ACID transactions and version backtracking.
[0045] 2. End-to-end API call sequence tracing: Distributed tracing is implemented based on OpenTelemetry, and SpanID and ParentID are automatically labeled to build service call topology; a special critical dependency link marking algorithm is designed to identify core paths such as order creation → payment callback → inventory deduction through the PageRank algorithm.
[0046] 3. Collection of performance indicators, including: Server-level metrics: CPU utilization (distinguishing between user mode and system mode), memory paging rate, disk IOPS, and latency; Container-level metrics: Pod resource quota, PVC storage volume throughput; Network-level metrics: TCP retransmission rate, connection establishment delay (SYN to SYN-ACK interval).
[0047] 4. Data preprocessing: Outlier repair: The KNN-Smooth algorithm is used to fill in the missing monitoring data caused by network jitter; Feature standardization: Perform Box-Cox transformation on latency-related metrics (such as API response time) to eliminate dimensional differences.
[0048] 2. Time alignment: Adopting a variant of the Dynamic Time Warping (DTW) algorithm - FastDTW, the time axis of user behavior logs, full-link API call sequence and performance indicators is aligned to millisecond precision; a time window folding strategy is designed, using 1-second granularity aggregation for sudden traffic scenarios (such as flash sales) and 10-second granularity for stable periods to reduce computational overhead.
[0049] III. Semantic encoding, specifically: User behavior log encoding: Based on the BERT-Base model fine-tuning, the operation sequence is mapped to a 768-dimensional vector, and a special Position Embedding is designed to encode the operation timing.
[0050] Among them, based on the BERT-Base model fine-tuning, the operation interval time is introduced as an additional feature input, so that the sequence encoding contains temporal information; a session segmentation strategy is designed to automatically segment ultra-long sessions (more than 1 hour) to avoid gradient vanishing.
[0051] API call chain encoding: Construct a heterogeneous graph neural network (HGNN), with node types including services, interfaces, and databases, and edge types including calls, dependencies, and data transmission; a special critical path enhancement mechanism is designed to exponentially weight the edge weights of core paths such as order creation → payment callback → inventory deduction.
[0052] Performance index encoding: Temporal patterns are extracted using TCN (Temporal Convolutional Network), and feature vectors of the same dimension as the above encoding are output.
[0053] Fourth, multimodal spatiotemporal fusion technology addresses the multi-source heterogeneity of user behavior, system interaction, and infrastructure data, and constructs spatiotemporally coherent scene features.
[0054] Specifically: 1. Design a three-level feature fusion channel (local fusion → group fusion → global fusion), and realize semantic connection from micro-operation to macro system through hierarchical abstraction, and finally output a unified multi-dimensional risk assessment vector.
[0055] 1-1. Local Fusion (User Session Level): Constructing a temporal causal chain between a single user's action and the system's response. Specifically: (1) Implementation of timing alignment optimization: Data preprocessing: Extract event timestamps from user operation logs (e.g., [t1:browse, t2:add_cart, t3:pay]) and API call chains (e.g., [t1':GET / item, t2':POST / cart, t3':POST / order]).
[0056] FastDTW adaptation: Employs a sliding window mechanism (window size = 500ms, step size = 100ms) to perform dynamic segment matching on non-equal length sequences; Among them, business constraints are introduced when defining the cost matrix, namely: the operation event must be earlier than or equal to the corresponding API call event (such as clicking the "Pay" button must precede the initiation of the POST / order request); the maximum allowed time offset is 500ms (obtained through training with business labeled data).
[0057] Output: Generate an aligned sequence of tuples [(op_vec, api_vec), ...] with a timing error ≤ 50ms.
[0058] (2) Local feature encoding: For each aligned event pair, feature enhancement is performed, including operation delay features and response state features. The output dimension is: 768 (BERT encoding) + 64 (temporal features) = 832-dimensional local feature vector.
[0059] 1-2. Group Integration (User Group Level) Objective: To uncover abnormal propagation paths in group behavior patterns.
[0060] (1) Construction of user feature vectors: Statistical features are extracted for each user session, including operation frequency distribution, temporal entropy, and device fingerprint features; the dimensionality is reduced to 128 dimensions using PCA, which are then used as the initial features for GAT nodes.
[0061] (2) Graph Attention Network (GAT) optimization: (2-1) Edge weight calculation: Initial edge weights are calculated using cosine similarity, and business rule corrections are introduced: edge weights for users with fingerprints from the same device are increased by 0.2, and edge weights for users with temporal entropy differences of <0.1 are increased by 0.1.
[0062] (2-2) Multi-head attention mechanism: Eight attention heads are executed in parallel, and each head learns a different similarity metric (e.g., some heads focus on the similarity of operation sequences, while others focus on the similarity of device features); the final edge weight is the weighted sum of the attention weights of each head.
[0063] (3) Behavioral motivation inference layer: Identify user types and obtain group feature matrix and user type labels.
[0064] 1-3. Global Integration (System Level): Establish a dynamic mapping model between business load and resource consumption.
[0065] (1) Construction of the correlation mapping matrix: collect business indicators and resource indicators; use the LightGBM regression model to learn the non-linear mapping from business indicators to resource indicators.
[0066] (2) Dynamic threshold generation: Based on historical data, fit the probability distribution of resource consumption (assuming a Gaussian distribution), calculate the dynamic threshold with a 95% confidence interval, and trigger an alarm when the real-time observed value exceeds the threshold. 1-4. Three-level integration.
[0067] Local to Group Fusion: The local feature vectors are concatenated with the group feature matrix, and group-enhanced features are generated through a cross-attention mechanism; Group → Global Fusion: Perform matrix multiplication between the group-enhanced features and the global correlation matrix to obtain system-level risk features; Concatenate the local feature vectors with the encoded user behavior logs; The system-level risk characteristics are combined with the coded performance metrics.
[0068] The three-level fusion addresses the problem of macro-level business risk perception, while the multi-modal fusion addresses the problem of micro-level operational semantic understanding. The two achieve gradient propagation through a shared GELU activation function, forming an end-to-end joint optimization.
[0069] 1-5. Design a cross-attention mechanism, generate attention weights through Softmax, and perform multi-source fusion of the spliced user behavior logs and performance metrics, as well as the encoded full-link API call sequence.
[0070] Design advantages analysis: Dynamic weighting mechanism: Automatically identify key operation stages (such as the immediate order placement operation in a flash sale) through cross-attention, and enhance dependency analysis of API call chains during stable periods; Noise resistance: Compared with ReLU, the GELU activation function has a smoother decision boundary and can effectively filter out abnormal operation sequences; Computational efficiency optimization: The fusion process employs matrix parallel computation; Enhanced interpretability: By visualizing attention weights, key operational paths that impact performance (such as specific API call sequences preceding slow database queries) can be identified.
[0071] 5. Dynamic stress testing scenario generation enables full-process modeling from historical data learning to real-time traffic prediction.
[0072] Technical Implementation: 1. Encoder-decoder architecture: Encoder: A time-series prediction module based on Transformer, which takes 7 days of historical fusion features as input and outputs a hidden state vector; a specially designed periodic position encoding is used to inject daily (24-hour) and weekly (7-day) patterns into the attention mechanism.
[0073] Decoder: Combines real-time streaming data (such as current order volume, payment interface RT) to generate a stress test parameter sequence with a granularity of the next 5 minutes through LSTM decoding; introduces an adversarial training mechanism, in which the generator and discriminator engage in a minimax game to improve the realism of the scene.
[0074] Specifically: 1-1. Traffic Baseline Generation: Construct an independently controllable baseline traffic model to provide a stable benchmark for anomaly injection.
[0075] (1) Optimization of the multi-period prediction model: (1-1) Decoupling of periodic components: Daily cycle (24h): Fixed periodic components are extracted by Fourier transform (period=24, order=3). Weekly cycle (7 days): Using Prophet's custom seasonality module, the cycle was set to 7 days and the prior scale to 0.5. Annual cycle (holidays): Construct holiday feature vectors (e.g., [is_holiday, days_to_holiday]) and encode them into 16-dimensional context vectors using LSTM.
[0076] (1-2) Trend mutation detection mechanism: The ADF test statistic of the residual sequence is calculated in real time, and a mutation alarm is triggered when the p value is <0.01; An online learning strategy is adopted: the original model is used for prediction before the mutation point; after the mutation point, LSTM incremental learning is started (learning rate = 0.001, batch size = 32); the historical window retains the data of the most recent 7 days to prevent concept drift.
[0077] Output: Minute-level baseline traffic curve, error rate <3% (verified by a certain e-commerce platform).
[0078] 1-2. Optimization of flow curve generation: (1) Copula correlation modeling: We choose the t-Copula function (degrees of freedom = 5) to model the asymmetric correlation between interfaces.
[0079] The parameter estimation adopts a two-stage method: KDE is used to estimate the marginal distribution of traffic at each interface; and maximum likelihood is used to estimate the Copula parameters.
[0080] Sampling process: Generate a uniformly distributed random vector (u1, u2); obtain the relevant random variables (x1, x2) through inverse Copula transformation.
[0081] (2) Enhancing proportional constraints: Add a KL divergence constraint term and a proportional constraint term (weight = 0.3) to the generator loss of WGAN-GP. (3) Output: A traffic matrix that matches the actual business ratio (e.g., orders:payments = 3:1, product queries:inventory checks = 5:2).
[0082] 2. Anomaly Injection Layer: It has 18 built-in fault mode templates (such as Redis cache penetration, database connection pool leakage), and each mode is configured with a feature fingerprint library; realistic anomaly features are generated through WGAN-GP (improved generative adversarial network), and gradient penalty terms are added to the discriminator loss function to stabilize training.
[0083] Specifically: Enables programmable abnormal scenario generation and supports complex fault chain simulation; 2-1. Optimized implementation of the fault mode library: (1) Construction of the feature fingerprint database: Define a three-dimensional feature space: Traffic dimension: QPS sudden change level (e.g., 3 times, 10 times); Behavioral dimension: Request distribution offset (e.g., hot key concentration > 80%); Resource dimension: Abnormal system indicators (such as CPU utilization > 90%).
[0084] Establish a hypercube decision boundary for each failure mode (such as cache penetration).
[0085] (2) WGAN-GP generation optimization: (2-1) Generator Architecture: Input layer: 128-dimensional Gaussian noise + 8-dimensional conditional coding (fault type + severity level); Hidden layers: 4 fully connected layers (256 units per layer, LeakyReLU activated); Output layer: Feature fingerprint vector (restricted to the interval [-1,1] by Tanh).
[0086] (2-2) Discriminator Improvement: Add Spectral Normalization for stable training; The gradient penalty term coefficient is 10 (consistent with the original WGAN-GP setting).
[0087] (2-3) Output: Abnormal feature samples with a fidelity > 0.85 (after manual evaluation).
[0088] 2-2. Optimization of the event orchestration engine: Fault propagation path calculation: Construct a service dependency directed graph G=(V,E), edge weight = number of calls / minute; use Monte Carlo Tree Search (MCTS) to predict propagation path: number of simulations = 1000, evaluation metrics: number of affected services, business interruption duration.
[0089] Heuristic pruning strategy: Remove dependent edges whose weight is less than the threshold (default 0.1); merge equivalent fault chains (e.g., A→B→C and A→D→C are considered equivalent).
[0090] Visual orchestration interface: Supports drag-and-drop fault chain design (such as "circuit breaker triggered → dependent service timeout → degradation strategy takes effect"), and displays a heat map of the impact range in real time (based on service criticality weighted calculation).
[0091] In this embodiment, a decoupling control mechanism is adopted: Baseline traffic and abnormal events are injected through a separate control channel: Baseline traffic: Temporal patterns are generated through a TCN temporal convolutional network; Abnormal events: Abnormal characteristics are superimposed at a specified time through event triggers.
[0092] Hybrid layer design: An additive hybrid model is adopted, and the coefficient α is dynamically adjusted to achieve anomaly intensity control (0≤α≤1).
[0093] In this embodiment, the dynamic scene generation process is as follows: Baseline generation: Generates stationary flow curves based on historical data; Anomaly injection: Superimposing fault features enhanced by WGAN-GP at a specified time point; Propagation simulation: Calculate cascading failure paths using service dependency graphs; Impact assessment: Real-time calculation of business metrics (such as order success rate and page response time).
[0094] Typical application scenario example: Flash Sale Test: Baseline Traffic: Regular traffic predicted by the daily cycle model (approximately 50,000 QPS); Anomaly Injection: 10 times the burst traffic at the start of the event (consistent with cache penetration characteristics); Propagation Path: Rate limiting component → Order service → Inventory service → Database; Observation Metrics: Inventory deduction latency increased from 20ms to 820ms, with an error of <7% compared to the actual failure scenario.
[0095] VI. Adaptive control module, which realizes millisecond-level dynamic adjustment of pressure test parameters with an error rate of ≤5%.
[0096] 1. PID Reinforcement Learning Algorithm: State space: a 3-dimensional vector consisting of current QPS, average response time, and error rate; Action space: User concurrency adjustment (ΔC), request interval adjustment (ΔT); Reward function: ; where e QPS e is the QPS error rate. RT , where is the response time error rate, 'a' is the action amplitude, and 'w' is the adjustable weight.
[0097] 2. Error feedback mechanism: The KL divergence between predicted flow and actual monitored flow is calculated in real time. When DKL > 0.05, model fine-tuning is triggered. Fine-tuning strategy: The Elastic Weight Consolidation (EWC) algorithm is used to prevent catastrophic forgetting.
[0098] VII. Lightweight Online Inference Technology. While maintaining accuracy, the model inference latency is reduced to less than 20ms to meet real-time adjustment requirements.
[0099] 1. Knowledge distillation framework, including: Teacher model: The Transformer-Big architecture (12-layer encoder, 1024 hidden layer dimensions) is adopted and pre-trained on historical stress test data; the output layer adds an uncertainty estimation branch to provide the confidence interval of the prediction results.
[0100] Student model: The TinyBERT architecture (4-layer encoder, 312-dimensional hidden layer) is designed, and the knowledge of the teacher model is inherited through attention matrix distillation. Dynamic quantization technology is introduced to compress the weight precision from FP32 to INT8, which improves the inference speed by 3.2 times.
[0101] 2. Hardware acceleration optimization: Operator fusion: Combines operations such as LayerNorm and residual connection into a single CUDA kernel function to reduce kernel startup overhead; performs piecewise linear approximation of the GELU activation function to improve computation speed.
[0102] Memory reuse: Design a feature cache pool mechanism to directly reuse historical encoding results for recurring user behavior sequences; avoid redundant data transmission between CPU and GPU through zero-copy technology.
[0103] The multimodal data-driven dynamic stress test scenario generation method proposed in this embodiment achieves significant technological breakthroughs and enhanced application value compared to traditional stress test techniques: 1. Improved simulation accuracy: By integrating multi-source information such as user behavior logs, API call chains, and historical performance data, a stress testing scenario that closely resembles real business fluctuations can be constructed. Traditional methods often result in high error rates for scenario parameters due to single data sources and static models. However, this embodiment significantly reduces the error rate through multi-modal feature fusion and dynamic adjustment mechanisms, enabling more accurate reproduction of user operation sequences, service call topologies, and system load changes.
[0104] 2. Enhanced Dynamic Adaptability: Traditional stress testing tools often fail to reflect the true performance of the system in a timely manner when faced with sudden traffic surges or abnormal events due to delayed adjustments. This embodiment achieves millisecond-level response speed through real-time data acquisition and dynamic parameter adjustment mechanisms, enabling it to quickly adapt to sudden changes in business traffic and ensuring that the stress testing scenario remains highly synchronized with actual business fluctuations.
[0105] 3. Improved Anomaly Reproduction Capability: This embodiment incorporates multiple fault mode templates and combines them with advanced technologies such as generative adversarial networks to generate realistic anomaly features, significantly improving the accuracy of anomaly scenario reproduction. Traditional methods, due to their simple fault injection mechanisms, often fail to reproduce complex scenarios highly coupled with real fault modes. This embodiment, however, utilizes dynamic scenario decoupling generation technology to achieve independent control and flexible combination of baseline traffic and anomaly events, providing strong support for system resilience testing.
[0106] 4. Optimized resource utilization: Traditional stress testing often leads to resource waste due to scenario distortion or delayed adjustments. This embodiment uses lightweight online inference technology and an adaptive control module to reduce model inference latency and resource consumption while ensuring accuracy, thereby improving the utilization of the stress testing cluster and saving hardware investment costs.
[0107] In summary, this embodiment achieves significant improvements in simulation accuracy, dynamic adaptability, anomaly reproduction capability, and resource utilization, providing an efficient and reliable solution for performance testing of modern complex distributed systems.
[0108] It should be noted that all data acquisition is conducted in accordance with laws and regulations and with user consent, and the data is used legally.
[0109] Example 2 This embodiment provides a multimodal data-driven dynamic stress test scenario generation system, including: The encoding module is configured to encode the acquired user behavior logs, end-to-end API call sequences, and performance metrics respectively; among which, the user behavior logs include user operation logs and user sessions; The three-level fusion module is configured to extract and match user operation logs and full-link API call sequences through event extraction, generate an aligned event pair sequence, perform feature enhancement on each aligned event pair to obtain a local feature vector, extract statistical features for each user session, construct a graph attention network with statistical features as nodes and similarity between nodes as edges to identify user types and obtain a group feature matrix, and obtain a global association matrix based on the mapping between business load and resource consumption. The multi-source fusion module is configured to concatenate the user session feature matrix and the group feature matrix to generate group enhanced features, perform matrix multiplication of the group enhanced features and the global correlation matrix to obtain system-level risk features, concatenate the local feature vector with the encoded user behavior log, concatenate the system-level risk features with the encoded performance indicators, and perform multi-source fusion of the concatenated user behavior log and performance indicators, as well as the encoded full-link API call sequence. The generation module is configured to generate an initial sequence of load testing parameters based on the obtained multi-source fusion dataset, and then generate a load testing scenario after dynamic adjustment based on real-time monitoring data.
[0110] It should be noted that the above modules correspond to the steps described in Embodiment 1, and the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the above modules, as part of the system, can be executed in a computer system such as a set of computer-executable instructions.
[0111] In further embodiments, the following is also provided: An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the method described in Embodiment 1. For brevity, further details are omitted here.
[0112] It should be understood that in this embodiment, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0113] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of memory may also include non-volatile random access memory. For example, memory may also store information about the device type.
[0114] A computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the method described in Embodiment 1.
[0115] The method in Example 1 can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can reside in readily available storage media in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not provided here.
[0116] A computer program product includes a computer program that, when executed by a processor, implements the method described in Embodiment 1.
[0117] The present invention also provides at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. The computer program product includes computer-executable instructions, such as instructions included in program modules, which execute in a device on a target real or virtual processor to perform the processes / methods described above. Typically, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., that perform specific tasks or implement specific abstract data types. In various embodiments, the functionality of program modules can be combined or divided among program modules as needed. The machine-executable instructions for the program modules can execute within a local or distributed device. In a distributed device, the program modules can reside in both local and remote storage media.
[0118] The computer program code used to implement the methods of the present invention may be written in one or more programming languages. This computer program code may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the computer or other programmable data processing device, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a computer, partially on a computer, as a stand-alone software package, partially on a computer and partially on a remote computer, or entirely on a remote computer or server.
[0119] In the context of this invention, computer program code or related data may be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, and the like. Examples of signals may include electrical, optical, radio, sound, or other forms of propagation signals, such as carrier waves, infrared signals, etc.
[0120] Those skilled in the art will recognize that the units and algorithm steps described in connection with the various examples of this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. 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 implementation should not be considered beyond the scope of this invention.
[0121] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A method for generating dynamic stress test scenarios driven by multimodal data, characterized in that, include: The acquired user behavior logs, end-to-end API call sequences, and performance metrics are encoded separately; among them, user behavior logs include user operation logs and user sessions; After extracting and matching user operation logs and the entire API call sequence, an aligned event pair sequence is generated. Feature enhancement is performed on each aligned event pair to obtain a local feature vector. Statistical features are extracted for each user session. A graph attention network is constructed using statistical features as nodes and the similarity between nodes as edges to identify user types and obtain a group feature matrix. A global association matrix is obtained based on the mapping between business load and resource consumption. The user session feature matrix and the group feature matrix are concatenated to generate group enhanced features. The group enhanced features are multiplied with the global correlation matrix to obtain system-level risk features. The local feature vectors are concatenated with the encoded user behavior logs. The system-level risk features are concatenated with the encoded performance indicators. The concatenated user behavior logs and performance indicators, as well as the encoded full-link API call sequence, are fused from multiple sources. The initial sequence of load testing parameters is generated based on the obtained multi-source fusion dataset, and the load testing scenario is generated after dynamic adjustment based on real-time monitoring data.
2. The method for generating dynamic stress test scenarios driven by multimodal data as described in claim 1, characterized in that, The process of encoding user behavior logs includes: mapping user operation logs into 768-dimensional vectors and automatically segmenting user sessions; The process of encoding the entire API call sequence includes: constructing a heterogeneous graph neural network, with node types including services, interfaces and databases, and edge types including calls, dependencies and data transfers; Performance metrics include server-level metrics, container-level metrics, and network-level metrics. Server-level metrics include CPU utilization, memory paging rate, disk IOPS, and latency. Container-level metrics include the Pod resource quota versus PVC storage volume throughput. Network-level metrics include the TCP retransmission rate versus connection establishment latency. The process of encoding performance metrics includes: using a temporal convolutional network to extract temporal patterns and outputting feature vectors of the same dimension as the user behavior log encoding.
3. The method for generating dynamic stress test scenarios driven by multimodal data as described in claim 1, characterized in that, The process of obtaining local feature vectors includes: introducing business constraints when defining the cost matrix, namely: the operation event must be earlier than or equal to the corresponding API call event, and designing the maximum allowable time offset.
4. The method for generating dynamic stress test scenarios driven by multimodal data as described in claim 1, characterized in that, The process of constructing a graph attention network includes: Statistical features are extracted for each user session, including: operation frequency distribution, temporal entropy, and device fingerprint features; Initial edge weights are calculated using cosine similarity, and business rule corrections are introduced: edge weights for users with fingerprints from the same device are increased by 0.2, and edge weights for users with temporal entropy differences of <0.1 are increased by 0.
1. A multi-head attention mechanism is adopted, in which each head learns a different similarity metric, and the final edge weight is the weighted sum of the attention weights of each head.
5. The method for generating dynamic stress test scenarios driven by multimodal data as described in claim 1, characterized in that, The process of generating a load testing scenario includes: A baseline traffic model is constructed by decoupling periodic components and detecting trend abrupt changes, and a traffic matrix that conforms to the actual business ratio is obtained by adding KL divergence constraint terms and proportional constraint terms. Built-in fault mode templates, each with a configured feature fingerprint library to generate realistic anomaly features, and gradient penalty terms are added to stabilize training.
6. The method for generating dynamic stress test scenarios driven by multimodal data as described in claim 1, characterized in that, The process of generating a stress test scenario also includes: using a PID reinforcement learning algorithm to predict traffic, calculating the KL divergence between the predicted traffic and the actual monitored traffic in real time, and triggering dynamic adjustment when it exceeds a set threshold.
7. A multimodal data-driven dynamic stress test scenario generation system, characterized in that, include: The encoding module is configured to encode the acquired user behavior logs, end-to-end API call sequences, and performance metrics respectively; among which, the user behavior logs include user operation logs and user sessions; The three-level fusion module is configured to extract and match user operation logs and full-link API call sequences through event extraction, generate an aligned event pair sequence, perform feature enhancement on each aligned event pair to obtain a local feature vector, extract statistical features for each user session, construct a graph attention network with statistical features as nodes and similarity between nodes as edges to identify user types and obtain a group feature matrix, and obtain a global association matrix based on the mapping between business load and resource consumption. The multi-source fusion module is configured to concatenate the user session feature matrix and the group feature matrix to generate group enhanced features, perform matrix multiplication of the group enhanced features and the global correlation matrix to obtain system-level risk features, concatenate the local feature vector with the encoded user behavior log, concatenate the system-level risk features with the encoded performance indicators, and perform multi-source fusion of the concatenated user behavior log and performance indicators, as well as the encoded full-link API call sequence. The generation module is configured to generate an initial sequence of load testing parameters based on the obtained multi-source fusion dataset, and then generate a load testing scenario after dynamic adjustment based on real-time monitoring data.
8. An electronic device, characterized in that, An electronic device comprising a memory and a processor, and computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, Used to store computer instructions, which, when executed by a processor, perform the method described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program, which, when executed by a processor, implements the method described in any one of claims 1-6.
Citation Information
Cited By
Intelligent AI pressure test method, device and platform of financial service system
CN121455793A
Data center east-west flow anomaly detection method and system based on deep learning
CN121690849A
A Deep Learning-Based Method and System for Detecting East-West Traffic Anomalies in Data Centers
CN121690849B
