Test sample synthesis method and device based on differential privacy processing and multi-agent collaboration, computer device, storage medium and computer program product

By employing differential privacy processing and multi-agent collaboration, the generator agent reconstructs the synthetic log dataset and adjusts parameters through game theory evaluation. This solves the problems of test data availability and privacy protection in traditional desensitization techniques, enabling efficient testing in crowdsourced testing environments.

CN123179447APending Publication Date: 2026-11-27ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611334955.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In existing security crowdsourcing, after processing the data using traditional data anonymization techniques, the semantic consistency and usability of the test data are difficult to guarantee, resulting in low credibility of the test conclusions and an inability to effectively handle semi-structured data.

Method used

A differential privacy processing and multi-agent collaboration approach is adopted. The synthetic log dataset is reconstructed by the generator agent, and the privacy protection parameters and generation parameters are iteratively adjusted by the game evaluation of the attacker, defender and referee agents until the preset convergence conditions are met, so as to generate a test sample set that meets the differential privacy protection.

Benefits of technology

While satisfying differential privacy protection, it preserves the business logic associations and conditional dependencies between fields of the original data to the greatest extent, improves the data availability of test data in the crowdsourced testing range, and solves the problems of traditional de-identification techniques destroying data association logic and GAN methods lacking privacy guarantees.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123179447A_ABST
    Figure CN123179447A_ABST
Patent Text Reader

Abstract

The application provides a test sample synthesis method and device based on differential privacy processing and multi-agent collaboration, a computer device, a storage medium and a computer program product. The method comprises: performing privacy processing on an original log data set based on a differential privacy protection parameter to generate a privacy log representation set; reconstructing data based on the privacy log representation set by a generator agent to obtain a synthetic log data set; evaluating the synthetic log data set by a plurality of game agents to obtain a plurality of game agent evaluation results; determining whether a game convergence condition is met based on the plurality of game agent evaluation results, and if not, adjusting the differential privacy protection parameter and a log record generation parameter of the generator agent until the game convergence condition is met; and taking the synthetic log data set when the game convergence condition is met as a test sample set. The method can generate high-fidelity test samples that take into account privacy protection and data usability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of network security and privacy computing technology, and in particular to a method, apparatus, computer device, storage medium and computer program product for synthesizing test samples based on differential privacy processing and multi-agent collaboration. Background Technology

[0002] During security crowdsourcing, researchers need to interact with real business systems to verify whether there are deep vulnerabilities such as unauthorized access in the core business logic. However, such interactions inevitably involve sensitive information of real users, posing a risk of privacy breaches and compliance issues.

[0003] Currently, existing technologies mainly employ traditional data masking techniques, such as field masking, generalization, and pseudonymization, to achieve privacy protection by directly obscuring or replacing sensitive fields in the original data. However, while removing sensitive information, these methods disrupt the original logical relationships between data fields, resulting in semantic inconsistencies in the generated masked data. Researchers cannot distinguish whether abnormal responses observed during testing are genuine business vulnerabilities or data noise introduced by the masking process, making it difficult to guarantee the reliability of test conclusions.

[0004] Therefore, existing technologies suffer from the technical problem of low data usability of test data after privacy protection processing. Summary of the Invention

[0005] Based on this, the purpose of this application is to at least solve one of the above-mentioned technical defects, especially the technical defect that the data availability of test data after privacy protection processing is not high in the prior art. This application provides a test sample synthesis method, apparatus, computer equipment, storage medium and computer program product based on differential privacy processing and multi-agent collaboration.

[0006] Firstly, this application provides a method for synthesizing test samples based on differential privacy processing and multi-agent cooperation, including:

[0007] Obtain the original log dataset and differential privacy protection parameters, and based on the differential privacy protection parameters, perform privacy processing on the original log dataset to generate a privacy-preserving log representation set;

[0008] A synthetic log dataset is obtained by reconstructing the data based on a privacy-preserving log representation set using a generator agent;

[0009] The synthetic log dataset is evaluated by multiple game agents to obtain the evaluation results of multiple game agents;

[0010] Based on the evaluation results of multiple game agents, determine whether the preset game convergence condition is met. If not, adjust the differential privacy protection parameters and the log recording generation parameters of the generator agent, and return the steps of privacy processing of the original log dataset based on the differential privacy protection parameters to generate a privacy log representation set, until the evaluation results of multiple game agents meet the preset game convergence condition.

[0011] The synthetic log dataset that meets the preset game convergence conditions will be used as the test sample set.

[0012] In one exemplary embodiment, the original log dataset is privatized based on differential privacy parameters to generate a privatized log representation set, including:

[0013] Semantic encoding is performed on each raw log data in the raw log dataset to obtain the semantic representation of each log.

[0014] Based on differential privacy protection parameters, the semantic representation of each log is privatized to generate a set of privatized log representations.

[0015] In one exemplary embodiment, based on differential privacy protection parameters, each log semantic representation is privatized to generate a privatized log representation set, including:

[0016] Gradient pruning is performed on each log semantic representation to obtain each pruned log semantic representation;

[0017] Based on differential privacy protection parameters, the noise intensity is determined, and Gaussian noise is superimposed on each pruned log semantic representation based on the noise intensity to generate a set of privacy-preserving log representations.

[0018] In one exemplary embodiment, the multiple game agents include an attacker agent, a defender agent, and a referee agent; the game evaluation of the synthetic log dataset is performed by the multiple game agents to obtain the evaluation results of the multiple game agents, including:

[0019] Attack risk assessment results are obtained by using an attacker agent to assess the attack risk of the synthetic log dataset, and data quality assessment results are obtained by using a defender agent to assess the data quality of the synthetic log dataset.

[0020] The game decision results of the synthetic log dataset are determined by the refereeing agent based on the attack risk assessment results and the data quality assessment results.

[0021] The attack risk assessment results, data quality assessment results, and game decision results are used as the assessment results.

[0022] In an exemplary embodiment, the attack risk assessment result includes indicator values ​​for multiple attack dimensions; the data quality assessment result includes indicator values ​​for multiple data quality dimensions; the game decision result includes a comprehensive utility value; and the game decision result of the synthetic log dataset is determined by a referee agent based on the attack risk assessment result and the data quality assessment result, including:

[0023] The attack risk score is determined by the referee agent based on the indicator values ​​of multiple attack dimensions, and the data quality score is determined by the referee agent based on the indicator values ​​of multiple data quality dimensions.

[0024] The data quality weight coefficient and attack risk weight coefficient are obtained by the referee agent. Based on the data quality weight coefficient and attack risk weight coefficient, the data quality score and attack risk score are weighted and calculated to obtain the comprehensive utility value of the synthetic log dataset.

[0025] In an exemplary embodiment, determining whether a preset game convergence condition is met based on the evaluation results of multiple game agents includes:

[0026] If the overall utility value is greater than or equal to the preset overall utility threshold and the index value of each attack dimension is less than or equal to the preset security threshold corresponding to each attack dimension, then the preset game convergence condition is satisfied.

[0027] If the overall utility value is less than the preset overall utility threshold or the index value of any attack dimension is greater than the preset security threshold corresponding to that attack dimension, then the preset game convergence condition is not met.

[0028] Secondly, this application provides a test sample synthesis device based on differential privacy processing and multi-agent cooperation, the device comprising:

[0029] The processing module is used to obtain the original log dataset and differential privacy protection parameters, and based on the differential privacy protection parameters, to perform privacy processing on the original log dataset to generate a privacy-preserving log representation set;

[0030] The reconstruction module is used to reconstruct data based on a privacy-preserving log representation set by a generator agent to obtain a synthetic log dataset.

[0031] The game theory module is used to perform game evaluation on the synthetic log dataset through multiple game agents and obtain the evaluation results of multiple game agents.

[0032] The judgment module is used to determine whether the preset game convergence condition is met based on the evaluation results of multiple game agents. If it is not met, the differential privacy protection parameters and the log recording generation parameters of the generator agent are adjusted, and the steps of privacy processing of the original log dataset based on the differential privacy protection parameters and generating privacy log representation set are returned until the evaluation results of multiple game agents meet the preset game convergence condition.

[0033] The determination module is used to use the synthetic log dataset that meets the preset game convergence conditions as the test sample set.

[0034] Thirdly, 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 the above-described method.

[0035] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0036] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.

[0037] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0038] This application provides a test sample synthesis method, apparatus, computer device, storage medium, and computer program product based on differential privacy processing and multi-agent collaboration. It acquires an original log dataset and differential privacy protection parameters, performs privacy processing on the original log dataset to generate a privacy-preserving log representation set, and then reconstructs the synthetic log dataset through a generator agent. Multiple game agents are introduced to form a game loop, and the privacy protection parameters and generation parameters are iteratively adjusted based on the game evaluation results until convergence. The synthetic log dataset at convergence is used as the test sample set. Thus, provable mathematical noise is injected into the embedding space through a differential privacy algorithm to... It provides strict privacy guarantees and continuously balances the strength of privacy protection and data quality during the generation process through multi-agent adversarial game using a large language model. This ensures that the final synthesized test sample set retains the business logic relationships, inter-field conditional dependencies, and long-tail anomaly distribution characteristics of the original data to the greatest extent possible, while satisfying differential privacy protection and preventing the leakage of real sensitive information. It solves the problems of traditional de-identification techniques destroying data relationship logic, resulting in low credibility of test conclusions, and standard GAN methods lacking privacy guarantees and unable to handle semi-structured data. It effectively improves the data availability of privacy-protected test data in crowdsourced testing ranges. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of this application 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 some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 A flowchart illustrating a test sample synthesis method based on differential privacy processing and multi-agent collaboration, provided for an embodiment of this application;

[0041] Figure 2 This is a schematic diagram of the multi-agent adversarial interaction process provided in an embodiment of this application;

[0042] Figure 3 A complete flowchart illustrating the Nash equilibrium convergence and output control provided in this application embodiment.

[0043] Figure 4 A schematic diagram of the overall architecture of a test sample synthesis system based on differential privacy processing and multi-agent collaboration, provided for embodiments of this application;

[0044] Figure 5 A flowchart illustrating another test sample synthesis method based on differential privacy processing and multi-agent collaboration provided in this application embodiment;

[0045] Figure 6 A schematic diagram of a test sample synthesis device based on differential privacy processing and multi-agent collaboration provided in an embodiment of this application;

[0046] Figure 7 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0047] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0048] In one exemplary embodiment, Figure 1 A flowchart illustrating a test sample synthesis method based on differential privacy processing and multi-agent collaboration, provided for embodiments of this application, is shown below. Figure 1As shown, a test sample synthesis method based on differential privacy processing and multi-agent cooperation is provided. Taking the application of this method to a server as an example, the method includes the following steps S102 to S110. Wherein:

[0049] S102: Obtain the original log dataset and differential privacy protection parameters, and based on the differential privacy protection parameters, perform privacy processing on the original log dataset to generate a privacy-preserving log representation set.

[0050] The raw log dataset refers to a collection of real user interaction records collected from business systems, including but not limited to API call records, network traffic mirrors, and user session sequences. Each record contains sensitive fields and business fields.

[0051] Among them, differential privacy protection parameters refer to a set of parameters used to control the strength of privacy protection.

[0052] Privacy processing refers to the process of performing mathematical transformations on the original log data to make it meet the requirements of differential privacy protection.

[0053] Here, the privacy-enhanced log representation set refers to the set of embedding vectors containing differential privacy noise obtained after privacy-enhancing the original log data. The privacy-enhanced log representation in the privacy-enhanced log representation set can be represented as... .

[0054] Optionally, the raw log dataset is first collected from the business system, preprocessed to convert the raw log data into a high-dimensional representation suitable for privacy protection, and then, according to the set differential privacy protection parameters, a mathematical noise injection operation is performed on the high-dimensional representation to generate a privacy-preserving log representation set.

[0055] S104, the generator agent reconstructs the data based on the privacy-preserving log representation set to obtain the synthetic log dataset.

[0056] Among them, the generator agent refers to the decoding model built on a large language model, which is responsible for reconstructing synthetic log records from noisy embedding vectors (i.e., privacy log representations in the privacy log representation set).

[0057] The synthetic log dataset refers to a collection of synthetic data generated by the generator agent based on autoregressive decoding of a privacy-preserving log representation set, which does not contain real user records. The synthetic log data in the synthetic log dataset can be represented as follows: .

[0058] Optionally, the generator agent reconstructs the synthetic log dataset based on the privacy-preserving log representation set.

[0059] In practical applications, the generator agent is embedded with noisy data. As a conditional input, the synthetic log record is reconstructed through autoregressive decoding. ,in, Indicates the first The generated synthetic log data; This represents the decoding function corresponding to the generator agent; This indicates the decoded temperature parameter. The larger the value, the more diverse the results are usually generated. Smaller values ​​generally result in more conservative outputs that are closer to high-probability outputs. Controlled temperature parameters are used during the decoding process. To balance generative diversity with semantic consistency.

[0060] S106: The synthetic log dataset is evaluated by multiple game agents to obtain the evaluation results of multiple game agents.

[0061] Among them, the game agent refers to the large language model agent that participates in adversarial games, which can include attacker agent, defender agent and referee agent. The parties promote the dynamic balance between generation quality and privacy protection through game evaluation.

[0062] Among them, game evaluation refers to the process in which multiple game agents evaluate the synthetic log dataset from two dimensions: attack risk and data quality, and the referee agent makes a comprehensive judgment.

[0063] Optionally, multiple game agents evaluate the synthetic log dataset from the perspectives of privacy risk and data quality, and a referee agent makes a comprehensive judgment on whether the convergence condition is met.

[0064] S108: Based on the evaluation results of multiple game agents, determine whether the preset game convergence condition is met. If not, adjust the differential privacy protection parameters and the log recording generation parameters of the generator agent, and return the steps of privacy processing of the original log dataset based on the differential privacy protection parameters to generate a privacy log representation set, until the evaluation results of multiple game agents meet the preset game convergence condition.

[0065] Among them, the pre-set game convergence condition refers to the quantitative condition that must be met to determine that an adversarial game has reached an equilibrium state.

[0066] Among them, the adjustment of differential privacy protection parameters refers to the operation of changing the privacy protection strength parameters based on the game evaluation results.

[0067] Among them, the log recording generation parameters refer to the control parameters used by the generator agent in the autoregressive decoding process, which are used to balance generation diversity and semantic consistency.

[0068] Optionally, multiple game agents evaluate the synthetic log dataset from both privacy risk and data quality perspectives, and a referee agent makes a comprehensive judgment on whether the convergence condition is met. If convergence is not achieved, the differential privacy protection parameters and the log generation parameters of the generator agent are adjusted, and the process proceeds to the next iteration until the convergence condition is met.

[0069] S110, use the synthetic log dataset that meets the preset game convergence conditions as the test sample set.

[0070] The test sample set refers to the final output synthetic dataset used by white-hat researchers to be deployed in the crowdsourced testing environment.

[0071] Optionally, if convergence is achieved, the synthetic log dataset is output as a test sample set.

[0072] The aforementioned test sample synthesis method based on differential privacy processing and multi-agent collaboration obtains the original log dataset and differential privacy protection parameters. It then performs privacy processing on the original log dataset to generate a privacy-preserving log representation set, which is reconstructed by a generator agent to obtain a synthetic log dataset. Multiple game agents are introduced to form a game-theoretic closed loop. The privacy protection parameters and generation parameters are iteratively adjusted based on the game evaluation results until convergence. The synthetic log dataset at convergence is used as the test sample set. Thus, by injecting provable mathematical noise into the embedding space using a differential privacy algorithm to provide strict privacy guarantees, and by continuously balancing privacy protection strength and data quality during the generation process through multi-agent adversarial game using a large language model, the final synthesized test sample set retains, to the greatest extent possible, the business logic relationships, inter-field conditional dependencies, and long-tail anomaly distribution characteristics of the original data while satisfying differential privacy protection and preventing the leakage of real sensitive information. This solves the problems of traditional de-identification techniques destroying data association logic, leading to low credibility of test conclusions, and standard GAN methods lacking privacy guarantees and unable to handle semi-structured data. It effectively improves the usability of privacy-protected test data in crowdsourced testing environments.

[0073] In one exemplary embodiment, the original log dataset is privatized based on differential privacy protection parameters to generate a privatized log representation set, including: semantically encoding each original log data in the original log dataset to obtain a semantic representation of each log; and privatizing each log semantic representation based on differential privacy protection parameters to generate a privatized log representation set.

[0074] Raw log data refers to a single record in the raw log dataset, including but not limited to API call records, network traffic mirror records, or user session sequences.

[0075] Semantic encoding refers to the process of mapping raw log data to a high-dimensional semantic embedding space using a pre-trained encoder model, thereby obtaining a log semantic representation.

[0076] Log semantic representation refers to the embedding vector obtained after semantic encoding of the original log data. Log semantic representation can be represented as... , ,in Indicates the first One original log record; Index the log entries; This represents a semantic encoder; Indicates the first output of the encoder The embedding vector of each log entry; express 3D real vector space; This indicates the dimension of the log semantic representation.

[0077] In the embedded space, it is necessary to encode both the syntactic structure information of the log (such as HTTP method, status code, request path) and the semantic business information (such as transaction type, user behavior intent).

[0078] Privacy processing refers to the process of applying differential privacy protection operations to the semantic representation of logs to satisfy (ε,δ)-differential privacy protection.

[0079] Optionally, the raw log dataset is first preprocessed. The preprocessing stage includes two key tasks: first, automatically labeling sensitive fields in the logs using a pre-trained named entity recognition model, such as identity attribute fields, contact information fields, geographic coordinate fields, and other personally identifiable information fields, to establish a list of sensitive fields; second, using an encoder model fine-tuned for network security logs, mapping each raw log record to a unified high-dimensional semantic embedding vector. This encoder model can simultaneously encode the log's syntactic structure information (such as HTTP methods, status codes, and request paths) and semantic business information (such as transaction types and user behavioral intent). After encoding, each log record corresponds to an embedding vector, and all embedding vectors constitute the log semantic representation set. Then, according to the set differential privacy protection parameters, privacy processing is performed on the log semantic representation set to generate a privacy-preserving log representation set.

[0080] In this embodiment, by semantically encoding the raw log data, the semi-structured log records are converted into high-dimensional embedding vectors of a unified dimension. This solves the problem that the raw log data, due to its diverse formats and complex field structures, is difficult to directly perform mathematical privacy protection processing. The embedding vector simultaneously encodes syntactic structure information and semantic business information, providing a standardized operation object for subsequent differential privacy noise injection. Simultaneously, a pre-trained named entity recognition model automatically labels sensitive fields, clarifying the target scope that needs to be protected for privacy processing. This allows the differential privacy mechanism to accurately apply to the semantic space containing privacy information, minimizing interference with non-sensitive business information while protecting user privacy, thereby better preserving the data's usability in the crowdsourced testing range.

[0081] In one exemplary embodiment, privacy processing is performed on each log semantic representation based on differential privacy protection parameters to generate a set of privacy-protected log representations. This includes: performing gradient pruning on each log semantic representation to obtain each pruned log semantic representation; determining the noise intensity based on the differential privacy protection parameters; and superimposing Gaussian noise on each pruned log semantic representation based on the noise intensity to generate a set of privacy-protected log representations.

[0082] Gradient pruning refers to the operation of constraining the L2 norm of each log semantic representation, which is used to limit the maximum impact of any single record on subsequent aggregation operations.

[0083] Among them, the pruned log semantic representation refers to the embedded vector after gradient pruning, whose L2 norm is restricted to within a preset pruning threshold C.

[0084] Among them, the differential privacy protection parameters include the upper bound ε of privacy loss and the probability δ of privacy guarantee failure.

[0085] Here, noise intensity refers to the standard deviation of Gaussian noise superimposed on the pruned log semantic representation, denoted as σ, which is jointly determined by the target privacy budget (ε, δ) and the sampling rate q.

[0086] Gaussian noise refers to random noise that follows a d-dimensional Gaussian distribution with zero mean and a covariance matrix of σ²C²Id, denoted as N(0, σ²C²Id), where Id represents the d×d identity matrix.

[0087] Among them, the privacy-preserving log representation set refers to the set of embedding vectors that satisfy differential privacy protection, obtained by gradient pruning and noise injection of each log semantic representation.

[0088] Optionally, the following operations are performed during the privacy processing. First, gradient pruning is performed. For each log semantic representation, its L2 norm is calculated. If the norm exceeds a preset pruning threshold C, it is scaled proportionally until the norm does not exceed C; otherwise, it remains unchanged. The pruning threshold C can be selected based on statistical analysis of the L2 norm distribution of the log semantic representations, for example, taking the 95th percentile of the L2 norm of a certain number of log semantic representations as the C value. This selection strategy ensures that most normal log semantic representations are not altered by the pruning operation, while the influence of a minority of log semantic representations with abnormally large L2 norms is explicitly limited. Then, noise injection is performed. Based on the target privacy budget (ε, δ) and sampling rate q, Rényi differential privacy is used as a privacy accounting mechanism, and the noise standard deviation σ is accurately calculated by tracking the moment accumulation of the Rényi divergence. Calibrated Gaussian noise is superimposed on the pruned embedding. The cumulative privacy consumption is continuously tracked throughout the iteration process, and data generation is automatically terminated when the privacy budget is exhausted.

[0089] In practical applications, for each embedding vector (i.e., log semantic representation) in the embedding space... Perform differential privacy protection operations, which consist of two sub-steps: gradient pruning and noise injection.

[0090] In the gradient clipping process, the L2 norm of each embedding vector needs to be constrained, and the specific formula is as follows:

[0091] ,

[0092] in, The preset pruning threshold is used to limit the maximum impact of any single record on subsequent aggregation operations; Indicates the first step before cutting. Semantic representation of log entries; This represents the semantic representation of the truncated log entries. Log semantic representation The L2 norm; This indicates taking the smaller of the two inputs; when The record remains unchanged when Scaling proportionally to a norm not exceeding .

[0093] During the noise injection phase, calibrated Gaussian noise needs to be superimposed on the pruned log semantic representation:

[0094] ,

[0095] in, This represents the private embedding vector after adding noise; This indicates that the mean is zero and the covariance matrix is... of Gaussian noise; Indicates the noise multiplier; express The identity matrix; The aforementioned clipping threshold. The noise multiplier is the noise standard deviation. By target privacy budget and sampling rate A joint decision, in which Indicates the upper bound of privacy loss. This indicates that the privacy guarantee has an extremely low probability of being invalidated. This represents the ratio of the number of samples drawn in each training or generation round to the total number of samples. Using Rényi Differential Privacy (RDP) as a privacy accounting mechanism, the total privacy loss across multiple iterations is accurately calculated by tracking the moment accumulation of the Rényi divergence, and data generation is automatically terminated when the privacy budget is exhausted.

[0096] It is understandable that this application requires updating the differential privacy protection parameters during model iteration, which is essentially a modification of... , , Updated because , , The noise scale was determined together. Noise scale This determines the degree of noise superposition.

[0097] In this embodiment, by performing gradient pruning on the log semantic representation, the maximum influence of any single original record on the subsequent synthesized data is mathematically constrained within a controllable range, avoiding the disproportionate impact of individual records containing rare sensitive information or outliers on the overall data distribution. Furthermore, by determining the noise intensity based on differential privacy protection parameters and superimposing noise on the pruned embedding, provable differential privacy protection of the original data is achieved. This two-stage processing method, combining gradient pruning and Gaussian noise injection in the embedding space, compared to directly performing masking or generalization on the original data fields, protects user privacy through mathematical mechanisms while preserving the high-dimensional semantic association information carried by the embedding vector. This lays the foundation for the generator agent to subsequently reconstruct high-fidelity synthesized data, effectively alleviating the contradiction between privacy protection and data availability.

[0098] In an exemplary embodiment, multiple game agents include an attacker agent, a defender agent, and a referee agent. The game evaluation of the synthetic log dataset by these multiple game agents yields evaluation results, including: an attacker agent assessing the attack risk of the synthetic log dataset to obtain an attack risk assessment result; a defender agent assessing the data quality of the synthetic log dataset to obtain a data quality assessment result; a referee agent determining the game decision result for the synthetic log dataset based on the attack risk assessment result and the data quality assessment result; and the attack risk assessment result, the data quality assessment result, and the game decision result are used as the respective evaluation results.

[0099] Among them, the attacker agent refers to a large language model agent that simulates a malicious data analyst to launch privacy attacks on synthetic data from multiple attack dimensions in order to quantify the risk of privacy leakage.

[0100] Among them, the attack risk assessment result can refer to the set of quantitative indicators output by the attacker's intelligent agent after performing a multi-dimensional privacy attack on the synthetic log dataset.

[0101] Among them, the defender agent refers to a large language model agent that evaluates the quality of synthetic data from the perspective of statistical fidelity, and calculates the degree of difference between synthetic data and real data in multiple data quality dimensions.

[0102] Among them, the data quality assessment result refers to the set of quantitative indicators output by the defender agent after performing a multi-dimensional quality assessment on the synthetic log dataset.

[0103] Among them, the referee agent refers to a large language model agent that integrates the evaluation results of the attacker and the evaluation results of the defender and outputs the game judgment. It is responsible for determining whether the game has reached a balance in the current round.

[0104] The game decision result refers to the judgment conclusion of the referee agent on whether the current synthetic log dataset meets the convergence condition, which includes at least the comprehensive utility value and the indication signal of convergence.

[0105] Optionally, the attacker agent simulates a malicious data analyst, launching privacy attacks on the synthetic data from multiple preset attack dimensions, and outputting attack success rate indicators for each dimension. The defender agent evaluates the quality of the synthetic data from a statistical fidelity perspective, calculating the difference indicators between the synthetic data and real data across multiple preset dimensions. The referee agent integrates the attack results of the attacker agent and the fidelity results of the defender agent to calculate a comprehensive utility value and determine whether the game has converged. Both the attacker and defender agents are specifically fine-tuned based on a large language model foundation, while the referee agent executes a comprehensive judgment according to a preset utility function.

[0106] In this embodiment, a three-party adversarial game architecture involving an attacker, a defender, and a referee enables closed-loop evaluation and iterative optimization of the synthetic data quality. The attacker, from a malicious perspective, continuously probes for privacy vulnerabilities in the synthetic data, providing precise quantitative feedback for adjusting the strength of privacy protection. The defender, from the user's perspective, continuously monitors the statistical fidelity of the synthetic data, ensuring that data quality does not degrade too quickly due to privacy protection. The referee, acting as a neutral arbitrator, seeks the optimal balance between privacy and quality. This multi-agent game mechanism effectively solves the problems of lacking systematic quality feedback and being unable to dynamically adjust generation strategies in traditional synthetic data generation methods. The evaluation results of each round of the game directly guide the optimization direction of generation and privacy parameters, allowing the synthetic data to gradually approach the optimal balance between privacy and quality during iteration, significantly improving the data usability of the final test samples.

[0107] In an exemplary embodiment, the attack risk assessment result includes indicator values ​​for multiple attack dimensions; the data quality assessment result includes indicator values ​​for multiple data quality dimensions; the game decision result includes a comprehensive utility value; the game decision result of the synthetic log dataset is determined by a referee agent based on the attack risk assessment result and the data quality assessment result, including: determining an attack risk score value based on the indicator values ​​for multiple attack dimensions by the referee agent, and determining a data quality score value based on the indicator values ​​for multiple data quality dimensions by the referee agent; obtaining data quality weight coefficients and attack risk weight coefficients by the referee agent, and performing a weighted calculation on the data quality score value and the attack risk score value based on the data quality weight coefficients and the attack risk weight coefficients to obtain the comprehensive utility value of the synthetic log dataset.

[0108] Among them, the attack dimension metric refers to the quantified success rate of each attack type output by the attacker's agent, including the attack advantage or attack success metric Adv, which measures the attack's success rate inferred by the members. MIA Leakage strength index λ of attribute inference attack attr The matching success rate metric ρ for link attack and record-keeping attacks link .

[0109] Among them, the index values ​​of the data quality dimension refer to the quantitative difference values ​​of each quality dimension output by the defender agent, including the first-order Wasserstein distance W1 between the marginal distribution of synthetic data and real data, the graph edit distance GED of the network topology, and the Kullback-Leibler divergence D between the long-tailed anomaly distribution. KL .

[0110] The attack risk score, denoted as Risk(A), is a single numerical value representing the overall privacy risk level of the synthetic log dataset, obtained by the referee agent through comprehensive calculation of indicators from multiple attack dimensions. A = [Adv...] MIA , λ attr , ρ link ].

[0111] The data quality score, denoted as Fidelity(F), is a single numerical value representing the overall fidelity level of the synthetic log dataset, obtained by the referee agent after comprehensively calculating the index values ​​of multiple data quality dimensions. F = [W1, GED, D...]. KL ].

[0112] The data quality weight coefficient, denoted as α, is a parameter used to adjust the weight of the data quality score in the overall utility value.

[0113] Among them, the attack risk weight coefficient is a parameter used to adjust the weight of the attack risk score in the overall utility value, denoted as β.

[0114] The overall utility value refers to the single numerical index used to measure the overall quality of the current synthetic log dataset after the referee agent calculates the data quality score Fidelity(F) and the attack risk score Risk(A) according to their weights. It is denoted as U and the calculation formula is U=α×Fidelity(F)-β×Risk(A).

[0115] Optionally, after receiving the attack result vector A from the attacker's agent and the fidelity vector F from the defender's agent, the referee agent executes the following decision process. First, it normalizes and comprehensively scores each indicator value in the attack result vector A to obtain the attack risk score Risk(A). Simultaneously, it normalizes and comprehensively scores each indicator value in the fidelity vector F to obtain the data quality score Fidelity(F). Then, the referee agent obtains preset data quality weight coefficient α and attack risk weight coefficient β based on the privacy preferences of the application scenario. In the financial payment scenario, α=0.6 and β=0.4 can be set to reflect a slightly fidelity-oriented business preference; in the medical scenario, α=0.45 and β=0.55 can be set to reflect a privacy-first business principle. Finally, it calculates the comprehensive utility value according to the formula U=α×Fidelity(F) -β×Risk(A), and outputs U along with the attack risk score and data quality score as the game decision result.

[0116] In this embodiment, a referee agent integrates multi-dimensional attack assessment results and data quality assessment results into attack risk scores and data quality scores, respectively. A weighted calculation method is then used to calculate the overall utility value, achieving a multi-dimensional and quantifiable comprehensive evaluation of the synthetic dataset quality. The design of the weighting coefficients α and β allows the system to flexibly adjust the balance between privacy protection and data quality according to the privacy compliance requirements and business needs of different application scenarios. This flexible and configurable comprehensive evaluation mechanism effectively solves the problems of traditional methods lacking unified evaluation standards and being unable to quantify the trade-off between privacy and quality. It ensures that the optimization direction of each iteration has a clear quantitative basis, ultimately generating a test sample set that achieves the optimal balance between privacy security and data availability in a specific business scenario.

[0117] The technical solution of this application deploys four types of large language model intelligent agents, forming a game-theoretic closed loop. The multi-agent adversarial interaction process is as follows: Figure 2 As shown.

[0118] The generator agent is represented by noisy, privacy-preserving logs. As a conditional input, synthetic log data is reconstructed through autoregressive decoding. Controlled temperature parameters are used during the decoding process. To balance the diversity of generation with semantic consistency, the generator agent sends the synthesized data batch S1 to the attacker agent (red team) and the defender agent (blue team).

[0119] After receiving the synthetic data batch S1, the attacker agent (Red Team) simulates the behavior of a malicious data analyst, launching privacy attacks on the synthetic log data from three dimensions: membership inference attack, determining whether a real record participated in training and outputting an inference advantage metric; attribute inference attack, inferring sensitive attributes of a specific user from the synthetic data and outputting an attribute leakage rate metric; and record linking attack, associating the synthetic data with an external auxiliary database to re-identify users and outputting a re-identification risk metric. The attacker agent summarizes the attack results from the above three dimensions into an attack result vector A and sends it to the referee agent.

[0120] After receiving the synthetic data batch S1, the Defender Agent (Blue Team) evaluates the quality of the synthetic data from a statistical fidelity perspective, calculating three core metrics: the Wasserstein distance between the synthetic and real data, measuring the preservation of marginal distributions; the graph edit distance of the network topology graph, measuring the preservation of topology structure; and the KL divergence of long-tail regions, measuring the preservation of anomaly distributions. The Defender Agent summarizes the quality evaluation results of the above three dimensions into a fidelity vector F and sends it to the Referee Agent.

[0121] The judge agent receives the attack result vector. And fidelity vector Then, the overall utility value is calculated by combining the evaluation results of both parties. The system then performs a convergence determination: when U reaches a preset threshold θ and all attack metrics in all dimensions of the attack result vector A are below their respective safety thresholds, the referee agent determines that the game has converged and outputs the current synthetic dataset as the final result; if U is less than the threshold θ, or any attack metric exceeds the safety threshold, the game is determined not to have converged, and the referee agent sends an optimization command to the generator agent to adjust the noise scale. and decoding temperature Then, the next round of adversarial iteration begins. This process is repeated cyclically until the game converges.

[0122] In an exemplary embodiment, based on the evaluation results of multiple game agents, determining whether a preset game convergence condition is met includes: if the overall utility value is greater than or equal to a preset overall utility threshold and the index value of each attack dimension is less than or equal to a preset security threshold corresponding to each attack dimension, then the preset game convergence condition is met; if the overall utility value is less than the preset overall utility threshold or the index value of any attack dimension is greater than the preset security threshold corresponding to that attack dimension, then the preset game convergence condition is not met.

[0123] The preset comprehensive utility threshold, denoted as θ, refers to the minimum comprehensive utility value required for game convergence. When the comprehensive utility value U ≥ θ, it indicates that the synthetic dataset has reached an acceptable quality level overall.

[0124] Among them, the preset security threshold refers to the maximum acceptable risk level corresponding to each attack dimension. The security threshold for member inference attacks is usually set to a level where its AUC is close to that of random guessing; the security threshold for attribute inference attacks is usually set to a level where its mean squared error is not less than a certain percentage of that of a random predictor; and the security threshold for record linking attacks is usually set to a level where its matching success rate does not exceed a preset extremely low percentage.

[0125] Among them, satisfying the preset game convergence condition means that the comprehensive utility value reaches the threshold and the index values ​​of all attack dimensions do not exceed their respective security lines, indicating that the synthetic dataset has reached an acceptable balance between privacy and data quality, and the game can be terminated.

[0126] Among them, failure to meet the preset game convergence conditions means that the comprehensive utility value does not meet the standard or that the index value of at least one attack dimension exceeds the safety line, indicating that the synthetic dataset still has problems in terms of privacy protection or data quality and needs to be further iterated and adjusted.

[0127] Optionally, after each round of game evaluation, the referee agent performs a convergence determination. First, it checks whether the calculated overall utility value U is greater than or equal to a preset overall utility threshold θ. If U < θ, it is directly determined as non-convergence, without further checking of attack metrics. If U ≥ θ, it further checks whether the metric values ​​of each attack dimension are all less than or equal to their respective preset security thresholds: whether the AUC of member inference attacks does not exceed the security line, whether the leakage strength metric of attribute inference attacks does not exceed the security line, and whether the matching success rate of record link attacks does not exceed the security line. Only when all attack metrics meet the security conditions is the game considered converged, and the current synthetic log dataset is output as the test sample set. If any attack metric exceeds the security line, even if the overall utility value has reached the threshold, iteration must continue. After determining non-convergence, the referee agent issues tuning instructions to the generator agent, including adjusting the privacy protection strength parameters. And log recording generated parameters (i.e., decoding temperature) If the attack metrics are too high but the quality metrics are good, prioritize strengthening privacy protection; if the quality metrics are too low but the attack metrics are good, prioritize adjusting log generation parameters to improve generation quality; if neither is ideal, then coordinate adjustments are needed to proceed to the next iteration.

[0128] In this embodiment, a dual convergence condition is established by setting a comprehensive utility threshold and a security threshold for each attack dimension. This ensures that while the overall utility level of the synthetic dataset meets the standard, each privacy attack indicator is strictly controlled within an acceptable range. This dual judgment mechanism effectively prevents evaluation distortion caused by anomalies in a single indicator—even if the comprehensive utility value is high, if the success rate of a certain type of attack still exceeds the safety line, iterative optimization will continue until the attack indicator is suppressed below the safety level. This ensures that the final output test sample set is only recognized after passing comprehensive privacy protection verification, eliminating the risk of privacy leakage due to the neglect of a certain attack dimension. At the same time, the differentiated optimization strategy when convergence is not achieved can accurately locate the problem based on the specific performance of the current round, and adjust the privacy protection parameters and generation parameters in a targeted manner, effectively improving the game convergence efficiency, and ultimately maximizing the data availability of the synthetic data in the crowdsourced testing range while meeting strict privacy protection constraints.

[0129] In practical applications, such as Figure 3 As shown, the complete process of Nash equilibrium convergence and output control includes:

[0130] During the process initiation phase, the initial privacy budget operation is performed first to set the total privacy consumption limit for differential privacy protection, providing a benchmark for privacy accounting in subsequent iterations.

[0131] During the data privacy processing stage, the following operations are performed sequentially on the original log dataset: First, semantic encoding is performed to map the semi-structured original log records into high-dimensional embedding vectors of uniform dimension; then, gradient pruning is performed to constrain the L2 norm of each embedding vector, limiting the maximum impact of any single record on subsequent aggregation operations; finally, Gaussian noise injection is performed to superimpose calibrated Gaussian noise on the pruned embeddings, generating a privacy-preserving log representation set that satisfies differential privacy protection.

[0132] In the data reconstruction phase, the generator agent uses a noisy, privacy-preserving log representation as a conditional input and reconstructs the synthetic log dataset through autoregressive decoding.

[0133] During the red-blue team parallel evaluation phase, the generator agent simultaneously sends batches of synthesized data to both the attacker and defender agents. The attacker agent (red team) launches privacy attacks from three dimensions: member inference attacks, and outputs an inference advantage metric (Adv). MIA Attribute inference attack, output attribute leakage rate metric Record link attacks and output re-identification risk indicators. The aforementioned metrics are then aggregated into an attack result vector and sent to the referee agent. The defender agent (blue team) evaluates data quality from three dimensions: calculating the Wasserstein distance W1(P_real,P_syn) between synthetic and real data to measure edge distribution preservation; calculating the graph edit distance GED(T_real,T_syn) of the network topology graph to measure topology preservation; and calculating the KL divergence DKL(Q_tail||P_tail) of the long-tail region to measure anomaly distribution preservation. These metrics are then aggregated into a fidelity vector and sent to the referee agent.

[0134] During the adjudication phase, after receiving the attack result vector and fidelity vector, the adjudicator agent first performs a privacy budget check: if the current cumulative privacy consumption is close to or exceeds the preset privacy budget limit, a stop generation mechanism is triggered to terminate the iteration process and output the final synthesized data. This dataset can be directly deployed to the crowdsourcing sandbox for use by white-hat researchers; if there is still a balance in the privacy budget, the evaluation results of both parties are further combined to determine whether the Nash equilibrium convergence condition has been met.

[0135] Convergence Judgment and Iteration Control: If the overall utility value reaches a preset threshold and the index values ​​of all attack dimensions are lower than their respective security lines, the game is judged to have converged. The converged batch is output and packaged into a standardized API endpoint and traffic replay engine, which is then deployed to an isolated crowdsourcing sandbox environment for use by white-hat researchers. If convergence is not achieved, the referee agent sends parameter adjustment instructions to the generator agent to adjust the noise scale and decoding temperature, and enters the next round of adversarial iteration. The entire process from semantic encoding to red-blue parallel evaluation is re-executed until the privacy budget is exhausted or the game converges.

[0136] Figure 4 This is a diagram illustrating the overall architecture of a test sample synthesis system based on differential privacy processing and multi-agent collaboration, as provided in an embodiment of this application. Figure 4 As shown, the system architecture includes a privacy processing layer (A), a multi-team adversarial game framework (B), and a target application layer (C).

[0137] The privacy processing layer (A) is responsible for pre-privacy protection of the original sensitive logs. After semantic encoding, the original log data undergoes DP-SGD gradient pruning and Gaussian noise injection through a differential privacy mechanism (DPM) to generate a noisy embedding space. This process ensures that the output privatized log representation satisfies strict (ε,δ)-differential privacy guarantees by severing the mathematical associations of individual real users, thus providing a secure input basis for upper-level game theory.

[0138] The multi-team adversarial game framework (B) serves as the core decision-making and optimization hub of the system, deploying four types of large language model agents. The generator agent performs denoising and reconstruction based on a noisy embedding space, dynamically adjusting the decoding temperature to generate a synthetic traffic dataset; the attacker agent simulates malicious behavior, submitting privacy attack results such as member inference, attribute inference, and record links; the defender agent verifies the statistical fidelity of edge distribution, network topology, and long-tail anomalies; and the referee agent is responsible for determining the Nash equilibrium convergence conditions. Through adversarial game theory, each party dynamically adjusts the noise scale and generation strategy, seeking a Nash equilibrium between privacy risks and data quality.

[0139] The target application layer (C) is the final output and deployment stage of the system. After the game convergence, the system outputs a fully synthetic traffic dataset. Under the premise of ensuring zero compliance risk and no loss of test effectiveness, this dataset is deployed as a crowdsourced testing benchmark in an isolated sandbox environment for use by white-hat security researchers.

[0140] To further illustrate the engineering implementation path and practical application effect of the technical solution of this application, two specific application scenario examples are given below.

[0141] The first application scenario is an online payment system of a large commercial bank, illustrating how the method described in this application generates high-fidelity synthetic transaction traffic for its crowdsourcing project. The online payment system processes approximately 8 million transactions daily, involving 12 business types including transfers, credit card spending, and wealth management subscriptions. The backend consists of 56 microservices that communicate with each other via gRPC and RESTful APIs. The bank's security team hopes to discover vulnerabilities in the payment chain, such as unauthorized access, amount tampering, and replay attacks, through the Bug Bounty project. However, regulatory authorities have explicitly required that no real customer transaction records be exposed during the crowdsourcing process.

[0142] During the data acquisition phase, the system continuously collected approximately 56 million raw transaction logs over seven days using a traffic mirroring proxy deployed at the API gateway layer. Each log entry is a JSON structure containing a request header, request body, response body, and timestamp. Typical sensitive fields include user UID, bank card number, payee account, transaction amount, GPS location, and device fingerprint. The system also collected inter-service call chain tracing data, which records the complete call path and latency distribution for each transaction from the gateway entry point through the risk control engine, account service, payment core, and clearing system. The sensitive field identification engine uses a BERT-NER model finely tuned on a financial domain corpus to perform entity classification on all leaf node values ​​in the JSON logs. The model can identify 16 types of PII entities. In this embodiment, the engine labeled approximately 230 million sensitive field instances in the 56 million log entries, achieving a coverage rate of 99.2% verified by manual sampling. The semantic encoding stage uses a Transformer-based encoder. This encoder, based on SecBERT pre-trained weights, is fine-tuned for domain adaptation using 3 million anonymized historical transaction logs from within the bank. The encoder flattens each JSON log into a token sequence and outputs a 768-dimensional semantic embedding vector. To capture the temporal context of transactions, the encoder also receives five transaction records from the same user before and after the current transaction as a context window, enabling the embedding to encode temporal patterns in the user's behavioral sequence. After entering the differential privacy processing layer, ε=1.0 and δ=10⁻ are determined. 7 Privacy parameters. The gradient clipping threshold C is selected based on statistical analysis of the L2 norm distribution of the embedding vectors. The system randomly samples 100,000 embedding vectors and calculates the 95th percentile of their L2 norm. In this embodiment, C=12.7. The noise standard deviation σ is derived by the RDP ledger based on the target privacy parameters and the total number of iterations. In this embodiment, σ=0.87.

[0143] In the LLM multi-agent adversarial generation layer, all four types of agents are fine-tuned based on an open-source large language model with 13 billion parameters. The generator agent's fine-tuning data comes from 500,000 noisy-injected embedding-log pairing samples. The training objective is to minimize the edit distance between the noisy embedding decoding output and the original log. The generator's decoding temperature is initially set to τ=0.7. The three attack strategies of the attacker agent are implemented as follows in this embodiment: the member inference attack uses a shadow model-based method. The attacker trains a binary classifier, takes the embedding vector of a record and the statistical summary of the synthetic dataset as input, and outputs the probability that the record belongs to the original training set; the attribute inference attack focuses on highly sensitive attributes. The attacker attempts to infer a user's monthly income range from a user's synthetic transaction sequence; the record linking attack simulates an attacker having an external phone number-username mapping table and attempts to associate and match behavioral patterns in the synthetic data with external identities. In this embodiment, the defender agent focuses on monitoring the following fidelity metrics: the first-order Wasserstein distance of the transaction amount distribution for each of the 12 business types, with a threshold set to W1 < 0.05; the graph edit distance of the call topology graph composed of 56 microservices, requiring that the edit distance between the service call graph in the synthetic data and the real call graph does not exceed 3% of the number of edges in the real graph; and the distribution preservation of long-tail anomalies, requiring that the frequency of anomalies in the synthetic data and the KL divergence of the original data be less than 0.1. The referee agent sets α = 0.6 and β = 0.4 in the comprehensive utility function, sets the convergence threshold to θ = 0.75, and the security line requires that the AUC of member inference attacks does not exceed 0.52, the mean square error of attribute inference is not less than 90% of that of the random predictor, and the Top-1 accuracy of record links does not exceed 0.01%.

[0144] In the actual operation of this embodiment, the adversarial game converged after 47 rounds of iteration. In the first 15 rounds, the attacker's member inference AUC dropped rapidly from an initial 0.61 to 0.54. During this stage, the referee mainly suppressed privacy risks by gradually increasing the noise scale σ from 0.87 to 1.12. However, at the same time, the defender detected that the Wasserstein distance of the transaction amount distribution increased from 0.03 to 0.09, exceeding the threshold. The referee then switched strategies, reducing the decoding temperature from 0.7 to 0.55 in rounds 16 to 30 and introducing conditional decoding, requiring the generator to refer to the historical distribution histogram of the business type as a soft constraint when decoding the transaction amount field. This adjustment caused the Wasserstein distance to fall back to 0.04, while the member inference AUC stabilized below 0.52. The fine-tuning in rounds 31 to 47 focused primarily on calibrating the distribution of long-tail anomalies. The referee-guided generator used a higher decoding temperature (τ=0.85) for anomaly samples and a lower temperature (τ=0.5) for normal transactions. This classification temperature control strategy ultimately reduced the long-tail KL divergence to 0.08. The final synthetic dataset contained 56 million fully synthetic transaction logs, and the RDP ledger consumed a cumulative privacy budget of ε_used=0.93. Independent validation showed that the mean Wasserstein distance for the marginal distribution of transaction amounts across 12 business categories was 0.037, the microservice call topology graph edit distance was 1.8% of the actual graph edges, and the KL divergence for the frequency of long-tail anomalies was 0.078. After deploying the synthetic dataset to an isolated crowdsourced testing sandbox, the bank's security team launched a 30-day Bug Bounty project. During this period, 42 white-hat researchers submitted 127 vulnerability reports, of which 23 were confirmed as valid vulnerabilities, resulting in a report validity rate of 18.1%. In contrast, a previous crowdsourcing test conducted by a bank using traditional masked and anonymized data had a reporting effectiveness rate of only 6.3%, and no deep vulnerabilities involving microservice call chains were found. This demonstrates that the synthetic data generated by the method in this application significantly improves the vulnerability discovery capabilities of crowdsourcing tests while maintaining absolute privacy and security.

[0145] The second embodiment uses the electronic medical record (EMR) system of a top-tier hospital as an application scenario to demonstrate the engineering implementation of the proposed method in the medical field. The hospital's EMR system integrates five subsystems: outpatient registration, prescription issuance, laboratory testing, imaging reports, and billing, generating approximately 120,000 business interaction records daily. The hospital's information security department intends to discover potential vulnerabilities in the EMR system, such as prescription tampering and unauthorized access to patient information, through crowdsourcing testing. However, due to HIPAA compliance requirements, it is strictly prohibited to expose any protected health information of real patients to external white-hat hackers. Compared to financial scenarios, the synthesis of medical data faces greater complexity. Medical interaction logs not only contain regular PII fields but also a large number of professional fields with strict clinical logic constraints. For example, the drug name, dosage, and usage in a prescription record must maintain clinical consistency with the diagnostic code. Traditional desensitization methods, after replacing drug names or diagnostic codes, are prone to producing clinically unreasonable record combinations, and this ambiguity directly destroys the value of the test.

[0146] This embodiment's data collection scope covers all five subsystems of the EMR system, with a collection period of 14 days, collecting approximately 1.68 million interaction logs. The log format is HL7 FHIR standard JSON resources, and each record contains different field structures depending on the resource type. In addition to standard PII detection capabilities, the sensitive field identification engine loads a dedicated medical PHI identification model, capable of recognizing medical record numbers, social security numbers, attending physician names, and other medical-specific PHI entities. The semantic encoding stage employs a different architectural strategy than in Embodiment 1. Due to the strong pattern constraints of medical data, this embodiment uses a dual-encoder architecture: a structural encoder encodes the JSON skeleton of the FHIR resource into a 384-dimensional structural embedding, and a semantic encoder, fine-tuned based on PubMedBERT, encodes the medical semantic information in the field values ​​into a 384-dimensional semantic embedding. The two embeddings are concatenated to form a complete 768-dimensional embedding vector. The dual encoder design aims to decouple structural and semantic information. Differential privacy noise is injected only into the semantic embedding, while the structural embedding remains noise-free to ensure the format compliance of the generated data. This design leads to the core improvement in the differential privacy processing layer of this embodiment: the partitioned noise injection strategy. The system divides the 768-dimensional embedding vector into structural and semantic regions, performing gradient pruning and noise injection only on the semantic region. The privacy guarantee of this partitioning strategy still holds because the post-processing invariance theorem of differential privacy guarantees that applying any deterministic function to the output of a mechanism that satisfies differential privacy will still satisfy differential privacy. The privacy budget in this embodiment is set more conservatively: ε=0.5, δ=10⁻ 8 Medical data is significantly more sensitive than financial data. A smaller ε means stronger privacy protection, but at the same time, it places higher demands on the generator's denoising and reconstruction capabilities.

[0147] In the multi-agent adversarial layer, this embodiment introduces an additional constraint mechanism: a clinical consistency verifier. This verifier is not an independent LLM agent but rather a rule engine embedded in the defender agent's evaluation process. Its knowledge base contains approximately 8,000 hard constraint rules extracted from clinical guidelines and drug instructions, encoded in first-order predicate logic. In addition to calculating regular fidelity metrics, the defender uses the clinical consistency verifier to perform rule validation on each synthetic record. Records violating any hard rules are flagged and fed back to the referee agent. The referee then increases the weight of conditional constraint decoding in the tuning instructions, ensuring that the synthetic data not only statistically approximates real data but also meets clinical rationality at the micro-level of each record. In this embodiment, the attacker agent adds a medical-specific attack vector: inference attacks based on rare diseases. Some rare diseases may only have a handful of patients in the entire dataset. Even after differential privacy processing, the unique diagnosis-medication-testing patterns of these records may still leave identifiable traces in the synthetic data. To address this attack, the system adds a rare pattern detection step before noise injection. For record groups associated with diagnostic codes that occur less than a threshold (20 times in this embodiment), the noise scale is amplified by a factor of 2 to ensure stronger privacy protection for patients with rare diseases. The trade-off is a slight decrease in the reconstruction fidelity of these records, but this is a perfectly acceptable compromise in a medical scenario where privacy is of paramount importance. The generator agent in this embodiment employs a hierarchical decoding strategy. The generator first decodes the skeleton structure of the FHIR resource, then decodes the specific values ​​field by field according to the topological order of the dependencies between fields. The system automatically mines the conditional dependency graph between fields from the training data. When generating drug names, the decoder uses the already generated diagnostic codes as conditional constraints. The final dependency graph contains approximately 340 directed edges, covering the most critical clinical logic constraints in the EMR system. In this embodiment, the referee agent adopts a more conservative security threshold setting than that in the financial scenario. The security threshold for member inference attack AUC is tightened to 0.51, the matching success rate requirement for rare disease inference attack is less than 0.005%, and the weights of the utility function are adjusted to α=0.45 and β=0.55, reflecting the business principle of prioritizing privacy over fidelity in the medical scenario.

[0148] In this embodiment, the adversarial game converged after 63 iterations, approximately 16 more than in the financial scenario. This is because a stricter privacy budget requires the generator to perform more rounds of fine-tuning. A noteworthy technical challenge during the convergence process occurred between rounds 22 and 35: the referee discovered that while the attacker's rare disease inference attack success rate did indeed drop below the safety threshold after noise amplification, the clinical consistency verifier reported that the clinical consistency verification pass rate of rare disease-related records in the synthetic data plummeted from the normal 99.5% to 87.3%. This was because double noise severely interfered with the semantic embedding of these records, causing the generator to deviate from the correct drug classification when decoding drug names. The referee's response was to guide the generator to enable an explicit conditional constraint decoding mode for rare disease records. Specifically, when decoding drug fields, it forced sampling from the list of legitimate drugs corresponding to the diagnosis code in the clinical consistency verifier's knowledge base, rather than relying entirely on autoregressive decoding. This strategy restored the clinical consistency verification rate of rare disease records to 98.9%, while maintaining the rare disease inference attack success rate at 0.003%. The final synthetic dataset achieved a clinical consistency verification rate of 99.6% through the clinical consistency validator. The average Wasserstein distance for the business type distribution of the five subsystems was 0.041, the triplet conditional dependency retention rate for diagnosis codes, drugs, and tests was 97.8%, and the cumulative privacy budget consumption ε_used = 0.47. After the synthetic dataset was deployed to the crowdsourced testing range, 31 white-hat researchers with medical information security backgrounds submitted 89 reports within a 45-day testing period. Among them, 17 were confirmed as valid vulnerabilities, including one insecure direct object reference vulnerability in prescription permission transfer. Attackers could issue controlled drug prescriptions as ordinary physicians by tampering with the Practitioner reference ID in the FHIR resource. The discovery of this high-risk vulnerability was due to the synthetic data faithfully preserving the complex mapping relationship between different physician role permissions and prescription scope. In contrast, in traditional desensitization schemes, the permission mapping logic was completely destroyed because the physician ID was replaced with a meaningless random string, making it impossible for white-hats to construct effective permission test cases. This result strongly validates the application value of this application in the medical field.

[0149] The two embodiments above respectively verified the universality and effectiveness of the technical solution of this application in two highly privacy-sensitive fields: financial payment and medical health. They showed that the method of this application can generate a high-fidelity synthetic test sample set that maintains the original data business logic association, inter-field conditional dependency relationship and long-tail abnormal distribution characteristics under strict differential privacy protection constraints, providing reliable data support for the construction of crowdsourced testing ranges in different industries.

[0150] In another embodiment, such as Figure 5As shown, a test sample synthesis method based on differential privacy processing and multi-agent cooperation is provided. Taking the application of this method to a server as an example, the method includes the following steps:

[0151] Step S502: Obtain the original log dataset and differential privacy protection parameters, and perform semantic encoding on each original log data in the original log dataset to obtain the semantic representation of each log.

[0152] Step S504: Perform gradient pruning on each log semantic representation to obtain each pruned log semantic representation.

[0153] Step S506: Based on the differential privacy protection parameters, determine the noise intensity, and based on the noise intensity, superimpose Gaussian noise on each pruned log semantic representation to generate a privacy-preserving log representation set.

[0154] Step S508: The generator agent reconstructs the data based on the privacy-preserving log representation set to obtain the synthetic log dataset.

[0155] Step S510: The synthetic log dataset is evaluated by multiple game agents to obtain the evaluation results of multiple game agents.

[0156] Step S512: Based on the evaluation results of multiple game agents, determine whether the preset game convergence condition is met. If not, adjust the differential privacy protection parameters and the log recording generation parameters of the generator agent, and return to the step of privacy processing of the original log dataset based on the differential privacy protection parameters to generate a privacy log representation set, until the evaluation results of multiple game agents meet the preset game convergence condition.

[0157] Step S514: Use the synthetic log dataset that meets the preset game convergence conditions as the test sample set.

[0158] It should be noted that the specific limitations of the above steps can be found in the specific limitations of the test sample synthesis method based on differential privacy processing and multi-agent collaboration described above.

[0159] It should be understood that although the steps in the flowcharts of the embodiments described above 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 restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0160] The following describes the test sample synthesis apparatus based on differential privacy processing and multi-agent collaboration provided in the embodiments of this application. The test sample synthesis apparatus based on differential privacy processing and multi-agent collaboration has the same inventive concept as the test sample synthesis method based on differential privacy processing and multi-agent collaboration described above. The solution to the problem provided by this apparatus is similar to the solution described in the above method. Therefore, the specific limitations of one or more test sample synthesis apparatus embodiments based on differential privacy processing and multi-agent collaboration provided below can be found in the limitations of the test sample synthesis method based on differential privacy processing and multi-agent collaboration described above. The test sample synthesis apparatus based on differential privacy processing and multi-agent collaboration described below can be referred to in correspondence with the test sample synthesis method based on differential privacy processing and multi-agent collaboration described above, and will not be repeated here.

[0161] In one exemplary embodiment, Figure 6 A schematic diagram of a test sample synthesis device based on differential privacy processing and multi-agent collaboration, provided in an embodiment of this application, is shown below. Figure 6 As shown, the test sample synthesis device based on differential privacy processing and multi-agent collaboration includes: a processing module 602, a reconstruction module 604, a game-playing module 606, a judgment module 608, and a determination module 610, wherein:

[0162] The processing module 602 is used to obtain the original log dataset and differential privacy protection parameters, and based on the differential privacy protection parameters, to perform privacy processing on the original log dataset to generate a privacy-preserving log representation set;

[0163] The reconstruction module 604 is used to reconstruct data based on the privacy-preserving log representation set by the generator agent to obtain a synthetic log dataset.

[0164] The game theory module 606 is used to perform game evaluation on the synthetic log dataset through multiple game agents and obtain the evaluation results of multiple game agents.

[0165] The judgment module 608 is used to determine whether the preset game convergence condition is met based on the evaluation results of multiple game agents. If it is not met, the differential privacy protection parameters and the log recording generation parameters of the generator agent are adjusted, and the steps of privacy processing of the original log dataset based on the differential privacy protection parameters and generating privacy log representation set are returned until the evaluation results of multiple game agents meet the preset game convergence condition.

[0166] The determination module 610 is used to use the synthetic log dataset that meets the preset game convergence conditions as the test sample set.

[0167] In an exemplary embodiment, the processing module 602 is specifically used to perform semantic encoding on each original log data in the original log dataset to obtain each log semantic representation; and to perform privacy processing on each log semantic representation based on differential privacy protection parameters to generate a privacy log representation set.

[0168] In an exemplary embodiment, the processing module 602 is specifically used to perform gradient pruning on each log semantic representation to obtain each pruned log semantic representation; determine the noise intensity based on differential privacy protection parameters, and based on the noise intensity, superimpose Gaussian noise on each pruned log semantic representation to generate a set of privacy-preserving log representations.

[0169] In an exemplary embodiment, the multiple game agents include an attacker agent, a defender agent, and a referee agent; the game module 606 is specifically used to perform an attack risk assessment on the synthetic log dataset by the attacker agent to obtain an attack risk assessment result, and to perform a data quality assessment on the synthetic log dataset by the defender agent to obtain a data quality assessment result; the referee agent determines the game decision result of the synthetic log dataset based on the attack risk assessment result and the data quality assessment result; and the attack risk assessment result, the data quality assessment result, and the game decision result are used as the respective assessment results.

[0170] In an exemplary embodiment, the attack risk assessment result includes indicator values ​​for multiple attack dimensions; the data quality assessment result includes indicator values ​​for multiple data quality dimensions; the game decision result includes a comprehensive utility value; the game module 606 is specifically used to determine an attack risk score value based on the indicator values ​​for multiple attack dimensions by a referee agent, and to determine a data quality score value based on the indicator values ​​for multiple data quality dimensions by a referee agent; the referee agent obtains data quality weight coefficients and attack risk weight coefficients, and performs a weighted calculation on the data quality score value and the attack risk score value based on the data quality weight coefficients and the attack risk weight coefficients to obtain the comprehensive utility value of the synthetic log dataset.

[0171] In an exemplary embodiment, the determination module 608 is specifically used to determine that the preset game convergence condition is met if the overall utility value is greater than or equal to a preset overall utility threshold and the index value of each attack dimension is less than or equal to the preset security threshold corresponding to each attack dimension; and to determine that the preset game convergence condition is not met if the overall utility value is less than the preset overall utility threshold or the index value of any attack dimension is greater than the preset security threshold corresponding to that attack dimension.

[0172] In one exemplary embodiment, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the test sample synthesis methods based on differential privacy processing and multi-agent cooperation in the above embodiments.

[0173] In one exemplary embodiment, this application also provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of any of the test sample synthesis methods based on differential privacy processing and multi-agent cooperation in the above embodiments.

[0174] In one exemplary embodiment, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the test sample synthesis methods based on differential privacy processing and multi-agent collaboration in the above embodiments.

[0175] Indicatively, such as Figure 7 As shown, Figure 7 This is a schematic diagram of the internal structure of a computer device 700 provided in an embodiment of this application. The computer device 700 can be provided as a server. (Refer to...) Figure 7 The computer device 700 includes a processing component 702, which further includes one or more processors, and memory resources represented by memory 701 for storing instructions, such as application programs, that can be executed by the processing component 702. The application programs stored in memory 701 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 702 is configured to execute instructions to perform the test sample synthesis method based on differential privacy processing and multi-agent cooperation of any of the above embodiments.

[0176] The computer device 700 may also include a power supply component 703 configured to perform power management of the computer device 700, a wired or wireless network interface 704 configured to connect the computer device 700 to a network, and an input / output (I / O) interface 705. The computer device 700 can operate on an operating system stored in memory 701, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.

[0177] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0178] It should be noted that the log information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0179] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0180] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.

[0181] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for synthesizing test samples based on differential privacy processing and multi-agent collaboration, characterized in that, The method includes: Obtain the original log dataset and differential privacy protection parameters, and based on the differential privacy protection parameters, perform privacy processing on the original log dataset to generate a privacy-preserving log representation set; The generator agent reconstructs the data based on the privacy-preserving log representation set to obtain a synthetic log dataset; The synthetic log dataset is evaluated by multiple game agents to obtain the evaluation results of the multiple game agents; Based on the evaluation results of multiple game agents, it is determined whether the preset game convergence condition is met. If not, the differential privacy protection parameter and the log recording generation parameter of the generator agent are adjusted, and the step of performing privacy processing on the original log dataset based on the differential privacy protection parameter to generate a privacy log representation set is returned until the evaluation results of multiple game agents meet the preset game convergence condition. The synthetic log dataset that satisfies the preset game convergence condition will be used as the test sample set.

2. The method according to claim 1, characterized in that, The process of privatizing the original log dataset based on the differential privacy protection parameters to generate a privatized log representation set includes: Semantic encoding is performed on each raw log data in the raw log dataset to obtain a semantic representation of each log. Based on the differential privacy protection parameters, the semantic representations of each log are privatized to generate a set of privatized log representations.

3. The method according to claim 2, characterized in that, The step of privatizing each log semantic representation based on the differential privacy protection parameters to generate a privatized log representation set includes: Gradient pruning is performed on each of the log semantic representations to obtain each pruned log semantic representation; Based on the differential privacy protection parameters, the noise intensity is determined, and based on the noise intensity, Gaussian noise is superimposed on each of the pruned log semantic representations to generate a set of privacy-preserving log representations.

4. The method according to claim 1, characterized in that, The multiple game agents include an attacker agent, a defender agent, and a referee agent; the game evaluation of the synthetic log dataset by the multiple game agents to obtain the evaluation results of the multiple game agents includes: The attacker agent performs an attack risk assessment on the synthetic log dataset to obtain an attack risk assessment result, and the defender agent performs a data quality assessment on the synthetic log dataset to obtain a data quality assessment result. The referee agent determines the game decision result of the synthetic log dataset based on the attack risk assessment result and the data quality assessment result; The attack risk assessment result, the data quality assessment result, and the game decision result are used as the respective assessment results.

5. The method according to claim 4, characterized in that, The attack risk assessment result includes indicator values ​​for multiple attack dimensions; the data quality assessment result includes indicator values ​​for multiple data quality dimensions; the game decision result includes a comprehensive utility value; the process of determining the game decision result of the synthetic log dataset by the referee agent based on the attack risk assessment result and the data quality assessment result includes: The referee agent determines an attack risk score based on the indicator values ​​of the multiple attack dimensions, and determines a data quality score based on the indicator values ​​of the multiple data quality dimensions. The data quality weight coefficient and attack risk weight coefficient are obtained through the referee agent, and the data quality score and attack risk score are weighted and calculated based on the data quality weight coefficient and the attack risk weight coefficient to obtain the comprehensive utility value of the synthetic log dataset.

6. The method according to claim 5, characterized in that, The determination of whether the preset game convergence condition is met based on the evaluation results of multiple game agents includes: If the overall utility value is greater than or equal to the preset overall utility threshold and the index value of each attack dimension is less than or equal to the preset security threshold corresponding to each attack dimension, then the preset game convergence condition is satisfied. If the overall utility value is less than the preset overall utility threshold or the index value of any of the attack dimensions is greater than the preset security threshold corresponding to that attack dimension, then it is determined that the preset game convergence condition is not met.

7. A test sample synthesis device based on differential privacy processing and multi-agent collaboration, characterized in that, The device includes: The processing module is used to obtain the original log dataset and differential privacy protection parameters, and based on the differential privacy protection parameters, to perform privacy processing on the original log dataset to generate a privacy log representation set; The reconstruction module is used to reconstruct data based on the privacy-preserving log representation set by the generator agent to obtain a synthetic log dataset; The game theory module is used to perform game evaluation on the synthetic log dataset through multiple game agents to obtain the evaluation results of the multiple game agents; The judgment module is used to determine whether the preset game convergence condition is met based on the evaluation results of multiple game agents. If not, the differential privacy protection parameter and the log recording generation parameter of the generator agent are adjusted, and the step of performing privacy processing on the original log dataset based on the differential privacy protection parameter to generate a privacy log representation set is returned until the evaluation results of multiple game agents meet the preset game convergence condition. The determination module is used to use the synthetic log dataset that meets the preset game convergence conditions as the test sample set.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. 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 method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.