Data desensitization method and device, electronic equipment and storage medium
By combining a lightweight semantic analysis model and an importance mapping table with a lightweight neural network model for hierarchical decision-making and fusion verification, the problem of high computational overhead in neural network data anonymization methods is solved, achieving efficient and accurate data anonymization processing.
Patent Information
- Application Number
- CN202611221933.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-11-06
AI Technical Summary
Existing data anonymization methods based on neural networks suffer from high computational overhead and low processing efficiency while ensuring accuracy, especially in large-scale model applications where computational redundancy is severe.
A lightweight semantic analysis model on the edge is used to make a preliminary importance judgment on the text data. Combining an importance mapping table and a lightweight neural network model, the complexity and fine-grained evaluation of sensitive words are carried out. Desensitization is performed through a hierarchical decision and fusion verification mechanism.
While ensuring the accuracy of data anonymization, it significantly reduces computational latency and resource consumption, improves processing efficiency, and is suitable for efficient data anonymization in common scenarios.
Smart Images

Figure CN123049641A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of data security technology, and in particular to a data desensitization method, apparatus, electronic device and storage medium. Background Technology
[0002] Large-scale model applications present significantly different technical requirements for data anonymization compared to traditional scenarios: on the one hand, excessive anonymization can severely impair the semantic understanding capabilities of large-scale models, causing them to fail to accurately capture user intent and thus reducing service quality; on the other hand, insufficient anonymization directly violates privacy protection regulations.
[0003] To address the aforementioned issues, existing technologies typically employ desensitization methods based on deep learning models. These methods utilize neural network models to perform semantic understanding and sensitive information identification on text, dynamically determining the importance of sensitive information based on context.
[0004] However, while neural network-based methods offer high accuracy, they suffer from significant inference latency, leading to substantial computational redundancy in simple scenarios that is disproportionate to the task's benefits. How to reduce computational overhead and improve processing efficiency while maintaining accuracy in text anonymization is a pressing issue in the current text anonymization technology field. Summary of the Invention
[0005] The purpose of this invention is to provide at least one data desensitization method, apparatus, electronic device, and storage medium, which can at least solve the technical problem that existing methods based on neural networks have high accuracy but large inference latency, and can at least reduce computational overhead and improve processing efficiency while ensuring desensitization accuracy.
[0006] To address the aforementioned technical problems, at least one embodiment of this application provides a data anonymization method, apparatus, electronic device, and storage medium, including: Based on a lightweight semantic analysis model on the device side, the importance of sensitive words in the input text data is initially judged to obtain the first importance. The overall complexity of the text data is determined. If the complexity does not meet the preset judgment standard for complex scenarios, the baseline importance of the sensitive word element hit by the preset importance mapping table is taken as the second importance. The importance mapping table stores the mapping relationship between sensitive information type, task type and baseline importance. The target importance of the sensitive word element is calculated based on the first importance and the second importance. The sensitive words are desensitized based on the target importance.
[0007] In some optional embodiments, determining the overall complexity of the text data includes: Based on the hit confidence of the importance mapping table, the complexity is calculated by combining the context entropy of the text data, the degree of importance change of the sensitive word in adjacent rounds, and / or the density of semantic anchors in the text data, wherein the semantic anchor is a sensitive word whose keyness in the semantic structure reaches a preset threshold.
[0008] In some optional embodiments, calculating the target importance of the sensitive word element based on the first importance and the second importance includes: The weights of the first importance and the second importance are assigned based on the context entropy of the text data and / or the degree of change in the importance of the sensitive words in adjacent rounds, wherein the greater the context entropy and / or the greater the degree of change in importance, the greater the weight corresponding to the first importance; The target importance is calculated by weighting the first importance and the second importance based on the assigned weights.
[0009] In some optional embodiments, the method further includes: If the complexity reaches the preset judgment standard of complex scenario, the importance of the sensitive word is judged by the preset neural network model to obtain the third importance. The neural network model is a lightweight multilayer perceptron model, which is used to fuse the contextual semantic representation of the sensitive word, the prior of the current task intent and / or the prior of the sensitive category to perform fine-grained importance evaluation. The target importance of the sensitive word element is calculated based on the first importance and the third importance.
[0010] In some optional embodiments, calculating the target importance of the sensitive word based on the first importance and the third importance includes: The weights of the first importance and the second importance are assigned based on the context entropy of the text data and / or the degree of change in the importance of the sensitive words in adjacent rounds, wherein the greater the context entropy and / or the greater the degree of change in importance, the greater the weight corresponding to the third importance. The first importance and the third importance are weighted and summed based on the assigned weights to obtain the target importance.
[0011] In some alternative embodiments, the neural network model shares at least some of the weight parameters of the hidden layers with the semantic analysis model.
[0012] In some optional embodiments, determining the semantic anchor point includes: Dependency parsing is performed on the text data to count the number of dependency arcs with the sensitive word as the head node, and the dependency correlation degree is obtained; and / or, within the dialog context window, the frequency of other words referring to the sensitive word through pronouns or synonyms is counted, and the coreference density is obtained. Based on the dependency correlation degree and / or the coreference density, the semantic anchor weight of the sensitive word is calculated. When the semantic anchor weight is greater than the preset threshold, the sensitive word is marked as a semantic anchor.
[0013] In some optional embodiments, the desensitization process of the sensitive words based on the target importance includes: The semantic anchors are desensitized by semantically preserving replacement, which is unaffected by the importance of the target.
[0014] In some alternative embodiments, determining the first importance includes: Obtain the context representation vector of each sensitive word element in the text data and the aggregate representation vector of task indicator words related to the current task; The first importance is calculated based on the association strength between the context representation vector and the aggregate representation vector of the task indicator token.
[0015] At least one embodiment of this application also provides a data desensitization apparatus, comprising: The first calculation module is used to perform an initial importance judgment on sensitive words in the input text data based on a lightweight semantic analysis model on the device side, and obtain the first importance. The second calculation module is used to determine the overall complexity of the text data. If the complexity does not reach the preset judgment standard for complex scenarios, the baseline importance of the sensitive word element hit by the preset importance mapping table is taken as the second importance. The importance mapping table stores the mapping relationship between sensitive information type, task type and baseline importance. The third calculation module is used to calculate the target importance of the sensitive word element based on the first importance and the second importance. The desensitization module is used to desensitize the sensitive words based on the importance of the target.
[0016] At least one embodiment of this application also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the data desensitization method described above.
[0017] At least one embodiment of this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the data desensitization method described above.
[0018] The data desensitization method, apparatus, electronic device, and storage medium provided in the embodiments of this application divert input through a pre-processing step of judging the overall complexity of the text. For common scenarios that account for the vast majority of actual business operations, only after the semantic analysis model completes a lightweight initial judgment, a lookup operation is performed through an importance mapping table to obtain the second importance, avoiding the high computational latency and resource consumption caused by end-to-end deep model full inference. Secondly, the first importance is dynamically calculated by the semantic analysis model based on the current text context, while the second importance provides a category-level prior benchmark that is independent of the specific context. The fusion of the two forms a dual verification mechanism of "dynamic perception + prior constraint", which has higher reliability than importance judgment from a single source.
[0019] In summary, this invention, through a hierarchical decision-making and fusion verification architecture, can significantly reduce overall inference latency and computational energy consumption while maintaining or even improving the de-identification accuracy under actual deployment conditions where common scenarios dominate, thus achieving synergistic optimization of accuracy and efficiency. Attached Figure Description
[0020] One or more embodiments are illustrated by way of example with reference to the accompanying drawings, and these illustrative descriptions do not constitute a limitation on the embodiments.
[0021] Figure 1 This is a flowchart of a data anonymization method provided in one embodiment of this application. Figure One ; Figure 2 This is a flowchart of a data anonymization method provided in one embodiment of this application. Figure Two ; Figure 3 This is a schematic diagram of a data desensitization device provided in another embodiment of this application. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been provided in the various embodiments of this application to help readers better understand this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments. The division of the various embodiments below is for the convenience of description and should not constitute any limitation on the specific implementation of this application. The various embodiments can be combined with and referenced by each other without contradiction.
[0023] This invention proposes a data anonymization method. The implementation details of the data anonymization method in this embodiment are described below. The following content is only for the convenience of understanding and is not necessary for implementing this solution.
[0024] Example 1: The data anonymization method of this embodiment can be applied to electronic devices with communication, computing, and data storage capabilities. Its specific process can be as follows: Figure 1 As shown, it includes: Step 110: Based on the lightweight semantic analysis model on the device side, perform an initial importance judgment on the sensitive words in the input text data to obtain the first importance. Specifically, the text data can be natural language text requiring anonymization, such as user queries, dialogue logs, and document paragraphs. The semantic analysis model can employ a lightweight pre-trained language model based on the Transformer architecture, capable of generating a vector representation with fused context for each lexical unit in the text. Simultaneously, sensitive tokens and their corresponding sensitive information types are pre-identified within the text data. Sensitive tokens refer to lexical units in the text that involve personal privacy, sensitive entities, or protected information, such as names, ID numbers, mobile phone numbers, home addresses, and bank card numbers. Based on this, the attention mechanism of the semantic analysis model is used to calculate the first importance of each sensitive token.
[0025] The lightweight semantic analysis model on the edge in this embodiment refers to a semantic understanding model with a small number of parameters, low computational complexity, and direct deployment on terminal hardware such as smartphones, IoT devices, and edge gateways. Its core design goal is to provide reliable semantic analysis capabilities even with limited computing resources, and it excels at handling common scenarios with standardized structures and simple types of sensitive information. This model plays the role of "initial judgment," quickly calculating the importance of each sensitive word and outputting its first importance. This design enables the system to obtain context-aware dynamic information in each round of decision-making.
[0026] For example, the lightweight semantic analysis model deployment on the edge in this embodiment employs knowledge distillation technology to transfer semantic understanding capabilities from a large language model, while strictly controlling the model size to adapt to edge computing power constraints. The model architecture is based on a Transformer encoder, with the number of layers compressed to 4–6, a hidden dimension of 256–512, and a total number of parameters of approximately 5M–20M. This model uses sequence labeling (token binary classification) mode to determine the sensitive attributes of the preprocessed token sequence, outputting a structured sequence of sensitive and non-sensitive tokens, which is the "sensitive token position".
[0027] Step 120: Determine the overall complexity of the text data. If the complexity does not meet the preset judgment standard for complex scenarios, the baseline importance of the sensitive word element hit by the preset importance mapping table is taken as the second importance. The importance mapping table stores the mapping relationship between sensitive information type, task type and baseline importance. Specifically, the purpose of complexity assessment is to evaluate whether the current text belongs to a common scenario with a standardized structure, clear semantics, and a single type of sensitive information, or to a complex or boundary scenario with diverse expressions, ambiguous semantics, and overlapping types of sensitive information. If it is determined to be a common scenario, it means that the current de-identification task is relatively simple and does not require calling a neural network model to finely analyze importance; the second importance can be quickly obtained by querying the importance mapping table.
[0028] The importance mapping table is pre-organized in the form of triples: <Sensitive Information Type, Task Type, Baseline Importance>. The sensitive information type identifies the specific category to which the sensitive term belongs, the task type identifies the business scenario category to which the current de-identification task belongs (e.g., customer service dialogue, document review, log de-identification, etc.), and the baseline importance is an empirical value between 0 and 1, reflecting the general importance level of this type of sensitive information in this type of task, detached from its specific context. The baseline importance of the mapping table can be initialized by domain experts based on compliance requirements and business experience, and statistically calibrated based on actual feedback data during system operation.
[0029] When looking up the table, the sensitive information type to which the sensitive word belongs and the task type to which the current text belongs are extracted. The two are used as a joint key value to search the mapping table. If a match is found, the corresponding baseline importance is returned as the second importance of the sensitive word.
[0030] Step 130: Calculate the target importance of the sensitive word element based on the first importance and the second importance; Specifically, the fusion computation can employ weighted summation, product fusion, or dynamic selection based on confidence levels. Regardless of the specific fusion method used, the core principle is that the first importance provides the dynamic semantic weight of sensitive words in the current specific context, while the second importance provides the prior baseline weight of this type of sensitive information in this type of task, detached from the context. The two reflect the importance of sensitive words from the dimensions of "dynamic perception" and "prior constraints," respectively. The fused target importance combines the advantages of both information sources, preserving the model's sensitivity to context while introducing regularization constraints from domain knowledge, resulting in higher reliability and stability than single-source judgment.
[0031] Step 140: Desensitize the sensitive words based on the target importance.
[0032] Specifically, the level of target importance directly determines the intensity or granularity of the de-identification operation. For sensitive words with high target importance, it indicates that they carry critical privacy information in the current text, posing a high risk of leakage; therefore, a high-intensity de-identification strategy (such as complete masking, random replacement, or generalization) is adopted. For sensitive words with low target importance, it indicates that their sensitivity in the current text is relatively limited, posing a lower risk of leakage; therefore, a low-intensity de-identification strategy (such as partial masking or mild blurring) is adopted. The final output of the de-identification process is the de-identified text generated by transforming each sensitive word in the original text data according to its respective target importance level. This de-identified text effectively protects sensitive information from leakage while preserving the semantic integrity and usability of the original text as much as possible to meet subsequent business needs.
[0033] In summary, this embodiment diverts input through a pre-processing step of determining the overall complexity of the text. For common scenarios that constitute the vast majority of actual business scenarios, only after the semantic analysis model completes a lightweight initial judgment, a lookup operation is performed through the importance mapping table to obtain the second importance, avoiding the high computational latency and resource consumption caused by end-to-end deep model full inference. Secondly, the first importance is dynamically calculated by the semantic analysis model based on the current text context, while the second importance provides a category-level prior benchmark independent of the specific context. The fusion of the two forms a dual verification mechanism of "dynamic perception + prior constraint", which has higher reliability than importance judgment from a single source.
[0034] This embodiment, through a hierarchical decision-making and fusion verification architecture, can significantly reduce overall inference latency and computational energy consumption while maintaining or even improving the de-identification accuracy under actual deployment conditions where common scenarios dominate, thus achieving synergistic optimization of accuracy and efficiency.
[0035] In some optional embodiments, determining the overall complexity of the text data includes: based on the hit confidence of the importance mapping table, combining the contextual entropy of the text data, the degree of importance change of the sensitive words in adjacent rounds, and / or the density of semantic anchors in the text data, to calculate the complexity, wherein the semantic anchors are sensitive words whose keyness in the semantic structure reaches a preset threshold.
[0036] Specifically, this embodiment further combines contextual entropy, the degree of change in the importance of sensitive words in adjacent rounds, and / or the density of semantic anchors in the text data to improve the accuracy of complex scene determination.
[0037] The mapping table hit confidence level `c_match` is calculated by searching the mapping table for the current <sensitive information type, task type> combination. If the combination has a high historical frequency, `c_match` is close to 1 (high confidence); if it is the first occurrence, `c_match` = 0 (completely unfamiliar). For example, the formula for calculating `c_match` can be set as follows: c_match = f_count / (f_count + K) Where: f_count is the historical hit frequency of the combination in the mapping table (how many times it has appeared), and K is the smoothing constant (similar to Bayesian prior, the default value is 5).
[0038] For example, <ID number, financial transaction> appears 100 times in the past → c_match = 100 / (100+5)≈0.95 (very familiar, high confidence); <telephone, case information inquiry> appears for the first time (f_count=0) → c_match = 0 / (0+5) =0 (completely unfamiliar); <geographical location, balance inquiry> appears 8 times → c_match = 8 / (8+5)≈0.62 (off-limits).
[0039] Context entropy Calculate the information entropy of the current input context. A higher entropy value indicates a more complex context and a more ambiguous task intent, requiring more precise evaluation. Context Entropy The calculation formula can be set as follows: = - · ; in, It is the probability distribution of each token in the current context (obtained from the softmax probability or word frequency statistics output by the edge semantic analysis model).
[0040] Variation in importance between adjacent rounds In multi-round dialogues, if the change in importance score of a unified sensitive word element occurs between adjacent rounds... A larger value indicates that the user's intent may have shifted to a boundary scenario, triggering a more detailed evaluation.
[0041]
[0042] in This is the integration importance score for this round. It's from the previous round.
[0043] For example: the previous round of casual conversation ≈ 0.1, this round of query business ≈ 0.62, = |0.62 - 0.2| =0.42 (clear intention to switch).
[0044] Semantic anchor density Before determining the scene type, the system uses the dependency parsing results (lightweight dependency tree parsing, which can be done by adding a linear layer to the encoder) generated by the semantic analysis model in step 110 to quickly scan all sensitive tokens and calculate anchor weights. Sensitive words with anchor weights exceeding a preset threshold are used as semantic anchors, and the number of semantic anchors is counted. Then, the number of potential semantic anchors is counted, and the semantic anchor density is calculated. .
[0045] When determining whether a scene is complex, the following rules can be used: When c_match ≥ c_match_max (the upper limit of confidence, default 0.85) and ≤ (Upper limit of entropy, default 2.5) and ≤ (Importance variation, default 0.3) and ≤ (Anchor point density upper limit, default 0.5) When it is determined to be a common scenario, it is directly looked up in the table for a quick response; otherwise, it is determined to be a complex / boundary scenario, and the neural network is enabled for fine evaluation.
[0046] In some optional embodiments, calculating the target importance of the sensitive word element based on the first importance and the second importance includes: allocating weights to the first importance and the second importance according to the context entropy of the text data and / or the degree of importance change of the sensitive word element in adjacent rounds, wherein the greater the context entropy and / or the greater the degree of importance change, the greater the weight corresponding to the first importance; calculating a weighted sum of the first importance and the second importance based on the allocated weights to calculate the target importance.
[0047] Specifically, the fusion weights in common scenarios are not fixed constants, but rather adaptive variables dynamically correlated with the context entropy and / or the magnitude of changes in importance between adjacent rounds. In common scenarios, although none of the four metrics exceed the threshold, and The specific value still reflects the "closeness to the boundary" of the scene. When near (As in 2.3), even if the boundary has not yet been crossed, the context is already quite complex. In this case, the trust in the prior knowledge of the mapping table should be appropriately reduced. (Decrease). Similarly, when near When user intent changes significantly, the intensity should be reduced. .
[0048] For example, the weights of the first importance and the second importance can be calculated using the following formula:
[0049] in, This is the baseline weight value corresponding to the second level of importance. The entropy influence coefficient, The coefficient representing the influence of the variation range. This is the final weight corresponding to the second level of importance.
[0050] Finally, the final importance (target importance) of common scenarios is fused according to the following formula: s = · + (1- )·a_att; Where s represents the importance of the target. a_att is the second most important value, while a_att is the most important value.
[0051] In some optional embodiments, the method further includes: if the complexity reaches a preset judgment standard for complex scenarios, using a preset neural network model to judge the importance of the sensitive word element and obtain a third importance, wherein the neural network model is a lightweight multilayer perceptron model, used to fuse the contextual semantic representation of the sensitive word element, the prior of the current task intent and / or the prior of the sensitive category, to perform fine-grained importance evaluation; and calculating the target importance of the sensitive word element based on the first importance and the third importance.
[0052] Specifically, for complex or boundary scenarios, a neural network model is used for fine-grained evaluation. This neural network model is a lightweight multilayer perceptron (MLP) model, a simplified version based on the standard MLP architecture, achieved by reducing the number of network layers, decreasing the number of hidden layer neurons, and employing parameter sharing or quantization compression. Its core design goal is to keep the number of model parameters to an extremely low level while ensuring sufficient semantic understanding capabilities, enabling direct deployment on resource-constrained edge devices such as smartphones, IoT gateways, and in-vehicle terminals. Its input is a concatenation of three types of vectors: Context vector: Take the [CLS] pooled vector of the semantic analysis model for the current input, with the same dimensions as the model's hidden dimensions (256–512 dimensions), to capture global semantics.
[0053] Task type vector: The task type label is embedded and encoded, with a dimension of 64, capturing the prior intent of the task.
[0054] Sensitive type vector: Embedded encoding of sensitive information type labels, 32 dimensions, capturing sensitive category priors.
[0055] The MLP network structure is a three-layer fully connected (FC) network:
[0056]
[0057]
[0058] The final calculation This is the third level of importance. The training labels for the MLP are derived from the importance samples annotated by experts in historical interaction data (positive samples: manually confirmed that the sensitive information has a key impact on the task; negative samples: manually confirmed that the sensitive information is irrelevant to the task), and the MLP is trained using the binary cross-entropy loss function.
[0059] In some optional embodiments, the number of MLP parameters is approximately 0.3M–1M, which can share the feature extraction weights of the first few layers with the semantic analysis model in step 110 to save on-side storage.
[0060] The process of calculating the target importance of sensitive words based on the first and third importance is similar to that in the above embodiments, and will not be described in detail here to avoid repetition.
[0061] In some optional embodiments, calculating the target importance of the sensitive word based on the first importance and the third importance includes: allocating weights to the first importance and the third importance according to the context entropy of the text data and / or the degree of importance change of the sensitive word in adjacent rounds, wherein the greater the context entropy and / or the greater the degree of importance change, the greater the weight corresponding to the third importance; calculating a weighted sum of the first importance and the third importance based on the allocated weights to calculate the target importance.
[0062] Specifically, dynamic fusion weights for complex / boundary scenarios It can be calculated as follows:
[0063] in, This is the baseline weight value corresponding to the third level of importance. The coefficient representing the influence of the variation range. This is the final weight corresponding to the third level of importance.
[0064] In complex / boundary scenarios and The degree exceeding the threshold reflects the "complexity depth" of the scene. When Far exceeding (As in 3.8), the context is extremely complex, and a more refined evaluation of the neural network is more reliable; therefore, the value should be increased. (Improve the level of) (Trust). Similarly, when Far exceeding When user intent changes drastically, the response time should also be increased. This design enables a gradual transfer of trust within "complex scenarios," where the more complex the scenario, the more the system trusts the neural network's sophisticated judgment.
[0065] Finally, the formula for calculating the importance of a target in complex / boundary scenarios is as follows: s = · +(1- )·a_att; pass , Through dynamic adjustment, the system achieves an optimal balance between prior knowledge (neural network) and real-time attention signals, and the balance point adapts to the complexity of the scene.
[0066] In some optional embodiments, determining the semantic anchor point includes: performing dependency parsing on the text data, counting the number of dependency arcs with the sensitive word as the head node, and obtaining the dependency correlation degree; and / or, within the dialogue context window, counting the frequency of other words referring to the sensitive word through pronouns or synonyms, and obtaining the coreference density; calculating the semantic anchor point weight of the sensitive word based on the dependency correlation degree and / or the coreference density, and marking the sensitive word as a semantic anchor point when the semantic anchor point weight is greater than the preset threshold.
[0067] Specifically, before performing desensitization, all sensitive tokens are iterated through, and their semantic anchor weights in the current sentence are calculated. . The calculation is performed by fusing the following two components: - Dependency Relationship: Through end-side dependency parsing, count the number of dependency arcs with this sensitive token as the head node. The more dependency arcs a token has, the stronger its role as a semantic anchor.
[0068] - Coreference density: Within the dialog context window, count the frequency of other tokens corerefringing this sensitive token through pronouns / synonyms. .
[0069] The formula for calculating semantic anchor weights is as follows:
[0070] in, The total number of lexical elements, This is for adjusting the coefficient.
[0071] when When the value is >0.6 (default), the token is marked as a semantic anchor. Even if its importance score s corresponds to a high importance level, semantically preservative replacement should be used instead of direct erasure replacement to prevent semantic chain breakage.
[0072] The formula for calculating semantic anchor density is as follows: = /
[0073] in, The total number of sensitive word elements, This represents the number of semantic anchors.
[0074] In some optional embodiments, the step of desensitizing the sensitive words based on the target importance includes: performing semantically preserving replacement desensitization on the semantic anchors, which is unaffected by the target importance.
[0075] In some optional embodiments, determining the first importance includes: obtaining the context representation vector of each sensitive word in the text data and the aggregate representation vector of the task indicator word related to the current task; and calculating the first importance based on the correlation strength between the context representation vector and the aggregate representation vector of the task indicator token.
[0076] Specifically, the lightweight semantic analysis model on the device employs knowledge distillation technology to transfer semantic understanding capabilities from large language models, while strictly controlling the model size to adapt to the computing power constraints on the device. The model architecture is based on a Transformer encoder, with the number of layers compressed to 4–6, a hidden dimension of 256–512, and a total number of parameters of approximately 5M–20M. This model undertakes the task of identifying sensitive information on the device, using a sequence labeling (token binary classification) mode to determine the sensitive attributes of the preprocessed token sequence, and outputs a structured sequence of sensitive tokens and non-sensitive tokens, which is the "sensitive token position".
[0077] The semantic analysis model employs an attention mechanism to calculate token-level importance scores, measuring the semantic association strength between sensitive tokens and the task target token. The model input consists of the user's original query text and the locations of sensitive tokens identified in step S1, and the output is an importance score of 0–1 for each sensitive token. Specifically, the input sequence is first encoded to obtain a context-dependent representation of each token. ∈ Simultaneously, extract aggregated representations of task instruction tokens (such as user intent category tags, key verbs, etc.). ∈ The dot product of the two is scaled and then mapped to the [0,1] interval using the Sigmoid function: a_att =Sigmoid(( · ) / ( )) in, ∈ This is the context representation vector of the sensitive token. ∈ An aggregated representation vector of the task instruction token. This represents the attention head dimension. a_att expresses the original association strength between the sensitive token and the semantic direction of the task, serving as one of the common inputs for subsequent hybrid decision-making.
[0078] Example 2: Based on the above embodiments, this embodiment provides an application example of a data anonymization method. For example... Figure 2 The diagram shown is an overall flowchart of the data anonymization method in this embodiment. The specific steps are as follows: Step S1: Deploy a lightweight semantic analysis model on the device side. This model employs knowledge distillation technology to transfer semantic understanding capabilities from a large language model, while strictly controlling the model size to accommodate device-side computing power constraints. The model architecture is based on a Transformer encoder, with the number of layers compressed to 4–6, a hidden dimension of 256–512, and a total parameter count of approximately 5M–20M. This model undertakes the task of identifying sensitive information on the device side. It uses sequence labeling (token binary classification) to determine the sensitive attributes of the preprocessed token sequence, outputting a structured sequence of sensitive and non-sensitive tokens. This structured sequence is the "sensitive token location" required in Step S2.
[0079] Step S2: The attention mechanism calculates token-level importance scores, measuring the semantic association strength between sensitive tokens and the task target token. The model input consists of the user's original query text and the locations of sensitive tokens identified in Step S1. The output is an importance score of 0–1 for each sensitive token. Specifically, a lightweight model architecture almost identical to Step S1 is used. The model first encodes the input sequence to obtain a context-dependent representation of each token. ∈ Simultaneously, extract aggregated representations of task instruction tokens (such as user intent category tags, key verbs, etc.). ∈ The dot product of the two is scaled and then mapped to the [0,1] interval using the Sigmoid function: a_att =Sigmoid(( · ) / ( )) in ∈ This is the context representation vector of the sensitive token. ∈ An aggregated representation vector of the task instruction token. This represents the attention head dimension. a_att expresses the original association strength between the sensitive token and the semantic direction of the task, serving as one of the common inputs for subsequent hybrid decision-making.
[0080] Step S3: Hybrid Decision Making – Mapping Table Lookup and Neural Network Fine-tuning Evaluation. Through a hybrid decision-making mechanism of "mapping table + neural network," the attention importance score a_att obtained in Step S2 is fused with prior knowledge or the output of the fine-tuned model to obtain the final importance score s. The specific implementation process is as follows: (1) Mapping Table Construction. A mapping table of sensitive information type – task type – baseline importance triplet is constructed and organized in the form of <sensitive information type, task type, baseline importance>. s_base is an empirical value between 0 and 1, reflecting the general importance level of this type of sensitive information in the task. The initial values of the mapping table are set by domain experts based on compliance requirements and business experience. During operation, statistical calibration is performed based on actual feedback data to correct entries with large deviations.
[0081] (2) Automatic Scenario Type Judgment – When to Look Up a Table and When to Activate the Neural Network. Before each decision, the system automatically determines whether the current scenario is a "common scenario" or a "complex / boundary scenario" based on the following four indicators: Mapping table hit confidence c_match: Search the mapping table for the current <sensitive information type, task type> combination. If the combination has a high historical frequency, c_match is close to 1 (high confidence); if it is the first occurrence, c_match = 0 (completely unfamiliar).
[0082] c_match =f_count / (f_count + 5) Where: f_count = the historical hit frequency of this combination in the mapping table (how many times it has appeared). K = Smoothing constant (similar to Bayesian prior, default value is 5). For example: <ID number, financial transaction> appears 100 times in history → c_match = 100 / (100+5) ≈ 0.95 (very familiar, high confidence) <Phone number, case information query> first appearance (f_count=0) → c_match = 0 / (0+5) =0 (completely unfamiliar) <Geographic Location, Balance Inquiry> appears 8 times → c_match = 8 / (8+5)≈0.62 (off-limits) Context entropy Calculate the information entropy of the current input context. The higher the entropy value, the more complex the context and the more ambiguous the task intent, and the more refined the evaluation is required.
[0083] = - ·
[0084] in, It is the probability distribution of each token in the current context (obtained from the softmax probability or word frequency statistics output by the edge model).
[0085] Variation in importance between adjacent rounds In multi-round dialogues, if the importance score changes significantly between adjacent rounds... A larger value indicates that the user's intent may have shifted to a boundary scenario, triggering a more detailed evaluation.
[0086]
[0087] in This is the integration importance score for this round. It's from the previous round.
[0088] For example: Last round of casual conversation ≈ 0.1, this round of query business ≈ 0.62, = |0.62 - 0.2| = 0.42 (Clearly indicating a shift in intent) Semantic anchor density Before determining the scene type, the system uses the dependency parsing results (lightweight dependency tree parsing, which can be done by adding a linear layer to the encoder) generated in step S1 to quickly scan all sensitive tokens and calculate the weights of the preceding anchor points:
[0089] Count the number of latent semantic anchors , Calculate semantic anchor density: = /
[0090] Judgment rule: When c_match ≥ c_match_max (default 0.85) and ≤ (Default 2.5) and ≤ _max (default 0.3) and ≤ (Default 0.5) If the scenario is a common scenario, a quick table lookup is performed; otherwise, if the scenario is a complex / boundary scenario, a neural network is used for fine evaluation.
[0091] (3) Dynamic fusion weight calculation. In this scheme, the fusion weights for common scenarios are calculated. Fusion weights for complex / boundary scenarios It is not a fixed constant, but rather related to the context entropy. and the magnitude of change in importance between adjacent rounds Dynamically correlated adaptive variables.
[0092] Dynamic fusion weights for common scenarios :
[0093] in =0.7 is the baseline value (when =0 and When =0, =0.7, mapping table prior dominates). =0.3 is the entropy influence coefficient. =0.3 is the influence coefficient of the change range.
[0094] Design Motivation: In common scenarios, although none of the four metrics exceed the threshold, =0 and The specific value still reflects the "closeness to the boundary" of the scene. When near (As in 2.3), even if the boundary has not yet been crossed, the context is already quite complex. In this case, the trust in the prior knowledge of the mapping table should be appropriately reduced. Decrease), and increase the weight of the real-time attention signal a_att. Similarly, when near When user intent changes significantly, the intensity should be reduced. .
[0095] Dynamic fusion weights for complex / boundary scenarios :
[0096] in =0.6 is the baseline value (the initial weight when the indicator just crosses the threshold). =0.15 is the entropy influence coefficient. =0.15 is the influence coefficient of the change range.
[0097] Design motivation: In complex / boundary scenarios and The degree exceeding the threshold reflects the "complexity depth" of the scene. When Far exceeding (As in 3.8), the context is extremely complex, and a more refined evaluation of the neural network is more reliable; therefore, the value should be increased. (Improve the level of) (Trust). Similarly, when Far exceeding When user intent changes drastically, the response time should also be increased. This design enables a gradual transfer of trust within "complex scenarios," where the more complex the scenario, the more the system trusts the neural network's sophisticated judgment.
[0098] Final importance fusion for common scenarios: s = ·s_base + (1- )·a_att (3) The specific computational logic of neural network fine evaluation.
[0099] For complex or boundary scenarios, a lightweight multilayer perceptron (MLP) is used as the fine-grained evaluation model. Its input is a concatenation of three types of vectors: Context vector: Take the [CLS] pooling vector of the model for the current input in step S1. The dimension is the same as the hidden dimension of the model (256-512 dimensions) to capture global semantics.
[0100] Task type vector: The task type label is embedded and encoded, with a dimension of 64, capturing the prior intent of the task.
[0101] Sensitive type vector: Embedded encoding of sensitive information type labels, 32 dimensions, capturing sensitive category priors.
[0102] The MLP network structure is a three-layer fully connected (FC) network:
[0103]
[0104]
[0105] The training labels for the MLP are derived from important samples annotated by experts in historical interaction data (positive samples: manually confirmed that the sensitive information has a key impact on the task; negative samples: manually confirmed that the sensitive information is irrelevant to the task), and it is trained using a binary cross-entropy loss function. The MLP has approximately 0.3M–1M parameters and can share the feature extraction weights of the first few layers with the recognition model in step S1 to save on-device storage.
[0106] Final importance fusion for complex / boundary scenarios: s = · +(1- )·a_att in, is the weight for the fusion of the mapping table and attention, and a_att is the token-level importance score calculated by the attention mechanism.
[0107] pass , Through dynamic adjustment, the system achieves an optimal balance between prior knowledge (mapping table / neural network) and real-time attention signals, and the balance point adapts to the complexity of the scene—something that fixed-weight schemes cannot achieve.
[0108] Table 1 below shows typical mapping examples: Table 1: Importance Mapping Table
[0109] Part Two: Multi-level Desensitization Strategy Library The multi-level de-identification strategy library provides a set of differentiated de-identification solutions for the dynamic strategy decision engine. Based on semantic importance classification, it designs four-level strategies from L1 to L4, covering all scenarios from retaining the original to complete de-identification, taking into account both privacy protection and business availability, adapting to sensitive information of different importance and various application scenarios, and providing a standardized execution solution that can be directly invoked for adaptive de-identification decisions.
[0110] Level 1 (Preserve Original): Only the transmission is encrypted; no data anonymization is performed. Level 1 is the least sensitive de-identification strategy, suitable for highly semantically important (>0.8) information with strict accuracy requirements. This strategy does not perform any content transformation on the original data, but only protects the confidentiality of the data during transmission through transport layer encryption (such as TLS 1.3). After receiving the data, the cloud can directly use the original values for operations such as precise matching and correlation queries.
[0111] Typical application scenarios include: name and ID number in identity verification, account information in financial transactions, and key medical history in medical diagnosis.
[0112] Level 2 (Reversible Desensitization): End-side key encryption, recoverable in the cloud. Level 2 (L2) employs reversible encryption technology, protecting transmission security while supporting the restoration of original information in the cloud. Sensitive information is encrypted on the client side using a pre-set or negotiated symmetric key (such as AES-256-GCM), and the ciphertext is transmitted to the cloud. The cloud holds the same key and decrypts the data to obtain the original information for business processing. Compared to Level 1, Level 2's advantages are: encrypted data exists in ciphertext form during both transmission and cloud storage; even if the transmission channel or cloud storage is compromised, attackers cannot directly obtain the plaintext; it supports key rotation and fine-grained access control, further enhancing security. Applicable scenarios for Level 2 include: businesses requiring precise information but with high security requirements (such as detailed addresses in financial risk control), cross-security domain data transmission, and temporary, highly sensitive operations.
[0113] Level 3 (Irreversible Desensitization): Hash / masking processing, preserving some semantic features. Level 3 (L3) is an irreversible anonymization strategy that, through one-way transformation or partial masking, eliminates the recoverability of the original information while preserving semantic features useful for the task. Specific techniques include: format-preserving hashing (e.g., a dedicated hash for mobile phone numbers, the output is still in 11-digit format, but cannot be reversed), partial masking (e.g., displaying the first 6 and last 4 digits of an ID card number, with the middle digit masked), and semantic generalization (e.g., generalizing "Zhongguancun, Haidian District, Beijing" to "Beijing Science and Technology Park"). The core design goal of L3 is "usable but not recognizable"—the anonymized information is sufficient to support the model in completing the task (e.g., recommending nearby services based on generalized geolocation), but cannot be used to accurately identify individuals. L3 is suitable for sensitive information with moderate importance (0.5-0.8), typical scenarios include: user profile features in recommendation systems, geolocation aggregation in statistical analysis, and order information references in customer service dialogues.
[0114] Level L4 (Completely Desensitized): Replaced with generic placeholders, completely eliminating the original information. Level 4 (L4) is the strongest desensitization strategy, completely replacing sensitive information with generic placeholders that contain no information, thus eliminating any potential risk of privacy leakage. The placeholder design follows the "zero semantic leakage" principle—even if an attacker possesses a large amount of auxiliary information, they cannot infer any clues about the original data from the placeholders. For example, all names are uniformly replaced with "[Name]", all geographical locations with "[Location]", and all numerical sequences with "[Number]". L4 is suitable for sensitive information with extremely low importance (<0.5) or completely irrelevant to the task. Typical scenarios include: personal privacy mentions in casual conversations, fictitious information in sample data, and expired sensitive content in historical conversations. The cost of L4 is the complete loss of all business value of the information; therefore, it is only triggered when the information is confirmed to be irrelevant. To prevent false positives, the system supports a "downgrade confirmation" mechanism—when L4 desensitization causes the model to be unable to understand the user's intent, the system automatically prompts the user to confirm whether to provide the information, returning the decision-making power to the user.
[0115] The desensitization level table is shown below: Table 2: Desensitization Level Table
[0116] Part Three: Semantic Consistency Preservation Algorithm Traditional methods of desensitization (such as directly replacing sensitive words with placeholders like [name], [location], etc.) can lead to: Semantic anchor loss—some sensitive tokens are the referential core of other non-sensitive words in the sentence, and direct replacement of descendant words / connectives results in dangling words; Semantic breaks in formatting—for example, after replacing an 11-digit mobile phone number with [contact information], semantic clues related to the number format are lost; Grammatical consistency violation—the subject-verb-object structure in the original sentence becomes semantically ambiguous because the core words are replaced by generic placeholders.
[0117] Algorithm flow (three-step execution): S1: Semantic Anchor Point Identification and Preservation Before performing desensitization, iterate through all sensitive tokens and calculate their semantic anchor weights in the current sentence. . The calculation is performed by fusing the following two components: - Dependency Relationship: Through end-side dependency parsing, count the number of dependency arcs with this sensitive token as the head node. The more dependency arcs a token has, the stronger its role as a semantic anchor.
[0118] - Coreference density: Within the dialog context window, count the frequency of other tokens corerefringing this sensitive token through pronouns / synonyms. .
[0119]
[0120] when When the value is >0.6 (default), the token is marked as a semantic anchor. Even if its importance score s falls into the L3 or L4 range, semantically preserved replacement (see step 2) should be used instead of direct elimination replacement to prevent semantic chain breakage.
[0121] S2: Context-aware format-preserving replacement Different types of sensitive information require different replacement strategies to preserve semantic coherence: 1. Sensitive numeric information (phone numbers, ID card numbers, bank card numbers, etc.): Format-Preserving Substitution (FPS) is used to generate a semantically safe alternative numeric sequence with the same number of bits and format (satisfying constraints such as area code range and check digits) as the original information. For example, the phone number "138XXXXXXXX" is replaced with a fictional number in a legal format, "139XXXXXXXX" (this number does not correspond to a real user), instead of being replaced with "[Contact Information]", thus preserving the format semantic clues of the numeric sequence, allowing the larger model to understand "this is a usable contact information field".
[0122] 2. Entity-sensitive information (person names, place names, etc.) (when marked as semantic anchors): Use Category-Preserving Substitution (CPS) to randomly select a fictional entity from the entity library of the same category as a replacement (e.g., replace a real name with a fictional name of the same gender, replace a real city with a fictional city name of the same level), retain the entity category information, so that the large model can correctly identify "this is a person name / place name" rather than a general placeholder when understanding the context.
[0123] S3: Semantic coherence repair After the de-identification and replacement are completed, a lightweight semantic repair is performed on the syntactic structure surrounding the replacement point: Pronoun reference correction: If the replaced entity is inconsistent with its preceding pronoun in terms of gender / quantity / person (e.g., the original name is male, but the category is kept as female and a fictional name is selected after replacement), the corresponding pronoun references in the context (he / she, its / her, etc.) will be automatically adjusted to maintain pronoun consistency.
[0124] Connector completion: If placeholder replacement results in dangling connectors in the sentence, the repaired connect expressions are generated through the edge language model (the same model with an additional decoding head in step S1) to make the sentence semantically complete.
[0125] For example: Original sentence: Dial 13800138000 to inquire about services through this number. The grammatically incorrect sentence used to describe this situation is: "Dial [mobile number] to inquire about services through this number." Result of conjunction completion and repair: Dial [mobile number] to inquire about services through this contact number.
[0126] The above three-step algorithm ensures that the anonymized text remains highly consistent with the original text within the semantic space that the large model can understand. In benchmark tests, compared with the traditional direct placeholder replacement method, the similarity of the anonymized text increased from an average of 0.61 to over 0.82, corresponding to a 15%–30% improvement in the accuracy of downstream tasks of the large model.
[0127] Part Four: Dynamic Strategy Decision Engine The core function of the dynamic strategy decision engine is to combine the semantic importance score of sensitive information, the semantic consistency maintenance algorithm, user privacy preferences and real-time scene changes, map continuous scores to discrete desensitization levels, match the optimal solution in the multi-level desensitization strategy library, and realize scenario-based real-time switching and adaptive desensitization decision-making.
[0128] Importance scores > 0.8 use L1 / L2 level, 0.5-0.8 use L3 level, and < 0.5 use L4 level. The core of the dynamic strategy decision engine is to map continuous semantic importance scores to discrete desensitization level selections. This invention adopts a three-level threshold partitioning strategy to form clear decision rules. The specific threshold partitioning rules are shown in Table 3 below: Table 3: Threshold Division Table
[0129] The threshold selection is based on large-scale experimental data and real-world scenario validation. The setting of the two key thresholds, 0.8 and 0.5, considers the following factors: the psychological threshold of human perception of "importance" (0.8 corresponds to the subjective feeling of "very important," and 0.5 corresponds to "optional"); the safety boundary between different desensitization levels (ensuring controllable risks when transitioning between levels); and ensuring business continuity (avoiding frequent strategy switching due to overly sensitive thresholds). The thresholds can be fine-tuned according to industry characteristics and corporate compliance requirements. For example, the financial industry can increase 0.8 to 0.85 to enhance conservatism, while the internet industry can decrease 0.5 to 0.45 to improve user experience.
[0130] In practice, user intent may change dynamically during the conversation, requiring the anonymization strategy to respond instantly. This invention achieves scenario-based strategy switching through the following mechanisms: real-time task type recognition—dynamically determining the user's current primary intent based on dialogue history and current input; hot-switching of mapping tables—immediately loading the corresponding mapping table entry and recalculating the importance score when the task type changes; smooth strategy transition—avoiding abrupt changes in strategy between adjacent rounds that could disrupt the user experience, employing a gradual adjustment (e.g., completing the transition from L1 to L4 in multiple steps, providing user confirmation at each step); and abnormal rollback—automatically reverting to the previous effective strategy and prompting the user when the strategy switch causes the model to be unable to understand it. Typical scenarios for scenario switching include: switching from casual conversation (L4 level anonymized personal information) to business processing (L2 level anonymized identity information), and switching from information query (L3 level anonymized location) to nearby search (L1 level retaining precise location), etc. The switching latency is controlled within 100ms, with no significant impact on user perception.
[0131] Example 3: Another embodiment of this application relates to a data desensitization device. The implementation details of this data desensitization device are described below. The following implementation details are provided for ease of understanding and are not essential for implementing this solution. A schematic diagram of the data desensitization device in this embodiment can be seen as follows: Figure 3 As shown, it includes a first calculation module 310, a second calculation module 320, a third calculation module 330, and a desensitization module 340.
[0132] The first calculation module 310 is used to perform an initial importance judgment on sensitive word elements in the input text data based on a lightweight semantic analysis model on the device side, and obtain the first importance. The second calculation module 320 is used to determine the overall complexity of the text data. If the complexity does not reach the preset judgment standard for complex scenarios, the baseline importance of the sensitive word element hit by the preset importance mapping table is taken as the second importance. The importance mapping table stores the mapping relationship between sensitive information type, task type and baseline importance. The third calculation module 330 is used to calculate the target importance of the sensitive word element based on the first importance and the second importance. The desensitization module 340 is used to desensitize the sensitive words based on the importance of the target.
[0133] It is worth mentioning that all modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovative aspects of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed in this application; however, this does not mean that other units are absent in this embodiment.
[0134] In some optional embodiments, the data desensitization device can implement the data desensitization method described in any of the above embodiments.
[0135] Example 4: Another embodiment of this application relates to an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the data desensitization methods described in the above embodiments.
[0136] In this embodiment, the memory and processor are connected via a bus, which can include any number of interconnected buses and bridges, connecting various circuits of one or more processors and the memory together. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be further described in this embodiment. A bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.
[0137] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.
[0138] Example 5: Another embodiment of this application relates to a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the method embodiments described above.
[0139] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0140] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing this application, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of this application.
Claims
1. A data anonymization method, characterized in that, include: Based on a lightweight semantic analysis model on the device side, the importance of sensitive words in the input text data is initially judged to obtain the first importance. The overall complexity of the text data is determined. If the complexity does not meet the preset judgment standard for complex scenarios, the baseline importance of the sensitive word element hit by the preset importance mapping table is taken as the second importance. The importance mapping table stores the mapping relationship between sensitive information type, task type and baseline importance. The target importance of the sensitive word element is calculated based on the first importance and the second importance. The sensitive words are desensitized based on the target importance.
2. The data anonymization method according to claim 1, characterized in that, The determination of the overall complexity of the text data includes: Based on the hit confidence of the importance mapping table, the complexity is calculated by combining the context entropy of the text data, the degree of importance change of the sensitive word in adjacent rounds, and / or the density of semantic anchors in the text data, wherein the semantic anchor is a sensitive word whose keyness in the semantic structure reaches a preset threshold.
3. The data anonymization method according to claim 2, characterized in that, The calculation of the target importance of the sensitive word element based on the first importance and the second importance includes: The weights of the first importance and the second importance are assigned based on the context entropy and / or the degree of change in importance, wherein the greater the context entropy and / or the greater the degree of change in importance, the greater the weight corresponding to the first importance; The target importance is calculated by weighting the first importance and the second importance based on the assigned weights.
4. The data anonymization method according to claim 1, characterized in that, The method further includes: If the complexity reaches the preset judgment standard of complex scenario, the importance of the sensitive word is judged by the preset neural network model to obtain the third importance. The neural network model is a lightweight multilayer perceptron model, which is used to fuse the contextual semantic representation of the sensitive word, the prior of the current task intent and / or the prior of the sensitive category to perform fine-grained importance evaluation. The target importance of the sensitive word element is calculated based on the first importance and the third importance.
5. The data anonymization method according to claim 4, characterized in that, The calculation of the target importance of the sensitive word element based on the first importance and the third importance includes: The weights of the first importance and the third importance are assigned based on the context entropy of the text data and / or the degree of change in the importance of the sensitive words in adjacent rounds, wherein the greater the context entropy and / or the greater the degree of change in importance, the greater the weight of the third importance. The first importance and the third importance are weighted and summed based on the assigned weights to obtain the target importance.
6. The data desensitization method according to claim 4, characterized in that, The neural network model shares at least some of the weight parameters of the hidden layers with the semantic analysis model.
7. The data anonymization method according to claim 2, characterized in that, Determining the semantic anchor point includes: Dependency parsing is performed on the text data to count the number of dependency arcs with the sensitive word as the head node, and the dependency correlation degree is obtained; and / or, within the dialog context window, the frequency of other words referring to the sensitive word through pronouns or synonyms is counted, and the coreference density is obtained. Based on the dependency correlation degree and / or the coreference density, the semantic anchor weight of the sensitive word is calculated. When the semantic anchor weight is greater than the preset threshold, the sensitive word is marked as a semantic anchor.
8. The data anonymization method according to claim 2, characterized in that, The process of desensitizing the sensitive words based on the target importance includes: The semantic anchors are desensitized by semantically preserving replacement, which is unaffected by the importance of the target.
9. The data desensitization method according to any one of claims 1-8, characterized in that, Determining the first importance includes: Obtain the context representation vector of each sensitive word element in the text data and the aggregate representation vector of task indicator words related to the current task; The first importance is calculated based on the association strength between the context representation vector and the aggregate representation vector of the task indicator token.
10. A data anonymization device, characterized in that, include: The first calculation module is used to perform an initial importance judgment on sensitive words in the input text data based on a lightweight semantic analysis model on the device side, and obtain the first importance. The second calculation module is used to determine the overall complexity of the text data. If the complexity does not reach the preset judgment standard for complex scenarios, the baseline importance of the sensitive word element hit by the preset importance mapping table is taken as the second importance. The importance mapping table stores the mapping relationship between sensitive information type, task type and baseline importance. The third calculation module is used to calculate the target importance of the sensitive word element based on the first importance and the second importance. The desensitization module is used to desensitize the sensitive words based on the importance of the target.
11. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the data desensitization method as described in any one of claims 1 to 9.
12. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the data desensitization method according to any one of claims 1 to 9.
