WO2022143298A1 - 基于区块链的数据处理方法和装置 - Google Patents

基于区块链的数据处理方法和装置 Download PDF

Info

Publication number
WO2022143298A1
WO2022143298A1 PCT/CN2021/140072 CN2021140072W WO2022143298A1 WO 2022143298 A1 WO2022143298 A1 WO 2022143298A1 CN 2021140072 W CN2021140072 W CN 2021140072W WO 2022143298 A1 WO2022143298 A1 WO 2022143298A1
Authority
WO
WIPO (PCT)
Prior art keywords
contract
file
contract file
verification
data package
Prior art date
Application number
PCT/CN2021/140072
Other languages
English (en)
French (fr)
Inventor
刘瑞飞
杨文锋
息冬阳
修宾彬
Original Assignee
北京京东乾石科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京京东乾石科技有限公司 filed Critical 北京京东乾石科技有限公司
Priority to US18/266,217 priority Critical patent/US20230394483A1/en
Priority to JP2023535744A priority patent/JP2023552651A/ja
Publication of WO2022143298A1 publication Critical patent/WO2022143298A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Definitions

  • the embodiments of the present application relate to the field of computer technology, in particular to the field of blockchain technology, and in particular, to a method and apparatus for data processing based on blockchain.
  • Blockchain technology was born from the Bitcoin system proposed by Satoshi Nakamoto. Its essence is a shared database, which has the advantages of decentralization, immutability, openness and transparency.
  • a smart contract is a concept proposed by Szabo in 1997.
  • a smart contract is an executable computer program with logical sequence that runs on the blockchain database and can meet the predefined conditions in its source code. executes itself. Due to the feature that smart contracts can be executed automatically without a trusted third party, it reduces the trust cost between multiple contract participants who do not trust each other.
  • the present application provides a blockchain-based data processing method, apparatus, device, and storage medium.
  • a blockchain-based data processing method comprising: in response to receiving a contract deployment request sent by a requesting node in a blockchain network, obtaining a contract file corresponding to the contract deployment request , where the contract file is generated based on the content expansion of the smart contract corresponding to the contract deployment request, and the smart contract is the business code that can be automatically executed in the blockchain; based on the parsing result of the contract file and the blockchain ledger, the contract file is processed.
  • Verification in which verification is used to represent the verification of the key of the contract file, the content of the contract file and the signatures of the contract participants, and the blockchain ledger is generated by pre-executing the transaction of the contract deployment; in response to the successful verification of the contract file, according to The contract file, which determines the smart contract corresponding to the contract deployment request.
  • verifying the contract file based on the parsing result of the contract file and the blockchain ledger includes: analyzing the content of the contract file to obtain a method name data package of each method in the contract file, and a data packet of each method in the contract file.
  • the parameter data package corresponding to each method in the contract file, the signature data package of the contract participants, the key package of the contract file and the blockchain ledger are used to verify the contract file.
  • Verifying the contract file includes: performing key verification on the contract file according to the key package of the contract file, wherein the verification is used to represent the verification of the public-private key pair of the requesting node; The contract participants verify; query the blockchain ledger to obtain the method name of each method corresponding to the contract deployment request and the parameter information corresponding to each method corresponding to the contract deployment request.
  • the method name data package of each method and the parameter data package corresponding to each method in the contract file are verified; according to the key verification result of the contract file, the verification result of the participants of the contract, the method name data package and the method name of each method in the contract file.
  • the verification result of the parameter data package corresponding to each method in the contract file determines whether the verification of the contract file is successful.
  • the generation process of the blockchain ledger is as follows: in response to receiving a transaction request for contract deployment sent by the requesting node, broadcasting the transaction request to the blockchain network, and verifying the transaction based on the transaction request message, wherein , the transaction request message includes: the method data package of each method corresponding to the contract deployment request, the parameter data package corresponding to each method corresponding to the contract deployment request, the hash value of the contract file and the location information of the contract file; in response to the transaction verification By generating the block corresponding to the transaction request according to the method data package of each method corresponding to the contract deployment request, the parameter data package corresponding to each method corresponding to the contract deployment request, the hash value of the contract file and the location information of the contract file ; Based on the consensus mechanism, the block is written into the blockchain ledger, and the written blockchain ledger is generated.
  • acquiring the contract file corresponding to the contract deployment request includes: based on the location information of the contract file in the blockchain ledger, acquiring the contract file corresponding to the location information of the contract file.
  • the method name data packet is generated by encrypting the method name based on the first encryption algorithm; and/or the parameter data packet is generated by encrypting the parameters based on the second encryption algorithm.
  • verifying the contract file based on the method name data package of each method in the contract file and the parameter data package corresponding to each method in the contract file includes: based on the ciphertext of the method name data package, verifying the contract file Verify; and/or, based on the ciphertext of the parameter data packet, verify the contract file.
  • the method further includes: deploying the smart contract in the blockchain, so that when the service triggers the calling condition, the smart contract is executed.
  • the method further includes: in response to the contract file verification failure, ending the contract deployment request.
  • a blockchain-based data processing device comprising: an obtaining unit configured to obtain contract deployment in response to receiving a contract deployment request sent by a requesting node in a blockchain network Request the corresponding contract file, wherein the contract file is generated based on the content expansion of the smart contract corresponding to the contract deployment request, and the smart contract is the business code that can be automatically executed in the blockchain; the verification unit is configured based on the parsing of the contract file.
  • the result and the blockchain ledger are used to verify the contract file, wherein the verification is used to characterize the key of the contract file, the content of the contract file and the signatures of the contract participants.
  • the blockchain ledger executes the transaction deployed by the contract in advance
  • the generating and determining unit is configured to, in response to the successful verification of the contract file, determine the smart contract corresponding to the contract deployment request according to the contract file.
  • the verification unit includes: a content parsing module configured to perform content parsing on the contract file to obtain a method name data package of each method in the contract file, a parameter data package corresponding to each method in the contract file, and a contract
  • the signature data package of the participant and the key package of the contract file, wherein the key package is generated by performing encryption operations on the requesting node the verification module is configured to be based on the method name data package of each method in the contract file, and the contract file.
  • the parameter data package corresponding to each method in the method, the signature data package of the contract participants, the key package of the contract file and the blockchain ledger are used to verify the contract file.
  • the verification module includes: a first verification sub-module, configured to perform key verification on the contract file according to the key bag of the contract file, wherein the verification is used to indicate that the public-private key pair of the requesting node is performed Verification; the second verification sub-module is configured to verify the contract participants according to the signed data packets of the contract participants; the third verification sub-module is configured to query the blockchain ledger to obtain each contract corresponding to the contract deployment request.
  • the method name of the method and the parameter information corresponding to each method corresponding to the contract deployment request, and according to the obtained method name and parameter information, the method name data package of each method in the contract file and the parameter data package corresponding to each method in the contract file are processed.
  • Verify determine the sub-module, which is configured to verify according to the key verification result of the contract file, the verification result of the contract participants, the method name data package of each method in the contract file, and the parameter data package corresponding to each method in the contract file. As a result, it is determined whether the verification of the contract file is successful.
  • the blockchain ledger is generated using the following modules: a transaction verification module, configured to, in response to receiving a transaction request for contract deployment sent by a requesting node, broadcast the transaction request to the blockchain network, and report the transaction request based on the transaction request.
  • the transaction request message includes: the method data package of each method corresponding to the contract deployment request, the parameter data package corresponding to each method corresponding to the contract deployment request, the hash value of the contract file and the value of the contract file.
  • the generation module is configured to respond to the transaction verification passing, according to the method data package of each method corresponding to the contract deployment request, the parameter data package corresponding to each method corresponding to the contract deployment request, the hash value of the contract file and the contract
  • the location information of the file generates the block corresponding to the transaction request
  • the writing module is configured to write the block into the blockchain ledger based on the consensus mechanism, and generate the written blockchain ledger.
  • the obtaining unit is further configured to obtain the contract file corresponding to the position information of the contract file based on the position information of the contract file in the blockchain ledger.
  • the method name data packet in the content parsing module is generated by encrypting the method name based on the first encryption algorithm; and/or the parameter data packet in the content parsing module is generated by encrypting the parameters based on the second encryption algorithm generate.
  • the verification module is further configured to verify the contract file based on the ciphertext of the method name data packet; and/or to verify the contract file based on the ciphertext of the parameter data packet.
  • the apparatus further includes: a deployment unit configured to deploy the smart contract in the blockchain, so that when the service triggers the calling condition, the smart contract is executed.
  • the apparatus further includes an end unit configured to end the contract deployment request in response to the contract file verification failure.
  • an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor.
  • the at least one processor executes to enable the at least one processor to perform a method as described in any implementation of the first aspect.
  • the present application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method described in any implementation manner of the first aspect .
  • FIG. 1 is a schematic diagram of a first embodiment of a blockchain-based data processing method according to the present application
  • Fig. 2 is a scene diagram in which the blockchain-based data processing method according to the embodiment of the present application can be realized;
  • FIG. 3 is a schematic diagram of a second embodiment of a blockchain-based data processing method according to the present application.
  • FIG. 4 is a schematic structural diagram of an embodiment of a blockchain-based data processing apparatus according to the present application.
  • FIG. 5 is a block diagram of an electronic device used to implement the blockchain-based data processing method according to the embodiment of the present application.
  • the technology according to the present application adopts, in response to receiving the contract deployment request sent by the requesting node in the blockchain network, to obtain the contract file corresponding to the contract deployment request, wherein the contract file is generated based on the content expansion of the smart contract corresponding to the contract deployment request , based on the parsing result of the contract file and the blockchain ledger, the contract file is verified, and in response to the successful verification of the contract file, the smart contract corresponding to the contract deployment request is determined according to the contract file.
  • file format to dynamically load smart contract files and run new smart contracts without restarting the blockchain node.
  • the blockchain ledger is generated by pre-executing the transaction of the contract deployment, which realizes that the smart contract method and parameters can be dynamically set, and restricts the implementation method and template of the smart contract, which has greater flexibility.
  • the verification is based on the verification of the key of the contract file, the content of the contract file and the signatures of the contract participants, which avoids the security risks and the possibility of key leakage caused by the introduction of a third-party key center in the existing technology, and ensures Non-repudiation and integrity of deployers and approvers of contracts.
  • FIG. 1 shows a schematic diagram 100 of a first embodiment of a blockchain-based data processing method according to the present application.
  • the blockchain-based data processing method includes the following steps:
  • Step 101 in response to receiving the contract deployment request sent by the requesting node in the blockchain network, obtain a contract file corresponding to the contract deployment request.
  • the execution body when the execution body (such as the smart contract server) receives the contract deployment request sent by the requesting node, it can obtain the contract corresponding to the contract deployment request through wired connection or wireless connection document.
  • the contract file can be generated based on the content expansion of the smart contract corresponding to the contract deployment request.
  • the file type of the contract file can be the ELFext expanded by the smart contract file (ELF file), and the smart contract is the business code that can be automatically executed in the blockchain .
  • ELF file ELFext expanded by the smart contract file
  • the smart contract is the business code that can be automatically executed in the blockchain .
  • the above wireless connection methods may include but are not limited to 3G, 4G, 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection currently known or developed in the future connection method.
  • the smart contract code after the smart contract code is compiled, it exists in the ELF file format.
  • the ELF file code logic is automatically executed.
  • the auxiliary attributes include the following: encrypted method name data package, the encrypted parameter data package corresponding to each method, the signature data package signed by the contract participants, the key package of the contract file and the smart contract ciphertext package.
  • For the method name packet use the CBC mode of the 3DES algorithm to encrypt the method name.
  • the parameters of the method are encrypted using the CBC mode of the 3DES algorithm.
  • smart contract participants use their private keys to sign the smart contract binary to generate a list of signature values.
  • the working key is the system random number
  • the public key of the blockchain node is used for operation, and the CRC32 value of the key needs to be calculated for verification for subsequent use.
  • the smart contract ciphertext package the symmetric algorithm encryption operation is performed on the binary stream of the smart contract, which ensures the confidentiality of the smart contract during the circulation of the smart contract. The above is used as an additional attribute, and is written into the additional attribute area of the ELF file to form a custom ELFext file.
  • Step 102 verifying the contract file based on the parsing result of the contract file and the blockchain ledger.
  • the execution body may parse the contract file obtained in step 101, and verify the contract file based on the result obtained by the parsing and the corresponding information in the blockchain ledger. Verification can represent the verification of the key of the contract file, the content of the contract file and the signatures of the contract participants, and the blockchain ledger is generated by pre-executing the transactions deployed by the contract.
  • the generation process of the blockchain ledger is as follows: in response to receiving a transaction request for contract deployment sent by the requesting node, broadcast the transaction request to the blockchain network, and perform the transaction based on the transaction request message.
  • Identity verification wherein the transaction request message includes: the method data package of each method corresponding to the contract deployment request, the parameter data package corresponding to each method corresponding to the contract deployment request, the hash value of the contract file, and the location information of the contract file;
  • the transaction request is generated according to the method data package of each method corresponding to the contract deployment request, the parameter data package corresponding to each method corresponding to the contract deployment request, the hash value of the contract file and the location information of the contract file.
  • the corresponding block based on the consensus mechanism, the block is written into the blockchain ledger, and the written blockchain ledger is generated.
  • the dynamic setting and distribution of smart contract methods and parameters is realized, making the realization of smart contracts more flexible; smart contracts have been confirmed by the blockchain consensus party, and in subsequent In the contract deployment link, based on the blockchain ledger generated by this transaction, the methods, parameters and summary values of the dynamic contract are verified to ensure the non-repudiation and integrity of the dynamic contract.
  • Step 103 in response to the successful verification of the contract file, determine the smart contract corresponding to the contract deployment request according to the contract file.
  • the contract file can be parsed to obtain a smart contract corresponding to the contract deployment request in the contract file.
  • the blockchain-based data processing method 200 of this embodiment runs in the service platform 201 .
  • the service platform 201 receives the contract deployment request sent by the requesting node in the blockchain network, it obtains the contract file 202 corresponding to the contract deployment request, and then the service platform 201 executes the contract file based on the parsing result of the contract file and the blockchain ledger. Verification 203.
  • the smart contract 204 corresponding to the contract deployment request is determined according to the contract file.
  • the contract file is generated based on the content expansion of the smart contract corresponding to the contract deployment request, and the verification is used to characterize the key of the contract file, the content of the contract file and the signatures of the contract participants. Generated by the contract deployment transaction.
  • the blockchain-based data processing method provided by the above-mentioned embodiments of the present application adopts, in response to receiving a contract deployment request sent by a requesting node in a blockchain network, to obtain a contract file corresponding to the contract deployment request, wherein the contract file is based on the
  • the smart contract corresponding to the deployment request is generated by content expansion.
  • the contract file is verified.
  • the smart contract corresponding to the contract deployment request is determined according to the contract file. , realizes that by extending the file format of the smart contract file, the smart contract file can be dynamically loaded without restarting the blockchain node to run a new smart contract.
  • the blockchain ledger is generated by pre-executing the transaction of the contract deployment, which realizes that the smart contract method and parameters can be dynamically set, and restricts the implementation method and template of the smart contract, which has greater flexibility.
  • the verification is based on the verification of the key of the contract file, the content of the contract file and the signatures of the contract participants, which avoids the security risks and the possibility of key leakage caused by the introduction of a third-party key center in the existing technology, and ensures Non-repudiation and integrity of deployers and approvers of contracts.
  • FIG. 3 a schematic diagram 300 of a second embodiment of a blockchain-based data processing method is shown.
  • the flow of the method includes the following steps:
  • Step 301 in response to receiving a contract deployment request sent by a requesting node in the blockchain network, obtain a contract file corresponding to the contract deployment request.
  • acquiring the contract file corresponding to the contract deployment request includes: acquiring the contract file corresponding to the location information of the contract file based on the location information of the contract file in the blockchain ledger. Realize accurate and fast query of contract files.
  • Step 302 Perform content analysis on the contract file to obtain the method name data package of each method in the contract file, the parameter data package corresponding to each method in the contract file, the signature data package of the contract participants and the key package of the contract file.
  • the execution body can parse the content of the contract file, and obtain the method name data package of each method in the parsed contract file, the parameter data package corresponding to each method in the contract file, the signature data package of the contract participants and The keybag for the contract file.
  • the key package is generated by performing encryption operations on the requesting node.
  • the method name data packet is generated by encrypting the method name based on the first encryption algorithm; and/or the parameter data packet is generated by encrypting the parameters based on the second encryption algorithm.
  • the first encryption algorithm and the second encryption algorithm may be the same or different.
  • Step 303 Based on the method name data package of each method in the contract file, the parameter data package corresponding to each method in the contract file, the signature data package of the contract participants, the key package of the contract file and the blockchain ledger, the contract file is analyzed. authenticating.
  • the execution body can be based on the method name data package of each method in the contract file, the parameter data package corresponding to each method in the contract file, the signature data package of the contract participants, the key package of the contract file and the blockchain Ledger, which verifies contract documents using pre-set verification methods. Verification is used to characterize the verification of the key of the contract file, the content of the contract file, and the signatures of the contract participants.
  • the blockchain ledger is generated by pre-executing the transaction deployed by the contract.
  • the parameter data package corresponding to each method in the contract file, the signature data package of the contract participants, and the key of the contract file package and blockchain ledger to verify the contract file, including: verifying the key of the contract file according to the key package of the contract file, wherein the verification is used to represent the verification of the public-private key pair of the requesting node; participation according to the contract
  • the signed data package of the contract party is used to verify the participants of the contract;
  • the blockchain ledger is queried to obtain the method name of each method corresponding to the contract deployment request and the parameter information corresponding to each method corresponding to the contract deployment request, and according to the obtained method name and Parameter information, verify the method name data package of each method in the contract file and the parameter data package corresponding to each method in the contract file;
  • the verification result of the method name data packet of the method and the parameter data packet corresponding to each method in the contract file determines whether the verification of the contract file is successful.
  • the contract file is verified based on the method name data package of each method in the contract file and the parameter data package corresponding to each method in the contract file, including: based on the method name data package , verify the contract file; and/or, based on the ciphertext of the parameter data package, verify the contract file. Further guarantees the confidentiality of smart contracts.
  • the contract file is verified based on the method name data package of each method in the contract file and the parameter data package corresponding to each method in the contract file, including: The ciphertext of the contract file to verify the contract file. Further guarantees the confidentiality of smart contracts.
  • Step 304 in response to the successful verification of the contract file, determine the smart contract corresponding to the contract deployment request according to the contract file.
  • the method further includes: deploying the smart contract in the blockchain.
  • the deployment of smart contracts is realized, so that when the business triggers the calling conditions, the smart contracts are executed according to the actual calling parameters of the user.
  • the method further includes: in response to the contract file verification failure, ending the contract deployment request. System resources are saved and system processing efficiency is improved.
  • steps 301 and 304 are basically the same as the operations of steps 101 and 103 in the embodiment shown in FIG. 1 , and details are not repeated here.
  • the schematic diagram 300 of the blockchain-based data processing method in this embodiment adopts the method of performing content analysis on the contract file to obtain each method in the contract file Name data package, parameter data package corresponding to each method in the contract file, signature data package of contract participants, and key package of the contract file, wherein the key package is generated by encrypting the requesting node; based on the data in the contract file
  • the method name data package of each method, the parameter data package corresponding to each method in the contract file, the signature data package of the contract participants, the key package of the contract file and the blockchain ledger are used to verify the contract file.
  • the double verification of the chain node's identity verification and the verification of the ciphertext of the contract file not only ensures the non-repudiation and integrity of the smart contract, but also ensures the confidentiality of the contract.
  • the present application provides an embodiment of a data processing device based on blockchain, which is the same as the method embodiment shown in FIG. 1 .
  • the apparatus can be specifically applied to various electronic devices.
  • the blockchain-based data processing apparatus 400 of this embodiment includes: an acquisition unit 401 , a verification unit 402 and a determination unit 403 , wherein the acquisition unit is configured to respond to receiving a Request the contract deployment request sent by the node, and obtain the contract file corresponding to the contract deployment request, wherein the contract file is generated based on the content expansion of the smart contract corresponding to the contract deployment request, and the smart contract is the business code that can be automatically executed in the blockchain;
  • the verification unit is configured to verify the contract file based on the parsing result of the contract file and the blockchain ledger, wherein the verification is used to characterize the key of the contract file, the content of the contract file and the signature of the contract participants.
  • the blockchain ledger is generated by pre-executing the contract deployment transaction; the determining unit is configured to, in response to the successful verification of the contract file, determine the smart contract corresponding to the contract deployment request according to the contract file.
  • the specific processing of the acquisition unit 401 , the verification unit 402 and the determination unit 403 of the blockchain-based data processing apparatus 400 and the technical effects brought about by them may refer to the steps in the embodiment corresponding to FIG. 1 respectively.
  • the related descriptions from 101 to 103 are not repeated here.
  • the verification unit includes: a content parsing module, configured to perform content parsing on the contract file, to obtain a method name data packet of each method in the contract file, and a data packet of each method in the contract file.
  • the verification module is configured as a method based on each method in the contract file Name data package, parameter data package corresponding to each method in the contract file, signature data package of contract participants, key package of the contract file and blockchain ledger to verify the contract file.
  • the verification module includes: a first verification sub-module, configured to perform key verification on the contract file according to the key package of the contract file, wherein the verification is used to represent a pair of The public and private key pairs of the requesting node are verified; the second verification sub-module is configured to verify the contract participants according to the signed data packets of the contract participants; the third verification sub-module is configured to query the blockchain ledger, Obtain the method name of each method corresponding to the contract deployment request and the parameter information corresponding to each method corresponding to the contract deployment request.
  • the parameter data package corresponding to the method is verified; the sub-module is determined, which is configured according to the key verification result of the contract file, the verification result of the contract participants, the method name data package of each method in the contract file and the method name in the contract file.
  • the verification result of the corresponding parameter data package determines whether the verification of the contract file is successful.
  • the blockchain ledger is generated using the following modules: a transaction verification module, configured to broadcast the transaction request to the blockchain in response to receiving a transaction request for contract deployment sent by the requesting node network, and verifies the transaction based on the transaction request message, wherein the transaction request message includes: the method data package of each method corresponding to the contract deployment request, the parameter data package corresponding to each method corresponding to the contract deployment request, and the data of the contract file.
  • a transaction verification module configured to broadcast the transaction request to the blockchain in response to receiving a transaction request for contract deployment sent by the requesting node network, and verifies the transaction based on the transaction request message, wherein the transaction request message includes: the method data package of each method corresponding to the contract deployment request, the parameter data package corresponding to each method corresponding to the contract deployment request, and the data of the contract file.
  • Hash value and the location information of the contract file the generation module is configured to respond to the transaction verification passing, according to the method data package of each method corresponding to the contract deployment request, the parameter data package and contract corresponding to each method corresponding to the contract deployment request
  • the hash value of the file and the location information of the contract file generate the block corresponding to the transaction request
  • the writing module is configured to write the block into the blockchain ledger based on the consensus mechanism, and generate the written blockchain ledger.
  • the obtaining unit is further configured to obtain a contract file corresponding to the position information of the contract file based on the position information of the contract file in the blockchain ledger.
  • the method name data packet in the content analysis module is generated by encrypting the method name based on the first encryption algorithm; and/or, the parameter data packet in the content analysis module is generated based on the second encryption algorithm.
  • the encryption algorithm encrypts the parameter and generates it.
  • the verification module is further configured to verify the contract file based on the ciphertext of the method name data package; and/or, based on the ciphertext of the parameter data package, to verify the contract file verify.
  • the apparatus further includes: a deployment unit configured to deploy the smart contract in the blockchain, so that when the service triggers the calling condition, the smart contract is executed.
  • the apparatus further includes: an end unit configured to end the contract deployment request in response to the contract file verification failure.
  • the present application further provides an electronic device and a readable storage medium.
  • FIG. 5 it is a block diagram of an electronic device of a data processing method based on a blockchain according to an embodiment of the present application.
  • Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
  • Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices.
  • the components shown herein, their connections and relationships, and their functions are by way of example only, and are not intended to limit implementations of the application described and/or claimed herein.
  • the electronic device includes: one or more processors 501, a memory 502, and interfaces for connecting various components, including a high-speed interface and a low-speed interface.
  • the various components are interconnected using different buses and may be mounted on a common motherboard or otherwise as desired.
  • the processor may process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface.
  • multiple processors and/or multiple buses may be used with multiple memories and multiple memories, if desired.
  • multiple electronic devices may be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system).
  • a processor 501 is taken as an example in FIG. 5 .
  • the memory 502 is the non-transitory computer-readable storage medium provided by the present application.
  • the memory stores instructions executable by at least one processor, so that the at least one processor executes the blockchain-based data processing method provided by the present application.
  • the non-transitory computer-readable storage medium of the present application stores computer instructions, and the computer instructions are used to cause the computer to execute the blockchain-based data processing method provided by the present application.
  • the memory 502 as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs and modules, such as program instructions/ modules (for example, the acquisition unit 401, the verification unit 402, and the determination unit 403 shown in FIG. 4).
  • the processor 501 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions and modules stored in the memory 502, that is, implementing the blockchain-based data processing method in the above method embodiments.
  • the memory 502 may include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function; data etc. Additionally, memory 502 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 502 may optionally include memory located remotely relative to processor 501 that may be connected to the blockchain-based data processing electronics via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • the electronic device based on the blockchain data processing method may further include: an input device 503 and an output device 504 .
  • the processor 501 , the memory 502 , the input device 503 and the output device 504 may be connected by a bus or in other ways, and the connection by a bus is taken as an example in FIG. 5 .
  • the input device 503 can receive input numerical or character information, and generate key signal input related to user settings and function control of the blockchain-based data processing electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, An input device such as a pointing stick, one or more mouse buttons, trackball, joystick, etc.
  • the output device 504 may include a display device, auxiliary lighting devices (eg, LEDs), haptic feedback devices (eg, vibration motors), and the like.
  • the display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
  • Various implementations of the systems and techniques described herein can be implemented in digital electronic circuitry, integrated circuit systems, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs executable and/or interpretable on a programmable system including at least one programmable processor that The processor, which may be a special purpose or general-purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device an output device.
  • the processor which may be a special purpose or general-purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device an output device.
  • machine-readable medium and “computer-readable medium” refer to any computer program product, apparatus, and/or apparatus for providing machine instructions and/or data to a programmable processor ( For example, magnetic disks, optical disks, memories, programmable logic devices (PLDs)), including machine-readable media that receive machine instructions as machine-readable signals.
  • machine-readable signal refers to any signal used to provide machine instructions and/or data to a programmable processor.
  • the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or trackball) through which a user can provide input to the computer.
  • a display device eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor
  • a keyboard and pointing device eg, a mouse or trackball
  • Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (eg, visual feedback, auditory feedback, or tactile feedback); and can be in any form (including acoustic input, voice input, or tactile input) to receive input from the user.
  • the systems and techniques described herein may be implemented on a computing system that includes back-end components (eg, as a data server), or a computing system that includes middleware components (eg, an application server), or a computing system that includes front-end components (eg, a user's computer having a graphical user interface or web browser through which a user may interact with implementations of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system.
  • the components of the system may be interconnected by any form or medium of digital data communication (eg, a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
  • a computer system can include clients and servers.
  • Clients and servers are generally remote from each other and usually interact through a communication network.
  • the relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other.
  • the technical solution according to the embodiment of the present application adopts, in response to receiving the contract deployment request sent by the requesting node in the blockchain network, to obtain the contract file corresponding to the contract deployment request, wherein the contract file is based on the content of the smart contract corresponding to the contract deployment request. It is generated by extension. Based on the analysis result of the contract file and the blockchain ledger, the contract file is verified. In response to the successful verification of the contract file, the smart contract corresponding to the contract deployment request is determined according to the contract file. (ELF file) file format that dynamically loads smart contract files to run new smart contracts without restarting the blockchain node. By extending the file type of the smart contract ELF file, the smart contract binary itself is safely controlled to achieve the purpose of safely dynamically loading smart contracts.
  • ELF file file format that dynamically loads smart contract files to run new smart contracts without restarting the blockchain node.
  • the blockchain ledger is generated by pre-executing the transaction of the contract deployment, which realizes that the smart contract method and parameters can be dynamically set, and restricts the implementation method and template of the smart contract, which has greater flexibility.
  • the verification is based on the verification of the key of the contract file, the content of the contract file and the signatures of the contract participants, which avoids the security risks and the possibility of key leakage caused by the introduction of a third-party key center in the existing technology, and ensures Non-repudiation and integrity of deployers and approvers of contracts.

Abstract

本申请公开了基于区块链的数据处理方法和装置,具体实现方案为:响应于接收到区块链网络中请求节点发送的合约部署请求,获取合约部署请求对应的合约文件,其中,合约文件基于对合约部署请求对应的智能合约进行内容扩展而生成,智能合约为区块链中可自动执行的业务代码;基于合约文件的解析结果和区块链账本,对合约文件进行验证,其中,验证用于表征对合约文件的密钥、合约文件的内容和合约参与方的签名进行验证,区块链账本通过预先执行合约部署的交易而生成;响应于合约文件验证成功,根据合约文件,确定与合约部署请求对应的智能合约。该方案实现了利用扩展智能合约文件的文件格式,动态加载智能合约文件。

Description

基于区块链的数据处理方法和装置
相关申请的交叉引用
本专利申请要求于2021年01月04日提交的、申请号为202110002609.2、发明名称为“基于区块链的数据处理方法和装置”的中国专利申请的优先权,该申请的全文以引用的方式并入本申请中。
技术领域
本申请的实施例涉及计算机技术领域,具体涉及区块链技术领域,尤其涉及基于区块链的数据处理方法和装置。
背景技术
区块链技术诞生于中本聪提出的比特币系统,其本质是一个共享数据库,具有去中心化、不可篡改、公开透明等优点。智能合约是1997年由Szabo提出的理念,在区块链系统中,智能合约是运行在区块链数据库上的一段可执行的具有逻辑顺序的计算机程序,可以满足其源代码中预定义的条件时自行执行。由于智能合约可以在无可信第三方的情况下自动执行的特性,其降低了互不信任的多个合约参与方之间的信任成本。
然而,目前在区块链系统中,修改智能合约代码,需要重新编译区块链节点代码并重新启动区块链服务,增加了运维人员的工作量,增大了系统出错的几率。
发明内容
本申请提供了一种基于区块链的数据处理方法、装置、设备以及存储介质。
根据本申请的第一方面,提供了一种基于区块链的数据处理方法,该方法包括:响应于接收到区块链网络中请求节点发送的合约部署请求,获取合约部署请求对应的合约文件,其中,合约文件基于对合约部署请求对 应的智能合约进行内容扩展而生成,智能合约为区块链中可自动执行的业务代码;基于合约文件的解析结果和区块链账本,对合约文件进行验证,其中,验证用于表征对合约文件的密钥、合约文件的内容和合约参与方的签名进行验证,区块链账本通过预先执行合约部署的交易而生成;响应于合约文件验证成功,根据合约文件,确定与合约部署请求对应的智能合约。
在一些实施例中,基于合约文件的解析结果和区块链账本,对合约文件进行验证,包括:对合约文件进行内容解析,得到合约文件中各方法的方法名数据包、与合约文件中各方法对应的参数数据包、合约参与方的签名数据包和合约文件的密钥包,其中,密钥包通过对请求节点进行加密运算而生成;基于合约文件中各方法的方法名数据包、与合约文件中各方法对应的参数数据包、合约参与方的签名数据包、合约文件的密钥包和区块链账本,对合约文件进行验证。
在一些实施例中,基于合约文件中各方法的方法名数据包、与合约文件中各方法对应的参数数据包、合约参与方的签名数据包、合约文件的密钥包和区块链账本,对合约文件进行验证,包括:根据合约文件的密钥包,对合约文件进行密钥验证,其中,验证用于表征对请求节点的公私钥对进行验证;根据合约参与方的签名数据包,对合约的参与方进行验证;查询区块链账本,得到合约部署请求对应的各方法的方法名和与合约部署请求对应的各方法对应的参数信息,并根据得到的方法名和参数信息,对合约文件中各方法的方法名数据包和与合约文件中各方法对应的参数数据包进行验证;根据合约文件的密钥验证结果、合约的参与方的验证结果、合约文件中各方法的方法名数据包和与合约文件中各方法对应的参数数据包的验证结果,确定合约文件是否验证成功。
在一些实施例中,区块链账本的生成过程如下:响应于接收到请求节点发送的合约部署的交易请求,广播交易请求至区块链网络,并基于交易请求报文对交易进行验证,其中,交易请求报文包括:合约部署请求对应的各方法的方法数据包、与合约部署请求对应的各方法对应的参数数据包、合约文件的哈希值和合约文件的位置信息;响应于交易验证通过,根据合约部署请求对应的各方法的方法数据包、与合约部署请求对应的各方法对 应的参数数据包、合约文件的哈希值和合约文件的位置信息,生成与交易请求对应的区块;基于共识机制,将区块写入区块链账本,生成写入后的区块链账本。
在一些实施例中,获取合约部署请求对应的合约文件,包括:基于区块链账本中合约文件的位置信息,获取与合约文件的位置信息对应的合约文件。
在一些实施例中,方法名数据包基于第一加密算法对方法名进行加密而生成;和/或,参数数据包基于第二加密算法对参数进行加密而生成。
在一些实施例中,基于合约文件中各方法的方法名数据包和与合约文件中各方法对应的参数数据包,对合约文件进行验证,包括:基于方法名数据包的密文,对合约文件进行验证;和/或,基于参数数据包的密文,对合约文件进行验证。
在一些实施例中,方法还包括:将智能合约部署于区块链中,以使当业务触发调用条件时,执行智能合约。
在一些实施例中,方法还包括:响应于合约文件验证失败,结束合约部署请求。
根据本申请的第二方面,提供了一种基于区块链的数据处理装置,装置包括:获取单元,被配置成响应于接收到区块链网络中请求节点发送的合约部署请求,获取合约部署请求对应的合约文件,其中,合约文件基于对合约部署请求对应的智能合约进行内容扩展而生成,智能合约为区块链中可自动执行的业务代码;验证单元,被配置成基于合约文件的解析结果和区块链账本,对合约文件进行验证,其中,验证用于表征对合约文件的密钥、合约文件的内容和合约参与方的签名进行验证,区块链账本通过预先执行合约部署的交易而生成;确定单元,被配置成响应于合约文件验证成功,根据合约文件,确定与合约部署请求对应的智能合约。
在一些实施例中,验证单元,包括:内容解析模块,被配置成对合约文件进行内容解析,得到合约文件中各方法的方法名数据包、与合约文件中各方法对应的参数数据包、合约参与方的签名数据包和合约文件的密钥包,其中,密钥包通过对请求节点进行加密运算而生成;验证模块,被配 置成基于合约文件中各方法的方法名数据包、与合约文件中各方法对应的参数数据包、合约参与方的签名数据包、合约文件的密钥包和区块链账本,对合约文件进行验证。
在一些实施例中,验证模块,包括:第一验证子模块,被配置成根据合约文件的密钥包,对合约文件进行密钥验证,其中,验证用于表征对请求节点的公私钥对进行验证;第二验证子模块,被配置成根据合约参与方的签名数据包,对合约的参与方进行验证;第三验证子模块,被配置成查询区块链账本,得到合约部署请求对应的各方法的方法名和与合约部署请求对应的各方法对应的参数信息,并根据得到的方法名和参数信息,对合约文件中各方法的方法名数据包和与合约文件中各方法对应的参数数据包进行验证;确定子模块,被配置成根据合约文件的密钥验证结果、合约的参与方的验证结果、合约文件中各方法的方法名数据包和与合约文件中各方法对应的参数数据包的验证结果,确定合约文件是否验证成功。
在一些实施例中,区块链账本利用如下模块生成:交易验证模块,被配置成响应于接收到请求节点发送的合约部署的交易请求,广播交易请求至区块链网络,并基于交易请求报文对交易进行验证,其中,交易请求报文包括:合约部署请求对应的各方法的方法数据包、与合约部署请求对应的各方法对应的参数数据包、合约文件的哈希值和合约文件的位置信息;生成模块,被配置成响应于交易验证通过,根据合约部署请求对应的各方法的方法数据包、与合约部署请求对应的各方法对应的参数数据包、合约文件的哈希值和合约文件的位置信息,生成与交易请求对应的区块;写入模块,被配置成基于共识机制,将区块写入区块链账本,生成写入后的区块链账本。
在一些实施例中,获取单元进一步被配置成基于区块链账本中合约文件的位置信息,获取与合约文件的位置信息对应的合约文件。
在一些实施例中,内容解析模块中的方法名数据包基于第一加密算法对方法名进行加密而生成;和/或,内容解析模块中的参数数据包基于第二加密算法对参数进行加密而生成。
在一些实施例中,验证模块进一步被配置成基于方法名数据包的密文, 对合约文件进行验证;和/或,基于参数数据包的密文,对合约文件进行验证。
在一些实施例中,装置还包括:部署单元,被配置成将智能合约部署于区块链中,以使当业务触发调用条件时,执行智能合约。
在一些实施例中,装置还包括:结束单元,被配置成响应于合约文件验证失败,结束合约部署请求。
根据本申请的第三方面,提供了一种电子设备,包括:至少一个处理器;以及与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行如第一方面中任一实现方式描述的方法。
根据本申请的第四方面,本申请提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其特征在于,计算机指令用于使计算机执行如第一方面中任一实现方式描述的方法。
应当理解,本部分所描述的内容并非旨在标识本申请的实施例的关键或重要特征,也不用于限制本申请的范围。本申请的其它特征将通过以下的说明书而变得容易理解。
附图说明
附图用于更好地理解本方案,不构成对本申请的限定。
图1是根据本申请的基于区块链的数据处理方法的第一实施例的示意图;
图2是可以实现本申请实施例的基于区块链的数据处理方法的场景图;
图3是根据本申请的基于区块链的数据处理方法的第二实施例的示意图;
图4是根据本申请的基于区块链的数据处理装置的一个实施例的结构示意图;
图5是用来实现本申请实施例的基于区块链的数据处理方法的电子设备的框图。
具体实施方式
以下结合附图对本申请的示范性实施例做出说明,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。
根据本申请的技术采用响应于接收到区块链网络中请求节点发送的合约部署请求,获取合约部署请求对应的合约文件,其中,合约文件基于对合约部署请求对应的智能合约进行内容扩展而生成,基于合约文件的解析结果和区块链账本,对合约文件进行验证,响应于合约文件验证成功,根据合约文件,确定与合约部署请求对应的智能合约,实现了通过扩展智能合约文件(ELF文件)的文件格式,动态加载智能合约文件,而无需重启区块链节点即可运行新的智能合约。通过扩展智能合约ELF文件的文件类型,对智能合约二进制本身进行了安全控制,达到安全的动态加载智能合约的目的。区块链账本通过预先执行合约部署的交易而生成,实现了智能合约方法和参数可以动态设置,而限制智能合约的实现方法和模板,具有更大的灵活性。验证基于对合约文件的密钥、合约文件的内容和合约参与方的签名进行验证,避免了现有技术中通过引入第三方密钥中心带来的安全风险和密钥泄漏的可能性,保证了合约的部署者和批准者的不可否认性和完整性。
图1示出了根据本申请的基于区块链的数据处理方法的第一实施例的示意图100。该基于区块链的数据处理方法,包括以下步骤:
步骤101,响应于接收到区块链网络中请求节点发送的合约部署请求,获取合约部署请求对应的合约文件。
在本实施例中,在区块链网络中,当执行主体(例如智能合约服务端)接收到请求节点发送的合约部署请求时,可以通过有线连接或无线连接的方式获取合约部署请求对应的合约文件。合约文件可以基于对合约部署请求对应的智能合约进行内容扩展而生成,合约文件的文件类型可以为智能 合约文件(ELF文件)扩展后的ELFext,智能合约为区块链中可自动执行的业务代码。需要指出的是,上述无线连接方式可以包括但不限于3G、4G、5G连接、WiFi连接、蓝牙连接、WiMAX连接、Zigbee连接、UWB(ultra wideband)连接、以及其他现在已知或将来开发的无线连接方式。
进一步说明,智能合约代码进行编译后,以ELF文件格式存在,当业务触发了调用条件的时候,自动执行ELF文件代码逻辑。为了保证ELF文件的不可篡改,以及体现区块链参与方对本合约的统一共识,需要在原ELF文件格式基础上添加自定义的属性,称为附加属性,附属属性包含以下内容:加密的方法名数据包、各方法对应的加密的参数数据包、合约参与方签名的签名数据包、合约文件的密钥包和智能合约密文包。对于方法名数据包,使用3DES算法的CBC模式对方法名进行加密运算。对于参数数据包,使用3DES算法的CBC模式对方法的参数进行加密。对于签名数据包,智能合约参与方对智能合约二进制文件使用各自私钥进行签名生成签名值列表。对于合约文件的密钥包,工作密钥为系统随机数,使用区块链节点公钥进行运算,还需要计算密钥的CRC32值,为后续使用进行校验。对于智能合约密文包,对智能合约的二进制流进行对称算法的加密运算,在智能合约流转过程中保证了智能合约的保密性。以上作为附加属性,写入到ELF文件的附加属性区域中,形成自定义的ELFext文件。
步骤102,基于合约文件的解析结果和区块链账本,对合约文件进行验证。
在本实施例中,执行主体可以对步骤101获得的合约文件进行解析,基于解析得到的结果和区块链账本中相应信息,对合约文件进行验证。验证可以表征对合约文件的密钥、合约文件的内容和合约参与方的签名进行验证,区块链账本通过预先执行合约部署的交易而生成。
在一些可选的实现方式中,区块链账本的生成过程如下:响应于接收到请求节点发送的合约部署的交易请求,广播交易请求至区块链网络,并基于交易请求报文对交易进行身份验证,其中,交易请求报文包括:合约部署请求对应的各方法的方法数据包、与合约部署请求对应的各方法对应的参数数据包、合约文件的哈希值和合约文件的位置信息;响应于交易验证通过,根据合约部署请求对应的各方法的方法数据包、与合约部署请求 对应的各方法对应的参数数据包、合约文件的哈希值和合约文件的位置信息,生成与交易请求对应的区块;基于共识机制,将区块写入区块链账本,生成写入后的区块链账本。通过对区块链账本进行更新,实现了智能合约方法和参数的动态设置和下发,使智能合约的实现具有更大的灵活性;智能合约经过了区块链共识方的确认,在后续的合约部署环节,以这个交易产生的区块链账本为基准,对动态合约的方法和参数以及摘要值进行验证,保证了动态合约的不可否认性和完整性。
步骤103,响应于合约文件验证成功,根据合约文件,确定与合约部署请求对应的智能合约。
在本实施例中,当执行主体确定合约文件验证成功后,可以对合约文件进行解析,得到合约文件中与合约部署请求对应的智能合约。
需要说明的是,上述区块链系统中智能合约的部署是目前广泛研究和应用的是公知技术,在此不再赘述。
继续参见图2,本实施例的基于区块链的数据处理方法200运行于服务平台201中。当服务平台201接收到区块链网络中请求节点发送的合约部署请求后,获取合约部署请求对应的合约文件202,然后服务平台201基于合约文件的解析结果和区块链账本,对合约文件进行验证203,最后当服务平台201确定合约文件验证成功后,根据合约文件,确定与合约部署请求对应的智能合约204。其中,合约文件基于对合约部署请求对应的智能合约进行内容扩展而生成,验证用于表征对合约文件的密钥、合约文件的内容和合约参与方的签名进行验证,区块链账本通过预先执行合约部署的交易而生成。
本申请的上述实施例提供的基于区块链的数据处理方法采用响应于接收到区块链网络中请求节点发送的合约部署请求,获取合约部署请求对应的合约文件,其中,合约文件基于对合约部署请求对应的智能合约进行内容扩展而生成,基于合约文件的解析结果和区块链账本,对合约文件进行验证,响应于合约文件验证成功,根据合约文件,确定与合约部署请求对应的智能合约,实现了通过扩展智能合约文件的文件格式,动态加载智能合约文件,而无需重启区块链节点即可运行新的智能合约。通过扩展智能合约文件的文件类型,对智能合约二进制本身进行了安全控制,达到安 全的动态加载智能合约的目的。区块链账本通过预先执行合约部署的交易而生成,实现了智能合约方法和参数可以动态设置,而限制智能合约的实现方法和模板,具有更大的灵活性。验证基于对合约文件的密钥、合约文件的内容和合约参与方的签名进行验证,避免了现有技术中通过引入第三方密钥中心带来的安全风险和密钥泄漏的可能性,保证了合约的部署者和批准者的不可否认性和完整性。
进一步参考图3,其示出了基于区块链的数据处理方法的第二实施例的示意图300。该方法的流程包括以下步骤:
步骤301,响应于接收到区块链网络中请求节点发送的合约部署请求,获取合约部署请求对应的合约文件。
在本实施例的一些可选的实现方式中,获取合约部署请求对应的合约文件,包括:基于区块链账本中合约文件的位置信息,获取与合约文件的位置信息对应的合约文件。实现准确快速地查询合约文件。
步骤302,对合约文件进行内容解析,得到合约文件中各方法的方法名数据包、与合约文件中各方法对应的参数数据包、合约参与方的签名数据包和合约文件的密钥包。
在本实施中,执行主体可以对合约文件进行内容解析,得到解析后的合约文件中各方法的方法名数据包、与合约文件中各方法对应的参数数据包、合约参与方的签名数据包和合约文件的密钥包。密钥包通过对请求节点进行加密运算而生成。
在本实施例的一些可选的实现方式中,方法名数据包基于第一加密算法对方法名进行加密而生成;和/或,参数数据包基于第二加密算法对参数进行加密而生成。第一加密算法和第二加密算法即可以相同也可以不同。通过对数据包进行加密,使得智能合约不易被篡改,增加了信息传输的安全性。
步骤303,基于合约文件中各方法的方法名数据包、与合约文件中各方法对应的参数数据包、合约参与方的签名数据包、合约文件的密钥包和区块链账本,对合约文件进行验证。
在本实施中,执行主体可以基于合约文件中各方法的方法名数据包、 与合约文件中各方法对应的参数数据包、合约参与方的签名数据包、合约文件的密钥包和区块链账本,利用预先设定的验证方法对合约文件进行验证。验证用于表征对合约文件的密钥、合约文件的内容和合约参与方的签名进行验证,区块链账本通过预先执行合约部署的交易而生成。
在本实施例的一些可选的实现方式中,基于合约文件中各方法的方法名数据包、与合约文件中各方法对应的参数数据包、合约参与方的签名数据包、合约文件的密钥包和区块链账本,对合约文件进行验证,包括:根据合约文件的密钥包,对合约文件进行密钥验证,其中,验证用于表征对请求节点的公私钥对进行验证;根据合约参与方的签名数据包,对合约的参与方进行验证;查询区块链账本,得到合约部署请求对应的各方法的方法名和与合约部署请求对应的各方法对应的参数信息,并根据得到的方法名和参数信息,对合约文件中各方法的方法名数据包和与合约文件中各方法对应的参数数据包进行验证;根据合约文件的密钥验证结果、合约的参与方的验证结果、合约文件中各方法的方法名数据包和与合约文件中各方法对应的参数数据包的验证结果,确定合约文件是否验证成功。经多方/多维度验证,更安全地保证了智能合约的不可否认性,完整性和保密性。
在本实施例的一些可选的实现方式中,基于合约文件中各方法的方法名数据包和与合约文件中各方法对应的参数数据包,对合约文件进行验证,包括:基于方法名数据包的密文,对合约文件进行验证;和/或,基于参数数据包的密文,对合约文件进行验证。进一步保证了智能合约的保密性。
在本实施例的一些可选的实现方式中,基于合约文件中各方法的方法名数据包和与合约文件中各方法对应的参数数据包,对合约文件进行验证,包括:基于合约文件中智能合约文件的密文,对合约文件进行验证。进一步保证了智能合约的保密性。
步骤304,响应于合约文件验证成功,根据合约文件,确定与合约部署请求对应的智能合约。
在本实施例的一些可选的实现方式中,方法还包括:将智能合约部署于区块链中。实现了智能合约的部署,以使当业务触发调用条件时,根据用户实际的调用参数,执行智能合约。
在本实施例的一些可选的实现方式中,方法还包括:响应于合约文件验证失败,结束合约部署请求。节省了系统资源,提高了系统处理效率。
在本实施例中,步骤301和304的具体操作与图1所示的实施例中的步骤101和103的操作基本相同,在此不再赘述。
从图3中可以看出,与图1对应的实施例相比,本实施例中的基于区块链的数据处理方法的示意图300采用对合约文件进行内容解析,得到合约文件中各方法的方法名数据包、与合约文件中各方法对应的参数数据包、合约参与方的签名数据包和合约文件的密钥包,其中,密钥包通过对请求节点进行加密运算而生成;基于合约文件中各方法的方法名数据包、与合约文件中各方法对应的参数数据包、合约参与方的签名数据包、合约文件的密钥包和区块链账本,对合约文件进行验证,通过对区块链节点进行身份验证和对合约文件的密文进行验证的双重验证,在保证了智能合约的不可否认性和完整性的同时,还保证了合约的保密性。
进一步参考图4,作为对上述图1~3所示方法的实现,本申请提供了一种基于区块链的数据处理装置的一个实施例,该装置实施例与图1所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。
如图4所示,本实施例的基于区块链的数据处理装置400包括:获取单元401、验证单元402和确定单元403,其中,获取单元,被配置成响应于接收到区块链网络中请求节点发送的合约部署请求,获取合约部署请求对应的合约文件,其中,合约文件基于对合约部署请求对应的智能合约进行内容扩展而生成,智能合约为区块链中可自动执行的业务代码;验证单元,被配置成基于合约文件的解析结果和区块链账本,对合约文件进行验证,其中,验证用于表征对合约文件的密钥、合约文件的内容和合约参与方的签名进行验证,区块链账本通过预先执行合约部署的交易而生成;确定单元,被配置成响应于合约文件验证成功,根据合约文件,确定与合约部署请求对应的智能合约。
在本实施例中,基于区块链的数据处理装置400的获取单元401、验证单元402和确定单元403的具体处理及其所带来的技术效果可分别参考图1对应的实施例中的步骤101到步骤103的相关说明,在此不再赘述。
在本实施例的一些可选的实现方式中,验证单元,包括:内容解析模块,被配置成对合约文件进行内容解析,得到合约文件中各方法的方法名数据包、与合约文件中各方法对应的参数数据包、合约参与方的签名数据包和合约文件的密钥包,其中,密钥包通过对请求节点进行加密运算而生成;验证模块,被配置成基于合约文件中各方法的方法名数据包、与合约文件中各方法对应的参数数据包、合约参与方的签名数据包、合约文件的密钥包和区块链账本,对合约文件进行验证。
在本实施例的一些可选的实现方式中,验证模块,包括:第一验证子模块,被配置成根据合约文件的密钥包,对合约文件进行密钥验证,其中,验证用于表征对请求节点的公私钥对进行验证;第二验证子模块,被配置成根据合约参与方的签名数据包,对合约的参与方进行验证;第三验证子模块,被配置成查询区块链账本,得到合约部署请求对应的各方法的方法名和与合约部署请求对应的各方法对应的参数信息,并根据得到的方法名和参数信息,对合约文件中各方法的方法名数据包和与合约文件中各方法对应的参数数据包进行验证;确定子模块,被配置成根据合约文件的密钥验证结果、合约的参与方的验证结果、合约文件中各方法的方法名数据包和与合约文件中各方法对应的参数数据包的验证结果,确定合约文件是否验证成功。
在本实施例的一些可选的实现方式中,区块链账本利用如下模块生成:交易验证模块,被配置成响应于接收到请求节点发送的合约部署的交易请求,广播交易请求至区块链网络,并基于交易请求报文对交易进行验证,其中,交易请求报文包括:合约部署请求对应的各方法的方法数据包、与合约部署请求对应的各方法对应的参数数据包、合约文件的哈希值和合约文件的位置信息;生成模块,被配置成响应于交易验证通过,根据合约部署请求对应的各方法的方法数据包、与合约部署请求对应的各方法对应的参数数据包、合约文件的哈希值和合约文件的位置信息,生成与交易请求对应的区块;写入模块,被配置成基于共识机制,将区块写入区块链账本,生成写入后的区块链账本。
在本实施例的一些可选的实现方式中,获取单元进一步被配置成基于 区块链账本中合约文件的位置信息,获取与合约文件的位置信息对应的合约文件。
在本实施例的一些可选的实现方式中,内容解析模块中的方法名数据包基于第一加密算法对方法名进行加密而生成;和/或,内容解析模块中的参数数据包基于第二加密算法对参数进行加密而生成。
在本实施例的一些可选的实现方式中,验证模块进一步被配置成基于方法名数据包的密文,对合约文件进行验证;和/或,基于参数数据包的密文,对合约文件进行验证。
在本实施例的一些可选的实现方式中,装置还包括:部署单元,被配置成将智能合约部署于区块链中,以使当业务触发调用条件时,执行智能合约。
在本实施例的一些可选的实现方式中,装置还包括:结束单元,被配置成响应于合约文件验证失败,结束合约部署请求。
根据本申请的实施例,本申请还提供了一种电子设备和一种可读存储介质。
如图5所示,是根据本申请实施例的基于区块链的数据处理方法的电子设备的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本申请的实现。
如图5所示,该电子设备包括:一个或多个处理器501、存储器502,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器 阵列、一组刀片式服务器、或者多处理器系统)。图5中以一个处理器501为例。
存储器502即为本申请所提供的非瞬时计算机可读存储介质。其中,存储器存储有可由至少一个处理器执行的指令,以使至少一个处理器执行本申请所提供的基于区块链的数据处理方法。本申请的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本申请所提供的基于区块链的数据处理方法。
存储器502作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本申请实施例中的基于区块链的数据处理方法对应的程序指令/模块(例如,附图4所示的获取单元401、验证单元402和确定单元403)。处理器501通过运行存储在存储器502中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的基于区块链的数据处理方法。
存储器502可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据基于区块链的数据处理电子设备的使用所创建的数据等。此外,存储器502可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器502可选包括相对于处理器501远程设置的存储器,这些远程存储器可以通过网络连接至基于区块链的数据处理电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
基于区块链的数据处理方法的电子设备还可以包括:输入装置503和输出装置504。处理器501、存储器502、输入装置503和输出装置504可以通过总线或者其他方式连接,图5中以通过总线连接为例。
输入装置503可接收输入的数字或字符信息,以及产生与基于区块链的数据处理电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置504可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。该显示设备 可以包括但不限于,液晶显示器(LCD)、发光二极管(LED)显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。
此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、专用ASIC(专用集成电路)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。
这些计算程序(也称作程序、软件、软件应用、或者代码)包括可编程处理器的机器指令,并且可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。如本文使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处 描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。
根据本申请实施例的技术方案采用响应于接收到区块链网络中请求节点发送的合约部署请求,获取合约部署请求对应的合约文件,其中,合约文件基于对合约部署请求对应的智能合约进行内容扩展而生成,基于合约文件的解析结果和区块链账本,对合约文件进行验证,响应于合约文件验证成功,根据合约文件,确定与合约部署请求对应的智能合约,实现了通过扩展智能合约文件(ELF文件)的文件格式,动态加载智能合约文件,而无需重启区块链节点即可运行新的智能合约。通过扩展智能合约ELF文件的文件类型,对智能合约二进制本身进行了安全控制,达到安全的动态加载智能合约的目的。区块链账本通过预先执行合约部署的交易而生成,实现了智能合约方法和参数可以动态设置,而限制智能合约的实现方法和模板,具有更大的灵活性。验证基于对合约文件的密钥、合约文件的内容和合约参与方的签名进行验证,避免了现有技术中通过引入第三方密钥中心带来的安全风险和密钥泄漏的可能性,保证了合约的部署者和批准者的不可否认性和完整性。
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本申请中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本申请公开的技术方案所期望的结果,本文在此不进行限制。
上述具体实施方式,并不构成对本申请保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本申请的精神和原则之内所作的修改、等同替换和改进等,均应包含在本申请保护范围之内。

Claims (20)

  1. 一种基于区块链的数据处理方法,所述方法包括:
    响应于接收到区块链网络中请求节点发送的合约部署请求,获取所述合约部署请求对应的合约文件,其中,所述合约文件基于对所述合约部署请求对应的智能合约进行内容扩展而生成,所述智能合约为所述区块链中可自动执行的业务代码;
    基于所述合约文件的解析结果和所述区块链账本,对所述合约文件进行验证,其中,所述验证用于表征对所述合约文件的密钥、所述合约文件的内容和所述合约参与方的签名进行验证,所述区块链账本通过预先执行所述合约部署的交易而生成;以及
    响应于所述合约文件验证成功,根据所述合约文件,确定与所述合约部署请求对应的智能合约。
  2. 根据权利要求1所述方法,其中,所述基于所述合约文件的解析结果和所述区块链账本,对所述合约文件进行验证,包括:
    对所述合约文件进行内容解析,得到所述合约文件中各方法的方法名数据包、与所述合约文件中各方法对应的参数数据包、所述合约参与方的签名数据包和所述合约文件的密钥包,其中,所述密钥包通过对所述请求节点进行加密运算而生成;以及
    基于所述合约文件中各方法的方法名数据包、与所述合约文件中各方法对应的参数数据包、所述合约参与方的签名数据包、所述合约文件的密钥包和所述区块链账本,对所述合约文件进行验证。
  3. 根据权利要求2所述方法,其中,所述基于所述合约文件中各方法的方法名数据包、与所述合约文件中各方法对应的参数数据包、所述合约参与方的签名数据包、所述合约文件的密钥包和所述区块链账本,对所述合约文件进行验证,包括:
    根据所述合约文件的密钥包,对所述合约文件进行密钥验证,其中,所述验证用于表征对所述请求节点的公私钥对进行验证;
    根据所述合约参与方的签名数据包,对所述合约的参与方进行验证;
    查询所述区块链账本,得到所述合约部署请求对应的各方法的方法名和与所述合约部署请求对应的各方法对应的参数信息,并根据得到的所述方法名和所述参数信息,对所述合约文件中各方法的方法名数据包和与所述合约文件中各方法对应的参数数据包进行验证;以及
    根据所述合约文件的密钥验证结果、所述合约的参与方的验证结果、所述合约文件中各方法的方法名数据包和与所述合约文件中各方法对应的参数数据包的验证结果,确定所述合约文件是否验证成功。
  4. 根据权利要求1所述方法,其中,所述区块链账本的生成过程如下:
    响应于接收到所述请求节点发送的所述合约部署的交易请求,广播所述交易请求至所述区块链网络,并基于所述交易请求报文对所述交易进行验证,其中,所述交易请求报文包括:所述合约部署请求对应的各方法的方法数据包、与所述合约部署请求对应的各方法对应的参数数据包、所述合约文件的哈希值和所述合约文件的位置信息;
    响应于所述交易验证通过,根据所述合约部署请求对应的各方法的方法数据包、与所述合约部署请求对应的各方法对应的参数数据包、所述合约文件的哈希值和所述合约文件的位置信息,生成与所述交易请求对应的区块;以及
    基于共识机制,将所述区块写入所述区块链账本,生成写入后的所述区块链账本。
  5. 根据权利要求4所述方法,其中,所述获取所述合约部署请求对应的合约文件,包括:
    基于所述区块链账本中所述合约文件的位置信息,获取与所述 合约文件的位置信息对应的合约文件。
  6. 根据权利要求2所述方法,其中,所述方法名数据包基于第一加密算法对所述方法名进行加密而生成;和/或,所述参数数据包基于第二加密算法对所述参数进行加密而生成。
  7. 根据权利要求6所述方法,其中,所述基于所述合约文件中各方法的方法名数据包和与所述合约文件中各方法对应的参数数据包,对所述合约文件进行验证,包括:
    基于所述方法名数据包的密文,对所述合约文件进行验证;和/或,基于所述参数数据包的密文,对所述合约文件进行验证。
  8. 根据权利要求1所述方法,还包括:
    将所述智能合约部署于所述区块链中,以使当业务触发调用条件时,执行所述智能合约。
  9. 根据权利要求1所述方法,还包括:
    响应于所述合约文件验证失败,结束所述合约部署请求。
  10. 一种基于区块链的数据处理装置,所述装置包括:
    获取单元,被配置成响应于接收到区块链网络中请求节点发送的合约部署请求,获取所述合约部署请求对应的合约文件,其中,所述合约文件基于对所述合约部署请求对应的智能合约进行内容扩展而生成,所述智能合约为所述区块链中可自动执行的业务代码;
    验证单元,被配置成基于所述合约文件的解析结果和所述区块链账本,对所述合约文件进行验证,其中,所述验证用于表征对所述合约文件的密钥、所述合约文件的内容和所述合约参与方的签名进行验证,所述区块链账本通过预先执行所述合约部署的交易而生成;以及
    确定单元,被配置成响应于所述合约文件验证成功,根据所述 合约文件,确定与所述合约部署请求对应的智能合约。
  11. 根据权利要求10所述装置,其中,所述验证单元,包括:
    内容解析模块,被配置成对所述合约文件进行内容解析,得到所述合约文件中各方法的方法名数据包、与所述合约文件中各方法对应的参数数据包、所述合约参与方的签名数据包和所述合约文件的密钥包,其中,所述密钥包通过对所述请求节点进行加密运算而生成;以及
    验证模块,被配置成基于所述合约文件中各方法的方法名数据包、与所述合约文件中各方法对应的参数数据包、所述合约参与方的签名数据包、所述合约文件的密钥包和所述区块链账本,对所述合约文件进行验证。
  12. 根据权利要求11所述装置,其中,所述验证模块,包括:
    第一验证子模块,被配置成根据所述合约文件的密钥包,对所述合约文件进行密钥验证,其中,所述验证用于表征对所述请求节点的公私钥对进行验证;
    第二验证子模块,被配置成根据所述合约参与方的签名数据包,对所述合约的参与方进行验证;
    第三验证子模块,被配置成查询所述区块链账本,得到所述合约部署请求对应的各方法的方法名和与所述合约部署请求对应的各方法对应的参数信息,并根据得到的所述方法名和所述参数信息,对所述合约文件中各方法的方法名数据包和与所述合约文件中各方法对应的参数数据包进行验证;以及
    确定子模块,被配置成根据所述合约文件的密钥验证结果、所述合约的参与方的验证结果、所述合约文件中各方法的方法名数据包和与所述合约文件中各方法对应的参数数据包的验证结果,确定所述合约文件是否验证成功。
  13. 根据权利要求10所述装置,其中,所述区块链账本利用如 下模块生成:
    交易验证模块,被配置成响应于接收到所述请求节点发送的所述合约部署的交易请求,广播所述交易请求至所述区块链网络,并基于所述交易请求报文对所述交易进行验证,其中,所述交易请求报文包括:所述合约部署请求对应的各方法的方法数据包、与所述合约部署请求对应的各方法对应的参数数据包、所述合约文件的哈希值和所述合约文件的位置信息;
    生成模块,被配置成响应于所述交易验证通过,根据所述合约部署请求对应的各方法的方法数据包、与所述合约部署请求对应的各方法对应的参数数据包、所述合约文件的哈希值和所述合约文件的位置信息,生成与所述交易请求对应的区块;以及
    写入模块,被配置成基于共识机制,将所述区块写入所述区块链账本,生成写入后的所述区块链账本。
  14. 根据权利要求13所述装置,其中,所述获取单元进一步被配置成基于所述区块链账本中所述合约文件的位置信息,获取与所述合约文件的位置信息对应的合约文件。
  15. 根据权利要求11所述装置,其中,所述内容解析模块中的所述方法名数据包基于第一加密算法对所述方法名进行加密而生成;和/或,所述内容解析模块中的所述参数数据包基于第二加密算法对所述参数进行加密而生成。
  16. 根据权利要求15所述装置,其中,所述验证模块进一步被配置成基于所述方法名数据包的密文,对所述合约文件进行验证;和/或,基于所述参数数据包的密文,对所述合约文件进行验证。
  17. 根据权利要求10所述装置,还包括:
    部署单元,被配置成将所述智能合约部署于所述区块链中,以使当业务触发调用条件时,执行所述智能合约。
  18. 根据权利要求10所述装置,还包括:
    结束单元,被配置成响应于所述合约文件验证失败,结束所述合约部署请求。
  19. 一种电子设备,其特征在于,包括:
    至少一个处理器;以及
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-9中任一项所述的方法。
  20. 一种存储有计算机指令的非瞬时计算机可读存储介质,其特征在于,所述计算机指令用于使所述计算机执行权利要求1-9中任一项所述的方法。
PCT/CN2021/140072 2021-01-04 2021-12-21 基于区块链的数据处理方法和装置 WO2022143298A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US18/266,217 US20230394483A1 (en) 2021-01-04 2021-12-21 Blockchain-based data processing method and apparatus
JP2023535744A JP2023552651A (ja) 2021-01-04 2021-12-21 ブロックチェーンに基づくデータ処理方法および装置

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110002609.2A CN112651741A (zh) 2021-01-04 2021-01-04 基于区块链的数据处理方法和装置
CN202110002609.2 2021-01-04

Publications (1)

Publication Number Publication Date
WO2022143298A1 true WO2022143298A1 (zh) 2022-07-07

Family

ID=75367414

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/140072 WO2022143298A1 (zh) 2021-01-04 2021-12-21 基于区块链的数据处理方法和装置

Country Status (4)

Country Link
US (1) US20230394483A1 (zh)
JP (1) JP2023552651A (zh)
CN (1) CN112651741A (zh)
WO (1) WO2022143298A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112651741A (zh) * 2021-01-04 2021-04-13 北京京东乾石科技有限公司 基于区块链的数据处理方法和装置
CN113472512A (zh) * 2021-06-10 2021-10-01 东软集团股份有限公司 智能合约执行方法、装置、存储介质及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108833398A (zh) * 2018-06-08 2018-11-16 浙江超脑时空科技有限公司 一种区块链智能合约更新方法、装置及设备
CN111221904A (zh) * 2019-12-23 2020-06-02 深圳壹账通智能科技有限公司 智能合约部署、执行方法、装置、电子设备及存储介质
CN111984271A (zh) * 2020-08-27 2020-11-24 北京海益同展信息科技有限公司 一种区块链应用程序处理方法、装置及区块链应用系统
WO2020249572A1 (en) * 2019-06-12 2020-12-17 NEC Laboratories Europe GmbH Method and contract rewriting framework system for supporting smart contracts in a blockchain network
CN112651741A (zh) * 2021-01-04 2021-04-13 北京京东乾石科技有限公司 基于区块链的数据处理方法和装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109493042A (zh) * 2018-10-24 2019-03-19 南京邮电大学 一种拥有访问控制功能的智能合约可信存证方法和系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108833398A (zh) * 2018-06-08 2018-11-16 浙江超脑时空科技有限公司 一种区块链智能合约更新方法、装置及设备
WO2020249572A1 (en) * 2019-06-12 2020-12-17 NEC Laboratories Europe GmbH Method and contract rewriting framework system for supporting smart contracts in a blockchain network
CN111221904A (zh) * 2019-12-23 2020-06-02 深圳壹账通智能科技有限公司 智能合约部署、执行方法、装置、电子设备及存储介质
CN111984271A (zh) * 2020-08-27 2020-11-24 北京海益同展信息科技有限公司 一种区块链应用程序处理方法、装置及区块链应用系统
CN112651741A (zh) * 2021-01-04 2021-04-13 北京京东乾石科技有限公司 基于区块链的数据处理方法和装置

Also Published As

Publication number Publication date
US20230394483A1 (en) 2023-12-07
CN112651741A (zh) 2021-04-13
JP2023552651A (ja) 2023-12-18

Similar Documents

Publication Publication Date Title
US11665000B2 (en) Method and apparatus for processing privacy data of block chain, device, and storage medium
TWI672648B (zh) 業務處理方法、裝置、資料共享系統及儲存介質
CN111460429B (zh) 基于可信执行环境的任务处理方法、装置、设备和介质
US20210218576A1 (en) Method, apparatus for blockchain-based multi-party computation, device and medium
JP7069286B2 (ja) プライバシーデータの処理方法、プライバシーデータの処理装置、機器及び媒体
RU2744827C2 (ru) Белые списки смарт-контрактов
WO2022143298A1 (zh) 基于区块链的数据处理方法和装置
CN111177107B (zh) 基于区块链的文件处理方法、装置、设备和存储介质
US9589153B2 (en) Securing integrity and consistency of a cloud storage service with efficient client operations
CN109951546B (zh) 基于智能合约的事务请求处理方法、装置、设备和介质
WO2022057275A1 (zh) 校验数据的方法、装置、设备和计算机可读介质
CN111464297B (zh) 基于区块链的事务处理方法、装置、电子设备和介质
US20220021529A1 (en) Key protection processing method, apparatus, device and storage medium
CN109918191B (zh) 一种业务请求防频的方法和装置
US20210409206A1 (en) Trusted environment remote verification method and apparatus, device, system, and medium
CN111339569B (zh) 区块链数据处理方法、装置、电子设备和介质
US11789929B2 (en) Method, apparatus, device and medium for performing review based on blockchain
US11640450B2 (en) Authentication using features extracted based on cursor locations
US20210312017A1 (en) Method, apparatus and electronic device for processing user request and storage medium
CN111782254A (zh) 用于升级对象的方法、装置、设备以及存储介质
WO2022142436A1 (zh) 基于区块链的数据处理方法、装置、设备及存储介质
CN114363088B (zh) 用于请求数据的方法和装置
CN111737534B (zh) 文件处理方法、装置及设备
CN111400743A (zh) 基于区块链网络的事务处理方法、装置、电子设备和介质
WO2023169193A1 (zh) 用于生成智能合约的方法和装置

Legal Events

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

Ref document number: 21914037

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2023535744

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

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

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