Agent-based large model dynamic desensitization system and method

By using the Agent-based large-model dynamic desensitization system, which combines multi-source perception, intelligent decision-making, and large-model semantic enhancement, the system solves the compatibility and adaptability issues of existing technologies in large-model interaction scenarios. It achieves high-precision, low-loss dynamic desensitization, and is applicable to multiple industry scenarios such as finance, healthcare, and government affairs.

CN122020693APending Publication Date: 2026-05-12HANGZHOU ANQUAN DIGITAL INTELLIGENCE TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU ANQUAN DIGITAL INTELLIGENCE TECH CO LTD
Filing Date
2026-04-14
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing dynamic desensitization technologies suffer from poor compatibility, insufficient adaptability, lack of adaptive decision-making capabilities, and passive rule execution in large-scale model interaction scenarios. This results in a mismatch between desensitization accuracy and usability, making it difficult to adapt to complex and diverse sensitive data types and interaction scenarios.

Method used

A large-scale model dynamic desensitization system based on agents is adopted. The system collects multi-dimensional information in real time through a multi-source perception module, combines the rule engine of the intelligent decision-making module with the reinforcement learning model to generate adaptive strategies, uses the large-scale model semantic enhancement module to identify explicit and implicit sensitive information, and performs desensitization operations through the dynamic desensitization execution module, which implements protocol adaptation and data length compensation mechanisms.

Benefits of technology

It achieves high-precision data masking across multiple database types and transmission protocols, reduces performance overhead, supports data security requirements across multiple industries, balances data security and availability, and improves policy adaptability and accuracy through a closed-loop optimization mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122020693A_ABST
    Figure CN122020693A_ABST
Patent Text Reader

Abstract

The invention discloses an Agent-based large-model dynamic desensitization system and method, and the system comprises a multi-source sensing module which is used for collecting and structurally processing multi-dimensional information in real time; the intelligent decision-making module is used for generating a self-adaptive desensitization strategy through a decision-making mechanism fused by a rule engine and a reinforcement learning model based on the multi-dimensional information; the large model semantic enhancement module is used for performing semantic understanding on input data by using a pre-accessed large model and identifying sensitive contents including dominant sensitive information and context implicit sensitive information; the dynamic desensitization execution module is used for executing desensitization operation on the recognized sensitive content through a protocol self-adaption and data length compensation mechanism according to the desensitization strategy, and the problems that an existing dynamic desensitization technology is poor in compatibility, insufficient in adaptability and lack of self-adaption decision-making capacity and passive rule execution are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data security processing technology, and in particular to a large-scale dynamic de-identification system and method based on agents. Background Technology

[0002] In recent years, large-scale models have been widely used across various industries. During large-scale model interactions, user input often contains a large amount of sensitive information, such as personal identification information, trade secrets, and medical records. Leakage of such information could lead to privacy risks and financial losses. Traditional data anonymization techniques, primarily based on static rules or simple pattern matching, are ill-suited to the complexity and dynamism of large-scale model interaction scenarios.

[0003] In recent years, some studies have attempted to introduce machine learning mechanisms to construct dynamic data anonymization schemes, but they still face several challenges in practice: some schemes achieve anonymization by rewriting SQL statements or modifying database return results, requiring adaptation to specific database protocols. Limited by the closed nature of commercial database protocols, their universality is constrained, and changes in data length after anonymization may affect transmission stability, leading to additional performance overhead. Other middleware-based schemes are heavily reliant on client connection methods, increasing deployment difficulty when interfacing with third-party applications or existing systems, thus limiting their applicability. Furthermore, most existing methods do not fully integrate multi-dimensional information such as user identity, interaction context, and scenario risks into policy generation, easily leading to a mismatch between the anonymization granularity and actual needs, affecting data availability or security protection effectiveness. Simultaneously, current anonymization mechanisms mostly adopt a fixed rule-driven model, lacking proactive perception of the interaction process, intelligent decision-making, and continuous optimization capabilities based on feedback, resulting in insufficient support for diverse sensitive data types and complex interaction scenarios. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide an agent-based dynamic de-identification system and method for large models, which solves the technical problems of poor compatibility, insufficient adaptability, lack of adaptive decision-making ability, and passive rule execution in existing dynamic de-identification technologies, and achieves the effects of wide compatibility, a balance between de-identification accuracy and usability, and strong scenario adaptability. The specific solution is as follows:

[0005] Firstly, this application provides an agent-based large-model dynamic de-identification system, comprising:

[0006] The multi-source sensing module is used to collect and structure multi-dimensional information in real time;

[0007] The intelligent decision-making module, connected to the multi-source perception module, is used to generate an adaptive desensitization strategy based on the multi-dimensional information through a decision-making mechanism that integrates a rule engine and a reinforcement learning model.

[0008] The large model semantic enhancement module, connected to the intelligent decision-making module, is used to perform semantic understanding on the input data using a pre-connected large model, and to identify sensitive content, including explicit sensitive information and contextual implicit sensitive information.

[0009] The dynamic desensitization execution module is connected to the intelligent decision-making module and the large model semantic enhancement module, respectively. It is used to perform desensitization operations on the identified sensitive content according to the desensitization strategy through protocol adaptation and data length compensation mechanism.

[0010] As a preferred technical solution of the present invention, the multi-dimensional information includes information on user identity, application scenario, data type and environmental state, and the user identity dimension information includes emotional intimacy tags generated based on the analysis of user's historical interaction behavior.

[0011] As a preferred embodiment of the present invention, the intelligent decision-making module includes a rule engine module, a reinforcement learning module, and a conflict resolution module. The rule engine module has built-in industry-standard rules and user-defined rules. The reinforcement learning module optimizes strategies based on a three-dimensional objective consisting of de-identification security, data availability, and system performance loss. The conflict resolution module is used to output the final strategy according to preset priority rules and real-time risk quantification results when strategies generated based on information from different dimensions conflict.

[0012] As a preferred embodiment of the present invention, the large model pre-connected in the large model semantic enhancement module is a model fine-tuned by low-rank adaptation technology, wherein the fine-tuning includes:

[0013] Freeze the original parameters of the large model;

[0014] Inject trainable low-rank decomposition matrix pairs next to the linear projection weights of the self-attention module in the Transformer layer of the large model.

[0015] Use a sensitive information identification and annotation dataset to train a low-rank decomposition matrix.

[0016] As a preferred embodiment of the present invention, the large model semantic enhancement module identifies entities through named entity recognition and sensitivity scoring algorithms, specifically including:

[0017] A candidate entity set is obtained through named entity recognition;

[0018] Assign basic sensitivity scores to each entity by querying the domain knowledge base;

[0019] Association weights are calculated by analyzing the contextual co-occurrence relationships between entities;

[0020] The final sensitivity score is synthesized based on the basic sensitivity score and the associated weight; and the contextual implicit sensitive information is determined based on the final sensitivity score and a preset threshold.

[0021] As a preferred embodiment of the present invention, the data length compensation mechanism is implemented by creating a desensitized view that is exactly the same as the length of the original data field.

[0022] As a preferred technical solution of the present invention, the protocol adaptation specifically includes:

[0023] At the application gateway layer, the raw data stream from the client is parsed to extract the data payload.

[0024] The data payload is sent to the dynamic desensitization execution module for processing.

[0025] The processed data will be reassembled into a new data stream according to the original protocol specifications and returned.

[0026] As a preferred technical solution of the present invention, it also includes a strategy optimization module, which is connected to the dynamic desensitization execution module and the intelligent decision-making module. The strategy optimization module is used to collect feedback on the desensitization effect and iteratively optimize the reinforcement learning model and the large model semantic enhancement module based on the feedback to form a closed-loop desensitization strategy.

[0027] As a preferred embodiment of the present invention, the dynamic desensitization execution module supports a reversible desensitization mode; the intelligent decision-making module is further configured to: dynamically decide whether to enable the reversible desensitization mode for specific sensitive content based on the trust assessment in the user identity dimension and the risk level in the application scenario dimension; when enabled, the reversible desensitization mode uses encryption parameters bound to the current user and scenario to perform desensitization and generate corresponding traceable authorized metadata.

[0028] Secondly, this invention provides a large-scale dynamic de-identification method based on agents, comprising:

[0029] Real-time collection and structured processing of multi-dimensional information;

[0030] Based on the aforementioned multi-dimensional information, and according to the decision-making mechanism that integrates the rule engine and the reinforcement learning model, an adaptive desensitization strategy is generated.

[0031] Using pre-connected large models, semantic understanding is performed on the input data to identify sensitive content, including explicit sensitive information and contextually implicit sensitive information.

[0032] Based on the aforementioned desensitization strategy, the identified sensitive content is desensitized through protocol adaptation and data length compensation mechanisms.

[0033] The beneficial effects of the technical solution of the agent-based large-model dynamic desensitization system and method of the present invention include at least the following:

[0034] Compared to existing technologies, this approach deeply integrates Agent technology with large-scale models, overcoming the limitations of traditional passive de-identification. It enables the de-identified intelligent agent to autonomously perceive, make decisions, and optimize, addressing the insufficient adaptive capabilities of existing technologies. It does not rely on specific database protocols or client connection methods, supporting multiple database types and transmission protocols. View replacement and length compensation mechanisms prevent data transmission anomalies, while caching optimization reduces performance overhead by over 40%. Combined with the semantic understanding capabilities of large-scale models, it accurately identifies explicit and implicit sensitive information. Furthermore, the Agent dynamically adjusts the de-identification strategy to avoid over- or under-identification, balancing data security and availability. It is adaptable to various industry scenarios, including finance, healthcare, and government, supporting private, public cloud, and edge deployments to meet the data security needs of different scenarios. A log retention mechanism ensures data compliance. Attached Figure Description

[0035] To more clearly illustrate the technical solutions in the embodiments of this specification, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0036] Figure 1 This is a schematic diagram of the overall architecture of a large-scale dynamic de-identification system based on an agent, provided as an embodiment of this specification.

[0037] Figure 2 This is a schematic diagram of the perception and decision-making process provided in the embodiments of this specification.

[0038] Figure 3 This is a schematic diagram illustrating the process of identifying implicit sensitive information in context using named entity recognition and sensitivity scoring algorithms, as provided in the embodiments of this specification.

[0039] Figure 4 This is a schematic diagram of the identification and execution phase provided in the embodiments of this specification.

[0040] Figure 5 This is a schematic diagram of the feedback and iteration phase process provided in the embodiments of this specification.

[0041] Figure 6 This is a flowchart illustrating a large-scale dynamic de-identification method based on an agent, as provided in the embodiments of this specification. Detailed Implementation

[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. The terms "first," "second," "third," etc., in the specification, claims, and accompanying drawings are used to distinguish different objects, not to describe a specific order. In addition, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0043] This invention provides an agent-based dynamic data anonymization system for large models. The system employs a layered architecture and utilizes the collaborative work of multiple functional modules to achieve intelligent dynamic data anonymization. It is suitable for scenarios with high requirements for sensitive data protection, such as finance, healthcare, and government affairs. Please refer to the appendix. Figure 1 The agent-based large-model dynamic desensitization system includes four core components: a multi-source perception module, an intelligent decision-making module, a large-model semantic enhancement module, and a dynamic desensitization execution module.

[0044] The multi-source perception module, as the system's information acquisition unit, is responsible for real-time acquisition and structured processing of multi-dimensional information, providing a basis for decision-making throughout the system. The intelligent decision-making module connects to the multi-source perception module and generates an adaptive desensitization strategy based on the acquired multi-dimensional information. The large-model semantic enhancement module connects to the intelligent decision-making module, utilizing a pre-accessed large model for semantic understanding and sensitive information identification. The dynamic desensitization execution module connects to both the intelligent decision-making module and the large-model semantic enhancement module, executing specific desensitization operations.

[0045] The multi-source perception module collects multi-dimensional information covering four dimensions: user identity, application scenario, data type, and environmental status. User identity information includes the user's identifier, permission level, and historical interaction records. This user identity information can be obtained from the unified identity management system, including the user's basic identity information and static permission roles. Specifically, it also includes an emotional intimacy tag generated based on the analysis of the user's historical interaction behavior. This tag is generated by analyzing factors such as the frequency of user-system interactions, the depth of interaction content, and trust behavior patterns, and is used to dynamically adjust the trust assessment of the user. The emotional intimacy tag is calculated by analyzing all data access logs of the user within a historical period (e.g., the past 90 days). The tag calculation model can be based on the following behavioral characteristics: stability of access frequency, adherence to the minimum necessity principle, operational error rate, and the presence of security violation records. The tag value is quantified as a trust score from 0 to 100 and is dynamically updated daily. Specifically, the emotional intimacy label F is calculated using the following formula: F = w1·f1 + w2·f2 + w3·f3 + w4·f4, where f1 is the standard score of the average daily access frequency over the past 90 days, f2 is the compliance rate following the minimum necessary principle, where compliance rate = number of compliant operations / total number of operations, f3 is 1 - operation error rate, and f4 is 1 - number of security violations, with an upper limit of 1, and weights w1 = 0.2, w2 = 0.4, w3 = 0.2, and w4 = 0.2; finally, F = 100 × sigmoid(Σw i f i -0.5), ensuring F∈[0,100]. Application scenario dimension information covers the current application scenario type, data usage purpose, and risk level assessment of the interaction environment. By parsing request parameters transmitted at the application layer or analyzing access paths, the current scenario is determined to be customer service, data analysis, internal audit, or development testing, etc. Furthermore, the system pre-sets baseline risk levels for different scenarios.

[0046] Data type dimension information includes the input data format type, sensitive field identifiers, data format, and transmission protocol type. By parsing SQL query statements, API request bodies, or file metadata, it identifies whether the data to be processed contains predefined sensitive field identifiers such as ID card numbers, medical records, and transaction amounts.

[0047] Environmental status information includes, but is not limited to, the current network security status, device trustworthiness, and the encryption level of the data transmission link. Real-time information can be obtained from network firewalls and host security agents, including the geographical location of the request source IP, whether the current network connection uses TLS 1.3 encryption, and the authentication status of the access terminal device. The multi-source perception module uses standardized interfaces to capture various types of information in real time and performs structured processing on the collected raw information to generate perception information data in a unified format, providing a reliable data foundation for subsequent decision-making. It should be noted that all collected information is formatted into a unified JSON log with a timestamp before being transmitted to the intelligent decision-making module.

[0048] Please see the appendix Figure 2 , attached Figure 2This diagram illustrates the flowchart of the perception and decision-making modules within the intelligent decision-making module. The intelligent decision-making module connects to the multi-source perception module, receiving related information from it and generating adaptive de-identification strategies through a decision-making mechanism that integrates a rule engine and a reinforcement learning model. This module adopts a hierarchical decision-making architecture, comprising three sub-modules: a rule engine module, a reinforcement learning module, and a conflict resolution module. The rule engine module loads an XML-formatted rule library containing general compliance rules for industries such as finance and healthcare, as well as user-defined rules. General industry rules include standard de-identification rules for common sensitive information such as ID card numbers, mobile phone numbers, bank card numbers, and medical records; for example, when displaying information to the public, mobile phone numbers retain only the first three and last four digits. User-defined rules allow users to set personalized de-identification rules based on specific business needs. The reinforcement learning module optimizes strategies based on a three-dimensional objective consisting of de-identification security, data availability, and system performance loss. Through continuous environmental interaction and reward feedback mechanisms, it learns the optimal combination of de-identification strategies. The core of the reinforcement learning module is a deep Q-network model. The state of this model represents the structured information perceived by multiple sources, and the actions are the different desensitization methods and intensities applied to different sensitive fields. The reward function R is calculated by weighting the following three factors: R = α·S + β·U - γ·C. Where S is the security score, which comes from subsequent security audit feedback; U is the usability score, which comes from the number of accesses without user complaints; C is the performance loss, which in this embodiment is the processing latency; α is the weight of the security score; β is the weight of the usability score; and γ is the weight of the performance loss. The initial values ​​of weights α, β, and γ are 0.5, 0.3, and 0.2, respectively. The policy optimization module dynamically adjusts the weights based on the false negative rate L and false positive rate M in the security audit logs. If the false negative rate L is greater than the threshold T1 for N consecutive periods, α increases by Δα. If M > threshold T2, β decreases by Δβ. If the average latency C exceeds the threshold T3, γ increases by Δγ. All weights are normalized within the interval [0,1] and satisfy α + β + γ = 1. This module outputs an optimization strategy suggestion based on the current state.

[0049] The conflict resolution module is used to resolve conflicts in strategies generated based on information from different dimensions, such as inconsistencies between scenario risks and user permission requirements. It outputs the optimal de-identification strategy based on preset priority rules and real-time risk quantification results, avoiding strategy rigidity and ensuring the consistency and rationality of decisions. This is done when the strategy output by the rule engine conflicts with the suggestions from the reinforcement learning module. For example, if the scenario is data analysis, the rule engine's strategy might de-identify monetary fields. Conversely, if the reinforcement learning module's suggestion is based on a very high user trust score and an internal network, it might retain the precision of monetary fields. When a conflict occurs, this module initiates a decision-making process, with its built-in priority rules being: Environmental Risk > Scenario Risk > User Trust Level > Data Type.

[0050] In this embodiment, the real-time risk quantification result used by the conflict mediation module is dynamically generated by a lightweight risk assessment model. This model takes multi-dimensional information collected and structured in real-time by a multi-source perception module as input and outputs a standardized comprehensive risk value. For example, this comprehensive risk value is defined within the range [0,1], with higher values ​​indicating higher risk. Specifically, the model first performs independent risk assessments for four core perception dimensions, generating corresponding dimension risk scores. The user risk score is calculated based on the user's emotional intimacy tag; the higher the user's trust level, the lower the risk score. For example, a user with a tag value of 85 has a risk score of (100-85) / 100=0.15. The scenario risk score can be directly obtained from a predefined scenario risk level table. For example, public information queries are mapped to low risk (0.2), internal data analysis to medium risk (0.5), and sensitive data export to high risk (0.8). The data risk score is calculated by weighting the type, quantity, and sensitivity level of sensitive fields in the data to be processed. For example, records containing ID numbers receive significantly higher risk scores than records containing the city of origin. Environmental risk is categorized into the security attributes of the network and device environment from which the request originates. For example, IP addresses from untrusted geographical locations or unencrypted transmission links will result in a high-risk score, such as 0.8, while access from a trusted internal network via an encrypted link will yield a low-risk score, such as 0.1.

[0051] Having obtained the risk analysis across the four dimensions mentioned above, the model calculates the final comprehensive risk value through a synthesis strategy. This embodiment employs a synthesis logic that highlights the primary risks; that is, when any dimension exhibits extremely high risk, the comprehensive risk will be significantly increased. The specific synthesis process includes: first, checking whether there is a high-risk dimension that can be disqualified outright, such as a data type risk score greater than 0.9; if so, the comprehensive risk value is directly determined to be in the high-risk range. Otherwise, a weighted calculation method is used, where the highest-scoring dimension risk score is given greater weight to ensure that the comprehensive result accurately reflects the weakest link.

[0052] To facilitate decision-making, the continuous composite risk value is divided into three discrete risk levels:

[0053] Low risk: Overall risk value is less than 0.3;

[0054] Medium risk: The overall risk value is between 0.3 and 0.7;

[0055] High risk: Overall risk score higher than 0.7;

[0056] The conflict resolution module utilizes the aforementioned real-time risk level and quantified value to perform the following steps:

[0057] When a conflict arises between the policies output by the rules engine module and the reinforcement learning module, the mediation module immediately initiates and obtains the real-time risk level and overall risk value of the current request. If the risk level is high, the system determines that the current operating environment is dangerous. The adjudication prioritizes security above all else, unconditionally adopting the conservative de-identification strategy generated by the rules engine. If the risk level is low, the system determines that the current operating environment is trustworthy. Under the premise of meeting basic compliance requirements, the adjudication prioritizes data availability and tends to adopt or closely align with the optimization strategy of the reinforcement learning module. If the risk level is medium, the system uses preset dimension priority rules for fine-tuning. For example, the default priority is: environmental risk > data risk > scenario risk > user risk. The mediation module analyzes the dimensions involved in the conflict and makes a final decision based on this priority. Simultaneously, the specific overall risk value can be used to fine-tune the de-identification intensity within the same policy direction; for example, after determining a partial mask, the number of mask bits is determined based on the overall risk value.

[0058] The large model semantic enhancement module is connected to the intelligent decision-making module and receives the input data to be processed. The large model semantic enhancement module includes three sub-modules: a sensitive information accurate identification module, a desensitization context adaptation module, and a lightweight adaptation module. In this embodiment, the large model pre-connected in the lightweight adaptation module is a model fine-tuned using low-rank adaptation technology. The fine-tuning process includes three steps: first, freezing the original parameters of the large model while keeping the pre-trained weights unchanged; then, injecting trainable low-rank factorization matrix pairs next to the linear projection weights of the self-attention module in the Transformer layer of the large model. The dimensions of these matrix pairs are much smaller than the original weight matrix; finally, training the low-rank factorization matrix using a sensitive information identification labeled dataset, enabling the model to possess specialized sensitive information identification capabilities.

[0059] In this embodiment, the large model semantic enhancement module identifies implicit sensitive information in the context through named entity recognition and sensitivity scoring algorithms. Please refer to [link to relevant documentation]. Figure 3 The details are as follows:

[0060] A candidate entity set is obtained through named entity recognition. First, its built-in, finely tuned large model is used to perform named entity recognition on the input raw text (such as customer service records, medical records, reports). This model is configured to recognize entities including, but not limited to, the following types:

[0061] People category: Name, position, family member titles;

[0062] Institutional / premises categories: Company names, hospitals, schools, government agencies;

[0063] Location-related information: detailed address, city, country, landmarks;

[0064] Numerical identifiers: telephone numbers, ID card numbers, bank card numbers, medical record numbers;

[0065] Domain-specific categories: disease name, drug name, financial product code, contract number.

[0066] All identified entities, along with their location and type information, are collected to form an initial candidate entity set E = {e1, e2, ..., e...}. n}

[0067] Each entity is assigned a basic sensitivity score based on a domain knowledge base. The system maintains an updatable domain knowledge base, which is stored in a structured format of (entity or entity schema, type, sensitivity level). For example: (diabetes, disease, high), (yield, financial indicator, low). For each entity e in the candidate entity set E... i The system queries the knowledge base for matching, which can be either exact matching or semantic similarity matching. If a match is successful, a quantified basic sensitivity score S is assigned based on its sensitivity level. b (e i In this embodiment, the score mapping rule is as follows: high corresponds to 0.9, medium corresponds to 0.6, and low corresponds to 0.3. If there is no matching record, its basic sensitivity score is 0.

[0068] Association weights are calculated by analyzing the contextual co-occurrence relationships between entities. To assess implicit risks, the algorithm delves into the contextual relationships between entities. For the current entity e... i The algorithm is within a certain range before and after it, for example, with e i Within 50 words before and after the center, examine all other entities e in the candidate entity set. j (j≠i). Entity e i and e j The correlation weight w between ij The correlation strength and statistical semantic correlation are determined based on the knowledge base definition. The correlation strength between specific entity type pairs can be predefined in the knowledge base. For example, the co-occurrence weight between disease type and medical institution type can be preset to 0.8. The statistical semantic correlation can be calculated using a semantic model such as word vectors trained on a large-scale corpus.

[0069] The implicit sensitive information in the context is determined based on the final sensitivity score and a preset threshold. Entity e i The final sensitivity score S f (e i J is a weighted composite of its base score and the influence of all contextual co-existing entities. The calculation formula for J is as follows:

[0070] S f (e i )= S b (e i )+γ·Σ[Sb (e j )·w ij Where j ≠ i,

[0071] Where γ is a configurable context enhancement coefficient, for example, set to 0.5. The system presets two decision thresholds: an explicit sensitivity threshold T. e, For example, 0.7, the latent sensitivity threshold T i The value is 0.75 for each entity e. i The judgment logic is as follows:

[0072] If S b (e i )≥T e This is directly identified as explicit sensitive information;

[0073] If S b (e i ) <T e But S f (e i )≥T i If so, it is determined to be context-sensitive information;

[0074] All entities deemed sensitive, including explicit and implicit ones, are structured together with their detailed information into a sensitive information list and output to subsequent modules.

[0075] The dynamic desensitization execution module is connected to both the intelligent decision-making module and the large-model semantic enhancement module. It receives the desensitization strategy generated by the intelligent decision-making module and the sensitive content identified by the large-model semantic enhancement module, and performs corresponding desensitization operations on the identified sensitive content according to the desensitization strategy. This module consists of a multi-mode desensitization module, a protocol adaptive module, and a low-loss optimization module. Figure 4 The diagram shows the workflow framework of the large-scale model semantic enhancement module in the identification and execution phases. The multi-mode desensitization module provides various desensitization methods such as replacement, masking, encryption, truncation, and reversible conversion, dynamically selecting the appropriate method for different types of sensitive data and scenario requirements. For example, it uses masking (e.g., 138****1234) for publicly accessible mobile phone numbers, and reversible encryption for internal analysis scenarios, balancing security and data reuse.

[0076] The protocol adaptation module performs data masking through protocol adaptation and a data length compensation mechanism. Protocol adaptation includes three steps: First, at the application gateway layer, the original data stream from the client is parsed to extract the data payload, supporting multiple transmission protocols such as HTTP, HTTPS, and RPC. Second, the data payload is sent to the dynamic data masking execution module for processing, performing the corresponding data masking operations. Third, the processed data is reassembled into a new data stream according to the original protocol specifications and returned, ensuring that the masked data can be processed normally by downstream systems. The data length compensation mechanism is implemented by creating a masked view with the exact same length as the original data fields, avoiding system compatibility issues caused by changes in data length.

[0077] The low-loss optimization module employs a view replacement and data length compensation mechanism. This is achieved by creating a masked view with the exact same length as the original data field, maintaining consistent data packet length before and after masking, and avoiding transmission anomalies or application errors caused by data length changes. In this embodiment, the masked view pads the end of the masked data with specific characters to complete the length to the original. In this embodiment, the data length compensation mechanism is crucial for stability. When masking a 20-digit ID number to 10 digits, traditional replacement methods would alter the data length, potentially leading to front-end formatting errors or database field overflows. This module uses a view replacement method: it creates a temporary 20-digit masked view in memory, for example, replacing 11010119900307787X with 110101*****787X**************, strictly maintaining length consistency by padding the end with asterisks (*), and then returning this view to the requester, thus completely avoiding system anomalies caused by length changes.

[0078] In a preferred embodiment, the system further includes a strategy optimization module, which is connected to the dynamic desensitization execution module and the intelligent decision-making module. (See attached diagram.) Figure 5 , attached Figure 5 The flowchart shown illustrates the feedback and iteration phases of the strategy optimization module. This module collects feedback on the anonymization effect and iteratively optimizes the reinforcement learning model and the large-scale model semantic enhancement module based on this feedback, forming a closed-loop anonymization strategy. The strategy optimization module includes a feedback collection module, a model iteration module, and a log retention module. In this embodiment, the feedback collection module collects anonymization effect feedback in real time and incrementally fine-tunes the Agent decision-making model and the large-scale model semantic recognition module based on these feedback samples. The feedback is collected asynchronously from four channels:

[0079] Synchronize security audit logs from the security operations center to obtain false negatives, such as access to sensitive data that has not been anonymized, and false positives, such as blocking normal access.

[0080] Embed a lightweight data quality feedback button in the front end to collect user interaction experience feedback;

[0081] The performance metrics of the de-identification operation are collected from system monitoring tools, and these metrics are average latency.

[0082] Administrators regularly calibrate the samples processed by the system through the review platform and provide high-quality annotation feedback.

[0083] Every fixed period, such as 24 hours, the strategy optimization module transforms the collected feedback data into training samples. The model iteration module incrementally fine-tunes the reinforcement learning model and the large-scale semantic recognition module based on these feedback samples, improving the accuracy of sensitive information recognition and the policy adaptability. Specifically, for the reinforcement learning model, it adjusts the weights α, β, and γ in its reward function R based on security events and user feedback. For the large-scale semantic enhancement module, it incrementally fine-tunes the LoRA parameters using administrator calibration data. All optimizations are performed offline. After successful verification, the online model is smoothly updated, achieving a closed-loop desensitization strategy evolution system. Furthermore, the log retention module records the entire desensitization log, including perceived information, decision-making process, desensitization operations, and feedback results, forming a complete traceability chain to meet data compliance requirements.

[0084] In a preferred embodiment, the dynamic de-identification execution module supports a reversible de-identification mode. This mode allows the de-identified data to be restored under specific conditions. The module incorporates various executors such as masking, hashing, and generalization. The intelligent decision-making module is further configured to dynamically decide whether to enable the reversible de-identification mode for specific sensitive content based on the trust level assessment in the user identity dimension and the risk level in the application scenario dimension. For example, for encrypted medical records queried by a highly trusted doctor in a consultation scenario, if the system determines that the user has sufficient trust and the risk level of the current application scenario is low, the reversible de-identification mode is enabled. The system uses encryption parameters bound to the current user and scenario to perform de-identification and generates corresponding traceable authorization metadata to ensure that authorized users can restore the original data while meeting security requirements. For example, in reversible de-identification mode, the module calls a temporary key bound to the current user's session ID and scenario code to perform symmetric encryption on the data. At the same time, a traceable authorization metadata record is generated, recording the unique ID, key index, decision basis, etc. of this operation, such as user trust score and scenario. After signing, it is stored in the blockchain or security log center for post-event auditing. In some embodiments, to implement the reversible desensitization mode and ensure its security, dynamic key management based on key derivation functions is adopted. Specifically, after receiving an instruction to enable reversible desensitization, the dynamic desensitization execution module generates and manages temporary session keys according to the following steps: The temporary session key is dynamically generated through a key derivation function, and its input factors include: the system-protected master key, the unique identifier of the current user, the unique identifier of this session, the scenario code that triggers reversible desensitization, and a current timestamp. This design ensures that the key is strongly bound to a specific user, session, and scenario. The derived temporary session key is only cached in the non-swappable memory area of ​​the current session process and is only used to encrypt sensitive content specified in this session. When the user session ends or times out, the temporary key is immediately cleared from memory, ensuring that its lifecycle is strictly consistent with the business session. When a subsequent authorized user, such as a senior auditor, needs to restore data, the authorization service must first verify their permissions. Then, based on the user's unique identifier, the unique identifier of this session, and the reversibly anonymized scenario code stored in the traceable authorization metadata, it uses the same key derivation function and master key to derive the same temporary session key, thereby completing the data decryption. This mechanism ensures that the data restoration operation itself is authoritative, verifiable, and traceable; any decryption attempt must be verified through the digital fingerprint recorded in the metadata.

[0085] This agent-based large-scale dynamic desensitization system achieves intelligent identification and dynamic desensitization of sensitive data through the collaborative work of multiple modules. It ensures data security, maximizes data availability, and has good system compatibility and scalability.

[0086] The workflow of this agent-based large-model dynamic desensitization system is as follows: A multi-source perception module monitors and collects multi-dimensional information in real time, including user identity, application scenario, data type, and environmental state. This information is then structured and processed through a standardized interface before being passed to the intelligent decision-making module. Upon receiving the multi-dimensional information, the intelligent decision-making module's rule engine module first performs basic rule matching. The reinforcement learning module calculates the optimal strategy based on historical experience and the current environmental state. When strategy conflicts occur, the conflict resolution module outputs the final desensitization strategy based on priority rules and risk assessment results. The large-model semantic enhancement module processes the input data in parallel, identifying explicit and implicit sensitive information through a fine-tuned large model, generating a list of sensitive information and a sensitivity rating. The dynamic desensitization execution module executes corresponding desensitization operations based on the strategy provided by the intelligent decision-making module and the sensitive information identified by the large-model semantic enhancement module. A protocol adaptive mechanism ensures the format compatibility of the desensitized data, and a data length compensation mechanism maintains the consistency of the data structure. Throughout the process, the strategy optimization module continuously collects feedback information and iteratively optimizes the system to improve desensitization effectiveness and system performance.

[0087] To more clearly illustrate how the above modules work together to achieve end-to-end dynamic desensitization, the following example, using a specific medical scenario, illustrates the system's workflow. Suppose a cardiologist, Dr. Zhang, has an emotional intimacy rating of 92 (high trust level) and a medium risk level in the hospital's research analysis platform. He needs to query a batch of patients' electronic medical records for clinical research. The multi-source sensing module collects the following information:

[0088] User: Dr. Zhang, Tag 92;

[0089] Scenario: Scientific research analysis, medium risk;

[0090] Data: Medical records, including a diagnosis description field;

[0091] Environment: Wired network available within the facility, secure;

[0092] The rules engine recommends strong anonymization of diagnostic descriptions. The reinforcement learning model, based on historical successes, indicates that high-trust users experienced no issues using the original data and provided positive feedback in this scenario; therefore, it recommends mild or reversible anonymization of diagnostic descriptions. The conflict resolution module, based on the priority scenario risk being medium to not extremely high, and considering the user's high trust score, adopts a reversible anonymization mode for adjudication.

[0093] The large model semantic enhancement module analyzes a diagnostic description of a patient complaining of chest pain, which worsened after activity in Wangfujing. It accurately identifies chest pain (a sensitive word for overt disease) and Wangfujing (a sensitive word for latent geographical location, which can be associated with the patient's activity trajectory in context).

[0094] The dynamic desensitization module uses the key bound to Dr. Zhang's current session to encrypt identified sensitive words and phrases, while simultaneously generating audit metadata. Direct identifiers in the medical record, such as ID numbers, are masked using view replacement to maintain a normal page layout.

[0095] Subsequently, Dr. Zhang did not complain about the data being unavailable, and the security audit found no abnormalities. The strategy optimization module recorded this positive feedback and used it to fine-tune the reinforcement learning model, making it more likely to make decisions to relax restrictions on high-trust users in medium-risk research scenarios in similar situations in the future.

[0096] This invention also provides an agent-based dynamic desensitization method for large models. This method achieves accurate and dynamic desensitization of sensitive information through multi-dimensional information perception, intelligent decision-making, and real-time optimization. Please refer to the appendix. Figure 6 The method includes at least the following steps:

[0097] S1: Real-time acquisition and structured processing of multi-dimensional information. The system collects anonymized multi-dimensional information in real time through a multi-source perception layer, including user, scenario, data, and environmental dimensions. User-dimensional information includes identity information, permission level, historical interaction records, and emotional intimacy tags; scenario-dimensional information covers application scenario type, data usage purpose, and interaction scenario risk level; data-dimensional information includes data type, sensitive field identifiers, data format, and transmission protocol type; environmental-dimensional information includes network security status, device trustworthiness, and data transmission link encryption level. Standardized interfaces enable real-time capture and structured processing of various types of information, generating perception information logs to ensure data traceability.

[0098] S2: Based on multi-dimensional information and according to the decision-making mechanism of the fusion of rule engine and reinforcement learning model, an adaptive desensitization strategy is generated:

[0099] The core decision-making layer of the Agent employs a hierarchical decision-making mechanism, integrating rule-based reasoning and reinforcement learning algorithms. The rule engine module incorporates industry-standard de-identification rules, including basic rules for ID cards, mobile phone numbers, and medical records, as well as user-defined rules. It performs preliminary rule matching based on information collected from the multi-source perception layer, quickly generating basic de-identification strategies. The reinforcement learning module optimizes the strategy decision logic through continuous iterative learning with large-scale model interactions, reducing de-identification intensity for high-privilege users in low-risk scenarios and increasing de-identification levels for low-privilege users in high-risk scenarios, achieving policy self-adaptation. The conflict resolution module outputs the optimal de-identification strategy based on preset priorities and real-time risk quantification results when multi-dimensional rules conflict.

[0100] S3: Use a pre-connected large model to perform semantic understanding on the input data to identify sensitive content, including explicit sensitive information and contextually implicit sensitive information.

[0101] The large-scale model semantic enhancement layer, through a sensitive information accurate identification module, utilizes named entity recognition technology and a sensitivity scoring algorithm, combined with contextual semantic analysis, to accurately locate sensitive information in unstructured data such as text and speech. This module can distinguish between explicit and implicit sensitive words, generating a list of sensitive information and their corresponding sensitivity levels. The de-identification context adaptation module, based on the large-scale model's dialogue context understanding capabilities, ensures that de-identification processing does not disrupt interactive coherence, maintaining consistency of de-identification rules across multiple rounds of dialogue. The lightweight adaptation module employs PEFT low-rank adaptation technology to fine-tune the large-scale model, controlling inference latency to within 100ms to meet real-time interaction requirements.

[0102] S4: Based on the de-identification strategy, the identified sensitive content is de-identified using protocol adaptation and data length compensation mechanisms.

[0103] The dynamic data masking execution layer performs masking operations based on the policies output by the Agent core decision layer. The multi-mode data masking module provides various masking methods such as replacement, masking, encryption, truncation, and reversible conversion, dynamically selecting the appropriate method for different types of sensitive data and scenario requirements. For example, masking is used for publicly accessible phone numbers, while reversible encryption is used for internal analysis scenarios. The protocol adaptive module performs real-time processing of large model input and output data through dynamic forwarding and adaptation at the application gateway layer. It supports open-source databases such as MySQL and PostgreSQL, as well as various commercial databases, and is compatible with multiple transmission protocols such as HTTP and RPC. The low-loss optimization module employs view replacement and data length compensation mechanisms to create masked views with the same length as the target data name, ensuring that the data length remains unchanged after masking and avoiding transmission anomalies. By caching high-frequency masking strategies, the performance loss of data masking processing is reduced by more than 40%.

[0104] This method achieves continuous iteration and optimization of the de-identification strategy through a strategy optimization layer. A feedback collection module gathers real-time feedback on the de-identification effect, including security audit results, user experience evaluations, and data availability feedback, generating optimized samples. A model iteration module incrementally fine-tunes the Agent decision-making model and the large-scale model semantic recognition module based on the feedback samples, improving the accuracy of sensitive information identification and the policy adaptability. A log retention module records the entire de-identification process log, including perceived information, decision-making process, de-identification operations, and feedback results, forming a complete traceability chain.

[0105] The entire process includes the initialization phase, which loads the desensitization rules and pre-fine-tunes the large model; the information collection phase, which acquires multi-dimensional information in real time; the strategy generation phase, which integrates the rules and learning algorithms to generate a desensitization strategy; the semantic recognition and desensitization execution phase, which accurately identifies and processes sensitive information; and the feedback and optimization phase, which collects feedback on the results and iteratively optimizes the model, forming a complete closed-loop processing mechanism.

[0106] The above description is merely an example and illustration of the concept of the present invention. Those skilled in the art can make various modifications or additions to the specific embodiments described or use similar methods to replace them, as long as they do not deviate from the concept of the invention or exceed the scope defined in the claims, they should all fall within the protection scope of the present invention.

Claims

1. A large-scale model dynamic desensitization system based on agents, characterized in that, include: The multi-source sensing module is used to collect and structure multi-dimensional information in real time; The intelligent decision-making module, connected to the multi-source perception module, is used to generate an adaptive desensitization strategy based on the multi-dimensional information through a decision-making mechanism that integrates a rule engine and a reinforcement learning model. The large model semantic enhancement module, connected to the intelligent decision-making module, is used to perform semantic understanding on the input data using a pre-connected large model, and to identify sensitive content, including explicit sensitive information and contextual implicit sensitive information. The dynamic desensitization execution module is connected to the intelligent decision-making module and the large model semantic enhancement module, respectively. It is used to perform desensitization operations on the identified sensitive content according to the desensitization strategy through protocol adaptation and data length compensation mechanism.

2. The agent-based large-model dynamic desensitization system according to claim 1, characterized in that, The multi-dimensional information includes information on user identity, application scenario, data type, and environmental status. The user identity dimension information includes emotional intimacy tags generated based on analysis of the user's historical interaction behavior.

3. The agent-based large-model dynamic desensitization system according to claim 1, characterized in that, The intelligent decision-making module includes a rule engine module, a reinforcement learning module, and a conflict resolution module. The rule engine module has built-in industry-standard rules and user-defined rules. The reinforcement learning module optimizes strategies based on a three-dimensional objective consisting of de-identification security, data availability, and system performance loss. The conflict resolution module is used to output the final strategy according to preset priority rules and real-time risk quantification results when strategies generated based on information from different dimensions conflict.

4. The agent-based large-model dynamic desensitization system according to claim 1, characterized in that, The large models pre-connected in the large model semantic enhancement module are models fine-tuned using low-rank adaptation techniques, wherein the fine-tuning includes: Freeze the original parameters of the large model; Inject trainable low-rank decomposition matrix pairs next to the linear projection weights of the self-attention module in the Transformer layer of the large model. Use a sensitive information identification and annotation dataset to train a low-rank decomposition matrix.

5. The agent-based large-model dynamic desensitization system according to claim 1, characterized in that, The large model semantic enhancement module identifies entities through named entity recognition and sensitivity scoring algorithms, specifically including: A candidate entity set is obtained through named entity recognition; Assign basic sensitivity scores to each entity based on the domain knowledge base; Analyze the contextual co-occurrence relationships between entities and calculate association weights; The final sensitivity score is determined based on the basic sensitivity score and the associated weight; and the contextual implicit sensitive information is determined based on the final sensitivity score and the preset threshold.

6. The agent-based large-model dynamic desensitization system according to claim 1, characterized in that, The data length compensation mechanism is implemented by creating a de-identified view that is exactly the same length as the original data field.

7. The agent-based large-model dynamic desensitization system according to claim 1, characterized in that, The protocol adaptation specifically includes: At the application gateway layer, the raw data stream from the client is parsed to extract the data payload. The data payload is sent to the dynamic desensitization execution module for processing. The processed data will be reassembled into a new data stream according to the original protocol specifications and returned.

8. The agent-based large-model dynamic desensitization system according to claim 1, characterized in that, It also includes a strategy optimization module, which is connected to the dynamic desensitization execution module and the intelligent decision-making module. The strategy optimization module is used to collect feedback on the desensitization effect and iteratively optimize the reinforcement learning model and the large model semantic enhancement module based on the feedback to form a closed-loop desensitization strategy.

9. The agent-based large-model dynamic desensitization system according to claim 1, characterized in that, The dynamic desensitization execution module supports a reversible desensitization mode; the intelligent decision-making module is further configured to: dynamically decide whether to enable the reversible desensitization mode for specific sensitive content based on the trust assessment in the user identity dimension and the risk level in the application scenario dimension; when enabled, the reversible desensitization mode uses encryption parameters bound to the current user and scenario to perform desensitization and generate corresponding traceable authorized metadata.

10. A large-scale model dynamic desensitization method based on agents, characterized in that, include: Real-time collection and structured processing of multi-dimensional information; Based on the aforementioned multi-dimensional information, and according to the decision-making mechanism that integrates the rule engine and the reinforcement learning model, an adaptive desensitization strategy is generated. Using pre-connected large models, semantic understanding is performed on the input data to identify sensitive content, including explicit sensitive information and contextually implicit sensitive information. Based on the aforementioned desensitization strategy, the identified sensitive content is desensitized through protocol adaptation and data length compensation mechanisms.