Searching method and device, equipment, storage medium and program product

Through blockchain technology and smart contracts, combined with searchable encryption solutions, the problem of data vulnerability within network equipment is solved, and safe storage and accurate retrieval of data are achieved.

CN118779535APending Publication Date: 2024-10-15CHINA MOBILE COMM GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410505998.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-25
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Existing searchable encryption technologies are vulnerable to attacks within network devices, resulting in data being maliciously tampered with or lost, and retrieval results being inaccurate.

Method used

Use blockchain technology combined with searchable encryption to obtain lists under different indexing methods through the blockchain, conduct document searches based on keywords, and use smart contracts as trusted third parties to perform retrievals to ensure data security and retrieval results. accuracy.

Benefits of technology

It effectively avoids data tampering by malicious servers, improves data security and the accuracy of retrieval results, and solves the problem of unreliable searchable encryption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779535A_ABST
    Figure CN118779535A_ABST
Patent Text Reader

Abstract

The invention discloses a searching method and device, equipment, a storage medium and a program product, and the searching method comprises the steps that first information sent by a data user is received, and the first information comprises a label of a to-be-searched keyword and a searching vector corresponding to the to-be-searched keyword; obtaining a first list and a second list of the block chain, wherein the index modes of documents in the first list and the second list are different; based on the first information, the first list and the second list, determining a sorting result of the to-be-searched document; according to the sorting result, second information is returned to the data user, and the second information comprises documents corresponding to the to-be-searched keywords in the to-be-searched documents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to, but is not limited to, the field of network security technology, and in particular to a search method, apparatus, device, storage medium, and computer program product. Background Art

[0002] Searchable encryption refers to a solution that encrypts and stores data files in the cloud and enables file retrieval based on keywords. In related technologies, searchable encryption encrypts and stores data files containing a large amount of sensitive information in network devices, and searches for target files from network devices when there is a need for retrieval. However, when a security attack occurs inside a network device, there is a risk of data being maliciously tampered with or even lost, making searchable encryption unreliable. Summary of the invention

[0003] The present application provides a search method, apparatus, device, storage medium and program product.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] A search method, applied to a network device, comprising:

[0006] receiving first information sent by a data user, wherein the first information includes a label of a keyword to be searched and a search vector corresponding to the keyword to be searched;

[0007] Obtaining a first list and a second list of a blockchain, wherein the indexing methods of documents in the first list and the second list are different;

[0008] Determine a ranking result of the documents to be searched based on the first information, the first list, and the second list;

[0009] According to the ranking result, second information is returned to the data user, where the second information includes documents corresponding to the keyword to be searched in the documents to be searched.

[0010] In the above solution, the step of obtaining the first list and the second list of blockchains includes:

[0011] Receiving third information sent by the data owner, the third information including a security index corresponding to a keyword of the original document and the encrypted original document;

[0012] Based on the third information, establishing the first list and the second list;

[0013] The first list and the second list are stored in the blockchain.

[0014] In the above solution, the indexing method of the documents in the second list is to point to the documents by keywords, and the determining of the sorting results of the documents to be searched based on the first information, the first list and the second list includes:

[0015] Determine one or more documents to be searched based on the label of the keyword to be searched and the second list;

[0016] The ranking result is determined based on the one or more documents to be searched and the first list.

[0017] In the above solution, the indexing method of the documents in the first list is to point to keywords from the documents, and the determining of the sorting result based on the one or more documents to be searched and the first list includes:

[0018] Based on the first list, acquiring fourth information, wherein the fourth information indicates a document vector of the document to be searched corresponding to the keyword to be searched;

[0019] Determining a relevance score based on the search vector and the document vector;

[0020] Based on the relevance score, the ranking result is determined.

[0021] In the above solution, returning the second information to the data user includes:

[0022] Receive fifth information, where the fifth information indicates a search result determined by the smart contract based on a security index corresponding to the keyword of the original document and a label of the keyword to be searched in the first information;

[0023] In the case where the search result indicates that the original document matching the tag of the keyword to be searched can be found in the security index, the second information is returned to the data user.

[0024] In the above solution, the second information also includes a first document identifier corresponding to the keyword to be searched, and the method further includes:

[0025] Acquire sixth information, where the sixth information indicates a second document identifier corresponding to the keyword to be searched, which is returned by the smart contract to the data user;

[0026] When the first document identifier is consistent with the second document identifier returned by the smart contract, the second information is returned to the data user.

[0027] In the above solution, the first list includes one or more of the following information:

[0028] Document identification;

[0029] The encrypted file name;

[0030] Symmetric key ciphertext;

[0031] Tags for multiple keywords;

[0032] Encrypted document vector;

[0033] Non-sensitive information.

[0034] In the above solution, the second list includes the following information:

[0035] Keyword tags;

[0036] Document identification.

[0037] The present application also provides a search device, the search device comprising:

[0038] an acquisition unit, configured to receive first information sent by a data user, wherein the first information includes a label of a keyword to be searched and a search vector corresponding to the keyword to be searched;

[0039] The acquisition unit is further used to acquire a first list and a second list of blockchains, wherein the indexing methods of the documents in the first list and the second list are different;

[0040] A processing unit, configured to determine a ranking result of the documents to be searched based on the first information, the first list, and the second list;

[0041] The processing unit is further configured to return second information to the data user according to the ranking result, wherein the second information includes documents corresponding to the keyword to be searched in the documents to be searched.

[0042] The embodiment of the present application also provides a search device, comprising: a processor and a memory for storing a computer program that can be run on the processor; wherein:

[0043] The processor is used to execute the steps of the aforementioned search method when running the computer program.

[0044] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the aforementioned search method are implemented.

[0045] An embodiment of the present application also provides a computer program product, including a computer program, which can be executed by a processor of an electronic device to complete the steps of the aforementioned search method.

[0046] The embodiment of the present application provides a search method, device, equipment, storage medium and program product, wherein the method includes: receiving first information sent by a data user, the first information including a label of a keyword to be searched and a search vector corresponding to the keyword to be searched; obtaining a first list and a second list of blockchains, wherein the indexing methods of the documents in the first list and the second list are different; determining the sorting results of the documents to be searched based on the first information, the first list and the second list; and returning second information to the data user according to the sorting results, wherein the second information includes the documents corresponding to the keyword to be searched in the documents to be searched. That is, the present application adopts blockchain technology to obtain the first list and the second list under different indexing methods, and performs keyword-based document search based on the first list and the second list, thereby avoiding malicious server tampering with data, and solving the problem that searchable encryption in related technologies is prone to malicious tampering with data or even data loss, making searchable encryption unreliable. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A flowchart of a search method according to an embodiment of the present application;

[0048] Figure 2 A flowchart of a method for ciphertext search and query in an actual scenario of an embodiment of the present application;

[0049] Figure 3 A schematic diagram of a positive index list in an actual scenario of an embodiment of the present application;

[0050] Figure 4 A schematic diagram of an inverted index list in an actual scenario of an embodiment of the present application;

[0051] Figure 5 A schematic diagram of a model of a ciphertext search and query system in an actual scenario of an embodiment of the present application;

[0052] Figure 6 This is a schematic diagram of the structure of a search device according to an embodiment of the present application;

[0053] Figure 7 A schematic diagram of the structure of a search device according to an embodiment of the present application. DETAILED DESCRIPTION

[0054] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0055] The traditional search method is to query in plain text, and the user's query is also performed in plain text, which has great security risks. Unencrypted information is easily obtained by malicious users and untrusted third parties, and user privacy is facing great threats. In response to the problem of security risks in traditional plain text queries, Song et al. first proposed a searchable encryption scheme: Assume that the data owner Alice has some documents stored on an untrusted server Bob. Considering that Bob is untrustworthy, Alice only stores encrypted documents on Bob. Each document can be divided into words of equal or unequal lengths. Furthermore, when the communication bandwidth between Alice and server Bob is low, Alice, as a data user, sends a search request containing a specific keyword w to server Bob when searching for documents, so that Bob can perform some calculations on the ciphertext and return part of the document containing w for Alice to use, and will not return other information. At the same time, user authorization is set. Other users who have not obtained authorization from the data owner Alice have no right to request any document and its document content. That is to say, in the searchable encryption scheme proposed in the related art, the data owner encrypts the user information (including the query content and the document or file content in the local database) and stores it on the server. When the data user needs to obtain a document or file, there is no need to download all the encrypted documents or files from the cloud storage server. Instead, it searches for a keyword and sends the search credential of the keyword to the cloud storage server. After receiving the search credential, the cloud server tentatively matches it with each document or file. If the match is successful, it means that the keyword is contained in the document or file. Finally, the cloud returns all the successfully matched documents or files to the user.

[0056] However, searchable encryption is to encrypt a large amount of user data and store it in the cloud server. When the cloud server is attacked by keyword guessing, it is easy to cause the privacy of user information to be leaked, and even the risk of information loss or malicious tampering. In addition, the method based on single keyword search in related technologies provides less key information, which easily causes a large number of irrelevant files or documents to be returned, and there is a problem of incorrect search results.

[0057] Based on this, the present application provides a search method, referring to Figure 1 As shown, applied to a network device, the method comprises the following steps:

[0058] Step 101: Receive first information sent by a data user.

[0059] The first information includes a label of a keyword to be searched and a search vector corresponding to the keyword to be searched.

[0060] In actual application, data users may also be referred to as data users, users, and user devices. User devices include but are not limited to mobile phones, cellular phones, smart phones, tablet computers, wearable terminal devices, personal digital assistants (PDAs), portable computers, game terminal devices, music storage and playback devices, wearable terminal devices, vehicle-mounted wireless terminal devices, etc. Network devices may also be referred to as network-side devices. Network devices may include but are not limited to local servers, cloud servers, network node devices, etc., depending on the technology actually applied.

[0061] In actual application, the first information instructs the network device to perform a search operation according to the search requirements of the data user. The first information can be in various forms, including but not limited to requests and messages.

[0062] In actual application, the first information includes the label of the keyword to be searched. The keyword can be in the form of text, numbers, or letters. For example, when the keyword is in the form of text, the keyword can be a single word or a word composed of multiple words. In one case, the data user can use a hash function to calculate the keyword label to be searched. The content can be document content, document name, file content, file name, etc. The form of the content includes but is not limited to images, text, programs, numbers, etc.

[0063] In actual application, the first information includes a search vector corresponding to the keyword to be searched, which can be called a query vector. In one case, the data user constructs a search vector based on a locally stored query keyword set and the inverse document frequency corresponding to the keyword, and the search vector indicates the component of the keyword to be searched in the query keyword set. The query keyword set is a set containing multiple query keywords generated by the data user after performing language analysis on the search statement. The query keyword can be input by the data user according to the search requirements.

[0064] In actual application, the data user sends the label of the keyword to be searched and the search vector corresponding to the keyword to be searched to the network device, so that the network device searches for content containing the keyword according to the label of the keyword sent by the data user and the search vector corresponding to the keyword.

[0065] Step 102: Obtain a first list and a second list of blockchains.

[0066] The indexing methods of the documents in the first list and the second list are different.

[0067] In actual application, the indexing method of the documents in the first list is from the document to the keyword, and the indexing method of the documents in the second list is from the keyword to the document. Both the first list and the second list are stored in the blockchain. Blockchain is a decentralized distributed ledger with the characteristics of block chain storage, non-tamperability, security and reliability. The embodiment of the present application combines blockchain technology with a searchable encryption scheme to avoid malicious servers from tampering with data and ensure the security of data.

[0068] In actual application, the cloud server obtains the secure first list and the second list from the blockchain, so that the cloud server can support the indexing method of pointing to keywords with documents, and also support the indexing method of pointing to documents with keywords.

[0069] Step 103: Determine the ranking result of the documents to be searched based on the first information, the first list and the second list.

[0070] In actual application, the cloud server stores documents to be searched. When the data user has a need for document search or document retrieval, the cloud server retrieves and returns the stored documents to be searched to the data user. The documents to be searched in the embodiments of the present application are all encrypted original documents, which can be called ciphertext documents. The documents to be searched can be all ciphertext documents stored in the cloud server, or part of the ciphertext documents in the stored ciphertext documents, and there is a correlation between them and the retrieval needs of the data user.

[0071] In actual application, the cloud server obtains the encrypted document from the data owner and stores it in the local storage unit of the cloud server.

[0072] In actual application, the cloud server determines the score of the document to be searched based on the acquired label of the keyword to be searched, the search vector corresponding to the keyword to be searched, and the first list and the second list of different indexing methods, and sorts the document to be searched according to the score to obtain the sorting result.

[0073] Step 104: Return the second information to the data user according to the sorting result.

[0074] The second information includes documents corresponding to the keywords to be searched in the documents to be searched.

[0075] In actual application, after the cloud server obtains the ranking result of the documents to be searched, it returns the documents corresponding to the keywords to be searched in the documents to be searched to the data user according to the ranking result.

[0076] A search method provided by an embodiment of the present application includes: receiving first information sent by a data user, the first information including a label of a keyword to be searched and a search vector corresponding to the keyword to be searched; obtaining a first list and a second list of blockchains, the indexing methods of documents in the first list and the second list being different; determining the sorting results of the documents to be searched based on the first information, the first list and the second list; and returning second information to the data user according to the sorting results, the second information including documents corresponding to the keyword to be searched in the documents to be searched. That is, the present application adopts blockchain technology to obtain the first list and the second list under different indexing methods, and performs keyword-based document search based on the first list and the second list, thereby avoiding malicious server tampering with data, and solving the problem that searchable encryption in related technologies is prone to malicious tampering or even data loss, making searchable encryption unreliable.

[0077] In one embodiment, in step 102, the first list and the second list of blockchains are obtained, and the method further includes:

[0078] Receiving third information sent by the data owner, the third information including a security index corresponding to a keyword of the original document and the encrypted original document;

[0079] Based on the third information, establishing a first list and a second list;

[0080] The first list and the second list are stored in the blockchain.

[0081] In actual application, the data owner may also be referred to as the data owner, data owner, data provider and their corresponding equipment. The data owner's equipment includes but is not limited to mobile phones, cellular phones, smart phones, tablet computers, wearable terminal devices, personal digital assistants (PDA), portable computers, game terminal devices, music storage and playback devices, wearable terminal devices, vehicle-mounted wireless terminal devices and other terminal devices, and also includes base stations / next generation nodes (the next Generation Node B, gNB), access points (Access Point, AP), new wireless (NewRadio, NR) and other network-side equipment, depending on the actual application technology.

[0082] In actual application, the data owner extracts keywords from the original document to form a keyword set, establishes a logical connection relationship between keywords and documents, including generating a logical pointer and logical address from the keyword to the document, thereby generating a searchable index using the keyword set, and selecting an encryption algorithm to encrypt the content in the searchable index to obtain an encrypted secure index. In this way, the data owner first encrypts the content in the searchable index to generate secure document index information, and then uploads it to the cloud server, avoiding the exposure of the document's plaintext information after the unencrypted index information is uploaded, thereby improving the security of the data.

[0083] In actual application, the cloud server receives the security index corresponding to the keywords of the original document sent by the data owner and the encrypted original document, and respectively establishes a first list and a second list with different indexing methods, and stores the first list and the second list in the blockchain.

[0084] Exemplarily, a secure K-Nearest Neighbor (KNN) algorithm may be used to encrypt the searchable index to generate a secure index.

[0085] In the embodiment of the present application, the cloud server establishes a first list and a second list of different indexing methods based on the security index corresponding to the keyword of the original document and the encrypted original document, so that the cloud server can simultaneously support two indexing methods to perform search operations, thereby realizing the update and improvement of the indexing method of the document set in the cloud server. In addition, based on blockchain technology, the first list and the second list are stored in the blockchain, so that the first list has the characteristic of being tamper-proof, thereby improving the security of the data.

[0086] In one embodiment, the first list includes one or more of the following information:

[0087] Document identification;

[0088] The encrypted file name;

[0089] Symmetric key ciphertext;

[0090] Tags for multiple keywords;

[0091] Encrypted document vector;

[0092] Non-sensitive information.

[0093] In actual application, the document identifier is the identification information assigned by the cloud server to each encrypted original document, and is the unique identifier of each original document.

[0094] In actual application, the encrypted document name is obtained by encrypting the document name using an encryption algorithm selected by the data owner.

[0095] In actual application, the symmetric key ciphertext is the access key generated by the data owner for each original document.

[0096] In actual application, the keyword label is that the data owner extracts keywords from the content of the original document, and selects an encryption algorithm to encrypt the extracted keywords to obtain the encrypted keyword ciphertext. The set of ciphertexts of multiple keywords can be called dictionary ciphertext.

[0097] In actual application, the data owner constructs a document vector for each original document stored locally based on each keyword. The document vector indicates the weight of the keywords in the original document in the keyword set of the original document. The keyword set of the original document is a set of multiple keywords generated by the data owner after performing language analysis on the original document. The encrypted document vector is obtained after the data owner selects an encryption algorithm to encrypt the document vector.

[0098] In actual application, after the data owner performs language analysis on each original document, the generated document name, keywords, etc. are sensitive information, while the document size, document modification time, etc. are non-sensitive information. It is understandable that sensitive information has higher security requirements because it involves the data privacy of the data owner, while the security requirements for non-sensitive information are relatively low, so non-sensitive information can be left unencrypted.

[0099] In actual application, the cloud server extracts keyword-related information from the security index and encrypted original document provided by the data owner. It can be understood that when the data owner constructs a searchable index based on the document name, symmetric key, dictionary composed of keywords, document vector, and non-sensitive information, and uses an encryption algorithm to encrypt the sensitive information in the searchable index to generate secure index information, the keyword-related information extracted by the cloud server is the encrypted document name, symmetric key ciphertext, multiple keyword labels, encrypted document vector, and non-sensitive information corresponding to each original document, and constructs a first list containing the relevant information. It can be understood that the indexing method of the first list is: the document identifier corresponding to each original document points to the set containing keywords corresponding to each original document, which includes the encrypted document name, symmetric key ciphertext, multiple keyword labels, encrypted document vector, and non-sensitive information. In this way, the data owner first encrypts the content in the searchable index locally to generate secure document index information, and then uploads it to the cloud server to avoid the exposure of the plaintext information of the document after the unencrypted index information is uploaded, thereby improving the security of the data.

[0100] In one embodiment, the second list includes the following information:

[0101] Keyword tags;

[0102] Document identification.

[0103] In actual application, the keyword label is that the data owner extracts keywords from the content of the original document, and selects an encryption algorithm to encrypt the extracted keywords to obtain the encrypted ciphertext of the keywords.

[0104] In actual application, the document identifier is the identification information assigned by the cloud server to each encrypted original document, and is the unique identifier of each original document.

[0105] In actual application, the cloud server extracts relevant information from the security index and encrypted original document provided by the data owner. It can be understood that when the data owner constructs a security index based on the dictionary ciphertext, the relevant information extracted by the cloud server is the label of the keyword corresponding to each original document, thereby constructing a second list of labels containing the keyword. It can be understood that the indexing method of the second list is: the label of each keyword points to the document identifier of the original document containing the keyword.

[0106] In practical applications, the encryption method of searchable encryption in the embodiments of the present application can be symmetric searchable encryption (SSE) and asymmetric searchable encryption (ASE), the latter also known as public key searchable encryption (PEKS). The difference between the two is that the former uses a symmetric encryption algorithm, and the encryption and decryption keys are the same, while the latter uses an asymmetric encryption algorithm, which can be set according to actual needs, and this application does not make specific limitations on this. Among them, the symmetric searchable encryption algorithm can be described as: SSE = (Key Gen, Encrypt, Trapdoor, Search, Decrypt), where K = KeyGen (λ): λ is a security parameter, and the algorithm generates an encryption key K based on the security parameter; (I, C) = Encrypt (K, D): D is a set of plaintext files, D = (D1, D2, ..., Dn), and the algorithm generates a file index I ciphertext file set C = (C1, C2, ..., Cn), and some schemes do not need to generate an index; Tw = Trapdoor (K, W): where W is the keyword to be queried by the user, and the algorithm generates a trapdoor Tw corresponding to the keyword W; D(W) = Search (I, Tw): The algorithm searches according to the trapdoor Tw generated by the user input and the index I of the file, and outputs a file set D(W) that matches the input keyword; Di = Decrypt (K, Ci): The returned ciphertext file Ci is decrypted with the generated key K to generate a plaintext file Di. Asymmetric searchable encryption can be described as: PEKS = (Key Gen, Encrypt, Trapdoor, Test), where (pk, sk) = Key Gen (λ): λ is a security parameter, and the algorithm generates a public key pk and a private key sk based on the security parameter; Cw = Encrypt (pk, W): using the generated public key pk and the keyword W of the encrypted file, generate the keyword ciphertext Cw; Tw = Trapdoor (sk, W): using the generated private key sk and the keyword W input by the user, generate the trapdoor Tw of the keyword w; b = Test (pk, Cw, Tw): based on the generated public key pk, the trapdoor Tw of the keyword W and the keyword ciphertext Cw, calculate the matching similarity and output the judgment value b∈{0, 1}.

[0107] The indexing method of the documents in the second list is to point to the documents by keywords. In one embodiment, in step 103, the ranking result of the documents to be searched is determined based on the first information, the first list and the second list, including:

[0108] Determining one or more documents to be searched based on the tags of the keywords to be searched and the second list;

[0109] A ranking result is determined based on the one or more documents to be searched and the first list.

[0110] In actual application, the indexing method of the documents in the second list is to point to documents by keywords, that is, documents containing the keywords can be retrieved according to the keywords. The documents to be searched are documents containing the keywords to be searched.

[0111] In actual application, the cloud server searches the second list according to the tag of the keyword to be searched, locates the keyword that is consistent with the tag of the keyword to be searched, and retrieves one or more documents containing the keyword according to the keyword, thereby determining the document to be searched. Furthermore, according to the document identifier of the determined document to be searched, a consistent document identifier is retrieved in the first list, and the corresponding keyword-related information is retrieved according to the content pointed to by the document identifier, and then the sorting result of the document to be searched is determined according to the keyword-related information. In this way, by calling the first list and the second list stored in the blockchain, one or more documents to be searched are determined, which ensures that the content in the index table corresponding to the determined document to be searched is safe and untampered information, thereby improving the security of the data.

[0112] The indexing method of the documents in the first list is that the documents point to keywords. In one embodiment, the step of determining the sorting result based on one or more documents to be searched and the first list includes:

[0113] Based on the first list, obtaining fourth information, the fourth information indicating a document vector of a document to be searched corresponding to the keyword to be searched;

[0114] Determine a relevance score based on the search vector and the document vector;

[0115] Based on the relevance scores, the ranking results are determined.

[0116] In actual application, after determining the document to be searched, locate the corresponding index position in the first list according to the document identifier of the document to be searched, and extract the keyword related information pointed to by the document identifier. As mentioned above, the keyword related information in the first list includes the encrypted document name, symmetric key ciphertext, multiple keyword labels, encrypted document vectors, and non-sensitive information. Based on the keyword related information in the first list, the encrypted document vector of the document to be searched corresponding to the keyword to be searched is obtained.

[0117] In actual application, after obtaining the document vector from the first list, the correlation score between the document vector and the search vector is calculated based on the search vector corresponding to the keyword to be searched and the document vector of the document to be searched sent by the data user. It can be understood that the higher the correlation score, the higher the similarity between the keyword to be searched and the original document to be retrieved, and the more accurate the retrieval result.

[0118] The embodiment of the present application can calculate the correlation score between the document vector and the search vector by calculating the Euclidean distance between the two. In this way, the similarity between multiple keywords to be searched and the documents to be searched can be measured by calculating the Euclidean distance, and the fuzzy similarity can be determined, so that fuzzy ciphertext search based on multiple keywords can be realized.

[0119] In one embodiment, in step 104, the second information is returned to the data user, and the method further includes:

[0120] Receive fifth information, where the fifth information indicates a search result determined by the smart contract based on a security index corresponding to a keyword of the original document and a label of the keyword to be searched in the first information;

[0121] When the search result indicates that an original document matching the tag of the keyword to be searched can be found in the security index, the second information is returned to the data user.

[0122] In actual application, the smart contract obtains the security index from the data owner and the label of the keyword to be searched from the data user, performs matching calculations based on the security index and the label of the keyword, and determines whether it is possible to retrieve information with the same label containing the keyword to be searched from the security index. If it is possible, it indicates that the original document corresponding to the security index contains the keyword to be searched, thereby determining the search result and sending the search result to the cloud server. If the search result indicates that the original document matching the label of the keyword to be searched can be found in the security index, the cloud server returns the document corresponding to the keyword to be searched in the search document to the data user.

[0123] In the embodiment of the present application, the smart contract calls the security index stored in the blockchain, performs matching calculations on the security index and the keyword label, and then feeds back the search results to the cloud server to assist the cloud server in performing the search operation, so that even if risks such as keyword guessing attacks occur inside the cloud server, the correct search operation can still be performed according to the search results fed back by the smart contract. In this way, the use of smart contracts as a trusted third party to perform retrieval work in the embodiment of the present application can not only prevent keyword guessing attacks inside the cloud server, but also solve the problem of incorrect retrieval results.

[0124] In one embodiment, the second information further includes a first document identifier corresponding to the keyword to be searched, and in step 104, the second information is returned to the data user. The method further includes:

[0125] Acquire sixth information, where the sixth information indicates a second document identifier corresponding to the keyword to be searched returned by the smart contract to the data user;

[0126] When the first document identifier is consistent with the second document identifier returned by the smart contract, the second information is returned to the data user.

[0127] In actual application, the cloud server returns the document corresponding to the keyword to be searched in the search document to the data user according to the sorting result, and at the same time returns the first document identifier corresponding to the keyword to be searched to the data user. The first document identifier is the document identifier of the document to be searched returned by the cloud server, so that the data user can quickly locate the document identifier most relevant to the keyword according to the sorting result, thereby improving search efficiency.

[0128] In actual application, the second document identifier is the document identifier of the document to be searched returned by the smart contract. After performing matching calculations based on the security index and the label of the keyword to be searched, the smart contract determines the document identifier corresponding to the document containing the label of the keyword from the security index, thereby determining the second document identifier.

[0129] In actual application, after receiving the first document identifier and the second document identifier, the data user verifies the first document identifier and the second document identifier. If the verification result indicates that the first document identifier returned by the cloud server is consistent with the second document identifier returned by the smart contract, it indicates that the first document identifier returned by the cloud server is correct. At this time, the next step can be performed to return the document corresponding to the keyword to be searched to the data user. It can be understood that the documents stored in the cloud server are all encrypted original documents. When the data user verifies that the document identifier is correct, the encrypted original document is decrypted to obtain the plaintext document corresponding to the keyword to be searched.

[0130] The embodiment of the present application utilizes blockchain technology to verify the document based on the second document identifier returned by the smart contract and the first document identifier returned by the cloud server, and then decrypts the document if the verification is correct. In this way, the blockchain technology is combined with the searchable encryption scheme to avoid malicious servers from tampering with the data, and the smart contract is used as a trusted third party for retrieval, which prevents keyword guessing attacks within the cloud server; in addition, the document to be downloaded is comprehensively determined based on the calculation results of both the smart contract and the cloud server, which improves the accuracy of the retrieval results.

[0131] The present application is described in further detail below in conjunction with application examples.

[0132] In a practical scenario, refer to Figure 2 As shown, a method for ciphertext retrieval query is proposed, which is described as follows:

[0133] Step 201: The data owner generates a ciphertext document and a security index.

[0134] First, the data owner preprocesses the original transmitted documents.

[0135] In actual application, the original documents to be uploaded, i.e., the plaintext document set, are recorded as set C: {F1, F2, ...F n}, the data owner has a i (1≤i≤n) is processed by the language analyzer to generate the document name FN i , keyword set W i 、Keywords w j In Document F i The number of times a word appears in the word is called word frequency. Sensitive information such as document size, modification time, etc. i , thereby obtaining document-related information. The document-related information includes:

[0136]

[0137] Among them, FN i is the document name, 1≤i≤n;

[0138] For each keyword The number of times it appears in document F is the word frequency, t i For document F i The number of keywords contained in .

[0139] Second, the data owner generates the relevant key.

[0140] In actual application, the data owner selects an encryption scheme and generates a key for encryption and decryption according to the selected encryption scheme. The steps include: the data owner generates a search key k according to the security parameter λ HMAC And the key K = {S, M1, M2} of the secure KNN algorithm, where S is a random M-bit one-dimensional vector, M1, M2 are two M×M reversible matrices. At the same time, the data owner generates an access key for each document, that is, the symmetric key k ENC The key generated by the embodiment of the present application is used to encrypt and decrypt original documents, searchable indexes, and retrieval requests.

[0141] The embodiment of the present application can select a suitable encryption algorithm and generate corresponding encryption parameters based on one or more keywords input by the user. The encryption parameters include a public key for encryption and a private key for decryption, etc. When the input keyword changes, the corresponding encryption parameters can still be generated and the corresponding ciphertext retrieval process can be performed, which has good adaptability.

[0142] Third, the data owner establishes a security index based on the key and generates a ciphertext document.

[0143] In actual application, the data owner extracts keywords from a document set C consisting of multiple local original documents to form a keyword set W, and uses the keyword set to build a searchable index I, which is the index information of the document. The document index information includes a logical pointer pointing to the document, a logical address of the document, and an index table built based on the logical pointer and the logical address. The data owner selects an encryption algorithm to encrypt the searchable index I into a more secure index structure, namely, a secure index I. ′ , thereby establishing a security index.

[0144] In actual application, the data owner constructs a keyword dictionary and document vector, and combines the constructed keyword dictionary and document vector with the document name FN generated above i , symmetric key k ENC , non-sensitive information i A searchable index I is constructed, and an encryption algorithm is used to encrypt sensitive information in the searchable index to generate secure index information.

[0145] In actual application, the data owner constructs the keyword dictionary and document vector by: segmenting the text of the documents in the document collection, obtaining the keyword set W of each document i , for each document’s keyword set W i Find the union and construct an ordered keyword dictionary W = {w1, w2, ...w m}; and construct an M-dimensional (M>m) normalized document vector FV for each document based on the dictionary W i , where 1≤j≤m, document vector FV i The calculation is as follows:

[0146]

[0147] Among them, FV i is the document vector, indicating the keywords w at different positions j In Document F i The keyword set W i The components in , and the rest of the components are 0;

[0148] w j is the keyword;

[0149] W i is the keyword set of each document;

[0150] For each keyword w j In Document F i The number of times a word appears in a sentence is called word frequency.

[0151] In an embodiment of the present application, a language analysis based on contextual semantics is performed on the original document, keywords are extracted therefrom, and a document vector containing the contextual semantic information of the document text is constructed for the extracted keywords. The document vector can more accurately describe the number of times a certain keyword appears in the document, so that data users can quickly locate documents containing the keyword and with a large number of occurrences based on the keyword, thereby improving the accuracy of search results and retrieval efficiency.

[0152] Generally, the length of a document vector is consistent with the size of the dictionary. The embodiment of the present application takes into account that the size of the dictionary will increase with the increase of documents, so the dimension of the document vector is expanded to M. The size of M can be set as appropriate according to the maximum size of the dictionary in actual applications, and the present application does not make any specific limitations on this.

[0153] In actual application, the data owner selects an encryption algorithm for each document F i and its corresponding searchable index, including the sensitive information in the document name FN i , keyword set W i 、Keywords w j In Document F i The number of times a word appears in the word is called word frequency. And according to word frequency The calculated document vector FV i Sensitive information such as HTTPS is encrypted to obtain encrypted index information.

[0154] In one case, the data owner generates a key to encrypt the plaintext document F. i Encrypt to generate ciphertext document F i ';

[0155] In one case, a symmetric encryption algorithm ENC and a symmetric key are used The encrypted file names are as follows:

[0156]

[0157] In one case, the document vector is encrypted using the secure KNN algorithm and the key K as follows:

[0158] FV i ′ =KNN(FV i, K)

[0159] In one case, a hash function (Hash-based Message Authentication Code, HMAC) is used to calculate the label of the keyword in the dictionary as follows:

[0160] w j ′ =HMAC(w j , k HMAC )

[0161] Among them, 1≤j≤m, W ′ ={w1 ′ , w2 ′ , …w m ′}.

[0162] In one case, an elliptic curve encryption algorithm may be used to encode keywords of a keyword set onto a generating point V of a curve E, and a representation of the keyword set on the elliptic curve may be output to encrypt the keywords, thereby generating a dictionary ciphertext locally.

[0163] In actual application, the document name needs to be displayed on the client corresponding to the data user during the retrieval stage, and the document name needs to be decrypted again after encryption; the encrypted keywords are used to retrieve documents and do not need to be decrypted after encryption; the word frequency is used to score and sort the documents and does not need to be decrypted after encryption; non-sensitive information does not need to be encrypted.

[0164] Step 202: The data owner uploads the encrypted document and security index to the cloud server.

[0165] In actual application, after the data owner generates a security index and ciphertext document containing the dictionary ciphertext locally, he packages multiple ciphertext documents, uploads the security index and the packaged ciphertext document collection to the blockchain for storage, and simultaneously uploads the dictionary ciphertext and the encrypted ciphertext document to other storage units of the cloud server. The storage location of other storage units is different from that of the blockchain.

[0166] In actual application, the data owner will contain the encrypted dictionary W ′ The security index information of all documents is packaged and uploaded to the cloud server. The packaged uploaded data includes:

[0167]

[0168] Among them, FN i is the document name, 1≤i≤n;

[0169] Is a symmetric key The ciphertext of

[0170] is the encrypted keyword, t i For document F i The number of keywords contained in ;

[0171] FV i ′ is the encrypted document vector;

[0172] OF i This is non-encrypted, non-sensitive information.

[0173] Among them, according to the symmetric key in different application modes The corresponding ciphertext The generation method is different, and this application does not make any specific limitation on this.

[0174] Step 203: The cloud server creates a forward index table and a reverse index table based on the ciphertext document and security index uploaded by the data owner.

[0175] After receiving the data packet containing security index, ciphertext document, and dictionary ciphertext sent by the data owner, the cloud server first assigns a unique file identifier (File Identifier Descriptor, FID) to each document, and then establishes a forward index table and a reverse index table respectively, and stores the established forward index table and reverse index table to the blockchain, and at the same time stores the ciphertext document sent by the data owner to other storage units of the cloud server.

[0176] The indexing method of the documents in the forward index table is from the document to the keyword, which corresponds to the first list mentioned above. Based on the document index information in the security index, the cloud server establishes a document identifier FID pointing to the encrypted document name FN i ′ , symmetric key ciphertext k ENCi ′ , the set of encrypted keywords is the dictionary ciphertext (corresponding to the labels of the aforementioned multiple keywords) w1 ′ …w j ′ , encrypted document vector FV i ′ , unencrypted non-sensitive information i The forward index table of the content has the following logical structure: Figure 3 shown.

[0177] The indexing method of the documents in the forward index table is to point to the documents by keywords, which corresponds to the second list mentioned above. The cloud server creates a label w1 composed of the dictionary ciphertext, i.e., the keyword, based on the document index information in the security index. ′ …wj ′ The inverted index table points to multiple document identifiers FID respectively, and its logical structure is as follows Figure 4 shown.

[0178] The embodiment of the present application utilizes blockchain technology to store both the forward index table and the reverse index table in the blockchain to prevent malicious servers from tampering with the data.

[0179] Step 204: The cloud server sends the inverse document frequency to the data owner.

[0180] First, the cloud server calculates the inverse document frequency corresponding to each keyword.

[0181] The cloud server calculates the inverse document frequency corresponding to each keyword in the dictionary based on the contents of the forward index table and the inverted index table as follows:

[0182]

[0183] Where N is the total number of documents, in units;

[0184] To contain the keyword w j The number of documents in .

[0185] The value of the inverse document frequency (IDF) represents the frequency of a keyword appearing in a document set. It is understandable that the larger the value of IDF, the smaller the number of documents containing the keyword, indicating that the keyword has a better ability to distinguish. The cloud server calculates the corresponding Get all the corresponding keywords

[0186] Secondly, the cloud server sends all the data to the data owner. It is sent to the owner in lexicographic order so that the data owner receives the inverse document frequency sent by the cloud server.

[0187] Step 205: The data owner sends document-related information to the authorized data user.

[0188] When an authorized data user has a document retrieval requirement, the data owner sends document-related information to the authorized data user so that the data user can generate retrieval information based on the document-related information. The document-related information includes the search key k generated locally by the data owner. HMAC and K = {S, M1, M2}, the keyword set, i.e. the dictionary W = {w1, w2, ... w m} and the keywords w received from the cloud server jThe corresponding inverse document frequency

[0189] In actual application, the data owner can send document-related information to the data user through a secure channel, where the secure channel is a channel established between the authorized data user and the data owner, and the secure channel can use encrypted transmission to ensure the security of data transmission.

[0190] Step 206: The data user generates search information based on document-related information.

[0191] In actual application, data users register with data owners using their user identities (ID). After the data owner selects a user they trust (including themselves), the data user obtains authorization from the data owner. After receiving document-related information sent by the data owner, the authorized data user generates a query trap based on their own search needs, which is used to perform keyword matching in the search process according to the query trap. Furthermore, the search information is determined according to the query trap.

[0192] In actual application, a data user receives the dictionary W and the corresponding IDF value sent by the data owner and stores them in a local storage unit of the data user in advance.

[0193] In actual application, data users perform language analysis on query statements to obtain the query keyword set W Q ={w1, w2, ... w s}, s≥2.

[0194] In actual application, data users query keyword set W Q , dictionary W and the IDF values ​​corresponding to the keywords in the dictionary to construct an M-dimensional normalized query vector QV, where the query vector QV is calculated as follows:

[0195]

[0196] Among them, QV[j] is the keyword w at different positions in the dictionary W. j In the query keyword set W Q The components in , and the rest of the components are 0;

[0197] w j is the keyword in the document;

[0198] W Q is a set of query keywords;

[0199] is the inverse document frequency.

[0200] After determining the query vector QV, the data user selects an encryption algorithm to encrypt the query vector and query keywords to obtain encrypted information, and generates a query trap T based on the encrypted information. Q , T Q Include {w1 ′ , w2 ′ ,…,w s ′ , QV ′}, and according to T Q Generate retrieval information containing keywords and query vectors. For different query vectors, multiple corresponding query traps can be constructed.

[0201] In one case, the secure KNN algorithm is used to encrypt the query vector as follows:

[0202] QV ′ = KNN(QV, K);

[0203] In one case, the query keyword tag is calculated using a hash function as follows:

[0204] w j ′ =HMAC(w j , k HMAC ), 1≤j≤s.

[0205] Step 207: The data user sends a query trap to the smart contract and simultaneously sends search information to the cloud server.

[0206] In actual application, the data user sends a ciphertext search request to the cloud server, and the ciphertext search request includes search information, which is used by the cloud server to return the ciphertext document to the data user. In one case, the data user can also generate a search request based on a query keyword set. In one case, the data user directly sends the query trap as search information to the cloud server, and the cloud server calls the query trap to perform a search operation.

[0207] In actual application, data users generate query trapdoors based on retrieval requests. The query trapdoors are compatible with security indexes, and the generated query trapdoors are uploaded to the blockchain for storage, so that smart contracts can call the query trapdoors to perform search operations.

[0208] In actual application, data users need to obtain authorization from the data owner before uploading the generated trapdoor to the private blockchain for storage, and then they can use the corresponding blockchain account file. In this way, the data user's access to the private blockchain is restricted through authorization, ensuring the user's data privacy and the correctness of access control verification.

[0209] In actual application, based on blockchain technology, the sharing permissions of encrypted documents can be set and restricted through smart contracts, thereby achieving preliminary control over document retrieval and data access, assisting cloud servers in performing search operations, ensuring secure access to data, and improving the access security of encrypted data or encrypted documents.

[0210] Step 208: The cloud server determines the ranking results of the documents to be searched based on the search information.

[0211] After receiving the search information sent by the data user, the cloud server will j ′ Retrieve the dictionary in the inverted index table, find the keyword tag of the document in the inverted index table that matches the query keyword and query vector, and take out the document identifiers of all documents corresponding to the keyword tag from the inverted index table, and build a collection based on the document identifiers corresponding to all documents that meet the keyword matching requirements It can be understood that if no keyword tag matching the search information is found in the inverted index table, then the set is constructed. For each keyword tag and query vector, determine the set And for all determined sets The intersection is taken to finally form a document identifier set R, thereby determining one or more documents to be searched.

[0212] The keyword matching in the embodiment of the present application refers to the ability to search for encrypted keywords that are consistent with and / or similar to the query keyword tag in the index list.

[0213] Further, the cloud server sorts the documents to be searched based on one or more documents to be searched, including: the cloud server determines the document vector FV in the index content of the document to be searched from the forward index table according to the document identifier in the set R. The cloud server calculates the relevance score between the query vector QV and the document vector FV according to the query vector QV and the document vector FV in the retrieval information sent by the data user, and sorts the documents according to the relevance score to obtain the sorting result of the documents to be searched. The relevance score is calculated as follows:

[0214]

[0215] Among them, R Score (F, Q) is the correlation score between the query vector QV and the document vector FV;

[0216] w j is the keyword;

[0217] W Q is a set of query keywords;

[0218] is the normalized inverse document frequency;

[0219] is the normalized word frequency;

[0220] FV is the document vector, FV ′ is the encrypted document vector;

[0221] QV is the query vector, QV ′ is the encrypted query vector.

[0222] Among them, the normalized word frequency is calculated as follows:

[0223]

[0224] in, is the normalized word frequency;

[0225] w j is the keyword;

[0226] W i is the keyword set of each document;

[0227] For each keyword w j In Document F i The number of times a word appears in a sentence is called word frequency.

[0228] Among them, the normalized inverse document frequency is calculated as follows:

[0229]

[0230] in, is the normalized inverse document frequency;

[0231] w j is the keyword in the document;

[0232] W Q is a set of query keywords;

[0233] is the inverse document frequency.

[0234] Step 209: The smart contract returns search results to the cloud server and data users based on the query trap and security index.

[0235] The smart contract calls the trapdoor generation algorithm, processes the query trapdoor, and sends the processing result to the blockchain network. In the blockchain network, the smart contract retrieves the security index and query trapdoor stored in the blockchain, performs matching calculations on the security index and query trapdoor, and determines the search matching result. When the matching result shows a successful match, the smart contract returns the search result to the data user. The search result includes the symmetric key K, the corresponding document identifier FID2, and the hash result Hi2. In this way, using the smart contract as a trusted third party for retrieval can not only prevent keyword guessing attacks within the cloud server, but also solve the problem of incorrect retrieval results.

[0236] Step 210: The cloud server returns document information to the data user based on the search results returned by the smart contract and the sorting results of the documents to be searched.

[0237] The cloud server determines the matching results of the security index and the query trap based on the search results returned by the smart contract. If the matching result is displayed as successful, it means that there is a document containing the query keyword. At this time, the cloud server returns the document information to the data user according to the sorting results of the document identifiers of the documents to be searched. The returned document information includes the document identifier FID1 of the document to be searched, the ciphertext document Ci, and the encrypted document name, i.e. the document name ciphertext FN ′ , symmetric key ciphertext k ENC ′ And some other non-sensitive information that needs to be displayed i .

[0238] In actual application, the matching results can be stored in the ledger file of the blockchain. The cloud server can determine whether there are documents containing the query keywords stored locally by comparing the record information of the matching results in the blockchain, and then return the document information to the data user.

[0239] Step 211: The data user selects a target document based on the document information and sends a document identifier corresponding to the target document to the cloud server.

[0240] The data user uses the symmetric key ciphertext k in the document information ENC ′ Get the symmetric key k ENC , and then use the symmetric key to decrypt the document name to obtain the plain text information of the document name, and display the document name and its corresponding document information according to the sorting result of the document identifier, and the display method can be a document display list. The data user can select the target document to be downloaded by browsing the document display list. Further, the data user sends the document identifier corresponding to the selected target document to the cloud server.

[0241] Step 212: The cloud server returns the target ciphertext document to the data user according to the document identifier.

[0242] The cloud server returns the corresponding ciphertext document and encryption key to the data user based on the document identifier sent by the data user.

[0243] Step 213: After verifying that the target ciphertext file is a legitimate file, the data user obtains the target plaintext document.

[0244] First, the data user verifies whether the ciphertext file is a legitimate file.

[0245] When the data user receives the ciphertext file returned by the cloud server, he first checks whether the document identifier FID1 sent by the cloud server is consistent with the document identifier FID2 issued by the smart contract. If they are consistent, it indicates that it is a safe document. Furthermore, the ciphertext document Ci issued by the file cloud server is hashed with the identifier FID1 to obtain the hash result Hi1, and then checks whether the hash result Hi1 is consistent with the hash result Hi2 in the packaged ciphertext document Ci′ issued by the smart contract. If they are consistent, it indicates that it is a correct document. At this time, the verification result is successful, thus completing the verification. In this way, by verifying the ciphertext file, it is checked whether the cloud server has erroneously sent the file or maliciously tampered with the data, thereby ensuring the security of the document.

[0246] Secondly, when the data user verifies that the target ciphertext file is a legitimate file, the symmetric key k is used ENC Decrypt the successfully verified ciphertext document to obtain the secure document plaintext.

[0247] In the embodiment of the present application, a smart contract is used as a trusted third party to perform retrieval work, which prevents keyword guessing attacks within the cloud server. In addition, the documents to be downloaded are comprehensively determined based on the calculation results of both the smart contract and the cloud server, which improves the accuracy of the retrieval results.

[0248] In a practical scenario, refer to Figure 5 As shown in the figure, a system model for ciphertext retrieval query is proposed, which can achieve the above Figure 2 The method shown, the system model 500 includes: a data owner (Data Owner, DO) 501, a cloud server (Cloud Server, CS) 502, a smart contract (Smart Contract, SC) 503, and a data user (Authorized User, AU) 504; wherein,

[0249] The data owner 501 is used to store and encrypt local documents, send security indexes and packaged ciphertext documents to the smart contract 503, and store the security indexes on the blockchain; upload ciphertext documents to the cloud server 502; and send document information to the authorized data user 504.

[0250] The cloud server 502 is used to return the target ciphertext document to the data user 504 according to the search request of the data user 504 and / or the search result sent by the smart contract 503; and can call the security index stored on the blockchain to generate a forward index table and a reverse index table.

[0251] Smart contract 503 is used to perform search matching and determine search results based on the security index sent by data owner 501 and the query trap sent by data user 504; send search results to cloud server 502; and send a ciphertext set to data user 504.

[0252] Data user 504 is used to send a search request and / or search information to the cloud server 502 so that the cloud server 502 returns the target ciphertext document; generate a query trap based on the query keyword, and send the query trap to the smart contract 503.

[0253] For the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0254] The embodiment of the present application uses smart contracts to assist in the retrieval of cloud servers, thereby reducing part of the computing workload of the cloud servers, thereby improving the accuracy of the retrieval results while making the retrieval faster and more efficient.

[0255] The embodiments of the present application can be used in but are not limited to the following application scenarios: ciphertext retrieval systems, ciphertext retrieval infrastructure for security assessments of commercial finance, financial institutions, government agencies, etc., as well as ciphertext retrieval scenarios in Internet-related industries such as Internet + government affairs, Internet + taxation, Internet + credit, Internet + insurance, and Internet + banking.

[0256] In order to implement the search method of the embodiment of the present application, the embodiment of the present application also provides a search device, referring to Figure 6 As shown, the search device 600 includes: an acquisition unit 601 and a processing unit 602; wherein,

[0257] An acquisition unit 601 is configured to receive first information sent by a data user, where the first information includes a label of a keyword to be searched and a search vector corresponding to the keyword to be searched;

[0258] The acquisition unit 601 is further used to acquire a first list and a second list of the blockchain, where the indexing methods of the documents in the first list and the second list are different;

[0259] A processing unit 602 is used to determine a ranking result of the documents to be searched based on the first information, the first list and the second list;

[0260] The processing unit 602 is further configured to return second information to the data user according to the sorting result, where the second information includes documents corresponding to the keywords to be searched in the documents to be searched.

[0261] in,

[0262] In one embodiment, the acquisition unit 601 is specifically configured to: receive third information sent by the data owner, the third information including a security index corresponding to a keyword of the original document and the encrypted original document;

[0263] In one embodiment, the processing unit 302 is specifically configured to: establish a first list and a second list based on the third information; and store the first list and the second list in the blockchain.

[0264] In one embodiment, the indexing method of the documents in the second list is to point to the documents by keywords, and the processing unit 302 is specifically used to: determine one or more documents to be searched based on the labels of the keywords to be searched and the second list; determine the sorting results based on the one or more documents to be searched and the first list.

[0265] In one embodiment, the indexing method of the documents in the first list is that the documents point to keywords, and the acquisition unit 601 is specifically used to: based on the first list, acquire fourth information, the fourth information indicating the document vector of the document to be searched corresponding to the keyword to be searched;

[0266] In one embodiment, the processing unit 302 is specifically configured to: determine a relevance score based on the search vector and the document vector; and determine a ranking result based on the relevance score.

[0267] In one embodiment, the acquisition unit 601 is specifically configured to: receive fifth information, where the fifth information indicates a search result determined by the smart contract based on a security index corresponding to a keyword of the original document and a tag of a keyword to be searched in the first information;

[0268] In one embodiment, the processing unit 302 is specifically configured to return second information to the data user when the search result indicates that an original document matching a tag of the keyword to be searched can be found in the security index.

[0269] In one embodiment, the second information further includes a first document identifier corresponding to the keyword to be searched, and the acquisition unit 601 is specifically used to: acquire sixth information, where the sixth information indicates a second document identifier corresponding to the keyword to be searched returned by the smart contract to the data user;

[0270] In one embodiment, the processing unit 302 is specifically used to return the second information to the data user when the first document identifier is consistent with the second document identifier returned by the smart contract.

[0271] In one embodiment, the acquisition unit 601 is specifically used to: acquire a first list of the blockchain, the first list including one or more of the following information: document identification; encrypted document name; symmetric key ciphertext; labels of multiple keywords; encrypted document vector; non-sensitive information.

[0272] In one embodiment, the acquisition unit 601 is specifically used to: acquire a second list of the blockchain, the second list including the following information: a tag of a keyword; and a document identifier.

[0273] For the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0274] In order to implement the search method of the embodiment of the present application, the embodiment of the present application also provides a search device, referring to Figure 7 As shown, the search device 700 includes: a processor 701, a memory 702, and a communication bus 703; wherein,

[0275] Processor 701, configured to execute the method provided by one or more of the above technical solutions when running a computer program;

[0276] A memory 702 for storing computer programs that can be run on the processor 701;

[0277] The communication bus 703 is used to realize the communication connection between the processor 701 and the memory 702.

[0278] It should be noted that the specific processing process of the processor 701 can be understood by referring to the above method, which will not be repeated here.

[0279] Of course, in actual application, the various components in the search device 700 are coupled together via the communication bus 703. It is understandable that the communication bus 703 is used to realize the connection and communication between these components. In addition to the data bus, the communication bus 703 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 7 Various buses are labeled as communication buses 703.

[0280] The memory 702 in the embodiment of the present application is used to store various types of data to support the operation of the search device 700. Examples of such data include: any computer program used to operate on the search device 700.

[0281] The method disclosed in the above embodiment of the present application can be applied to the processor 701, or implemented by the processor 701. The processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 701. The processor 701 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 701 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 702, and the processor 701 reads the information in the memory 702 and completes the steps of the above method in combination with its hardware.

[0282] In an exemplary embodiment, the search device 700 can be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.

[0283] It can be understood that the memory (memory 702) of the embodiment of the present application can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Sync Link Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.

[0284] In an exemplary embodiment, the present application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, a memory 702 storing a computer program, and the computer program in the memory 702 can be executed by a processor 701 of a search device 700 to complete the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.

[0285] In an exemplary embodiment, the embodiment of the present application further provides a computer program product, including a computer program, and the above computer program can be executed by the processor 701 of the search device 700 to complete the steps of the above method of the above search device.

[0286] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0287] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.

[0288] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.

Claims

1. A search method, characterized in that: Applied to a network device, the method comprises: receiving first information sent by a data user, wherein the first information includes a label of a keyword to be searched and a search vector corresponding to the keyword to be searched; Obtaining a first list and a second list of a blockchain, wherein the indexing methods of documents in the first list and the second list are different; Determine a ranking result of the documents to be searched based on the first information, the first list, and the second list; According to the ranking result, second information is returned to the data user, where the second information includes documents corresponding to the keyword to be searched in the documents to be searched.

2. The method according to claim 1, characterized in that The obtaining of the first list and the second list of blockchains includes: Receiving third information sent by the data owner, the third information including a security index corresponding to a keyword of the original document and the encrypted original document; Based on the third information, establishing the first list and the second list; The first list and the second list are stored in the blockchain.

3. The method according to claim 2, characterized in that The indexing method of the documents in the second list is to point to the documents by keywords, and the determining of the sorting results of the documents to be searched based on the first information, the first list and the second list includes: Determine one or more documents to be searched based on the label of the keyword to be searched and the second list; The ranking result is determined based on the one or more documents to be searched and the first list.

4. The method according to claim 3, characterized in that The indexing method of the documents in the first list is that the documents point to keywords, and the determining of the sorting result based on the one or more documents to be searched and the first list includes: Based on the first list, acquiring fourth information, wherein the fourth information indicates a document vector of the document to be searched corresponding to the keyword to be searched; Determining a relevance score based on the search vector and the document vector; Based on the relevance score, the ranking result is determined.

5. The method according to claim 2, characterized in that: The returning the second information to the data user includes: Receive fifth information, where the fifth information indicates a search result determined by the smart contract based on a security index corresponding to the keyword of the original document and a label of the keyword to be searched in the first information; In the case where the search result indicates that the original document matching the tag of the keyword to be searched can be found in the security index, the second information is returned to the data user.

6. The method according to claim 5, characterized in that The second information also includes a first document identifier corresponding to the keyword to be searched, and the method further includes: Acquire sixth information, where the sixth information indicates a second document identifier corresponding to the keyword to be searched, which is returned by the smart contract to the data user; When the first document identifier is consistent with the second document identifier returned by the smart contract, the second information is returned to the data user.

7. The method according to claim 1, characterized in that The first list includes one or more of the following information: Document identification; The encrypted file name; Symmetric key ciphertext; Tags for multiple keywords; Encrypted document vector; Non-sensitive information.

8. The method according to claim 1, characterized in that The second list includes the following information: Keyword tags; Document identification.

9. A search device, characterized in that: The device comprises: an acquisition unit, configured to receive first information sent by a data user, wherein the first information includes a label of a keyword to be searched and a search vector corresponding to the keyword to be searched; The acquisition unit is further used to acquire a first list and a second list of blockchains, wherein the indexing methods of the documents in the first list and the second list are different; A processing unit, configured to determine a ranking result of the documents to be searched based on the first information, the first list, and the second list; The processing unit is further configured to return second information to the data user according to the sorting result, wherein the second information includes documents corresponding to the keyword to be searched in the documents to be searched.

10. A search device, characterized in that: The device comprises: a processor and a memory for storing a computer program that can be run on the processor; wherein, The processor is used to execute the steps of the method according to any one of claims 1 to 8 when running the computer program.

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

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.