A method, apparatus, device, and storage medium for processing sensitive data.

By extracting and replacing the associated information of sensitive entities, and using entity recognition models and anti-reverse algorithms to generate codes, the problem of semantic structure destruction in existing desensitization methods is solved, thus achieving secure processing and accurate retrieval of sensitive data.

CN122839436BActive Publication Date: 2026-11-17DEYANG CITY WISDOM HEART INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611339290.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-09-01
Publication Date
2026-11-17
Estimated Expiration
2046-09-01

AI Technical Summary

Technical Problem

Existing technologies, when processing sensitive data, use simple replacement-based desensitization methods that disrupt the semantic structure of documents, affecting retrieval accuracy and usability, and cannot guarantee entity consistency across files.

Method used

By extracting sensitive entities and their associated information from the original document, using an entity recognition model to query historical sensitive entities with the same semantic structure in the entity database, replacing the sensitive entities with target encoded information, and combining with a reversibility algorithm to generate initial encoded information, the uniqueness of the encoding and the preservation of the semantic structure are ensured.

Benefits of technology

Sensitive data anonymization was achieved without affecting the semantic structure of the original documents, ensuring entity consistency and retrieval accuracy across files, and improving the integrity and security of the RAG knowledge base.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122839436B_ABST
    Figure CN122839436B_ABST
Patent Text Reader

Abstract

This invention discloses a sensitive data processing method, apparatus, device, and storage medium, relating to the field of data security technology, and solves the problem that current methods of desensitizing documents when processing sensitive data destroy the original semantics of the document. The method involves extracting the current sensitive entity and its association information with the original document from the original document; inputting the current sensitive entity and the association information into a pre-set entity recognition model; querying a database using the pre-set entity recognition model to find historical sensitive entities with the same application semantic structure as the current sensitive entity; storing historical sensitive entities and their corresponding encoding information in the entity database; obtaining the target encoding information corresponding to the current sensitive entity based on the query results of the historical sensitive entities; and replacing the sensitive entity in the original document with the target encoding information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data security technology, and in particular to a sensitive data processing method, apparatus, device, and storage medium. Background Technology

[0002] In natural language modeling applications, Retrieval-Augmented Generation (RAG) technology is widely used in scenarios such as enterprise knowledge base construction, intelligent question answering, and document retrieval. The main implementation involves storing raw document data in a knowledge base and providing accurate contextual support for large models through retrieval matching. During execution, the raw documents in the RAG knowledge base often contain a large amount of sensitive entity information, such as personnel names, contact information, geographical locations, monetary data, organization names, and time periods. This sensitive information involves privacy protection, trade secrets, or compliance requirements and cannot be shared externally without authorization.

[0003] Existing technologies employ simple replacement-based desensitization to address the security issues of sensitive information. For example, during the processing of a file, sensitive information is directly replaced with generated ciphertext, and the next file is processed immediately after the sensitive information is replaced. Although the above-mentioned simple replacement-based desensitization can hide sensitive information, it will destroy the semantic structure of the document, making it impossible to achieve cross-file entity association during RAG retrieval, thus affecting the accuracy and practicality of retrieval.

[0004] Because of the aforementioned document-by-document independent desensitization, the same sensitive entity is assigned different codes or replacement symbols in different documents, which cannot guarantee the consistency of entities across documents, undermines the integrity of the knowledge base, and is not conducive to joint retrieval and analysis of multiple documents. Summary of the Invention

[0005] In view of this, this application provides a sensitive data processing method, apparatus, device, and storage medium to solve the problem that current methods of desensitizing documents when processing sensitive data destroy the original semantics of the documents.

[0006] The first aspect of this application provides a method for processing sensitive data, the method comprising:

[0007] Extract the current sensitive entity and its association information with the original document from the original document; the association information includes: the frequency of occurrence of the sensitive entity, the target paragraph containing the sensitive entity, the list of the target paragraphs, the position information of the target paragraphs in the original document, and the text of the adjacent paragraphs of the target paragraphs;

[0008] The current sensitive entity and the associated information are input into a pre-set entity recognition model. The pre-set entity recognition model is used to query the entity database for historical sensitive entities that have the same application semantic structure as the current sensitive entity. The entity database is used to store historical sensitive entities and their corresponding encoding information.

[0009] Based on the query results of the historical sensitive entities, the target encoding information corresponding to the current sensitive entity is obtained;

[0010] The sensitive entity is replaced in the original document using the target encoded information.

[0011] In one possible implementation, obtaining the target encoding information corresponding to the current sensitive entity based on the query result of the sensitive entity includes:

[0012] When the historical sensitive entity is found in the entity database, the corresponding encoding information of the historical sensitive entity is read as the target encoding information.

[0013] When the historical sensitive entity is not found in the entity database, the anti-reverse algorithm is used to calculate the initial encoding information of the current sensitive entity, and establish the association structure of initial encoding information, historical sensitive entity, and association information;

[0014] The associated structure is stored in the entity database.

[0015] In one possible implementation, the initial encoding information of the current sensitive entity is calculated using a resilient algorithm, including:

[0016] The current sensitive entity is encrypted using an encryption algorithm to obtain ciphertext;

[0017] The category information of the current sensitive entity is obtained by calculating the current sensitive entity and the original document corresponding to the current sensitive entity;

[0018] Specific characters are added to the ciphertext according to the category information to obtain the initial encoded information.

[0019] In one possible implementation, storing the association structure in the entity database includes:

[0020] The type of the current sensitive entity is obtained by using a classification model to calculate the current sensitive entity and the original document corresponding to the current sensitive entity;

[0021] Query the entity database to find the specified storage location corresponding to the category information of the type;

[0022] When the specified storage location is found, the associated structure is stored in the specified storage location;

[0023] If the specified storage location is not found, a storage location is created based on the category information.

[0024] In one possible implementation, after the sensitive entity is replaced in the original document using the target encoding information, the method further includes:

[0025] The de-identified document obtained by replacing the sensitive entity is associated with the corresponding original document, and the de-identified document is stored in the RAG knowledge base that stores the original document;

[0026] Upon receiving a user's search request for the original document, the de-identified document is displayed.

[0027] A second aspect of this application provides a sensitive data processing apparatus, the apparatus comprising:

[0028] The extraction module is used to extract the current sensitive entity and the association information between the current sensitive entity and the original document from the original document; the association information includes: the frequency of occurrence of the sensitive entity, the target paragraph recording the sensitive entity, the list of target paragraphs, the position information of the target paragraph in the original document, and the adjacent paragraph text of the target paragraph;

[0029] The query module is used to input the current sensitive entity and the associated information into a pre-set entity recognition model, and query the entity database for historical sensitive entities that have the same application semantic structure as the current sensitive entity through the pre-set entity recognition model; the entity database is used to store historical sensitive entities and their corresponding encoding information;

[0030] The encoding information acquisition module is used to obtain the target encoding information corresponding to the current sensitive entity based on the query results of the historical sensitive entities;

[0031] A replacement module is used to replace the sensitive entity in the original document with the target encoded information.

[0032] In one possible implementation, the encoded information acquisition module includes:

[0033] The reading submodule is used to read the corresponding encoding information of the historical sensitive entity as the target encoding information when the historical sensitive entity is found in the entity database.

[0034] The calculation submodule is used to calculate the initial encoding information of the current sensitive entity using an anti-reverse algorithm when the historical sensitive entity is not found in the entity database, and to establish an association structure of initial encoding information, historical sensitive entity, and association information.

[0035] The storage submodule is used to store the association structure to the entity database.

[0036] In one possible implementation, the computation submodule is specifically used for the initial encoding information of sensitive entities, including:

[0037] The current sensitive entity is encrypted using an encryption algorithm to obtain ciphertext;

[0038] The category information of the current sensitive entity is obtained by calculating the current sensitive entity and the original document corresponding to the current sensitive entity;

[0039] Specific characters are added to the ciphertext according to the category information to obtain the initial encoded information.

[0040] In one possible implementation, the storage submodule is specifically used to use a classification model to calculate the type of the current sensitive entity and the original document;

[0041] Query the entity database to find the specified storage location corresponding to the category information of the type;

[0042] When the specified storage location is found, the associated structure is stored in the specified storage location;

[0043] If the specified storage location is not found, a storage location is created based on the category information.

[0044] In one possible implementation, a relationship-establishing module is used to establish an association between the desensitized document obtained by replacing the sensitive entity and the corresponding original document, and to store the desensitized document in the RAG knowledge base that stores the original document;

[0045] The display module is used to display the de-identified document upon receiving a user's search query for the original document.

[0046] A third aspect of this application provides an apparatus comprising: a processor and a memory, the processor and the memory being connected via a communication bus; wherein the processor is configured to call and execute a program stored in the memory; and the memory is configured to store the program, the program being configured to implement the sensitive data processing method provided in the first aspect of this application.

[0047] A fourth aspect of this application provides a computer-readable storage medium storing computer-executable instructions for performing a sensitive data processing method as provided in the first aspect of this application.

[0048] Compared with existing technologies, this application provides a sensitive data processing method, apparatus, device, and storage medium, the advantages of which are: while extracting sensitive entities from the original document, it also extracts the associated information of the original document corresponding to the sensitive entity, obtains the semantic structure of the sensitive entity in the original document through the associated information, and queries the entity database for historical sensitive entities with the same semantic structure through an entity recognition model. The entity database stores sensitive entities and their corresponding encoding information. Therefore, when a sensitive entity with the same semantic structure is found, the encoding information that can express the semantics is found. The sensitive entity in the original document is replaced with the encoding information, thereby achieving desensitization of sensitive entities without affecting the semantic structure of the original document. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0050] Figure 1 This is a flowchart illustrating the steps of a sensitive data processing method proposed in an embodiment of this application;

[0051] Figure 2 This is a schematic diagram of a table structure in an entity database, as exemplified in this application.

[0052] Figure 3 This is an architectural diagram of the language model retrieval data processing device proposed in the embodiments of this application. Detailed Implementation

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

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

[0055] To better understand this application, the technical names involved in this application are explained below:

[0056] Retrieval-Augmented Generation (RAG) is a technique that combines information retrieval with language model generation capabilities. Its basic workflow is as follows: when a user asks a question, the system first retrieves relevant document fragments or knowledge entries from the knowledge base. These search results are then used as contextual information and input into a large language model along with the user's question. The model then generates a more accurate and traceable answer based on the retrieved evidence. Unlike simply relying on data associations stored in the model parameters, RAG effectively mitigates problems such as memory errors, knowledge lag, and lack of private domain knowledge in language models by introducing data from the knowledge base. This allows the model output to be based on factual evidence rather than just probabilistic speculation.

[0057] Therefore, the knowledge base is the data source of the RAG system, and the document content stored in the knowledge base directly determines the information boundary and quality of the RAG system output. Existing technologies use coarse ciphertext replacement to desensitize sensitive entity information. After replacing sensitive entity information, the semantic structure of the document itself is destroyed, affecting the information boundary and quality of the RAG system output.

[0058] Example 1

[0059] In view of this, this application proposes a sensitive data processing method. While extracting sensitive entities from the original document, it also extracts the associated information of the original document corresponding to the sensitive entities. The semantic structure of the sensitive entities in the original document is obtained through the associated information. Then, the entity recognition model is used to query the entity database for historical sensitive entities with the same semantic structure. The entity database stores sensitive entities and their corresponding encoding information. Therefore, when a sensitive entity with the same semantic structure is found, the encoding information that can express the semantics is found. The sensitive entity in the original document is replaced with the encoding information, thereby achieving desensitization of sensitive entities without affecting the semantic structure of the original document.

[0060] Figure 1 This is a flowchart illustrating the steps of a sensitive data processing method proposed in an embodiment of this application, as follows: Figure 1 As shown, the steps include:

[0061] S101: Extract the current sensitive entity and the association information between the current sensitive entity and the original document from the original document.

[0062] The associated information includes: the frequency of occurrence of the sensitive entity, the target paragraph containing the sensitive entity, the list of the target paragraphs, the location information of the target paragraphs in the original document, and the text of the adjacent paragraphs of the target paragraphs.

[0063] The semantic structure is determined by the role of the sensitive entity in the event, the position of the entity in the narrative of the document, and the binding relationship between the sensitive entity and surrounding information. Therefore, by extracting the associated information while extracting the current sensitive entity, the semantic structure of the current sensitive entity in the original document can be obtained by analyzing the association features between the associated information and the current sensitive entity through the model.

[0064] In one example, the original document is "Party A: a certain digital technology company, Party B: a certain pharmaceutical group company, regarding the procurement of a smart healthcare system, after friendly consultation, the following agreement has been reached." The sensitive entities "a certain digital technology company" and "a certain pharmaceutical group company" are extracted from this document. The association information with the original document is extracted as follows: {Frequency of occurrence: 2 times; Appearance paragraphs: the first and last paragraphs of the document; Position information of the target paragraph in the original document: lines 1 to 1+a of the original document, etc.; Adjacent paragraph text of the target paragraph: "Party A," "Party B," "Regarding the procurement of a smart healthcare system, after friendly consultation, the following agreement has been reached"}. Through the above association information, the semantic structure of the current sensitive entities in the original document can be identified as: {Organization names in the agreement}.

[0065] For example, semantic structures also include: identity information such as ID cards, profit data in financial reports, and the geographical location of confidential entities.

[0066] S102: Input the current sensitive entity and the associated information into a pre-set entity recognition model, and query the entity database for historical sensitive entities that have the same application semantic structure as the current sensitive entity through the pre-set entity recognition model.

[0067] The entity database is used to store historically sensitive entities and their corresponding coded information.

[0068] The BERT-BiLSTM-CRF model can be used to construct the model to be trained. The BERT layer converts phrases, characters, etc. in the document into vector representations, the BiLSTM layer is used to encode the semantic dependencies between vectors, and the CRF is used to verify the logical relevance between sensitive entities and related information. Supervised learning is used to achieve semantic structure recognition. Specifically, the semantic structure is abstracted into a predefined set of semantic role labels.

[0069] Multiple samples were collected from various sectors including business and legal services, judicial and administrative adjudication, finance and accounting, government and public administration, and vertical industry reports. Original documents were used as samples, and 'sensitive entities' were extracted from each sample. The sensitive entity's textual features and associated contextual features (frequency of occurrence, paragraph position, paragraph list, adjacent paragraphs, etc.) were used as input. The model was trained to learn and map these features to corresponding semantic role labels, thereby achieving a quantitative determination of the entity's semantic structure within the original document. Specific training methods can employ other settings in this field, and this application's embodiments are not limited to any particular approach.

[0070] The entity database stores multiple pre-stored sensitive entities, along with the corresponding encoded information and semantic structure for each sensitive entity. This can be done during model training by using an entity recognition model to identify the semantic structure of sensitive entities and associated information, and then storing the data. Alternatively, the sensitive entities and their corresponding encoded information can be continuously updated during application.

[0071] S103: Based on the query results of the historical sensitive entities, obtain the target encoding information corresponding to the current sensitive entity.

[0072] One embodiment of this application also provides a specific process for executing S103, which includes the following sub-steps:

[0073] S1031: When the historical sensitive entity is found in the entity database, the corresponding encoding information of the historical sensitive entity is read as the target encoding information.

[0074] If the entity database query contains a historical sensitive entity with the same semantic structure as the current sensitive entity, the encoded information of the historical sensitive entity is directly read and output. If the entity database query does not contain a historical sensitive entity with the same semantic structure as the current sensitive entity, the current sensitive entity is encoded to obtain the target encoded information. The current sensitive entity, the target encoded information, and the semantic structure are then stored in the entity database, enabling continuous updates of the sensitive entity and its corresponding encoded information during application.

[0075] S1032: When the historical sensitive entity is not found in the entity database, the initial encoding information of the current sensitive entity is calculated using the anti-reverse algorithm, and the association structure of the initial encoding information, the historical sensitive entity, and the association information is established.

[0076] S1033: Store the association structure in the entity database.

[0077] In one example, Figure 2 This is a schematic diagram of the table structure in an entity database, as shown in this application. Figure 2 As shown, the historical sensitive entity table (entity), the associated information table structure (entity_context), and the original document table information (document) can be linked through foreign keys. Encoding information and category information are stored in the historical sensitive entity table (entity), thus allowing the query to retrieve historical sensitive entities. The encoding information associated with historical sensitive entities can be extracted through foreign keys.

[0078] In one example of this application, when the RAG knowledge base adds, deletes, or modifies an original document, the entity association information in the entity database is updated synchronously. When a new document is detected, steps S1032-S1033 are executed to update the encoding and document association relationship of the modified or deleted document.

[0079] This application embodiment also provides a specific process for executing S1032 to calculate the initial encoding information of the current sensitive entity using an anti-reverse algorithm:

[0080] K11: Encrypt the current sensitive entity using an encryption algorithm to obtain ciphertext.

[0081] One or more of the following encryption algorithms can be used: hash algorithm, key derivation algorithm, random perturbation + hash composite algorithm.

[0082] The encrypted ciphertext is a fixed-length, random string.

[0083] K12: Calculate the category information of the current sensitive entity by combining the current sensitive entity and the original document corresponding to the current sensitive entity.

[0084] A deep learning text classification model or a pre-trained language model can be used to fine-tune the classification model to calculate the category information of the current sensitive entity and its relationship with the original document. Alternatively, the semantic structure of the current sensitive entity can be directly extracted to obtain its category information.

[0085] K13: Add specific characters to the ciphertext according to the category information to obtain the initial encoding information.

[0086] You can pre-set specific characters to represent category information, and then randomly select specific characters to add during the application process.

[0087] For example, suppose the category information is a name, and the preset characters include {Zhang, Gao, ... Wang}. The current sensitive entity is encrypted using an encryption algorithm to obtain the ciphertext "XX". The current selection is a specific character "Gao". The specific character is added to the ciphertext to obtain the initial encoded information "GaoXX". The resulting encoded information "GaoXX" has the characteristics of ciphertext, is not easily attacked, and does not destroy the semantic structure of the original document. If the current sensitive entity in the original document is replaced with this encoded information, the reader can still obtain the meaning of that information as someone's name when retrieving the original document.

[0088] This application also provides an example of executing S1033 to store the association structure in the entity database:

[0089] K21: Use a classification model to calculate the category information of the current sensitive entity and the original document corresponding to the current sensitive entity.

[0090] K22: Query the specified storage location of the category information corresponding to the type in the entity database.

[0091] K23: When the specified storage location is found, store the associated structure in the specified storage location.

[0092] K24: If the specified storage location is not found, create a storage location according to the type.

[0093] The entity database categorizes and stores sensitive entities according to their category information.

[0094] The types include: personnel, location, organization, amount, time, and document.

[0095] When managing the storage structure, first obtain the category information of sensitive entities, find the type corresponding to the category information, and store the associated structure {initial encoding information - historical sensitive entities - associated information} in the storage location of the type storage form.

[0096] If the specified storage location is not found, a storage location is created based on the type to update the type storage form.

[0097] S104: Replace the sensitive entity in the original document with the target encoding information.

[0098] This application embodiment also includes a method to periodically check whether the encoding of the same sensitive entity is consistent in different documents. If there is an encoding conflict, the conflicting encoding is automatically corrected to ensure that the encoding of the same sensitive entity is globally unique and consistent throughout the entire knowledge base.

[0099] For example, a consistency check is performed weekly. By traversing all entities in the entity database, the encoding of the same entity is checked to see if it is consistent across different documents. If it is detected that "Li Si" is encoded as "ENC0005" in DOC008 and "ENC0006" in DOC010, then "ENC0006" is automatically corrected to "ENC0005", and the de-identified document and entity database association information in DOC010 are updated synchronously to ensure global encoding consistency.

[0100] By replacing the target encoding information through the embodiments of this application, the semantic structure of the original document is preserved, and the original document is also desensitized.

[0101] In one example of this application, steps S105 and S106 can also be executed to store the de-identified document in the RAG knowledge base that stores the original document, so that the user can directly obtain the de-identified document by calling the knowledge base, thus ensuring the security of sensitive information in the original document.

[0102] S105: Establish an association between the desensitized document obtained by replacing the sensitive entity and the corresponding original document, and store the desensitized document in the RAG knowledge base that stores the original document.

[0103] S106: Upon receiving a user's search for the original document, display the de-identified document.

[0104] Furthermore, after generating the desensitized document, the vector library of the RAG knowledge base is updated simultaneously. Vector data is generated from the desensitized document and replaced with the vector data corresponding to the original sensitive document to ensure that the original sensitive information is not leaked during the vector retrieval process.

[0105] Furthermore, during the execution of S106, access control can be implemented for de-identified documents and entity databases. Ordinary users can only access de-identified documents and codes, while authorized users can retrieve entity databases through codes to view the original text of the corresponding sensitive entities and related document information. Entity databases are stored separately with encryption and deployed separately from de-identified documents.

[0106] This application proposes a sensitive data processing method that employs an anti-reverse engineering algorithm to generate codes, avoiding the risk of reverse engineering using ordinary hash algorithms. Simultaneously, it enhances the protection strength of sensitive information and effectively prevents the leakage of original documents by separating and encrypting entity libraries and desensitized documents, and implementing hierarchical access control. The entity library achieves globally unified encoding of sensitive entities, and uses semantic structure to overlay encrypted ciphertexts. The same entity has a unique code across different documents, ensuring the integrity of the RAG knowledge base and preserving cross-file entity relationships, thus ensuring the accuracy of document retrieval after desensitization. Combining the association information of sensitive entities, an encoding replacement method, rather than simple masking, is used to retain the semantic structure and non-sensitive content of the original documents, ensuring that desensitized documents can be used normally for RAG vectorization, fragmentation, and retrieval without affecting the core functions of the RAG system. The entity library enables the association management of entities, codes, and documents, supporting entity tracing, frequency statistics, and incremental updates, facilitating knowledge base maintenance and management. Furthermore, the consistency verification mechanism avoids encoding conflicts, improving system stability. New documents are desensitized incrementally, eliminating the need to reprocess all documents, reducing system computing power consumption, improving desensitization efficiency, and adapting to application scenarios of large-scale RAG knowledge bases.

[0107] Example 2

[0108] Based on the sensitive data processing method provided in Embodiment 1 of this application, correspondingly, Embodiment 2 of this application also provides a sensitive data processing apparatus. Figure 3 This is a functional block diagram of the sensitive data processing device proposed in the embodiments of this application, such as... Figure 3 As shown, the device includes:

[0109] Extraction module 301 is used to extract the current sensitive entity and the association information between the current sensitive entity and the original document from the original document; the association information includes: the frequency of occurrence of the sensitive entity, the target paragraph recording the sensitive entity, the list of target paragraphs, the position information of the target paragraph in the original document, and the adjacent paragraph text of the target paragraph;

[0110] The query module 302 is used to input the current sensitive entity and the associated information into a pre-set entity recognition model, and query the entity database for historical sensitive entities that have the same application semantic structure as the current sensitive entity through the pre-set entity recognition model; the entity database is used to store historical sensitive entities and their corresponding encoding information;

[0111] The encoding information acquisition module 303 is used to obtain the target encoding information corresponding to the current sensitive entity based on the query results of the historical sensitive entities;

[0112] Replacement module 304 is used to replace the sensitive entity in the original document with the target encoding information.

[0113] In one possible implementation, the encoded information acquisition module includes:

[0114] The reading submodule is used to read the corresponding encoding information of the historical sensitive entity as the target encoding information when the historical sensitive entity is found in the entity database.

[0115] The calculation submodule is used to calculate the initial encoding information of the current sensitive entity using an anti-reverse algorithm when the historical sensitive entity is not found in the entity database, and to establish an association structure of initial encoding information, historical sensitive entity, and association information.

[0116] The storage submodule is used to store the association structure to the entity database.

[0117] In one possible implementation, the computation submodule is specifically used for the initial encoding information of sensitive entities, including:

[0118] The current sensitive entity is encrypted using an encryption algorithm to obtain ciphertext;

[0119] The category information of the current sensitive entity is obtained by calculating the current sensitive entity and the original document corresponding to the current sensitive entity;

[0120] Specific characters are added to the ciphertext according to the category information to obtain the initial encoded information.

[0121] In one possible implementation, the storage submodule is specifically used to calculate the type of the current sensitive entity and the original document corresponding to the current sensitive entity using a classification model;

[0122] Query the entity database to find the specified storage location corresponding to the category information of the type;

[0123] When the specified storage location is found, the associated structure is stored in the specified storage location;

[0124] If the specified storage location is not found, a storage location is created based on the category information.

[0125] In one possible implementation, the apparatus further includes:

[0126] The relationship establishment module is used to establish an association between the desensitized document obtained by replacing the sensitive entity and the corresponding original document, and to store the desensitized document in the RAG knowledge base that stores the original document;

[0127] The display module is used to display the de-identified document upon receiving a user's search query for the original document.

[0128] The specific principles and execution processes of each unit in the language model retrieval data processing device disclosed in Embodiment 2 of this application can be found in the corresponding parts of the language model retrieval data processing method disclosed in Embodiment 1 of this application, and will not be repeated here.

[0129] Example 3

[0130] Embodiment 3 of this application provides a device, including: a processor and a memory, the processor and the memory being connected via a communication bus; wherein, the processor is used to call and execute a program stored in the memory; the memory is used to store the program, the program being used to implement the sensitive data processing method provided in Embodiment 1 of this application.

[0131] Example 4

[0132] Embodiment 4 of this application provides a computer-readable storage medium storing computer-executable instructions for performing the sensitive data processing method provided in Embodiment 1 of this application.

[0133] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computing software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

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

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

Claims

1. A method of processing sensitive data, characterized in that, The method includes: Extract the current sensitive entity and its association information with the original document from the original document; the association information includes: the frequency of occurrence of the sensitive entity, the target paragraph containing the sensitive entity, the list of the target paragraphs, the position information of the target paragraphs in the original document, and the text of the adjacent paragraphs of the target paragraphs; The current sensitive entity and the associated information are input into a pre-set entity recognition model. The pre-set entity recognition model is used to query the entity database for historical sensitive entities that have the same application semantic structure as the current sensitive entity. The entity database is used to store historical sensitive entities and their corresponding encoding information. Based on the query results of the historical sensitive entities, the target encoding information corresponding to the current sensitive entity is obtained; The sensitive entity is replaced in the original document using the target encoded information; Specifically, based on the query results for the sensitive entity, the target encoding information corresponding to the current sensitive entity is obtained, including: When the historical sensitive entity is found in the entity database, the corresponding encoding information of the historical sensitive entity is read as the target encoding information. When the historical sensitive entity is not found in the entity database, the anti-reverse algorithm is used to calculate the initial encoding information of the current sensitive entity, and establish the association structure of initial encoding information, historical sensitive entity, and association information; Store the association structure in the entity database; The initial encoding information of the current sensitive entity is calculated using a resilient algorithm, including: The current sensitive entity is encrypted using an encryption algorithm to obtain ciphertext; The category information of the current sensitive entity is obtained by calculating the current sensitive entity and the original document corresponding to the current sensitive entity; Specific characters are added to the ciphertext according to the category information to obtain the initial encoded information.

2. The method according to claim 1, characterized in that, Storing the association structure in the entity database includes: The type of the current sensitive entity is obtained by using a classification model to calculate the current sensitive entity and the original document corresponding to the current sensitive entity; Query the entity database to find the specified storage location corresponding to the category information of the type; When the specified storage location is found, the associated structure is stored in the specified storage location; If the specified storage location is not found, a storage location is created based on the category information.

3. The method according to claim 1, characterized in that, After the sensitive entity is replaced in the original document using the target encoding information, the method further includes: The de-identified document obtained by replacing the sensitive entity is associated with the corresponding original document, and the de-identified document is stored in the RAG knowledge base that stores the original document; Upon receiving a user's search request for the original document, the de-identified document is displayed.

4. A sensitive data processing device, characterized in that, The device includes: The extraction module is used to extract the current sensitive entity and the association information between the current sensitive entity and the original document from the original document; the association information includes: the frequency of occurrence of the sensitive entity, the target paragraph recording the sensitive entity, the list of target paragraphs, the position information of the target paragraph in the original document, and the adjacent paragraph text of the target paragraph; The query module is used to input the current sensitive entity and the associated information into a pre-set entity recognition model, and query the entity database for historical sensitive entities that have the same application semantic structure as the current sensitive entity through the pre-set entity recognition model; the entity database is used to store historical sensitive entities and their corresponding encoding information; The encoding information acquisition module is used to obtain the target encoding information corresponding to the current sensitive entity based on the query results of the historical sensitive entities; The replacement module is used to replace the sensitive entity in the original document with the target encoded information; The encoding information acquisition module includes: The reading submodule is used to read the corresponding encoding information of the historical sensitive entity as the target encoding information when the historical sensitive entity is found in the entity database. The calculation submodule is used to calculate the initial encoding information of the current sensitive entity using an anti-reverse algorithm when the historical sensitive entity is not found in the entity database, and to establish an association structure of initial encoding information, historical sensitive entity, and association information. A storage submodule is used to store the association structure into the entity database; The calculation submodule is specifically used for the initial encoding information of sensitive entities. It encrypts the current sensitive entity using an encryption algorithm to obtain ciphertext; it calculates the category information of the current sensitive entity by performing calculations on the current sensitive entity and the original document corresponding to the current sensitive entity; and it adds specific characters to the ciphertext according to the category information to obtain the initial encoding information.

5. A device, characterized in that, include: A processor and a memory are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; The memory is used to store a program for implementing the sensitive data processing method as described in any one of claims 1-3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for performing the sensitive data processing method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • File desensitization and de-desensitization method and system for edge equipment with semantic fidelity

    CN121959630A

  • Automatic De-Identification Of Sensitive Data With Contextual Relexicalization

    US20260170174A1