Data processing method, blockchain node, system and computer-readable storage medium
By using homomorphic encryption algorithms on the blockchain to encrypt data and perform calculations in smart contracts, the problem of data privacy protection in blockchain technology is solved, and the security and privacy protection of data during the sharing process is achieved.
Patent Information
- Application Number
- CN202010969216.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-15
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2040-09-15
AI Technical Summary
When using blockchain technology to achieve data sharing, it is impossible to effectively protect the privacy of data. The storage of data on the blockchain is distributed and public, and any node can know the stored data, resulting in data sharing hoping to protect data The original text is not known to the user.
By receiving user data calculation requests on blockchain nodes, encrypting data using preset homomorphic encryption algorithms, and calling calculation methods in smart contracts for calculations, ensuring that the data is not disclosed in plain text during the calculation process, and only has permissions for the user decrypt the calculation results.
Improve the privacy protection of data, ensure the security and immutability of data storage and computing process on the blockchain, and prevent illegal users from getting the plain text of data.
Smart Images

Figure CN114268437B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data processing method, a blockchain node, a system, and a computer-readable storage medium. Background Art
[0002] The development and application of data are changing the world today. Data resources have become data assets. The production, circulation and application of data have made the secure sharing of data an important means to solve the problem of data from resources to assets and maximize the value of data.
[0003] The traditional data sharing model is to centrally collect, process, store and apply data through a unified data warehouse or big data platform. This model works well in centralized institutions and is of great help in improving institutional operational efficiency and promoting institutional digital transformation. However, if data needs to be shared between institutions with equal relationships, adopting a centralized sharing model will bring a series of problems.
[0004] The data sharing model based on blockchain technology effectively solves many problems of data sharing between peer institutions through mechanisms such as distributed ledgers and data rights confirmation. Summary of the invention
[0005] The inventors found that when using blockchain technology to achieve data sharing, the privacy of data cannot be guaranteed. The storage of data on the blockchain is distributed and public, and any node can know the stored data. In many cases, when data sharers share data containing private information, they do not want users to know the original text of the data.
[0006] A technical problem to be solved by the present disclosure is: how to improve the protection of data privacy while realizing secure data sharing by using blockchain.
[0007] According to some embodiments of the present disclosure, a data processing method is provided, including: a blockchain node receives a data calculation request from a user, wherein the data calculation request includes: a location where the data to be calculated is stored in the blockchain, an address of a smart contract, and an identifier of a calculation method to be called in the smart contract, the data to be calculated is data encrypted by a preset homomorphic encryption algorithm, and the user initiates a data calculation request when having data calculation authority; the blockchain node obtains the data to be calculated in the blockchain according to the data calculation request; the blockchain node calls the calculation method to be called in the smart contract to calculate the data to be calculated and obtains a calculation result; the blockchain node sends the calculation result to the user so that the user can decrypt the calculation result.
[0008] In some embodiments, the data calculation request also includes: an identifier of the permission verification method in the smart contract and an identifier of the user, and the blockchain node obtains the data to be calculated in the blockchain according to the data calculation request, including: the blockchain node calls the permission verification method according to the identifier of the permission verification method in the smart contract, and obtains the access permission list corresponding to the data to be calculated, wherein the access permission list includes the identifier of the user who is allowed to access the data to be calculated or the identifier of the user who is not allowed to access the data to be calculated; the blockchain node determines whether the user is allowed to access the data to be calculated according to the access permission list; if the user allows access to the data to be calculated, the blockchain node obtains the data to be calculated in the blockchain according to the location where the data to be calculated is stored in the blockchain.
[0009] In some embodiments, the blockchain node receiving the user's data calculation request includes: the blockchain node receiving the user's data calculation request through an interface between the blockchain node and the business system, or receiving the data calculation request broadcasted by other blockchain nodes.
[0010] In some embodiments, the blockchain node sends the calculation result to the user, including: the blockchain node generates first transaction information based on the calculation result, and stores the first transaction information to the blockchain, wherein the first transaction information includes the calculation result; when the blockchain node receives a data calculation request from the user through an interface with the business system, the blockchain node sends the calculation result to the user through the interface with the business system; or, when the blockchain node receives a data calculation request broadcasted by other blockchain nodes, the other blockchain nodes obtain the calculation result based on the first transaction information stored in the blockchain and send the calculation result to the user through the interface with the business system.
[0011] In some embodiments, the method also includes: the blockchain node receives a data storage request from a user, wherein the data storage request includes data to be stored, and the data to be stored is data encrypted using a preset homomorphic encryption algorithm; the blockchain node generates second transaction information based on the data to be stored, and stores the second transaction information to the blockchain, wherein the second transaction information includes the data to be stored; the blockchain node returns the storage location of the second transaction information to the user.
[0012] In some embodiments, storing the second transaction information to the blockchain includes: the blockchain node broadcasting the second transaction information to other blockchain nodes; after a block containing the second transaction information is generated by any blockchain node and the blockchain nodes executing the consensus mechanism reach a consensus on the block, the block containing the second transaction information is added to the blockchain.
[0013] In some embodiments, the method also includes: the business system receives a key acquisition request from a user, wherein the key generation request includes the user's identity authentication information; the business system verifies the user's identity authentication information to determine whether the user has key acquisition authority; if the user has key acquisition authority, the business system generates a public key and a private key corresponding to the user according to a preset homomorphic encryption algorithm, and returns the public key and the private key corresponding to the user to the user, so that the user can use the corresponding public key to homomorphically encrypt the data to be stored.
[0014] In some embodiments, the method also includes: the business system receives a data computing permission verification request from a user, wherein the data computing permission verification request includes the user's identity authentication information and an identification of the data to be calculated; the business system performs verification based on the verification conditions corresponding to the identification of the data to be calculated and the user's identity authentication information to determine whether the user has data computing permission; if the user has data computing permission, the business system returns the verification result to the user.
[0015] According to some other embodiments of the present disclosure, a blockchain node is provided, including: a receiving module, used to receive a user's data calculation request, wherein the data calculation request includes: the location where the data to be calculated is stored in the blockchain, the address of the smart contract and the identifier of the calculation method to be called in the smart contract, the data to be calculated is data encrypted by a preset homomorphic encryption algorithm, and the user initiates the data calculation request if he has the data calculation permission; an acquisition module, used to obtain the data to be calculated in the blockchain according to the data calculation request; a calculation module, used to call the calculation method to be called in the smart contract to calculate the data to be calculated and obtain a calculation result; a sending module, used to send the calculation result to the user so that the user can decrypt the calculation result.
[0016] In some embodiments, the receiving module is also used to receive a data storage request from a user, wherein the data storage request includes data to be stored, and the data to be stored is data encrypted using a preset homomorphic encryption algorithm; the blockchain node also includes: a storage module, used to generate second transaction information based on the data to be stored, and store the second transaction information to the blockchain, wherein the second transaction information includes the data to be stored; the sending module is also used to return the storage location of the second transaction information to the user.
[0017] According to some further embodiments of the present disclosure, a data processing system is provided, comprising: a plurality of blockchain nodes of any of the aforementioned embodiments; and a business system, for receiving data calculation requests sent by users, and sending the data calculation requests of users to the blockchain nodes through an interface between the blockchain nodes.
[0018] In some embodiments, the business system is also used to receive a key acquisition request from a user, wherein the key generation request includes the user's identity authentication information; verify the user's identity authentication information to determine whether the user has key acquisition authority; if the user has key acquisition authority, generate the user's corresponding public key and private key according to a preset homomorphic encryption algorithm, and return the user's corresponding public key and private key to the user, so that the user can use the corresponding public key to homomorphically encrypt the data to be stored.
[0019] In some embodiments, the business system is also used to receive a user's data calculation permission verification request, wherein the data calculation permission verification request includes the user's identity authentication information and the identification of the data to be calculated; verification is performed based on the verification conditions corresponding to the identification of the data to be calculated and the user's identity authentication information to determine whether the user has data calculation permission; and the verification result is returned to the user.
[0020] According to some further embodiments of the present disclosure, an electronic device is provided, comprising: a processor; and a memory coupled to the processor, for storing instructions, wherein when the instructions are executed by the processor, the processor executes the data processing method as described in any of the aforementioned embodiments.
[0021] According to some further embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, wherein the program, when executed by a processor, implements the data processing method of any of the aforementioned embodiments.
[0022] The data to be calculated in the present disclosure is data encrypted by a preset homomorphic encryption algorithm and stored in the blockchain. The user initiates a data calculation request if he has the data calculation permission. After receiving the data request, the blockchain node obtains the data to be calculated in the blockchain according to the data calculation request, and calls the calculation method to be called in the smart contract to calculate the data to be calculated to obtain the calculation result. After the blockchain node sends the calculation result to the user, the user decrypts the calculation result to obtain the final result. Since the data to be calculated and the calculation method are stored in the blockchain, the immutability and security of the data and the accuracy of the calculation results are guaranteed. Since the data to be calculated is encrypted by a preset homomorphic encryption algorithm, the user will decrypt it after obtaining the calculation result. During the entire calculation process, no blockchain node can obtain the plaintext of the data, thereby improving the protection of data privacy.
[0023] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0025] Figure 1 A flowchart diagram showing a data processing method according to some embodiments of the present disclosure is provided.
[0026] Figure 2 A flowchart schematically illustrates a data processing method according to other embodiments of the present disclosure.
[0027] Figure 3 A schematic diagram showing the structure of a blockchain node according to some embodiments of the present disclosure.
[0028] Figure 4 A schematic diagram showing the structure of a data processing system according to some embodiments of the present disclosure.
[0029] Figure 5 A schematic diagram showing the structure of an electronic device according to some embodiments of the present disclosure.
[0030] Figure 6 A schematic diagram showing the structure of an electronic device according to some other embodiments of the present disclosure. DETAILED DESCRIPTION
[0031] The technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present disclosure and its application or use. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0032] The present disclosure proposes a data processing method, which is combined with Figure 1 Give a description.
[0033] Figure 1 Flowcharts of some embodiments of the data processing method disclosed herein. Figure 1 As shown, the method of this embodiment includes: steps S102 to S108.
[0034] In step S102, the blockchain node receives the user's data calculation request.
[0035] In some embodiments, a blockchain node receives a user's data calculation request through an interface with a business system, or receives a data calculation request broadcasted by other blockchain nodes. If a blockchain node receives a user's data calculation request through an interface with a business system, the blockchain node needs to broadcast the data calculation request, and other blockchain nodes will also receive the data calculation request. When a blockchain node broadcasts a data calculation request, it can first sign the data calculation request, and other blockchain nodes can verify the signature after receiving the signed data calculation request. This process is a routine operation in the process of blockchain initiating transactions and will not be repeated here.
[0036] In some embodiments, the data calculation request includes: the location where the data to be calculated is stored in the blockchain, the address of the smart contract, and the identifier of the calculation method to be called in the smart contract. The data to be calculated is data encrypted using a preset homomorphic encryption algorithm. The preset homomorphic encryption algorithm is, for example, a fully homomorphic encryption algorithm. The homomorphic encryption model is expressed as HE=(HE.Keygen, HE.Enc, HE.Dec, HE.Eval), where HE.Keygen is the key generation algorithm in the preset homomorphic encryption algorithm, and HE.Keygen is used to generate the encryption key pk and the decryption key sk. HE.Enc is the encryption algorithm in the preset homomorphic encryption algorithm, HE.Dec is the decryption algorithm in the preset homomorphic encryption algorithm, and HE.Eval is the valuation algorithm (evaluation function), that is, the calculation method to be called in the smart contract.
[0037] In some embodiments, the business system receives a key acquisition request from a user, wherein the key generation request includes the user's identity authentication information; the business system verifies the user's identity authentication information to determine whether the user has the key acquisition authority; if the user has the key acquisition authority, the business system generates the user's corresponding public key and private key according to a preset homomorphic encryption algorithm, and returns the user's corresponding public key and private key to the user, so that the user can use the corresponding public key to homomorphically encrypt the data to be stored. The public key and private key assigned to each user can be different.
[0038] The business system can store a blacklist or whitelist for key acquisition, and can verify the user based on the blacklist or whitelist and the user's identification (authentication information). Alternatively, the business system or authentication system can assign a token to the user based on the user's registration information (for example, user name, password, etc.). The user's identity authentication information in the key acquisition request is the token assigned to the user. The token corresponds to a valid time. The business system compares the token assigned to the user with one or more stored tokens and the valid time of each token to verify the user. Other methods can also be used to verify the user, not limited to the examples given. When the user verification is passed, the business system calls HE.Keygen to generate an encryption key pk and a decryption key sk and returns them to the user. The transmission of various key information between the business system and the user can be encrypted. For example, the business system uses a public key for encryption and the user uses a private key for decryption, not limited to the examples given.
[0039] HE.Keygen is divided into three parts: Setup, SecretKeyGen and PublicKeyGen.
[0040] 1) Setup(1 λ , 1 L ): Generate Z q n The parameter q = q(λ, L), the dimension parameter n = n(λ, L), the error distribution X = X(λ, L) and the parameter m = m(λ, L), let N = (n + 1) · l.
[0041] 2) SecretKeyGen(n,q,X,m): Select Output Let v=Powersof2(s).
[0042] 3) PublicKeyGen(n,q,X,m,sk): Generate matrix and the vector e←X m . Let b = B·t+e. Let A be a matrix with n+1 rows, consisting of the matrix B and b. Let the public key pk = A. (Note: A·s = e)
[0043] First, λ is a security parameter, which indicates the complexity of the difficult problem in the cryptographic scheme. All parameters should be selected based on this parameter (directly or indirectly). Parameter L indicates the number of layers of homomorphic operations. Since the number of layers of homomorphic operations is determined by the proportion of noise, if more homomorphic operations are to be performed, the noise should not cover q too quickly, and q should be selected accordingly. The error distribution X and dimension n of the LWE problem can be weighed according to q, and the parameters l and N are introduced for the convenience of representation. For details, please refer to the GSW algorithm, which will not be repeated here.
[0044] The encryption and decryption process of the preset homomorphic encryption algorithm is, for example, HE.Enc(n,q,X,m,pk,u): Encrypted message u∈z q , the sampling uniform matrix R∈{0,1} N×m And output the ciphertext C. For example, C can be calculated using the following formula.
[0045]
[0046] The encryption and decryption process of the preset homomorphic encryption algorithm is, for example, HE.DEC(n,q,X,m,sk,C). Observe that the first l coefficients of v are 1,2,...,2 l-1 , among these coefficients, C i represents the i-th row of C, calculate x i ←<C i ,v>, output u i =x i / v i (Rounded to the nearest integer). For details, please refer to the GSW algorithm, which will not be described in detail here. The preset homomorphic encryption algorithm can be other existing algorithms, not limited to the examples given.
[0047] The encryption and decryption process of the preset homomorphic encryption algorithm can be configured on the user's client to prevent other users from obtaining information before and after encryption.
[0048] In some embodiments, the user initiates a data computing request when he has data computing authority. The business system receives a data computing authority verification request from the user (through the client), wherein the data computing authority verification request includes the user's identity verification information and the identification of the data to be calculated; the business system verifies according to the verification conditions corresponding to the identification of the data to be calculated and the user's identity verification information to determine whether the user has data computing authority; the business system returns the verification result to the user. For example, when the user has data computing authority, the verification result also includes the homomorphic encryption decryption key corresponding to the data to be calculated.
[0049] The identification of the data to be calculated may be the identification of the owner of the data to be calculated or other unique identification, etc. The identification of the data to be calculated may correspond to a blacklist or a whitelist as a verification condition. The blacklist stores the identification of users who are not allowed to calculate the data to be calculated, and the whitelist stores the identification of users who are allowed to calculate the data to be calculated. The user can be verified based on the blacklist or the whitelist and the user's identification (authentication information). Alternatively, the business system or the authentication system may assign a token to the user based on the user's registration information (for example, user name, password, etc.). The user's identity authentication information in the data calculation permission verification request is the token assigned to the user. The identification of the data to be calculated may correspond to one or more tokens, and the token corresponds to a valid time. The business system compares the token assigned by the user with the one or more tokens corresponding to the identification of the data to be calculated and the valid time of each token to verify the user. Other methods may also be used to verify the user, not limited to the examples given.
[0050] After the user passes the verification, the user can send a data calculation request to the business system through the client. The data calculation request can include a call token of the data calculation interface. The business system can verify the token and then send the user's data calculation request through the interface between the blockchain node. The token generation and verification can refer to the above embodiments or existing technologies, and will not be repeated here.
[0051] In step S104, the blockchain node obtains the data to be calculated in the blockchain according to the data calculation request.
[0052] In some embodiments, the data calculation request also includes: an identifier of the permission verification method in the smart contract and an identifier of the user. The blockchain node calls the permission verification method according to the identifier of the permission verification method in the smart contract, and obtains the access permission list corresponding to the data to be calculated, wherein the access permission list includes the identifiers of users who are allowed to access the data to be calculated or the identifiers of users who are not allowed to access the data to be calculated; the blockchain node determines whether the user is allowed to access the data to be calculated according to the access permission list; if the user is allowed to access the data to be calculated, the blockchain node obtains the data to be calculated in the blockchain according to the location where the data to be calculated is stored in the blockchain. The access permission list can be a blacklist or a whitelist.
[0053] In some embodiments, the data calculation request also includes: an identifier of the permission verification method in the smart contract and the user's credentials, where the credentials are, for example, preset data signed by the owner of the data to be calculated, that is, the uploading user, or preset data signed by the business system. The data to be calculated can come from multiple different owners. Therefore, the credentials can have multiple or preset data signed by multiple owners. The blockchain node calls the permission verification method according to the identifier of the permission verification method in the smart contract to verify the credentials, such as verifying the signature of the preset data. If the verification is successful, it is determined that the user is allowed to access the data to be calculated. When the user allows access to the data to be calculated, the blockchain node obtains the data to be calculated in the blockchain according to the location where the data to be calculated is stored in the blockchain.
[0054] The user is verified through the permission verification method in the smart contract, which ensures the accuracy and security of the verification process. Only after the user is verified can the data to be calculated be obtained for calculation, which prevents illegal users from obtaining data for calculation and improves security and data privacy.
[0055] In step S106, the blockchain node calls the calculation method to be called in the smart contract to calculate the data to be calculated and obtains the calculation result.
[0056] Blockchain nodes can be divided into the protocol layer and the computing layer. The protocol layer can implement consensus mechanisms, register CA (certification authority) certificates, store and execute rights confirmation agreements, and store ledgers, etc. Blockchain technology support functions. The computing layer can store smart contracts, evaluation functions, and keys, etc.
[0057] For example, the calculation method to be called is HE.Eval, which is stored in the smart contract. If the public key of the preset homomorphic encryption algorithm corresponding to the data to be calculated is also needed to call HE.Eval for calculation, the public key can be stored in the smart contract. Due to the use of the homomorphic encryption algorithm, the calculation is based on the encrypted data, and the result obtained after decryption is the same as the result of directly calculating the data.
[0058] In step S108, the blockchain node sends the calculation result to the user so that the user can decrypt the calculation result.
[0059] In some embodiments, the blockchain node generates first transaction information based on the calculation result and stores the first transaction information to the blockchain, wherein the first transaction information includes the calculation result; when the blockchain node receives a data calculation request from a user through an interface with a business system, the blockchain node sends the calculation result to the user through the interface with the business system; or, when the blockchain node receives a data calculation request broadcasted by other blockchain nodes, the other blockchain nodes obtain the calculation result based on the first transaction information stored in the blockchain and send the calculation result to the user through the interface with the business system.
[0060] Each blockchain node receives the broadcast data calculation request and can execute the above steps S104 to S106 to obtain the calculation result. Further, the blockchain node that obtains the calculation result generates the first transaction information according to the calculation result and broadcasts the first transaction information. The first transaction information can be signed by the blockchain node that publishes it, and the other blockchain nodes that receive the first transaction information verify the signature. After the signature is verified, the first transaction information is temporarily stored. When the temporarily stored transaction information reaches a preset number, a block can be generated (can be generated by any node or a specified node). The block is broadcast to the blockchain node that executes the consensus mechanism to reach a consensus on the block, and the block is added to the blockchain after the consensus. For example, n consensus nodes provide a fault tolerance of f = (n-1) / 3. The node synchronization process completes the synchronization by requesting blocks from other nodes and verifying them. The view switching process can be based on the block generation protocol, and then use a timeout mechanism to switch views. To a certain extent, it reduces the computing power overhead and data transmission volume. View switching means replacing the consensus master node, and the view will be switched every time a master node is replaced. The timeout mechanism is to switch the view when the block generation exceeds the preset time. The above-mentioned process of broadcasting transaction information, verifying signatures, generating blocks and reaching consensus can refer to the existing technology, or it can be different due to different blockchain technologies, and is not limited to the examples given. After the first transaction information is stored in the blockchain, the calculation result can be returned to the user through the business system.
[0061] If the aforementioned user obtains the homomorphic encryption decryption key when verifying the data calculation authority, the calculation result can be decrypted to obtain the final result. Alternatively, if multiple users need to jointly decrypt (such as the secure multi-party computing method), the user can request the various users of the data to be calculated to jointly decrypt.
[0062] In the above embodiment, the data to be calculated is data encrypted by a preset homomorphic encryption algorithm and stored in the blockchain. The user initiates a data calculation request when he has the data calculation permission. After receiving the data request, the blockchain node obtains the data to be calculated in the blockchain according to the data calculation request, and calls the calculation method to be called in the smart contract to calculate the data to be calculated to obtain the calculation result. After the blockchain node sends the calculation result to the user, the user decrypts the calculation result to obtain the final result. Since the data to be calculated and the calculation method are stored in the blockchain, the immutability and security of the data and the accuracy of the calculation result are guaranteed. Since the data to be calculated is encrypted by a preset homomorphic encryption algorithm, the user will decrypt it after obtaining the calculation result. During the entire calculation process, no blockchain node can obtain the plaintext of the data, thereby improving the protection of data privacy.
[0063] Combine the following Figure 2 Other embodiments of the data processing method disclosed herein are described.
[0064] Figure 2 Flowcharts of other embodiments of the data processing method disclosed herein. Figure 2 As shown, the method of this embodiment includes: steps S202 to S206.
[0065] In step S202, the blockchain node receives a data storage request from a user.
[0066] The data storage request includes the data to be stored, and the data to be stored is data encrypted using a preset homomorphic encryption algorithm. For example, referring to the aforementioned embodiment, the user uses the corresponding public key on the client to homomorphically encrypt the data to be stored, and then uploads it to the blockchain as the data to be stored.
[0067] In step S204, the blockchain node generates second transaction information based on the data to be stored, and stores the second transaction information in the blockchain.
[0068] The second transaction information includes data to be stored. In some embodiments, the blockchain node broadcasts the second transaction information to other blockchain nodes; after a block containing the second transaction information is generated by any blockchain node (or designated node) and the blockchain node executing the consensus mechanism reaches a consensus on the block, the block containing the second transaction information is added to the blockchain. The second transaction information can be signed by the blockchain node that issued it, and other blockchain nodes that received the second transaction information verify the signature. After the signature is verified, the second transaction information is temporarily stored. When the temporarily stored transaction information reaches a preset number, a block can be generated (can be generated by any node or a designated node). The block is broadcast to the blockchain node that executes the consensus mechanism to reach a consensus on the block, and the block is added to the blockchain after consensus. The above-mentioned process of broadcasting transaction information, signing and verifying, generating blocks and reaching consensus can refer to the prior art, and can also be different due to different blockchain technologies, and is not limited to the examples cited.
[0069] In step S206, the blockchain node returns the storage location of the second transaction information to the user.
[0070] The storage location of the second transaction information can be stored in the business system so that other users can subsequently initiate data calculation requests. When the data to be calculated is the data included in the second transaction information, the data to be calculated can be obtained from the blockchain node through the business system.
[0071] In the method of the above embodiment, the user homomorphically encrypts the data to be stored and then uploads it to the blockchain. No node or user can obtain the true meaning of the data, thereby improving the privacy of the data.
[0072] In this disclosure, each data sharing participant (user) can build a blockchain alliance mechanism, and each participant will store the shared data in the distributed architecture of the blockchain in homomorphic encryption, and use the consensus mechanism on the blockchain to solve the problem of mutual trust between blockchain nodes. On the basis of mutual trust, the homomorphic encryption algorithm is used to jointly calculate the required function value using the encrypted data of each node, and the distributed parallel framework model is used to calculate the user's input using the fully homomorphic encryption algorithm, and the result is returned to the user. Since the user can only see the calculation result, no privacy information will be leaked in this process.
[0073] The data is stored by encrypting the original text on the chain. The encryption algorithm can be an algorithm supported by secure multi-party computing. Each user is assigned a set of encryption keys. The data is homomorphically encrypted before being uploaded to the chain. After obtaining the permission, the data user can decrypt and use the calculated results with the decryption key.
[0074] Participants can authorize third parties to access their data, or revoke permissions at any time to revoke third parties' access to data, and control and manage access to all or part of the data content stored in the blockchain.
[0075] The present disclosure provides a blockchain node, which is combined with Figure 3 Give a description.
[0076] Figure 3 Figure 1 is a structural diagram of some embodiments of the blockchain node disclosed in the present invention. Figure 3 As shown, the blockchain node 30 of this embodiment includes: a receiving module 310, an acquisition module 320, a calculation module 330, and a sending module 340.
[0077] The receiving module 310 is used to receive a data calculation request from a user, wherein the data calculation request includes: the location where the data to be calculated is stored in the blockchain, the address of the smart contract, and the identifier of the calculation method to be called in the smart contract. The data to be calculated is data encrypted using a preset homomorphic encryption algorithm. The user initiates a data calculation request if he has data calculation authority.
[0078] In some embodiments, the receiving module 310 is used to receive a user's data calculation request through an interface with the business system, or to receive a data calculation request broadcasted by other blockchain nodes.
[0079] The acquisition module 320 is used to obtain the data to be calculated in the blockchain according to the data calculation request.
[0080] The calculation module 330 is used to call the calculation method to be called in the smart contract to calculate the data to be calculated and obtain the calculation result.
[0081] In some embodiments, the data calculation request also includes: an identifier of the permission verification method in the smart contract and an identifier of the user. The calculation module 330 is used to call the permission verification method according to the identifier of the permission verification method in the smart contract, obtain the access permission list corresponding to the data to be calculated, wherein the access permission list includes the identifier of the user who is allowed to access the data to be calculated or the identifier of the user who is not allowed to access the data to be calculated; determine whether the user is allowed to access the data to be calculated according to the access permission list; if the user is allowed to access the data to be calculated, obtain the data to be calculated in the blockchain according to the location where the data to be calculated is stored in the blockchain.
[0082] The sending module 340 is used to send the calculation result to the user so that the user can decrypt the calculation result.
[0083] In some embodiments, the sending module 340 is used to generate first transaction information based on the calculation result, and store the first transaction information to the blockchain, wherein the first transaction information includes the calculation result; when the receiving module 310 is used to receive the user's data calculation request through the interface between the business system, the sending module 340 is used to send the calculation result to the user through the interface between the business system; or, when the receiving module 310 is used to receive data calculation requests broadcasted by other blockchain nodes, the other blockchain nodes obtain the calculation result based on the first transaction information stored in the blockchain and send the calculation result to the user through the interface between the business system.
[0084] In some embodiments, the receiving module 310 is also used to receive a data storage request from a user, wherein the data storage request includes the data to be stored, and the data to be stored is data encrypted using a preset homomorphic encryption algorithm. The blockchain node 30 also includes: a storage module 350, which is used to generate second transaction information based on the data to be stored, and store the second transaction information in the blockchain, wherein the second transaction information includes the data to be stored; and the sending module 340 is also used to return the storage location of the second transaction information to the user.
[0085] In some embodiments, the sending module 340 is also used to broadcast the second transaction information to other blockchain nodes; after a block containing the second transaction information is generated by any blockchain node and the blockchain nodes executing the consensus mechanism reach consensus on the block, the block containing the second transaction information is added to the blockchain.
[0086] The present disclosure also provides a data processing system, Figure 4 Give a description.
[0087] Figure 4 FIG. 1 is a block diagram of some embodiments of the data processing system disclosed in the present invention. Figure 4 As shown, the data processing system 4 of this embodiment includes: a plurality of blockchain nodes 30 of any of the aforementioned embodiments; and a business system 42.
[0088] The business system 42 is used to receive data calculation requests sent by users, and send the user's data calculation requests to the blockchain node through the interface between the blockchain node 30.
[0089] In some embodiments, the business system 42 is also used to receive a key acquisition request from a user, wherein the key generation request includes the user's identity authentication information; verify the user's identity authentication information to determine whether the user has key acquisition authority; if the user has key acquisition authority, generate the user's corresponding public key and private key according to a preset homomorphic encryption algorithm, and return the user's corresponding public key and private key to the user, so that the user can use the corresponding public key to homomorphically encrypt the data to be stored.
[0090] In some embodiments, the business system 42 is also used to receive a user's data calculation permission verification request, wherein the data calculation permission verification request includes the user's identity authentication information and the identification of the data to be calculated; verification is performed based on the verification conditions corresponding to the identification of the data to be calculated and the user's identity authentication information to determine whether the user has data calculation permission; and the verification result is returned to the user.
[0091] The electronic device in the embodiments of the present disclosure may include a blockchain node and / or a business system, which may be implemented by various computing devices or computer systems. Figure 5 as well as Figure 6 Give a description.
[0092] Figure 5 FIG. 1 is a structural diagram of some embodiments of the electronic device disclosed in the present invention. Figure 5 As shown, the electronic device 50 of this embodiment includes: a memory 510 and a processor 520 coupled to the memory 510 , and the processor 520 is configured to execute the data processing method in any of some embodiments of the present disclosure based on the instructions stored in the memory 510 .
[0093] The memory 510 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, a database, and other programs.
[0094] Figure 6 FIG. 1 is a structural diagram of some other embodiments of the electronic device disclosed in the present invention. Figure 6 As shown, the electronic device 60 of this embodiment includes: a memory 610 and a processor 620, which are similar to the memory 510 and the processor 520 respectively. It can also include an input and output interface 630, a network interface 640, a storage interface 650, etc. These interfaces 630, 640, 650 and the memory 610 and the processor 620 can be connected, for example, through a bus 660. Among them, the input and output interface 630 provides a connection interface for input and output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 640 provides a connection interface for various networked devices, for example, it can be connected to a database server or a cloud storage server. The storage interface 650 provides a connection interface for external storage devices such as SD cards and USB flash drives.
[0095] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable non-transient storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0096] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0097] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0098] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0099] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.
Claims
1. A data processing method, comprising: The blockchain node receives a data calculation request from a user, wherein the data calculation request includes: the location where the data to be calculated is stored in the blockchain, the address of the smart contract, the identifier of the calculation method to be called in the smart contract, the identifier of the permission verification method in the smart contract, and the identifier of the user. The user initiates the data calculation request if he has the data calculation permission; The blockchain node obtains the data to be calculated in the blockchain according to the data calculation request, including: the blockchain node calls the permission verification method according to the identifier of the permission verification method in the smart contract to obtain the access permission list corresponding to the data to be calculated, wherein the access permission list includes the identifiers of users who are allowed to access the data to be calculated or the identifiers of users who are not allowed to access the data to be calculated; the blockchain node determines whether the user is allowed to access the data to be calculated according to the access permission list; the blockchain node obtains the data to be calculated in the blockchain according to the location where the data to be calculated is stored in the blockchain when the user is allowed to access the data to be calculated, wherein the data to be calculated is data encrypted by using a preset homomorphic encryption algorithm; The blockchain node calls the calculation method to be called in the smart contract to calculate the data to be calculated and obtains a calculation result; The blockchain node sends the calculation result to the user so that the user uses the homomorphic encryption decryption key to decrypt the calculation result to obtain the final result.
2. The data processing method according to claim 1, wherein: The blockchain node receiving the user's data calculation request includes: The blockchain node receives the data calculation request of the user through an interface with the business system, or receives the data calculation request broadcasted by other blockchain nodes.
3. The data processing method according to claim 2, wherein: The blockchain node sending the calculation result to the user includes: The blockchain node generates first transaction information according to the calculation result, and stores the first transaction information in the blockchain, wherein the first transaction information includes the calculation result; When the blockchain node receives the data calculation request of the user through the interface between the blockchain node and the business system, the blockchain node sends the calculation result to the user through the interface between the blockchain node and the business system; or, when the blockchain node receives the data calculation request broadcasted by other blockchain nodes, the other blockchain nodes obtain the calculation result based on the first transaction information stored in the blockchain and send the calculation result to the user through the interface between the blockchain node and the business system.
4. The data processing method according to claim 1, further comprising: The blockchain node receives a data storage request from a user, wherein the data storage request includes data to be stored, and the data to be stored is data encrypted using a preset homomorphic encryption algorithm; The blockchain node generates second transaction information according to the data to be stored, and stores the second transaction information in the blockchain, wherein the second transaction information includes the data to be stored; The blockchain node returns the storage location of the second transaction information to the user.
5. The data processing method according to claim 4, wherein: The storing the second transaction information into the blockchain comprises: The blockchain node broadcasts the second transaction information to other blockchain nodes; After a block containing the second transaction information is generated by any blockchain node and a blockchain node executing a consensus mechanism reaches a consensus on the block, the block containing the second transaction information is added to the blockchain.
6. The data processing method according to claim 1, further comprising: The business system receives a key acquisition request from a user, wherein the key generation request includes the user's identity authentication information; The business system verifies the identity authentication information of the user to determine whether the user has the key acquisition authority; When the user has key acquisition authority, the business system generates a public key and a private key corresponding to the user according to a preset homomorphic encryption algorithm, and returns the public key and the private key corresponding to the user to the user so that the user can use the corresponding public key to homomorphically encrypt the data to be stored.
7. The data processing method according to claim 1, further comprising: The business system receives a data computing authority verification request from a user, wherein the data computing authority verification request includes identity authentication information of the user and an identifier of the data to be calculated; The business system verifies according to the verification conditions corresponding to the identifier of the data to be calculated and the identity verification information of the user to determine whether the user has the data calculation authority; The business system returns the verification result to the user.
8. A blockchain node, comprising: A receiving module, configured to receive a data calculation request from a user, wherein the data calculation request includes: a location where the data to be calculated is stored in the blockchain, an address of the smart contract, an identifier of a calculation method to be called in the smart contract, an identifier of a permission verification method in the smart contract, and an identifier of the user, wherein the user initiates a data calculation request if the user has data calculation authority; An acquisition module, used to acquire the data to be calculated in the blockchain according to the data calculation request, including: the blockchain node calls the permission verification method according to the identifier of the permission verification method in the smart contract to acquire the access permission list corresponding to the data to be calculated, wherein the access permission list includes the identifiers of users who are allowed to access the data to be calculated or the identifiers of users who are not allowed to access the data to be calculated; the blockchain node determines whether the user is allowed to access the data to be calculated according to the access permission list; the blockchain node acquires the data to be calculated in the blockchain according to the location where the data to be calculated is stored in the blockchain when the user is allowed to access the data to be calculated, wherein the data to be calculated is data encrypted by a preset homomorphic encryption algorithm; A calculation module, used to call the calculation method to be called in the smart contract to calculate the data to be calculated and obtain a calculation result; The sending module is used to send the calculation result to the user so that the user can use the homomorphic encryption decryption key to decrypt the calculation result to obtain the final result.
9. The blockchain node according to claim 8, wherein: The receiving module is further used to receive a data storage request from a user, wherein the data storage request includes data to be stored, and the data to be stored is data encrypted using a preset homomorphic encryption algorithm; The blockchain node also includes: A storage module, configured to generate second transaction information according to the data to be stored, and store the second transaction information in a blockchain, wherein the second transaction information includes the data to be stored; The sending module is also used to return the storage location of the second transaction information to the user.
10. A data processing system comprising: A plurality of blockchain nodes as described in claim 8 or 9; as well as The business system is used to receive data calculation requests sent by users, and send the data calculation requests of the users to the blockchain nodes through the interface between the blockchain nodes.
11. The data processing system according to claim 10, wherein: The business system is also used to receive a key acquisition request from a user, wherein the key generation request includes the user's identity authentication information; verify the user's identity authentication information to determine whether the user has key acquisition authority; if the user has key acquisition authority, generate a public key and a private key corresponding to the user according to a preset homomorphic encryption algorithm, and return the public key and the private key corresponding to the user to the user, so that the user can use the corresponding public key to homomorphically encrypt the data to be stored.
12. The data processing system according to claim 10, wherein: The business system is also used to receive a user's data calculation permission verification request, wherein the data calculation permission verification request includes the user's identity authentication information and the identification of the data to be calculated; verify according to the verification conditions corresponding to the identification of the data to be calculated and the user's identity authentication information to determine whether the user has data calculation permission; and return the verification result to the user.
13. An electronic device, comprising: processor; as well as A memory coupled to the processor, for storing instructions, wherein when the instructions are executed by the processor, the processor executes the data processing method according to any one of claims 1 to 7.
14. A non-transitory computer-readable storage medium having a computer program stored thereon, wherein: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Driving data sharing method and device, system and computer storage medium
CN108734017A
Data storage method and device based on block chain
CN109544393A
Secure multi-party computing method and device based on block chain and readable storage medium
CN109615378A
Blockchain data protection method, device, system and computer readable storage medium
CN109690551A
Off-chain privacy calculation method and device for on-chain data
CN111047450A
