Knowledge retrieval enhanced privacy protection method and device, system, equipment, and medium

Through the knowledge retrieval of large language models, the candidate context data in the database are processed for privacy protection, and question and answer prompt data are generated, which solves the problems of outdated information and low privacy security of large language models, and improves the accuracy of answer data and privacy-sensitive data. security.

CN118296654BActive Publication Date: 2024-10-29ANT GROUP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410720609.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-10-29
Estimated Expiration
2044-06-05

AI Technical Summary

Technical Problem

Large language models have problems with outdated information and low accuracy in the knowledge retrieval process. At the same time, the plug-in knowledge base contains personally identifiable private information and sensitive data, resulting in low privacy security.

Method used

By determining the candidate context data associated with the user's question data from the knowledge retrieval enhancement database, perform privacy protection processing, generate question and answer prompt data and input it into the large language model, realize the protection of privacy-sensitive data and prevent attackers from obtaining the privacy in the database Sensitive data.

Benefits of technology

It improves the accuracy and reliability of large language model answer data, and at the same time significantly improves the security of privacy-sensitive data, avoids data leakage, and achieves refined management of privacy-sensitive data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118296654B_ABST
    Figure CN118296654B_ABST
Patent Text Reader

Abstract

The embodiments of this specification disclose a privacy protection method and apparatus, system, device, and medium for knowledge retrieval enhancement. First, user question data is received, candidate context data associated with the user question data is determined from an external knowledge database, and the candidate context data is processed for privacy protection to obtain target context data; then, based on the user question data and the target context data, question and answer prompt data is generated, and finally the question and answer prompt data is input into a trained large language model to obtain answer data corresponding to the user question data. This technical solution can protect privacy-sensitive data from the source of the data, prevent attackers from obtaining privacy-sensitive data in the database through questions with the large language model, and effectively improve the security of privacy-sensitive data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a knowledge retrieval-enhanced privacy protection method and apparatus, system, device, and medium. Background Art

[0002] With the rapid development of science and technology, large language models (LLM) have attracted more and more attention. Large language models are deep learning models trained based on massive text data. They can generate natural language text or understand the meaning of language text. Such models can perform a variety of natural language processing (NLP) tasks, including but not limited to text classification, question answering, and dialogue. However, large language models often have hallucinations during use, that is, the content in the generated results of the large language model may not be consistent with the facts, and because the training knowledge base of the large language model is updated less frequently, the information obtained by the model is often outdated, and the accuracy and reliability of the output results are low, which cannot meet the needs of actual applications.

[0003] To solve this problem, an external knowledge base is usually used to provide accurate and up-to-date data for the large language model. However, the external knowledge base contains a large amount of personal identification privacy information (such as email addresses, mobile phone numbers, etc.) and sensitive internal corporate data (such as account passwords, financial data, etc.), which may result in attackers obtaining personal identification privacy information or sensitive internal corporate data from the output of the large language model through question-and-answer sessions, resulting in low security for privacy-sensitive data. Summary of the invention

[0004] The embodiments of this specification first provide a privacy protection method for knowledge retrieval enhancement, which can protect privacy-sensitive data from the source of the data by performing privacy protection processing on candidate context data determined from a knowledge retrieval enhancement database, preventing attackers from obtaining privacy-sensitive data in the database through problems with a large language model, and effectively improving the security of privacy-sensitive data. The method includes:

[0005] Receive user question data, and determine candidate context data associated with the user question data from a preset knowledge retrieval enhancement database;

[0006] Performing privacy protection processing on the candidate context data to obtain target context data;

[0007] Generate question and answer prompt data based on the user question data and the target context data;

[0008] The question and answer prompt data is input into the trained large language model to obtain the answer data corresponding to the user question data.

[0009] Furthermore, in some implementations, performing privacy protection processing on the candidate context data to obtain target context data includes: performing access permission screening on the candidate context data to obtain target context data.

[0010] Further, in some embodiments, the access permission screening of the candidate context data to obtain the target context data includes: determining the user access permission corresponding to the user question data; matching the user access permission with the data access permission corresponding to the candidate context data, and using the successfully matched candidate context data as the target context data.

[0011] Further, in some implementations, performing privacy protection processing on the candidate context data to obtain target context data includes: replacing privacy data on the candidate context data to obtain target context data.

[0012] Further, in some embodiments, the replacing of the candidate context data with privacy data to obtain the target context data includes: identifying the real privacy data in the candidate context data; obtaining virtual privacy data corresponding to the data structure of the real privacy data; and replacing the real privacy data in the candidate context data with the virtual privacy data to obtain the target context data.

[0013] Further, in some embodiments, determining the candidate context data associated with the user question data from a preset knowledge retrieval enhanced database includes: determining the candidate context data associated with the user question data based on the semantic similarity between the user question data and each context data in the knowledge retrieval enhanced database.

[0014] Furthermore, in some embodiments, the knowledge retrieval enhanced database includes a context vector database; determining the candidate context data associated with the user question data based on the semantic similarity between the user question data and each context data in the knowledge retrieval enhanced database includes: determining the question embedding vector corresponding to the user question data through a pre-trained word embedding model; determining the semantic similarity between the question embedding vector and each context embedding vector in the context vector database, and sorting each context embedding vector according to the semantic similarity; and selecting at least one context embedding vector from the sorted context embedding vectors as the candidate context data associated with the user question data.

[0015] Furthermore, in some embodiments, the method also includes: obtaining pre-collected context data; performing vector embedding representation on the context data through the word embedding model to obtain the context embedding vector corresponding to each context data; and constructing the context vector database through the context embedding vector.

[0016] Further, in some embodiments, generating question and answer prompt data based on the user question data and the target context data includes: obtaining a preset model question and answer prompt template; filling the user question data and the target context data into the model question and answer prompt template to generate the question and answer prompt data.

[0017] Furthermore, in some embodiments, the method also includes: determining the question type corresponding to the user question data; if the question type is detected to be an offensive question, counting the user account information corresponding to the user question data; in response to detecting that the count number of offensive questions of the user account information exceeds a preset number of offensive questions, updating the user access rights of the user account information to the minimum access rights.

[0018] The embodiment of this specification also provides a knowledge retrieval enhanced privacy protection device, the device comprising:

[0019] A context data matching module, used for receiving user question data and determining candidate context data associated with the user question data from a preset knowledge retrieval enhancement database;

[0020] A context data screening module, used for performing privacy protection processing on the candidate context data to obtain target context data;

[0021] A question and answer prompt generating module, used for generating question and answer prompt data based on the user question data and the target context data;

[0022] The model answering module is used to input the question and answer prompt data into the trained large language model to obtain the answer data corresponding to the question data.

[0023] The embodiment of this specification also provides a knowledge retrieval enhanced privacy protection system, the system comprising:

[0024] A graphical user interface for obtaining input user question data;

[0025] A knowledge retrieval enhancement database, used to determine candidate context data according to the semantic similarity between the user question data and each stored context data;

[0026] A privacy authority management device, used to perform privacy protection processing on the candidate context data to obtain target context data;

[0027] A model question and answer prompt device, used to generate question and answer prompt data based on the user question data and the target context data;

[0028] The large language model is used to output answer data corresponding to the user question data according to the input question and answer prompt data.

[0029] The embodiment of this specification also provides a knowledge retrieval enhanced privacy protection system, the system comprising:

[0030] A graphical user interface for obtaining input user question data;

[0031] A knowledge retrieval enhancement database, used to determine candidate context data according to the semantic similarity between the user question data and each stored context data;

[0032] A privacy authority management device, used to perform privacy protection processing on the candidate context data to obtain target context data;

[0033] A model question and answer prompt device, used to generate question and answer prompt data based on the user question data and the target context data;

[0034] The large language model is used to output answer data corresponding to the user question data according to the input question and answer prompt data.

[0035] The embodiments of the present specification also provide an electronic device, including: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the knowledge retrieval enhanced privacy protection method in the embodiments of the present specification.

[0036] The embodiments of the present specification also provide a computer program product, wherein the computer program product stores at least one instruction, and the at least one instruction is suitable for being loaded by a processor and executing the steps of the knowledge retrieval enhanced privacy protection method in the embodiments of the present specification.

[0037] The embodiments of the present specification also provide a storage medium storing a computer program, wherein the computer program is suitable for being loaded by a processor and executing the steps of the knowledge retrieval enhanced privacy protection method in the embodiments of the present specification.

[0038] In an embodiment of the present specification, by receiving user question data, candidate context data associated with the user question data is determined from an external knowledge retrieval enhanced database, and privacy protection processing is performed on the candidate context data to obtain target context data; then, based on the user question data and the target context data, question and answer prompt data is generated, and finally the question and answer prompt data is input into a trained large language model to obtain answer data corresponding to the user question data. On the one hand, the target context data for answering the user's question data is determined through an external knowledge retrieval enhancement database, and then the question and answer prompt data is generated through the user's question data and the target context data, thereby realizing the knowledge retrieval enhancement of the large language model, so that the large language model can obtain the answer data according to the accurate and latest knowledge retrieval enhancement database of the knowledge data, effectively improving the accuracy and reliability of the answer data; on the other hand, after screening the candidate context data from the knowledge retrieval enhancement database, the target context data is obtained by performing privacy protection processing on the candidate context data, and then the target context data is used as the question and answer prompt data, which can realize the protection of privacy-sensitive data from the source of the data, avoid the attacker from obtaining the privacy-sensitive data in the database through the questions with the large language model, and effectively improve the security of the privacy-sensitive data; on the other hand, compared with directly filtering all the privacy-sensitive data in the external knowledge retrieval enhancement database, the candidate context data is processed for privacy protection to obtain the target context data, which can realize the refined management of privacy-sensitive data, avoid the data loss of the target context data, and further improve the accuracy and reliability of the answer data of the large language model. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A schematic diagram of the system architecture of an exemplary application environment of a knowledge retrieval enhanced privacy protection method and apparatus to which the embodiments of this specification can be applied is shown.

[0040] Figure 2 A flowchart of a knowledge retrieval enhanced privacy protection method provided in an embodiment of this specification.

[0041] Figure 3 A flowchart of performing privacy protection processing on candidate context data is provided in an embodiment of this specification.

[0042] Figure 4 A schematic diagram of another process for performing privacy protection processing on candidate context data provided in an embodiment of this specification.

[0043] Figure 5 A flowchart of identifying offensive questions and performing privacy protection processing is provided in an embodiment of this specification.

[0044] Figure 6A flowchart of a knowledge retrieval enhancement method for implementing privacy protection of a large language model provided in an embodiment of this specification.

[0045] Figure 7 A schematic diagram of the structure of a knowledge retrieval enhanced privacy protection system provided in an embodiment of this specification.

[0046] Figure 8 A schematic diagram of the structure of a knowledge retrieval enhanced privacy protection device provided in an embodiment of this specification.

[0047] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.

[0049] Figure 1 A schematic diagram of the system architecture of an exemplary application environment of a knowledge retrieval enhanced privacy protection method and apparatus to which the embodiments of this specification can be applied is shown.

[0050] like Figure 1 As shown, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The terminal devices 101, 102, 103 may be various electronic devices with artificial intelligence (AI) computing capabilities, including but not limited to desktop computers, portable computers, smart phones, tablet computers, etc. It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.

[0051] The privacy protection method for knowledge retrieval enhancement provided in the embodiments of this specification is generally executed by the terminal devices 101, 102, and 103, and accordingly, the privacy protection device for knowledge retrieval enhancement is generally set in the terminal devices 101, 102, and 103. However, it is easy for those skilled in the art to understand that the privacy protection method for knowledge retrieval enhancement provided in the embodiments of this specification can also be executed by the server 105, and accordingly, the privacy protection device for knowledge retrieval enhancement can also be set in the server 105, which is not particularly limited in this exemplary embodiment.

[0052] See also Figure 2 , which is a flowchart of a method for privacy protection enhanced by knowledge retrieval in the embodiment of this specification. In the embodiment of this specification, the method for privacy protection enhanced by knowledge retrieval can be applied to a terminal device or a server, and this exemplary embodiment does not make any special restrictions on this. Figure 2 The process shown is described in detail. The knowledge retrieval enhanced privacy protection method in the embodiment of this specification may specifically include the following steps:

[0053] Step S210, receiving user question data, and determining candidate context data associated with the user question data from a preset knowledge retrieval enhancement database;

[0054] Step S220, performing privacy protection processing on the candidate context data to obtain target context data;

[0055] Step S230, generating question and answer prompt data based on the user question data and the target context data;

[0056] Step S240: input the question and answer prompt data into the trained large language model to obtain answer data corresponding to the user question data.

[0057] According to the privacy protection method for knowledge retrieval enhancement in the embodiments of this specification, on the one hand, the target context data for answering user question data is determined through an external knowledge retrieval enhancement database, and then question and answer prompt data is generated through the user question data and the target context data, thereby realizing knowledge retrieval enhancement of a large language model, so that the large language model can obtain answer data based on the accurate and latest knowledge retrieval enhancement database of knowledge data, effectively improving the accuracy and reliability of the answer data; on the other hand, after screening candidate context data from the knowledge retrieval enhancement database, the candidate context data is processed for privacy protection to obtain target context data, and then the target context data is used as question and answer prompt data, so that the protection of privacy-sensitive data can be achieved from the source of the data, avoiding attackers from obtaining privacy-sensitive data in the database through questions with the large language model, and effectively improving the security of privacy-sensitive data; on the other hand, the candidate context data is processed for privacy protection to obtain target context data, which can achieve refined management of privacy-sensitive data, avoid data loss of target context data, and further improve the accuracy and reliability of the answer data of the large language model, compared with directly filtering all privacy-sensitive data in the external knowledge retrieval enhancement database.

[0058] The following is a detailed description of the privacy protection method for knowledge retrieval enhancement provided in the embodiments of this specification.

[0059] In step S210, user question data is received, and candidate context data associated with the user question data is determined from a preset knowledge retrieval enhancement database.

[0060] In an example embodiment of the present specification, user question data refers to question-and-answer instructions input by a user object to a large language model. For example, the user question data can be question-and-answer instructions in text form input by a user object through a graphical user interface, or can be question-and-answer instructions in voice form input by a user object through an intelligent voice assistant. The voice question-and-answer instructions are converted into text question-and-answer instructions through a conversion model and input into the large language model. Of course, the user question data can also be question-and-answer instructions in other forms input by a user object to a large language model, and this example embodiment does not specifically limit this.

[0061] The knowledge retrieval enhancement database refers to an external knowledge source provided in advance for the large language model. Compared with the non-parametric knowledge learned by the large language model, the knowledge retrieval enhancement database has a fast knowledge update frequency and more accurate data, which can provide better quality knowledge data for the knowledge retrieval of the large language model. For example, the knowledge retrieval enhancement database can be a context vector database obtained by pre-collecting knowledge data and constructing it, or it can be a knowledge search engine accessed through an API (Application Programming Interface). Of course, it can also be an open source knowledge graph or other type of knowledge database. This example embodiment does not specifically limit the type of the knowledge retrieval enhancement database.

[0062] Candidate context data refers to several pieces of context data most relevant to the user's question data retrieved from the knowledge retrieval enhancement database. The context data may include question data and answer data associated with the question data. The context data is provided as prompt data to the large language model so that the large language model can generate answer data for answering the user's question data based on the provided context data. The candidate context data can effectively improve the accuracy and reliability of the answer data generated by the large language model without adjusting the model parameters of the large language model or retraining the large language model.

[0063] The user question data input by the user object can be obtained, and then the candidate context data associated with the user question data can be determined from the preset knowledge retrieval enhancement database based on the user question data. For example, the candidate context data associated with the user question data can be determined from the preset knowledge retrieval enhancement database by semantic similarity matching. Of course, it can also be determined from the preset knowledge retrieval enhancement database by extracting keywords and matching keywords. This embodiment does not specifically limit the method of screening and matching candidate context data.

[0064] In step S220, privacy protection processing is performed on the candidate context data to obtain target context data.

[0065] In an example embodiment of the present specification, privacy protection processing refers to processing measures for protecting privacy-sensitive data present in candidate context data. For example, privacy protection processing can be a processing process for screening candidate context data that does not meet the access rights corresponding to user question data, so that the access rights of the screened context data meet the access rights corresponding to the user question data, thereby achieving the purpose of protecting privacy-sensitive data. Of course, privacy protection processing can also be a processing process for replacing privacy-sensitive data in candidate context data, such as detecting the data structure of real privacy data in candidate context data, and replacing the corresponding real privacy data with virtual privacy data with the same data structure, so that the access rights of the replaced context data meet the access rights corresponding to the user question data, thereby achieving the purpose of protecting privacy-sensitive data.

[0066] It can be understood that privacy protection processing can also be a process of access permission screening combined with privacy-sensitive data replacement. For example, the candidate context data can be screened according to the access permissions corresponding to the user's question data, and the privacy-sensitive data in the candidate context data that does not meet the access permissions can be replaced. In this way, the leakage of privacy-sensitive data can be avoided, and the integrity of the context data input into the large language model can be guaranteed. While improving the security of privacy-sensitive data, the accuracy and reliability of the output results of the large language model can be further improved.

[0067] The target context data refers to the context data obtained after privacy protection processing is performed on the candidate context data. For example, the target context data may be the context data remaining after access screening of the candidate context data, or it may be new context data obtained after replacing privacy-sensitive data in the candidate context data. Of course, the target context data may also be a combination of the above two, and the present example embodiment is not limited to this.

[0068] In step S230, question and answer prompt data is generated based on the user question data and the target context data.

[0069] In an example embodiment of the present specification, question and answer prompt data refers to prompt data constructed based on user question data and target context data for input into a large language model to guide it to generate answer data. For example, the question and answer prompt data may be "You are a question and answer robot assistant. Please use the following retrieved context data to answer the question. If you don't know the answer, just say you don't know. The question is {user question data}, and the context data is {target context data}"; of course, the question and answer prompt data only needs to include user question data and target context data. This embodiment does not specifically limit the data structure of the question and answer prompt data.

[0070] A model question and answer prompt template for constructing question and answer prompt data can be set up in advance, and the question and answer prompt data can be obtained by filling the user question data and target context data into the model question and answer prompt template; of course, the user question data and the target context data can also be directly concatenated and embedded to obtain the question and answer prompt data input into the large language model. This embodiment does not specifically limit the method for constructing the question and answer prompt data.

[0071] In step S240, the question and answer prompt data is input into the trained large language model to obtain answer data corresponding to the user question data.

[0072] In an example embodiment of the present specification, answer data refers to the output result output by the large language model based on the input question and answer prompt data, and the output result is the reply content inferred by the large language model for the user's question data.

[0073] It can be understood that in the process of interacting with the large language model, the content visible to the user object in the graphical user interface only includes the user's question data and the answer data output by the large language model, while the question and answer prompt data is a hidden link, which is only used to guide the generation of answer data of the large language model and is invisible to the user object.

[0074] The target context data for answering the user's question data is determined through an external knowledge retrieval enhancement database, and then question and answer prompt data is generated through the user's question data and the target context data, thereby realizing knowledge retrieval enhancement of the large language model, so that the large language model can obtain answer data based on the accurate and latest knowledge retrieval enhancement database of knowledge data, effectively improving the accuracy and reliability of the answer data; after screening the candidate context data from the knowledge retrieval enhancement database, the target context data is obtained by performing privacy protection processing on the candidate context data, and then the target context data is used as question and answer prompt data, the protection of privacy-sensitive data can be achieved from the source of the data, avoiding attackers from obtaining privacy-sensitive data in the database through questions with the large language model, and effectively improving the security of privacy-sensitive data; compared with directly filtering all privacy-sensitive data in the external knowledge retrieval enhancement database, the target context data can be obtained by performing privacy protection processing on the candidate context data, and refined management of privacy-sensitive data can be achieved, avoiding data loss of target context data, and further improving the accuracy and reliability of the answer data of the large language model.

[0075] Next, step S202 and step S208 are described in detail.

[0076] In an example embodiment of the present specification, the target context data can be obtained by screening the access rights of the candidate context data, thereby implementing privacy protection processing for the candidate context data.

[0077] The access rights corresponding to the user account information of the user's question data can be matched with the access rights of each candidate context data, and the target context data that can be called by the user's question data can be filtered out through the access rights, so as to solve the leakage problem of privacy-sensitive data from the source of the data, and effectively reduce the possibility of attackers obtaining privacy-sensitive data through carefully designed questioning methods. In addition, the access rights can be used to refine the control granularity of privacy data to specific individual entries in the knowledge retrieval enhanced database, and the management and control granularity is more detailed.

[0078] Optionally, you can Figure 3 The steps in the implementation of the candidate context data to filter the access rights, to obtain the target context data. Figure 3 As shown, it may specifically include:

[0079] Step S310, determining the user access rights corresponding to the user question data;

[0080] Step S320: Match the user access permission with the data access permission corresponding to the candidate context data, and use the successfully matched candidate context data as target context data.

[0081] Among them, user access rights refer to the data of the user account information that is pre-configured to identify the user's question data and the data that can be accessed by the user. For example, user access rights can be set to level one, level two, level three, level four, and level five access rights, among which level five access rights are the highest, and higher-level access rights can be downward compatible, such as level five user access rights can access context data of level one to level five access rights; of course, user access rights can also be access rights of different roles, and user access rights can only access context data of corresponding access rights, for example, user access rights can be ordinary user access rights, administrator access rights, and minimum access rights, etc., and ordinary user access rights can only access context data that ordinary users can access. This embodiment does not specifically limit the configuration method of user access rights.

[0082] The user account information corresponding to the user question data can be obtained, and the user access rights corresponding to the user question data can be determined through the user account information; then the data access rights corresponding to each candidate context data can be obtained, and then the user access rights and data access rights can be matched to determine the target context data that the current user question data can access. For example, the user access rights and data access rights are first-level, second-level, third-level, fourth-level, and fifth-level access rights. Assuming that the user access rights are third-level access rights, the context data belonging to the first-level, second-level, and third-level data access rights in the candidate context data can be used as the target context data. Of course, this is only an illustrative example, and the present embodiment is not limited to this.

[0083] A permission management system can be pre-built to manage the user access rights of user account information corresponding to each user object, as well as the data access rights corresponding to each context data in the knowledge retrieval enhancement database. The permission management system can improve the accuracy and precision of permission management and further ensure the security of privacy-sensitive data.

[0084] Through the user access rights corresponding to the user question data and the data access rights of the context data, the privacy management of each context data in the knowledge retrieval enhanced database can be effectively implemented. By matching the user access rights and the data access rights, the protection of privacy-sensitive data can be achieved from the data source of the large language model, avoiding the possibility of attackers obtaining privacy-sensitive data by asking questions to the large language model, and effectively improving the security of privacy-sensitive data.

[0085] In an example embodiment of the present specification, privacy protection processing of candidate context data can be implemented by replacing privacy data with target context data.

[0086] The protection of privacy-sensitive data in the candidate context data can be achieved by replacing the privacy-sensitive data in the candidate context data with other data. For example, the privacy-sensitive data in the candidate context data can be replaced by empty data, or by virtual privacy-sensitive data. This embodiment does not specifically limit the method of replacing the privacy-sensitive data in the candidate context data. By replacing the privacy-sensitive data in the candidate context data with specified data, the possibility of obtaining privacy-sensitive data from a large language model by designing a question can be effectively avoided, thereby improving the security of privacy-sensitive data. At the same time, the integrity of the data structure of the context data can also be guaranteed by data replacement, avoiding the situation where the context data is incomplete due to direct deletion of privacy-sensitive data, thereby improving the accuracy and reliability of the answer data output by the large language model based on the context data to a certain extent.

[0087] Optionally, you can Figure 4 The steps in are used to replace the candidate context data with private data to obtain the target context data, including:

[0088] Step S410, identifying real private data in the candidate context data;

[0089] Step S420, acquiring virtual private data corresponding to the data structure of the real private data;

[0090] Step S430: Replace the real private data in the candidate context data with the virtual private data to obtain target context data.

[0091] Among them, real privacy data refers to privacy-sensitive data that actually exists in the candidate context data. For example, real privacy data can be personal identification privacy information in the candidate context data, such as personal email address, mobile phone number, etc.; real privacy data can be sensitive internal enterprise data in the candidate context data, such as account password, financial data, etc. This example embodiment does not specifically limit the data type of real privacy data.

[0092] Virtual privacy data refers to non-existent privacy-sensitive data that is pre-constructed with the same data structure as real privacy data. For example, taking the real privacy data as a personal mobile phone number, the data structure of the personal mobile phone number may include the network identification number from 1 to 3 digits, the area code from 4 to 7 digits, and the user identification code from 8 to 11 digits. Similarly, the data structure of the virtual privacy data is the same as the structure of the above personal mobile phone number, except that the network identification number, area code, and user identification code are virtual information, which is different from the information contained in the real personal mobile phone number.

[0093] By replacing the real privacy data in the candidate context data with virtual privacy data with the same data structure, the integrity of the data structure of the candidate context data can be guaranteed while ensuring that the privacy-sensitive data is protected, thereby avoiding the situation where the large language model cannot accurately understand the context data due to incomplete context data caused by direct deletion of privacy-sensitive data, and improving the accuracy of the answer data output by the large language model.

[0094] In an example embodiment of the present specification, candidate context data associated with the user question data can be determined based on the semantic similarity between the user question data and each context data in the knowledge retrieval enhancement database, thereby determining the candidate context data associated with the user question data from the preset knowledge retrieval enhancement database. Of course, keywords in the user question data can also be extracted, so that context data with the same keywords can be retrieved from the knowledge retrieval enhancement database based on the extracted keywords as candidate context data associated with the user question data, and the present example embodiment is not limited thereto.

[0095] Optionally, the knowledge retrieval enhancement database may include at least one or a combination of a context vector database, a knowledge search engine, and a knowledge graph. For ease of explanation, the following uses the knowledge retrieval enhancement database as a context vector database as an example.

[0096] The following steps may be used to determine candidate context data associated with the user question data according to the semantic similarity between the user question data and each context data in the knowledge retrieval enhancement database, which may specifically include:

[0097] The question embedding vector corresponding to the user question data can be determined through a pre-trained word embedding model, the semantic similarity between the question embedding vector and each context embedding vector in the context vector database can be determined, and the context embedding vectors can be sorted according to the semantic similarity, and at least one context embedding vector can be selected from the sorted context embedding vectors as candidate context data associated with the user question data.

[0098] Among them, word embedding is a technology in natural language processing (NLP) that is used to map words in a text into a low-dimensional vector space. A word embedding model refers to a pre-trained neural network model that maps text data to a specific vector space. For example, the word embedding model can be a Word2Vec model, or a term frequency-inverse document frequency model (TF-IDF). Of course, it can also be a word embedding model such as a bag-of-words model, which is not specifically limited in this example embodiment.

[0099] The context vector database refers to a database consisting of context embedding vectors obtained by embedding the collected context data in advance. By constructing a context vector database and embedding the user question data into question embedding vectors, the user question data can be retrieved by similarity with the context embedding vectors in the context vector database, which can effectively improve the retrieval efficiency of candidate context data.

[0100] The semantic similarity between the question embedding vector and each context embedding vector in the context vector database can be determined, and each context embedding vector can be sorted according to the semantic similarity. For example, the context embedding vectors can be arranged in order from large to small according to the semantic similarity, or in order from small to large according to the semantic similarity. This embodiment does not limit this. After sorting, K context data with the largest semantic similarity can be selected as candidate context data, where K can be a positive integer, and can be 3, 5, 8, etc. according to actual application conditions. This embodiment is not limited to this.

[0101] Optionally, a context vector database may be constructed by the following steps, specifically:

[0102] The pre-collected context data can be obtained, and the context data can be represented by vector embedding through a word embedding model to obtain a context embedding vector corresponding to each context data; a context vector database can be constructed through the context embedding vector.

[0103] Among them, the word embedding model for constructing the context vector database and the word embedding model for converting user question data into question embedding vectors can be the same word embedding model. By mapping the context data and user question data to the same vector space through the word embedding model, the retrieval efficiency and accuracy of matching user question data with candidate context data can be effectively improved.

[0104] In an example embodiment of the present specification, the following steps may be used to generate question and answer prompt data based on user question data and target context data, which may specifically include:

[0105] A preset model question and answer prompt template can be obtained, and user question data and target context data can be filled into the model question and answer prompt template to generate question and answer prompt data.

[0106] Among them, the model question and answer prompt template refers to a template used to generate answer data corresponding to the user question data by guiding the large language model to fuse the context data. For example, the model question and answer prompt template can be "You are a question and answer robot assistant, please use the following retrieved context data to answer the question. If you don’t know the answer, just say you don’t know; the question is {A}, the context data is {B}", "{A}" can be filled with user question data, and "{B}" can be filled with target context data. Of course, this is only an illustrative example, and this example embodiment does not specifically limit the type of model question and answer prompt template.

[0107] The model question and answer prompt template can be used to quickly generate question and answer prompt data, effectively improving the efficiency of generating question and answer prompt data. At the same time, the model question and answer prompt template can be customized according to the understanding ability of the large language model, making the generated question and answer prompt data easier to be understood by the large language model, thereby improving the accuracy of the answer data output by the large language model to a certain extent.

[0108] In an exemplary embodiment of this specification, it is possible to Figure 5 To protect privacy-sensitive data, refer to Figure 5 As shown, it may specifically include:

[0109] Step S510, determining the question type corresponding to the user question data;

[0110] Step S520: if it is detected that the question type is an offensive question, then counting the user account information corresponding to the user question data;

[0111] Step S530: in response to detecting that the counted number of offensive questions of the user account information exceeds a preset number of offensive questions, the user access rights of the user account information are updated to the minimum access rights.

[0112] Among them, the question type refers to a pre-set classification type for identifying the intention of the user's question data. For example, the question type may include aggressive questions for asking privacy-sensitive data and normal questions for asking ordinary questions. This embodiment does not specifically limit the classification method of question types.

[0113] When it is detected that the question type of the current user question data is an offensive question, the user account information corresponding to the user question data can be counted. If it is detected that the count number of offensive questions of the user account information exceeds the preset number of offensive questions, it can be considered that the question corresponding to the user account information is an offensive behavior, and the user access permission of the user account information can be updated to the minimum access permission.

[0114] By updating the user access rights of user account information with attacking behavior to the minimum access rights, context data containing privacy-sensitive data can be screened out when matching target context data, further improving the security of privacy-sensitive data in the knowledge retrieval enhancement database.

[0115] Figure 6 A flowchart of a knowledge retrieval enhancement method for implementing privacy protection of a large language model provided in an embodiment of this specification.

[0116] refer to Figure 6As shown, step S610, obtains the user question data input by the front end, and retrieves the TopN candidate context data most relevant to the user question data from the external knowledge retrieval enhancement database; step S620, queries the user access rights corresponding to the user question data from the permission management system; step S630, filters out the target context data to which the user has access rights from the candidate context data; step S640, fills the filtered target context data and user question data into the model question and answer prompt template to obtain question and answer prompt data; step S650, inputs the question and answer prompt data into the trained large language model, obtains the answer data corresponding to the user question data, and displays the answer data to the front end.

[0117] To summarize, according to the knowledge retrieval enhanced privacy protection method in the embodiments of this specification, by receiving user question data, candidate context data associated with the user question data is determined from an external knowledge retrieval enhanced database, and privacy protection processing is performed on the candidate context data to obtain target context data; then, based on the user question data and the target context data, question and answer prompt data is generated, and finally the question and answer prompt data is input into the trained large language model to obtain answer data corresponding to the user question data. On the one hand, the target context data for answering the user's question data is determined through an external knowledge retrieval enhancement database, and then the question and answer prompt data is generated through the user's question data and the target context data, thereby realizing the knowledge retrieval enhancement of the large language model, so that the large language model can obtain the answer data according to the accurate and latest knowledge retrieval enhancement database of the knowledge data, effectively improving the accuracy and reliability of the answer data; on the other hand, after screening the candidate context data from the knowledge retrieval enhancement database, the target context data is obtained by performing privacy protection processing on the candidate context data, and then the target context data is used as the question and answer prompt data, which can realize the protection of privacy-sensitive data from the source of the data, avoid the attacker from obtaining the privacy-sensitive data in the database through the questions with the large language model, and effectively improve the security of the privacy-sensitive data; on the other hand, compared with directly filtering all the privacy-sensitive data in the external knowledge retrieval enhancement database, the candidate context data is processed for privacy protection to obtain the target context data, which can realize the refined management of privacy-sensitive data, avoid the data loss of the target context data, and further improve the accuracy and reliability of the answer data of the large language model.

[0118] In addition, the embodiments of this specification also provide a privacy protection system for knowledge retrieval enhancement. Figure 7 As shown, the knowledge retrieval enhanced privacy protection system 700 may include a graphical user interface 710, a knowledge retrieval enhanced database 720, a privacy authority management device 730, a model question and answer prompt device 740, and a large language model 750:

[0119] Graphical user interface 710, used to obtain input user question data;

[0120] A knowledge retrieval enhancement database 720, for determining candidate context data according to the semantic similarity between the user question data and each stored context data;

[0121] A privacy authority management device 730 is used to perform privacy protection processing on the candidate context data to obtain target context data;

[0122] Model question and answer prompting means 740, for generating question and answer prompting data based on the user question data and the target context data;

[0123] The large language model 750 is used to output answer data corresponding to the user question data according to the input question and answer prompt data, and display the answer data on the graphical user interface 710.

[0124] In an example embodiment of the present specification, the privacy rights management device is configured to: perform access rights screening on the candidate context data to obtain target context data. Specifically, performing access rights screening on the candidate context data to obtain target context data includes determining the user access rights corresponding to the user question data; matching the user access rights with the data access rights corresponding to the candidate context data, and using the successfully matched candidate context data as the target context data.

[0125] In an example embodiment of the present specification, the privacy rights management device is configured to: replace the candidate context data with privacy data to obtain target context data. Specifically, the candidate context data is screened for access rights to obtain the target context data, including identifying the real privacy data in the candidate context data; obtaining virtual privacy data corresponding to the data structure of the real privacy data; and replacing the real privacy data in the candidate context data with the virtual privacy data to obtain the target context data.

[0126] In an example embodiment of the present specification, the knowledge retrieval enhancement database is configured to: determine the candidate context data associated with the user question data based on the semantic similarity between the user question data and each stored context data. Specifically, the knowledge retrieval enhancement database includes a context vector database; the determination of the candidate context data associated with the user question data based on the semantic similarity between the user question data and each context data in the knowledge retrieval enhancement database includes determining the question embedding vector corresponding to the user question data through a pre-trained word embedding model; determining the semantic similarity between the question embedding vector and each context embedding vector in the context vector database, and sorting each context embedding vector according to the semantic similarity; and selecting at least one context embedding vector from the sorted context embedding vectors as the candidate context data associated with the user question data.

[0127] In an example embodiment of the present specification, the knowledge retrieval enhanced database is configured to: obtain pre-collected context data; perform vector embedding representation on the context data through the word embedding model to obtain the context embedding vector corresponding to each context data; and construct the context vector database through the context embedding vector.

[0128] In an example embodiment of the present specification, the model question and answer prompt device is configured to: obtain a preset model question and answer prompt template; fill the user question data and the target context data into the model question and answer prompt template to generate the question and answer prompt data.

[0129] In an example embodiment of the present specification, the privacy rights management device is configured to: determine the question type corresponding to the user question data; if the question type is detected to be an offensive question, count the user account information corresponding to the user question data; in response to detecting that the count number of offensive questions asked by the user account information exceeds a preset number of offensive questions, update the user access rights of the user account information to the minimum access rights.

[0130] The above system embodiments correspond to the method embodiments. For specific descriptions, please refer to the description of the method embodiments, which will not be repeated here. The system embodiments are obtained based on the corresponding method embodiments and have the same technical effects as the corresponding system embodiments. For specific descriptions, please refer to the corresponding method embodiments.

[0131] See also Figure 8 , is a schematic diagram of the structure of a knowledge retrieval enhanced privacy protection device provided in an embodiment of this specification. Figure 8As shown, the knowledge retrieval enhanced privacy protection device 800 can be implemented as all or part of an electronic device through software, hardware, or a combination of both. According to some embodiments, the knowledge retrieval enhanced privacy protection device 800 includes a context data matching module 810, a context data screening module 820, a question and answer prompt generation module 830, and a model answer module 840, which may specifically include:

[0132] A context data matching module 810 is used to receive user question data and determine candidate context data associated with the user question data from a preset knowledge retrieval enhancement database;

[0133] A context data screening module 820 is used to perform privacy protection processing on the candidate context data to obtain target context data;

[0134] A question and answer prompt generating module 830, configured to generate question and answer prompt data based on the user question data and the target context data;

[0135] The model answering module 840 is used to input the question and answer prompt data into the trained large language model to obtain the answer data corresponding to the question data.

[0136] In an optional embodiment of the present specification, the context data screening module 820 includes an access permission screening unit, and the access permission screening unit is configured to:

[0137] Access permission screening is performed on the candidate context data to obtain target context data.

[0138] In an optional embodiment of the present specification, the access permission screening unit is configured as follows:

[0139] Determine the user access rights corresponding to the user question data;

[0140] The user access permission is matched with the data access permission corresponding to the candidate context data, and the successfully matched candidate context data is used as the target context data.

[0141] In an optional embodiment of the present specification, the context data screening module 820 includes a privacy data replacement unit, and the privacy data replacement unit is configured to:

[0142] The candidate context data is replaced with privacy data to obtain target context data.

[0143] In an optional embodiment of the present specification, the privacy data replacement unit is configured as follows:

[0144] identifying real private data in the candidate context data;

[0145] Acquire virtual private data corresponding to the data structure of the real private data;

[0146] The real private data in the candidate context data is replaced by the virtual private data to obtain target context data.

[0147] In an optional embodiment of the present specification, the context data matching module 810 further includes a candidate context data determination module, which is configured to:

[0148] The candidate context data associated with the user question data is determined according to the semantic similarity between the user question data and each context data in the knowledge retrieval enhancement database.

[0149] In an optional embodiment of the present specification, the knowledge retrieval enhancement database includes a context vector database; the candidate context data determination module is configured to:

[0150] Determine a question embedding vector corresponding to the user question data through a pre-trained word embedding model;

[0151] Determining the semantic similarity between the question embedding vector and each context embedding vector in the context vector database, and sorting the context embedding vectors according to the semantic similarity;

[0152] At least one context embedding vector is selected from the sorted context embedding vectors as candidate context data associated with the user question data.

[0153] In an optional embodiment of the present specification, the knowledge retrieval enhanced privacy protection device 800 further includes a context vector database construction module, and the context vector database construction module is configured as follows:

[0154] Get pre-collected context data;

[0155] Performing vector embedding representation on the context data through the word embedding model to obtain the context embedding vector corresponding to each context data;

[0156] The context vector database is constructed by using the context embedding vectors.

[0157] In an optional embodiment of the present specification, the question and answer prompt generating module 830 is configured to:

[0158] Get the preset model question and answer prompt template;

[0159] The user question data and the target context data are filled into the model question and answer prompt template to generate the question and answer prompt data.

[0160] In an optional embodiment of the present specification, the knowledge retrieval enhanced privacy protection device 800 further includes an attack question identification module, and the attack question identification module is configured to:

[0161] Determine the question type corresponding to the user question data;

[0162] If it is detected that the question type is an offensive question, counting the user account information corresponding to the user question data;

[0163] In response to detecting that the counted number of offensive questions of the user account information exceeds a preset number of offensive questions, the user access rights of the user account information are updated to a minimum access right.

[0164] The above device embodiments correspond to the method embodiments. For specific descriptions, please refer to the description of the method embodiments, which will not be repeated here. The device embodiments are obtained based on the corresponding method embodiments and have the same technical effects as the corresponding method embodiments. For specific descriptions, please refer to the corresponding method embodiments.

[0165] The embodiments of this specification also provide a computer storage medium, which can store multiple instructions. The instructions are suitable for being loaded by a processor and executing the knowledge retrieval enhanced privacy protection method recorded in the embodiments of this specification. The specific execution process can be found in the specific description of the knowledge retrieval enhanced privacy protection method embodiment, which will not be repeated here.

[0166] This specification also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded by a processor to execute the knowledge retrieval enhanced privacy protection method described in the embodiments of this specification. The specific execution process can be found in the specific description of the knowledge retrieval enhanced privacy protection method embodiment, which will not be repeated here.

[0167] The embodiments of this specification also provide Fig. 9 The structural diagram of the electronic device shown in FIG. Fig. 9 At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the above-mentioned voice activity detection method.

[0168] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the executor of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0169] For the improvement of a technology, it can be clearly distinguished whether it is a hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or a software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0170] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.

[0171] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0172] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0173] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0174] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0175] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0176] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0177] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0178] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0179] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0180] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0181] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0182] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0183] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0184] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.

Claims

1. A privacy protection method for knowledge retrieval enhancement, the method comprising: Receive user question data, and determine candidate context data associated with the user question data from a preset knowledge retrieval enhancement database; Replacing the real privacy data that does not comply with the access rights obtained by screening the candidate context data according to the user access rights corresponding to the user account information of the user question data with at least one of empty data and virtual privacy data having the same data structure, so as to perform privacy protection processing on the candidate context data and obtain target context data; Based on the user question data and the target context data, embedding into a preset model question and answer prompt template to generate question and answer prompt data; wherein the model question and answer prompt template refers to a template for generating and guiding a large language model to fuse context data and output answer data corresponding to the user question data; Inputting the question and answer prompt data into the trained large language model to obtain answer data corresponding to the user question data; If it is detected that the question type corresponding to the user question data for identifying the intention of the user question data is an offensive question, and the count number of offensive questions of the user account information exceeds the preset number of offensive questions, the user access permission corresponding to the user account information is updated to the minimum access permission.

2. According to the privacy protection method for knowledge retrieval enhancement according to claim 1, the step of performing privacy protection processing on the candidate context data to obtain target context data comprises: Access permission screening is performed on the candidate context data to obtain target context data.

3. The method for enhancing privacy protection for knowledge retrieval according to claim 2, wherein the step of screening the candidate context data for access rights to obtain the target context data comprises: Determine the user access rights corresponding to the user question data; The user access permission is matched with the data access permission corresponding to the candidate context data, and the successfully matched candidate context data is used as the target context data.

4. According to the privacy protection method for knowledge retrieval enhancement according to claim 1, the step of performing privacy protection processing on the candidate context data to obtain target context data comprises: The candidate context data is replaced with privacy data to obtain target context data.

5. According to the privacy protection method for knowledge retrieval enhancement according to claim 4, the step of replacing the candidate context data with privacy data to obtain target context data comprises: identifying real private data in the candidate context data; Acquire virtual private data corresponding to the data structure of the real private data; The real private data in the candidate context data is replaced by the virtual private data to obtain target context data.

6. The privacy protection method for enhanced knowledge retrieval according to claim 1, wherein the step of determining candidate context data associated with the user question data from a preset enhanced knowledge retrieval database comprises: The candidate context data associated with the user question data is determined according to the semantic similarity between the user question data and each context data in the knowledge retrieval enhancement database.

7. The privacy protection method for enhanced knowledge retrieval according to claim 6, wherein the enhanced knowledge retrieval database comprises a context vector database; and the step of determining the candidate context data associated with the user question data according to the semantic similarity between the user question data and each context data in the enhanced knowledge retrieval database comprises: Determine a question embedding vector corresponding to the user question data through a pre-trained word embedding model; Determining the semantic similarity between the question embedding vector and each context embedding vector in the context vector database, and sorting the context embedding vectors according to the semantic similarity; At least one context embedding vector is selected from the sorted context embedding vectors as candidate context data associated with the user question data.

8. The method for enhancing privacy protection for knowledge retrieval according to claim 7, further comprising: Get pre-collected context data; Performing vector embedding representation on the context data through the word embedding model to obtain the context embedding vector corresponding to each context data; The context vector database is constructed by using the context embedding vectors.

9. The privacy protection method for enhanced knowledge retrieval according to claim 1, wherein generating question and answer prompt data based on the user question data and the target context data comprises: Get the preset model question and answer prompt template; The user question data and the target context data are filled into the model question and answer prompt template to generate the question and answer prompt data.

10. The method for enhancing privacy protection of knowledge retrieval according to claim 1, further comprising: Determine the question type corresponding to the user question data; If it is detected that the question type is an offensive question, counting the user account information corresponding to the user question data; In response to detecting that the counted number of offensive questions of the user account information exceeds a preset number of offensive questions, the user access rights of the user account information are updated to a minimum access right.

11. A knowledge retrieval enhanced privacy protection device, the device comprising: A context data matching module, used for receiving user question data and determining candidate context data associated with the user question data from a preset knowledge retrieval enhancement database; a context data screening module, configured to replace the real privacy data that does not comply with the access rights obtained by screening the candidate context data according to the user access rights corresponding to the user account information of the user question data with at least one of empty data and virtual privacy data having the same data structure, so as to perform privacy protection processing on the candidate context data and obtain target context data; A question and answer prompt generation module is used to embed the user question data and the target context data into a preset model question and answer prompt template to generate question and answer prompt data; wherein the model question and answer prompt template refers to a template for generating answer data corresponding to the user question data by guiding the large language model to fuse the context data; A model answering module, used to input the question and answer prompt data into a trained large language model to obtain answer data corresponding to the question data; The attack question identification module is used to update the user access permission corresponding to the user account information to the minimum access permission if it is detected that the question type corresponding to the user question data for identifying the intention of the user question data is an offensive question, and the count number of offensive questions of the user account information exceeds a preset number of offensive questions.

12. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

13. An electronic device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the method as claimed in any one of claims 1 to 10.

14. A computer program product having at least one instruction stored thereon, characterized in that: When the at least one instruction is executed by the processor, the steps of the method described in any one of claims 1 to 10 are implemented.

15. A knowledge retrieval enhanced privacy protection system, the system comprising: A graphical user interface for obtaining input user question data; A knowledge retrieval enhancement database, used to determine candidate context data according to the semantic similarity between the user question data and each stored context data; a privacy rights management device, configured to replace the real privacy data that does not comply with the access rights obtained by screening the candidate context data according to the user access rights corresponding to the user account information of the user question data with at least one of empty data and virtual privacy data having the same data structure, so as to perform privacy protection processing on the candidate context data and obtain target context data; If it is detected that the question type corresponding to the user question data and used to identify the intention of the user question data is an offensive question, and the count number of offensive questions of the user account information exceeds the preset number of offensive questions, the user access right corresponding to the user account information is updated to the minimum access right; A model question and answer prompt device, which is used to embed a preset model question and answer prompt template based on the user question data and the target context data to generate question and answer prompt data; wherein the model question and answer prompt template refers to a template for generating and guiding a large language model to fuse context data and output answer data corresponding to the user question data; The large language model is used to output answer data corresponding to the user question data according to the input question and answer prompt data.

Citation Information

Patent Citations

  • Intelligent conversation privacy protection method and device, equipment and storage medium

    CN116775837A

  • Private data management method and system based on big data

    CN117332452A

  • Knowledge base privacy protection method and device, terminal equipment and storage medium

    CN118069803A