WO2022217926A1 - 一种图像查找方法、区块链、云服务器及图像查找装置 - Google Patents

一种图像查找方法、区块链、云服务器及图像查找装置 Download PDF

Info

Publication number
WO2022217926A1
WO2022217926A1 PCT/CN2021/132779 CN2021132779W WO2022217926A1 WO 2022217926 A1 WO2022217926 A1 WO 2022217926A1 CN 2021132779 W CN2021132779 W CN 2021132779W WO 2022217926 A1 WO2022217926 A1 WO 2022217926A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
vector
encrypted
index
blockchain
Prior art date
Application number
PCT/CN2021/132779
Other languages
English (en)
French (fr)
Inventor
苗银宾
李颖莹
范瑞彬
张开翔
李辉忠
严强
李成博
Original Assignee
深圳前海微众银行股份有限公司
西安电子科技大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳前海微众银行股份有限公司, 西安电子科技大学 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2022217926A1 publication Critical patent/WO2022217926A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6227Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • the embodiments of the present application relate to the field of financial technology (Fintech), and in particular, to an image search method, a blockchain, a cloud server, and an image search device.
  • Fetech field of financial technology
  • the image owner will send the encrypted image (ie, the ciphertext image) to a cloud server for storage by the cloud server.
  • the cloud server Based on the image query request of the querying party, the cloud server searches for the target ciphertext image that meets the image query request from each ciphertext image, and sends the target ciphertext image to the querying party.
  • the query party will decrypt the target ciphertext image based on the key passed by the image owner to obtain the plaintext image.
  • the present application provides an image search method, a blockchain, a cloud server and an image search device, which are used to overcome the cheating behavior of the cloud server when performing image search.
  • an embodiment of the present application provides an image search method, the method includes: the blockchain receives an image query request sent by a query party, where the image query request includes an encrypted query vector generated based on the image to be queried; The block chain searches for a target encrypted index vector matching the encrypted query vector from the encrypted indexes stored on the chain; wherein, each encrypted index includes an encrypted index vector and a hash value generated based on the encrypted index vector, the The encrypted index vector is generated by the image owner based on the corresponding plaintext image; the blockchain sends index information for indicating the target encrypted index vector to the cloud server, and receives the target encrypted index sent by the cloud server The target ciphertext image corresponding to the vector; the blockchain verifies whether the first hash value corresponding to the target ciphertext image is consistent with the second hash value corresponding to the target encryption index vector, and the verification result on the chain.
  • the encrypted index of each plaintext image sent by the image owner is stored by using the blockchain, so that when the blockchain searches for the encrypted index vector sent by the query party, it can use its own decentralized It can search all encrypted indexes stored on the blockchain, so it can overcome the shortcomings of the cloud server in the background technology that the retrieval of ciphertext images is incomplete; in addition, based on the verification behavior existing in the blockchain, the cloud server can be controlled.
  • the cloud server can be controlled.
  • the returned target ciphertext image is the ciphertext image consistent with the target encryption index vector, that is, the cloud server cannot tamper with the ciphertext image. In this way, the cheating behavior of the cloud server can be effectively controlled.
  • the encrypted query vector is generated by the query party according to the feature vector of the image to be queried and a similarity threshold; the similarity threshold is used to indicate the blockchain search and The encrypted query vector is an encrypted index vector that satisfies the similarity threshold.
  • the currently used cloud server returns the search results to the querying party based on the secure k-nearest neighbor algorithm (sorted in descending order of similarity). For the first k ciphertext images, after the retrieval results are sorted, the higher the ciphertext images are sorted, the greater the similarity with the image to be queried. Therefore, the cloud server in the background technology uses the sorting results and additional background knowledge. It will be able to guess the query request of the querying party, which will easily lead to the privacy leakage of the querying party.
  • the query party can generate an encrypted query vector based on the actual image similarity requirement (ie, similarity threshold), and the blockchain only needs to be responsible for the encrypted query vector Perform image search to obtain the target encrypted index vector, and the cloud server only needs to return the target ciphertext image to be verified to the blockchain according to the index information used to indicate the target encrypted index vector.
  • the actual image similarity requirement ie, similarity threshold
  • the cloud server cannot know which ciphertext image is the closest to the image to be queried, that is, the cloud server cannot infer the query request of the querying party based on the target ciphertext image, which can overcome the background technology
  • the possible privacy leakage problem of the cloud server in addition, based on the same logic as the cloud server, the blockchain will not be able to infer the query request of the queryer based on the target ciphertext image, that is, the blockchain will not generate the query request.
  • the problem of privacy leakage caused by the query request to be informed.
  • the encrypted index further includes an index number; and the blockchain sends index information for indicating the target encrypted index vector to a cloud server, including: the blockchain sends the The target index number corresponding to the target encrypted index vector is sent to the cloud server.
  • any two plaintext images can be distinguished by setting the index number. Therefore, when the image owner generates an encrypted index for a plaintext image, the index number of the plaintext image can also be introduced.
  • the index number can be used to reflect the uniqueness of the plaintext image as well as the uniqueness of the encrypted index. More specifically One point is to reflect that the encrypted index vector and hash value in the encrypted index have a one-to-one correspondence with the plaintext image and the ciphertext image corresponding to the plaintext image, so that the encrypted query is performed on the blockchain through the encrypted query.
  • the blockchain can send the target index number corresponding to the target encrypted index vector to the cloud server, so that the cloud server can return the corresponding target index to the blockchain based on the target index number.
  • the ciphertext image of the number for blockchain verification Setting the index number for the plaintext image and using the index number as the index information can quickly realize the search of the target ciphertext image by the cloud server.
  • the blockchain searches for a target encrypted index vector matching the encrypted query vector from an encrypted index stored on the chain, including: Any encrypted index in the encrypted index, determine the trace of the product of the encrypted index vector and the encrypted query vector in the encrypted index; if the blockchain determines that the trace meets the set threshold, the encrypted index vector will be used as the Describe the target encrypted index vector.
  • the blockchain when the blockchain searches the encrypted query vector, the blockchain extracts the encrypted index vector for any encrypted index stored on the chain, and compares the extracted encrypted index vector with the encrypted query vector. Multiply and trace the product. Finally, by comparing the size of the trace and the set threshold, the encrypted index vector corresponding to the trace that meets the set threshold is determined as the target encrypted index vector. In this way, the blockchain can not know the real image query request of the querying party on the basis of satisfying the completeness query of the querying party's image query request, that is, the privacy of the querying party will not be leaked.
  • an embodiment of the present application provides an image search method, the method includes: for any plaintext image, the image owner generates the plaintext image encryption index; the encryption index includes an encryption index generated based on the plaintext image vector and the hash value generated based on the encrypted index vector; the image owner uploads each encrypted index to the blockchain; the image owner encrypts each plaintext image into each ciphertext image and sends it to the cloud server.
  • the encrypted index of each plaintext image sent by the image owner is stored by using the blockchain, so that when the blockchain searches for the encrypted index vector sent by the query party, it can use its own decentralized It can search all encrypted indexes stored on the blockchain, so it can overcome the shortcomings of the cloud server in the background technology that the retrieval of ciphertext images is incomplete; in addition, based on the verification behavior existing in the blockchain, the cloud server can be controlled.
  • the cloud server can be controlled.
  • the returned target ciphertext image is the ciphertext image consistent with the target encryption index vector, that is, the cloud server cannot tamper with the ciphertext image. In this way, the cheating behavior of the cloud server can be effectively controlled.
  • generating the encrypted index of the plaintext image by the image owner includes: extracting, by the image owner, a first feature vector of the plaintext image; the image owner is based on a first random number to obtain the first extension vector of the first feature vector; the image owner processes the first extension vector based on the first key in the vector key to obtain a first diagonal matrix; the image Based on the second key and the third key in the vector key, the owner processes the first diagonal matrix and the preset lower triangular matrix to obtain an encrypted index vector; the image owner determines the Describe the index number of the plaintext image and the concatenated hash value of the ciphertext image; the image owner determines the index number of the plaintext image, the hash value and the encrypted index vector as the encrypted index.
  • the image owner Based on this scheme, the image owner generates a corresponding encrypted index vector for each plaintext image. After the generated encrypted index vectors are stored in the blockchain, they can be used for the blockchain to initiate the querying party.
  • the image query request is searched, so as to match the encrypted index vector that meets the query requirements of the query party; in addition, the image owner can also generate corresponding hash values for each plaintext image, and the generated hash values
  • After being stored on the blockchain it can be used in the blockchain to verify the ciphertext image returned by the cloud server, so as to determine whether the cloud server returns the one determined by itself (that is, the blockchain) that meets the query requirements of the querying party.
  • Ciphertext image for any plaintext image, the image owner sends the index number of the plaintext image together with the hash value and the encrypted index vector as an encrypted index to the blockchain for storage, since the index number is a plaintext image Therefore, after the blockchain finds and matches the encrypted index required by the querying party, the blockchain can send the index number of the encrypted index to the cloud server, so that the cloud server can send it to itself (that is, the blockchain ) returns the ciphertext image corresponding to each index number.
  • the image owner generates a first encrypted index based on the first plaintext image, and constructs a first transaction including the first encrypted index; the image owner For the second transaction and the first transaction corresponding to the second encryption index, determine the update random number; the update random number is used to instruct the second plaintext image to be updated to the first plaintext image; the image owner will The first transaction and the updated nonce are sent to the blockchain.
  • the image owner when the image owner wants to use the first encrypted index corresponding to the first plaintext image to update the second encrypted index corresponding to the second plaintext image stored on the blockchain, the image owner is generating the first After encrypting the index, a first transaction including the first encrypted index is constructed, and then the image owner can determine the update random number according to the first transaction and the second transaction corresponding to the second encrypted index, and the updated random number can be used to ensure the first transaction.
  • the plaintext image is correctly updated to the second plaintext image.
  • the owner of the image sends the first transaction and the updated random number to the blockchain, and the blockchain performs the update process of the first plaintext image to the second plaintext image.
  • an embodiment of the present application provides an image search method, the method includes: a cloud server receives index information sent by a blockchain; the index information is used to indicate a target encrypted index vector; the target encrypted index vector is an The blockchain is based on the image query request of the query party, and the encrypted index vector determined from the encrypted index stored on the chain and matched with the encrypted query vector in the image query request; the encrypted index vector is the image owner.
  • the encrypted query vector is generated based on the corresponding plaintext image, and the encrypted query vector is generated by the query party based on the image to be queried; the cloud server determines from each ciphertext image a target ciphertext image that conforms to the index information; The image is generated by the image owner by encrypting each plaintext image and sent to the cloud server for storage; the cloud server sends the target ciphertext image to the blockchain and the query party .
  • the encrypted index of each plaintext image sent by the image owner is stored by using the blockchain, so that when the blockchain searches for the encrypted index vector sent by the query party, it can use its own decentralized It can search all encrypted indexes stored on the blockchain, so it can overcome the shortcomings of the cloud server in the background technology that the retrieval of ciphertext images is incomplete; in addition, based on the verification behavior existing in the blockchain, the cloud server can be controlled.
  • the cloud server can be controlled.
  • the returned target ciphertext image is the ciphertext image consistent with the target encryption index vector, that is, the cloud server cannot tamper with the ciphertext image. In this way, the cheating behavior of the cloud server can be effectively controlled.
  • an embodiment of the present application provides an image search method, the method includes: a query party sends an image query request to a blockchain, where the image query request includes an encrypted query vector generated based on the image to be queried; the query receiving the target ciphertext image sent by the cloud server; the target ciphertext image is determined from the index information sent by the cloud server based on the blockchain and from each ciphertext image stored locally; the index information is used to indicate Target encrypted index vector, the target encrypted index vector is the encrypted index vector determined by the blockchain from the encrypted index stored on the chain and matched with the encrypted query vector; the encrypted index vector is the image owner.
  • the query party obtains the verification result corresponding to the image query request from the blockchain, and determines whether to decrypt the target ciphertext image; the verification result is the
  • the block chain is generated after checking whether the first hash value corresponding to the target ciphertext image is consistent with the second hash value corresponding to the target encryption index vector.
  • the encrypted index of each plaintext image sent by the image owner is stored by using the blockchain, so that when the blockchain searches for the encrypted index vector sent by the query party, it can use its own decentralized It can search all encrypted indexes stored on the blockchain, so it can overcome the shortcomings of the cloud server in the background technology that the retrieval of ciphertext images is incomplete; in addition, based on the verification behavior existing in the blockchain, the cloud server can be controlled.
  • the cloud server can be controlled.
  • the returned target ciphertext image is the ciphertext image consistent with the target encryption index vector, that is, the cloud server cannot tamper with the ciphertext image. In this way, the cheating behavior of the cloud server can be effectively controlled.
  • the method before the query party sends the image query request to the blockchain, the method further includes: the query party extracts a second feature vector of the image to be queried; the query party based on the second feature vector A random number and a similarity threshold to obtain a second extension vector of the second feature vector; the similarity threshold is used to instruct the blockchain to search for an encrypted index vector that satisfies the similarity threshold with the encrypted query vector ; Described inquiring party processes the second extended vector based on the first key in the vector key to obtain a second diagonal matrix; The inquiring party is based on the second key in the vector key and the first key With three keys, the second diagonal matrix and the preset lower triangular matrix are processed to obtain the encrypted query vector.
  • the querying party when the querying party generates the corresponding encrypted query vector for the image to be queried, if the querying party's image query request is to query similar images of the image to be queried, then in the process of generating the encrypted query vector by the querying party, the querying party will The encrypted query vector can be generated based on the actual image similarity requirements (ie similarity threshold), so that the blockchain that receives the encrypted query vector only needs to be responsible for image search based on the encrypted query vector to obtain the target encrypted index vector. It is only necessary to return the target ciphertext image to be verified to the blockchain according to the index information used to indicate the target encryption index vector.
  • the actual image similarity requirements ie similarity threshold
  • the cloud server currently in use is based on the secure k-nearest neighbor algorithm, it returns to the queryer the first k ciphertext images after sorting the search results (sorted in descending order of similarity). , the higher the ranking of the ciphertext image, the greater the similarity with the image to be queried, so the cloud server in the background technology will be able to guess the query request of the query party according to the ranking result and additional background knowledge, which is easy to cause The privacy leak of the querying party.
  • the cloud server in the solution of the present application cannot know the ciphertext image that is closest to the image to be queried.
  • the cloud server cannot infer the query request of the query party based on the target ciphertext image, so that the privacy leakage problem that may exist in the cloud server in the background technology can be overcome; in addition, based on the same logic as the cloud server, The blockchain will also be unable to infer the query request of the querying party based on the target ciphertext image, that is, there will be no privacy leakage problem caused by the blockchain learning the querying party's query request.
  • the embodiments of the present application provide a blockchain, including: a transceiver unit configured to receive an image query request sent by a query party, where the image query request includes an encrypted query vector generated based on an image to be queried; a search unit, It is used to find a target encrypted index vector matching the encrypted query vector from the encrypted index stored on the chain; wherein, each encrypted index includes an encrypted index vector and a hash value generated based on the encrypted index vector, and the The encrypted index vector is generated by the image owner based on the corresponding plaintext image; the transceiver unit is further configured to send index information for indicating the target encrypted index vector to the cloud server, and receive the information sent by the cloud server.
  • a target ciphertext image corresponding to the target encryption index vector a verification unit for verifying whether the first hash value corresponding to the target ciphertext image is consistent with the second hash value corresponding to the target encryption index vector, and Upload the verification result to the chain.
  • the encrypted query vector is generated by the query party according to the feature vector of the image to be queried and a similarity threshold; the similarity threshold is used to indicate the blockchain search and The encrypted query vector is an encrypted index vector that satisfies the similarity threshold.
  • the encrypted index further includes an index number; the transceiver unit is specifically configured to: send the target index number corresponding to the target encrypted index vector to the cloud server.
  • the search unit is specifically configured to: for any encrypted index in the encrypted index, determine the trace of the product of the encrypted index vector in the encrypted index and the encrypted query vector; If it is determined that the trace meets the set threshold, the encrypted index vector is used as the target encrypted index vector.
  • an embodiment of the present application provides an image search device, including: an encrypted index generation unit configured to generate an encrypted index of any plaintext image; the encrypted index includes an encrypted index vector generated based on the plaintext image and an encrypted index vector generated based on the plaintext image.
  • the hash value generated by the encrypted index vector; the sending unit is used to upload each encrypted index to the blockchain; the sending unit is also used to encrypt each plaintext image into each ciphertext image and send it to the cloud server.
  • the encryption index generation unit is specifically configured to: extract the first feature vector of the plaintext image by the image owner; and obtain the image owner based on the first random number The first extension vector of the first feature vector; the image owner processes the first extension vector based on the first key in the vector key to obtain a first diagonal matrix; the image owner is based on the For the second key and the third key in the vector key, the first diagonal matrix and the preset lower triangular matrix are processed to obtain an encrypted index vector; the image owner determines the index of the plaintext image number and the concatenated hash value of the ciphertext image; the image owner determines the index number of the plaintext image, the hash value and the encrypted index vector as the encrypted index.
  • the device further includes a transaction construction unit and an update random number determination unit;
  • the transaction construction unit is configured to generate a first encrypted index based on the first plaintext image, and construct a first encrypted index including the first plaintext image.
  • the first transaction of the encrypted index is configured to determine the updated random number according to the second transaction corresponding to the second encrypted index of the second plaintext image and the first transaction;
  • the updated random number is instructing the second plaintext image to be updated to the first plaintext image;
  • the sending unit is specifically configured to send the first transaction and the updated random number to the blockchain.
  • an embodiment of the present application provides a cloud server, including: a transceiver unit configured to receive index information sent by a blockchain; the index information is used to indicate a target encrypted index vector; the target encrypted index vector is the The blockchain is based on the image query request of the query party, and the encrypted index vector determined from the encrypted index stored on the chain and matched with the encrypted query vector in the image query request; the encrypted index vector is the image owner.
  • the encrypted query vector is generated based on the corresponding plaintext image, and the encrypted query vector is generated by the query party based on the image to be queried; the determining unit is configured to determine the target ciphertext image that conforms to the index information from each ciphertext image;
  • the text image is generated by the image owner by encrypting each plaintext image and sending it to the cloud server for storage; the transceiver unit is also used to send the target ciphertext image to the blockchain and the inquiring party.
  • an embodiment of the present application provides an image search device, including: a transceiver unit for sending an image query request to a blockchain, where the image query request includes an encrypted query vector generated based on the image to be queried; the The transceiver unit is further configured to receive the target ciphertext image sent by the cloud server; the target ciphertext image is determined from each ciphertext image stored locally based on the index information sent by the cloud server based on the blockchain; the The index information is used to indicate the target encrypted index vector, and the target encrypted index vector is the encrypted index vector determined by the blockchain from the encrypted index stored on the chain and matched with the encrypted query vector; the encrypted index The vector is generated by the image owner based on the corresponding plaintext image; the processing unit is used to obtain the verification result corresponding to the image query request from the blockchain, and determine whether to decrypt the target ciphertext image; the The verification result is generated after the blockchain verifies whether the first hash value corresponding to the target ciphertext image is consistent with the second hash value
  • the apparatus further includes an encrypted query vector generation unit; the encrypted query vector generation unit is configured to: extract the second feature vector of the image to be queried; based on the second random number and similar degree threshold to obtain the second extension vector of the second feature vector; the similarity threshold is used to instruct the blockchain to search for an encrypted index vector that satisfies the similarity threshold with the encrypted query vector; based on the vector density
  • the first key in the key processes the second extension vector to obtain a second diagonal matrix; based on the second key and the third key in the vector key, the second diagonal matrix is and a preset lower triangular matrix to obtain the encrypted query vector.
  • an embodiment of the present application provides a computing device, including:
  • the processor is configured to invoke the program instructions stored in the memory, and execute any of the implementation methods of the first aspect, the second aspect, the third aspect and the fourth aspect according to the obtained program.
  • embodiments of the present application provide a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to cause a computer to execute the first aspect, the second A method of implementing any of the aspect, the third aspect and the fourth aspect.
  • FIG. 1 is a schematic diagram of a possible system architecture provided by an embodiment of the present application
  • FIG. 2 provides an image search method according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of storing encrypted indexes on a blockchain according to an embodiment of the present application
  • Fig. 4 is a kind of block chain provided by the embodiment of this application.
  • FIG. 5 is an image search apparatus provided by an embodiment of the present application.
  • FIG. 6 provides a cloud server according to an embodiment of the present application
  • FIG. 7 is an image search apparatus provided by an embodiment of the present application.
  • FIG. 8 is a computing device provided by an embodiment of the present application.
  • the image owner can encrypt the generated images when faced with continuously generated images, and send the encrypted ciphertext images to the cloud server for storage by the cloud server. Therefore, when the cloud server receives the image query request from the querying party, the cloud server can find the target ciphertext image that meets the image query request from the ciphertext image, and send the target ciphertext image to the querying party. Finally, the querying party The target ciphertext image will be decrypted based on the key passed by the image owner to obtain the plaintext image.
  • the embodiments of the present application provide a possible system architecture, and the system includes a blockchain 110 , a cloud server 120 , an image owner 130 and a queryer 140 . in:
  • the image owner 130 can be used to encrypt any generated plaintext image, and send the encrypted ciphertext image to the cloud server 120, and the cloud server 120 stores the ciphertext image; on the other hand, It can also be used to extract the feature vector of any generated plaintext image, and build an encrypted index based on the extracted feature vector, and then send the encrypted index to the blockchain 110, and the blockchain 110 stores the encrypted index.
  • the encrypted index includes an encrypted index vector and a hash value generated based on the encrypted index vector.
  • the encrypted index vector can be used by the blockchain 110 to calculate the encrypted query vector, and the hash value can be used for verification.
  • the encrypted index also includes an index number, which is an image identification and can be used to distinguish any two plaintext images; in addition, when the index number is used to reflect the uniqueness of the plaintext image, it can also be used to reflect the uniqueness of the plaintext image.
  • the uniqueness of the encrypted index more specifically, reflects that the encrypted index vector and hash value in the encrypted index have a one-to-one correspondence with the plaintext image and the ciphertext image corresponding to the plaintext image, respectively.
  • the querying party 140 can be used to extract and post-process the feature vector of the image to be queried according to the query requirements of the user, obtain the corresponding encrypted query vector, and send the obtained encrypted query vector to the blockchain 110 through the image query request, so as to obtain a corresponding encrypted query vector.
  • This enables the blockchain 110 to find the relevant information of the image that meets the user's query requirement from the encrypted index stored on the chain according to the encrypted query vector, that is, the target encrypted index vector.
  • the querying party 140 can be used to receive the retrieval result sent by the cloud server, that is, the target ciphertext image, and when the querying party 140 receives the instruction information sent by the blockchain 110 that the retrieval result has passed the verification, it can also be used to send the image to the owner of the image. 130 and the cloud server 120 pay the corresponding information fee and service fee, and decrypt the target ciphertext image sent by the cloud server 120 to obtain a plaintext image.
  • the blockchain 110 can be used to receive and store the encrypted index sent by the image owner 130 , process the image query request sent by the query party 140 , and verify the correctness of the retrieval result returned by the cloud server 120 .
  • the blockchain 110 when processing the image query request sent by the query party 140, can search for images that meet the user's query requirements from the encrypted index stored on the chain according to the encrypted query vector in the image query request. If the blockchain 110 finds the relevant information of the image that meets the user's query requirements, that is, finds the target encrypted index vector, the blockchain 110 can send the index information used to indicate the target encrypted index vector to the cloud server 120; When the information is an index number, the cloud server 120 can be made to return the locally stored ciphertext image (ie the retrieval result) corresponding to the index number as the target ciphertext image to the blockchain 110 and the querying party 140 respectively according to the index number; When the blockchain 110 receives the retrieval result returned by the cloud server 120, it can verify the correctness of the retrieval result, that is, verify whether the cloud server 120 is really based on the index number of the image determined by the blockchain 110.
  • the ciphertext image corresponding to the index number is returned.
  • the blockchain 110 can be used to verify whether the cloud server 120 has tampered with the ciphertext image, resulting in the returned ciphertext image that does not match the index number of the image. text image.
  • the blockchain 110 may, on the one hand, encrypt the data stored on the chain with the index number based on the index number of the image that has been determined.
  • the hash value in the index is extracted, that is, the second hash value is obtained; on the other hand, for any index number in the index numbers of the images that have been determined, the blockchain 110 can return the retrieval result from the cloud server 120
  • the ciphertext image with the index number is matched in, and its hash value is calculated, that is, the first hash value is determined.
  • the blockchain 110 can compare the calculated hash value (ie the first hash value) with the pre-stored hash value (ie the second hash value), including:
  • the blockchain 110 may send to the querying party 140 information indicating that the retrieval result has passed the verification, so as to instruct the querying party 140 to pay the corresponding information fee and service fee to the image owner 130 and the cloud server 120 , and instructing the querying party 140 to decrypt the received target ciphertext image to obtain a plaintext image;
  • the cloud server 120 can be used to store each ciphertext image sent by the image owner 130, and when receiving the index information sent by the blockchain 110, when the index information is the index number of the image, the cloud server 120 can search for each ciphertext image stored locally, and return the found ciphertext image (that is, the retrieval result) as the target ciphertext image to the blockchain 110 and the querying party 140 for the blockchain 110 to perform a search. The correctness is verified, and when the blockchain 110 confirms that the retrieval result passes the verification, the query party 140 can decrypt the received target ciphertext image to obtain a plaintext image.
  • an embodiment of the present application provides an image search method, as shown in FIG. 2, the method includes the following steps:
  • Step 201 The blockchain receives an image query request sent by a query party, where the image query request includes an encrypted query vector generated based on the image to be queried.
  • the querying party when the querying party wants to query an image, the querying party can process the image, generate an encrypted query vector corresponding to it, and send the encrypted query vector to the blockchain through the image query request,
  • the service of image query is provided by the blockchain for the query party.
  • the image is the image to be queried.
  • the query is performed based on the image to be queried, and the image query type may include similar image query, difference image query, target detection, face recognition, classification query or other types of image query, for example, when the image to be queried is an apple, its The query result of a similar image query will be Apple, not other things; if the image to be queried is female, the query result of the difference image query will be male, not female; or if the image to be queried is captured by a driverless vehicle If the image to be queried is a person who appears in the surveillance video, the target detection result will be the pedestrian and various vehicles in the image; if the image to be queried is someone who appears in the surveillance video, the face recognition result will be this person, not someone else ; For example, when the image to be queried is a banana, the result of the classification query will be fruit, not other categories.
  • this step also includes: generating a key.
  • the key includes the public and private keys of the image owner, the public and private keys of the query party, the public and private keys of the cloud server, the symmetric key of the symmetric encryption algorithm, and the encryption key of the vector.
  • Step 202 the blockchain searches for a target encrypted index vector that matches the encrypted query vector from the encrypted index stored on the chain; wherein, each encrypted index includes an encrypted index vector and an encrypted index vector generated based on the encrypted index vector.
  • Hash value the encrypted index vector is generated by the image owner based on the corresponding plaintext image.
  • the block chain can search for one/some encrypted index vectors matching the encrypted query vector based on the encrypted index stored on the chain.
  • each encrypted index includes an encrypted index vector
  • the blockchain searches for one/some encrypted index vectors matching the encrypted query vector based on the encrypted index vectors in each encrypted index stored on the chain.
  • the blockchain finds one/some encrypted index vectors matching the encrypted query vector, the one/some encrypted index vectors are the target encrypted index vectors.
  • the image owner Before this step, the image owner generates an encrypted index corresponding to each plaintext image based on each plaintext image held by itself, and then sends the generated encrypted index to the blockchain for storage by the blockchain , so that when the blockchain receives the image query request sent by the query party, the blockchain can respond to the image query request sent by the query party based on each encrypted index stored on the chain.
  • any encrypted index may include an encrypted index vector and a hash value generated based on the encrypted index vector, and the encrypted index vector is the image owner based on the corresponding plaintext The image is generated, and the hash value can be used for verification.
  • any encrypted index may further include an index number, where the index number is an image identification and can be used to distinguish any two plaintext images.
  • the index number when used to reflect the uniqueness of the plaintext image, it can also be used to reflect the uniqueness of the encrypted index. And there is a one-to-one correspondence between the ciphertext images corresponding to the plaintext images.
  • Step 203 The blockchain sends index information for indicating the target encrypted index vector to the cloud server, and receives the target ciphertext image corresponding to the target encrypted index vector sent by the cloud server.
  • the blockchain can Send the index information used to indicate the target encrypted index vector to the cloud server.
  • the index information is the index number, that is, the blockchain sends the index number corresponding to the target encrypted index vector to the cloud server, so that the cloud server can use the index according to the index. number to search each ciphertext image stored locally, and return the ciphertext image that matches the index number (that is, the retrieval result) as the target ciphertext image to the blockchain for the blockchain to verify the correctness of the image. test.
  • the cloud server when the cloud server returns the retrieval result to the blockchain, the cloud server simultaneously sends the retrieval result to the querying party.
  • the image owner Before this step, the image owner generates ciphertext images corresponding to each plaintext image one-to-one based on each plaintext image held by itself, and then sends each generated ciphertext image to the cloud server for processing by the cloud server. Therefore, when receiving the index number sent by the blockchain, the cloud server can match the ciphertext image that is consistent with the index number from each ciphertext image stored locally, that is, determine the target ciphertext image.
  • the image owner can obtain the ciphertext image corresponding to the plaintext image by the following methods:
  • the image owner can encrypt the plaintext image by using a symmetric encryption algorithm, for example, encrypting the plaintext image m ID into a ciphertext image c ID , where the subscript ID is the image number, that is, the index number.
  • the symmetric encryption algorithm includes any one of the following algorithms: an advanced encryption algorithm, a data encryption standard algorithm, and an international data encryption algorithm.
  • Step 204 the blockchain verifies whether the first hash value corresponding to the target ciphertext image is consistent with the second hash value corresponding to the target encryption index vector, and uploads the verification result to the chain.
  • the blockchain when the blockchain receives the target ciphertext image returned by the cloud server, for any target ciphertext image, the first hash value corresponding to the target ciphertext image is calculated, and the calculated The first hash value of is compared with the second hash value corresponding to the target encryption index vector that is stored on the chain and has the same index number as the target ciphertext image, and the comparison results include:
  • step 202 Encrypt the ciphertext images that match the index numbers of the index vectors; thus, when the first hash value and the second hash value of the index numbers of all images in the retrieval result pass the verification, the blockchain can send the query to the querying party.
  • the instruction information that the retrieval result has passed the verification to instruct the inquiring party to pay the corresponding information fee and service fee to the image owner and the cloud server, and to instruct the inquiring party to decrypt the target ciphertext image in the received retrieval result to obtain the plaintext image.
  • the cloud server If the former is different from the latter, it means that the cloud server returns a ciphertext image that does not match the index number, that is, the cloud server has tampered with the ciphertext image, and there is cheating. At this time, the blockchain can return the deposit to the querying party.
  • the encrypted query vector is generated by the query party according to the feature vector of the image to be queried and a similarity threshold; the similarity threshold is used to indicate the blockchain search and The encrypted query vector is an encrypted index vector that satisfies the similarity threshold.
  • the query party extracts a second feature vector of the image to be queried; the query party obtains a second extension of the second feature vector based on a second random number and a similarity threshold vector; the similarity threshold is used to instruct the blockchain to search for an encrypted index vector that satisfies the similarity threshold with the encrypted query vector; the query party based on the first key in the vector key pairs the The second extended vector is processed to obtain a second diagonal matrix; the query party, based on the second key and the third key in the vector key, analyzes the second diagonal matrix and the preset lower triangle The matrix is processed to obtain the encrypted query vector.
  • the encryption key for the vector is: in are two random invertible matrices, are the inverse matrices of M 1 and M 2 , respectively, ⁇ : is a random permutation, and d represents the dimension of the extracted image feature vector.
  • the first step is to randomly select two numbers ⁇ and r q for the feature vector q, a similarity threshold ⁇ and a (d+5) ⁇ (d+5) dimensional lower triangular matrix S q whose diagonal elements are 1.
  • the second step is to expand the feature vector q to q':
  • the third step is to replace the expanded vector q' with q" with the key ⁇ :
  • the fourth step is to convert the permuted vector q" into a diagonal matrix Q with q" as a diagonal element.
  • the fifth step is to encrypt the diagonal matrix Q with the keys M 1 -1 and M 2 -1 to obtain the encrypted query vector T q :
  • q is the second eigenvector
  • ⁇ and r q are the second random numbers
  • is the similarity threshold
  • S q is the preset lower triangular matrix
  • q' is the second expansion vector
  • is the first density key
  • Q is the second diagonal matrix
  • M 1 -1 and M 2 -1 are the second and third keys, respectively, or M 1 -1 and M 2 -1 are the third and second keys, respectively key
  • T q is the encrypted query vector.
  • the similarity threshold ⁇ is introduced, which means that when the blockchain queries the query image, it searches for similar images of the query image, and the found image is satisfying Set the similarity threshold ⁇ .
  • the querying party when the querying party generates the corresponding encrypted query vector for the image to be queried, if the querying party's image query request is to query similar images of the image to be queried, then in the process of generating the encrypted query vector by the querying party, the querying party will The encrypted query vector can be generated based on the actual image similarity requirements (ie similarity threshold), so that the blockchain that receives the encrypted query vector only needs to be responsible for image search based on the encrypted query vector to obtain the target encrypted index vector. It is only necessary to return the target ciphertext image to be verified to the blockchain according to the index information used to indicate the target encryption index vector.
  • the actual image similarity requirements ie similarity threshold
  • the cloud server currently in use is based on the secure k-nearest neighbor algorithm, it returns to the queryer the first k ciphertext images after sorting the search results (sorted in descending order of similarity). , the higher the ranking of the ciphertext image, the greater the similarity with the image to be queried, so the cloud server in the background technology will be able to guess the query request of the query party according to the ranking result and additional background knowledge, which is easy to cause The privacy leak of the querying party.
  • the cloud server in the solution of the present application cannot know the ciphertext image that is closest to the image to be queried.
  • the cloud server cannot infer the query request of the query party based on the target ciphertext image, so that the privacy leakage problem that may exist in the cloud server in the background technology can be overcome; in addition, based on the same logic as the cloud server, The blockchain will also be unable to infer the query request of the querying party based on the target ciphertext image, that is, there will be no privacy leakage problem caused by the blockchain learning the querying party's query request.
  • the query party After the query party encrypts the feature vector q with the encryption key of the vector and obtains the encrypted query vector T q , the query party sends the encrypted query vector and the deposit to the SEARCH contract through a transaction, and calls the Search() function in the contract to query.
  • the SEARCH contract is a smart contract deployed on the blockchain through transactions to implement the search function.
  • the PAYMENT contract for payment the VERIFY contract for verification
  • the UPDATE contract for update can also be deployed at the same time.
  • pre-trained convolutional neural network models include any of the following models: VGG, ResNet, Xception, GoogLeNet, DenseNet, and Inception.
  • the image owner for any plaintext image, the image owner generates an encrypted index of the plaintext image; the encrypted index includes an encrypted index vector generated based on the plaintext image and a generated based on the encrypted index vector.
  • the image owner uploads each encrypted index to the blockchain; the image owner encrypts each plaintext image into each ciphertext image and sends it to the cloud server.
  • generating the encrypted index of the plaintext image by the image owner includes: extracting, by the image owner, a first feature vector of the plaintext image; the image owner is based on a first random number to obtain the first extension vector of the first feature vector; the image owner processes the first extension vector based on the first key in the vector key to obtain a first diagonal matrix; the image Based on the second key and the third key in the vector key, the owner processes the first diagonal matrix and the preset lower triangular matrix to obtain an encrypted index vector; the image owner determines the Describe the index number of the plaintext image and the concatenated hash value of the ciphertext image; the image owner determines the index number of the plaintext image, the hash value and the encrypted index vector as the encrypted index.
  • M 1 are two random invertible matrices
  • is a random permutation
  • d represents the dimension of the extracted image feature vector.
  • the second step is to expand the feature vector f ID to f' ID :
  • the third step is to replace the expanded vector f' ID with f" ID with the key ⁇ :
  • the permuted vector f" ID is converted into a diagonal matrix F ID with f" ID as a diagonal element.
  • the fifth step is to encrypt the diagonal matrix F ID with the keys M 1 and M 2 to obtain the encrypted index vector C ID :
  • the image owner After the image owner encrypts its feature vector f ID with the encryption key of the vector and obtains the encrypted index vector C ID , the image owner can further obtain the ID of the plaintext image and the corresponding encryption key.
  • the hash value h ID after the concatenation of the text is calculated:
  • h ID h(ID
  • h() is the hash function
  • " represents the cascade operation
  • the image owner can further define ⁇ ID, h ID , C ID > as the encryption index I ID of the plaintext image m ID .
  • the owner of the image can upload the encrypted index I ID to the blockchain through a transaction, so that the blockchain can store it.
  • FIG. 3 it is a schematic diagram of storing an encrypted index by a blockchain according to an embodiment of the present application.
  • block i a block in the blockchain, denoted as block i, which stores some encrypted indexes sent by the image owner. It is divided into block header and block body.
  • the block header includes the previous A block hash, block random number, timestamp and hash tree root
  • the block body includes a hash tree generated by several transactions
  • the leaf nodes of the hash tree store the transaction Tx and the transaction corresponding to the encrypted index
  • the chameleon hash value calculated by the random number rd the non-leaf node stores the hash value calculated by concatenating the hash values of its two child nodes
  • the hash tree needs to be stored in the block when the image owner needs to Used when the encrypted index on the chain is updated.
  • f ID is the first feature vector
  • ⁇ , r f, ID is the first random number
  • S f ID is the preset lower triangular matrix
  • f′ ID is the first expansion vector
  • is the first dense key
  • F ID is the second diagonal matrix
  • M 1 , M 2 are the second key and the third key
  • M 1 , M 2 are the third key and the second key, respectively
  • C ID is the encryption index Vector
  • h ID is the hash value
  • I ID is the encrypted index.
  • the miner in the blockchain receives the transaction
  • the miner who receives the transaction needs to verify the legality and correctness of the transaction, and will verify the transaction passed. Put it into the unconfirmed transaction pool and wait for it to be packaged. If the verification fails, the transaction will be marked as "invalid transaction” and will not be packaged.
  • the miner will extract nearly a thousand unconfirmed transactions from the unconfirmed transaction pool, package them into a block and broadcast it to the blockchain network. After other miners verify this block, they stop their own mining and start mining new mines based on this block. All transactions in this block are permanently recorded in the blockchain, that is, the encrypted index of the plaintext image has been successfully stored in the blockchain.
  • the consensus protocol can include any one of the following protocols: Proof of Work and Proof of Stake.
  • pre-trained convolutional neural network models include any of the following models: VGG, ResNet, Xception, GoogLeNet, DenseNet, and Inception.
  • the blockchain searches for a target encrypted index vector matching the encrypted query vector from an encrypted index stored on the chain, including: Any encrypted index in the encrypted index, determine the trace of the product of the encrypted index vector and the encrypted query vector in the encrypted index; if the blockchain determines that the trace meets the set threshold, the encrypted index vector will be used as the Describe the target encrypted index vector.
  • the SEARCH contract first calls the check() function in the PAYMENT contract to check whether the deposit exceeds the message fee $fee message and service fee $ defined by the image owner and the cloud server respectively
  • the sum of fee services including:
  • the SEARCH contract can perform subsequent retrieval tasks
  • the SEARCH contract can access the encrypted index stored in each transaction of each block one by one, and calculate the encrypted query vector and encrypted index. product of encrypted index vectors in , and trace S of the product:
  • Tr() represents the sum of each element on the main diagonal of the square matrix.
  • the SEARCH contract can extract the corresponding ID and h ID from the encrypted index I ID stored on the chain based on the encrypted index vector C ID , and use the extracted ID and h ID will be added to the result list L, and the ID column will be broadcast to the blockchain network.
  • the cloud server sends the target ciphertext image to the querying party; the blockchain verifies that the first hash value corresponding to the target ciphertext image matches the Whether the second hash value corresponding to the target encryption index vector is consistent, and uploading the verification result on the chain, including: if the blockchain determines that the first hash value is consistent with the second hash value, then determining The target ciphertext image conforms to the encrypted query vector; the blockchain sends instruction information to the querying party, where the instruction information instructs the querying party to decrypt the target ciphertext image and obtain a plaintext image.
  • the ID column can be received by the cloud server.
  • the cloud server can search for the ciphertext image c ID corresponding to each ID from each ciphertext image stored locally according to each ID in the ID column, and use the searched ciphertext image.
  • the image c ID is returned to the querying party as the retrieval result R, and the ciphertext image c ID found through the transaction is sent to the VERIFY contract, and the Verify() function in the contract is called for correctness verification.
  • the searched-out ciphertext image is the target ciphertext image.
  • the Verify() function in the VERIFY contract calculates the hash value h(ID
  • the hash value is compared to the h ID in the result list L.
  • the VERIFY contract can call the Transfer() function in the PAYMENT contract on the one hand to transfer the message fee $fee message and service fee $fee service is transferred to the account of the image owner and the cloud server respectively.
  • the VERIFY contract can send the querying party the instruction information that the retrieval result has passed the verification.
  • the instruction information is used to indicate that the querying party can send the encrypted image to the cloud server.
  • the c ID decrypts and obtains the corresponding plaintext image; otherwise, the deposit of the query party is returned.
  • the image owner needs to update the ciphertext image stored on the cloud server and the encrypted index stored on the blockchain.
  • the image owner generates a first encrypted index based on the first plaintext image, and constructs a first transaction including the first encrypted index; the image owner generates a first encrypted index based on the first plaintext image; For the second transaction and the first transaction corresponding to the second encryption index, determine the update random number; the update random number is used to instruct the second plaintext image to be updated to the first plaintext image; the image owner will The first transaction and the updated nonce are sent to the blockchain.
  • Scenario 1 the image owner who wants to update the image updates the encrypted index stored on the blockchain.
  • the steps to update the encrypted index are as follows:
  • the image owner extracts the feature vector of the new image m' and constructs an encrypted index.
  • the specific process of constructing an encrypted index can refer to the foregoing embodiments of the present application, which will not be repeated here.
  • the image owner obtains the transaction Tx corresponding to the image m to be updated and marks it as an old transaction, calculates the transaction Tx' corresponding to the new image m' and marks it as a new transaction, and calculates the chameleon hash of the new transaction and the old transaction Collision, get the random number rd' corresponding to the new transaction and mark it as a new random number.
  • the image owner sends the new random number rd' and the new transaction Tx' to the UPDATE contract through the transaction, and calls the Update() function in the contract to update.
  • the UPDATE contract replaces the old transaction Tx in the blockchain block body with the new transaction Tx', and at the same time replaces the old transaction Tx and the old random number rd of the leaf node of the hash tree with the new transaction Tx' and the new transaction Tx'. random number rd'.
  • the new image m' is the first plaintext image
  • the to-be-updated image m is the second plaintext image
  • the new random number rd' is the updated random number
  • the image owner who wants to update the image updates the ciphertext image stored on the cloud server.
  • the steps for updating the ciphertext image are as follows:
  • the image owner encrypts the new image m', wherein the specific process of encrypting the new image m' may refer to the foregoing embodiments of the present application, which will not be repeated here.
  • the image owner sends the ciphertext image of the new image m' to the cloud server, so that the cloud server can replace the ciphertext image of the to-be-updated image m with the ciphertext image of the new image m'.
  • an embodiment of the present application provides a blockchain, as shown in FIG. 4 , the blockchain includes a transceiver unit 401 , a search unit 402 and a verification unit 403 ;
  • the transceiver unit 401 is configured to receive an image query request sent by a query party, where the image query request includes an encrypted query vector generated based on the image to be queried.
  • a search unit 402 configured to search for a target encrypted index vector matching the encrypted query vector from the encrypted indexes stored on the chain; wherein, each encrypted index includes an encrypted index vector and a hash generated based on the encrypted index vector value, the encrypted index vector is generated by the image owner based on the corresponding plaintext image.
  • the transceiver unit 401 is further configured to send index information for indicating the target encrypted index vector to a cloud server, and receive a target ciphertext image corresponding to the target encrypted index vector sent by the cloud server.
  • the verification unit 403 is configured to verify whether the first hash value corresponding to the target ciphertext image is consistent with the second hash value corresponding to the target encryption index vector, and upload the verification result to the chain.
  • the encrypted query vector is generated by the query party according to the feature vector of the image to be queried and the similarity threshold; the similarity threshold is used to instruct the blockchain to find the
  • the encrypted query vector is an encrypted index vector that satisfies the similarity threshold.
  • the encrypted index further includes an index number; the transceiver unit 401 is specifically configured to: send the target index number corresponding to the target encrypted index vector to the cloud server.
  • the search unit 402 is specifically configured to: for any encrypted index in the encrypted index, determine the trace of the product of the encrypted index vector in the encrypted index and the encrypted query vector; if If it is determined that the trace meets the set threshold, the encrypted index vector is used as the target encrypted index vector.
  • an embodiment of the present application provides an image search device.
  • the image search device includes an encrypted index generation unit 501 and a sending unit 502;
  • the encrypted index generation unit 501 is configured to generate an encrypted index of any plaintext image; the encrypted index includes an encrypted index vector generated based on the plaintext image and a hash value generated based on the encrypted index vector.
  • the sending unit 502 is configured to upload each encrypted index to the blockchain.
  • the sending unit 502 is further configured to encrypt each plaintext image into each ciphertext image and send it to the cloud server.
  • the encryption index generation unit 501 is specifically configured to: the image owner extracts the first feature vector of the plaintext image; the image owner obtains the first feature vector based on the first random number A first extension vector of a feature vector; the image owner processes the first extension vector based on the first key in the vector key to obtain a first diagonal matrix; the image owner is based on the vector For the second key and the third key in the key, the first diagonal matrix and the preset lower triangular matrix are processed to obtain an encrypted index vector; the image owner determines the index number of the plaintext image The hash value concatenated with the ciphertext image; the image owner determines the index number of the plaintext image, the hash value and the encrypted index vector as the encrypted index.
  • the image search device also includes a transaction construction unit 503 and an update random number determination unit 504; the transaction construction unit 503 is used to generate a first encrypted index based on the first plaintext image, and construct a first encrypted index including the first encrypted index.
  • the updated random number determination unit 504 is configured to determine the updated random number according to the second transaction corresponding to the second encrypted index of the second plaintext image and the first transaction; the updated random number is used to indicate the The second plaintext image is updated to the first plaintext image; the sending unit 502 is specifically configured to send the first transaction and the updated random number to the blockchain.
  • an embodiment of the present application provides a cloud server, as shown in FIG. 6 , the cloud server includes a transceiver unit 601 and a determination unit 602;
  • the transceiver unit 601 is configured to receive index information sent by the blockchain; the index information is used to indicate a target encrypted index vector; the target encrypted index vector is the image query request of the blockchain based on the query party, and the target encrypted index vector is obtained from the chain.
  • the encrypted index vector determined in the stored encrypted index and matched with the encrypted query vector in the image query request; the encrypted index vector is generated by the image owner based on the corresponding plaintext image, and the encrypted query vector is the query vector The square is generated based on the image to be queried.
  • Determining unit 602 configured to determine a target ciphertext image conforming to the index information from each ciphertext image; each ciphertext image is generated by the owner of the image encrypting each plaintext image, and sent to the cloud server for storage.
  • the transceiver unit 601 is further configured to send the target ciphertext image to the blockchain and the query party.
  • an embodiment of the present application provides an image search apparatus, as shown in FIG. 7 , the image search apparatus includes a transceiver unit 701 and a processing unit 702;
  • the transceiver unit 701 is configured to send an image query request to the blockchain, where the image query request includes an encrypted query vector generated based on the image to be queried.
  • the transceiver unit 701 is further configured to receive the target ciphertext image sent by the cloud server; the target ciphertext image is determined from the locally stored ciphertext images based on the index information sent by the cloud server based on the blockchain; The index information is used to indicate the target encrypted index vector, which is the encrypted index vector determined by the blockchain from the encrypted index stored on the chain and matched with the encrypted query vector; the encrypted The index vector is generated by the image owner based on the corresponding plaintext image.
  • the processing unit 702 is configured to obtain the verification result corresponding to the image query request from the blockchain, and determine whether to decrypt the target ciphertext image; the verification result is the verification result of the blockchain verification institute. It is generated after determining whether the first hash value corresponding to the target ciphertext image is consistent with the second hash value corresponding to the target encryption index vector.
  • the image search device also includes an encrypted query vector generation unit 703; the encrypted query vector generation unit 703 is used to: extract the second feature vector of the image to be queried; based on the second random number and the similarity threshold, Obtain the second extension vector of the second feature vector; the similarity threshold is used to instruct the blockchain to search for an encrypted index vector that satisfies the similarity threshold with the encrypted query vector; based on the The first key processes the second expansion vector to obtain a second diagonal matrix; based on the second key and the third key in the vector key, the second diagonal matrix and the preset The lower triangular matrix is processed to obtain the encrypted query vector.
  • the encrypted query vector generation unit 703 is used to: extract the second feature vector of the image to be queried; based on the second random number and the similarity threshold, Obtain the second extension vector of the second feature vector; the similarity threshold is used to instruct the blockchain to search for an encrypted index vector that satisfies the similarity threshold with the encrypted query vector; based on the The first key processes the second expansion vector to
  • Embodiments of the present application further provide a computing device, and the computing device may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (Personal Digital Assistant, PDA), and the like.
  • the computing device may include a central processing unit (Center Processing Unit, CPU), a memory, an input/output device, etc.
  • the input device may include a keyboard, a mouse, a touch screen, etc.
  • the output device may include a display device, such as a liquid crystal display (Liquid Crystal Display, LCD), Cathode Ray Tube (CRT), etc.
  • LCD Liquid Crystal Display
  • CRT Cathode Ray Tube
  • the memory which may include read only memory (ROM) and random access memory (RAM), provides the processor with program instructions and data stored in the memory.
  • the memory may be used to store program instructions of the image search method;
  • the processor is configured to call the program instructions stored in the memory, and execute the image search method according to the obtained program.
  • a schematic diagram of a computing device provided by an embodiment of the present application, the computing device includes:
  • the processor 801 is configured to read the program in the memory 802 and execute the above image search method
  • the processor 801 may be a central processing unit (CPU for short), a network processor (NP for short), or a combination of CPU and NP. It can also be a hardware chip.
  • the above-mentioned hardware chip may be an application-specific integrated circuit (ASIC for short), a programmable logic device (PLD for short) or a combination thereof.
  • the above PLD may be a complex programmable logic device (CPLD for short), a field-programmable gate array (FPGA for short), a generic array logic (GAL for short) or any of the above. combination.
  • the memory 802 is used to store one or more executable programs, and can store data used by the processor 801 when performing operations.
  • the program may include program code, and the program code includes computer operation instructions.
  • the memory 802 may include volatile memory (volatile memory), such as random-access memory (random-access memory, RAM for short); the memory 802 may also include non-volatile memory (non-volatile memory), such as flash memory ( flash memory), hard disk drive (HDD for short) or solid-state drive (SSD for short); the memory 802 may also include a combination of the above-mentioned types of memory.
  • Memory 802 stores the following elements, executable modules or data structures, or a subset thereof, or an extended set thereof:
  • Operation instructions including various operation instructions, which are used to realize various operations.
  • Operating System Includes various system programs for implementing various basic services and handling hardware-based tasks.
  • the bus 805 may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (EISA for short) bus or the like.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on. For ease of presentation, only one thick line is used in FIG. 8, but it does not mean that there is only one bus or one type of bus.
  • the bus interface 804 may be a wired communication access port, a wireless bus interface or a combination thereof, wherein the wired bus interface may be, for example, an Ethernet interface.
  • the Ethernet interface can be an optical interface, an electrical interface or a combination thereof.
  • the wireless bus interface may be a WLAN interface.
  • Embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, where the computer-executable instructions are used to cause a computer to execute the image search method.
  • the embodiments of the present application may be provided as a method, or as a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions
  • the apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种图像查找方法、区块链、云服务器及图像查找装置,涉及金融科技领域,该方法包括:区块链接收查询方发送的图像查询请求,图像查询请求包括加密查询向量;区块链从链上存储的加密索引中,查找与加密查询向量匹配的目标加密索引向量;每个加密索引包括加密索引向量和哈希值;区块链发送索引信息至云服务器并接收云服务器发送的目标密文图像;区块链校验目标密文图像对应的第一哈希值与目标加密索引向量对应的第二哈希值是否一致,将校验结果上链。凭借区块链去中心化的优势可对链上存储的全部加密索引进行查找,可克服云服务器对密文图像检索不完备的弊端;基于区块链对目标密文图像的校验,可克服云服务器篡改密文图像的问题。

Description

一种图像查找方法、区块链、云服务器及图像查找装置
相关申请的交叉引用
本申请要求在2021年04月16日提交中国专利局、申请号为202110409104.8、申请名称为“一种图像查找方法、区块链、云服务器及图像查找装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及金融科技(Fintech)领域,尤其涉及一种图像查找方法、区块链、云服务器及图像查找装置。
背景技术
随着计算机技术的发展,越来越多的技术(例如:区块链、大数据或云计算)应用在金融领域,传统金融业正在逐步向金融科技转变,在大数据技术的背景下,需要基于云服务器来对用户发起的图像查询请求进行响应。
目前,图像所有方在图像数据量较大时,会将加密后的图像(即密文图像)发送至云服务器,以由云服务器进行存储。云服务器基于查询方的图像查询请求,从各密文图像中查找符合图像查询请求的目标密文图像,并将目标密文图像发送给查询方。查询方会基于图像所有方传递的密钥对目标密文图像进行解密得到明文图像。
上述实现方式中,由于是通过云服务器进行查询,无法保证云服务器对图像查询请求进行了充分的查询,即检索了全部的密文图像。同时,也可能存在恶意的云服务器会篡改密文图像,导致查询方得到是错误的图像。显然,针对于云服务器的作弊行为,现有技术是无法进行判断也无法对云服务器进行管控的。
发明内容
本申请提供一种图像查找方法、区块链、云服务器及图像查找装置,用以克服云服务器在进行图像查询时的作弊行为。
第一方面,本申请实施例提供一种图像查找方法,该方法包括:区块链接收查询方发送的图像查询请求,所述图像查询请求包括基于待查询图像生成的加密查询向量;所述区块链从链上存储的加密索引中,查找与所述加密查询向量匹配的目标加密索引向量;其中,每个加密索引包括加密索引向量和基于所述加密索引向量生成的哈希值,所述加密索引向量是图像所有方基于对应的明文图像生成的;所述区块链发送用于指示所述目标加密索引向量的索引信息至云服务器,并接收所述云服务器发送的所述目标加密索引向量对应的目标密文图像;所述区块链校验所述目标密文图像对应的第一哈希值与所述目标加密索引向量对应的第二哈希值是否一致,并将校验结果上链。
基于该方案,通过使用区块链来对图像所有方发送的各明文图像的加密索引进行存储,从而在区块链对查询方发送的加密索引向量进行查找时,则可以利用自身去中心化的优势来对区块链上存储的全部的加密索引进行查找,因此可以克服背景技术中云服务器对密文图像检索不完备的弊端;此外,基于区块链存在的校验行为,可控制云服务器在基于本地的各密文图像返回查询方所需的密文图像时所返回的目标密文图像是与目标加密索引向量相一致的密文图像,即云服务器是无法篡改密文图像的。通过该方式,可以有效地控制云服务器的作弊行为。
在一种可能实现的方法中,所述加密查询向量是所述查询方根据所述待查询图像的特征向量及相似度阈值生成的;所述相似度阈值用于指示所述区块链查找与所述加密查询向量满足所述相似度阈值的加密索引向量。
在查询方想对待查询图像的相似图像进行查询时,目前投入使用的云服务器是基于安全k近邻算法而向查询方返回对检索结果进行排序(按照相似度从大到小的顺序排序)后的前k个密文图像,由于对检索结果排序后,密文图像排序越靠前,则意味着与待查询图像的相似度越大,所以背景技术中的云服务器根据排序结果和额外的背景知识将能够猜测出查询方的查询请求,从而容易导致查询方的隐私泄露问题。为此,本方案在为待查询图像确定相似图像的过程中,查询方可以基于实际需要的图像相似度需求(即相似度阈值)而生成加密查询向量,区块链仅需要负责基于加密查询向量进行图像查找而得到目标加密索引向量,云服务器也仅仅只需要根据用于指示目标加密索引向量的索引信息而向区块链返回待校验的目标密文图像。显然,该过程中云服务器是无法知晓与待查询图像最相近的密文图像为哪一个/些的,即云服务器无法基于目标密文图像而推测出查询方的查询请求,从而可以克服背景技术中云服务器可能存在的隐私泄露问题;此外,基于与云服务器相同的逻辑,区块链也将无法基于目标密文图像而推测出查询方的查询请求,即不会产生区块链对查询方的查询请求进行获知而导致的隐私泄露问题。
在一种可能实现的方法中,所述加密索引还包括索引号;所述区块链发送用于指示所述目标加密索引向量的索引信息至云服务器,包括:所述区块链发送所述目标加密索引向量对应的目标索引号至云服务器。
基于该方案,对于图像所有方所持有的每一张明文图像,可以通过设置索引号的方式来区分任意两张明文图像。因此,图像所有方在为明文图像生成加密索引时,还可以引入该明文图像的索引号,该索引号除了可用于体现该明文图像的唯一性,还可用于体现加密索引的唯一性,更具体一点,是体现加密索引中的加密索引向量和哈希值,分别与该明文图像、以及与该明文图像对应的密文图像之间具有一一对应的关系,从而在区块链通过对加密查询向量进行查找并确定出目标加密索引向量后,区块链可以将与目标加密索引向量对应的目标索引号发送至云服务器,从而云服务器可以基于目标索引号而向区块链返回对应于目标索引号的密文图像,以供区块链校验。为明文图像设置索引号,以及将索引号作为索引信息,可以快速实现云服务器对目标密文图像的查找。
在一种可能实现的方法中,所述区块链从链上存储的加密索引中,查找与所述加密查询向量匹配的目标加密索引向量,包括:所述区块链针对所述加密索引中的任一加密索引,确定所述加密索引中的加密索引向量与所述加密查询向量乘积的迹;所述区块链若确定所述迹满足设定阈值,则将所述加密索引向量作为所述目标加密索引向量。
基于该方案,在区块链对加密查询向量进行查找时,区块链对于链上存储的任一加密索引,通过提取其中的加密索引向量,并将所提取的加密索引向量与加密查询向量做乘法,并对乘积求迹,最后通过比较迹和设定阈值的大小,并将满足设定阈值的迹所对应的加密索引向量确定为目标加密索引向量。通过该方式,区块链在满足对查询方的图像查询请求进行完备性查询的基础上,同时还无法获知查询方真实的图像查询请求,即不会产生对查询方的隐私进行泄漏的问题。
第二方面,本申请实施例提供一种图像查找方法,该方法包括:针对任一明文图像,图像所有方生成所述明文图像加密索引;所述加密索引包括基于所述明文图像生成的加密索引向量及基于所述加密索引向量生成的哈希值;所述图像所有方将各加密索引上链至区块链中;所述图像所有方将各明文图像加密为各密文图像并发送至云服务器。
基于该方案,通过使用区块链来对图像所有方发送的各明文图像的加密索引进行存储,从而在区块链对查询方发送的加密索引向量进行查找时,则可以利用自身去中心化的优势来对区块链上存储的全部的加密索引进行查找,因此可以克服背景技术中云服务器对密文图像检索不完备的弊端;此外,基于区块链存在的校验行为,可控制云服务器在基于本地的各密文图像返回查询方所需的密文图像时所返回的目标密文图像是与目标加密索引向量相一致的密文图像,即云服务器是无法篡改密文图像的。通过该方式,可以有效地控制云服务器的作弊行为。
在一种可能实现的方法中,所述图像所有方生成所述明文图像的加密索引,包括:所述图像所有方提取所述明文图像的第一特征向量;所述图像所有方基于第一随机数,得到所述第一特征向量的第一扩展向量;所述图像所有方基于向量密钥中的第一密钥对所述第一扩展向量进行处理,得到第一对角矩阵;所述图像所有方基于所述向量密钥中的第二密钥和第三密钥,对所述第一对角矩阵和预设的下三角矩阵进行处理,得到加密索引向量;所述图像所有方确定所述明文图像的索引号和密文图像级联后的哈希值;所述图像所有方将所述明文图像的索引号、所述哈希值和所述加密索引向量确定为所述加密索引。
基于该方案,图像所有方通过为每一张明文图像生成对应的加密索引向量,所生成的该些加密索引向量在被存储于区块链上后,可以用于区块链对查询方所发起的图像查询请求进行查找,从而匹配出符合查询方查询需求的加密索引向量;此外,图像所有方还可为每一张明文图像生成对应的哈希值,所生成的该些哈希值在被存储于区块链上后,可以用于区块链对云服务器返回的密文图像进行校验,从而确定云服务器返回的是否为自己(即区块链)确定出来的符合查询方查询需求的密文图像;最后,针对于任一张明文图像,图像所有方通过将该明文图像的索引号连同哈希值及加密索引向量作为加密索引发送至区块链进行存储,由于索引号是明文图像的标识,因此在区块链通过查找、匹配出查询方查询需求的加密索引后,区块链则可以将加密索引具有的索引号发送至云服务器,以由云服务器向自己(即区块链)返回各个索引号对应的密文图像。
在一种可能实现的方法中,所述图像所有方基于第一明文图像生成第一加密索引,并构建包括所述第一加密索引的第一交易;所述图像所有方根据第二明文图像的第二加密索引对应的第二交易和所述第一交易,确定更新随机数;所述更新随机数用于指示所述第二明文图像更新为所述第一明文图像;所述图像所有方将所述第一交易和所述更新随机数发送至所述区块链。
基于该方案,在图像所有方欲使用第一明文图像对应的第一加密索引对存储于区块链上的第二明文图像对应的第二加密索引进行更新时,则图像所有方在生成第一加密索引后构建包括该第一加密索引的第一交易,接着图像所有方可根据第一交易和第二加密索引对应的第二交易,确定出更新随机数,该更新随机数可用于确保第一明文图像对第二明文图像的正确更新,最后图像所有方通过将第一交易和更新随机数发送至区块链,由区块链执行第一明文图像对第二明文图像的更新过程。
第三方面,本申请实施例提供一种图像查找方法,该方法包括:云服务器接收区块链发送的索引信息;所述索引信息用于指示目标加密索引向量;所述目标加密索引向量是所述区块链基于查询方的图像查询请求,从链上存储的加密索引中确定出的、与所述图像查询请求中的加密查询向量匹配的加密索引向量;所述加密索引向量是图像所有方基于对应的明文图像生成的,所述加密查询向量是查询方基于待查询图像生成的;所述云服务器从各密文图像中确定符合所述索引信息的目标密文图像;所述各密文图像是所述图像所有方对各明文图像分别进行加密生成、并发送至所述云服务器进行存储的;所述云服务器将所述目标密文图像发送至所述区块链和所述查询方。
基于该方案,通过使用区块链来对图像所有方发送的各明文图像的加密索引进行存储,从而在区块链对查询方发送的加密索引向量进行查找时,则可以利用自身去中心化的优势来对区块链上存储的全部的加密索引进行查找,因此可以克服背景技术中云服务器对密文图像检索不完备的弊端;此外,基于区块链存在的校验行为,可控制云服务器在基于本地的各密文图像返回查询方所需的密文图像时所返回的目标密文图像是与目标加密索引向量相一致的密文图像,即云服务器是无法篡改密文图像的。通过该方式,可以有效地控制云服务器的作弊行为。
第四方面,本申请实施例提供一种图像查找方法,该方法包括:查询方将图像查询请求发送至区块链,所述图像查询请求包括基于待查询图像生成的加密查询向量;所述查询方接收云服务器发送的目标密文图像;所述目标密文图像是所述云服务器基于区块链发送 的索引信息、从本地存储的各密文图像中确定的;所述索引信息用于指示目标加密索引向量,所述目标加密索引向量是所述区块链从链上存储的加密索引中确定出的、与所述加密查询向量匹配的加密索引向量;所述加密索引向量是图像所有方基于对应的明文图像生成的;所述查询方从所述区块链获取所述图像查询请求对应的校验结果,确定是否对所述目标密文图像进行解密;所述校验结果是所述区块链校验所述目标密文图像对应的第一哈希值与所述目标加密索引向量对应的第二哈希值是否一致后生成的。
基于该方案,通过使用区块链来对图像所有方发送的各明文图像的加密索引进行存储,从而在区块链对查询方发送的加密索引向量进行查找时,则可以利用自身去中心化的优势来对区块链上存储的全部的加密索引进行查找,因此可以克服背景技术中云服务器对密文图像检索不完备的弊端;此外,基于区块链存在的校验行为,可控制云服务器在基于本地的各密文图像返回查询方所需的密文图像时所返回的目标密文图像是与目标加密索引向量相一致的密文图像,即云服务器是无法篡改密文图像的。通过该方式,可以有效地控制云服务器的作弊行为。
在一种可能实现的方法中,所述查询方将图像查询请求发送至区块链之前,还包括:所述查询方提取所述待查询图像的第二特征向量;所述查询方基于第二随机数和相似度阈值,得到所述第二特征向量的第二扩展向量;所述相似度阈值用于指示所述区块链查找与所述加密查询向量满足所述相似度阈值的加密索引向量;所述查询方基于向量密钥中的第一密钥对所述第二扩展向量进行处理,得到第二对角矩阵;所述查询方基于所述向量密钥中的第二密钥和第三密钥,对所述第二对角矩阵和预设的下三角矩阵进行处理,得到所述加密查询向量。
基于该方案,查询方在为待查询图像生成对应的加密查询向量时,若查询方的图像查询请求是对待查询图像的相似图像进行查询,则在查询方生成加密查询向量的过程中,查询方可以基于实际需要的图像相似度需求(即相似度阈值)而生成加密查询向量,从而接收到加密查询向量的区块链仅需要负责基于加密查询向量进行图像查找而得到目标加密索引向量,云服务器也仅仅只需要根据用于指示目标加密索引向量的索引信息而向区块链返回待校验的目标密文图像。由于目前投入使用的云服务器是基于安全k近邻算法而向查询方返回对检索结果进行排序(按照相似度从大到小的顺序排序)后的前k个密文图像,由于对检索结果排序后,密文图像排序越靠前,则意味着与待查询图像的相似度越大,所以背景技术中的云服务器根据排序结果和额外的背景知识将能够猜测出查询方的查询请求,从而容易导致查询方的隐私泄露问题。显然,相比于现有技术中的由云服务器根据安全k近邻算法而返回查询方的相似图像查询结果的方案,本申请方案中的云服务器是无法知晓与待查询图像最相近的密文图像为哪一个/些的,即云服务器无法基于目标密文图像而推测出查询方的查询请求,从而可以克服背景技术中云服务器可能存在的隐私泄露问题;此外,基于与云服务器相同的逻辑,区块链也将无法基于目标密文图像而推测出查询方的查询请求,即不会产生区块链对查询方的查询请求进行获知而导致的隐私泄露问题。
第五方面,本申请实施例提供一种区块链,包括:收发单元,用于接收查询方发送的图像查询请求,所述图像查询请求包括基于待查询图像生成的加密查询向量;查找单元,用于从链上存储的加密索引中,查找与所述加密查询向量匹配的目标加密索引向量;其中,每个加密索引包括加密索引向量和基于所述加密索引向量生成的哈希值,所述加密索引向量是图像所有方基于对应的明文图像生成的;所述收发单元,还用于发送用于指示所述目标加密索引向量的索引信息至云服务器,并接收所述云服务器发送的所述目标加密索引向量对应的目标密文图像;校验单元,用于校验所述目标密文图像对应的第一哈希值与所述目标加密索引向量对应的第二哈希值是否一致,并将校验结果上链。
在一种可能实现的方法中,所述加密查询向量是所述查询方根据所述待查询图像的特征向量及相似度阈值生成的;所述相似度阈值用于指示所述区块链查找与所述加密查询向量满足所述相似度阈值的加密索引向量。
在一种可能实现的方法中,所述加密索引还包括索引号;所述收发单元,具体用于:发送所述目标加密索引向量对应的目标索引号至云服务器。
在一种可能实现的方法中,所述查找单元,具体用于:针对所述加密索引中的任一加密索引,确定所述加密索引中的加密索引向量与所述加密查询向量乘积的迹;若确定所述迹满足设定阈值,则将所述加密索引向量作为所述目标加密索引向量。
第六方面,本申请实施例提供一种图像查找装置,包括:加密索引生成单元,用于生成任一明文图像的加密索引;所述加密索引包括基于所述明文图像生成的加密索引向量及基于所述加密索引向量生成的哈希值;发送单元,用于将各加密索引上链至区块链中;所述发送单元,还用于将各明文图像加密为各密文图像并发送至云服务器。
在一种可能实现的方法中,所述加密索引生成单元,具体用于:所述图像所有方提取所述明文图像的第一特征向量;所述图像所有方基于第一随机数,得到所述第一特征向量的第一扩展向量;所述图像所有方基于向量密钥中的第一密钥对所述第一扩展向量进行处理,得到第一对角矩阵;所述图像所有方基于所述向量密钥中的第二密钥和第三密钥,对所述第一对角矩阵和预设的下三角矩阵进行处理,得到加密索引向量;所述图像所有方确定所述明文图像的索引号和密文图像级联后的哈希值;所述图像所有方将所述明文图像的索引号、所述哈希值和所述加密索引向量确定为所述加密索引。
在一种可能实现的方法中,所述装置还包括交易构建单元和更新随机数确定单元;所述交易构建单元,用于基于第一明文图像生成第一加密索引,并构建包括所述第一加密索引的第一交易;所述更新随机数确定单元,用于根据第二明文图像的第二加密索引对应的第二交易和所述第一交易,确定更新随机数;所述更新随机数用于指示所述第二明文图像更新为所述第一明文图像;所述发送单元,具体用于将所述第一交易和所述更新随机数发送至所述区块链。
第七方面,本申请实施例提供一种云服务器,包括:收发单元,用于接收区块链发送的索引信息;所述索引信息用于指示目标加密索引向量;所述目标加密索引向量是所述区块链基于查询方的图像查询请求,从链上存储的加密索引中确定出的、与所述图像查询请求中的加密查询向量匹配的加密索引向量;所述加密索引向量是图像所有方基于对应的明文图像生成的,所述加密查询向量是查询方基于待查询图像生成的;确定单元,用于从各密文图像中确定符合所述索引信息的目标密文图像;所述各密文图像是所述图像所有方对各明文图像分别进行加密生成、并发送至所述云服务器进行存储的;所述收发单元,还用于将所述目标密文图像发送至所述区块链和所述查询方。
第八方面,本申请实施例提供一种图像查找装置,包括:收发单元,用于将图像查询请求发送至区块链,所述图像查询请求包括基于待查询图像生成的加密查询向量;所述收发单元,还用于接收云服务器发送的目标密文图像;所述目标密文图像是所述云服务器基于区块链发送的索引信息、从本地存储的各密文图像中确定的;所述索引信息用于指示目标加密索引向量,所述目标加密索引向量是所述区块链从链上存储的加密索引中确定出的、与所述加密查询向量匹配的加密索引向量;所述加密索引向量是图像所有方基于对应的明文图像生成的;处理单元,用于从所述区块链获取所述图像查询请求对应的校验结果,确定是否对所述目标密文图像进行解密;所述校验结果是所述区块链校验所述目标密文图像对应的第一哈希值与所述目标加密索引向量对应的第二哈希值是否一致后生成的。
在一种可能实现的方法中,所述装置还包括加密查询向量生成单元;所述加密查询向量生成单元,用于:提取所述待查询图像的第二特征向量;基于第二随机数和相似度阈值,得到所述第二特征向量的第二扩展向量;所述相似度阈值用于指示所述区块链查找与所述加密查询向量满足所述相似度阈值的加密索引向量;基于向量密钥中的第一密钥对所述第二扩展向量进行处理,得到第二对角矩阵;基于所述向量密钥中的第二密钥和第三密钥,对所述第二对角矩阵和预设的下三角矩阵进行处理,得到所述加密查询向量。
第九方面,本申请实施例提供了一种计算设备,包括:
存储器,用于存储程序指令;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行如第一方面、第二方面、第三方面和第四方面任一实现方法。
第十方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使计算机执行如第一方面、第二方面、第三方面和第四方面任一实现方法。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种可能的系统架构示意图;
图2为本申请实施例提供的一种图像查找方法;
图3为本申请实施例提供的一种区块链对加密索引进行存储的示意图;
图4为本申请实施例提供的一种区块链;
图5为本申请实施例提供的一种图像查找装置;
图6为本申请实施例提供的一种云服务器;
图7为本申请实施例提供的一种图像查找装置;
图8为本申请实施例提供的一种计算设备。
具体实施方式
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。
目前,图像所有方在面临源源不断产生的图像时,可对所产生的图像进行加密,并将加密得到的密文图像发送至云服务器,以由云服务器进行存储。从而,当云服务器接收到查询方的图像查询请求时,云服务器可从密文图像中查找出符合图像查询请求的目标密文图像,并将目标密文图像发送给查询方,最终,查询方会基于图像所有方传递的密钥对目标密文图像进行解密得到明文图像。
该方式中,由于是通过云服务器进行查询,无法保证云服务器对图像查询请求进行了充分的查询,即检索了全部的密文图像。同时,也可能存在恶意的云服务器会篡改密文图像,导致查询方得到是错误的图像。显然,针对于云服务器的作弊行为,现有技术是无法进行判断也无法对云服务器进行管控的。
针对上述技术问题,本申请实施例提供一种可能的系统架构,该系统中包括区块链110,云服务器120,图像所有方130和查询方140。其中:
图像所有方130,一方面,可用于对产生的任一张明文图像进行加密,并将加密后的密文图像发送至云服务器120,由云服务器120对密文图像进行存储;另一方面,还可用于对产生的任一张明文图像进行特征向量的提取,并基于所提取的特征向量构建加密索引,而后将加密索引发送至区块链110,由区块链110对加密索引进行存储。其中,加密索引中包括加密索引向量和基于加密索引向量生成的哈希值,加密索引向量可用于区块链110对加密查询向量进行计算,哈希值可用于校验。可选的,加密索引中还包括索引号,索引号是图像的标识,可用于区分任意两张明文图像;除此之外,索引号在用于体现明文图像的唯一性时,还可用于体现加密索引的唯一性,更具体一点,是体现加密索引中的加密索引向量和哈希值,分别与明文图像、以及与明文图像对应的密文图像之间具有一一对应的 关系。
查询方140,可用于根据用户的查询需求,对待查询图像进行特征向量的提取以及后处理,得到相应的加密查询向量,并将得到的加密查询向量通过图像查询请求发送至区块链110,以使区块链110可以根据加密查询向量而从链上存储的加密索引中查找到符合用户查询需求的图像的相关信息,即目标加密索引向量。此外,查询方140可用于接收云服务器发送的检索结果,即目标密文图像,以及查询方140在接收到区块链110发送的检索结果通过验证的指示信息时,还可用于向图像所有方130和云服务器120支付相应的信息费和服务费,以及对云服务器120发送的目标密文图像进行解密而得到明文图像。
区块链110,可用于接收并存储图像所有方130发送的加密索引,处理查询方140发送的图像查询请求,以及验证云服务器120返回的检索结果的正确性。
其中,区块链110在处理查询方140发送的图像查询请求时,可以根据图像查询请求中的加密查询向量而从链上存储的加密索引中对符合用户查询需求的图像进行查找。若区块链110查找到符合用户查询需求的图像的相关信息,即查找到目标加密索引向量,则区块链110可以将用于指示目标加密索引向量的索引信息发送至云服务器120;在索引信息为索引号时,则可使云服务器120根据索引号而将本地存储的对应索引号的密文图像(即检索结果)作为目标密文图像分别返回至区块链110和查询方140;在区块链110接收到云服务器120返回的检索结果时,则可以对检索结果的正确性进行验证,也即验证云服务器120是否真的是按照区块链110所确定出的图像的索引号而将对应于该索引号的密文图像进行返回的,换句话说,区块链110可以用于校验云服务器120是否篡改了密文图像,导致返回的是与图像的索引号不相符的密文图像。
在区块链110对云服务器120返回的检索结果的正确性进行验证的过程中,区块链110一方面可以基于已经确定出来的图像的索引号而对链上存储的具有该索引号的加密索引中的哈希值进行提取,即获取第二哈希值;另一方面,针对已经确定出来的图像的索引号中的任一索引号,区块链110可从云服务器120返回的检索结果中匹配出具有该索引号的密文图像,并对其哈希值进行计算,即确定第一哈希值。从而,在同一图像的索引号下,区块链110可以将计算得到哈希值(即第一哈希值)与预先存储的哈希值(即第二哈希值)进行比较,包括:
若二者相同,则表示验证通过,说明云服务器120返回的密文图像是与图像的索引号相符的密文图像,从而在检索结果中的所有图像的索引号的第一哈希值与第二哈希值都通过验证时,则区块链110可向查询方140发送检索结果通过验证的指示信息,以指示查询方140向图像所有方130和云服务器120支付相应的信息费和服务费,以及指示查询方140可以对接收到的目标密文图像进行解密而得到明文图像;
若二者不相同,则表示验证不通过,说明云服务器120篡改了密文图像,从而区块链110可将押金向查询方140退回。
云服务器120,可用于对图像所有方130发送的各密文图像进行存储,并在接收到区块链110发送的索引信息时,在索引信息为图像的索引号时,云服务器120可根据图像的索引号而对本地存储的各密文图像进行查找,并将查找到的密文图像(即检索结果)作为目标密文图像返回至区块链110和查询方140,供区块链110进行正确性的校验,并在区块链110确认检索结果通过验证时,查询方140可以对接收到的目标密文图像进行解密而得到明文图像。
针对上述技术问题和图1所示的系统架构,本申请实施例提供一种图像查找方法,如图2所示,该方法包括以下步骤:
步骤201,区块链接收查询方发送的图像查询请求,所述图像查询请求包括基于待查询图像生成的加密查询向量。
在本步骤中,当查询方想对一图像进行查询时,查询方可以对该图像进行处理,生成对应于它的加密查询向量,并将该加密查询向量通过图像查询请求发送至区块链,以由区 块链为查询方提供图像查询的服务。
其中,该图像即为待查询图像。可选的,基于待查询图像进行查询,其图像查询类型可以包括相似图像查询、区别图像查询、目标检测、人脸识别、分类查询或者其他类型的图像查询,例如待查询图像为苹果时,其相似图像查询的查询结果将为苹果,而非其他事物;又如待查询图像为女性时,其区别图像查询的查询结果将为男性,而非女性;又如待查询图像为无人驾驶车辆捕获的图像时,其目标检测结果将为图中出现的行人及各类车辆;又如待查询图像为监控视频中出现的某人时,其人脸识别的结果将为此人,而非其他人;还如待查询图像为香蕉时,其分类查询的结果将为水果,而非其他类别。
在本步骤之前,还包括:生成密钥。
其中,密钥包括图像所有方的公私钥、查询方的公私钥、云服务器的公私钥、对称加密算法的对称密钥和向量的加密密钥。
步骤202,所述区块链从链上存储的加密索引中,查找与所述加密查询向量匹配的目标加密索引向量;其中,每个加密索引包括加密索引向量和基于所述加密索引向量生成的哈希值,所述加密索引向量是图像所有方基于对应的明文图像生成的。
在本步骤中,在区块链接收到查询方发送的图像查询请求后,区块链可以基于链上存储的加密索引、而查找与加密查询向量匹配的一个/些加密索引向量。
由于每个加密索引包括加密索引向量,因此,本步骤中区块链是基于链上存储的各个加密索引中的加密索引向量而对与加密查询向量匹配的一个/些加密索引向量进行查找。当区块链查找到与加密查询向量匹配的一个/些加密索引向量时,该个/些加密索引向量即为目标加密索引向量。
在本步骤之前,图像所有方基于自身持有的各明文图像、生成了与各明文图像一一对应的加密索引,而后将所生成的加密索引发送至区块链,以由区块链进行存储,从而在区块链接收到查询方发送的图像查询请求时,区块链可基于链上存储的各加密索引而对查询方发送的图像查询请求进行响应。
其中,图像所有方在生成与各明文图像一一对应的加密索引时,任一个加密索引可包括加密索引向量和基于加密索引向量生成的哈希值,加密索引向量是图像所有方基于对应的明文图像生成的,哈希值可用于校验。
可选的,任一个加密索引还可包括索引号,索引号是图像的标识,可用于区分任意两张明文图像。
说明的是,索引号在用于体现明文图像的唯一性时,还可用于体现加密索引的唯一性,更具体一点,是体现加密索引中的加密索引向量和哈希值,分别与明文图像、以及与明文图像对应的密文图像之间具有一一对应的关系。
步骤203,所述区块链发送用于指示所述目标加密索引向量的索引信息至云服务器,并接收所述云服务器发送的所述目标加密索引向量对应的目标密文图像。
对于步骤202,若区块链从链上能够查找出与加密查询向量匹配的一个/些加密索引向量时,即区块链确定出了目标加密索引向量,则在本步骤中,区块链可将用于指示目标加密索引向量的索引信息发送给云服务器,可选的,索引信息为索引号,即区块链将目标加密索引向量对应的索引号发送给云服务器,以使云服务器根据索引号来对本地存储的各密文图像进行查找,并将与索引号相匹配的密文图像(即检索结果)作为目标密文图像返回至区块链,供区块链进行图像正确性的校验。
在本步骤中,云服务器在向区块链返回检索结果时,云服务器同时将该检索结果发送至查询方。
在本步骤之前,图像所有方基于自身持有的各明文图像、生成了与各明文图像一一对应的密文图像,而后将所生成的各密文图像发送至云服务器,以由云服务器进行存储,从而云服务器可以在接收到区块链发送的索引号时、而从本地存储的各密文图像中匹配出与索引号相一致的密文图像,即确定出目标密文图像。
其中,图像所有方可通过下述方法得到明文图像对应的密文图像:
图像所有方可利用对称加密算法对明文图像进行加密,如将明文图像m ID加密成密文图像c ID,其中,下标ID为图像编号,即索引号。
可选的,对称加密算法包括以下算法中的任一项:高级加密算法、数据加密标准算法和国际数据加密算法。
步骤204,所述区块链校验所述目标密文图像对应的第一哈希值与所述目标加密索引向量对应的第二哈希值是否一致,并将校验结果上链。
在本步骤中,区块链在接收到云服务器返回的目标密文图像时,针对任一张目标密文图像,通过计算该目标密文图像对应的第一哈希值,并将所计算出来的第一哈希值与链上存储的、且与该目标密文图像具有同一索引号的目标加密索引向量对应的第二哈希值进行比较,比较的结果包括:
如果前者与后者相同,则说明云服务器返回的目标密文图像是正确的,也即说明云服务器返回的目标密文图像是与自身(即区块链)在步骤202中所确定出来的目标加密索引向量具有的索引号相符的密文图像;从而在检索结果中的所有图像的索引号的第一哈希值与第二哈希值都通过验证时,则区块链可向查询方发送检索结果通过验证的指示信息,以指示查询方向图像所有方和云服务器支付相应的信息费和服务费,以及指示查询方可以对接收到的检索结果中的目标密文图像进行解密而得到明文图像。
如果前者与后者不相同,则说明云服务器返回的是与索引号不相符的密文图像,即云服务器篡改了密文图像,存在作弊行为,此时区块链可将押金向查询方退回。
说明的是,对于以上两种比较结果中的任一种,区块链都将对其在链上进行存储。
以下将结合示例分别对上述一些步骤进行详细说明。
在上述步骤201的一个实施中,所述加密查询向量是所述查询方根据所述待查询图像的特征向量及相似度阈值生成的;所述相似度阈值用于指示所述区块链查找与所述加密查询向量满足所述相似度阈值的加密索引向量。
在本申请的某些实施中,所述查询方提取所述待查询图像的第二特征向量;所述查询方基于第二随机数和相似度阈值,得到所述第二特征向量的第二扩展向量;所述相似度阈值用于指示所述区块链查找与所述加密查询向量满足所述相似度阈值的加密索引向量;所述查询方基于向量密钥中的第一密钥对所述第二扩展向量进行处理,得到第二对角矩阵;所述查询方基于所述向量密钥中的第二密钥和第三密钥,对所述第二对角矩阵和预设的下三角矩阵进行处理,得到所述加密查询向量。
例如,查询方可利用预训练的卷积神经网络模型提取待查询图像的特征向量q={q 1,q 2,…,q d},并用向量的加密密钥对特征向量q进行加密,从而得到加密查询向量。
可选的,向量的加密密钥为:
Figure PCTCN2021132779-appb-000001
其中
Figure PCTCN2021132779-appb-000002
是两个随机可逆矩阵,
Figure PCTCN2021132779-appb-000003
分别为M 1,M 2的逆矩阵,π:
Figure PCTCN2021132779-appb-000004
是一个随机置换,d表示所提取的图像特征向量的维度。
则,根据上述的向量加密密钥对特征向量q进行加密的步骤如下:
第一步,为特征向量q随机选择两个数β和r q、一个相似度阈值θ和一个对角线元素 为1的(d+5)×(d+5)维下三角矩阵S q
第二步,将特征向量q扩展成q′:
Figure PCTCN2021132779-appb-000005
第三步,用密钥π将扩展后的向量q′置换成q″:
q″=π(q′)。
第四步,将置换后的向量q″转换成一个以q″为对角元素的对角矩阵Q。
第五步,用密钥M 1 -1、M 2 -1加密对角矩阵Q,得到加密查询向量T q
Figure PCTCN2021132779-appb-000006
说明的是,q为第二特征向量,β和r q为第二随机数,θ为相似度阈值,S q为预设的下三角矩阵,q′为第二扩展向量,π为第一密钥,Q为第二对角矩阵,M 1 -1、M 2 -1分别为第二密钥和第三密钥或者M 1 -1、M 2 -1分别为第三密钥和第二密钥,T q为加密查询向量。
由于在得到加密查询向量T q的过程中,引入了相似度阈值θ,这表示在区块链对待查询图像进行查询时,是在对待查询图像的相似图像进行查找,所查找到的图像是满足设定的相似度阈值θ的。
基于该方案,查询方在为待查询图像生成对应的加密查询向量时,若查询方的图像查询请求是对待查询图像的相似图像进行查询,则在查询方生成加密查询向量的过程中,查询方可以基于实际需要的图像相似度需求(即相似度阈值)而生成加密查询向量,从而接收到加密查询向量的区块链仅需要负责基于加密查询向量进行图像查找而得到目标加密索引向量,云服务器也仅仅只需要根据用于指示目标加密索引向量的索引信息而向区块链返回待校验的目标密文图像。由于目前投入使用的云服务器是基于安全k近邻算法而向查询方返回对检索结果进行排序(按照相似度从大到小的顺序排序)后的前k个密文图像,由于对检索结果排序后,密文图像排序越靠前,则意味着与待查询图像的相似度越大,所以背景技术中的云服务器根据排序结果和额外的背景知识将能够猜测出查询方的查询请求,从而容易导致查询方的隐私泄露问题。显然,相比于现有技术中的由云服务器根据安全k近邻算法而返回查询方的相似图像查询结果的方案,本申请方案中的云服务器是无法知晓与待查询图像最相近的密文图像为哪一个/些的,即云服务器无法基于目标密文图像而推测出查询方的查询请求,从而可以克服背景技术中云服务器可能存在的隐私泄露问题;此外,基于与云服务器相同的逻辑,区块链也将无法基于目标密文图像而推测出查询方的查询请求,即不会产生区块链对查询方的查询请求进行获知而导致的隐私泄露问题。
在查询方用向量的加密密钥对特征向量q进行加密并得到加密查询向量T q后,查询方通过交易将加密查询向量和押金发送给SEARCH合约,调用合约中的Search()函数进行查 询。
说明的是,SEARCH合约是通过交易而在区块链上部署的一个智能合约,用于实现搜索功能。本申请实施例中,在部署SEARCH合约的同时,还可以同时部署用于支付的PAYMENT合约、用于验证的VERIFY合约和用于更新的UPDATE合约。
继续说明的是,预训练的卷积神经网络模型包括以下模型中的任一个:VGG、ResNet、Xception、GoogLeNet、DenseNet和Inception。
在上述步骤202的一个实施中,针对任一明文图像,图像所有方生成所述明文图像的加密索引;所述加密索引包括基于所述明文图像生成的加密索引向量及基于所述加密索引向量生成的哈希值;所述图像所有方将各加密索引上链至区块链中;所述图像所有方将各明文图像加密为各密文图像并发送至云服务器。
在本申请的某些实施中,所述图像所有方生成所述明文图像的加密索引,包括:所述图像所有方提取所述明文图像的第一特征向量;所述图像所有方基于第一随机数,得到所述第一特征向量的第一扩展向量;所述图像所有方基于向量密钥中的第一密钥对所述第一扩展向量进行处理,得到第一对角矩阵;所述图像所有方基于所述向量密钥中的第二密钥和第三密钥,对所述第一对角矩阵和预设的下三角矩阵进行处理,得到加密索引向量;所述图像所有方确定所述明文图像的索引号和密文图像级联后的哈希值;所述图像所有方将所述明文图像的索引号、所述哈希值和所述加密索引向量确定为所述加密索引。
例如,针对于每一张自己所持有的明文图像,图像所有方可利用预训练的卷积神经网络模型提取该明文图像的特征向量f ID={f ID,1,f ID,2,…,f ID,d},并用向量的加密密钥对特征向量f ID进行加密,从而得到加密索引向量。
可选的,向量的加密密钥为:SK={M 1,M 2,M 1 -1,M 2 -1,π}。其中M 1,
Figure PCTCN2021132779-appb-000007
是两个随机可逆矩阵,
Figure PCTCN2021132779-appb-000008
分别为M 1,M 2的逆矩阵,π:
Figure PCTCN2021132779-appb-000009
是一个随机置换,d表示所提取的图像特征向量的维度。
则,根据上述的向量加密密钥对特征向量f ID进行加密的步骤如下:
第一步,为特征向量f ID随机选择两个数α、r f,ID和一个对角线元素为1的(d+5)×(d+5)维下三角矩阵S f,ID
第二步,将特征向量f ID扩展成f′ ID
Figure PCTCN2021132779-appb-000010
第三步,用密钥π将扩展后的向量f′ ID置换成f″ ID
f″ ID=π(f′ ID)。
第四步,将置换后的向量f″ ID转换成一个以f″ ID为对角元素的对角矩阵F ID
第五步,用密钥M 1、M 2加密对角矩阵F ID,得到加密索引向量C ID
C ID=M 1·S f,ID·FID·M 2
针对于任一张明文图像,在图像所有方用向量的加密密钥对它的特征向量f ID进行加密并得到加密索引向量C ID后,图像所有方可进一步对该明文图像的ID及对应密文级联后的哈希值h ID进行计算:
h ID=h(ID||c ID)。
其中,h()为哈希函数,“||”表示级联操作。
针对于任一张明文图像,在图像所有方得到它的哈希值h ID值后,图像所有方可进一步将<ID,h ID,C ID>定义为该明文图像m ID的加密索引I ID。在得到明文图像的加密索引I ID后,图像所有方可通过交易将加密索引I ID上传至区块链,以使区块链对其进行存储。
其中,交易的哈希值由变色龙哈希函数ch()计算。如图3所示,为本申请实施例提供的一种区块链对加密索引进行存储的示意图。参考图3,表示的是区块链中的一个区块,记为区块i,对图像所有方发送的一些加密索引进行存储的示意图,分为区块头和区块体,区块头中包括前一个区块哈希、区块随机数、时间戳和哈希树根,区块体中包括由若干交易生成的哈希树,其中哈希树的叶子节点存储由加密索引对应的交易Tx及交易的随机数rd计算出来的变色龙哈希值,非叶子节点存储由其两个孩子节点的哈希值级联之后计算出来的哈希值,该哈希树在图像所有方需要对存储于区块链上的加密索引进行更新时而使用。
说明的是,f ID为第一特征向量,α、r f,ID为第一随机数,S f,ID为预设的下三角矩阵,f′ ID为第一扩展向量, π为第一密钥,F ID为第二对角矩阵,M 1、M 2分别为第二密钥和第三密钥或者M 1、M 2分别为第三密钥和第二密钥,C ID为加密索引向量,h ID为哈希值,I ID为加密索引。
说明的是,在区块链接收到交易时,更具体一点,是区块链中的矿工接收到交易,则接收到交易的矿工需验证交易的合法性和正确性,并将验证通过的交易放进未确认交易池中等待打包,如果验证失败,该交易会被标记为“无效交易”,且不会被打包。通过执行共识协议确定获得记账权的矿工,该矿工会从未确认交易池中抽取近千笔未确认交易,并打包成一个区块而广播到区块链网络中。其他矿工校验这个区块之后,就停止自己的挖矿, 开始基于这个区块挖新的矿。该区块中的所有交易被永远记录在区块链中,也就是明文图像的加密索引已经被成功存储在区块链中。
其中,共识协议可包括以下协议中的任一个:工作量证明和权益证明。
继续说明的是,预训练的卷积神经网络模型包括以下模型中的任一个:VGG、ResNet、Xception、GoogLeNet、DenseNet和Inception。
在上述步骤202的一个实施中,所述区块链从链上存储的加密索引中,查找与所述加密查询向量匹配的目标加密索引向量,包括:所述区块链针对所述加密索引中的任一加密索引,确定所述加密索引中的加密索引向量与所述加密查询向量乘积的迹;所述区块链若确定所述迹满足设定阈值,则将所述加密索引向量作为所述目标加密索引向量。
例如,区块链收到查询方发起的交易之后,其中的SEARCH合约首先调用PAYMENT合约中的check()函数检查押金是否超过图像所有方和云服务器分别定义的消息费$fee message和服务费$fee service之和,包括:
若押金超过和值,则SEARCH合约可进行后续的检索任务;
若押金不超过和值,则SEARCH合约将终止检索任务。
为了清楚地对本申请方案作出说明,本申请实施例中设押金超过和值,则SEARCH合约可逐个访问每一个区块的每一笔交易中所存储的加密索引,并计算加密查询向量与加密索引中的加密索引向量乘积,并对乘积求迹S:
S=Tr(C ID·T q)。
其中,Tr()表示方阵的主对角线上各个元素之和。
在计算得到迹S后,若迹S≥0,则SEARCH合约可基于该加密索引向量C ID而从链上存储的加密索引I ID中提取出对应的ID和h ID,并将所提取出的ID和h ID将加入结果列表L中,同时ID列将会被广播到区块链网络中。
在上述步骤204的一个实施中,所述云服务器将所述目标密文图像发送至所述查询方;所述区块链校验所述目标密文图像对应的第一哈希值与所述目标加密索引向量对应的第二哈希值是否一致,并将校验结果上链,包括:所述区块链若确定所述第一哈希值与所述第二哈希值一致,则确定所述目标密文图像符合所述加密查询向量;所述区块链向所述查询方发送指示信息,所述指示信息指示所述查询方对所述目标密文图像进行解密并获得明文图像。
接着前述的例子,当ID列被广播后,ID列可被云服务器接收到。收到广播的ID列之后,云服务器可根据ID列中的每一个ID、从本地存储的各密文图像中查找与每一个ID相对应的密文图像c ID,并将查找出的密文图像c ID作为检索结果R返回给查询方,同时通过交易将查找出的密文图像c ID发送给VERIFY合约,调用合约中的Verify()函数进行正确性验证。
说明的是,查找出的密文图像即为目标密文图像。
其中,区块链对密文图像c ID进行正确性验证的步骤如下:
第一步,收到云服务器发起的交易之后,VERIFY合约中的Verify()函数逐个计算交易中存储的密文图像的哈希值h(ID||c ID),并将计算得出的哈希值与结果列表L中的h ID进行比较。
第二步,如果每一笔交易计算出来的哈希值与结果列表L中对应的哈希值相等,则VERIFY合约一方面可调用PAYMENT合约中Transfer()函数将消息费$fee message和服务费$fee service分别转到图像所有方和云服务器的账户,另一方面VERIFY合约可向查询方发送检索结果通过验证的指示信息,该指示信息用于指示查询方可对云服务器发送的密文图像c ID进行解密并获得对应的明文图像;否则,退回查询方的押金。
在一些场景下,图像所有方存在需要对存储于云服务器上的密文图像以及存储于区块链上的加密索引进行更新的需求。
在本申请某些实施中,所述图像所有方基于第一明文图像生成第一加密索引,并构建包括所述第一加密索引的第一交易;所述图像所有方根据第二明文图像的第二加密索引对应的第二交易和所述第一交易,确定更新随机数;所述更新随机数用于指示所述第二明文图像更新为所述第一明文图像;所述图像所有方将所述第一交易和所述更新随机数发送至所述区块链。
例如,接下来可通过下述两个例子说明图像所有方如何分别实现对密文图像以及加密索引的更新:
情形1,欲更新图像的图像所有方更新区块链上存储的加密索引。其更新加密索引的步骤如下:
第一步,图像所有方提取新图像m′的特征向量并构建加密索引,其中构建加密索引的具体过程可参考本申请前述的实施例,此处不赘述。
第二步,图像所有方获取待更新图像m对应的交易Tx并标记其为旧交易,计算新图像m′对应的交易Tx′并标记其为新交易,计算新交易与旧交易的变色龙哈希碰撞,得到新交易对应的随机数rd′标记其为新随机数。
第三步,图像所有方通过交易将新随机数rd′和新交易Tx′发送给UPDATE合约,调用合约中的Update()函数进行更新。
第四步,UPDATE合约将区块链区块体中的旧交易Tx替换为新交易Tx′,同时将哈希树的叶子节点的旧交易Tx与旧随机数rd替换为新交易Tx′与新随机数rd′。
说明的是,新图像m′为第一明文图像,待更新图像m为第二明文图像,新随机数rd′为更新随机数。
情形2,欲更新图像的图像所有方更新云服务器上存储的密文图像。其更新密文图像的步骤如下:
第一步,图像所有方对新图像m′进行加密,其中对新图像m′进行加密的具体过程可参考本申请前述的实施例,此处不赘述。
第二步,图像所有方将新图像m′的密文图像发送给云服务器,从而云服务器可将待更新图像m的密文图像替换为新图像m′的密文图像。
基于同样的构思,本申请实施例提供一种区块链,如图4所示,该区块链包括收发单元401、查找单元402和校验单元403;
收发单元401,用于接收查询方发送的图像查询请求,所述图像查询请求包括基于待查询图像生成的加密查询向量。
查找单元402,用于从链上存储的加密索引中,查找与所述加密查询向量匹配的目标加密索引向量;其中,每个加密索引包括加密索引向量和基于所述加密索引向量生成的哈希值,所述加密索引向量是图像所有方基于对应的明文图像生成的。
收发单元401,还用于发送用于指示所述目标加密索引向量的索引信息至云服务器,并接收所述云服务器发送的所述目标加密索引向量对应的目标密文图像。
校验单元403,用于校验所述目标密文图像对应的第一哈希值与所述目标加密索引向量对应的第二哈希值是否一致,并将校验结果上链。
进一步的,对于该区块链,所述加密查询向量是所述查询方根据所述待查询图像的特征向量及相似度阈值生成的;所述相似度阈值用于指示所述区块链查找与所述加密查询向量满足所述相似度阈值的加密索引向量。
进一步的,对于该区块链,所述加密索引还包括索引号;收发单元401,具体用于:发送所述目标加密索引向量对应的目标索引号至云服务器。
进一步的,对于该区块链,查找单元402,具体用于:针对所述加密索引中的任一加密索引,确定所述加密索引中的加密索引向量与所述加密查询向量乘积的迹;若确定所述迹满足设定阈值,则将所述加密索引向量作为所述目标加密索引向量。
基于同样的构思,本申请实施例提供一种图像查找装置,如图5所示,该图像查找装置包括加密索引生成单元501和发送单元502;
加密索引生成单元501,用于生成任一明文图像的加密索引;所述加密索引包括基于所述明文图像生成的加密索引向量及基于所述加密索引向量生成的哈希值。
发送单元502,用于将各加密索引上链至区块链中。
发送单元502,还用于将各明文图像加密为各密文图像并发送至云服务器。
进一步的,对于该图像查找装置,加密索引生成单元501,具体用于:所述图像所有方提取所述明文图像的第一特征向量;所述图像所有方基于第一随机数,得到所述第一特征向量的第一扩展向量;所述图像所有方基于向量密钥中的第一密钥对所述第一扩展向量进行处理,得到第一对角矩阵;所述图像所有方基于所述向量密钥中的第二密钥和第三密钥,对所述第一对角矩阵和预设的下三角矩阵进行处理,得到加密索引向量;所述图像所有方确定所述明文图像的索引号和密文图像级联后的哈希值;所述图像所有方将所述明文图像的索引号、所述哈希值和所述加密索引向量确定为所述加密索引。
进一步的,对于该图像查找装置,还包括交易构建单元503和更新随机数确定单元504;交易构建单元503,用于基于第一明文图像生成第一加密索引,并构建包括所述第一加密索引的第一交易;更新随机数确定单元504,用于根据第二明文图像的第二加密索引对应的第二交易和所述第一交易,确定更新随机数;所述更新随机数用于指示所述第二明文图 像更新为所述第一明文图像;发送单元502,具体用于将所述第一交易和所述更新随机数发送至所述区块链。
基于同样的构思,本申请实施例提供一种云服务器,如图6所示,该云服务器包括收发单元601和确定单元602;
收发单元601,用于接收区块链发送的索引信息;所述索引信息用于指示目标加密索引向量;所述目标加密索引向量是所述区块链基于查询方的图像查询请求,从链上存储的加密索引中确定出的、与所述图像查询请求中的加密查询向量匹配的加密索引向量;所述加密索引向量是图像所有方基于对应的明文图像生成的,所述加密查询向量是查询方基于待查询图像生成的。
确定单元602,用于从各密文图像中确定符合所述索引信息的目标密文图像;所述各密文图像是所述图像所有方对各明文图像分别进行加密生成、并发送至所述云服务器进行存储的。
收发单元601,还用于将所述目标密文图像发送至所述区块链和所述查询方。
基于同样的构思,本申请实施例提供一种图像查找装置,如图7所示,该图像查找装置包括收发单元701和处理单元702;
收发单元701,用于将图像查询请求发送至区块链,所述图像查询请求包括基于待查询图像生成的加密查询向量。
收发单元701,还用于接收云服务器发送的目标密文图像;所述目标密文图像是所述云服务器基于区块链发送的索引信息、从本地存储的各密文图像中确定的;所述索引信息用于指示目标加密索引向量,所述目标加密索引向量是所述区块链从链上存储的加密索引中确定出的、与所述加密查询向量匹配的加密索引向量;所述加密索引向量是图像所有方基于对应的明文图像生成的。
处理单元702,用于从所述区块链获取所述图像查询请求对应的校验结果,确定是否对所述目标密文图像进行解密;所述校验结果是所述区块链校验所述目标密文图像对应的第一哈希值与所述目标加密索引向量对应的第二哈希值是否一致后生成的。
进一步的,对于该图像查找装置,还包括加密查询向量生成单元703;加密查询向量生成单元703,用于:提取所述待查询图像的第二特征向量;基于第二随机数和相似度阈值,得到所述第二特征向量的第二扩展向量;所述相似度阈值用于指示所述区块链查找与所述加密查询向量满足所述相似度阈值的加密索引向量;基于向量密钥中的第一密钥对所述第二扩展向量进行处理,得到第二对角矩阵;基于所述向量密钥中的第二密钥和第三密钥,对所述第二对角矩阵和预设的下三角矩阵进行处理,得到所述加密查询向量。
本申请实施例还提供了一种计算设备,该计算设备具体可以为桌面计算机、便携式计算机、智能手机、平板电脑、个人数字助理(Personal Digital Assistant,PDA)等。该计算设备可以包括中央处理器(Center Processing Unit,CPU)、存储器、输入/输出设备等,输入设备可以包括键盘、鼠标、触摸屏等,输出设备可以包括显示设备,如液晶显示器(Liquid Crystal Display,LCD)、阴极射线管(Cathode Ray Tube,CRT)等。
存储器,可以包括只读存储器(ROM)和随机存取存储器(RAM),并向处理器提供存储器中存储的程序指令和数据。在本申请实施例中,存储器可以用于存储图像查找方法的程序指令;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行图像查找方法。
如图8所示,为本申请实施例提供的一种计算设备的示意图,该计算设备包括:
处理器801、存储器802、收发器803、总线接口804;其中,处理器801、存储器802与收发器803之间通过总线805连接;
所述处理器801,用于读取所述存储器802中的程序,执行上述图像查找方法;
处理器801可以是中央处理器(central processing unit,简称CPU),网络处理器(network processor,简称NP)或者CPU和NP的组合。还可以是硬件芯片。上述硬件芯片可以是 专用集成电路(application-specific integrated circuit,简称ASIC),可编程逻辑器件(programmable logic device,简称PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,简称CPLD),现场可编程逻辑门阵列(field-programmable gate array,简称FPGA),通用阵列逻辑(generic array logic,简称GAL)或其任意组合。
所述存储器802,用于存储一个或多个可执行程序,可以存储所述处理器801在执行操作时所使用的数据。
具体地,程序可以包括程序代码,程序代码包括计算机操作指令。存储器802可以包括易失性存储器(volatile memory),例如随机存取存储器(random-access memory,简称RAM);存储器802也可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory),硬盘(hard disk drive,简称HDD)或固态硬盘(solid-state drive,简称SSD);存储器802还可以包括上述种类的存储器的组合。
存储器802存储了如下的元素,可执行模块或者数据结构,或者它们的子集,或者它们的扩展集:
操作指令:包括各种操作指令,用于实现各种操作。
操作系统:包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。
总线805可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图8中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
总线接口804可以为有线通信接入口,无线总线接口或其组合,其中,有线总线接口例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线总线接口可以为WLAN接口。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使计算机执行图像查找方法。
本领域内的技术人员应明白,本申请的实施例可提供为方法、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概 念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (16)

  1. 一种图像查找方法,其特征在于,包括:
    区块链接收查询方发送的图像查询请求,所述图像查询请求包括基于待查询图像生成的加密查询向量;
    所述区块链从链上存储的加密索引中,查找与所述加密查询向量匹配的目标加密索引向量;其中,每个加密索引包括加密索引向量和基于所述加密索引向量生成的哈希值,所述加密索引向量是图像所有方基于对应的明文图像生成的;
    所述区块链发送用于指示所述目标加密索引向量的索引信息至云服务器,并接收所述云服务器发送的所述目标加密索引向量对应的目标密文图像;
    所述区块链校验所述目标密文图像对应的第一哈希值与所述目标加密索引向量对应的第二哈希值是否一致,并将校验结果上链。
  2. 如权利要求1所述的方法,其特征在于,所述加密查询向量是所述查询方根据所述待查询图像的特征向量及相似度阈值生成的;所述相似度阈值用于指示所述区块链查找与所述加密查询向量满足所述相似度阈值的加密索引向量。
  3. 如权利要求2所述的方法,其特征在于,所述加密索引还包括索引号;
    所述区块链发送用于指示所述目标加密索引向量的索引信息至云服务器,包括:
    所述区块链发送所述目标加密索引向量对应的目标索引号至云服务器。
  4. 如权利要求3所述的方法,其特征在于,
    所述区块链从链上存储的加密索引中,查找与所述加密查询向量匹配的目标加密索引向量,包括:
    所述区块链针对所述加密索引中的任一加密索引,确定所述加密索引中的加密索引向量与所述加密查询向量乘积的迹;
    所述区块链若确定所述迹满足设定阈值,则将所述加密索引向量作为所述目标加密索引向量。
  5. 一种图像查找方法,其特征在于,包括:
    针对任一明文图像,图像所有方生成所述明文图像的加密索引;所述加密索引包括基于所述明文图像生成的加密索引向量及基于所述加密索引向量生成的哈希值;
    所述图像所有方将各加密索引上链至区块链中;
    所述图像所有方将各明文图像加密为各密文图像并发送至云服务器。
  6. 如权利要求5所述的方法,其特征在于,
    所述图像所有方生成所述明文图像的加密索引,包括:
    所述图像所有方提取所述明文图像的第一特征向量;
    所述图像所有方基于第一随机数,得到所述第一特征向量的第一扩展向量;
    所述图像所有方基于向量密钥中的第一密钥对所述第一扩展向量进行处理,得到第一对角矩阵;
    所述图像所有方基于所述向量密钥中的第二密钥和第三密钥,对所述第一对角矩阵和预设的下三角矩阵进行处理,得到加密索引向量;
    所述图像所有方确定所述明文图像的索引号和密文图像级联后的哈希值;
    所述图像所有方将所述明文图像的索引号、所述哈希值和所述加密索引向量确定为所述加密索引。
  7. 如权利要求5所述的方法,其特征在于,
    所述方法还包括:
    所述图像所有方基于第一明文图像生成第一加密索引,并构建包括所述第一加密索引的第一交易;
    所述图像所有方根据第二明文图像的第二加密索引对应的第二交易和所述第一交易,确定更新随机数;所述更新随机数用于指示所述第二明文图像更新为所述第一明文图像;
    所述图像所有方将所述第一交易和所述更新随机数发送至所述区块链。
  8. 一种图像查找方法,其特征在于,包括:
    云服务器接收区块链发送的索引信息;所述索引信息用于指示目标加密索引向量;所述目标加密索引向量是所述区块链基于查询方的图像查询请求,从链上存储的加密索引中确定出的、与所述图像查询请求中的加密查询向量匹配的加密索引向量;所述加密索引向量是图像所有方基于对应的明文图像生成的,所述加密查询向量是查询方基于待查询图像生成的;
    所述云服务器从各密文图像中确定符合所述索引信息的目标密文图像;所述各密文图像是所述图像所有方对各明文图像分别进行加密生成、并发送至所述云服务器进行存储的;
    所述云服务器将所述目标密文图像发送至所述区块链和所述查询方。
  9. 一种图像查找方法,其特征在于,包括:
    查询方将图像查询请求发送至区块链,所述图像查询请求包括基于待查询图像生成的加密查询向量;
    所述查询方接收云服务器发送的目标密文图像;所述目标密文图像是所述云服务器基于区块链发送的索引信息、从本地存储的各密文图像中确定的;所述索引信息用于指示目标加密索引向量,所述目标加密索引向量是所述区块链从链上存储的加密索引中确定出的、与所述加密查询向量匹配的加密索引向量;所述加密索引向量是图像所有方基于对应的明文图像生成的;
    所述查询方从所述区块链获取所述图像查询请求对应的校验结果,确定是否对所述目标密文图像进行解密;所述校验结果是所述区块链校验所述目标密文图像对应的第一哈希值与所述目标加密索引向量对应的第二哈希值是否一致后生成的。
  10. 如权利要求9所述的方法,其特征在于,
    所述查询方将图像查询请求发送至区块链之前,还包括:
    所述查询方提取所述待查询图像的第二特征向量;
    所述查询方基于第二随机数和相似度阈值,得到所述第二特征向量的第二扩展向量;所述相似度阈值用于指示所述区块链查找与所述加密查询向量满足所述相似度阈值的加密索引向量;
    所述查询方基于向量密钥中的第一密钥对所述第二扩展向量进行处理,得到第二对角矩阵;
    所述查询方基于所述向量密钥中的第二密钥和第三密钥,对所述第二对角矩阵和预设的下三角矩阵进行处理,得到所述加密查询向量。
  11. 一种区块链,其特征在于,包括:
    收发单元,用于接收查询方发送的图像查询请求,所述图像查询请求包括基于待查询图像生成的加密查询向量;
    查找单元,用于从链上存储的加密索引中,查找与所述加密查询向量匹配的目标加密索引向量;其中,每个加密索引包括加密索引向量和基于所述加密索引向量生成的哈希值,所述加密索引向量是图像所有方基于对应的明文图像生成的;
    所述收发单元,还用于发送用于指示所述目标加密索引向量的索引信息至云服务器,并接收所述云服务器发送的所述目标加密索引向量对应的目标密文图像;
    校验单元,用于校验所述目标密文图像对应的第一哈希值与所述目标加密索引向量对应的第二哈希值是否一致,并将校验结果上链。
  12. 一种图像查找装置,其特征在于,包括:
    加密索引生成单元,用于生成任一明文图像的加密索引;所述加密索引包括基于所述明文图像生成的加密索引向量及基于所述加密索引向量生成的哈希值;
    发送单元,用于将各加密索引上链至区块链中;
    所述发送单元,还用于将各明文图像加密为各密文图像并发送至云服务器。
  13. 一种云服务器,其特征在于,包括:
    收发单元,用于接收区块链发送的索引信息;所述索引信息用于指示目标加密索引向量;所述目标加密索引向量是所述区块链基于查询方的图像查询请求,从链上存储的加密索引中确定出的、与所述图像查询请求中的加密查询向量匹配的加密索引向量;所述加密索引向量是图像所有方基于对应的明文图像生成的,所述加密查询向量是查询方基于待查询图像生成的;
    确定单元,用于从各密文图像中确定符合所述索引信息的目标密文图像;所述各密文图像是所述图像所有方对各明文图像分别进行加密生成、并发送至所述云服务器进行存储的;
    所述收发单元,还用于将所述目标密文图像发送至所述区块链和所述查询方。
  14. 一种图像查找装置,其特征在于,包括:
    收发单元,用于将图像查询请求发送至区块链,所述图像查询请求包括基于待查询图像生成的加密查询向量;
    所述收发单元,还用于接收云服务器发送的目标密文图像;所述目标密文图像是所述云服务器基于区块链发送的索引信息、从本地存储的各密文图像中确定的;所述索引信息用于指示目标加密索引向量,所述目标加密索引向量是所述区块链从链上存储的加密索引中确定出的、与所述加密查询向量匹配的加密索引向量;所述加密索引向量是图像所有方基于对应的明文图像生成的;
    处理单元,用于从所述区块链获取所述图像查询请求对应的校验结果,确定是否对所述目标密文图像进行解密;所述校验结果是所述区块链校验所述目标密文图像对应的第一哈希值与所述目标加密索引向量对应的第二哈希值是否一致后生成的。
  15. 一种计算机设备,其特征在于,包括:
    存储器,用于存储计算机程序;
    处理器,用于调用所述存储器中存储的计算机程序,按照获得的程序执行如权利要求1-4、5-7、8、和9-10任一项所述的方法。
  16. 一种计算机可读存储介质,其特征在于,所述存储介质存储有计算机可执行指令,所述计算机可执行指令用于使计算机执行如权利要求1-4、5-7、8、和9-10任一项所述的方法。
PCT/CN2021/132779 2021-04-16 2021-11-24 一种图像查找方法、区块链、云服务器及图像查找装置 WO2022217926A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110409104.8A CN113094747B (zh) 2021-04-16 2021-04-16 一种图像查找方法、区块链、云服务器及图像查找装置
CN202110409104.8 2021-04-16

Publications (1)

Publication Number Publication Date
WO2022217926A1 true WO2022217926A1 (zh) 2022-10-20

Family

ID=76678144

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/132779 WO2022217926A1 (zh) 2021-04-16 2021-11-24 一种图像查找方法、区块链、云服务器及图像查找装置

Country Status (2)

Country Link
CN (1) CN113094747B (zh)
WO (1) WO2022217926A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116450918A (zh) * 2023-06-09 2023-07-18 辰风策划(深圳)有限公司 线上信息咨询方法、装置及电子设备
CN116582281A (zh) * 2023-07-10 2023-08-11 中国人民解放军国防科技大学 一种基于密码技术的安全人脸识别方法、系统及设备
CN116825259A (zh) * 2023-08-31 2023-09-29 四川省医学科学院·四川省人民医院 一种基于物联网的医疗数据管理方法

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113094747B (zh) * 2021-04-16 2024-02-09 深圳前海微众银行股份有限公司 一种图像查找方法、区块链、云服务器及图像查找装置
CN113656648A (zh) * 2021-08-09 2021-11-16 杭州安恒信息技术股份有限公司 数据查询方法、相关装置和介质
CN113868450B (zh) * 2021-09-29 2024-04-02 武汉大学 一种基于区块链的遥感影像安全检索方法
CN114036565B (zh) * 2021-11-19 2024-03-08 上海勃池信息技术有限公司 隐私信息检索系统及隐私信息检索方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190342072A1 (en) * 2014-11-24 2019-11-07 NEC Laboratories Europe GmbH Method for encrypting data for distributed storage
CN111460526A (zh) * 2020-04-17 2020-07-28 支付宝(杭州)信息技术有限公司 基于区块链的影像数据记录、获取、验证方法及装置
CN112528064A (zh) * 2020-12-10 2021-03-19 西安电子科技大学 一种隐私保护的加密图像检索方法及系统
CN113094747A (zh) * 2021-04-16 2021-07-09 深圳前海微众银行股份有限公司 一种图像查找方法、区块链、云服务器及图像查找装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334612B (zh) * 2018-02-07 2022-03-29 华南理工大学 一种针对密文域的形近汉字全文模糊检索方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190342072A1 (en) * 2014-11-24 2019-11-07 NEC Laboratories Europe GmbH Method for encrypting data for distributed storage
CN111460526A (zh) * 2020-04-17 2020-07-28 支付宝(杭州)信息技术有限公司 基于区块链的影像数据记录、获取、验证方法及装置
CN112528064A (zh) * 2020-12-10 2021-03-19 西安电子科技大学 一种隐私保护的加密图像检索方法及系统
CN113094747A (zh) * 2021-04-16 2021-07-09 深圳前海微众银行股份有限公司 一种图像查找方法、区块链、云服务器及图像查找装置

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116450918A (zh) * 2023-06-09 2023-07-18 辰风策划(深圳)有限公司 线上信息咨询方法、装置及电子设备
CN116450918B (zh) * 2023-06-09 2023-08-25 辰风策划(深圳)有限公司 线上信息咨询方法、装置及电子设备
CN116582281A (zh) * 2023-07-10 2023-08-11 中国人民解放军国防科技大学 一种基于密码技术的安全人脸识别方法、系统及设备
CN116582281B (zh) * 2023-07-10 2023-09-22 中国人民解放军国防科技大学 一种基于密码技术的安全人脸识别方法、系统及设备
CN116825259A (zh) * 2023-08-31 2023-09-29 四川省医学科学院·四川省人民医院 一种基于物联网的医疗数据管理方法
CN116825259B (zh) * 2023-08-31 2023-11-07 四川省医学科学院·四川省人民医院 一种基于物联网的医疗数据管理方法

Also Published As

Publication number Publication date
CN113094747B (zh) 2024-02-09
CN113094747A (zh) 2021-07-09

Similar Documents

Publication Publication Date Title
WO2022217926A1 (zh) 一种图像查找方法、区块链、云服务器及图像查找装置
US11050555B2 (en) Method for remotely acquiring secret key, POS terminal and storage medium
KR102493744B1 (ko) 생체 특징에 기초한 보안 검증 방법, 클라이언트 단말, 및 서버
US10382965B2 (en) Identity verification using computer-implemented decentralized ledger
WO2020048241A1 (zh) 区块链跨链的认证方法、系统、服务器及可读存储介质
US20190036692A1 (en) System and method for generating a recovery key and managing credentials using a smart blockchain contract
JP6180177B2 (ja) プライバシーを保護することができる暗号化データの問い合わせ方法及びシステム
US10917249B2 (en) Processing data elements stored in blockchain networks
US9485098B1 (en) System and method of user authentication using digital signatures
CN110392038B (zh) 一种多用户场景下可验证的多密钥可搜索加密方法
EP3933624A1 (en) Blockchain-based identity verification method and related hardware
CN108351905B (zh) 隐匿检索系统、隐匿检索方法及计算机可读取的记录介质
JP6967449B2 (ja) セキュリティチェックのための方法、デバイス、端末およびサーバ
WO2021008118A1 (zh) 业务系统的访问方法及装置
US11244146B2 (en) Systems and methods for secure user logins with facial recognition and blockchain
CN114048448A (zh) 基于区块链的动态可搜索加密方法及装置
US11804961B1 (en) Secure video content transmission over a computer network
CN110908959A (zh) 一种支持多关键字和结果排序的动态可搜索加密方法
KR20200126061A (ko) 블록체인 네트워크에서의 트랜잭션의 삭제를 가능하게 하는 노드 장치 및 그 동작 방법
US20220188393A1 (en) Biometric locking methods and systems for internet of things and the connected person
WO2022048589A1 (zh) 数据获取方法、装置、设备和介质
JP6289768B2 (ja) 暗号化装置、暗号化プログラム及び暗号化方法
CN112860933B (zh) 密文图像检索方法、装置、终端设备及存储介质
CN109918451A (zh) 基于区块链的数据库管理方法及系统
CN114268447B (zh) 一种文件传输方法、装置、电子设备和计算机可读介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21936792

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 19.01.2024)