A knowledge retrieval system, method, device, storage medium and electronic device

By storing preset questions and encrypted answers in the database of the knowledge retrieval system, and using these information as a prompt when LLM querying, it solves the problem of inaccurate answers to LLM in unpopular professional fields, improves the accuracy of knowledge retrieval and ensures information security.

CN118779440BActive Publication Date: 2025-03-11ANT GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411277313.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2025-03-11
Estimated Expiration
2044-09-12

AI Technical Summary

Technical Problem

In the prior art, LLM may give incorrect answers when dealing with unpopular and highly professional fields, reducing the accuracy of knowledge retrieval.

Method used

Provides a knowledge retrieval system, including a proxy server, a database and LLM. The system stores preset questions and encrypted preset answers in the database, and uses these preset information as prompts when users query, to improve the accuracy of LLM's answers.

Benefits of technology

By using preset questions and answers as prompt information, LLM's answer accuracy in unpopular professional fields is improved, and the information security of tenants is protected through encryption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779440B_ABST
    Figure CN118779440B_ABST
Patent Text Reader

Abstract

The embodiments of this specification disclose a knowledge retrieval system, method, device, storage medium and electronic device, which belong to the field of computer technology. The method stores preset questions and preset answers set by itself in a database and encrypts the answers. When a user uses the tenant's question and answer service, the tenant's proxy server retrieves the preset questions related to the user's real-time questions and their corresponding ciphertext preset answers from the database, and then decrypts them to obtain the plaintext preset answers. The user's real-time questions are input into the LLM, and the preset questions and plaintext preset answers are also input into the LLM as prompt information, so that the LLM generates real-time answers corresponding to the real-time questions according to the prompt information, which can not only improve the accuracy of knowledge retrieval, but also ensure the information security of the preset questions and preset answers set by each tenant.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present specification relates to the field of computer technology, and in particular to a knowledge retrieval system, method, device, storage medium and electronic device. Background Art

[0002] At present, with the development of Large Language Model (LLM), more and more people have begun to use LLM as an auxiliary tool.

[0003] In order to facilitate more users to use LLM, some enterprises (hereinafter referred to as tenants) use their own proxy servers to connect to the LLM provided by the LLM provider, and provide LLM service interfaces to the outside world. Users can ask questions to LLM through the LLM service interface provided by the tenant, and LLM will return the answers to the users through the tenant's proxy server to realize question-and-answer knowledge retrieval services.

[0004] However, for some unpopular and highly professional fields, due to the training iteration cost of LLM and the limitations of the knowledge base, LLM may give incorrect answers, reducing the accuracy of knowledge retrieval. Summary of the invention

[0005] The embodiments of this specification provide a knowledge retrieval system, method, device, storage medium and electronic device to partially solve the problems existing in the above-mentioned prior art.

[0006] The embodiments of this specification adopt the following technical solutions:

[0007] This specification provides a knowledge retrieval system, the system comprising: a proxy server, a database, a large language model LLM;

[0008] The database is used to store preset questions and encrypted preset answers corresponding to the preset questions;

[0009] The proxy server is used to receive a real-time question sent by a user, and according to the real-time question, retrieve a preset question related to the real-time question from the database as a prompt question, and retrieve an encrypted preset answer corresponding to the prompt question from the database as a ciphertext prompt answer; decrypt the ciphertext prompt answer using a pre-stored key to obtain a plaintext prompt answer; send the real-time question and prompt information of the real-time question to the LLM; the prompt information includes the prompt question and the plaintext prompt answer;

[0010] The LLM is used to generate a real-time answer corresponding to the real-time question according to the received real-time question and the prompt information, and return the answer to the proxy server;

[0011] The proxy server is further configured to return the real-time answer to the user.

[0012] Optionally, the database is deployed in the cloud;

[0013] Different tenants use different proxy servers;

[0014] Different tenants all use the database, and the preset questions and encrypted preset answers stored in the database are pre-stored in the database by each tenant.

[0015] Optionally, the database is further used to generate different public-private key pairs for different tenants, and allocate each public-private key pair to a corresponding tenant;

[0016] For each tenant, the encrypted preset answer of the tenant stored in the database is encrypted using the public key of the tenant.

[0017] Optionally, the proxy server is specifically configured to decrypt the ciphertext prompt answer using a pre-stored private key.

[0018] This specification provides a knowledge retrieval method, which is applied to a proxy server and includes:

[0019] Receive real-time questions sent by users;

[0020] According to the real-time question, a preset question related to the real-time question is retrieved from a database as a prompt question, and an encrypted preset answer corresponding to the prompt question is retrieved from the database as a ciphertext prompt answer;

[0021] Decrypting the ciphertext prompt answer using a pre-stored key to obtain a plaintext prompt answer;

[0022] Sending the real-time question and prompt information of the real-time question to a large language model LLM, wherein the prompt information includes the prompt question and the plaintext prompt answer;

[0023] The real-time answer generated and returned by the LLM based on the real-time question and the prompt information is received, and the real-time answer is returned to the user.

[0024] Optionally, before retrieving preset questions related to the real-time question from the database, the method further includes:

[0025] Receiving preset questions and preset answers corresponding to the preset questions sent by the tenant;

[0026] Encrypting the preset answer using a pre-stored public key to obtain an encrypted preset answer;

[0027] The preset questions and the encrypted preset answers are uploaded to the database for storage.

[0028] Optionally, before encrypting the preset answer using a pre-stored public key, the method further includes:

[0029] Receive a public-private key pair allocated by the database to the tenant.

[0030] Optionally, decrypting the ciphertext prompt answer using a pre-stored key specifically includes:

[0031] The ciphertext prompt answer is decrypted using the pre-stored private key corresponding to the public key.

[0032] This specification provides a knowledge retrieval method, which is applied to a database and includes:

[0033] In response to a search request sent by the proxy server, a preset question related to the real-time question carried in the search request is retrieved from pre-stored preset questions as a prompt question, and an encrypted preset answer corresponding to the prompt question is retrieved from pre-stored encrypted preset answers as a ciphertext prompt answer; wherein the search request is sent by the proxy server after receiving the real-time question sent by the user;

[0034] The prompt question and the ciphertext prompt answer are returned to the proxy server, so that the proxy server decrypts the ciphertext prompt answer to obtain a plaintext prompt answer, and sends the real-time question and the prompt information of the real-time question to the large language model LLM to obtain the real-time answer returned by the LLM, and returns the real-time answer to the user; wherein the prompt information includes the prompt question and the plaintext prompt answer.

[0035] Optionally, before retrieving the preset question related to the real-time question carried in the search request, the method further includes:

[0036] Generate a public-private key pair for the tenant corresponding to the proxy server;

[0037] The private key in the public-private key pair is sent to the proxy server for storage.

[0038] Optionally, before retrieving the preset question related to the real-time question carried in the search request, the method further includes:

[0039] Receiving preset questions and preset answers corresponding to the preset questions uploaded by the tenant through the proxy server;

[0040] Using the public key in the public-private key pair to encrypt the preset answer to obtain an encrypted preset answer;

[0041] The preset question and the encrypted preset answer are associated and stored.

[0042] This specification provides a knowledge retrieval device, the device comprising:

[0043] A receiving module is used to receive real-time questions sent by users;

[0044] A prompt retrieval module is used to retrieve a preset question related to the real-time question from a database according to the real-time question as a prompt question, and retrieve an encrypted preset answer corresponding to the prompt question from the database as a ciphertext prompt answer;

[0045] A decryption module, used to decrypt the ciphertext prompt answer using a pre-stored key to obtain a plaintext prompt answer;

[0046] A knowledge retrieval module, used for sending the real-time question and the prompt information of the real-time question to the large language model LLM, wherein the prompt information includes the prompt question and the plain text prompt answer;

[0047] The sending module is used to receive the real-time answer generated and returned by the LLM based on the real-time question and the prompt information, and return the real-time answer to the user.

[0048] This specification provides a knowledge retrieval device, the device comprising:

[0049] A retrieval module is used to respond to a retrieval request sent by the proxy server, retrieve a preset question related to the real-time question carried in the retrieval request from pre-stored preset questions as a prompt question, and retrieve an encrypted preset answer corresponding to the prompt question from pre-stored encrypted preset answers as a ciphertext prompt answer; wherein the retrieval request is sent by the proxy server after receiving the real-time question sent by the user;

[0050] A sending module is used to return the prompt question and the ciphertext prompt answer to the proxy server, so that the proxy server decrypts the ciphertext prompt answer to obtain a plaintext prompt answer, and sends the real-time question and the prompt information of the real-time question to the large language model LLM, obtains the real-time answer returned by the LLM, and returns the real-time answer to the user; wherein the prompt information includes the prompt question and the plaintext prompt answer.

[0051] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned knowledge retrieval method is implemented.

[0052] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned knowledge retrieval method when executing the program.

[0053] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects:

[0054] The embodiment of this specification discloses a knowledge retrieval method. In this method, tenants store preset questions and preset answers set by themselves in a database and encrypt the answers. When a user uses the tenant's question and answer service, the tenant's proxy server retrieves the preset questions related to the user's real-time questions and their corresponding ciphertext preset answers from the database, and then decrypts them to obtain the plaintext preset answers. The user's real-time questions are input into the LLM, and the preset questions and plaintext preset answers are also input into the LLM as prompt information, so that the LLM generates real-time answers corresponding to the real-time questions according to the prompt information. This can not only improve the accuracy of knowledge retrieval, but also ensure the information security of the preset questions and preset answers set by each tenant. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:

[0056] Figure 1 A schematic diagram of a knowledge retrieval process provided in an embodiment of this specification;

[0057] Figure 2 A schematic diagram and flow chart of the first knowledge retrieval device provided in the embodiments of this specification;

[0058] Figure 3 A schematic diagram and flow chart of a second knowledge retrieval device provided in an embodiment of this specification;

[0059] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0060] 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.

[0061] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0062] An embodiment of the present specification provides a knowledge retrieval system, which includes a proxy server, a database and an LLM. The system is designed to enable tenants to store preset questions and preset answers set by themselves in the database. When a user uses the tenant's question and answer function, the relevant preset questions and preset answers stored in the database are used as prompt information for the user's real-time questions and are input into the LLM together with the real-time questions, so that the LLM generates answers corresponding to the real-time questions based on the prompt information, thereby enhancing knowledge retrieval and improving the accuracy of knowledge retrieval.

[0063] Based on the above system, the embodiment of this specification provides a method for knowledge retrieval, such as Figure 1 shown.

[0064] Figure 1 A schematic diagram of a knowledge retrieval process provided in this specification may specifically include the following steps:

[0065] S100: The proxy server receives a real-time question sent by a user.

[0066] In the embodiment of this specification, the proxy server is a proxy server used by a tenant, and different tenants use different proxy servers.

[0067] The database is used by tenants to store their preset questions and encrypted preset answers. The database can be deployed in the cloud, so different tenants can use the same database deployed in the cloud, that is, different tenants can store their own preset questions and encrypted preset answers in the database deployed in the cloud.

[0068] For a tenant, when the tenant provides question-and-answer services to users, the users can send questions, that is, real-time questions, to the tenant's proxy server through their own terminals (such as mobile phones, computers, etc.).

[0069] S102: Send a search request to the database.

[0070] After receiving the real-time question sent by the user, the proxy server may generate a search request carrying the real-time question and send it to the database.

[0071] S104: Retrieve preset questions related to the real-time question carried in the search request from pre-stored preset questions as prompt questions.

[0072] The database retrieves preset questions related to the real-time question from the preset questions pre-stored by the tenant as prompt questions.

[0073] Specifically, the database described in the embodiments of this specification may be a vector database, and the preset questions stored by the tenant in the database may be encoded, vectorized preset questions, that is, the vectors corresponding to the preset questions. Thus, when the database retrieves preset questions related to real-time questions, it may encode the real-time questions to obtain the vectors corresponding to the real-time questions, and then retrieve the vectors corresponding to one or more preset questions that are closest in similarity to the vector corresponding to the real-time question from the vectors corresponding to the preset questions pre-stored by the tenant, and use the preset questions corresponding to the retrieved vectors as prompt questions.

[0074] The above-mentioned method for encoding preset questions and real-time questions can be any encoding method as long as the characters in the question can be encoded into a vector, but the method for encoding the preset questions and the real-time questions needs to be the same.

[0075] S106: Retrieving the encrypted preset answer corresponding to the prompt question from the pre-stored encrypted preset answers as the ciphertext prompt answer.

[0076] After the database retrieves the preset questions related to the user's real-time questions and uses them as prompt questions, the preset answers corresponding to each prompt question can be retrieved from the preset answers pre-stored by the tenant.

[0077] It should be noted that since the database in the embodiments of this specification is deployed in the cloud for common use by multiple tenants, the same tenant can directly read the preset questions and preset answers uploaded and stored by other tenants from the database. In addition, the cloud service provider providing the cloud can also directly read the preset questions and preset answers uploaded and stored by any tenant from the database, which may reduce the information security of the tenant's privacy data or sensitive data. Therefore, in order to improve the information security of tenants, in the embodiments of this specification, tenants can encrypt their preset answers, and then upload and store the preset questions and the corresponding encrypted preset answers in the database. Therefore, after the database retrieves the prompt question, it can only retrieve the encrypted preset answer corresponding to the prompt question as the ciphertext prompt answer.

[0078] S108: Return the prompt question and the ciphertext prompt answer to the proxy server.

[0079] S110: The proxy server uses a pre-stored key to decrypt the ciphertext prompt answer to obtain a plaintext prompt answer.

[0080] After the database retrieves the prompt question and its corresponding ciphertext prompt answer, the prompt question and the ciphertext prompt answer can be returned to the tenant's proxy server.

[0081] The proxy server uses the pre-stored key to decrypt the ciphertext prompt answer and obtain the corresponding plaintext prompt answer.

[0082] S112: Send the real-time question and the prompt information of the real-time question to the large language model LLM, wherein the prompt information includes the prompt question and the plain text prompt answer.

[0083] S114: LLM generates and returns a real-time answer based on the real-time question and the prompt information.

[0084] After obtaining the prompt question and the plain text prompt answer, the proxy server can use the prompt question and the plain text prompt answer as prompt information and send the user's real-time question and prompt information to the LLM. The LLM can generate a real-time answer corresponding to the user's real-time question under the prompt information.

[0085] Since the prompt questions and prompt answers are essentially preset questions and preset answers that tenants have stored in the database in advance, tenants can decide the questions and answers to use as prompt information. Furthermore, for some unpopular and highly professional fields, there is no need to train the LLM. Tenants can directly store the preset questions and preset answers (encrypted) in the field in the database as prompt information, so that the LLM can generate more accurate real-time answers in the field.

[0086] S116: The proxy server returns the real-time answer to the user.

[0087] Through the above method, the tenant stores the preset questions and preset answers set by himself in the database, and encrypts the answers. When the user uses the tenant's question-and-answer service, the tenant's proxy server retrieves the preset questions related to the user's real-time questions and their corresponding ciphertext preset answers from the database, and then decrypts them to obtain the plaintext preset answers. The user's real-time questions are input into the LLM, and the preset questions and plaintext preset answers are also input into the LLM as prompt information, so that the LLM generates the real-time answers corresponding to the real-time questions according to the prompt information, so that there is no need to train the LLM. The tenant can directly store the preset questions and preset answers (encrypted) in the required fields in the database as prompt information, so that the LLM generates more accurate real-time answers in the field. Moreover, when multiple tenants share a database deployed in the cloud, the embodiment of this specification also encrypts the preset answers stored by the tenants. Therefore, even if the preset answers stored by one tenant are read by other tenants or cloud service providers, they cannot be decrypted to obtain the plaintext preset answers, which improves the information security and privacy of the tenants.

[0088] Furthermore, since the tenants in the embodiment of this specification need to encrypt the preset answers and store them in the database, the database can generate different keys for different tenants in advance. In order to further improve the information security of the tenants, the embodiment of this specification adopts an asymmetric encryption method, that is, the database generates different public-private key pairs for different tenants in advance, and distributes each public-private key pair to the corresponding tenant.

[0089] The tenant can store the public key in his own proxy server, and the database can also directly send the public-private key pair generated for the tenant to the proxy server for storage. When the tenant uploads the preset questions and preset answers to the database, he can first send the preset questions and preset answers to the proxy server. The proxy server receives the preset questions and preset answers corresponding to the preset questions sent by the tenant, and encrypts the preset answers using the pre-stored public key to obtain the encrypted preset answers, and uploads the preset questions and the encrypted preset answers to the database for storage. Subsequently, the proxy server sends the user's real-time questions to the database, retrieves the preset questions related to the real-time questions and the encrypted preset answers corresponding to the preset questions from the database, and the proxy server can use the private key in the public-private key pair to decrypt the encrypted preset answers to obtain the plaintext prompt answers.

[0090] Alternatively, after the database generates a public-private key pair for the tenant, it may only send the private key to the proxy server for storage, and store the public key locally in the database. Then, when the tenant uploads the preset question and the preset answer to the database, the tenant may first send the preset question and the preset answer to the proxy server, and the proxy server sends the preset question and the preset answer to the database. The database uses the public key pre-stored for the tenant to encrypt the preset answer, obtains the encrypted preset answer, and then stores the preset question and the encrypted preset answer in association.

[0091] The above is a knowledge retrieval method and system provided in the embodiments of this specification. Based on the same idea, this specification also provides corresponding devices, storage media and electronic devices.

[0092] Figure 2 The first knowledge retrieval device provided in the embodiment of this specification is a schematic diagram and a flow chart. The first knowledge retrieval device can be located in the proxy server of the tenant, and the device includes:

[0093] Receiving module 201, used for receiving real-time questions sent by users;

[0094] A prompt retrieval module 202 is used to retrieve, according to the real-time question, a preset question related to the real-time question from a database as a prompt question, and retrieve an encrypted preset answer corresponding to the prompt question from the database as a ciphertext prompt answer;

[0095] Decryption module 203, used to decrypt the ciphertext prompt answer using a pre-stored key to obtain a plaintext prompt answer;

[0096] A knowledge retrieval module 204, configured to send the real-time question and prompt information of the real-time question to a large language model LLM, wherein the prompt information includes the prompt question and the plain text prompt answer;

[0097] The sending module 205 is used to receive the real-time answer generated and returned by the LLM based on the real-time question and the prompt information, and return the real-time answer to the user.

[0098] Optionally, the receiving module 201 is also used to, before retrieving preset questions related to the real-time questions from the database, receive preset questions and preset answers corresponding to the preset questions sent by the tenants, encrypt the preset answers using a pre-stored public key to obtain the encrypted preset answers, and upload the preset questions and the encrypted preset answers to the database for storage.

[0099] Optionally, the receiving module 201 is further configured to receive a public-private key pair allocated by the database to the tenant before using a pre-stored public key to encrypt the preset answer.

[0100] Optionally, the decryption module 203 is specifically configured to decrypt the ciphertext prompt answer using a pre-stored private key corresponding to the public key.

[0101] Figure 3 The second knowledge retrieval device provided in the embodiment of this specification is a schematic diagram and a flow chart. The second knowledge retrieval device may be located in a database, and the device includes:

[0102] The retrieval module 301 is used to respond to the retrieval request sent by the proxy server, retrieve the preset questions related to the real-time question carried in the retrieval request from the pre-stored preset questions as the prompt question, and retrieve the encrypted preset answers corresponding to the prompt question from the pre-stored encrypted preset answers as the ciphertext prompt answer; wherein the retrieval request is sent by the proxy server after receiving the real-time question sent by the user;

[0103] The sending module 302 is used to return the prompt question and the ciphertext prompt answer to the proxy server, so that the proxy server decrypts the ciphertext prompt answer to obtain a plaintext prompt answer, and sends the real-time question and the prompt information of the real-time question to the large language model LLM, obtains the real-time answer returned by the LLM, and returns the real-time answer to the user; wherein the prompt information includes the prompt question and the plaintext prompt answer.

[0104] Optionally, the device further comprises:

[0105] The key distribution module 303 is used to generate a public-private key pair for the tenant corresponding to the proxy server before the retrieval module 301 retrieves the preset questions related to the real-time questions carried in the retrieval request, and send the private key in the public-private key pair to the proxy server for storage.

[0106] Optionally, the device further comprises:

[0107] The storage module 304 is used to receive the preset questions and preset answers corresponding to the preset questions uploaded by the tenant through the proxy server before the retrieval module 301 retrieves the preset questions related to the real-time questions carried in the retrieval request, encrypt the preset answers using the public key in the public-private key pair, obtain the encrypted preset answers, and store the preset questions and the encrypted preset answers in association with each other.

[0108] This specification also provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, it can be used to perform the above Figure 1 Provides knowledge retrieval methods.

[0109] based on Figure 1 Based on the Figure 1 The knowledge retrieval method shown in the specification also provides Figure 4 The structural diagram of the electronic device shown in FIG. Figure 4 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 other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 The knowledge retrieval method described.

[0110] 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.

[0111] 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 knowledge retrieval system, the system comprising: Proxy server, database, large language model LLM; The database is used to store preset questions and encrypted preset answers corresponding to the preset questions; The proxy server is used to receive the real-time question sent by the user, and according to the real-time question, retrieve the preset question related to the real-time question from the database as the prompt question, and retrieve the encrypted preset answer corresponding to the prompt question from the database as the ciphertext prompt answer; Decrypting the ciphertext prompt answer using a pre-stored key to obtain a plaintext prompt answer; Sending the real-time question and prompt information of the real-time question to the LLM; the prompt information includes the prompt question and the plain text prompt answer; The LLM is used to generate a real-time answer corresponding to the real-time question according to the received real-time question and the prompt information, and return the answer to the proxy server; The proxy server is further configured to return the real-time answer to the user.

2. The system according to claim 1, wherein the database is deployed in the cloud; Different tenants use different proxy servers; Different tenants all use the database, and the preset questions and encrypted preset answers stored in the database are pre-stored in the database by each tenant.

3. The system according to claim 2, wherein the database is further used to generate different public-private key pairs for different tenants and assign each public-private key pair to a corresponding tenant; For each tenant, the encrypted preset answer of the tenant stored in the database is encrypted using the public key of the tenant.

4. The system as claimed in claim 3, wherein the proxy server is specifically used to decrypt the ciphertext prompt answer using a pre-stored private key.

5. A knowledge retrieval method, the method being applied to a proxy server, the method comprising: Receive real-time questions sent by users; According to the real-time question, a preset question related to the real-time question is retrieved from a database as a prompt question, and an encrypted preset answer corresponding to the prompt question is retrieved from the database as a ciphertext prompt answer; Decrypting the ciphertext prompt answer using a pre-stored key to obtain a plaintext prompt answer; Sending the real-time question and prompt information of the real-time question to a large language model LLM, wherein the prompt information includes the prompt question and the plaintext prompt answer; The real-time answer generated and returned by the LLM based on the real-time question and the prompt information is received, and the real-time answer is returned to the user.

6. The method according to claim 5, before retrieving the preset question related to the real-time question from the database, the method further comprises: Receiving preset questions and preset answers corresponding to the preset questions sent by the tenant; Encrypting the preset answer using a pre-stored public key to obtain an encrypted preset answer; The preset questions and the encrypted preset answers are uploaded to the database for storage.

7. The method according to claim 6, before encrypting the preset answer with a pre-stored public key, the method further comprises: Receive a public-private key pair allocated by the database to the tenant.

8. The method of claim 6, wherein the ciphertext prompt answer is decrypted using a pre-stored key, comprising: The ciphertext prompt answer is decrypted using the pre-stored private key corresponding to the public key.

9. A knowledge retrieval method, the method being applied to a database, the method comprising: In response to a search request sent by the proxy server, a preset question related to the real-time question carried in the search request is retrieved from pre-stored preset questions as a prompt question, and an encrypted preset answer corresponding to the prompt question is retrieved from pre-stored encrypted preset answers as a ciphertext prompt answer; wherein the search request is sent by the proxy server after receiving the real-time question sent by the user; The prompt question and the ciphertext prompt answer are returned to the proxy server, so that the proxy server decrypts the ciphertext prompt answer to obtain a plaintext prompt answer, and sends the real-time question and the prompt information of the real-time question to the large language model LLM to obtain the real-time answer returned by the LLM, and returns the real-time answer to the user; wherein the prompt information includes the prompt question and the plaintext prompt answer.

10. The method according to claim 9, before retrieving the preset question related to the real-time question carried in the search request, the method further comprises: Generate a public-private key pair for the tenant corresponding to the proxy server; The private key in the public-private key pair is sent to the proxy server for storage.

11. The method according to claim 10, before retrieving the preset question related to the real-time question carried in the search request, the method further comprises: Receiving preset questions and preset answers corresponding to the preset questions uploaded by the tenant through the proxy server; Using the public key in the public-private key pair to encrypt the preset answer to obtain an encrypted preset answer; The preset question and the encrypted preset answer are associated and stored.

12. A knowledge retrieval device, comprising: A receiving module is used to receive real-time questions sent by users; A prompt retrieval module is used to retrieve a preset question related to the real-time question from a database according to the real-time question as a prompt question, and retrieve an encrypted preset answer corresponding to the prompt question from the database as a ciphertext prompt answer; A decryption module, used to decrypt the ciphertext prompt answer using a pre-stored key to obtain a plaintext prompt answer; A knowledge retrieval module, used for sending the real-time question and the prompt information of the real-time question to the large language model LLM, wherein the prompt information includes the prompt question and the plain text prompt answer; The sending module is used to receive the real-time answer generated and returned by the LLM based on the real-time question and the prompt information, and return the real-time answer to the user.

13. A knowledge retrieval device, comprising: A retrieval module is used to respond to a retrieval request sent by the proxy server, retrieve a preset question related to the real-time question carried in the retrieval request from pre-stored preset questions as a prompt question, and retrieve an encrypted preset answer corresponding to the prompt question from pre-stored encrypted preset answers as a ciphertext prompt answer; wherein the retrieval request is sent by the proxy server after receiving the real-time question sent by the user; A sending module is used to return the prompt question and the ciphertext prompt answer to the proxy server, so that the proxy server decrypts the ciphertext prompt answer to obtain a plaintext prompt answer, and sends the real-time question and the prompt information of the real-time question to the large language model LLM, obtains the real-time answer returned by the LLM, and returns the real-time answer to the user; wherein the prompt information includes the prompt question and the plaintext prompt answer.

14. A computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 5 to 11 is implemented.

15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 5 to 11 when executing the program.

Citation Information

Patent Citations

  • Knowledge base management method and system of robot, electronic equipment and storage medium

    CN111966779A

  • Question searching method and device, equipment and storage medium

    CN116955573A