Traffic playback method, apparatus, computer equipment, and storage medium based on large-scale language models

By deploying collectors at network boundaries or terminals, and using large-scale language models to process traffic data, generating structured semantic representations and constructing session templates, the problems of semantic ignoring, inflexible scenarios, privacy concerns, and high costs in existing traffic recording and playback technologies are solved, achieving efficient and controllable traffic playback.

CN123123485APending Publication Date: 2026-11-17BEIJING SMART LOGIC EAST TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611054698.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-15
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing traffic recording and playback technologies suffer from issues such as ignoring the semantics of higher-level protocols, lack of flexibility and generalization in playback scenarios, privacy and compliance problems, and high storage and transmission costs.

Method used

Large-scale language models are used to deploy collectors at network boundaries or terminals to capture raw network packets, parse and generate structured session sequences, process sensitive fields through desensitization strategies, generate structured semantic representations using large-scale language models, construct multi-level session templates, and generate playback plans by combining parameter sampling and network environment simulation to perform high-fidelity, transferable traffic playback.

Benefits of technology

It enables high-fidelity, portable traffic playback, reduces storage costs, supports anonymization, and improves the business effectiveness and privacy protection of playback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123485A_ABST
    Figure CN123123485A_ABST
Patent Text Reader

Abstract

This application provides a traffic replay method, apparatus, computer device, and storage medium based on a large-scale language model. The method includes: parsing, grouping, identifying protocols, extracting fields, and matching request-response relationships in captured raw network packets to generate a structured session sequence; replacing sensitive fields in the structured session sequence; inputting the desensitized structured session sequence into a pre-trained large-scale language model to generate a structured semantic representation; summarizing the structured semantic representation into session templates and storing them in a template library; selecting a session template from the template library according to the replay target to generate a replay plan; generating network requests according to the replay plan and sending requests to the system under test; collecting response information and performance indicators of the system under test during the replay process; and generating an evaluation report using the large-scale language model. This method can extract semantic information from packets, construct session representations, and perform efficient replay while ensuring privacy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer network and artificial intelligence fusion technology, specifically to a traffic replay method, apparatus, computer device and storage medium based on a large-scale language model. Background Technology

[0002] Currently, existing traffic recording and playback technologies mostly rely on precise capture and packet-by-packet replay at the packet layer. Problems include: ignoring higher-layer protocol semantics, resulting in playback failing to trigger application-layer logic or incomplete scenario reproduction; lack of flexibility and generalization in playback scenarios, making migration between different network environments or service versions difficult; privacy and compliance issues: recorded original packets often contain sensitive information, requiring complex desensitization strategies; and playback efficiency and capacity issues: large original packet volumes lead to high storage and transmission costs.

[0003] Therefore, the challenge lies in how to leverage large language models to extract semantic features from network traffic and generate traffic representations that can be used for high-fidelity, transferable, and controllable playback, while simultaneously reducing storage costs, supporting de-identification processing, and improving the effectiveness of playback services. Summary of the Invention

[0004] This application provides a traffic playback method, apparatus, computer device, and storage medium based on a large-scale language model.

[0005] A first aspect of this application provides a traffic replay method based on a large-scale language model, comprising: Deploy collectors at network boundaries or endpoints to capture raw network packets at the session or transaction granularity; The original network packets are parsed, grouped, protocol identified, fields extracted, and request-response relationship matched to generate a structured session sequence; A desensitization strategy combining rules and models is used to replace or encrypt sensitive fields in the structured session sequence, and the desensitization mapping relationship is recorded. The anonymized structured conversation sequence is input into a pre-trained large-scale language model to generate a structured semantic representation that includes intent, parameter abstraction, conversation flow, boundary conditions, and abnormal scenarios. The structured semantic representation is summarized into multi-level session templates, including atomic request templates, composite transaction templates, and business scenario templates, and stored in the template library; Based on the playback target, a session template is selected from the template library, and a playback plan is generated by combining parameter sampling strategy, time control strategy, concurrency control strategy and network environment simulation strategy. Reconstruct or generate network requests according to the replay plan, send requests to the system under test through the protocol stack, and inject controllable network conditions during the sending process; The system collects response information and performance metrics of the tested system during playback, and uses a large-scale language model to perform semantic-level compliance and validity assessment of the playback results, generating an assessment report.

[0006] In an optional embodiment of this application, the step of inputting the desensitized structured conversation sequence into a pre-trained large-scale language model to generate a structured semantic representation containing intent, parameter abstraction, conversation flow, boundary conditions, and abnormal scenarios includes: The large-scale language model generates the structured semantic representation through fine-tuning, cue engineering, or structured output constraints. The semantic representation also includes temporal features, concurrency features, and state transition information.

[0007] In one optional embodiment of this application, the template library supports version management, template reuse, and parameterized variation to adapt to different network environments, service versions, or testing scenarios.

[0008] In an optional embodiment of this application, the network conditions include one or more of latency, jitter, packet loss, and rate limiting; the playback execution supports breakpoint resumption and automatic retry mechanisms for abnormal events.

[0009] In an optional embodiment of this application, the playback execution also supports message reconstruction or semantic-driven request generation, and can simulate network environments with latency, packet loss, and rate limiting.

[0010] In an optional embodiment of this application, the semantic-level evaluation includes: determining whether the expected business logic is triggered, whether abnormal paths and branch conditions are covered, whether potential defects occur, and optimizing the template library based on the evaluation results.

[0011] In an optional embodiment of this application, the method further includes: collecting call chain tracing information and combining a large-scale language model to perform business logic compliance judgment and anomaly coverage analysis on the replay results.

[0012] A second aspect of this application provides a traffic playback device based on a large-scale language model, comprising: The generation module is used to deploy collectors at network boundaries or terminals to capture raw network packets at the session or transaction granularity; and to parse, group, identify protocols, extract fields, and match request-response relationships in the raw network packets to generate structured session sequences. The input module is used to replace or encrypt sensitive fields in the structured conversation sequence based on a desensitization strategy that combines rules and models, and to record the desensitization mapping relationship; the desensitized structured conversation sequence is input into a pre-trained large-scale language model to generate a structured semantic representation that includes intent, parameter abstraction, conversation flow, boundary conditions and abnormal scenarios; The selection module is used to summarize the structured semantic representation into multi-level session templates, including atomic request templates, composite transaction templates, and business scenario templates, and store them in the template library; select a session template from the template library according to the replay target, and generate a replay plan by combining parameter sampling strategy, time control strategy, concurrency control strategy, and network environment simulation strategy; The evaluation module is used to reconstruct or generate network requests according to the replay plan, send requests to the system under test through the protocol stack, and inject controllable network conditions during the sending process; collect response information and performance indicators of the system under test during the replay process, and use a large-scale language model to perform semantic-level compliance and validity evaluation of the replay results, and generate an evaluation report.

[0013] A third aspect of this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the above-mentioned traffic replay methods based on a large-scale language model.

[0014] A fourth aspect of the embodiments of this application provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of the traffic replay method based on a large-scale language model as described above.

[0015] Compared with the prior art, the technical solutions provided in this application have at least some or all of the following advantages: The traffic replay method based on a large-scale language model described in this application deploys a collector at the network boundary or terminal to capture original network packets at the session or transaction granularity; it parses, groups, identifies protocols, extracts fields, and matches request-response relationships in the original network packets to generate a structured session sequence; it replaces or encrypts sensitive fields in the structured session sequence based on a rule-based and model-based desensitization strategy and records the desensitization mapping relationship; it inputs the desensitized structured session sequence into a pre-trained large-scale language model to generate a structured semantic representation containing intent, parameter abstraction, session flow, boundary conditions, and abnormal scenarios; and it summarizes the structured semantic representation into a multi-level session template, including the original... Sub-request templates, composite transaction templates, and business scenario templates are stored in a template library. A session template is selected from the template library based on the replay target, and a replay plan is generated by combining parameter sampling strategies, time control strategies, concurrency control strategies, and network environment simulation strategies. A network request is reconstructed or generated according to the replay plan, and the request is sent to the system under test through the protocol stack, injecting controllable network conditions during the sending process. Response information and performance indicators of the system under test during the replay process are collected, and a large-scale language model is used to perform semantic-level compliance and effectiveness evaluation of the replay results, generating an evaluation report. This system can extract semantic information from messages, construct generalizable session representations, and perform efficient replay while ensuring privacy. Attached Figure Description

[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart of a traffic replay method based on a large-scale language model provided in one embodiment of this application; Figure 2 A flowchart of semantic representation generation provided in one embodiment of this application; Figure 3 A schematic diagram of a traffic playback device based on a large-scale language model provided in one embodiment of this application; Figure 4 This is a schematic diagram of a computer device structure provided in one embodiment of this application. Detailed Implementation

[0017] In the process of developing this application, the inventors discovered that current traffic recording and playback technologies are inferior in terms of storage costs, support for de-identification processing, and the effectiveness of playback services.

[0018] To address the aforementioned issues, this application provides a traffic replay method, apparatus, computer equipment, and storage medium based on a large-scale language model, in order to reduce storage costs, support de-identification processing, and improve the effectiveness of replay services.

[0019] The solutions in this application embodiment can be implemented using various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0020] To make the technical solutions and advantages of the embodiments of this application clearer, the exemplary embodiments of this application will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not an exhaustive list of all embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.

[0021] Please see Figure 1 The traffic replay method based on a large-scale language model provided in this application includes the following steps S100 to S800: S100: Deploy collectors at network boundaries or terminals to capture raw network packets at the session or transaction granularity. S200, the original network packets are parsed, grouped, identified by protocols, extracted by fields, and matched for request-response relationships to generate a structured session sequence; S300, based on a desensitization strategy combining rules and models, sensitive fields in the structured session sequence are replaced or encrypted, and the desensitization mapping relationship is recorded; S400 inputs the anonymized structured conversation sequence into a pre-trained large-scale language model to generate a structured semantic representation that includes intent, parameter abstraction, conversation flow, boundary conditions, and abnormal scenarios. The semantic representation generation flowchart is shown below. Figure 2 As shown; S500, the structured semantic representation is summarized into multi-level session templates, including atomic request templates, composite transaction templates and business scenario templates, and stored in the template library; S600: Select a session template from the template library according to the playback target, and generate a playback plan by combining parameter sampling strategy, time control strategy, concurrency control strategy and network environment simulation strategy; S700, according to the playback plan, reconstruct or generate a network request, send the request to the system under test through the protocol stack, and inject controllable network conditions during the sending process; The S800 collects response information and performance indicators of the system under test during playback, and uses a large-scale language model to perform semantic-level compliance and validity assessment of the playback results, generating an assessment report.

[0022] In an optional embodiment of this application, the scenario background is as follows: Data source: 512 nodes, each node independently calculates a portion of the protein trajectory; Task composition: Energy Calculation, Conformation Update, Trajectory Output. Inter-node interaction: MPI (Message Passing Interface) / RPC (Remote Procedure Call) / File I / O, as well as communication latency and synchronization. Replay objectives: Functional correctness (consistent calculation results), performance evaluation (throughput, latency, scalability), anomaly coverage (node ​​anomalies, slow nodes, network jitter). In step S100, the objective is to capture the task execution behavior, communication, and I / O records of each node. Implementation method: Deploy a data acquisition agent (lightweight Python or C++ agent) on each node. Captured content: Function calls (energy calculation, conformation update), MPI / RPC messages, I / O writes to the trajectory file, timestamps, node IDs, and task IDs. In step S200, the objectives are: to parse the raw logs, organize the track tasks by session / transaction level, aggregate synchronization events (such as barriers), match request-response (MPI messages), and extract fields: step name, time consumption, inter-node dependencies, and I / O file name. In step S300, the experimental user ID, task ID, and computer node name are anonymized to preserve semantic uniqueness and ensure that the large-scale language model LLM can generate reproducible semantic representations. In step S400, the raw logs are mapped to the semantic layer using LLM or a rule-based model: Intent: Task type (MD_Simulation), Step Abstraction: The semantic meaning of each step, not just the name, Node Scope: Single node / multiple nodes, Dependencies: Which steps must be completed first, Exceptions: Possible error types and whether they are recoverable, and Time Features: Time consumption range and concurrency level. In step S500, the template structure includes: atomic request templates: single-node single-step operations (such as Energy Calculation); composite transaction templates: single-node complete tasks (Energy → Conformation → Trajectory); and business scenario templates: multi-node parallel simulations (512-node overall replay). Generation method: Semantic representation of LLM output → abstraction, abstract parameters → template variables (number of nodes, time range, anomaly probability), stored in the template library.

[0023] In an optional embodiment of this application, the replay objective is functional correctness verification. The goal is to ensure consistent calculation results and reproduce the actual node execution logic. The selection logic includes: Atomic template: used only for debugging single-step functions, such as verifying the correctness of single-node energy calculations or trajectory outputs. Condition: Only verifying the correctness of single-step calculation results. Composite template: Replay of a complete single-node task. Condition: Verifying the complete single-node process (energy → conformation → output). Business scenario template: Complete multi-node task. Condition: Verifying the consistency of the entire cluster execution and the correctness of calculation results. Logic description: Only checking correctness → no time compression, no exception injection. A layered verification approach of "atomic + composite + business scenario" can be selected: first single-step, then complete single-node process, then complete multi-node parallel process.

[0024] In an optional embodiment of this application, the replay objective is performance evaluation, specifically measuring throughput, latency, and node scalability. The selection logic is as follows: Atomic Template: Condition: Single-step performance bottleneck analysis, such as calculating energy consumption time distribution. Composite Template: Condition: Performance analysis of multi-step tasks on a single node, detecting the time consumption of each step and CPU / memory load. Business Scenario Template: Condition: Multi-node cluster throughput and scalability testing; Logic Description: Focus on concurrency, throughput, and latency → Compressible time consumption, increased concurrency, and changes in the number of covered nodes in the template parameters. The probability of anomaly injection is generally low (maintaining a normal performance environment); the main performance metrics are measured.

[0025] In an optional embodiment of this application, the replay objective is to cover anomalies and extreme scenarios, with the goal of verifying the system's behavior under node failures, slow nodes, or network jitter. Selection logic: Atomic template: Condition: Single-step injection node failure or delay, testing recovery logic. Composite template: Condition: Anomaly occurs in a single-node complete task, such as calculation step failure or trajectory output failure. Condition: Multi-node parallel scenarios, covering node downtime, network jitter, IO failure, etc. Logic explanation: Focus on anomaly triggering paths, recovery logic, and system robustness. Anomaly probability and node range are the core of template parameterization: few anomalies → functional verification; high-probability anomalies → extreme scenario coverage.

[0026] In an optional embodiment of this application, the semantic-level evaluation reference corresponding to the template defines the following error messages: NODE_FAILURE → node crash or computational anomaly, NETWORK_LATENCY → node communication timeout, IO_ERROR → trajectory output failure. Semantic-level evaluation: Step-level: Single-step failure (Energy / Conformation / Output) → Evaluate whether the step has recovered / triggered exception handling; Node-level: Single-node complete task anomaly → Check node recovery logic and whether dependent tasks have retried; Cluster-level: Multi-node parallel task anomaly → Evaluate overall system robustness, communication synchronization, and task correctness. Corresponding template selection: Step-level → atomic template, Node-level → composite template, Cluster-level → business scenario template.

[0027] In an optional embodiment of this application, in step S100, a lightweight traffic collector is deployed at the network boundary, service gateway, or terminal side to capture raw network packets at the session or transaction granularity. Collection can be triggered by a time window, service event, or policy. The collected data includes request packets, response packets, and link metadata (timestamp, session ID, source / destination address, etc.).

[0028] In an optional embodiment of this application, in step S200, the collected raw messages are parsed and organized, and the following operations are performed: protocol identification and layered parsing (HTTP, RPC, binary protocol, etc.), request-response relationship matching, field extraction (header, body, parameter structure, etc.), session segmentation and business transaction aggregation, initialization of annotation information: session metadata, status code, time consumption, error code, etc., and the output is a structured session sequence that can be processed by the model.

[0029] In an optional embodiment of this application, in step S300, a hybrid desensitization strategy of "rules + model" is adopted: static rule matching (phone number, ID card number, email, token, etc.), LLM-assisted identification of potential sensitive fields, replacement, masking or encryption of sensitive fields, and recording of desensitization mapping table (optionally stored securely) to ensure that privacy is not leaked during model training and playback.

[0030] In an optional embodiment of this application, step S400, which involves inputting the desensitized structured conversation sequence into a pre-trained large-scale language model to generate a structured semantic representation containing intent, parameter abstraction, conversation flow, boundary conditions, and abnormal scenarios, includes: The large-scale language model generates the structured semantic representation through fine-tuning, cue engineering, or structured output constraints. The semantic representation also includes temporal features, concurrency features, and state transition information. The structured semantic representation is a structured semantic model that can be used for template generation and playback. This model includes: User intent Parameter semantic abstraction and typed structure Session flow / state diagram Conditional branches and boundary conditions Triggerable abnormal scenarios and recovery logic Temporal characteristics (rhythm, concurrency, waiting, etc.) User intent generation methods: LLM reads the preprocessed session sequence: Node_23: Energy calculation start ->end Node_23: Configuration update start ->end Node_23: Trajectory output write Node_45: Energy calculation start ->end ... LLM extracts the "operation goal" from the prompting process and generates the user intent field.

[0031] Methods for parameter semantic abstraction and typed structure generation: LLM analyzes the parameters and data types for each session event: Energy Calculation → Input molecular structure, output energy value Conformation Update → Input old coordinates, output new coordinates Trajectory Output → Input trajectory data, output file path Abstract and label the parameter types (string, float, list, file_path, etc.).

[0032] Methods for generating session flow / state diagrams: LLM generates a state flow based on event timestamps and dependencies between nodes, including: Node-level state (Energy → Conformation → Output) Cluster-level dependencies (some steps require waiting for MPI synchronization to complete).

[0033] Methods for generating conditional branches and boundary conditions: LLM analysis logs or historical runs can be used to extract possible branches: Abnormal branch (node ​​failure, I / O error) Boundary conditions (energy value exceeds threshold → triggers convergence / retry) Output conditional logic.

[0034] Triggerable abnormal scenarios and recovery logic generation methods: LLM analyzes historical error logs, marking the exception type and recovery strategy: NODE_FAILURE → Retry node task or migration task NETWORK_LATENCY → Delay synchronization or adjust timeout IO_ERROR → Retry write operation or switch storage path.

[0035] Methods for generating time-related features (rhythm, concurrency, waiting): LLM abstracts the following based on timestamps and node dependencies: Single-step time range Concurrent execution relationship Waiting / blocking time.

[0036] In an optional embodiment of this application, in step S500, the template library supports version management, template reuse, and parameterized variation to adapt to different network environments, service versions, or test scenarios. The semantic representation is uniformly abstracted into multi-level session templates, including: Atomic request template (single request). Multi-step transaction template. Business scenario template (scenario-level orchestration). Parameter distribution model and data domain constraints.

[0037] In an optional embodiment of this application, step S600, which generates a strategy based on the playback target (functionality, performance, anomaly coverage), mainly includes: Template selection and parameter sampling strategies (random / distributed / model-driven) Timing control (real timing, compressed timing, acceleration / deceleration) Concurrency control and scheduling algorithms Network environment simulation (latency, jitter, packet loss, rate limiting) Generate a complete executable playback plan. The replay object is a protein molecular dynamics trajectory analysis task. The data source is a 512-node supercomputing cluster. Each node performs different sub-tasks (energy calculation, conformation update, trajectory output), and there is communication, synchronization, and I / O writing between nodes. The replay objectives may be three types: functional correctness verification (whether the results are consistent), performance evaluation (throughput, latency, scalability), and coverage of abnormal and extreme scenarios (node ​​abnormalities, network jitter, slow nodes). Template selection and parameter sampling strategy: Template selection: Scenario A: Functional correctness replay, objective: to verify whether the algorithm logic and numerical results are consistent with the actual operation, template selection: characteristics of deterministic functional template: fixed number of nodes (512), fixed task division method, fixed communication topology, and fixed input data. Functional verification is most afraid of "randomness". Once a result deviation occurs, it can be accurately reproduced and located without introducing unnecessary disturbance factors. Scenario B: Performance Evaluation Replay. Objective: To test the system's performance under different loads and scales. Template selection: Parametric performance template. Features: Configurable number of nodes (128 / 256 / 512), adjustable task granularity, adjustable communication frequency. Performance bottlenecks often only appear within specific parameter ranges; parametric templates can systematically scan performance curves. Scenario C: Anomaly and Stability Verification. Objective: To cover "low-probability but high-risk" situations in real-world operation. Template selection: Anomaly injection template. Features: Random node slowdown / disconnection, communication anomalies, sudden increases in I / O latency. Real-world production environments are unpredictable; templates must be used to systematically construct "non-ideal states."

[0038] In an optional embodiment of this application, the parameter sampling strategy is as shown in Table 1 below.

[0039] Table 1

[0040] In an optional embodiment of this application, the function replay is: fixed parameters (no sampling); the performance replay is: sampling according to the actual production distribution (e.g., 80% small tasks, 20% large tasks); and the anomaly replay is: model-driven (historically, "slow nodes + high communication" are most prone to problems).

[0041] In one optional embodiment of this application, the time control strategies are as follows: First, realistic timing, used in scenarios such as functional verification and debugging race conditions and timing dependency issues. Node A must write the trajectory file after node B. Any time compression will mask bugs; timing is part of the logic and cannot be disrupted. Second, compressed / accelerated timing, used in scenarios such as performance stress testing and large-scale regression testing. The original 24-hour simulation is compressed into a 1-hour replay, focusing only on throughput and resource consumption, saving testing time and quickly exposing performance bottlenecks. Third, decelerated timing, used in scenarios such as debugging occasional anomalies and reproducing concurrency issues. Slowing down node synchronization points and enlarging the race condition window makes fleeting issues observable.

[0042] In one optional embodiment of this application, the concurrency control and scheduling algorithm includes: First, full concurrency scheduling, scenario: performance limit testing, with 512 nodes starting computation simultaneously to verify the scheduler's limits and simulate worst-case load. Second, batch / layered scheduling, scenario: replay of real production behavior, with compute nodes starting first and I / O nodes starting later, closely resembling real system behavior and avoiding artificially creating unrealistic pressure peaks. Third, controlled concurrency (rate limiting), scenario: anomaly location, allowing only N tasks to proceed at a time, accurately observing resource changes, improving observability, and reducing noise.

[0043] In one optional embodiment of this application, the network environment is simulated as follows: Scenario A: Real cluster replay, latency: fixed 1–2ms, jitter: minimal, packet loss: 0, verifying logical correctness. Scenario B: Cross-data center deployment evaluation, latency: 20–50ms, jitter: ±10ms, packet loss: 0.1%, verifying the robustness of the distributed algorithm. Scenario C: Abnormal coverage, latency: random peak 200ms, packet loss: 1–5%, rate limiting: sudden rate limiting, simulating network congestion and switch malfunction.

[0044] In an optional embodiment of this application, a complete executable replay plan is generated. The plan includes: the selected template type, parameter sampling rules, time control mode, concurrency scheduling strategy, and network simulation configuration. This plan can be versioned and executed repeatedly in different environments, facilitating problem backtracking and comparative analysis.

[0045] In an optional embodiment of this application, in step S700, the network conditions include one or more of latency, jitter, packet loss, and rate limiting; the playback execution supports breakpoint resumption and automatic retry mechanisms for exceptions, wherein converting the playback plan into an executable request includes: packet reconstruction or regenerating the request based on semantic fragments, initiating real access through the protocol stack / network library, controlling the request rate, session concurrency, burst traffic, injecting network conditions (latency, packet loss, error response), interrupt recovery, breakpoint resumption, and automatic retry for exceptions. This engine is used to simulate business traffic in an environment consistent with the real system.

[0046] In an optional embodiment of this application, the playback execution further supports packet reconstruction or semantic-driven request generation, and can simulate network environments with latency, packet loss, and rate limiting. In an optional embodiment of this application, step S800, the semantic-level evaluation includes: determining whether expected business logic is triggered, whether abnormal paths and branch conditions are covered, and whether potential defects occur, and optimizing the template library based on the evaluation results. The function responsible for collecting the response behavior of the system under test (SUT) during playback includes: Response code, delay, error type; Performance metrics such as CPU, memory, I / O, and network; Business logic execution records (logs, event tracing); Call chain information (Tracing / Observability) Specifically, LLM is used for semantic-level evaluation: Whether the expected business logic is triggered; Does the scenario in the training data need to be reproduced? Whether to cover abnormal paths and branch conditions; Are there any potential defects or risks? Finally, an interpretable playback report is generated, which can be fed back to the template library for continuous optimization.

[0047] In an optional embodiment of this application, the method further includes: collecting call chain tracing information and combining a large-scale language model to perform business logic compliance judgment and anomaly coverage analysis on the replay results.

[0048] This application's traffic replay method based on a large-scale language model (LLM) improves replay hit rate and scenario coverage by understanding business semantics, achieving semantically aware replay. Semantic representation and templates are more compact than per-packet storage, making them easier to migrate between different versions / environments, thus reducing costs and achieving generalization. Built-in desensitization and mapping mechanisms reduce the risk of sensitive information leakage and achieve privacy protection. It supports functions such as parameterized mutation, load adjustment, and environment injection, adapting to the needs of automated regression and stress testing, achieving controllability and scalability. By using LLM to perform semantic-level judgment on the results, it reduces the cost of manual judgment and achieves intelligent evaluation.

[0049] It should be understood that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order constraint on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the diagram may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0050] Please see Figure 3 One embodiment of this application provides a traffic playback device 300 based on a large-scale language model, comprising: The generation module 310 is used to deploy collectors at network boundaries or terminals to capture raw network packets at the session or transaction granularity; and to parse, group, identify protocols, extract fields, and match request-response relationships in the raw network packets to generate structured session sequences. The input module 320 is used to replace or encrypt sensitive fields in the structured conversation sequence based on a desensitization strategy that combines rules and models, and record the desensitization mapping relationship; the desensitized structured conversation sequence is input into a pre-trained large-scale language model to generate a structured semantic representation that includes intent, parameter abstraction, conversation flow, boundary conditions and abnormal scenarios; The selection module 330 is used to summarize the structured semantic representation into multi-level session templates, including atomic request templates, composite transaction templates and business scenario templates, and store them in the template library; select a session template from the template library according to the replay target, and generate a replay plan by combining parameter sampling strategy, time control strategy, concurrency control strategy and network environment simulation strategy; The evaluation module 340 is used to reconstruct or generate network requests according to the replay plan, send requests to the system under test through the protocol stack, and inject controllable network conditions during the sending process; collect response information and performance indicators of the system under test during the replay process, and use a large-scale language model to perform semantic-level compliance and effectiveness evaluation on the replay results, and generate an evaluation report.

[0051] Specific limitations regarding the aforementioned device 300 can be found in the above description of the limitations on the traffic replay method based on large-scale language models, and will not be repeated here. Each module in the aforementioned device 300 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in a computer device, or stored in software in the memory of a computer device, so that the processor can call and execute the operations corresponding to each module.

[0052] In one embodiment, a computer device is provided, the internal structure of which can be as follows: Figure 4 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and the database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements the above-described traffic replay method based on a large-scale language model. It includes: memory and a processor; the memory stores the computer program; and the processor executes the computer program to implement any step in the above-described traffic replay method based on a large-scale language model.

[0053] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, can perform any of the steps in the above-described traffic replay method based on a large-scale language model.

[0054] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0055] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0056] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0057] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0058] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0059] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for traffic replay based on a large-scale language model, characterized in that, include: Deploy collectors at network boundaries or endpoints to capture raw network packets at the session or transaction granularity; The original network packets are parsed, grouped, protocol identified, fields extracted, and request-response relationship matched to generate a structured session sequence; A desensitization strategy combining rules and models is used to replace or encrypt sensitive fields in the structured session sequence, and the desensitization mapping relationship is recorded. The anonymized structured conversation sequence is input into a pre-trained large-scale language model to generate a structured semantic representation that includes intent, parameter abstraction, conversation flow, boundary conditions, and abnormal scenarios. The structured semantic representation is summarized into multi-level session templates, including atomic request templates, composite transaction templates, and business scenario templates, and stored in the template library; Based on the playback target, a session template is selected from the template library, and a playback plan is generated by combining parameter sampling strategy, time control strategy, concurrency control strategy and network environment simulation strategy. Reconstruct or generate network requests according to the replay plan, send requests to the system under test through the protocol stack, and inject controllable network conditions during the sending process; The system collects response information and performance metrics of the tested system during playback, and uses a large-scale language model to perform semantic-level compliance and validity assessment of the playback results, generating an assessment report.

2. The method of claim 1, wherein, The process of inputting the desensitized structured conversation sequence into a pre-trained large-scale language model to generate a structured semantic representation containing intent, parameter abstraction, conversation flow, boundary conditions, and abnormal scenarios includes: The large-scale language model generates the structured semantic representation through fine-tuning, cue engineering, or structured output constraints. The semantic representation also includes temporal features, concurrency features, and state transition information.

3. The method of claim 1, wherein, The template library supports version management, template reuse, and parameterized variation to adapt to different network environments, service versions, or test scenarios.

4. The method according to claim 1, characterized in that, The network conditions include one or more of latency, jitter, packet loss, and rate limiting; the playback execution supports breakpoint resumption and automatic retry mechanism for abnormalities.

5. The method according to claim 4, characterized in that, The playback execution also supports message reconstruction or semantic-driven request generation, and can simulate network environments with latency, packet loss, and rate limiting.

6. The method according to claim 1, characterized in that, The semantic-level evaluation includes: determining whether the expected business logic is triggered, whether abnormal paths and branch conditions are covered, whether potential defects occur, and optimizing the template library based on the evaluation results.

7. The method according to claim 1, characterized in that, The method also includes: collecting call chain tracing information and combining it with a large-scale language model to perform business logic compliance judgment and anomaly coverage analysis on the replay results.

8. A playback device based on a large-scale language model, characterized in that, include: The generation module is used to deploy collectors at network boundaries or terminals to capture raw network packets at the session or transaction granularity. The original network packets are parsed, grouped, protocol identified, fields extracted, and request-response relationship matched to generate a structured session sequence; The input module is used to replace or encrypt sensitive fields in the structured session sequence based on a desensitization strategy that combines rules and models, and to record the desensitization mapping relationship. The anonymized structured conversation sequence is input into a pre-trained large-scale language model to generate a structured semantic representation that includes intent, parameter abstraction, conversation flow, boundary conditions, and abnormal scenarios. The selection module is used to summarize the structured semantic representation into multi-level session templates, including atomic request templates, composite transaction templates and business scenario templates, and store them in the template library; Based on the playback target, a session template is selected from the template library, and a playback plan is generated by combining parameter sampling strategy, time control strategy, concurrency control strategy and network environment simulation strategy. The evaluation module is used to reconstruct or generate network requests according to the playback plan, send requests to the system under test through the protocol stack, and inject controllable network conditions during the sending process. The system collects response information and performance metrics of the tested system during playback, and uses a large-scale language model to perform semantic-level compliance and validity assessment of the playback results, generating an assessment report.

9. A computer device, comprising: The device includes a memory and a processor, the memory storing a computer program, characterized in that the processor executes the computer program to implement the steps of the traffic replay method based on any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the traffic replay method based on any one of claims 1 to 7.