Secure retrieval methods, systems and electronic devices

CN122986159APending Publication Date: 2026-10-27NANJING GLORY SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611161764.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-10-27

AI Technical Summary

Benefits of technology

[0016]第三方面,本申请提供了一种通信系统,包括终端和云服务器,其中,该终端用于执行如第一方面中任一项可能的实现方式中的方法,该云服务器用于执行如第二方面中任一项可能的实现方式中的方法。这样,在检索过程中保护用户的隐私信息,保障数据的安全性和保密性,提高检索效率的效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122986159A_ABST
    Figure CN122986159A_ABST
Patent Text Reader

Abstract

This application provides a secure retrieval method, system, and electronic device. The method includes: data to be stored can be divided into different privacy levels. A terminal can use different encryption / decryption methods for the data to be stored at different privacy levels. The terminal can encrypt the data to be stored at different privacy levels and then store it on a cloud server. Then, for query content at different privacy levels, the cloud server can use the retrieval method corresponding to the privacy level of the query content to determine the target data. This not only protects user privacy information and ensures data security and confidentiality, but also improves query efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminals, and more particularly to a secure retrieval method, system, and electronic device. Background Technology

[0002] In everyday applications, retrieving target data via terminals and cloud servers is one of the most common scenarios. For example, with the development of artificial intelligence technology, when users use Large Language Models (LLMs) for intelligent question answering and content generation, retrieval augmented generation (RAG) technology has emerged to address the shortcomings of LLMs in terms of knowledge timeliness, professionalism, and controllability. RAGs can enhance the generation capabilities of Large Language Models by retrieving relevant information from external knowledge bases, effectively improving the accuracy and reliability of answers. However, during data retrieval, especially when handling sensitive or private data, the risk of data leakage is relatively high. Therefore, how to protect user privacy and data security during data retrieval has become an urgent problem to be solved. Summary of the Invention

[0003] This application provides a secure retrieval method, system, and electronic device that protects users' privacy information, ensures data security and confidentiality, and improves retrieval efficiency during the retrieval process.

[0004] Firstly, this application provides a secure retrieval method applied to a terminal, comprising: receiving a query request, wherein the query request includes first query content; determining the privacy level of the first query content; sending a first retrieval request through an encrypted channel corresponding to the privacy level of the first query content; wherein the first retrieval request is used to request retrieval of the first query content; and receiving one or more target data through the encrypted channel corresponding to the privacy level of the first query content. This method protects the user's privacy information during the retrieval process, ensures data security and confidentiality, and improves retrieval efficiency.

[0005] In one possible implementation, a first search request is sent through an encrypted channel corresponding to the privacy level of the first query content. Specifically, this includes: if the first query content has a first privacy level, generating an encrypted first deduplication identifier based on the first query content; and sending a first search request carrying the encrypted first deduplication identifier. This protects the user's privacy information during the search process.

[0006] In one possible implementation, a first search request is sent through an encrypted channel corresponding to the privacy level of the first query content. Specifically, this includes: if the first query content is at a second privacy level, generating an encrypted first keyword based on the first query content; and sending a first search request carrying the encrypted first keyword. This protects the user's privacy information during the search process.

[0007] In one possible implementation, a first retrieval request is sent through an encrypted channel corresponding to the privacy level of the first query content. Specifically, this includes: if the first query content is at privacy level three, generating a first vector ciphertext based on the first query content; and sending a first retrieval request carrying the first vector ciphertext. This protects the user's privacy information during the retrieval process.

[0008] In one possible implementation, a first retrieval request is sent through an encrypted channel corresponding to the privacy level of the first query content. Specifically, this includes: if the first query content is at privacy level four, generating a second and a third vector ciphertext based on the first query content. The second and third vector ciphertexts use different encryption methods. A first retrieval request carrying the second vector ciphertext and a first retrieval request carrying the third vector ciphertext are then sent. This protects the user's privacy information during the retrieval process.

[0009] In one possible implementation, a first retrieval request is sent through an encrypted channel corresponding to the privacy level of the first query content. Specifically, this includes: if the first query content is at privacy level five, generating a fourth vector ciphertext and a first encrypted query content based on the first query content; sending a first retrieval request carrying the fourth vector ciphertext; and sending a first retrieval request carrying the first encrypted query content. This protects the user's privacy information during the retrieval process.

[0010] In one possible implementation, the method further includes: acquiring one or more pieces of data to be stored; determining the privacy level of the one or more pieces of data to be stored; and sending the one or more pieces of data to be stored through an encrypted channel corresponding to the one or more pieces of data to be stored. This ensures the security and confidentiality of the data during the retrieval process. Secondly, this application provides a secure retrieval method applied to a cloud server, comprising: receiving a first retrieval request. The first retrieval is generated based on first query content and the privacy level of the first query content, and the first retrieval request is used to request a retrieval of the first query content. Based on the first retrieval request and the privacy level of the first query content, one or more target data are determined. The one or more target data are sent through an encrypted channel corresponding to the privacy level of the first query content. This protects the user's privacy information during the retrieval process, ensures data security and confidentiality, and improves retrieval efficiency.

[0011] In one possible implementation, receiving a first search request specifically includes: if the first query content is at a first privacy level, then receiving a first search request carrying an encrypted first deduplication identifier. Based on the first search request and the privacy level of the first query content, determining one or more target data specifically includes: if the first query content is at a first privacy level, determining one or more target data based on the encrypted first deduplication identifier. This protects the user's privacy information during the search process, ensuring data security and confidentiality.

[0012] In one possible implementation, receiving a first search request specifically includes: if the first query content is at a second privacy level, then receiving a first search request carrying an encrypted first keyword. Based on the first search request and the privacy level of the first query content, determining one or more target data specifically includes: if the first query content is at a second privacy level, determining one or more target data based on the encrypted first keyword. This protects the user's privacy information during the search process, ensuring data security and confidentiality.

[0013] In one possible implementation, receiving a first search request specifically includes: if the first query content is at the third privacy level, then receiving a first search request carrying a first vector ciphertext. Based on the first search request and the privacy level of the first query content, determining one or more target data specifically includes: if the first query content is at the third privacy level, determining one or more target data based on the first vector ciphertext. This protects the user's privacy information during the search process, ensuring data security and confidentiality.

[0014] In one possible implementation, receiving a first retrieval request specifically includes: if the first query content is at the fourth privacy level, then receiving a first retrieval request carrying a second vector ciphertext and a third vector ciphertext. Based on the first retrieval request and the privacy level of the first query content, determining one or more target data specifically includes: if the first query content is at the fourth privacy level, determining a first candidate set based on the second vector ciphertext. Based on the third vector ciphertext and the first candidate set, determining one or more target data. This protects the user's privacy information during the retrieval process, ensuring data security and confidentiality.

[0015] In one possible implementation, receiving a first retrieval request specifically includes: if the first query content is at the fifth privacy level, receiving a first retrieval request carrying a fourth vector ciphertext, and a first retrieval request carrying a first encrypted query content. Based on the first retrieval request and the privacy level of the first query content, determining one or more target data specifically includes: if the first query content is at the fifth privacy level, determining a second candidate set based on the fourth vector ciphertext. Based on the fourth vector ciphertext and the second candidate set, determining one or more target data. This protects the user's privacy information during the retrieval process, ensuring data security and confidentiality.

[0016] Thirdly, this application provides a communication system including a terminal and a cloud server, wherein the terminal is used to execute the method as described in any possible implementation of the first aspect, and the cloud server is used to execute the method as described in any possible implementation of the second aspect. This effectively protects user privacy information, ensures data security and confidentiality, and improves retrieval efficiency during the retrieval process.

[0017] Fourthly, this application provides an electronic device including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors and are used to store a computer program. When the one or more processors execute the computer program, they cause the method described in any of the possible implementations of any of the above aspects to be performed. This protects user privacy information during the retrieval process, ensures data security and confidentiality, and improves retrieval efficiency.

[0018] Fifthly, this application provides a chip system including a processing circuit and an interface circuit. The interface circuit receives instructions and transmits them to the processing circuit, which then executes the instructions to perform a method as described in any of the possible implementations of any of the preceding aspects. This approach protects user privacy information during the retrieval process, ensures data security and confidentiality, and improves retrieval efficiency.

[0019] Sixthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method as described in any of the possible implementations of any of the preceding aspects. This protects user privacy information during the retrieval process, ensures data security and confidentiality, and improves retrieval efficiency.

[0020] Seventhly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method as described in any of the possible implementations of any of the foregoing aspects. This protects user privacy information during the retrieval process, ensures data security and confidentiality, and improves retrieval efficiency. Attached Figure Description

[0021] Figure 1 A schematic diagram of the system architecture of a communication system 10 provided in an embodiment of this application; Figure 2 This application provides a schematic diagram of a different encrypted channel for its embodiments. Figure 3 This is a schematic diagram illustrating the execution logic of a secure retrieval method provided in an embodiment of this application; Figure 4 A schematic diagram of the module architecture of a communication system 10 provided in an embodiment of this application; Figures 5A-5D This application provides an embodiment of a secure retrieval method with interactive diagrams of various modules. Detailed Implementation

[0022] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.

[0023] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0024] In some data retrieval implementations, three methods are often used to retrieve data. One method is to convert the data into corresponding vectors and upload them to a vector database on a cloud server. During a query, the question is also converted into a corresponding question vector. The cloud server can calculate vectors in the vector database that have a high similarity to the question vector. LLM can then generate content based on the data corresponding to these vectors. In the first method, both data and query content are transmitted and stored in plaintext, posing a high privacy risk. The second method involves desensitizing (e.g., replacing the real value with a non-real value, obfuscating, etc.), anonymizing (hiding personal information through a mask, etc.), or filtering permissions before calling the LLM to generate content from the queried data. This method can reduce the risk of data leakage, but it is difficult to hide the query content and access modules. The third method involves retrieving target data on the cloud server based on the query content. This can be done in a trusted execution environment (TEE), or by using secure multi-party computation (MPC) or homomorphic encryption (HE). This method can improve data confidentiality, but it is less efficient and has a higher resource cost.

[0025] Therefore, this application provides a secure retrieval method in which data to be stored can be divided into different privacy levels. The terminal can use different encryption / decryption methods for the data to be stored at different privacy levels. The terminal can encrypt the data to be stored at different privacy levels and then store it on a cloud server. Then, for query content at different privacy levels, the cloud server can use the retrieval method corresponding to the privacy level of the query content to determine the target data. In one possible implementation, the terminal can generate a response text based on the target data using an LLM (Local Level Management) algorithm.

[0026] This not only protects users' privacy and ensures data security and confidentiality, but also improves query efficiency.

[0027] Figure 1 This is a schematic diagram of the architecture of a communication system provided in an embodiment of this application.

[0028] like Figure 1 As shown, Figure 1 This is a schematic diagram of the system architecture of a communication system 10 provided in an embodiment of this application.

[0029] like Figure 1 As shown, the communication system 10 may include: a terminal 100 and a cloud server 200. Wherein: Terminal 100 can be an electronic device such as a mobile phone, tablet computer, PC, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA). This application does not impose any restrictions on the specific type of terminal 100.

[0030] Terminal 100 can establish a wireless communication connection with cloud server 200 and conduct data communication with cloud server 200 based on the aforementioned wireless communication connection. In this embodiment, terminal 100 can send one or more encrypted data to be stored, one or more retrieval requests with different privacy levels, etc., to cloud server 200 through the aforementioned wireless communication connection. Terminal 100 can also receive one or more encrypted target data sent by cloud server 200 through the aforementioned wireless communication connection, decrypt the encrypted target data into plaintext form, and then the one or more plaintext target data can be used to generate response text using LLM.

[0031] The cloud server 200 can store one or more target data in encrypted form with different privacy levels. When the cloud server 200 receives one or more retrieval requests with different privacy levels from the terminal 100 via the aforementioned wireless communication connection, the cloud server 200 can adopt the retrieval method corresponding to each retrieval request to determine one or more target data in encrypted form, and then send the one or more target data in encrypted form to the terminal 100 via the aforementioned wireless communication connection. Specific implementation methods will be described in subsequent embodiments.

[0032] It should be noted that the "user" mentioned in the embodiments of this application can be a natural person, or it can include intelligent agents, robots, artificial intelligence, automated machines, and other devices that simulate human operations.

[0033] The exemplary communication system 10 architecture shown in the embodiments of this application does not constitute a specific limitation on the communication system 10. In other embodiments of this application, the communication system 10 may include more than Figure 1 The number of more or fewer electronic devices shown may also include those with Figure 1 The different types of electronic devices shown.

[0034] Figure 2 This is a schematic diagram of a different encrypted channel provided for an embodiment of this application.

[0035] Specifically, different encryption channels can use different encryption protocols and encryption methods.

[0036] All encrypted channels on terminal 100 include a tiered privacy channel module. Different encrypted channels on cloud server 200 include different processing modules, and these different processing modules on cloud server 200 can perform retrieval in different ways. The specific processing modules included on cloud server 200 for each encrypted channel will be explained in detail later.

[0037] The encrypted channel can be specifically divided as follows: Among them, L0 and L1 encryption channels are considered low-sensitivity, L2 encryption channels are medium-sensitivity, and L3 and L4 encryption channels are high-sensitivity. Regarding the damage caused by data disclosure or leakage, the order is: low sensitivity < medium sensitivity < high sensitivity. Specifically: The L0 encrypted channel can be used to send data that can be obtained through public channels (also known as public data). Examples include public papers, public web pages, public Uniform Resource Locators (URLs), and shareable content. The L0 encrypted channel in cloud server 200 includes a public deduplication module, which will be described in subsequent embodiments.

[0038] The L1 encrypted channel can be used to send personal structured data (also known as small-scale structured data) of a preset size. Examples include user contact information, user calendar information, and user bill summary information. The L1 encrypted channel includes a local precision retrieval module on the cloud server 200, which will be described in subsequent embodiments.

[0039] The L2 encrypted channel can be used to send vector data (i.e., first-type vector ciphertext) encrypted using a first vector encryption method. This vector data, encrypted using the first vector encryption method, can be decrypted into plaintext vector data in the TEE on the cloud server 200 side. It can be understood that vector data is a set of floating-point numbers, representing coordinates mapping a specified data point to a mathematical space. The L2 encrypted channel on the cloud server 200 includes a TEE retrieval module, the description of which will be elaborated in subsequent embodiments.

[0040] The L3 encrypted channel can be used to send preset, highly sensitive data. Examples include a user's private documents, private images, private videos, and meeting minutes. The L3 encrypted channel in the cloud server 200 includes a homomorphic rearrangement and PIR service module. PIR (Private Information Retrieval) is a cryptographic protocol that allows the cloud server 200 to retrieve data while ensuring that the cloud server 200 is unaware of the specific content retrieved. A description of this homomorphic rearrangement and PIR service module will be provided in subsequent embodiments.

[0041] The L4 encrypted channel can be used to send data with a preset maximum sensitivity. Examples include user identification documents, user medical information text, and user financial documents. The L4 encrypted channel in the cloud server 200 includes a pure homomorphic module, which will be described in subsequent embodiments.

[0042] Understandable, Figure 2 The types of data transmitted through the encrypted channels shown are for illustrative purposes only and are not intended to be limiting. In other implementations, the encrypted channels may transmit different types of data than those shown in this application, and this application does not impose any restrictions on this.

[0043] Figure 3 This is a schematic diagram illustrating the execution logic of a secure retrieval method provided in an embodiment of this application.

[0044] like Figure 3 As shown, the execution logic of this secure retrieval method may specifically include: Phase 1: Data storage.

[0045] S301. Terminal 100 acquires one or more pieces of data to be stored and determines the privacy level of each piece of data to be stored.

[0046] Specifically, terminal 100 can acquire one or more pieces of raw data (including text, images, etc.) and process the one or more pieces of raw data to obtain one or more pieces of data to be stored.

[0047] Processing of raw data includes, but is not limited to, one or more of the following: identifying the source of the data (e.g., downloaded from the Internet, uploaded by users, etc.), parsing the data format, performing optical character recognition (OCR), text extraction, and performing block operations on the text to obtain multiple sub-data, etc.

[0048] The text to be segmented can be text already included in the original data, or text extracted from images in the original data using OCR technology. The data to be stored can include sub-data of text, images, etc. It is understood that this application does not restrict the method of acquiring the data to be stored.

[0049] Then, based on the information obtained from processing the original data, terminal 100 can determine the data type label, sensitivity label, etc., for each piece of data to be stored. The data type label indicates the type of data to be stored. The sensitivity label indicates the sensitivity of the data to be stored (e.g., low sensitivity, medium sensitivity, or high sensitivity).

[0050] Then, terminal 100 can determine the privacy level of each piece of data to be stored based on its data type label, sensitivity label, user settings, regulatory category, etc. This application divides the privacy level into five levels: Level 1, Level 2, Level 3, Level 4, and Level 5, with Level 1 being the lowest and Level 5 the highest.

[0051] In one possible implementation, if the data to be stored is sub-data of text, the data to be stored may carry metadata, including but not limited to: the identifier (id) of the parent data, the order identifier of the sub-data in the parent data, and the identifier of the sub-data.

[0052] In one possible implementation, a user can adjust the privacy level of data A stored on cloud server 200. When terminal 100 receives an operation from the user to adjust the privacy level of data A from B1 (where B1 can be any one of the first to fifth privacy levels) to B2 (where B2 can be any one of the first to fifth privacy levels but not the same as B1), terminal 100 can send encrypted data A (which can be called newly encrypted data A) to cloud server 200 through the encrypted channel corresponding to privacy level B2. Simultaneously, terminal 100 sends instruction C to cloud server 200. Instruction C is used to trigger cloud server 200 to delete data A at privacy level B1. After receiving instruction C and the newly encrypted data A, cloud server 200 stores the newly encrypted data A and deletes data A at privacy level B1.

[0053] It should be noted that before the chunking operation is performed, the original data (i.e., the complete data) obtained by terminal 100 can be regarded as parent data. After performing the chunking operation on the parent data, the resulting multiple data blocks can be called child data. All child data originating from the same parent data can be concatenated to obtain a complete piece of parent data.

[0054] S302. Terminal 100 determines the encryption channel corresponding to each piece of data to be stored based on the privacy level of each piece of data to be stored.

[0055] S303. Terminal 100 sends each piece of data to be stored through the encrypted channel corresponding to each piece of data to be stored.

[0056] It is understandable that sending data through an encrypted channel is a process that includes processing the data (e.g., encryption) and sending information based on the processed data.

[0057] Specifically, since the embodiments of this application preferably have 5 privacy levels, the encryption methods for the data to be stored at different privacy levels will be described in detail below: First privacy level: If the data to be stored is of the first privacy level, the terminal 100 can determine that the data to be stored is sent through the L0 encrypted channel.

[0058] Specifically, terminal 100 can encrypt the data to be stored at the first privacy level using a first encryption method. For example, terminal 100 can combine convergent encryption (CE) and authenticating encryption (AEAD) to encrypt the data to be stored. That is, terminal 100 can generate a hash value based on the content of the data to be stored, then derive a key Q1 based on the hash value, and then encrypt the data to be stored using AEAD based on key Q1 (and similarly, decrypt it using key Q1).

[0059] Terminal 100 also generates a deduplication identifier W1 for the data to be stored based on tags (e.g., name, URL, etc.) using a verifiable unintentional pseudo-random function (VOPRF), and encrypts the deduplication identifier W1 based on key Q1. This encrypted deduplication identifier W1 can be attached to the encrypted data to be stored to ensure that cloud server 200 does not repeatedly store the same data at the first privacy level. If multiple users upload first privacy level data with the same encrypted deduplication identifier, cloud server 200 will only store one copy.

[0060] Next, terminal 100 sends the encrypted data to be stored at the first privacy level (which can be called the first level encrypted data) and the encrypted deduplication identifier W1 to cloud server 200.

[0061] In one possible implementation, terminal 100 may also use only the CE method to encrypt the data to be stored at the first privacy level. That is, terminal 100 can generate a hash value based on the content of the data to be stored, then derive a key Q1 based on the hash value, and then encrypt the data to be stored based on the key Q1.

[0062] In one possible implementation, the CE method can derive the key through HKDF (a key derivation function based on HMAC), or through other functions; this application does not impose any restrictions on this.

[0063] In one possible implementation, if the data to be stored is child data, then the label of the data to be stored is the label of its parent data. Multiple child data belonging to the same parent data are all associated with the same deduplication identifier.

[0064] This not only ensures data integrity but also enables data deduplication (i.e., when multiple users upload the same file, only one copy is saved on the cloud server 200).

[0065] Second privacy level: If the data to be stored is of the second privacy level, the terminal 100 can determine that the data to be stored is sent through the L1 encrypted channel.

[0066] Specifically, terminal 100 can encrypt the data to be stored at the second privacy level using a second encryption method. For example, terminal 100 can encrypt the data to be stored at the second privacy level based on Searchable Symmetric Encryption (SSE). This SSE can be used to retrieve data in encrypted form. Its core principle is to establish an encrypted index (i.e., a ciphertext index) that can associate keywords with the data to be stored containing them; the keywords are also in encrypted form. Therefore, when performing data retrieval, cloud server 200 can match on the ciphertext index instead of directly searching the encrypted data.

[0067] Next, terminal 100 can send the encrypted data to be stored at the second privacy level (which can be called second-level encrypted data) to cloud server 200.

[0068] Third privacy level: If the data to be stored is at the third privacy level (e.g., private text and image descriptions with medium sensitivity), the terminal 100 can determine that the data to be stored is sent through the L2 encryption channel.

[0069] Specifically, terminal 100 can vectorize the data to be stored to obtain vector data E1. Then, terminal 100 encrypts vector data E1 using a first vector encryption method to obtain vector ciphertext E11 (i.e., vector data E1 encrypted using the first vector encryption method). This vector data E1 can be restored to the corresponding data to be stored (i.e., the original text). That is, if terminal 100 receives vector data E1 during a subsequent retrieval process, terminal 100 can restore vector data E1 to the corresponding original text.

[0070] Next, terminal 100 sends the vector ciphertext E11 to cloud server 200.

[0071] This application does not limit the encryption method of the first vector; it can be the encryption method mentioned in the embodiments of this application, or other encryption methods.

[0072] The cloud server 200 can possess a key Q2 for decrypting the vector ciphertext E11, which can be stored in the TEE. During subsequent retrieval, the TEE can use this key Q2 to decrypt the vector ciphertext E11, obtaining the vector data E1, thereby enabling plaintext vector retrieval.

[0073] Fourth Privacy Level: If the data to be stored is at the fourth privacy level, then firstly, terminal 100 vectorizes the data to be stored and calculates the corresponding vector data E2. This vector data E2 can be associated with the data to be stored at the fourth privacy level (e.g., both have the same identifier G1). Then, terminal 100 can determine to send the data to be stored at the fourth privacy level through the L3 encryption channel, and send the vector data E2 through both the L2 and L3 encryption channels.

[0074] Specifically, terminal 100 can encrypt vector data E2 using two encryption methods: 1. Encrypt using a first vector encryption method to obtain vector ciphertext E21 (i.e., vector data E2 encrypted using the first vector encryption method); 2. Encrypt using a second vector encryption method (e.g., ciphertext-policy K-anonymous encryption, CKKS) to obtain vector ciphertext E22 (i.e., vector data E2 encrypted using the second vector encryption method). Vector data E2 is interconnected with vector ciphertext E21 and vector ciphertext E22 (e.g., they all share the same identifier G1).

[0075] For data to be stored at the fourth privacy level, terminal 100 may use the fourth encryption method (e.g., Brakerski-fan-vercauteren, BFV method) for encryption.

[0076] The vector ciphertext E22 obtained by encrypting using the second vector encryption method (e.g., CKKS) can be attached to the encrypted fourth privacy level data to be stored.

[0077] Next, terminal 100 sends vector ciphertext E21, vector ciphertext E22, and data to be stored (which can be referred to as fourth-level encrypted data) encrypted using the fourth encryption method and at the fourth privacy level to cloud server 200. Among them, the fourth-level encrypted data is associated with vector ciphertext E21, vector ciphertext E22, and vector data E2.

[0078] In one possible implementation, if the data to be stored in the fourth privacy level contains non-sensitive data that the cloud server 200 needs (such as publicly available data such as user names and public URLs), the non-sensitive data does not need to be encrypted and can be uploaded and stored in plaintext in the cloud server 200.

[0079] Fifth Privacy Level: If the data to be stored is at the fifth privacy level, then firstly, terminal 100 vectorizes the data to be stored and calculates the corresponding vector data E3. This vector data E3 can be associated with the data to be stored at the fifth privacy level (e.g., both have the same identifier G2). Then, terminal 100 can determine to send the data to be stored at the fifth privacy level through the L4 encryption channel and send the vector data E3 through the L2 encryption channel.

[0080] Specifically, the vector data E3 can be encrypted using the first vector encryption method to obtain the vector ciphertext E31.

[0081] The data to be stored at the fifth privacy level can be encrypted using the fifth encryption method (e.g., fully homomorphic encryption, FHE).

[0082] Then, terminal 100 sends vector ciphertext E31 and data to be stored (which can be called fifth-level encrypted data) encrypted using the fifth encryption method and at the fifth privacy level to cloud server 200. The fifth-level encrypted data is associated with vector ciphertext E31 and vector data E3.

[0083] Understandably, the vector ciphertext obtained by encryption based on the first vector encryption method can be called the first type vector ciphertext. The cloud server 200 can store the key for decrypting the first type vector ciphertext in the TEE (for example, the key Q2 for vector ciphertext E11, the key Q3 for vector ciphertext E21, and the key Q4 for vector ciphertext E31) so that the first type vector ciphertext can be decrypted based on the key of the first type vector ciphertext in the subsequent retrieval process to perform plaintext vector retrieval.

[0084] It is understandable that the vector ciphertext obtained by encryption based on the second vector encryption method can be called the second type of vector ciphertext.

[0085] After receiving one or more pieces of data to be stored, the S304. Cloud server 200 saves one or more pieces of data to be stored in the corresponding data storage area.

[0086] Specifically, the cloud server 200 offers different storage methods for data with varying privacy levels, as detailed below: For data to be stored at the first privacy level, the cloud server 200 can receive the first-level encrypted data. The first-level encrypted data carries an identifier Z1, and the cloud server 200 stores the first-level encrypted data in the L0 public pool (also known as the L0 data storage area) based on this identifier Z1.

[0087] For data to be stored at the second privacy level, the cloud server 200 can receive the second-level encrypted data. The second-level encrypted data carries an identifier Z2, and the cloud server 200 stores the second-level encrypted data in the L1 data storage area based on this identifier Z2.

[0088] For data to be stored at the third privacy level, the cloud server 200 can receive the vector ciphertext E11. This vector ciphertext E11 carries an identifier Z3, and the cloud server 200 stores the vector ciphertext E11 in the L2 data storage area based on this identifier Z3.

[0089] For data to be stored at the fourth privacy level, the cloud server 200 can receive vector ciphertext E21, vector ciphertext E22, and the fourth-level encrypted data. Vector ciphertext E21 carries an identifier Z3. Vector ciphertext E22 and the fourth-level encrypted data carry identifier Z4. Based on identifier Z3, the cloud server 200 stores vector ciphertext E21 in the L2 data storage area. Based on identifier Z4, the cloud server 200 stores vector ciphertext E22 and the fourth-level encrypted data in the L3 storage area.

[0090] For data to be stored at Privacy Level 5, cloud server 200 can receive vector ciphertext E31 and Level 5 encrypted data. Vector ciphertext E31 carries identifier Z3. The Level 5 encrypted data carries identifier Z5. Based on identifier Z3, cloud server 200 stores vector ciphertext E31 in the L2 data storage area. Based on identifier Z5, cloud server 200 stores the Level 5 encrypted data in the L4 data storage area.

[0091] It is understandable that the data stored in the L0 data storage area can be called L0 class data. The data stored in the L1 data storage area can be called L1 class data. The data stored in the L2 data storage area can be called L2 class data. The data stored in the L3 data storage area can be called L3 class data. The data stored in the L4 data storage area can be called L4 class data.

[0092] Phase Two: Data Retrieval.

[0093] S305. Terminal 100 receives a query request, wherein the query request includes a first query content.

[0094] For example, if the query request is "Hello YOYO, please help me find employees with a monthly salary of more than 10,000 yuan", then the first query content included in the query request can be "employees with a monthly salary of more than 10,000 yuan".

[0095] S306. Terminal 100 determines the privacy level of the first query content.

[0096] Specifically, terminal 100 can determine the privacy level of the first query content based on attribute information such as the retrieval steps, data type, and content type (e.g., health, finance, documents, location, contacts, private experiences, etc.) involved in the first query content.

[0097] S307. Terminal 100 sends a first search request through an encrypted channel corresponding to the privacy level of the first query content.

[0098] This application embodiment preferably has 5 privacy levels, and the method for sending the first search request corresponding to these 5 privacy levels can be as follows: First privacy level: If the first query content is of the first privacy level, the terminal 100 sends the first search request to the cloud server 200 through the L0 encrypted channel.

[0099] Specifically, terminal 100 generates a deduplication identifier W2 (referred to as the first deduplication identifier) ​​based on the tags (e.g., name, URL, etc.) of the specified data included in the first query content using VOPRF. Then, terminal 100 encrypts the deduplication identifier W2 using key Q1.

[0100] Then, terminal 100 generates a first retrieval request carrying the encrypted deduplication identifier W2, and then sends the first retrieval request carrying the encrypted deduplication identifier W2 to cloud server 200.

[0101] Second privacy level: If the first query content is of the second privacy level, the terminal 100 sends the first search request through the L1 encrypted channel.

[0102] Specifically, terminal 100 encrypts the keyword W3 (referred to as the first keyword) in the first query content using a second encryption method (e.g., SSE method).

[0103] Then, terminal 100 generates a first search request carrying the encrypted keyword W3, and then sends the first search request carrying the encrypted keyword W3 to cloud server 200.

[0104] Third privacy level: If the first query content is at the third privacy level, terminal 100 sends the first search request through the L2 encrypted channel.

[0105] Specifically, terminal 100 vectorizes the first query content to obtain vector data E4. Then, terminal 100 encrypts the vector data E4 based on the first vector encryption method to obtain vector ciphertext E41 (referred to as the first vector ciphertext).

[0106] Then, terminal 100 generates a first retrieval request carrying vector ciphertext E41, and then sends the first retrieval request carrying vector ciphertext E41 to cloud server 200.

[0107] Fourth Privacy Level: If the first query content is at the fourth privacy level, the terminal 100 will send the first search request through the L2 encryption channel and the L3 encryption channel.

[0108] Specifically, terminal 100 vectorizes the first query content to obtain vector data E5. Then, terminal 100 encrypts vector data E5 based on the first vector encryption method to obtain vector ciphertext E51 (referred to as the second vector ciphertext); and terminal 100 also encrypts vector data E5 based on the second vector encryption method (e.g., CKKS method) to obtain vector ciphertext E52 (referred to as the third vector ciphertext).

[0109] In one possible implementation, both vector ciphertext E51 and vector ciphertext E52 can carry a query identifier K1 to indicate that the two vector ciphertexts actually originate from the same fourth privacy level query.

[0110] Then, terminal 100 generates a first retrieval request carrying vector ciphertext E51 and a first retrieval request carrying vector ciphertext E52. Vector ciphertext E51, vector data E5, and vector ciphertext E52 are interconnected.

[0111] Then, terminal 100 sends a first retrieval request carrying vector ciphertext E51 and a first retrieval request carrying vector ciphertext E52 to cloud server 200.

[0112] Fifth Privacy Level: If the first query content is at the fifth privacy level, the terminal 100 will send the first search request through the L2 encryption channel and the L4 encryption channel.

[0113] Specifically, terminal 100 vectorizes the first query content to obtain vector data E6. Then, terminal 100 encrypts the vector data E6 based on the first vector encryption method to obtain vector ciphertext E61 (referred to as the fourth vector ciphertext). Furthermore, terminal 100 also encrypts the first query content based on the fifth encryption method (e.g., FHE method).

[0114] In one possible implementation, the vector ciphertext E61 and the first query content encrypted using the fifth encryption method can carry the same query identifier K2 to indicate that the vector ciphertext E61 and the first query content encrypted using the fifth encryption method actually originate from the same query content of the fifth privacy level.

[0115] Then, terminal 100 generates a first retrieval request carrying vector ciphertext E61, and a first retrieval request carrying first query content (referred to as the first encrypted query content) encrypted using the fifth encryption method. The vector ciphertext E61, the vector data E6, and the first query content encrypted using the fifth encryption method are interconnected.

[0116] Then, terminal 100 sends a first retrieval request carrying vector ciphertext E61 and a first retrieval request carrying first query content encrypted by the fifth encryption method to cloud server 200.

[0117] It is understandable that the first search request can be associated with the privacy level of the first query content.

[0118] S308. Cloud Server 200 determines one or more matching objects based on the privacy level of the first search request and the first query content.

[0119] This embodiment preferably has 5 privacy levels. The following will describe in detail the method of retrieving the target object corresponding to the privacy level of the first query content: First privacy level: If the first query content is of the first privacy level, then the cloud server 200 receives the first search request carrying the encrypted deduplication identifier W2.

[0120] Then, cloud server 200 checks in the L0 data storage area whether an encrypted deduplication identifier W2 exists.

[0121] If an encrypted deduplication identifier W2 exists in the L0 data storage area, the cloud server 200 determines that the L0 class data corresponding to the encrypted deduplication identifier W2 is a hit object. It can be understood that if the encrypted deduplication identifier W2 corresponds to multiple L0 class data, then these L0 class data are multiple child data obtained from the same parent data block, and all of these multiple L0 class data are hit objects.

[0122] If the L0 data storage area does not contain an encrypted deduplication identifier W2, the cloud server 200 can send a retrieval failure indication message C1 to the terminal 100 to indicate to the terminal 100 that the retrieval based on the encrypted deduplication identifier W2 has failed.

[0123] Understandably, during this retrieval process, the cloud server 200 sends the complete data to the terminal 100, rather than the segmented sub-data.

[0124] Second privacy level: If the first query content is at the second privacy level, then the cloud server 200 receives the first search request carrying the encrypted keyword W3.

[0125] During the aforementioned SSE-based encryption of data to be stored, terminal 100 constructs mapping entries that include the data to be stored and its keywords. Each mapping entry indicates the mapping relationship between a piece of data to be stored and its keyword. The keywords in the mapping entries are not plaintext, but encrypted keywords.

[0126] Therefore, during the retrieval process, the cloud server 200 will search the L1 data storage area for a mapping entry containing the encrypted keyword W3. If it exists, the cloud server 200 will determine the corresponding data B22 (L1 class data) based on the mapping entry containing the encrypted keyword W3, and use this data B22 as the target. If it does not exist, the cloud server 200 can send a retrieval failure indication message C2 to the terminal 100 to indicate that the retrieval based on the encrypted keyword W3 has failed.

[0127] As can be seen, during this retrieval process, the cloud server 200 can send the segmented sub-data to the terminal 100.

[0128] Third Privacy Level: If the first query is at the third privacy level, then the cloud server 200 receives the first retrieval request carrying the vector ciphertext E41. Since the vector ciphertext E41 is a first-type vector ciphertext, the TEE contains a key Q41 that can decrypt the vector ciphertext E41.

[0129] In the TEE (Transparent Environment), cloud server 200 can decrypt the ciphertext E41 based on key Q41 to obtain vector data E4. Furthermore, cloud server 200 decrypts the ciphertexts corresponding to multiple third-privacy-level data to be stored using the corresponding keys stored in the TEE, obtaining vector data corresponding to multiple third-privacy-level data to be stored. Then, cloud server 200 can calculate the similarity between vector data E4 and the vector data corresponding to the multiple third-privacy-level data to be stored in the TEE. Cloud server 200 can then encrypt the vector data V1 with the highest similarity using the first vector encryption method, obtaining ciphertext V11. This ciphertext V11 can be used as the target. The above process can be called plaintext vector retrieval.

[0130] In one possible implementation, the retrieval process can be performed using the FAISS vector retrieval engine deployed in the TEE.

[0131] Fourth Privacy Level: If the first query is at the fourth privacy level, the cloud server 200 can receive a first retrieval request carrying vector ciphertext E51 and a first retrieval request carrying vector ciphertext E52. Since vector ciphertext E51 is a first-type vector ciphertext, the TEE contains a key Q51 that can decrypt vector ciphertext E51.

[0132] First, the cloud server 200 can decrypt the vector ciphertext E51 based on the key Q51 in the TEE to obtain the vector data E5. Furthermore, the cloud server 200 can decrypt the first-type vector ciphertexts corresponding to multiple level-four encrypted data using the corresponding keys stored in the TEE to obtain the vector data corresponding to the multiple level-four encrypted data.

[0133] Then, the cloud server 200 can calculate the similarity between vector data E5 and the vector data corresponding to multiple fourth-level encrypted data in the TEE. The vector data corresponding to the fourth-level encrypted data with a similarity greater than a preset threshold Y1 constitute the first candidate set. The process of determining the first candidate set described above can be called plaintext vector retrieval.

[0134] Next, the cloud server 200 determines the second type of vector ciphertext associated with each vector data in the first candidate set.

[0135] Then, in the TEE, the cloud server 200 calculates the encryption score between multiple second-type vector ciphertexts associated with the first candidate set and the vector ciphertext E52 based on CKKS homomorphic multiplication in encrypted state. The cloud server 200 sends the encryption score of the multiple second-type vector ciphertexts and the identifier of the multiple second-type vector ciphertexts to the terminal 100 through the L3 encryption channel.

[0136] Terminal 100 uses the key corresponding to the second vector encryption method to decrypt the encryption scores of the multiple second-type vector ciphertexts, obtaining multiple plaintext scores. After sorting the multiple plaintext scores, it selects the identifiers of the top N second-type vector ciphertexts. Next, based on the identifiers of the top N second-type vector ciphertexts, terminal 100 generates a fixed-width ciphertext retrieval request (e.g., a BFV-PIR request). Terminal 100 sends this ciphertext retrieval request to cloud server 200 through an L3 encryption channel.

[0137] In response to the aforementioned ciphertext retrieval request, the cloud server 200 determines the fourth-level encrypted data corresponding to the identifiers of the top N second-type vector ciphertexts from the L3 data storage area. The determined fourth-level encrypted data can be used as the target and sent to the terminal 100 in fixed-width ciphertext form through the L3 encryption channel.

[0138] Fifth Privacy Level: If the first query content is at the fifth privacy level, the cloud server 200 can receive the first retrieval request carrying the vector ciphertext E61, and the first retrieval request carrying the first query content encrypted by the fifth encryption method.

[0139] Since vector ciphertext E61 is a type 1 vector ciphertext, the TEE contains a key Q61 that can decrypt vector ciphertext E61.

[0140] First, the cloud server 200 can decrypt the vector ciphertext E61 based on the key Q61 in the TEE to obtain the vector data E6. Furthermore, the cloud server 200 can decrypt the first-type vector ciphertexts corresponding to multiple level-5 encrypted data using the corresponding keys stored in the TEE to obtain the vector data corresponding to the multiple level-5 encrypted data.

[0141] Then, the cloud server 200 can calculate the similarity between vector data E6 and the vector data corresponding to multiple level 5 encrypted data in the TEE. The vector data corresponding to the level 5 encrypted data with a similarity greater than a preset threshold Y2 constitute the second candidate set. The process of determining the second candidate set described above can be called plaintext vector retrieval.

[0142] Next, the cloud server 200 determined the fifth-level encrypted data associated with each vector data in the second candidate set.

[0143] Then, the cloud server 200 retrieves the fifth-level encrypted data that matches the first query content encrypted by the fifth encryption method from the fifth-level encrypted data associated with each vector data in the second candidate set through the corresponding retrieval method of the FHE scheme, and uses it as the hit object.

[0144] In one possible implementation, based on the first query content at the fifth privacy level, the cloud server 200 can also perform a retrieval in pure encrypted form. That is, when the first query content is at the fifth privacy level, the terminal 100 sends a first retrieval request through an L4 encryption channel. Specifically, the terminal 100 encrypts the first query content using a fifth encryption method (e.g., FHE), and then sends a first retrieval request carrying the first query content encrypted using the fifth encryption method to the cloud server 200. The cloud server 200 can then retrieve, in encrypted form, the fifth-level encrypted data matching the first query content encrypted using the fifth encryption method from the L4 class data in the L4 data storage area, and use this as the match. In the data storage stage corresponding to this implementation, the terminal 100 may not generate corresponding vector ciphertext based on the fifth privacy level data to be stored, and the cloud server 200 may not store the vector ciphertext corresponding to the fifth privacy level data to be stored. This improves the privacy and security of the retrieval.

[0145] S309. The cloud server 200 sends one or more hit objects to the terminal 100 through an encrypted channel corresponding to the privacy level of the first query content.

[0146] Specifically, the following describes the sending methods for the target audience corresponding to the five privacy levels: First privacy level: If the first query content is at the first privacy level, the cloud server 200 will send one or more hit objects to the terminal 100 through the L0 encrypted channel.

[0147] Second privacy level: If the first query content is at the second privacy level, the cloud server 200 will send one or more hit objects to the terminal 100 through the L1 encrypted channel.

[0148] Third Privacy Level: If the first query content is at the third privacy level, the cloud server 200 will send one or more hit objects to the terminal 100 through the L2 encrypted channel.

[0149] Fourth Privacy Level: If the first query content is at the fourth privacy level, the cloud server 200 will send one or more hit objects to the terminal 100 through the L3 encrypted channel.

[0150] Fifth Privacy Level: If the first query content is at the fifth privacy level, the cloud server 200 will send one or more hit objects to the terminal 100 through the L4 encrypted channel.

[0151] S310. Terminal 100 decrypts one or more hit objects based on the privacy level of the first query content to obtain one or more target data.

[0152] Specifically, the following describes the decryption methods corresponding to the five privacy levels: First Privacy Level: If the first query content is at the first privacy level, then: If the hit object is not sub-data, terminal 100 decrypts it using the decryption method corresponding to the first encryption method (e.g., CE+AEAD) to obtain the target data. If the hit object is sub-data, that is, terminal 100 receives multiple hit objects belonging to the same parent data, terminal 100 decrypts the multiple hit objects belonging to the same parent data using the decryption method corresponding to the first encryption method to obtain multiple sub-target data. Then, according to the order identifier recorded in the metadata, the multiple sub-target data belonging to the same parent data are concatenated to obtain a complete target data.

[0153] Second privacy level: If the first query content is of the second privacy level, the terminal 100 can decrypt the hit object based on the decryption method corresponding to the second encryption method (e.g., SSE) to obtain the target data.

[0154] Third privacy level: If the first query content is at the third privacy level, the terminal 100 can decrypt the hit object based on the decryption method corresponding to the first vector encryption method to obtain vector data, and then restore the vector data to the target data (that is, the vector data is obtained by vectorizing the target data).

[0155] Fourth Privacy Level: If the first query content is at the fourth privacy level, terminal 100 can decrypt the target object based on the decryption method corresponding to the fourth encryption method to obtain the target data.

[0156] Fifth Privacy Level: If the first query content is at the fifth privacy level, terminal 100 can decrypt the target object based on the decryption method corresponding to the fifth encryption method to obtain the target data.

[0157] It is understandable that the hit object is the encrypted form of the target data.

[0158] S311. Optionally, terminal 100 generates a response text based on one or more target data.

[0159] In one possible implementation, terminal 100 can extract a fragment (i.e., minimum necessary evidence fragment) from one or more target data based on the query request, and input the minimum necessary evidence fragment into the LLM to generate the response text corresponding to the query request through the LLM.

[0160] After the terminal 100 acquires one or more target data, it can process the one or more target data before inputting them into the LLM.

[0161] For example, the processing performed by terminal 100 on target data may include, but is not limited to, the following: deduplicating repetitive target data, identifying information in terminal 100 associated with the target data as input to LLM (referred to as reference binding), and prioritizing target data based on the strength of the support of the target data for the response text (referred to as evidence ranking), etc.

[0162] In one possible implementation, terminal 100 can record an audit log, which may include user identifier, retrieval time, query content, etc. The audit log can be noise-added by terminal 100 to maintain user privacy. The added noise can be determined based on a privacy budget and the privacy level of the query content. Terminal 100 can record the consumption of the privacy budget based on the added noise. The privacy budget can indicate the total amount of noise that can be added. The audit log can be stored in the local storage area of ​​terminal 100 or sent to cloud server 200 for analysis.

[0163] In one possible implementation, when terminal 100 detects that the remaining privacy budget is less than a preset threshold S1, terminal 100 can update the privacy budget. The updated privacy budget can be greater than the preset threshold S2 (where S2 is greater than S1).

[0164] In one possible implementation, terminal 100 may change the device root key every specified time interval S3. This device root key may derive keys for encrypting the first query content, encrypting vector data, encrypting data to be stored, and decrypting the hit object.

[0165] In one possible implementation, terminal 100 can store the keys corresponding to each encryption method to decrypt the target object based on the key. If terminal 100 loses a key, it can retrieve the lost key using a threshold recovery method. Specifically, if terminal 100 is bound to a specified cloud account, and multiple electronic devices (including terminal 100) are bound to that specified cloud account, terminal 100 can split the keys (which can be called data keys) and / or device root keys corresponding to each encryption method into H fragments, and distribute these H fragments across multiple electronic devices under the specified cloud account using Shamir's secret sharing (SSS). If terminal 100 loses its data key and / or device root key, terminal 100 only needs to collect any J fragments (J less than H) to completely restore the data key and / or device root key.

[0166] In one possible implementation, this application does not limit the encryption method used for the data to be stored and the content to be queried at each privacy level. For example, CKKS can be replaced with a BFV / BGV approximate rearrangement variant, BFV-PIR can be replaced with a PIR based on lattice cipher or OT extension, TEE can be SGX, TDX, SEV-SNP, TrustZone or a cloud vendor's confidential computing instance, and threshold recovery can be 2 (J value) of 3 (H value), 3 (J value) of 5 (H value) or a user-configured threshold.

[0167] Figure 4 This is a schematic diagram of the module architecture of a communication system 10 provided in an embodiment of this application.

[0168] like Figure 4 As shown, the communication system 10 may include a terminal 100 and a cloud server 200.

[0169] Terminal 100 may include: a data processing module, a sensitive routing module, a hierarchical privacy channel module, a key and recovery module, and an LLM context minimization module (optional). Cloud server 200 may include: a data storage module, a public deduplication module, a local precise retrieval module, a TEE retrieval module, a homomorphic rearrangement and PIR service module, and a pure homomorphic module.

[0170] Regarding the modules in terminal 100: During the data storage phase: The data processing module can process one or more pieces of raw data to obtain one or more pieces of data to be stored. The sensitive routing module can select a corresponding encryption channel for each piece of data to be stored based on its privacy level. The hierarchical privacy channel module can call the key and recovery module to encrypt each piece of data to be stored based on its privacy level. Then, the hierarchical privacy channel module sends the encrypted data to be stored to the cloud server 200.

[0171] During the data retrieval phase: The sensitive routing module can determine the privacy level of the first query content. The hierarchical privacy channel module, based on the privacy level of the first query content, calls the key and recovery module to encrypt the first query content according to its privacy level, and sends the first retrieval request carrying the encrypted first query content to the cloud server 200. The hierarchical privacy channel module can also receive the hit object and, based on the privacy level of the first query content, call the key and recovery module to decrypt the hit object to obtain the target data. The key and recovery module can also be used for threshold recovery.

[0172] In one possible implementation, the LLM context minimization module can be used to generate the minimum necessary evidence fragments.

[0173] Regarding the modules in Cloud Server 200: During the data storage phase: The data storage module can be used to store the received encrypted data to be stored. Specifically, encrypted data of different privacy levels can be stored in different data storage areas (L0 data storage area to L4 data storage area).

[0174] During the data retrieval phase: The public deduplication module retrieves the first query content for the first privacy level and sends the retrieved matching objects to terminal 100. The local precise retrieval module retrieves the first query content for the second privacy level and sends the retrieved matching objects to terminal 100. The TEE retrieval module performs plaintext vector retrieval and sends the retrieved matching objects to terminal 100. The homomorphic rearrangement and PIR service module collaborates with the TEE retrieval module to retrieve the first query content for the fourth privacy level and sends the retrieved matching objects to terminal 100. The pure homomorphic module collaborates with the TEE retrieval module to retrieve the first query content for the fifth privacy level and sends the retrieved matching objects to terminal 100.

[0175] The common deduplication module, local precise retrieval module, TEE retrieval module, homomorphic rearrangement and PIR service module, and pure homomorphic module can be collectively referred to as the retrieval request processing module. The interaction between these modules will be described in subsequent embodiments.

[0176] Figures 5A-5D This application provides an embodiment of a secure retrieval method with interactive diagrams of various modules.

[0177] like Figures 5A-5D As shown, the interactions between the modules in this secure retrieval method can be as follows: Phase 1: such as Figure 5A As shown, data is stored.

[0178] S501: The data processing module obtains one or more pieces of raw data and processes the one or more pieces of raw data to obtain one or more pieces of data to be stored.

[0179] The specific implementation method of this step can be found in the description in S301, and will not be repeated here.

[0180] S502: The data processing module sends one or more pieces of data to be stored to the sensitive routing module.

[0181] S503: The sensitive routing module determines the privacy level of each piece of data to be stored.

[0182] S504: The sensitive routing module sends the data to be stored to the hierarchical privacy channel module.

[0183] S505: The hierarchical privacy channel module calls the key and recovery module to perform corresponding encryption processing on each piece of data to be stored, based on the privacy level of each piece of data to be stored.

[0184] The specific implementation method of this step can be found in the descriptions in S302~S303, and will not be repeated here.

[0185] S506: The tiered privacy channel module sends one or more encrypted data items to be stored to the data storage module of the cloud server 200.

[0186] The specific implementation method of this step can be found in the description in S303, and will not be repeated here.

[0187] S507: The data storage module stores one or more encrypted data to be stored in the corresponding data storage area.

[0188] The specific implementation method of this step can be found in the description in S304, and will not be repeated here.

[0189] Phase Two: such as Figure 5B , Figure 5C , Figure 5D Data retrieval.

[0190] S508: The sensitive routing module receives a query request, which includes the first query content.

[0191] S509: The sensitive routing module determines the privacy level of the first query content.

[0192] S510: The sensitive routing module sends the first query content to the hierarchical privacy channel module.

[0193] S511: The tiered privacy channel module generates a first search request based on the privacy level of the first query content.

[0194] S512: The tiered privacy channel module sends the first search request to the search request processing module corresponding to the cloud server 200 based on the privacy level of the first query content.

[0195] The steps of S511 to S512 can be referred to the description of S307 above.

[0196] If the first query content is at the first privacy level, then the first search request can be received by the public deduplication module.

[0197] If the first query content is at the second privacy level, then the first search request can be received by the local precise search module.

[0198] If the first query is at the third privacy level, the first search request can be received by the TEE search module.

[0199] If the first query is at the fourth privacy level, the first search request can be received by the TEE search module and the homomorphic rearrangement and PIR service module.

[0200] If the first query content is at the fifth privacy level, then the first search request can be received by the TEE search module and the pure homomorphic module.

[0201] S513: The retrieval request processing module of the cloud server 200 determines one or more hit objects based on the privacy level of the first retrieval request and the first query content.

[0202] If the first query content is at the first privacy level, the public deduplication module determines one or more matching objects based on the first search request, as described in the aforementioned S308.

[0203] If the first query content is at the second privacy level, the local precise retrieval module determines one or more hit objects based on the first retrieval request, as described in the aforementioned S308.

[0204] If the first query content is at the third privacy level, the TEE retrieval module determines one or more matching objects based on the first retrieval request, as described in the aforementioned S308.

[0205] If the first query content is at the fourth privacy level, the TEE retrieval module performs a plaintext vector retrieval based on the first retrieval request, determines the first candidate set, and identifies the second type of vector ciphertext associated with the first candidate set. Then, the second type of vector ciphertext associated with the first candidate set is sent to the homomorphic rearrangement and PIR service module. The homomorphic rearrangement and PIR service module, based on the first retrieval request and the second type of vector ciphertext associated with the first candidate set, determines one or more matching objects, as described in S308 above.

[0206] If the first query content is at the fifth privacy level, the TEE retrieval module performs a plaintext vector retrieval based on the first retrieval request to determine the second candidate set and the fifth-level encrypted data associated with the second candidate set. Then, the fifth-level encrypted data associated with the second candidate set is sent to the homomorphic module, which determines one or more matching objects based on the first retrieval request and the fifth-level encrypted data associated with the second candidate set, as described in S308 above.

[0207] S514: The cloud server 200 sends one or more hit objects to the hierarchical privacy channel module of the terminal 100 through the retrieval request processing module corresponding to the privacy level of the first query content.

[0208] If the first query content is at the first privacy level, the public deduplication module sends one or more matching objects.

[0209] If the first query is at the second privacy level, the local precise retrieval module sends one or more hit objects.

[0210] If the first query is at the third privacy level, the TEE retrieval module will send one or more hit objects.

[0211] If the first query is at the fourth privacy level, then the homomorphic rearrangement and PIR service module will send one or more hit objects.

[0212] If the first query is at privacy level 5, the pure homomorphic module sends one or more hit objects.

[0213] S515: The graded privacy channel module, based on the privacy level of the first query content, calls the key and recovery module to decrypt one or more hit objects to obtain one or more target data.

[0214] This step can be referred to in the description of S310 above.

[0215] S516: Optional, the tiered privacy channel module triggers the LLM to generate a response text based on one or more target data.

[0216] This step can be referred to the description of S311 above.

[0217] In one possible implementation, the hierarchical privacy channel module can trigger the LLM context minimization module to extract fragments (i.e., minimum necessary evidence fragments) from one or more target data that can be used to answer the query request. Then, the minimum necessary evidence fragments are input into the LLM, and the LLM generates the response text corresponding to the query request.

[0218] Understandable Figures 5A-5D This is used only as an example to explain this application and does not constitute a specific limitation.

[0219] The secure retrieval method provided in this application can be implemented as a personal knowledge cloud client, a privacy-protected RAG gateway, a browser / operating system-level personal AI assistant plugin, an enterprise personal workspace assistant, etc., and there are no limitations on this.

[0220] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in the above-described method embodiments.

[0221] This application also provides a computer program product, including a computer program that, when run on a processor, can implement the steps executed by the electronic device in the above-described method embodiments.

[0222] This application also provides a chip system, which includes a processing circuit interface circuit. The interface circuit receives instructions and transmits them to the processing circuit, which executes the instructions to cause the chip system to perform the steps executed by the electronic device in any of the method embodiments of this application. The chip system can be a single chip or a chip module composed of multiple chips.

[0223] The term "user interface (UI)" used in the specification and accompanying drawings of this application refers to the medium through which an application or operating system interacts and exchanges information with the user. It converts the internal form of information into a form acceptable to the user. The user interface of an application is source code written in a specific computer language such as Java or Extensible Markup Language (XML). This source code is parsed and rendered on the terminal device, ultimately presenting user-recognizable content, such as images, text, buttons, and other controls. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, scroll bars, images, and text. The attributes and content of controls in the interface are defined through tags or nodes, such as in XML. <textview> 、 <imgview> 、 <videoview>Nodes define the controls contained in the interface. A node corresponds to a control or property in the interface, and after parsing and rendering, the node is presented as the content visible to the user. In addition, many applications, such as hybrid applications, often contain web pages within their interfaces. A web page, also known as a page, can be understood as a special control embedded in the application interface. Web pages are source code written in a specific computer language, such as Hypertext Markup Language (HTML), Cascading Style Sheets (CSS), JavaScript, etc. The source code of a web page can be loaded and displayed as user-readable content by a browser or a web page display component with browser-like functionality. The specific content contained in a web page is also defined through tags or nodes in the web page's source code; for example, HTML uses tags or nodes to define the content. 、 、 <video> 、 <canvas>To define the elements and attributes of a webpage.

[0224] The most common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be an interface element such as an icon, window, or control displayed on the screen of an electronic device. The control can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.

[0225] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.

[0226] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0227] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. A secure retrieval method, characterized in that, Applied to terminals, including: A query request is received, wherein the query request includes a first query content; Determine the privacy level of the first query content; A first retrieval request is sent through an encrypted channel corresponding to the privacy level of the first query content; wherein, the first retrieval request is used to request the retrieval of the first query content; One or more target data are received through an encrypted channel corresponding to the privacy level of the first query content.

2. The method according to claim 1, characterized in that, Send the first retrieval request through the encrypted channel corresponding to the privacy level of the first query content, specifically including: If the first query content is at the first privacy level, then an encrypted first deduplication identifier is generated based on the first query content; Send a first retrieval request carrying the encrypted first deduplication identifier.

3. The method according to claim 1, characterized in that, Send the first retrieval request through the encrypted channel corresponding to the privacy level of the first query content, specifically including: If the first query content is at the second privacy level, then an encrypted first keyword is generated based on the first query content; Send a first search request carrying the encrypted first keyword.

4. The method according to claim 1, characterized in that, Send the first retrieval request through the encrypted channel corresponding to the privacy level of the first query content, specifically including: If the first query content is at the third privacy level, then a first vector ciphertext is generated based on the first query content; Send a first retrieval request carrying the first vector ciphertext.

5. The method according to claim 1, characterized in that, Send the first retrieval request through the encrypted channel corresponding to the privacy level of the first query content, specifically including: If the first query content is at the fourth privacy level, then a second vector ciphertext and a third vector ciphertext are generated based on the first query content; wherein the second vector ciphertext and the third vector ciphertext correspond to different encryption methods; Send a first retrieval request carrying the second vector ciphertext, and a first retrieval request carrying the third vector ciphertext.

6. The method according to claim 1, characterized in that, Send the first retrieval request through the encrypted channel corresponding to the privacy level of the first query content, specifically including: If the first query content is at the fifth privacy level, then a fourth vector ciphertext and a first encrypted query content are generated based on the first query content; Send a first retrieval request carrying the fourth vector ciphertext, and a first retrieval request carrying the first encrypted query content.

7. The method according to claim 1, characterized in that, The method further includes: Based on the one or more target data, generate the response text corresponding to the query request.

8. The method according to claim 1, characterized in that, The method further includes: Retrieve one or more pieces of data to be stored; Determine the privacy level of one or more of the data to be stored; The one or more pieces of data to be stored are sent through the encrypted channel corresponding to the one or more pieces of data to be stored.

9. A secure retrieval method, characterized in that, Applied to cloud servers, including: Receive a first search request; wherein the first search is generated based on the first query content and the privacy level of the first query content, and the first search request is used to request the retrieval of the first query content; Based on the privacy level of the first retrieval request and the first query content, one or more target data are identified; The one or more target data are sent through an encrypted channel corresponding to the privacy level of the first query content.

10. The method according to claim 9, characterized in that, Receive the first search request, specifically including: If the first query content is at the first privacy level, then a first search request carrying an encrypted first deduplication identifier is received; Based on the privacy level of the first retrieval request and the first query content, one or more target data are identified, specifically including: If the first query content is at the first privacy level, one or more target data are determined based on the encrypted first deduplication identifier.

11. The method according to claim 9, characterized in that, Receive the first search request, specifically including: If the first query content is at the second privacy level, then a first search request carrying an encrypted first keyword is received; Based on the privacy level of the first retrieval request and the first query content, one or more target data are identified, specifically including: If the first query content is at the second privacy level, one or more target data are determined based on the encrypted first keyword.

12. The method according to claim 9, characterized in that, Receive the first search request, specifically including: If the first query content is at the third privacy level, then a first retrieval request carrying the first vector ciphertext is received; Based on the privacy level of the first retrieval request and the first query content, one or more target data are identified, specifically including: If the first query content is at the third privacy level, one or more target data are determined based on the first vector ciphertext.

13. The method according to claim 9, characterized in that, Receive the first search request, specifically including: If the first query content is at the fourth privacy level, then receive the first retrieval request carrying the second vector ciphertext and the first retrieval request carrying the third vector ciphertext. Based on the privacy level of the first retrieval request and the first query content, one or more target data are identified, specifically including: If the first query content is at the fourth privacy level, the first candidate set is determined based on the second vector ciphertext; Based on the third vector ciphertext and the first candidate set, one or more target data are determined.

14. The method according to claim 9, characterized in that, Receive the first search request, specifically including: If the first query content is at the fifth privacy level, then receive the first retrieval request carrying the fourth vector ciphertext and the first retrieval request carrying the first encrypted query content; Based on the privacy level of the first retrieval request and the first query content, one or more target data are identified, specifically including: If the first query content is at the fifth privacy level, the second candidate set is determined based on the fourth vector ciphertext; Based on the fourth vector ciphertext and the second candidate set, one or more target data are determined.

15. A communication system, characterized in that, It includes a terminal and a cloud server, wherein the terminal is used to perform the method as described in any one of claims 1-8, and the cloud server is used to perform the method as described in any one of claims 9-14.

16. An electronic device, characterized in that, It includes one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store a computer program that, when the one or more processors execute the computer program, causes the method as described in any one of claims 1-14 to be performed.

17. A chip system, characterized in that, It includes a processing circuit and an interface circuit, the interface circuit being used to receive instructions and transmit them to the processing circuit, the processing circuit being used to execute the instructions to perform the method as described in any one of claims 1-14.

18. A computer-readable storage medium, characterized in that, The device contains a computer program that, when executed by a processor, implements the method as described in any one of claims 1-14.

19. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method as described in any one of claims 1-14.