CN109766707B - Data processing method, device, equipment and medium based on block chain - Google Patents

Data processing method, device, equipment and medium based on block chain Download PDF

Info

Publication number
CN109766707B
CN109766707B CN201910045588.5A CN201910045588A CN109766707B CN 109766707 B CN109766707 B CN 109766707B CN 201910045588 A CN201910045588 A CN 201910045588A CN 109766707 B CN109766707 B CN 109766707B
Authority
CN
China
Prior art keywords
search
file
keyword
chain
data processing
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201910045588.5A
Other languages
Chinese (zh)
Other versions
CN109766707A (en
Inventor
张琰
王瑾璠
齐竹云
杨镕玮
汪漪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Southwest University of Science and Technology
Original Assignee
Southwest University of Science and Technology
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 Southwest University of Science and Technology filed Critical Southwest University of Science and Technology
Priority to CN201910045588.5A priority Critical patent/CN109766707B/en
Publication of CN109766707A publication Critical patent/CN109766707A/en
Application granted granted Critical
Publication of CN109766707B publication Critical patent/CN109766707B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data processing method, a device, equipment and a storage medium based on a block chain. Wherein, the method comprises the following steps: determining file information and a keyword set of a file, and generating a search token of each keyword in the keyword set; and generating a data processing request on the chain according to the file information and the search token of each keyword, sending the data processing request on the chain to a blockchain network, processing the data processing request on the chain by the blockchain network, and storing the obtained index relationship between the file information and the keywords as transaction data in the blockchain. The problems that a platform is easily attacked maliciously and data security and user privacy cannot be effectively guaranteed due to the centralized storage encryption searching technology can be effectively solved, and the security of data storage encryption searching is improved.

Description

Data processing method, device, equipment and medium based on block chain
Technical Field
Embodiments of the present invention relate to data processing technologies, and in particular, to a data processing method, apparatus, device, and storage medium based on a block chain.
Background
In recent years, many attempts and researches are made in the scientific research field for cloud storage systems. A storage encryption searching technology is generated aiming at centralized storage, and the privacy and the safety of a user are protected through an established safe search index and a reasonable encryption method.
At present, a common storage Encryption search technology based on centralization is generally based on a Symmetric Searchable Encryption (SSE) technology, and a security index is established after keywords are encrypted by extracting the keywords, so that files are searched on the premise of not leaking file information.
However, although the storage encryption search technology based on the centralization can implement encryption search on stored data, the centralization storage mode storage platform is easy to receive malicious attacks, and data security and user privacy cannot be effectively guaranteed, so that improvement is needed.
Disclosure of Invention
The embodiment of the invention provides a data processing method, a data processing device, data processing equipment and a data processing storage medium based on a block chain, and aims to improve the safety of data storage and encrypted search.
In a first aspect, an embodiment of the present invention provides a data processing method based on a block chain, where the method is executed by a client, and the method includes:
determining file information and a keyword set of a file, and generating a search token of each keyword in the keyword set;
and generating a data processing request on the chain according to the file information and the search token of each keyword, sending the data processing request on the chain to a blockchain network, processing the data processing request on the chain by the blockchain network, and storing the obtained index relationship between the file information and the keywords as transaction data in the blockchain.
In a second aspect, an embodiment of the present invention provides a data processing method based on a block chain, which is performed by a block chain node, and the method includes:
receiving an on-chain data processing request sent by a client, wherein the on-chain data processing request is generated according to file information and search tokens of all keywords, and the search tokens are generated according to a keyword set of a file;
and processing the data processing request on the chain, and storing the index relation between the file information and the key words as transaction data into the block chain according to the processing result.
In a third aspect, an embodiment of the present invention further provides a data processing apparatus based on a block chain, where the apparatus is configured in a client, and the apparatus includes:
the system comprises a search token generation module, a search token generation module and a search token generation module, wherein the search token generation module is used for determining file information and a keyword set of a file and generating a search token of each keyword in the keyword set;
the processing request generating module is used for generating a chained data processing request according to the file information and the search token of each keyword;
and the processing request sending module is used for sending the on-chain data processing request to the blockchain network, processing the on-chain data processing request by the blockchain network, and storing the obtained index relationship between the file information and the keyword into the blockchain as transaction data.
In a fourth aspect, an embodiment of the present invention further provides a data processing apparatus based on a blockchain, where the apparatus is configured in a blockchain node, and the apparatus includes:
the system comprises a processing request receiving module, a processing request processing module and a processing module, wherein the processing request receiving module is used for receiving a data processing request on a chain sent by a client, the data processing request on the chain is generated according to file information and search tokens of all keywords, and the search tokens are generated according to a keyword set of a file;
and the processing request processing module is used for processing the data processing request on the chain and storing the index relationship between the file information and the key words as transaction data into the block chain according to the processing result.
In a fifth aspect, an embodiment of the present invention further provides an apparatus, where the apparatus includes:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method for blockchain-based data processing of any of the first or second aspects.
In a sixth aspect, an embodiment of the present invention further provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the block chain based data processing method described in any of the first aspect or the second aspect.
According to the technical scheme of the embodiment of the invention, the client generates the search token of each keyword according to the determined keyword set of the file, generates the on-link data processing request together with the determined file information, and sends the on-link data processing request to the block link network. So that the blockchain network executes the on-chain data processing request and stores the index relationship between the file information and the key in the blockchain. According to the block chain-based storage encryption search technology, the problems that a storage platform is easily attacked maliciously and data security and user privacy cannot be effectively guaranteed are well solved, and the security of data storage encryption search is improved.
Drawings
Fig. 1 is a flowchart of a data processing method based on a block chain according to an embodiment of the present invention;
fig. 2 is a flowchart of a data processing method based on a block chain according to a second embodiment of the present invention;
fig. 3 is a flowchart of a data processing method based on a block chain according to a third embodiment of the present invention;
fig. 4 is a flowchart of a data processing method based on a block chain according to a fourth embodiment of the present invention;
fig. 5A is a flowchart of a data processing method based on a blockchain according to a fifth embodiment of the present invention;
5B-5C are schematic diagrams comparing the number of times of comparison of search tokens according to the fifth embodiment of the present invention;
fig. 6 is a signaling diagram of data processing based on a block chain according to a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a data processing apparatus based on a block chain according to a seventh embodiment of the present invention;
fig. 8 is a schematic structural diagram of a data processing apparatus based on a block chain according to an eighth embodiment of the present invention;
fig. 9 is a schematic structural diagram of an apparatus provided in the ninth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a data processing method based on a blockchain according to an embodiment of the present invention, where the method is applicable to a case where an index relationship between a file and a keyword in the file is stored in an encrypted manner based on interaction between a client and the blockchain, and the method may be executed by a data processing apparatus based on a blockchain, which is configured on a client and is provided by an embodiment of the present invention, and the apparatus may be implemented in a hardware and/or software manner. As shown in fig. 1, the method specifically comprises the following steps:
s101, determining file information and a keyword set of the file, and generating a search token of each keyword in the keyword set.
The file information is a file to be uploaded to the storage end or information of a file stored in the storage end, and may include identification information of the file and storage information of the file, specifically, the identification information of the file may be a name, a serial number, a pinyin brevity code, or the like of the file, and the storage information of the file may include a Uniform identifier (URL), a storage format, a size, or the like of the file. The keyword set of the file can be a set composed of keywords of the file to be uploaded to the storage end, or a set composed of keywords to be newly added to the file stored in the storage end. The search token of the keyword may be a token corresponding to the keyword obtained by the keyword according to a certain encryption algorithm, and the encrypted search technology is implemented based on the encrypted search token.
It should be noted that, in the embodiment of the present invention, it is determined that the file information and the keyword set of the file correspond to two different scenarios. The first scenario is that a user uploads a new file, and the process of determining file information at this time may be: the client automatically extracts the identification information of the file, the storage information of the file can be the storage information of the file which is sent to the storage end by the client, the storage end stores the uploaded file and then feeds the uploaded file back to the client, and the client determines the file information according to the extracted identification information of the file and the received storage information of the file; the process of determining the set of keywords for the file may be: after analyzing the content of the uploaded file, the client automatically extracts keywords of the uploaded file to form a key set; or the user can determine keywords of the uploaded file to form a key set; the user can also select a plurality of keywords from the keywords of the uploaded files extracted by the client to form a keyword set. Optionally, if the client automatically extracts the keyword set of the new file, the client may determine the keywords of the file after analyzing the content of the uploaded file by using a preset keyword extraction algorithm (such as a TF-IDF keyword extraction method, a Topic-model keyword extraction method, a RAKE keyword extraction method, and the like) to form a file keyword set; or inputting the uploaded file into a pre-trained keyword extraction model, and analyzing the uploaded file by the keyword extraction model based on a training algorithm and then outputting a keyword set of the uploaded file. The embodiment of the present invention is not limited thereto.
In the second scenario, a user adds a new keyword to a stored file, and the process of determining file information may be that after the user selects a file to which the keyword is to be added at a client, the client obtains the file information of the file; the process of determining the keyword set may be to obtain keywords to be added by the user to form a keyword set of the file, where the keyword set of the file is the newly added keyword set of the file.
Optionally, in the embodiment of the present invention, any algorithm for encrypting the keywords may be used to generate the search token for each keyword in the keyword set, and the search token for the keyword is obtained by encrypting the keywords. For example, it may be to invoke the message digest algorithm (
Figure BDA0001949043590000061
Algorithm) to calculate the search token for the keyword, the specific calculation formula is as follows:
Figure BDA0001949043590000062
wherein, WiThe ith keyword in the keyword set;
Figure BDA0001949043590000063
a search token that is an ith keyword; key2A token key for use in computing the search token; HMAC is a message digest algorithm, which is a key-dependent hashing algorithm that takes a key and a message as inputs and generates a message digest as an output (i.e., a search token). Account-required token key for computing search token2The token key may be generated when the client initializes, and the token keys corresponding to the keywords in the keyword set may be the same or different.
Illustratively, for each keyword in the keyword set, a search token for each keyword is generated according to a preset encryption algorithm.
S102, generating a data processing request on the chain according to the file information and the search token of each keyword, sending the data processing request on the chain to the blockchain network, processing the data processing request on the chain by the blockchain network, and storing the obtained index relation between the file information and the keywords as transaction data in the blockchain.
The on-chain data processing request may be a transaction processing request generated by the client according to a preset on-chain data processing request generation algorithm, and the algorithm may be to establish an index relationship between the file information and each keyword search token, for example, may be to establish a relationship between { file information: search token for keyword } indicating a correspondence between the index token for keyword and file information. The generated on-chain data processing request may be to request the current block generation node in the block chain network to process the data contained therein, to obtain an index relationship between the file information and the keyword, for example, the index relationship may be an index relationship between the file information and each keyword search token, and store the obtained index relationship in the block chain network according to a preset format.
Optionally, in order to improve the efficiency of encrypted search and the security of encrypted search, in the embodiment of the present invention, when the client generates the on-chain data processing request according to the file information and the search token of each keyword, the client may establish an index relationship between the file information and the keyword for the file information and each keyword after processing the search token of the keyword, so that the generated on-chain data processing request includes an index relationship of multiple dimensions between the file information and each keyword.
Optionally, in the embodiment of the present invention, after the client generates the on-chain data processing request, the client sends the generated on-chain data processing request to the blockchain network, and after the current blockchain generation node of the blockchain network receives the on-chain data processing request, the on-chain data processing request is processed, an index relationship of at least one dimension between the file information and the keyword (i.e., transaction data obtained by processing the on-chain data processing request) is obtained, and each index relationship is stored in the blockchain according to a preset storage rule. Wherein processing the data processing request on the chain and storing the index relationship in the blockchain may be performed based on an intelligent contract in the blockchain.
It should be noted that the client in the embodiment of the present invention may be a node in the blockchain network, or may be a node that can participate in the blockchain by calling a web page, a platform, an application program, or the like through the client.
In the data processing method based on the blockchain provided in this embodiment, the client generates a search token for each keyword according to the determined keyword set of the file, generates a linked data processing request together with the determined file information, and sends the linked data processing request to the blockchain network. So that the blockchain network executes the on-chain data processing request and stores the index relationship between the file information and the key in the blockchain. According to the block chain-based storage encryption search technology, the problems that a storage platform is easily attacked maliciously and data security and user privacy cannot be effectively guaranteed are well solved, and the security of data storage encryption search is improved.
Example two
Fig. 2 is a flowchart of a data processing method based on a block chain according to a second embodiment of the present invention. The method can be executed by a client, and the embodiment performs further optimization on the basis of the above embodiment, and specifically gives a description of a specific situation of a data processing request on a link generated according to file information and a search token of each keyword. Referring to fig. 2, the method specifically includes:
s201, determining file information and a keyword set of the file, and generating a search token of each keyword in the keyword set.
S202, determining the dynamic accumulated value of the file according to the search token of each keyword.
The dynamic accumulated value of the file can be obtained by performing accumulation operation on the search tokens of each keyword according to a certain encryption algorithm based on a dynamic accumulator. It should be noted that when the keyword corresponding to the document changes, the dynamic accumulated value of the document also increases or decreases correspondingly.
Optionally, in the embodiment of the present invention, the process of determining the dynamic accumulated value of the file according to the search token of each keyword may be determining the latest dynamic accumulated value of the file according to the search token of each keyword, an accumulator key, and a historical dynamic accumulated value of the file.
The accumulator key may be pre-generated by the client (e.g., may be generated at the initialization of the client), and the key may be a set of keys required by the dynamic accumulator, such as puda=(puda-pk,puda-sk) Wherein p isuda-pkIs the public key of the dynamic accumulator, puda-skIs the private key of the dynamic accumulator. The historical dynamic accumulation value for a file may be the dynamic accumulation value determined for the last calculation of the file. When the keywords of the file change, the dynamic accumulated value of the file also changes, so when a user adds a new keyword to a stored file, the dynamic accumulated value of the file is determined before, and the dynamic accumulated value obtained by the latest calculation of the file is used as the historical dynamic accumulated value of the file.
Specifically, the search token of each keyword, the accumulator key, and the historical dynamic accumulated value of the file may be used as the input of an accumulation algorithm, and the accumulation algorithm determines the dynamic accumulated value of the file through operation. It should be noted that the search token of each keyword refers to the search token of each keyword in the file keyword set determined in S201, and if the file is a newly added file, the keyword set may be a set of keywords determined according to the content of the newly added file; if the file is a stored file, the keyword set is a keyword which the user wants to newly add to the stored file at this time, and the keyword set does not include the existing keywords of the stored file. The historical dynamic accumulated values of the files are not all the files, only the stored files have the historical dynamic accumulated values, and the dynamic accumulated values of the files are not determined by newly added files. Therefore, for the newly added uploaded files, the parameter of the historical dynamic accumulated value can be ignored when the dynamic accumulated value of the files is determined according to the accumulation algorithm.
Optionally, in order to quickly and accurately calculate the corresponding dynamic accumulated values for different file types (a newly added file and a stored file), different accumulation algorithms may be used to determine the dynamic accumulated values of the files for different file types, for example:
if the file is a newly added file uploaded by the client, the client can call the AccVal algorithm according to the formula according to the accumulator key and the search token of each keyword
Figure BDA0001949043590000101
And accumulating and calculating the search token of each keyword according to the key of the accumulator to generate a dynamic accumulated value of the newly added file. Wherein v is the accumulated value of the dynamic accumulator; a iscAnd AiIs a set of auxiliary information;
Figure BDA0001949043590000102
a search token that is an ith keyword; pudaThe dynamic accumulator is a pair of keys required by the dynamic accumulator to perform accumulation calculation, namely an accumulator key; the AccVal algorithm may be an algorithm that performs an accumulation calculation on the newly added file based on a dynamic accumulator.
If the file is a stored file which has been uploaded by the client before, the client can call the AddEle algorithm according to the formula and the search token of each keyword according to the accumulator key, the historical dynamic accumulated value of the stored file and the
Figure BDA0001949043590000103
And accumulating and calculating the search token of each keyword according to the accumulator key and the historical dynamic accumulated value to generate the latest dynamic accumulated value of the stored file. Wherein v is the accumulated value of the dynamic accumulator; a iscAnd AiIs a set of auxiliary information;
Figure BDA0001949043590000104
search token for the ith keyword, PudaIs the accumulator key; v' is the historical dynamic accumulation value of the stored file; the AddEle algorithm may be an algorithm that performs an accumulation calculation on a stored file based on a dynamic accumulator.
S203, determining witness values of the search tokens according to the search tokens of the keywords to form witness value sets.
The witness value of the search token can be a witness value which is obtained by the search token of the keyword according to a preset encryption algorithm and can authenticate the search token. The witness set may be a set consisting of at least one witness value.
Optionally, in this embodiment of the present invention, determining, according to the search token of each keyword, the witness value of each search token may be: calling a probability polynomial algorithm (WitGen algorithm) which can generate witness values corresponding to all the search tokens, wherein the input of the algorithm is a group of auxiliary information a obtained when calculating the dynamic accumulated values of the filesc、AiAnd the accumulator key PudaAnd outputting witness values of the search tokens corresponding to the search tokens input when determining the dynamic accumulated value of the file. Specifically, the formula X ═ WitGen (a) can be expressed byc,Ai,Puda) And determining the witness value of each search token. Wherein a iscAnd AiIs a group of auxiliary information obtained when calculating the dynamic accumulated value of the file; pudaIs the accumulator key; x is the set of witness values for each search token.
Optionally, in this embodiment, a set of WitGen values of each search token calculated by the WitGen algorithm may be directly used as the witness value set; or after the witness values of the search tokens calculated by the WitGen algorithm are deleted, determining a witness value set by a set formed by the deleted witness values. Specifically, it may be: and determining the witness value of each search token according to the search token of each keyword, judging whether each keyword search token belongs to a historical search token set, and if the search token of each keyword exists in the search tokens belonging to the historical search token set, adding the witness value of the search token into the witness value set.
The historical search token set may be a set of search tokens of search keywords input by a user when searching for a file through a client. The embodiment of the invention judges whether the keyword search token is the search token of the keyword searched before, and adds the witness value of the search token of the keyword searched before to the witness value set, so that the witness value set is searched before by the user, the validity of the witness value set is improved, and the file corresponding to the search keyword can be found out for the user quickly and accurately in the following process.
S204, generating a data processing request on the chain comprising the file information, the dynamic accumulated value and the witness value set of the file.
Optionally, because the parameter dimension for generating the on-link data request is increased in this embodiment, a search relationship between a plurality of keywords and the file information may be established in the determined on-link data processing request, for example, an index relationship between the file information and a dynamic accumulated value of the file may be established, an index relationship between the file information and each witness value may be established, an index relationship between the file information, the dynamic accumulated value of the file, and each witness value set may be established, and the like.
Optionally, in this embodiment, when generating the on-chain data processing request including the file information, the dynamic accumulated value of the file, and the witness value set, the on-chain data processing request generation algorithm (i.e., Trans) may be calledaddAlgorithm) according to the formula Transadd(ID (f), v, X, URL) to generate an on-chain data processing request comprising document information, a dynamic accumulation value of the document, and a set of witness values. Wherein, id (f) is the file information of the file f, URL is the link of the file storage location, v is the accumulated value of the dynamic accumulator of the file, and X is the witness value set.
S205, sending a data processing request on the link to the blockchain network, processing the data processing request on the link by the blockchain network, and storing the obtained index relationship between the file information and the keyword into the blockchain as transaction data.
For example, since the request for processing the data on the chain of the present application is generated by using multidimensional parameters, the transaction data obtained by processing the request may have various index relationships between the file information and the keywords, and when storing the index relationships between the file information and the keywords, different index relationships may be stored in different manners. For example, the index relationship between the file information and the witness value set may be written into the reverse index and stored in the blockchain, and the index relationship between the file information and the dynamic accumulated value may be written into the forward index and stored in the blockchain. Therefore, when a subsequent user searches for the file through the client, the file can be searched through different index relationships, and the searching efficiency and accuracy are improved.
In the data processing method based on the block chain provided in this embodiment, when an on-chain data processing request is generated according to the search token of each determined keyword and the determined file information, the search token of the keyword is further calculated, a dynamic accumulated value of the file and a witness value set of the search token are determined, an on-chain data processing request including the file information, the dynamic accumulated value of the file and the witness value set is generated, and the on-chain data processing request is sent to the block chain network, so that the block chain network executes the on-chain data processing request, and an index relationship between the file information and the keyword is stored in the block chain. By increasing the dimensionality of the index relationship between the file information and the keywords, the accuracy of the index relationship is improved, and the searching efficiency and accuracy are improved during subsequent file searching.
EXAMPLE III
Fig. 3 is a flowchart of a data processing method based on a block chain according to a third embodiment of the present invention. The method can be executed by a client, and the embodiment provides a specific scheme introduction for a user to search for a required file by inputting a search keyword at the client on the basis of the above embodiments. Referring to fig. 3, the method specifically includes:
s301, determining file information and a keyword set of the file, and generating a search token of each keyword in the keyword set.
S302, generating a data processing request on the link according to the file information and the search token of each keyword, sending the data processing request on the link to the blockchain network, processing the data processing request on the link by the blockchain network, and storing the obtained index relationship between the file information and the keywords as transaction data in the blockchain.
S303, receiving the search keyword input by the user, and generating a search token of the search keyword.
The search keyword may be input by the user on the client, and the keyword may be a keyword of a file that the user wants to find. The user may enter the search keyword by manual input, voice input, selection from a set of keywords provided by the client, and the like.
Illustratively, after receiving a search keyword input by a user, a client generates a search token of the search keyword according to a preset encryption algorithm. Wherein, the process of generating the search token of the search keyword can be the same as the way of generating the search token of each keyword in the keyword set in each embodiment of the present invention, by calling the information summarization algorithm: (
Figure BDA0001949043590000131
Algorithm) to calculate the search token of the search keyword, which is not described in detail herein.
Optionally, after receiving the search keyword input by the user, the client further includes: judging whether a search token of a search keyword input by the user exists in the historical search token set or not, if not, adding the search token into the historical search token set, wherein the historical search token set is used for determining the witness value set when a link data processing request is generated. The historical search token set is updated for each search of the user, so that the timeliness of the historical search token set is improved, and the accuracy of determining the witness value set is further ensured.
S304, determining witness values of the search tokens of the search keywords, generating a link file query request according to the search tokens of the search keywords and the witness values of the search tokens, and sending the link file query request to the blockchain network, wherein the link file query request is used for querying file information corresponding to the search keywords from the blockchain network.
For example, in this embodiment, the mode of determining the witness value of the search token of the search keyword may be the same as the mode of determining the witness value of the search token according to the search token of the keyword when the on-chain data processing request is generated in each embodiment of the present invention, and the witness value of the search token is calculated by calling the WitGen algorithm, which is not described herein again in this step. Optionally, since the witness values of the search tokens of the keywords which are searched historically are already stored in the witness value set corresponding to the historical search token set, it may be determined whether the search token of the search keyword input by the user this time belongs to the historical search token set, if so, the witness values of the historical search tokens are directly obtained from the witness value set, and it is not necessary to call a witness value calculation function to calculate the corresponding witness values according to the search tokens of the search keywords, so that the efficiency of determining the witness values of the search tokens of the search keywords is improved.
For example, in the embodiment of the present invention, the generation of the on-chain file query request according to the search token of the search keyword and the witness value of the search token may be by calling an on-chain file query request generation algorithm, and using the search token of the search keyword and the witness value of the search token as inputs of the algorithm, or may generate a corresponding on-chain file query request.
Optionally, in order to improve the security of the on-chain file query request and prevent the generated on-chain file query request from being maliciously tampered, the on-chain file query request may be generated according to the search token of the search keyword, the witness value of the search token, and the accumulator key when the on-chain file query request is generated. Specifically, it may be a generation algorithm (i.e. Trans) for calling file query request on chainsearchAlgorithm) according to formula
Figure BDA0001949043590000151
And taking the search token of the search keyword, the witness value of the search token and the public key of the accumulator as the input of the algorithm to generate the on-chain file query request. Wherein the content of the first and second substances,
Figure BDA0001949043590000152
a search token that is a search keyword; witnessiIs the witness value of the search token; p is a radical ofuda-pkIs the public key of the dynamic accumulator; transsearchIs a generated chainAnd (5) a file query request.
Optionally, after the client generates the on-chain file query request, the client sends the generated on-chain file query request to the blockchain network, after the current blockchain node of the blockchain network receives the on-chain file query request, the on-chain file query request is processed to obtain the search token, the witness value of the search token and the public key of the accumulator of the search keyword, which are searched for this time, the search token or the witness value of the search token, which is matched with the search token or the witness value of the search token, which are searched for the file information successfully verified by the public key of the accumulator, and the file information successfully searched for is fed back to the client after being searched for.
S305, receiving the file information fed back by the block chain network, and acquiring the query file corresponding to the search keyword in a preset storage unit according to the file information and displaying the query file to the user.
Illustratively, after receiving file information fed back by the blockchain network, the client acquires identification information of a file and storage information of the file from the file information, searches the file with the file identification information at the storage information in a preset storage unit based on the identification information of the file and the storage information of the file as a query file corresponding to a search keyword, and displays the query file to a user.
For example, when the query file is presented to the user, the specific content of the file may be presented to the user in the original format of the file for the user to view. Optionally, when searching for a file corresponding to a search keyword, it may occur that the keyword input by the user corresponds to multiple query files, and when there are many query files corresponding to the search keyword, the name, abstract, author information, and the like of each file may be displayed to the user for the user to select among the query files, select a target file to be viewed, and then display the specific content of the file to the user in the original format of the file.
In the data processing method based on the blockchain provided by this embodiment, after the index relationship is stored in the blockchain, the user terminal may generate the search token and the witness value of the search token based on the search keyword input by the user, and further generate an on-chain file query request to request the blockchain to search for file information corresponding to the search keyword. The encryption searching technology is applied to the block chain network, encryption searching is guaranteed, and data security is improved.
Example four
Fig. 4 is a flowchart of a data processing method based on a block chain according to a fourth embodiment of the present invention, where this embodiment is applicable to a case where an index relationship between a file and a keyword in the file is stored in an encrypted manner based on interaction between a client and the block chain, and this method may be executed by a data processing apparatus based on a block chain configured at a block chain link point according to the fourth embodiment of the present invention, for example, the data processing apparatus based on a block chain configured at a current block generation node of a block chain. The apparatus may be implemented in hardware and/or software. As shown in fig. 4, the method specifically includes the following steps:
s401, receiving an on-chain data processing request sent by a client, wherein the on-chain data processing request is generated according to file information and search tokens of all keywords, and the search tokens are generated according to a keyword set of a file.
Illustratively, after the client sends an on-chain data processing request to the blockchain network, the current blockgeneration node of the blockchain receives the on-chain data processing request. Wherein, the block link point may be a current block generation node in the block chain network. The data processing request on the chain received by the block chain node is generated by the client according to the file information and the search token of each keyword, and the search token is generated by the client according to the keyword set of the file.
Optionally, in order to improve the data storage precision, the data processing request on the chain may also be generated according to the file information, the dynamic accumulated value of the file, and the witness value set, where the dynamic accumulated value of the file may be determined according to the search token of each keyword; the witness value set is a set of witness values of the respective search tokens determined from the search tokens of the respective keywords.
S402, processing the data processing request on the chain, and storing the index relation between the file information and the key words as transaction data into the block chain according to the processing result.
For example, the process of the current tile generation node of the tile chain processing the data processing request on the chain may be: and processing according to the intelligent contract, and extracting the index relation between the file information and the keywords to store in the block chain. For example, the data processing request on the chain may be processed, the index relationship between the file information and the search token of each keyword may be extracted, and the index relationship between the extracted file information and the search token of each keyword may be stored in the blockchain. Optionally, the index relationship between the file information and each keyword may be stored in one block, or may be stored in different blocks, which is not limited in this embodiment of the present invention.
Optionally, when the on-chain data processing request is generated according to the file information, the dynamic accumulated value of the file, and the witness value set, the process of generating the on-chain data processing request by the current block of the block chain may be: and processing according to the intelligent contract, and extracting the index relationship between the file information and the witness value set and the index relationship between the file information and the dynamic accumulated value. At this time, the index relationship between the file information and the keyword is stored into the block chain as transaction data according to the processing result, including:
taking the index relation between the file information and the witness value set as transaction data according to the processing result, writing the transaction data into the inverted index, and storing the inverted index in the block chain, wherein the witness value set is a set formed by witness values of the search tokens determined according to the search tokens of the keywords; and writing the index relation between the file information and the dynamic accumulated value as transaction data according to the processing result, and storing the forward index in the block chain, wherein the dynamic accumulated value is determined according to the search token of each keyword.
Wherein, the index table corresponding to the inverted index comprises witness values of the search tokens of the keywords and file letters of files to which the keywords corresponding to the witness values belongInformation (including storage information of the file and identification information of the file). The document information of the document to which the keyword corresponding to the witness value belongs is determined according to the witness value of the search token of the keyword in the reverse index. When the index relation between the file information and the witness value set is written into the inverted index, the file information and the witness value set can be written according to the format of the inverted index, for example, { witnessi: ID (f) } where, witnessiId (f) is the witness value of the search token for the ith keyword, and id (f) is the file information of the file f. The index table corresponding to the forward index comprises: file information and a dynamic accumulated value of the file. The forward index is a dynamic accumulated value of the file corresponding to the forward index determined by the file information. When writing the index relationship between the file information and the dynamic accumulated value into the forward index, the index relationship may be written in the format of the forward index, for example, { ID (f: v) }, where ID is file information, f is file identification, and v is the dynamic accumulated value of the file.
Optionally, before processing the on-chain data processing request received in S401, the received on-chain data processing request may be verified, and then processed after being successfully verified. Specifically, when verifying the received on-chain data processing request, the request content in the on-chain data processing request may be verified; or the identity of the sender of the data processing request on the chain may be verified, etc. When the data processing request on the chain is verified, the verification may be performed based on a rule in the smart contract, or the verification may be performed by a key. The embodiment of the present invention is not limited thereto.
According to the data processing method based on the block chain, provided by the embodiment of the invention, the received data processing request on the chain is processed, and then the index relation between the file information and the key words is stored in the block chain as transaction data according to the processing result. By the block chain-based storage encryption searching technology, the problems that a storage platform is easily attacked maliciously and data security and user privacy cannot be effectively guaranteed are well solved, and the security of data storage encryption searching is improved.
EXAMPLE five
Fig. 5A is a flowchart of a data processing method based on a block chain according to a fifth embodiment of the present invention. The method is performed by block link points. On the basis of the foregoing embodiments, the present embodiment provides a specific scheme introduction for receiving a link file query request sent by a client and searching for a file required by the client. Referring to fig. 5A, the method specifically includes:
s501, receiving an on-chain data processing request sent by a client, wherein the on-chain data processing request is generated according to file information and search tokens of all keywords, and the search tokens are generated according to a keyword set of a file.
S502, processing the data processing request on the chain, and storing the index relation between the file information and the key words as transaction data into the block chain according to the processing result.
S503, receiving an on-chain file query request sent by a client, wherein the on-chain file query request is generated according to a search token of a search keyword and a witness value of the search token, and the search token of the search keyword is generated according to the search keyword input by a user; witness values for the search tokens are generated from the search tokens for the search keywords.
For example, after the client sends a file query request on a link to the blockchain network based on a search keyword input by a user, the blockchain node receives the file query request on the link, where the blockchain node may be a current blockchain generation node in the blockchain network. The method comprises the steps that a search token of a search keyword and a witness value of the search token are generated according to a search request of a chained file received by a block chain node, and the search token of the search keyword is generated according to the search keyword input by a user; the witness value for the search token is generated from the search token for the search keyword.
Optionally, in order to improve the security of the on-chain file query request and prevent the generated on-chain file query request from being maliciously tampered, the on-chain file query request may be generated according to the search token of the search keyword, the witness value of the search token, and the accumulator key. Wherein the accumulator key is used to verify the accuracy of the witness value of the search token.
S504, processing the file query request on the chain, and feeding back file information corresponding to the search keyword to the client according to the processing result.
For example, the process of processing the file query request on the chain by the blockchain node may be: processing according to an intelligent contract, extracting a search token of a search keyword in the file query request on the chain and a witness value of the search token, and feeding back text information corresponding to the search keyword in the query request to the client in forward indexes and reverse indexes between file information and keywords stored in the block chain. Optionally, if the link file query request includes an accumulator key, the accumulator key needs to be extracted, the witness value of the search token is verified by the accumulator key, and after the verification is successful, the text information is searched.
Specifically, after the on-chain data processing request is processed in S502, the index relationship between the file information and the witness value set is written into the reverse index, and the index relationship between the file information and the dynamic accumulated value is written into the forward index, so that the processing of the received on-chain file query request may be:
firstly, inquiring witness values of search tokens of search keywords in a file query request on a chain from an inverted index stored in a block chain; and acquiring file information corresponding to the witness value of the search token in the inverted index as a processing result. For example, the search engine may first search the inverted index quickly, search each item in the inverted index to see whether there is a witness value of the search token of the search keyword extracted from the on-chain file query request, and if so, take the file information corresponding to the witness value of the search token as the processing result.
And if the search token of the search keyword in the on-chain file query request cannot be queried in the inverted index stored in the block chain, determining text information matched with the search keyword as a processing result according to the dynamic accumulated value of the text corresponding to each text information in the forward index stored in the block chain, the search token of the search keyword in the on-chain file query request and the witness value of the search token.
For example, if the witness value of the search token of the search keyword of this time is not found in the reverse index, it is indicated that the search keyword of this time is a new search keyword, and the user has not searched before, and then the search is performed based on the forward index. Specifically, the dynamic accumulated values of the file information in the forward index are traversed, a matching judgment algorithm (i.e., Verify algorithm) is called, the dynamic accumulated values of the file information, the search order of the search keyword extracted from the on-chain file query request, and the witness value of the search token are used as parameters and input into the Verify algorithm, and the algorithm can judge whether the file information corresponding to the input dynamic accumulated values matches the search keyword, so that the text information matching the search keyword is determined as the processing result.
According to the scheme of the embodiment of the invention, after the encryption searching scheme is improved by introducing the dynamic accumulator algorithm, the space complexity of encryption searching is further reduced, and the encryption searching efficiency is obviously improved. The reason for this is as follows: in existing schemes (e.g., CCS'14Hahn), each search will traverse the forward index and the reverse index. Particularly, in the forward index, each row is indexed by
Figure BDA0001949043590000211
This form exists, where id (f) is file information of file f; s1Is a random number of 1;
Figure BDA0001949043590000212
a search token that is a first keyword;
Figure BDA0001949043590000213
to follow the HMAC algorithm pair by random numbers
Figure BDA0001949043590000214
The encrypted value of (a); snIs a random number n;
Figure BDA0001949043590000215
a search token that is an nth keyword;
Figure BDA0001949043590000216
to follow the HMAC algorithm pair by random numbers
Figure BDA0001949043590000217
The encrypted value of (2). After the server receives the search token, each row needs to perform n times of search token operations (assuming that each file has n keywords on average), and if there are m files in the current index, performing one search in the index requires o (n) ═ m × n times of comparison. In the invention, due to the introduction of the dynamic accumulator algorithm, each line in the forward index will appear in the form of an aggregation value of { ID (f): v }, and when a search is carried out, each line only needs to carry out a check operation once to verify whether the witness value of the search token of the search keyword exists in the dynamic accumulated value of the file. Therefore, when performing keyword search on m files, o (n) ═ m times need to be compared. As shown in fig. 5B and 5C, the more average keywords of a given document, the higher the search efficiency of the present invention. Similarly, if the number of the keywords of the given file is fixed, the larger the number of the files is, the more obvious the search efficiency advantage of the method is.
According to the data processing method based on the block chain, provided by the embodiment of the invention, after a file query request on the chain sent by a client is received, the query request is processed, and file information corresponding to search keywords is determined based on the cooperation of two modes of reverse indexes and forward indexes. The efficiency of encrypted searching is greatly improved while the data security is improved.
EXAMPLE six
Fig. 6 is a signaling diagram of a data processing method based on a block chain according to a sixth embodiment of the present invention. The present embodiment provides a preferred embodiment based on the above embodiments. The method is interactively executed by three ends, namely a block chain node, a client and a storage end.
The block chain network is mainly based on an intelligent contract technology, and indexes based on an encryption search technology are established in a block chain. Each user may have a forward index and a reverse index, or all users may have a forward index and a reverse index. The forward index mainly stores the index relationship between the file information and the dynamic accumulated value of the file, and the reverse index mainly stores the index relationship between the file information and the witness value set. And the block chain network and the client carry out interaction to establish indexes and cooperate to complete the encryption search function. The client is responsible for encrypting data, including: encrypting the uploaded original file, encrypting the keywords to generate a search token, encrypting the search token of each keyword of the file to obtain a dynamic accumulated value of the file (the dynamic accumulated value can be added and deleted), generating a witness value of the search token, and the like. The storage terminal may be a storage for storing the file uploaded by the user, and may be a preset storage space in a memory of the client terminal, or may be a third-party storage (for example, a third-party database, a server, a memory card, or the like).
Referring to fig. 6, the method specifically includes:
s601, the client side carries out initialization operation.
For example, in this embodiment of the present invention, the initialization operation performed by the client may be that a user triggers that an initialization algorithm (e.g., a SetUp algorithm) is locally invoked at the client to generate a key required for initialization, and optionally, the key required for initialization may include: file key for encrypting uploaded file1) Generating a token key (key) of the keyword search token2) And a set of keys p for a dynamic accumulatoruda=(puda-pk,puda-sk) Wherein p isuda-pkIs the public key of the dynamic accumulator, puda-skIs the private key of the dynamic accumulator.
Optionally, when providing the storage encryption search function for the user, the client may share all user resources and searches, and at this time, when the client performs an initialization operation for the first time, two null sets are initialized, one is a history search token set, and the other is a witness value set. When the client provides the storage encryption search function for the user, each user can also have an account, the user can only carry out encryption search on files stored by the user, and at the moment, any user can initialize two empty sets when the client operates for the first time, wherein one empty set is a historical search token set, and the other empty set is a witness value set.
S602, the client receives the file uploaded by the user.
For example, when a user needs to store a file in a storage party, the file to be uploaded by the user is backed up to a client, and the client receives the file uploaded by the user; or after the user backs up the file to be uploaded to the client, triggering an upload or storage key on the client, and then receiving the file uploaded by the user by the client.
And S603, the client encrypts the uploaded file by using the file key.
For example, the client may encrypt the file uploaded by the user by using the file key obtained by the initialization of S601, for example, the file key may be used
Figure BDA0001949043590000241
And (4) performing an algorithm to generate a ciphertext of the uploaded file. It should be noted that, when encrypting the uploaded file, the client may adopt any encryption algorithm, and the embodiment of the present invention is not limited thereto. Optionally, in order to improve security of encryption, a symmetric encryption algorithm may be preferably used to encrypt the uploaded file.
S604, the client sends the encrypted file to the storage terminal.
S605, the storage end receives the encrypted file sent by the client.
S606, the storage end stores the encrypted file.
Optionally, when the storage end stores the encrypted file, distributed storage may be adopted, and the storage end and the encrypted file are respectively stored in different positions of the storage end. For example, the uploaded files may be classified according to a preset rule, and then stored in the storage location of the category to which the uploaded files belong.
S607, the storage end sends the storage information of the encrypted file to the client.
For example, in order to quickly search when a subsequent user searches for the file, after the storage end stores the encrypted file, the storage end may obtain storage information of the encrypted file, such as Uniform Resource Locator (URL), storage format, size, and the like of the file. And sending the acquired storage information of the encrypted file to the client.
S608, the client receives the storage information of the encrypted file sent by the storage terminal.
S609, the client determines the file information and the keyword set of the file, and generates a search token of each keyword in the keyword set.
S610, the client determines the dynamic accumulated value of the file according to the search token of each keyword.
S611, the client determines the witness value of each search token according to the search token of each keyword to form a witness value set.
S612, the client generates a data processing request on the chain, wherein the data processing request comprises file information, a dynamic accumulated value of the file and a witness value set.
S613, the client sends the on-chain data processing request to the blockchain network.
S614, the block chain network receives the on-chain data processing request sent by the client.
S615, processing the data processing request on the chain by the block chain network, taking the index relation between the file information and the witness value set as transaction data according to the processing result, writing the transaction data into the inverted index, and storing the inverted index in the block chain; and writing the index relation between the file information and the dynamic accumulated value as transaction data according to the processing result, writing the transaction data into the forward index, and storing the forward index in the block chain.
S616, the client receives the search keyword input by the user and generates a search token of the search keyword.
S617, the client determines the witness value of the search token of the search keyword, and generates the on-link file query request according to the search token of the search keyword and the witness value of the search token.
S618, the client sends a file query request to the blockchain network.
S619, the block chain network receives a chain file query request sent by the client.
S620, the block chain network inquires the witness value of the search token of the search keyword in the file inquiry request on the chain from the inverted index stored in the block chain.
S621 the blockchain network judges whether the witness value of the search token of the search keyword exists in the reverse index, if so, S622 is executed, otherwise, S623 is executed.
And S622, the block chain network acquires file information corresponding to the witness value of the search token in the inverted index as a processing result.
S623, determining the text information matched with the search keyword as a processing result according to the dynamic accumulated value of the text corresponding to each text information in the forward index stored in the block chain, the search token of the search keyword in the file query request on the chain and the witness value of the search token.
And S624, the block chain network feeds back file information corresponding to the search keywords in the processing result to the client.
S625, the client receives the file information fed back by the block chain network.
And S626, the client sends the file information of the query file to the storage terminal according to the file information fed back by the block chain network.
S627, the storage end receives file information of the query file sent by the client.
And S628, the storage terminal searches the corresponding query file according to the file information.
Illustratively, the file information includes identification information of the file and storage information of the file, and when the storage terminal searches for the corresponding query file according to the file information, the storage terminal may first find the storage location of the query file according to the storage information of the file, and then accurately determine the query file from the storage location according to the identification information of the file.
And S629, feeding the query file back to the client by the storage terminal.
S630, the client displays the received query file to the user.
Optionally, when the client sends the storage file to the storage end, the ciphertext obtained by encrypting the original file is sent, so that after the client receives the query file sent by the storage end, the encrypted file needs to be decrypted according to the file key and then displayed to the user.
According to the data processing method based on the block chain, provided by the embodiment of the invention, the encrypted search technology is applied and decentralized storage is completed through interaction among the client, the block chain end and the storage end, the technical feasibility of the application of the encrypted search technology in a decentralized storage scene is proved, the user privacy is protected while the safety of stored data is ensured, meanwhile, the query of text information corresponding to search keywords is carried out based on the inverted index and the forward index, and the encrypted search efficiency is greatly improved.
EXAMPLE seven
Fig. 7 is a block diagram of a data processing apparatus based on a block chain according to a seventh embodiment of the present invention, where the apparatus may be configured in a client, and the apparatus may execute the data processing method based on the block chain according to the first to third embodiments and the sixth embodiment of the present invention, and has corresponding functional modules and beneficial effects of the execution method. As shown in fig. 7, the apparatus may include:
a search token generation module 701, configured to determine a file information and a keyword set of a file, and generate a search token for each keyword in the keyword set;
a processing request generating module 702, configured to generate an uplink data processing request according to the file information and the search token of each keyword;
a processing request sending module 703, configured to send the uplink data processing request to the blockchain network, where the blockchain network processes the uplink data processing request, and stores the obtained index relationship between the file information and the keyword as transaction data in the blockchain.
In the data processing apparatus based on the blockchain according to this embodiment, a search token for each keyword is generated according to a set of keywords of a specific file, and a linked data processing request is generated together with specific file information and sent to the blockchain network. So that the blockchain network executes the on-chain data processing request and stores the index relationship between the file information and the key in the blockchain. According to the block chain-based storage encryption search technology, the problems that a storage platform is easily attacked maliciously and data security and user privacy cannot be effectively guaranteed are well solved, and the security of data storage encryption search is improved.
Further, the processing request generating module 702 includes:
the accumulated value determining unit is used for determining the dynamic accumulated value of the file according to the search token of each keyword;
the witness value determining unit is used for determining the witness value of each search token according to the search token of each keyword to form a witness value set;
and the processing request generating unit is used for generating an on-chain data processing request comprising the file information, the dynamic accumulated value of the file and the witness value set.
Further, the accumulated value determining unit is specifically configured to:
and determining the latest dynamic accumulated value of the file according to the search token, the accumulator key and the historical dynamic accumulated value of the file of each keyword.
Further, the witness determination unit is specifically configured to:
determining witness values of the search tokens according to the search tokens of the keywords;
and if the search token of each keyword comprises the search token belonging to the historical search token set, adding the witness value of the search token into the witness value set.
Further, the search token generation module 701 is further configured to:
receiving a search keyword input by a user, and generating a search token of the search keyword;
the above-mentioned device still includes:
the query request generation module is used for determining the witness value of the search token of the search keyword, generating an on-chain file query request according to the search token of the search keyword and the witness value of the search token, and sending the on-chain file query request to the blockchain network, wherein the on-chain file query request is used for querying file information corresponding to the search keyword from the blockchain network;
and the file acquisition and display module is used for receiving the file information fed back by the block chain network, and acquiring the query file corresponding to the search keyword in a preset storage unit according to the file information and displaying the query file to the user.
Example eight
Fig. 8 is a block diagram of a data processing apparatus based on a block chain according to an eighth embodiment of the present invention, where the apparatus may be configured in a block chain node, and the apparatus may execute a data processing method based on a block chain according to any of the fourth to sixth embodiments of the present invention, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 8, the apparatus may include:
a processing request receiving module 801, configured to receive an on-chain data processing request sent by a client, where the on-chain data processing request is generated according to file information and a search token of each keyword, and the search token is generated according to a keyword set of a file;
a processing request processing module 802, configured to process the on-chain data processing request, and store the index relationship between the file information and the keyword as transaction data in the blockchain according to a processing result.
In the data processing apparatus based on the blockchain according to this embodiment, after the received on-chain data processing request is processed by processing the on-chain data processing request, the index relationship between the file information and the keyword is stored in the blockchain as transaction data according to the processing result. By the block chain-based storage encryption searching technology, the problems that a storage platform is easily attacked maliciously and data security and user privacy cannot be effectively guaranteed are well solved, and the security of data storage encryption searching is improved.
Further, the processing request processing module 802 is specifically configured to:
taking the index relation between the file information and the witness value set as transaction data according to the processing result, writing the transaction data into an inverted index, and storing the inverted index in a block chain, wherein the witness value set is a set formed by witness values of all search tokens determined according to the search tokens of all keywords;
and taking the index relation between the file information and a dynamic accumulated value as transaction data according to the processing result, writing the transaction data into a forward index, and storing the forward index in a block chain, wherein the dynamic accumulated value is determined according to the search token of each keyword.
Further, the above apparatus further comprises:
the system comprises a query request receiving module, a searching module and a searching module, wherein the query request receiving module is used for receiving a chained file query request sent by a client, the chained file query request is generated according to a search token of a search keyword and a witness value of the search token, and the search token of the search keyword is generated according to the search keyword input by a user; the witness value of the search token is generated according to the search token of the search keyword;
and the query request processing module is used for processing the on-chain file query request and feeding back file information corresponding to the search keyword to the client according to a processing result.
Further, the query request processing module is specifically configured to:
inquiring witness values of search tokens of search keywords in the on-chain file inquiry request from an inverted index stored in a block chain;
and acquiring file information corresponding to the witness value of the search token in the inverted index as a processing result.
Further, the query request processing module is further specifically configured to:
and if the search token of the search keyword in the on-chain file query request cannot be queried in the inverted index stored in the block chain, determining text information matched with the search keyword as a processing result according to the dynamic accumulated value of the text corresponding to each text information in the forward index stored in the block chain, the search token of the search keyword in the on-chain file query request and the witness value of the search token.
Example nine
Fig. 9 is a schematic structural diagram of an apparatus according to a sixth embodiment of the present invention. Fig. 9 illustrates a block diagram of an exemplary device 90 suitable for use in implementing embodiments of the present invention. The device 90 shown in fig. 9 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present invention. It can be a client or a blockchain node. As shown in fig. 9, the device 90 is in the form of a general purpose computing device. The components of the device 90 may include, but are not limited to: one or more processors or processing units 901, a system memory 902, and a bus 903 that couples the various system components including the system memory 902 and the processing unit 901.
Bus 903 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The device 90 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by device 90 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 902 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)904 and/or cache memory 905. The device 90 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 906 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 9, and commonly referred to as a "hard drive"). Although not shown in FIG. 9, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 903 by one or more data media interfaces. System memory 902 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 908 having a set (at least one) of program modules 907, such program modules 907 including but not limited to an operating system, one or more application programs, other program modules, and program data, may be stored in, for example, system memory 902, each or some combination of which may comprise an implementation of a network environment. Program modules 907 typically perform the functions and/or methodologies of embodiments of the present invention as described herein.
The device 90 may also communicate with one or more external devices 909 (e.g., keyboard, pointing device, display 910, etc.), with one or more devices that enable a user to interact with the device, and/or with any device (e.g., network card, modem, etc.) that enables the device 90 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interface 911. Also, the device 90 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 912. As shown in fig. 9, the network adapter 912 communicates with the other modules of the device 90 via the bus 903. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the device 90, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 901 executes various functional applications and data processing, for example, a data processing method based on a block chain provided in an embodiment of the present invention, by executing a program stored in the system memory 902.
Example ten
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, can implement the data processing method based on the block chain according to the foregoing embodiment.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The above example numbers are for description only and do not represent the merits of the examples.
It will be appreciated by those of ordinary skill in the art that the modules or operations of the embodiments of the invention described above may be implemented using a general purpose computing device, which may be centralized on a single computing device or distributed across a network of computing devices, and that they may alternatively be implemented using program code executable by a computing device, such that the program code is stored in a memory device and executed by a computing device, and separately fabricated into integrated circuit modules, or fabricated into a single integrated circuit module from a plurality of modules or operations thereof. Thus, the present invention is not limited to any specific combination of hardware and software.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A data processing method based on a block chain is characterized by being executed by a client and comprising the following steps:
determining file information and a keyword set of a file, and generating a search token of each keyword in the keyword set;
generating an on-chain data processing request according to the file information and the search token of each keyword, sending the on-chain data processing request to a blockchain network, processing the on-chain data processing request by the blockchain network, and storing the obtained index relationship between the file information and the keywords as transaction data in the blockchain; generating a chained data processing request according to the file information and the search token of each keyword, wherein the chained data processing request comprises the following steps:
determining a dynamic accumulated value of the file according to the search token of each keyword;
determining witness values of the search tokens according to the search tokens of the keywords to form witness value sets;
generating an on-chain data processing request comprising the document information, the dynamic accumulation value of the document, and the witness value set.
2. The method of claim 1, wherein determining a dynamic accumulation value for the document based on the search tokens for the keywords comprises:
and determining the latest dynamic accumulated value of the file according to the search token, the accumulator key and the historical dynamic accumulated value of the file of each keyword.
3. The method of claim 1, wherein determining a witness value for each search token from the search tokens for each keyword to form a set of witness values comprises:
determining witness values of the search tokens according to the search tokens of the keywords;
and if the search token of each keyword comprises the search token belonging to the historical search token set, adding the witness value of the search token into the witness value set.
4. The method of claim 1, wherein after generating an on-chain data processing request according to the file information and the search token of each keyword and sending the on-chain data processing request to a blockchain network, further comprising:
receiving a search keyword input by a user, and generating a search token of the search keyword;
determining witness values of the search tokens of the search keywords, generating an on-chain file query request according to the search tokens of the search keywords and the witness values of the search tokens, and sending the on-chain file query request to a blockchain network, wherein the on-chain file query request is used for querying file information corresponding to the search keywords from the blockchain network;
and receiving file information fed back by the block chain network, and acquiring query files corresponding to the search keywords in a preset storage unit according to the file information and displaying the query files to a user.
5. A data processing method based on a block chain is characterized by being executed by block chain nodes and comprising the following steps:
receiving an on-chain data processing request sent by a client, wherein the on-chain data processing request is generated according to file information and search tokens of all keywords, and the search tokens are generated according to a keyword set of a file;
processing the data processing request on the chain, and storing the index relation between the file information and the key words as transaction data into a block chain according to a processing result;
storing the index relationship between the file information and the keywords as transaction data into a block chain according to the processing result, wherein the index relationship comprises the following steps:
taking the index relation between the file information and the witness value set as transaction data according to the processing result, writing the transaction data into an inverted index, and storing the inverted index in a block chain, wherein the witness value set is a set formed by witness values of all search tokens determined according to the search tokens of all keywords;
and taking the index relation between the file information and a dynamic accumulated value as transaction data according to the processing result, writing the transaction data into a forward index, and storing the forward index in a block chain, wherein the dynamic accumulated value is determined according to the search token of each keyword.
6. The method of claim 5, wherein after storing the index relationship between the file information and the key as transaction data in the blockchain according to the processing result, further comprising:
receiving a chain file query request sent by a client, wherein the chain file query request is generated according to a search token of a search keyword and a witness value of the search token, and the search token of the search keyword is generated according to the search keyword input by a user; the witness value of the search token is generated according to the search token of the search keyword;
and processing the on-chain file query request, and feeding back file information corresponding to the search keyword to the client according to a processing result.
7. The method of claim 6, wherein processing the on-chain file query request comprises:
inquiring witness values of search tokens of search keywords in the on-chain file inquiry request from an inverted index stored in a block chain;
and acquiring file information corresponding to the witness value of the search token in the inverted index as a processing result.
8. The method of claim 7, wherein processing the on-chain file query request comprises:
and if the search token of the search keyword in the on-chain file query request cannot be queried in the inverted index stored in the block chain, determining text information matched with the search keyword as a processing result according to the dynamic accumulated value of the text corresponding to each text information in the forward index stored in the block chain, the search token of the search keyword in the on-chain file query request and the witness value of the search token.
9. A data processing apparatus based on a blockchain, the apparatus configured in a client, comprising:
the system comprises a search token generation module, a search token generation module and a search token generation module, wherein the search token generation module is used for determining file information and a keyword set of a file and generating a search token of each keyword in the keyword set;
the processing request generating module is used for generating a chained data processing request according to the file information and the search token of each keyword;
a processing request sending module, configured to send the uplink data processing request to a blockchain network, process the uplink data processing request by the blockchain network, and store the obtained index relationship between the file information and the keyword as transaction data in the blockchain;
the processing request generating module comprises:
the accumulated value determining unit is used for determining the dynamic accumulated value of the file according to the search token of each keyword;
and the witness value determining unit is used for determining the witness value of each search token according to the search token of each keyword to form a witness value set.
10. A blockchain-based data processing apparatus, the apparatus being configured in a blockchain node, comprising:
the system comprises a processing request receiving module, a processing request processing module and a processing module, wherein the processing request receiving module is used for receiving a data processing request on a chain sent by a client, the data processing request on the chain is generated according to file information and search tokens of all keywords, and the search tokens are generated according to a keyword set of a file;
the processing request processing module is used for processing the data processing request on the chain and storing the index relation between the file information and the key words as transaction data into the block chain according to the processing result;
a processing request generation module comprising:
a processing request generating unit, configured to generate an on-chain data processing request including the file information, the dynamic accumulated value of the file, and the witness value set;
determining a dynamic accumulated value of the file according to the search token of each keyword;
and determining witness values of the search tokens according to the search tokens of the keywords to form witness value sets.
11. An electronic device for data processing based on a blockchain, comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the blockchain based data processing method of any one of claims 1-4 or the blockchain based data processing method of any one of claims 5-8.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the blockchain-based data processing method according to any one of claims 1 to 4, or the blockchain-based data processing method according to any one of claims 5 to 8.
CN201910045588.5A 2019-01-17 2019-01-17 Data processing method, device, equipment and medium based on block chain Active CN109766707B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910045588.5A CN109766707B (en) 2019-01-17 2019-01-17 Data processing method, device, equipment and medium based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910045588.5A CN109766707B (en) 2019-01-17 2019-01-17 Data processing method, device, equipment and medium based on block chain

Publications (2)

Publication Number Publication Date
CN109766707A CN109766707A (en) 2019-05-17
CN109766707B true CN109766707B (en) 2022-01-14

Family

ID=66454060

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910045588.5A Active CN109766707B (en) 2019-01-17 2019-01-17 Data processing method, device, equipment and medium based on block chain

Country Status (1)

Country Link
CN (1) CN109766707B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110517029B (en) * 2019-08-29 2024-02-23 深圳市迅雷网络技术有限公司 Method, device, equipment and blockchain system for verifying blockchain cross-chain transaction
CN110597852A (en) * 2019-09-27 2019-12-20 腾讯科技(深圳)有限公司 Data processing method, device, terminal and storage medium
CN111143471B (en) * 2019-12-27 2023-09-01 北京工业大学 Ciphertext retrieval method based on blockchain
CN111400325A (en) * 2020-02-17 2020-07-10 合肥工大高科信息科技股份有限公司 Iron transportation material logistics analysis method and system and electronic equipment
CN111324611B (en) * 2020-02-28 2023-12-29 北京瑞卓喜投科技发展有限公司 Certificate retrieval method and device for asset type certificate
CN111444198B (en) * 2020-06-15 2020-09-25 支付宝(杭州)信息技术有限公司 Transaction storage and query method based on centralized block chain type account book
CN114826613B (en) * 2022-04-21 2023-07-28 微位(深圳)网络科技有限公司 Identity information query method, device, equipment and storage medium based on blockchain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150156011A1 (en) * 2011-08-16 2015-06-04 Microsoft Technology Licensing, Llc Dynamic symmetric searchable encryption
CN105024802A (en) * 2015-07-13 2015-11-04 西安理工大学 Bilinear pairing-based multi-user multi-keyword searchable encryption method in cloud storage
CN105069358A (en) * 2015-07-13 2015-11-18 西安理工大学 Keyword searchable encryption method based on Bloom filter with storage structure
US20160125198A1 (en) * 2014-10-29 2016-05-05 Florian Hahn Searchable encryption with secure and efficient updates
CN103593476B (en) * 2013-11-28 2017-01-25 中国科学院信息工程研究所 Multi-keyword plaintext and ciphertext retrieving method and device oriented to cloud storage

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101282281B1 (en) * 2011-08-30 2013-08-23 고려대학교 산학협력단 Weighted keyword searching method for perserving privacy, and apparatus thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150156011A1 (en) * 2011-08-16 2015-06-04 Microsoft Technology Licensing, Llc Dynamic symmetric searchable encryption
CN103593476B (en) * 2013-11-28 2017-01-25 中国科学院信息工程研究所 Multi-keyword plaintext and ciphertext retrieving method and device oriented to cloud storage
US20160125198A1 (en) * 2014-10-29 2016-05-05 Florian Hahn Searchable encryption with secure and efficient updates
CN105024802A (en) * 2015-07-13 2015-11-04 西安理工大学 Bilinear pairing-based multi-user multi-keyword searchable encryption method in cloud storage
CN105069358A (en) * 2015-07-13 2015-11-18 西安理工大学 Keyword searchable encryption method based on Bloom filter with storage structure

Non-Patent Citations (8)

* Cited by examiner, † Cited by third party
Title
Dynamic Accumulators and Application to E±cient Revocation of Anonymous Credentials;Jan Camenisch,et al;《https://link.springer.com/content/pdf/10.1007%2F3-540-45708-9_5.pdf》;20020822;文章第61-76页 *
Towards Trustworthy and Private Keyword Search in Encrypted Decentralized Storage;Chengjun Cai et al;《IEEE ICC 2017 Communication and Information Systems Security Symposium》;20170731;正文第III-V节,图1-3,表1 *
vChain:支持可信数据查询的区块链技术;腾讯云;《https://cloud.tencent.com/developer/news/367954》;20181208;文章全文 *
Verifiable Ranked Search Over Dynamic Encrypted Data in Cloud Computing;Qin Liu,et al;《2017 IEEE/ACM 25th International Symposium on Quality of Service (IWQoS)》;20170707;文章全文 *
云环境下可搜索加密技术安全机制及应用陷阱;杨宁,等;《计算机应用研究》;20150831;第32卷(第8期);文章第2254-2260页 *
分布式网络环境下基于区块链的密钥管理方案;戴千一 ,等;《网络与信息安全学报》;20181210;第4卷(第9期);文章第23-35页 *
基于动态累加器的去中心化加密搜索方案;张琰,等;《网络与信息安全学报》;20190528;第5卷(第2期);文章第23-29页 *
基于动态累加器的异构传感网认证组密钥管理方案;钟晓睿,等;《通信学报》;20140409;第35卷(第3期);文章第124-134段 *

Also Published As

Publication number Publication date
CN109766707A (en) 2019-05-17

Similar Documents

Publication Publication Date Title
CN109766707B (en) Data processing method, device, equipment and medium based on block chain
US9973588B2 (en) Managing notifications across multiple devices
CN109981297B (en) Block chain processing method, device, equipment and storage medium
CN109344631B (en) Data modification and block verification method, device, equipment and medium for block chain
CN106972927B (en) Encryption method and system for different security levels
CN107948152B (en) Information storage method, information acquisition method, information storage device, information acquisition device and information acquisition equipment
US8819408B2 (en) Document processing method and system
US20130159694A1 (en) Document processing method and system
JP2012164031A (en) Data processor, data storage device, data processing method, data storage method and program
CN106911712B (en) Encryption method and system applied to distributed system
US10581808B2 (en) Keyed hash contact table
CN114428972A (en) Privacy protection query method and device supporting outsourcing calculation and related equipment
CN113094334B (en) Digital service method, device, equipment and storage medium based on distributed storage
CN115017107A (en) Data retrieval method and device based on privacy protection, computer equipment and medium
CN105827582A (en) Communication encryption method, device and system
CN114239072A (en) Block chain node management method and block chain network
JP6585192B2 (en) Retrieval and retrieval of keyed data maintained using a keyed database
US11893055B2 (en) System for automatic management and depositing of documents (images) hash in block-chain technology
CN116992486A (en) Cryptography-based united blacklist multiparty privacy query method and system
JP2006189925A (en) Private information management system, private information management program, and private information protection method
CN114428661A (en) Mirror image management method and device
CN111651425A (en) Data extraction method and device for data mart, terminal and storage medium
CN111030930B (en) Decentralized network data fragment transmission method, device, equipment and medium
CN114021196A (en) Fair searchable encryption method and system
Handa et al. Keyword binning-based efficient search on encrypted cloud data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant