A privacy-safe knowledge base construction method with multi-party participation

Through blockchain and vector model encryption technology, combined with AI agents and invisible queries, the problem of knowledge base islands in the construction of large model knowledge bases is solved, the security and privacy sharing of enterprise knowledge bases are realized, and the privacy protection and privacy of data are ensured. Controlled access.

CN118245565BActive Publication Date: 2024-09-20YUKUAI CHUANGLING INTELLIGENT TECH (NANJING) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410667806.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-09-20
Estimated Expiration
2044-05-28

AI Technical Summary

Technical Problem

Existing large-model knowledge base construction methods are difficult to achieve security and privacy sharing of enterprise knowledge bases, resulting in knowledge bases forming isolated islands and making it difficult to realize the value of data.

Method used

The blockchain is used to build the document library data directory, the vector model is used to encrypt the document fragments, and the AI ​​agent is used to decrypt and generate answers in a secure environment. It combines invisible query technology and distributed identity authorization to achieve multi-party participation and privacy protection in the knowledge base.

Benefits of technology

It realizes the safe sharing of knowledge base, protects the privacy of providers and users, ensures controllable access and private calculation of data, and supports the flow and statistics of knowledge data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118245565B
    Figure CN118245565B
Patent Text Reader

Abstract

The present invention provides a method for constructing a knowledge base with privacy and security with multi-party participation, through S1: dividing roles; S2: using blockchain to construct a document library data directory for resource sharing; S3: establishing a document knowledge base; S4: constructing identity authorization and encrypted transmission; S5: constructing an anonymous query based on vectorization; S6: random AI proxy service gives the final answer: S7: the knowledge user obtains the final answer: the present invention uses the trusted characteristics of blockchain to share knowledge base metadata, opens the knowledge base while protecting the privacy of the knowledge base, uses the distributed identity capability of blockchain to authenticate the participants, so that the access to the knowledge base is controllable; the number of calls and the token amount of the large model are also recorded in the blockchain for easy statistics; finally, multiple parties can participate safely, and a knowledge base alliance with transferable knowledge data and privacy is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet security, and in particular to a method for constructing a knowledge base for multi-party participation in privacy security. Background Art

[0002] The big model base only contains public data on the Internet, and does not understand the framework knowledge and usage documents within the enterprise. At this stage, the construction of the big model knowledge base mainly includes the following three aspects: Text Embeddings: Different from the fuzzy search / matching keywords of traditional databases, semantic / feature matching is required, and text similarity calculation models are usually used, such as the text-embedding-ada-002 model of openai; Vector Stores: Vector embeddings are performed on enterprise documents in advance, and then stored in vector databases, such as milvus, Qrant, etc., and directly retrieved during subsequent use to improve efficiency; Similarity Search: By comparing the distance between vectors to judge the similarity of texts, knowledge fragments related to the problem are obtained. This step requires the vector library to support relevant retrieval algorithms. Since the big model knowledge base is in the development stage, the above process is only an exploratory process at this stage and has not formed an industry standard; even if the knowledge base construction of the enterprise is processed according to the above process, it will eventually form an isolated or centralized knowledge base, which is difficult to share and use, and it is difficult to play the value of data today when the circulation of data elements is encouraged. Summary of the invention

[0003] The purpose of the present invention is to solve the shortcomings of the prior art, that is, how to enable enterprises to open knowledge bases to other participants in a secure and private manner, and to propose a method for constructing a knowledge base with multi-party participation and privacy security.

[0004] To achieve the above purpose, the present invention adopts the following technical solution: a method for constructing a knowledge base with multi-party participation in privacy security, the specific steps of the method are as follows:

[0005] S1: Divide roles:

[0006] The multiple parties include knowledge providers, knowledge users, and AI agents;

[0007] The knowledge provider is the creator of the knowledge base and is responsible for providing background knowledge for the question; the knowledge user uses the knowledge base to ask questions and retrieve answers;

[0008] The AI ​​agent uses questions and knowledge fragments as input to obtain AI answers.

[0009] S2: Use blockchain to build a document library data directory for resource sharing;

[0010] S21: Create a document library directory: Each participant in the alliance has a large number of document resources, which need to be classified and organized to form a data directory and maintained on the blockchain;

[0011] S22: Data preservation: The knowledge provider mounts the document under a specific document library. The blockchain can save the document's name, description summary, data fingerprint, storage location and other information, but does not include the original content of the document.

[0012] S3: Building a document knowledge base:

[0013] S31: Use a document parser to parse the document and split it into document segments of the same length;

[0014] S32: Use the vector model to convert the document fragment into a vector value and form a mapping relationship;

[0015] S33: Use the symmetric key to encrypt the document fragment, associate it with the vector, and store it in the vector library.

[0016] S4: Building identity authorization and encrypted transmission:

[0017] Each participant uses a digital identity and records the identity and public key in the blockchain to form a trusted PKI system.

[0018] S5: Constructing vectorized anonymous queries:

[0019] S51: The knowledge user converts the original question into a vector through the vector model, symmetrically encrypts the original question, obtains the data fingerprint, and calls the knowledge provider on the chain;

[0020] S52: The knowledge provider uses the question vector to search in the local vector library, returns the ciphertext of the topN similarity document fragments and the summary of the fragments, and uploads them to the chain;

[0021] S53: Randomly calculate and select the AI ​​agent service based on the characteristics of the timestamp, request information, and return information data.

[0022] S6: Random AI agent service gives the final answer:

[0023] An AI proxy service is randomly selected. When the proxy service receives the ciphertext of the question and the fragment, it obtains a single symmetric key from the knowledge user and the knowledge provider, decrypts the data in a secure environment, and verifies the fingerprint. It then calls the large model AI to conduct question-and-answer sessions to obtain the answer. The answer is encrypted and uploaded to the chain using the public key of the questioner.

[0024] S7: Knowledge users obtain the final answer:

[0025] The knowledge user obtains the execution results of the AI ​​agent, uses the private key to decrypt and verify the data fingerprint to obtain the final answer.

[0026] Preferably, in step S4, the encrypted transmission includes two parts, one is an identity recognition mechanism based on the secret key of step S33, which ensures that the identity can be recognized when a p2p request is made, and the other is a data transmission mechanism based on the secret key of step S33, which ensures the security of data transmission.

[0027] Preferably, in step S4, each participant needs to register its own metadata information to the blockchain network through a smart contract.

[0028] Preferably, in step S5, the vector is retrieved by using a cosine similarity retrieval algorithm combined with a random perturbation method.

[0029] Preferably, the distributed identity authorization is adopted in step S4, mainly using the attributes of the blockchain, configuring relevant attribute values ​​in the document library, and opening the document library to the identity of a certain participant.

[0030] Preferably, in step S6, the AI ​​agent does not need to store special information locally, and when receiving the trigger of the smart contract, it obtains the ciphertext of the question and the ciphertext of the answer fragment from the blockchain.

[0031] Preferably, the multi-party participation may also involve an auditor.

[0032] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention uses the trusted characteristics of blockchain to share knowledge base metadata, opens the knowledge base while protecting the privacy of the knowledge base, and uses the distributed identity capabilities of blockchain to authenticate participants, so that access to the knowledge base is controllable; at the same time, the anonymous query technology in privacy computing is used to ensure the privacy of the provider's knowledge base data and the privacy of the query question of the query party; the number of calls and the token amount of the large model are also recorded in the blockchain for easy statistics; ultimately, multiple parties can participate safely, and a knowledge base alliance with transferable knowledge data and privacy is realized. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is the overall logic diagram;

[0034] Figure 2 This is the structure diagram of the document library data directory;

[0035] Figure 3 Build a flow chart for the knowledge base;

[0036] Figure 4This is the identity recognition flow chart based on the blockchain key recognition system;

[0037] Figure 5 This is a flow chart of the data transmission mechanism based on the blockchain key system;

[0038] Figure 6 Flowchart for generating answers for anonymous queries and AI agents; DETAILED DESCRIPTION

[0039] In order to provide a further understanding of the purpose, structure, features, and functions of the present invention, the following detailed description is given in conjunction with the embodiments.

[0040] Please refer to Figure 1 The present invention provides a method for constructing a knowledge base with multi-party participation in privacy security, and the specific steps of the method are as follows:

[0041] S1: Divide roles:

[0042] The multiple parties include knowledge providers, knowledge users, and AI agents;

[0043] The knowledge provider is the creator of the knowledge base and is responsible for providing background knowledge for the question; the knowledge user uses the knowledge base to ask questions and retrieve answers;

[0044] The AI ​​agent uses questions and knowledge fragments as input to obtain AI answers.

[0045] During the interaction process, the privacy security of the knowledge provider's knowledge base and the privacy security of the knowledge user's questions are protected, while the credible and traceable nature of the records is guaranteed. It can be used for settlement or statistics, thereby increasing profits for knowledge providers and AI agents.

[0046] S2: Use blockchain to build a document library data directory for resource sharing;

[0047] S21: Create a document library directory: Each participant in the alliance has a large number of document resources, which need to be classified and organized to form a data directory and maintained on the blockchain;

[0048] Since data directories are mostly data metadata and do not pose privacy risks, they have a low security level and can be shared through blockchain. Blockchain can record key information such as the name, description, and owner of the document library to ensure the reliability and ownership of the data source.

[0049] S22: Data preservation: The knowledge provider mounts the document under a specific document library. The blockchain can save the document name, description summary, data fingerprint, storage location and other information, but does not include the original content of the document;

[0050] The document name and description summary are convenient for retrieval when used. The data fingerprint ensures the uniqueness and immutability of the off-chain data. The storage location is used for database construction later. The document is not uploaded to the chain to ensure the privacy and security of the original data.

[0051] S3: Building a document knowledge base:

[0052] S31: Use a document parser to parse the document and split it into document segments of the same length;

[0053] It can ensure semantic integrity, use different segmentation strategies, and allow overlap between fragments.

[0054] S32: Use the vector model to convert the document fragment into a vector value and form a mapping relationship;

[0055] S33: Use the symmetric key to encrypt the document fragment, associate it with the vector, and store it in the vector library.

[0056] Storing in the vector library is to facilitate question retrieval, and document fragment encryption is to protect the privacy of data fragments during subsequent transmission.

[0057] S4: Building identity authorization and encrypted transmission:

[0058] Each participant uses a digital identity and records the identity and public key in the blockchain to form a trusted PKI system.

[0059] S5: Constructing vectorized anonymous queries:

[0060] Traditional anonymous query is a privacy protection technology used to hide sensitive information and protect personal privacy when querying a database. It perturbs or replaces the data in the query to hide the real personal identity or sensitive information while still providing query results. The usual requirement is to ensure the privacy of the query conditions while returning the query results. Since the vectorization of text is essentially irreversible, that is, the original text cannot be deduced from the vector results, this technology coincides with the concept of anonymous query.

[0061] S51: The knowledge user converts the original question into a vector through the vector model, symmetrically encrypts the original question, obtains the data fingerprint, and calls the knowledge provider on the chain;

[0062] S52: The knowledge provider uses the question vector to search in the local vector library, returns the ciphertext of the topN similarity document fragments and the summary of the fragments, and uploads them to the chain;

[0063] S53: Randomly calculate and select the AI ​​agent service based on the characteristics of the timestamp, request information, and return information data.

[0064] S6: Random AI agent service gives the final answer:

[0065] An AI proxy service is randomly selected. When the proxy service receives the ciphertext of the question and the fragment, it obtains a single symmetric key from the knowledge user and the knowledge provider, decrypts the data in a secure environment, and verifies the fingerprint. It then calls the large model AI to conduct question-and-answer sessions to obtain the answer. The answer is encrypted and uploaded to the chain using the public key of the questioner.

[0066] Since AI needs to know the original text to give the final answer based on the fragments of the question, it is not conducive to privacy protection whether the knowledge user sees the original text of the document fragment of the knowledge provider or the knowledge provider sees the original text of the knowledge user's question; therefore, a random strategy is adopted to randomly select AI agent services in the alliance.

[0067] S7: Knowledge users obtain the final answer:

[0068] The knowledge user obtains the execution results of the AI ​​agent, uses the private key to decrypt and verify the data fingerprint to obtain the final answer.

[0069] Knowledge users can search multiple knowledge bases or a single knowledge base. During the entire process, the data knowledge provider does not know what the specific problem of the knowledge user is; the knowledge user also does not know what the return content of the knowledge provider is, but ultimately obtains the final result related to the problem; and the entire process is recorded in the blockchain, which can be easily traced and billed.

[0070] Preferably, in step S4, the encrypted transmission includes two parts, one is an identity recognition mechanism based on the secret key of step S33, which ensures that the identity can be recognized when a p2p request is made, and the other is a data transmission mechanism based on the secret key of step S33, which ensures the security of data transmission.

[0071] Preferably, in step S4, each participant needs to register its own metadata information to the blockchain network through a smart contract.

[0072] Preferably, in step S5, the vector is retrieved by using a cosine similarity retrieval algorithm combined with a random perturbation method.

[0073] Preferably, the distributed identity authorization is adopted in step S4, mainly using the attributes of the blockchain, configuring relevant attribute values ​​in the document library, and opening the document library to the identity of a certain participant.

[0074] On the one hand, distributed digital identities can be used for on-demand authorization of knowledge bases and documents, and on the other hand, asymmetric encryption methods can be used to encrypt transmitted data to ensure transmission security.

[0075] Preferably, in step S6, the AI ​​agent does not need to store special information locally, and when receiving the trigger of the smart contract, it obtains the ciphertext of the question and the ciphertext of the answer fragment from the blockchain.

[0076] Preferably, the multi-party participation may also involve an auditor.

[0077] Specific implementation:

[0078] like Figure 1 Shown: Overall logic diagram

[0079] First, each real member can play multiple roles at the same time. The following explains the capabilities of each role without mentioning the member, such as Figure 1 As shown, it can be mainly divided into knowledge providers, knowledge users (questioners), AI agents, and auditors can also be introduced (not emphasized);

[0080] Each participant needs to record their identity and public key information in the blockchain. Such a distributed identity system can ensure the trustworthiness of the PKI system.

[0081] The data that the knowledge user (questioner) needs to upload to the chain mainly includes "question vector", "question ciphertext" and "question fingerprint", and the symmetric key used to encrypt the question is stored locally; then the smart contract triggers the knowledge provider to perform knowledge retrieval; multiple knowledge providers can be triggered to retrieve at the same time;

[0082] The knowledge provider first needs to upload the "data directory" and "authorization information" of the document library to the chain to facilitate access and screening by the knowledge provider, and store the associated original documents and knowledge vector library in local storage to ensure the security of the original data; the knowledge provider needs to use the vector library to retrieve the TopN answer fragments for a question vector and upload them to the chain. The parts uploaded to the chain mainly include "answer fragment ciphertext" and "answer fragment fingerprint", and then trigger the smart contract to randomly select an AI agent to answer the question;

[0083] The AI ​​agent does not need to store special information locally. When receiving a trigger from a smart contract, it obtains the question ciphertext and the answer fragment ciphertext from the blockchain. It also obtains the symmetric key of the corresponding ciphertext from the knowledge user (questioner) and the knowledge provider in a P2P manner to decrypt the data. During decryption, it verifies the data fingerprint to ensure that the data has not been tampered with. When all conditions are met, the AI ​​model is called through the prompt word to return the answer, the answer ciphertext and the answer fingerprint are uploaded to the blockchain, and the provider is triggered through the smart contract to obtain the answer. After that, the AI ​​agent service destroys the intermediate data.

[0084] It is recommended that the symmetric key for each piece of data encryption be temporarily generated, and a unified key should not be used to prevent brute force cracking of blockchain data. It is recommended that when p2p obtains the symmetric key, it should be encrypted with the public key of the AI ​​agent, so as to ensure the security of off-chain transmission.

[0085] like Figure 2 As shown, the document library data directory and the core structure of the knowledge base:

[0086] The document library data directory can be a tree structure, and the upper-level nodes of the "document library" basically play the role of field classification.

[0087] like Figure 3 As shown, the document knowledge base is built:

[0088] The time point for building a knowledge base is after documents are uploaded and before knowledge retrieval; it is usually recommended to start building the database after documents are uploaded.

[0089] The main properties of the knowledge base object are shown in the following table:

[0090] The main properties of the local key library are as follows:

[0091] At the same time, the knowledge base supports similarity retrieval. If you want to confuse the output at the same time, you can return several irrelevant answers based on the similarity retrieval.

[0092] like Figure 4 As shown, based on distributed digital identity authorization and encrypted transmission method

[0093] Each participant needs to register its own metadata information to the blockchain network through a smart contract, including but not limited to the following fields: organization name, organization ID, organization proxy address (for interface calls and data transmission, etc.);

[0094] And with the public key information of a public-private key system, the main attributes are as follows:

[0095] Property Name Property Description Key pair unique identifier Unique ID readable by human or machine Key Type Such as RSA, SM4, ECC and other asymmetric key pairs or certificates, but not limited to these. The key type can be regulated and defined by the business field, and the purpose is to clarify the key pair type. Key encoding format Such as PEM, Base64 and other encoding formats, but not limited to these. It is regulated and defined by the business domain, and its purpose is to complete the serialization and deserialization of key pairs. Public Key Entity The result of serializing a public key or public key certificate, depending on the key type and encoding format Key Status Enable / Disable Ownership Identifies the ownership relationship between the key pair and the organization

[0096] The private key information can contain all the public key information fields, and also needs to include:

[0097] property describe Private Key Entity The result of serializing the private key according to the key type and encoding format

[0098] like Figure 4 , Figure 5 As shown, the encrypted transmission scheme:

[0099] It consists of two parts: one is the identity recognition mechanism based on the above key system, which ensures that the identity can be recognized when a p2p request is made; the other is the data transmission mechanism based on the above key system, which ensures the security of data transmission and cannot be cracked even if it is monitored.

[0100] like Figure 6 As shown in the figure, the anonymous query method based on vectorization:

[0101] Since the process of converting text to vector is irreversible, and vectors can be used for retrieval, vectorized retrieval can effectively achieve the effect of anonymous query with hidden query conditions.

[0102] The data disclosed by the provider include: question vector, question ciphertext, and question fingerprint. The question vector is used by the knowledge base provider during the query process, and the knowledge base provider cannot infer the original question text. The question ciphertext and fingerprint can only be parsed when the password is available. Only the randomly selected AI agent has the authority to obtain the password.

[0103] Vector-based search, using the cosine similarity search algorithm, can retrieve fragments that are highly relevant to the question, but these fragments cannot provide feedback on what the question is. In addition, a certain amount of random disturbance can be added to return several irrelevant fragments during the search, which makes it even more difficult to deduce the content of the question.

[0104] Since the given knowledge fragment is encrypted, the questioner does not know what has been retrieved, and only the randomly selected AI agent has the authority to obtain the password.

[0105] When generating answers, the AI ​​agent will obtain the relevant secret key of the ciphertext based on the identity, decrypt the data in the process, and generate answers using the AI ​​big model. This process will automatically eliminate irrelevant information items, verify the data fingerprint of the question and the knowledge fragment, and the generated answer will be encrypted and uploaded to the chain, so that only the questioner can answer it.

[0106] Therefore, in the above process, the knowledge provider does not know what the search question is, and the knowledge user (questioner) does not know what the retrieved knowledge fragment is but obtains the final answer. This ensures the confidentiality of information.

[0107] Although the AI ​​agent can know the content during the decryption process, it does not have a big impact because it is recommended not to persist, run in a sandbox, and has no direct relationship with the two parties.

[0108] Ultimately, whether it is questions, knowledge fragments, or answers (AI resource consumption), the entire process is recorded on the blockchain, which can be traced and audited, and can facilitate billing or other operations.

[0109] The present invention has been described by the above-mentioned relevant embodiments, however, the above-mentioned embodiments are only examples for implementing the present invention. It must be pointed out that the disclosed embodiments do not limit the scope of the present invention. On the contrary, changes and modifications made without departing from the spirit and scope of the present invention are all within the scope of patent protection of the present invention.

Claims

1. A method for constructing a knowledge base with multi-party participation in privacy security, characterized by: The specific steps of the method are as follows: S1: Divide roles: The multiple parties include knowledge providers, knowledge users, and AI agents; The knowledge provider is the creator of the knowledge base and is responsible for providing background knowledge for the question; the knowledge user uses the knowledge base to ask questions and retrieve answers; The AI ​​agent uses the question and the knowledge fragment as input to obtain the AI ​​answer; S2: Use blockchain to build a document library data directory for resource sharing; S21: Create a document library directory: Each participant in the alliance has a large number of document resources, which need to be classified and organized to form a data directory and maintained on the blockchain; S22: Data preservation: The knowledge provider mounts the document under a specific document library. The blockchain can save the document name, description summary, data fingerprint, and storage location information, but does not include the original content of the document; S3: Building a document knowledge base: S31: Use a document parser to parse the document and split it into document segments of the same length; S32: Use the vector model to convert the document fragment into a vector value and form a mapping relationship; S33: Encrypt the document fragment using the symmetric key, associate it with the vector, and store it in the vector library together; S4: Building identity authorization and encrypted transmission: Each participant uses a digital identity and records the identity and public key in the blockchain to form a trusted PKI system; S5: Constructing vectorized anonymous queries: S51: The knowledge user converts the original question into a vector through the vector model, symmetrically encrypts the original question, obtains the data fingerprint, and calls the knowledge provider on the chain; S52: The knowledge provider uses the question vector to search in the local vector library, returns the ciphertext of the topN similarity document fragments and the summary of the fragments, and uploads them to the chain; S53: Randomly calculate and select the AI ​​agent service according to the characteristics of the timestamp, request information, and return information data; S6: Random AI agent service gives the final answer: The AI ​​proxy service is randomly selected. When the proxy service receives the ciphertext of the question and the fragment, it obtains a single symmetric key from the knowledge user and the knowledge provider, decrypts the data in a secure environment, and verifies the fingerprint. Then, the large model AI is called to perform question-and-answer operations to obtain the answer. The answer is encrypted and uploaded to the chain using the public key of the questioner. S7: Knowledge users obtain the final answer: The knowledge user obtains the execution results of the AI ​​agent, uses the private key to decrypt and verify the data fingerprint to obtain the final answer.

2. A method for constructing a knowledge base with multi-party participation in privacy security as claimed in claim 1, characterized in that: In step S4, the encrypted transmission includes two parts: one is an identity recognition mechanism based on the secret key of step S33, which ensures that the identity can be recognized when a p2p request is made; the other is a data transmission mechanism based on the secret key of step S33, which ensures the security of data transmission.

3. A method for constructing a knowledge base with multi-party participation in privacy security as claimed in claim 1, characterized in that: In step S4, each participant needs to register its own metadata information to the blockchain network through a smart contract.

4. A method for constructing a knowledge base with multi-party participation in privacy security as claimed in claim 1, characterized in that: In step S5, the vector is retrieved by using a cosine similarity retrieval algorithm combined with a random perturbation method.

5. A method for constructing a knowledge base with multi-party participation in privacy security as claimed in claim 1, characterized in that: The distributed identity authorization adopted in step S4 mainly uses the attributes of the blockchain to configure relevant attribute values ​​in the document library and open the document library to the identity of a certain participant.

6. A method for constructing a knowledge base with multi-party participation in privacy security as claimed in claim 1, characterized in that: In step S6, the AI ​​agent does not need to store special information locally. When receiving the trigger of the smart contract, it obtains the ciphertext of the question and the ciphertext of the answer fragment from the blockchain.

7. A method for constructing a knowledge base with multi-party participation in privacy security as claimed in claim 1, characterized in that: The multi-party participation may also involve an auditor.

Citation Information

Patent Citations

  • Method and system for selective document redaction

    CN106605220A

  • Private data storage and access control method and system based on block chain

    CN112989415A

  • Block chain data privacy protection and sharing method based on zero knowledge proof

    CN114143080A

  • Blockchain-based pharmaceutical crystal library and construction method therefor

    WO2021003831A1