Large model reasoning method and device based on sensitive information protection and related equipment

By building a sensitive information knowledge graph and using a large model for text processing methods, the security and integrity of sensitive information in the large model processing process in the prior art is solved, and end-to-end sensitive information protection and restoration are achieved.

CN119623648APending Publication Date: 2025-03-14CHINA CONSTRUCTION BANK
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411994005.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

When the prior art protects sensitive information input by users, it lacks an end-to-end protection mechanism, which leads to security risks in the large-scale processing process of sensitive information, and also affects the integrity and practicality of the information.

Method used

The named entity recognition (NER) model is used to identify sensitive entities in the text, and a sensitive information knowledge graph is built, sensitive information is filtered and replaced by sensitive information in the original input text, desensitized input text is generated, and a large model on the server side is called for processing, and finally, the second large model is used to restore sensitive information on the user side.

Benefits of technology

It realizes comprehensive protection of user-sensitive information, reduces the risk of sensitive information leakage, and ensures the integrity and practicality of information, and balances data security and model performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623648A_ABST
    Figure CN119623648A_ABST
Patent Text Reader

Abstract

The invention discloses a large model reasoning method and device based on sensitive information protection and related equipment. The method comprises the steps that firstly, an original input text is obtained, sensitive entities in the original input text are detected through a named entity recognition NER model, relation extraction and attribute extraction are conducted, and a sensitive information knowledge graph is constructed; then, screening sensitive information in the original input text according to the knowledge graph, and replacing the sensitive information to generate a desensitized input text; next, calling a first large model of the server side, and executing a specified task by using the desensitized input text to obtain a result text; and finally, calling a second large model of the user side, and restoring the sensitive information in the result text by using the original input text, the desensitized input text and the result text to obtain a complete text. Large models configured at different ends are utilized, sensitive information is protected, and meanwhile practicability of result texts is taken into account.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of human-computer interaction, and more specifically, to a large-model reasoning method, apparatus, and related equipment based on sensitive information protection. Background Art

[0002] With its powerful text understanding and generation capabilities, big models are completely changing the way people interact with computers and are widely used in various fields, such as intelligent customer service, automatic writing, code generation, etc. However, in actual applications, users often need to input text containing sensitive information into big models, such as personal identity information, financial information, medical records, etc., in order to obtain more personalized and accurate services. The leakage of this sensitive information will seriously infringe on the user's sensitive information and bring huge security risks.

[0003] Traditional sensitive information protection methods usually lack a comprehensive and coherent protection mechanism. The protection of sensitive information is not comprehensive enough, and the output results are not coherent enough. While protecting sensitive information, the integrity and practicality of the information are sacrificed. From the user input text to the large model, and then to the final result output, it is necessary to fully protect the sensitive information of the user input text and ensure that the output obtained by the user is complete and practical. Existing methods often only focus on the single link of sensitive information protection, and cannot fully and meticulously protect all sensitive information. They also ignore the practicality of the information in the entire process. Therefore, there is an urgent need for a sensitive information protection method that can provide end-to-end protection to ensure the security and practicality of information in the large model processing process. Summary of the invention

[0004] In view of the above problems, this application is proposed to provide a large model reasoning method, device, and related equipment based on sensitive information protection to achieve the protection of user sensitive information. The specific solution is as follows:

[0005] In a first aspect, a large model reasoning method based on sensitive information protection is provided, including:

[0006] Get the original input text;

[0007] Using a named entity recognition (NER) model to detect sensitive entities in the original input text, performing relationship extraction and attribute extraction on the sensitive entities in the original input text to obtain relationships between sensitive entities and attributes of sensitive entities, and constructing a sensitive information knowledge graph based on the sensitive entities, the relationships between the sensitive entities, and the attributes of the sensitive entities;

[0008] Filter sensitive information in the original input text according to the sensitive information knowledge graph;

[0009] Replacing the sensitive information in the original input text to obtain a desensitized input text;

[0010] Calling a first large model configured on the server side to instruct the first large model to perform a specified task using the desensitized input text, and obtaining a result text output by the first large model;

[0011] The second largest model configured on the user side is called to instruct the second largest model to use the original input text, the desensitized input text and the result text to restore the sensitive information in the result text to obtain the complete text output by the second largest model.

[0012] Preferably, the process of screening the sensitive information in the original input text according to the sensitive information knowledge graph includes:

[0013] Sensitive information is filtered in the sensitive information knowledge graph using preset filtering rules, wherein the filtering rules are constraint conditions for filtering the sensitive information.

[0014] Preferably, the screening rules include:

[0015] In the sensitive information knowledge graph, the sensitive entity and the attribute set of the sensitive entity cannot be used as sensitive information at the same time;

[0016] If the attribute set of the sensitive entity appears, the importance of the attributes of the sensitive entity in the original input text is analyzed by a preset importance analysis model, and the top N% of the attributes of the sensitive entity with higher importance are taken as sensitive information, where N is a value greater than 0 and less than 100;

[0017] The sensitive entities cannot be simultaneously sensitive information when connected by an edge in the sensitive information knowledge graph.

[0018] Preferably, the process of replacing the sensitive information in the original input text to obtain the desensitized input text includes:

[0019] Using placeholders, common tags or synonyms to replace the sensitive information to obtain desensitized input text;

[0020] or,

[0021] The second largest model configured on the user side is called to instruct the second largest model to replace the sensitive information in the original input text with the original input text and the sensitive information, so as to obtain the desensitized input text output by the second largest model.

[0022] Preferably, the calling of the first large model configured on the server side to instruct the first large model to perform a specified task using the desensitized input text to obtain the result text output by the first large model includes:

[0023] Obtain a first prompt instruction prompt format template, wherein the first prompt instruction prompt format template includes a first task instruction and a desensitized text slot, wherein the first task instruction is used to instruct the first large model to perform a specified task on the desensitized input text in the desensitized text slot to generate a result text;

[0024] Fill the desensitized input text into the desensitized text slot to obtain a first prompt instruction prompt, input the first prompt instruction prompt into a first large model configured on the server side, and obtain a result text output by the first large model.

[0025] Preferably, the calling of the second large model configured on the user side to instruct the second large model to use the original input text, the desensitized input text and the result text to restore the sensitive information in the result text to obtain the complete text output by the second large model includes:

[0026] Obtain a second prompt instruction prompt format template, wherein the second prompt instruction prompt format template includes a second task instruction, an original slot, a desensitized slot, and a result slot, wherein the second task instruction is used to instruct the second large model to use the original input text in the original slot and the desensitized input text in the desensitized slot to restore the sensitive information in the result text in the result slot to generate a complete text;

[0027] Fill the original input text into the original slot, fill the desensitized input text into the desensitized slot, fill the result text into the result slot, obtain a second prompt instruction prompt, input the second prompt instruction prompt into the second largest model configured on the user side, and obtain the complete text output by the second largest model.

[0028] Preferably, the calling of the second large model configured on the user side to instruct the second large model to replace the sensitive information in the original input text with the original input text and the sensitive information to obtain the desensitized input text output by the second large model includes:

[0029] Obtain a third prompt instruction prompt format template, wherein the third prompt instruction prompt format template includes a third task instruction, an original text slot, and a sensitive information slot, wherein the third task instruction is used to instruct the second large model to replace the corresponding sensitive information in the original input text in the original text slot with the sensitive information in the sensitive information slot to generate a desensitized input text;

[0030] Fill the original input text into the original text slot, fill the sensitive information into the sensitive information slot, obtain a third prompt instruction prompt, input the third prompt instruction prompt into the second largest model configured on the user side, and obtain the desensitized input text output by the second largest model.

[0031] In a second aspect, a large model reasoning device based on sensitive information protection is provided, comprising:

[0032] An original text acquisition unit, used for acquiring original input text;

[0033] A knowledge graph construction unit, configured to detect sensitive entities in the original input text using a named entity recognition (NER) model, extract relations and attributes of sensitive entities in the original input text to obtain relations between sensitive entities and attributes of sensitive entities, and construct a sensitive information knowledge graph based on the sensitive entities, the relations between the sensitive entities, and the attributes of the sensitive entities;

[0034] A sensitive information screening unit, used to screen the sensitive information in the original input text according to the sensitive information knowledge graph;

[0035] A sensitive information replacement unit, used to replace the sensitive information in the original input text to obtain a desensitized input text;

[0036] A result text generating unit, used for calling a first large model configured on the server side to instruct the first large model to perform a specified task using the desensitized input text to obtain a result text output by the first large model;

[0037] The complete text generation unit is used to call the second largest model configured on the user side to instruct the second largest model to use the original input text, the desensitized input text and the result text to restore the sensitive information in the result text to obtain the complete text output by the second largest model.

[0038] In a third aspect, an electronic device is provided, comprising: a memory and a processor;

[0039] The memory is used to store programs;

[0040] The processor is used to execute the program to implement the various steps of the large model reasoning method based on sensitive information protection described in any one of the first aspects of the present application.

[0041] In a fourth aspect, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the various steps of the large model reasoning method based on sensitive information protection described in any one of the first aspects of the present application are implemented.

[0042] By means of the above technical solution, the present application identifies sensitive entities in the text through the Named Entity Recognition (NER) model, and uses the relationship extraction and attribute extraction technology to obtain the relationship between sensitive entities and the attributes of sensitive entities, and then constructs a sensitive information knowledge graph to more comprehensively identify and screen sensitive information. It can not only accurately identify sensitive entities in the original input text, but also capture the complex relationship between sensitive entities through the sensitive information knowledge graph, so as to achieve more detailed sensitive information protection. By replacing sensitive information, while protecting sensitive information, the original context and information integrity of the original input text are retained as much as possible, the desensitized text is input into the first large model deployed on the server side to perform the specified task to obtain the result text, and finally the second large model deployed on the user side is used to combine the original text, the desensitized text and the result text to restore the sensitive information in the result text, avoiding the direct exposure of sensitive information to the large model on the server side, thereby reducing the risk of sensitive information leakage, achieving effective protection and on-demand restoration of sensitive information, and taking into account the security of sensitive information and the availability of information data. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0044] Figure 1 A schematic diagram of an implementation system architecture of a large model reasoning method based on sensitive information protection provided in an embodiment of the present application;

[0045] Figure 2 A schematic diagram of a process flow of a large model reasoning method based on sensitive information protection provided in an embodiment of the present application;

[0046] Figure 3 A schematic diagram of the structure of a large model reasoning device based on sensitive information protection provided in an embodiment of the present application;

[0047] Figure 4 A schematic diagram of the structure of a large model inference device based on sensitive information protection provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0049] This application provides a large model reasoning method based on sensitive information protection, which can be applied to Figure 1 The system architecture shown in the figure may include a terminal 100 and a server 200, wherein the server 200 is configured with a first large model and the terminal 100 is configured with a second large model. The terminal 100 and the server 200 cooperate to execute the large model reasoning method based on sensitive information protection provided in the embodiment of the present application.

[0050] Next, the embodiment of the present application introduces a large model reasoning method based on sensitive information protection from the perspective of the terminal 100. Figure 2 The large model reasoning method based on sensitive information protection specifically includes the following steps:

[0051] Step S100: Obtain original input text.

[0052] Specifically, the original input text can be direct user input, file upload, or API call. Direct input can come from web forms, chat windows, etc.; file upload can support txt, docx, pdf and other formats, and the uploaded files can be pre-processed, such as converting PDF to text; API calls can receive text data passed in by other systems. After obtaining the original input text, preliminary data cleaning can be performed, such as removing extra spaces, line breaks, or unifying the encoding format to UTF-8 to ensure the consistency of subsequent processing. The original input text can be temporarily stored to provide input for subsequent steps.

[0053] Step S110: Use a named entity recognition (NER) model to detect sensitive entities in the original input text, perform relationship extraction and attribute extraction on the sensitive entities in the original input text to obtain relationships between sensitive entities and attributes of sensitive entities, and construct a sensitive information knowledge graph based on the sensitive entities, the relationships between the sensitive entities, and the attributes of the sensitive entities.

[0054] Specifically, NER models, such as Bidirectional Encoder Representations from Transformers for Named Entity Recognition (BERT-NER), Conditional Random Field (CRF) models, etc., are used to identify sensitive entities in the original input text, such as names of people, places, names of organizations, phone numbers, ID numbers, bank card numbers, medical information, etc. The choice of NER model can be adjusted according to the specific application scenario and the type of sensitive information. A pre-trained model can be used or fine-tuned on a dataset in a specific field to improve the recognition accuracy. After the sensitive entities are identified, relationship extraction is further performed to determine the relationship between the entities. For example, the relationship between "Zhang San" and "Peking University" may be "studying at" or "working at". Relationship extraction can use rule-based methods, statistical machine learning-based methods, or deep learning-based methods. Next, attribute extraction is performed to extract attribute information of sensitive entities. For example, for the entity "Peking University", its attributes such as "address", "type", and "ranking" can be extracted. Finally, the extracted sensitive entities, relationships, and attributes are integrated into a sensitive information knowledge graph, which can be stored and managed using a graph database, such as Neo4j. In the sensitive information knowledge graph, nodes represent sensitive entities, edges represent relationships between sensitive entities, and attributes of sensitive entities can be attached to nodes. Based on the sensitive information knowledge graph, complex relationships and attributes between sensitive entities can be captured to achieve more comprehensive identification of sensitive information.

[0055] Step S120: Filter sensitive information in the original input text according to the sensitive information knowledge graph.

[0056] Specifically, after constructing the sensitive information knowledge graph, the sensitive information knowledge graph can be combined to more comprehensively capture the relationships between sensitive entities and the attributes of sensitive entities in the original input text, so as to more accurately identify potential sensitive information and achieve more fine-grained protection. The purpose of this step is to be able to more accurately screen the sensitive information that needs to be protected for the sensitive information knowledge graph according to preset policies or user-defined rules. For example, in some scenarios, only the ID number and telephone number may need to be desensitized, while the name and company name may be retained. The screening process can be based on entity type, relationship type, or attribute value, or it can be filtered according to relationship type, or it can be filtered according to attribute value. Through flexible screening strategies, it can ensure that only the information that really needs to be protected is desensitized, improve the efficiency and accuracy of subsequent processing, and avoid information loss caused by excessive desensitization.

[0057] Step S130: Replace the sensitive information in the original input text to obtain a desensitized input text.

[0058] Specifically, the sensitive information in the original input text screened out in step S120 is replaced to generate a desensitized input text, and the replacement strategy can be adjusted according to actual needs.

[0059] Step S140: calling the first large model configured on the server side to instruct the first large model to perform a specified task using the desensitized input text to obtain a result text output by the first large model.

[0060] Specifically, the desensitized input text is input into the first large model configured on the server side for processing. The first large model on the server side can perform set tasks, such as text summarization, machine translation, sentiment analysis, question-answering system, etc. Since the input text has been desensitized, the large model on the server side will not be exposed to sensitive information, thereby ensuring the security of the data, effectively isolating sensitive data from the server-side environment, and reducing the risk of data leakage. After the first large model completes the processing, it will return the corresponding processing result, that is, the result text.

[0061] Step S150, calling the second largest model configured on the user side to instruct the second largest model to use the original input text, the desensitized input text and the result text to restore the sensitive information in the result text to obtain the complete text output by the second largest model.

[0062] Specifically, the second largest model is used on the user side to restore the sensitive information in the result text output by the first largest model on the server side to generate the final complete text. The input of the second largest model on the user side is the original input text, the desensitized input text and the result text. The second largest model can understand the correspondence between the original input text and the desensitized input text, such as which placeholders correspond to which original sensitive information. Since the entire restoration process is carried out on the user side, the sensitive information will not leave the user's device, thereby maximizing data security and avoiding the risk of sensitive information being stolen or leaked during network transmission. Finally, the complete text after the sensitive information is restored is presented to the user to complete the entire process.

[0063] By desensitizing the original input text, sensitive information is protected from being leaked to the server, thereby improving data security. At the same time, the second largest model on the user side is used to restore sensitive information, ensuring the integrity and accuracy of the final output result text. This method effectively balances the contradiction between data security and model performance, allowing the powerful reasoning ability of the large model to be utilized while protecting sensitive information, significantly reducing the risk of data leakage, and is particularly suitable for processing scenarios containing sensitive information such as personal privacy and commercial secrets.

[0064] In this embodiment, the process of filtering sensitive information in the original input text according to the sensitive information knowledge graph in step S120 in the above embodiment is described in detail, which may specifically include the following steps:

[0065] Sensitive information is filtered in the sensitive information knowledge graph using preset filtering rules, wherein the filtering rules are constraint conditions for filtering the sensitive information.

[0066] Specifically, a preset screening rule based on the sensitive entity knowledge graph is introduced to more finely control the desensitization scope. An importance analysis model can be introduced into the preset screening rule, which can be used to evaluate the importance of the attributes of sensitive entities. The input of the importance analysis model can be the attributes of sensitive entities. After analysis by the importance analysis model, the importance of the attributes of sensitive entities in the original input text can be output, and all attributes are sorted from large to small according to importance. The top N% attributes are used as sensitive information, which provides a flexible method for controlling the intensity of desensitization. If an attribute of a sensitive entity is determined to be sensitive information, the sensitive entity is not considered as sensitive information. If all attributes of a sensitive entity are not determined to be sensitive information, the sensitive entity is considered as sensitive information, that is, the sensitive entity and the attributes of the sensitive entity are not considered as sensitive information at the same time. If two sensitive entities are directly connected in the sensitive information knowledge graph, that is, connected by an edge, at most only one of the entities can be desensitized. This is to avoid excessive desensitization and retain some context information. The above screening rules are exemplary. In addition, other optional screening rules can be set according to actual business needs.

[0067] By using the sensitive information knowledge graph and preset screening rules to screen sensitive information and introducing an importance analysis model, we can screen based on the importance of the attributes of sensitive entities in the original input text, avoid over-desensitization, and retain important contextual information. By setting the threshold of the top N% of importance, we can flexibly control the granularity of desensitization, while protecting sensitive information, we can maximize the integrity and information content of the text, and effectively improve the readability of the desensitized text and the accuracy of model reasoning.

[0068] In the following embodiment, the process of replacing the sensitive information in the original input text to obtain the desensitized input text in step S130 in the above embodiment is described in detail, which may specifically include the following steps:

[0069] Using placeholders, common tags or synonyms to replace the sensitive information to obtain desensitized input text;

[0070] or,

[0071] The second largest model configured on the user side is called to instruct the second largest model to replace the sensitive information in the original input text with the original input text and the sensitive information, so as to obtain the desensitized input text output by the second largest model.

[0072] Specifically, use predefined placeholders for replacement, such as replacing a person's name with "[NAME]", replacing an address with "[LOCATION]", replacing a phone number with "[PHONE]", etc.; use common tags for replacement, such as <person> 、 <location> 、 <organization>The corresponding sensitive information can be replaced by words, etc., which can retain some semantic information; the sensitive information can also be replaced by synonyms or near-synonyms, which can better retain the semantic information of the original text, and the synonym dictionary can be built and maintained as needed; the second largest model configured on the user side can also be called to replace sensitive information, and the appropriate replacement method can be dynamically selected according to the context information to generate a more natural and semantically desensitized input text. The second largest model can select an appropriate replacement method according to the context of the sensitive information in the original input text. For example, in different contexts, the same name can be replaced with different nicknames or codes. The second largest model can also generate more complex replacement texts, such as replacing "Zhang San studies at Peking University" with "A student studies at a certain university", which can better protect sensitive information.

[0073] In addition, sensitive information can be desensitized by using generalization technology, such as replacing specific ages with age groups, replacing precise addresses with vague addresses, etc. Sensitive information can also be encrypted by using encryption technology, such as using symmetric encryption or asymmetric encryption algorithms to encrypt sensitive information and decrypt it in subsequent steps; a suitable replacement strategy can be selected by considering the security and availability of the data.

[0074] It provides a variety of sensitive information replacement methods, including placeholders, universal tags, synonym replacement, generalization technology, encryption technology, and intelligent replacement based on the second largest model on the user side. It can select appropriate desensitization strategies according to different application scenarios and data characteristics to further improve the effectiveness of desensitization.

[0075] In this embodiment, the process of calling the first large model configured on the server side in S140 in the aforementioned embodiment to instruct the first large model to perform a specified task using the desensitized input text and obtain the result text output by the first large model is described in detail, which may specifically include the following steps:

[0076] Step S200, obtain a first prompt instruction prompt format template, wherein the first prompt instruction prompt format template includes a first task instruction and a desensitized text slot, and the first task instruction is used to instruct the first large model to perform a specified task on the desensitized input text in the desensitized text slot to generate a result text.

[0077] Step S210: fill the desensitized input text into the desensitized text slot to obtain a first prompt instruction prompt, input the first prompt instruction prompt into a first large model configured on the server side, and obtain a result text output by the first large model.

[0078] Specifically, effective prompt engineering can guide the large model to complete the specified task. The design of the desensitized text slot can consider the task type. The first task instruction can clearly and concisely describe the task goal to avoid ambiguity. Few-shot learning (FSL) can be used to provide some examples in the prompt to help the model better understand the task requirements. The format of the desensitized text slot can be compatible with the input format of the first large model. For example, specific delimiters or special tags can be used to distinguish different input parts, and the format of the slot can also consider the desensitization strategy. Prompts can also be generated dynamically based on different desensitized input texts. For example, the instructions or contextual information in the prompt can be adjusted according to the length or topic of the desensitized text. Dynamic prompt generation can improve the adaptability and robustness of the large model.

[0079] Using a prompt template that includes task instructions and anonymized text slots can more effectively guide the server-side No. 1 model to complete the specified task. Through clear task instructions and appropriate anonymized text slots, it can ensure that the No. 1 model correctly understands the task requirements and uses the anonymized text for reasoning, improving the efficiency and accuracy of the No. 1 model's reasoning and simplifying the calling process of the No. 1 model.

[0080] In the following embodiment, the process of calling the second large model configured on the user end in step S150 in the aforementioned embodiment to instruct the second large model to restore the sensitive information in the result text using the original input text, the desensitized input text and the result text to obtain the complete text output by the second large model is described in detail, which may specifically include the following steps:

[0081] Step S300, obtain a second prompt instruction prompt format template, wherein the second prompt instruction prompt format template includes a second task instruction, an original slot, a desensitized slot and a result slot, wherein the second task instruction is used to instruct the second large model to use the original input text in the original slot and the desensitized input text in the desensitized slot to restore the sensitive information in the result text in the result slot to generate a complete text.

[0082] Step S310, fill the original input text into the original slot, fill the desensitized input text into the desensitized slot, fill the result text into the result slot, obtain a second prompt instruction prompt, input the second prompt instruction prompt into the second largest model configured on the user side, and obtain the complete text output by the second largest model.

[0083] Specifically, the second largest model configured on the user side uses the association between the original input text, the desensitized input text and the result text to restore the sensitive information. The second task instruction can clearly instruct the second largest model configured on the user side to restore the sensitive information. The design of the original slot, the desensitized slot and the result slot enables the model to understand the correspondence between the three. Some restoration examples can be provided in the prompt to help the model learn the restoration strategy. The restoration strategy of the second largest model can be adjusted according to the specific desensitization method. For example, if a placeholder is used to replace sensitive information, the second largest model can directly replace the placeholder back to the original sensitive information. If a more complex desensitization method is used, such as synonym replacement, the second largest model can perform more complex reasoning and generation. During the restoration process, the second largest model may encounter ambiguous situations, such as multiple sensitive information corresponding to the same placeholder. Contextual information or an external knowledge base can be used to resolve ambiguity. If a unique restoration result cannot be determined, multiple candidate results can be provided for the user to choose. The operation of the second largest model on the user side can ensure the security of sensitive information and prevent sensitive information leakage.

[0084] Using prompt templates to guide the second largest model on the user side to restore sensitive information can more accurately control the restoration process and improve the accuracy of restoration. By providing the original input text, desensitized input text, and result text as context information, the second largest model can better understand the sensitive information in the result text and restore it to the correct location. This method can effectively avoid restoration errors and ensure the integrity and accuracy of the final output results.

[0085] The following embodiment describes the process of calling the second large model configured on the user end in the above embodiment to instruct the second large model to replace the sensitive information in the original input text with the original input text and the sensitive information to obtain the desensitized input text output by the second large model. Specifically, the following steps may be included:

[0086] Step S400, obtaining a third prompt instruction prompt format template, wherein the third prompt instruction prompt format template includes a third task instruction, an original text slot, and a sensitive information slot, wherein the third task instruction is used to instruct the second large model to replace the corresponding sensitive information in the original input text in the original text slot with the sensitive information in the sensitive information slot to generate a desensitized input text;

[0087] Step S410: fill the original input text into the original text slot, fill the sensitive information into the sensitive information slot, obtain a third prompt instruction prompt, input the third prompt instruction prompt into the second largest model configured on the user side, and obtain the desensitized input text output by the second largest model.

[0088] Specifically, the third task instruction can instruct the second model on the user side to replace sensitive information and specify a replacement strategy. The design of the sensitive information slot can ensure that the model can identify all sensitive information that needs to be replaced, and can control the replacement granularity according to different needs. For example, only part of the sensitive information can be replaced, or different replacement strategies can be adopted for different types of sensitive information. The second largest model can perform more intelligent replacements based on contextual information. For example, appropriate synonyms or near-synonyms can be selected to replace sensitive information based on the context. In order to improve the interpretability and controllability of the desensitization process, the second largest model can be required to output the specific process of the replacement, such as which sensitive information is replaced and which replacement methods are used. Users can control the intensity and effect of desensitization by adjusting the prompt or the parameters of the second largest model.

[0089] Using the second largest model on the user side to generate desensitized text and guiding it through prompt templates can achieve a more flexible and intelligent desensitization strategy. The second largest model can automatically select the appropriate replacement method based on the original input text and sensitive information. This method can improve the efficiency and accuracy of desensitization while reducing the need for manual intervention.

[0090] The following describes the big model reasoning device based on sensitive information protection provided in an embodiment of the present application. The big model reasoning device based on sensitive information protection described below and the big model reasoning method based on sensitive information protection described above can refer to each other.

[0091] See also Figure 3 , Figure 3 A schematic diagram of the structure of a large model reasoning device based on sensitive information protection disclosed in an embodiment of the present application.

[0092] like Figure 3 As shown, the device may include:

[0093] The original text acquisition unit 11 is used to acquire the original input text;

[0094] The knowledge graph construction unit 12 is used to detect sensitive entities in the original input text using a named entity recognition (NER) model, extract relations and attributes of the sensitive entities in the original input text to obtain relations between the sensitive entities and attributes of the sensitive entities, and construct a sensitive information knowledge graph based on the sensitive entities, the relations between the sensitive entities, and the attributes of the sensitive entities;

[0095] A sensitive information screening unit 13, configured to screen sensitive information in the original input text according to the sensitive information knowledge graph;

[0096] A sensitive information replacement unit 14, used to replace the sensitive information in the original input text to obtain a desensitized input text;

[0097] A result text generating unit 15 is used to call the first large model configured on the server side to instruct the first large model to perform a specified task using the desensitized input text to obtain a result text output by the first large model;

[0098] The complete text generation unit 16 is used to call the second large model configured on the user end to instruct the second large model to use the original input text, the desensitized input text and the result text to restore the sensitive information in the result text to obtain the complete text output by the second large model.

[0099] Optionally, the process of the sensitive information screening unit 13 screening the sensitive information in the original input text according to the sensitive information knowledge graph includes:

[0100] Sensitive information is filtered in the sensitive information knowledge graph using preset filtering rules, wherein the filtering rules are constraint conditions for filtering the sensitive information.

[0101] Optionally, the screening rules include:

[0102] In the sensitive information knowledge graph, the sensitive entity and the attribute set of the sensitive entity cannot be used as sensitive information at the same time;

[0103] If the attribute set of the sensitive entity appears, the importance of the attributes of the sensitive entity in the original input text is analyzed by a preset importance analysis model, and the top N% of the attributes of the sensitive entity with higher importance are taken as sensitive information, where N is a value greater than 0 and less than 100;

[0104] The sensitive entities cannot be simultaneously sensitive information when connected by an edge in the sensitive information knowledge graph.

[0105] Optionally, the process in which the sensitive information replacing unit 14 replaces the sensitive information in the original input text to obtain a desensitized input text includes:

[0106] Using placeholders, common tags or synonyms to replace the sensitive information to obtain desensitized input text;

[0107] or,

[0108] The second largest model configured on the user side is called to instruct the second largest model to replace the sensitive information in the original input text with the original input text and the sensitive information, so as to obtain the desensitized input text output by the second largest model.

[0109] Optionally, the result text generation unit 15 calls the first large model configured on the server side to instruct the first large model to perform a specified task using the desensitized input text to obtain the result text output by the first large model, including:

[0110] Obtain a first prompt instruction prompt format template, wherein the first prompt instruction prompt format template includes a first task instruction and a desensitized text slot, wherein the first task instruction is used to instruct the first large model to perform a specified task on the desensitized input text in the desensitized text slot to generate a result text;

[0111] Fill the desensitized input text into the desensitized text slot to obtain a first prompt instruction prompt, input the first prompt instruction prompt into a first large model configured on the server side, and obtain a result text output by the first large model.

[0112] Optionally, the complete text generation unit 16 calls a second large model configured on the user end to instruct the second large model to use the original input text, the desensitized input text and the result text to restore the sensitive information in the result text to obtain the complete text output by the second large model, including:

[0113] Obtain a second prompt instruction prompt format template, wherein the second prompt instruction prompt format template includes a second task instruction, an original slot, a desensitized slot, and a result slot, wherein the second task instruction is used to instruct the second large model to use the original input text in the original slot and the desensitized input text in the desensitized slot to restore the sensitive information in the result text in the result slot to generate a complete text;

[0114] Fill the original input text into the original slot, fill the desensitized input text into the desensitized slot, fill the result text into the result slot, obtain a second prompt instruction prompt, input the second prompt instruction prompt into the second largest model configured on the user side, and obtain the complete text output by the second largest model.

[0115] Preferably, the process of calling the second large model configured on the user side to instruct the second large model to replace the sensitive information in the original input text with the original input text and the sensitive information to obtain the desensitized input text output by the second large model includes:

[0116] Obtain a third prompt instruction prompt format template, wherein the third prompt instruction prompt format template includes a third task instruction, an original text slot, and a sensitive information slot, wherein the third task instruction is used to instruct the second large model to replace the corresponding sensitive information in the original input text in the original text slot with the sensitive information in the sensitive information slot to generate a desensitized input text;

[0117] Fill the original input text into the original text slot, fill the sensitive information into the sensitive information slot, obtain a third prompt instruction prompt, input the third prompt instruction prompt into the second largest model configured on the user side, and obtain the desensitized input text output by the second largest model.

[0118] The present application also provides an electronic device in an embodiment. Figure 4 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, tablet computers, teaching large screens, wearable devices, etc. Figure 4 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0119] like Figure 4 As shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603, so as to implement the large model reasoning method based on sensitive information protection of the aforementioned embodiment of the present application. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0120] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0121] An embodiment of the present application also provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any large model reasoning method based on sensitive information protection provided in the embodiment of the present application.

[0122] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When one or more computer programs are executed by an electronic device, the electronic device can implement any large model reasoning method based on sensitive information protection provided in an embodiment of the present application.

[0123] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0124] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0125] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0126] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0127] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.< / organization> < / location> < / person>

Claims

1. A large model reasoning method based on sensitive information protection, characterized in that: include: Get the original input text; Using a named entity recognition (NER) model to detect sensitive entities in the original input text, performing relationship extraction and attribute extraction on the sensitive entities in the original input text to obtain relationships between sensitive entities and attributes of sensitive entities, and constructing a sensitive information knowledge graph based on the sensitive entities, the relationships between the sensitive entities, and the attributes of the sensitive entities; Filter sensitive information in the original input text according to the sensitive information knowledge graph; Replacing the sensitive information in the original input text to obtain a desensitized input text; Calling a first large model configured on the server side to instruct the first large model to perform a specified task using the desensitized input text, and obtaining a result text output by the first large model; The second largest model configured on the user side is called to instruct the second largest model to use the original input text, the desensitized input text and the result text to restore the sensitive information in the result text to obtain the complete text output by the second largest model.

2. The method according to claim 1, characterized in that The process of screening the sensitive information in the original input text according to the sensitive information knowledge graph includes: Sensitive information is filtered in the sensitive information knowledge graph using preset filtering rules, wherein the filtering rules are constraint conditions for filtering the sensitive information.

3. The method according to claim 2, characterized in that The screening rules include: In the sensitive information knowledge graph, the sensitive entity and the attribute set of the sensitive entity cannot be used as sensitive information at the same time; If the attribute set of the sensitive entity appears, the importance of the attributes of the sensitive entity in the original input text is analyzed by a preset importance analysis model, and the top N% of the attributes of the sensitive entity with higher importance are taken as sensitive information, where N is a value greater than 0 and less than 100; The sensitive entities cannot be simultaneously sensitive information when connected by an edge in the sensitive information knowledge graph.

4. The method according to claim 1, characterized in that: The process of replacing the sensitive information in the original input text to obtain the desensitized input text includes: Using placeholders, common tags or synonyms to replace the sensitive information to obtain desensitized input text; or, The second largest model configured on the user side is called to instruct the second largest model to replace the sensitive information in the original input text with the original input text and the sensitive information, so as to obtain the desensitized input text output by the second largest model.

5. The method according to claim 1, characterized in that The calling of the first large model configured on the server side to instruct the first large model to perform a specified task using the desensitized input text to obtain a result text output by the first large model includes: Obtain a first prompt instruction prompt format template, wherein the first prompt instruction prompt format template includes a first task instruction and a desensitized text slot, wherein the first task instruction is used to instruct the first large model to perform a specified task on the desensitized input text in the desensitized text slot to generate a result text; Fill the desensitized input text into the desensitized text slot to obtain a first prompt instruction prompt, input the first prompt instruction prompt into a first large model configured on the server side, and obtain a result text output by the first large model.

6. The method according to claim 1, characterized in that The calling of the second largest model configured on the user side to instruct the second largest model to restore the sensitive information in the result text by using the original input text, the desensitized input text and the result text to obtain the complete text output by the second largest model includes: Obtain a second prompt instruction prompt format template, wherein the second prompt instruction prompt format template includes a second task instruction, an original slot, a desensitized slot, and a result slot, wherein the second task instruction is used to instruct the second large model to use the original input text in the original slot and the desensitized input text in the desensitized slot to restore the sensitive information in the result text in the result slot to generate a complete text; Fill the original input text into the original slot, fill the desensitized input text into the desensitized slot, fill the result text into the result slot, obtain a second prompt instruction prompt, input the second prompt instruction prompt into the second largest model configured on the user side, and obtain the complete text output by the second largest model.

7. The method according to claim 4, characterized in that The calling of the second largest model configured on the user side to instruct the second largest model to replace the sensitive information in the original input text with the original input text and the sensitive information to obtain the desensitized input text output by the second largest model includes: Obtain a third prompt instruction prompt format template, wherein the third prompt instruction prompt format template includes a third task instruction, an original text slot, and a sensitive information slot, wherein the third task instruction is used to instruct the second large model to replace the corresponding sensitive information in the original input text in the original text slot with the sensitive information in the sensitive information slot to generate a desensitized input text; Fill the original input text into the original text slot, fill the sensitive information into the sensitive information slot, obtain a third prompt instruction prompt, input the third prompt instruction prompt into the second largest model configured on the user side, and obtain the desensitized input text output by the second largest model.

8. A large model reasoning device based on sensitive information protection, characterized in that: include: An original text acquisition unit, used for acquiring original input text; A knowledge graph construction unit, configured to detect sensitive entities in the original input text using a named entity recognition (NER) model, extract relations and attributes of sensitive entities in the original input text to obtain relations between sensitive entities and attributes of sensitive entities, and construct a sensitive information knowledge graph based on the sensitive entities, the relations between the sensitive entities, and the attributes of the sensitive entities; A sensitive information screening unit, used to screen the sensitive information in the original input text according to the sensitive information knowledge graph; A sensitive information replacement unit, used to replace the sensitive information in the original input text to obtain a desensitized input text; A result text generating unit, used for calling a first large model configured on the server side to instruct the first large model to perform a specified task using the desensitized input text to obtain a result text output by the first large model; The complete text generation unit is used to call the second largest model configured on the user side to instruct the second largest model to use the original input text, the desensitized input text and the result text to restore the sensitive information in the result text to obtain the complete text output by the second largest model.

9. An electronic device, characterized in that: include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the large model reasoning method based on sensitive information protection as described in any one of claims 1 to 7.

10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the large model reasoning method based on sensitive information protection as described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Content security identification method based on integration of multiple large language models

    CN120012776A

  • Content Security Recognition Method Based on the Integration of Multiple Large Language Models

    CN120012776B

  • Information encryption method, system, equipment and medium

    CN120358066A