WO2020082894A1 - 基于区块链的数据存证、获取方法和装置 - Google Patents

基于区块链的数据存证、获取方法和装置 Download PDF

Info

Publication number
WO2020082894A1
WO2020082894A1 PCT/CN2019/103270 CN2019103270W WO2020082894A1 WO 2020082894 A1 WO2020082894 A1 WO 2020082894A1 CN 2019103270 W CN2019103270 W CN 2019103270W WO 2020082894 A1 WO2020082894 A1 WO 2020082894A1
Authority
WO
WIPO (PCT)
Prior art keywords
smart contract
target
data
target event
blockchain
Prior art date
Application number
PCT/CN2019/103270
Other languages
English (en)
French (fr)
Inventor
林立
闫莺
宋旭阳
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2020082894A1 publication Critical patent/WO2020082894A1/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/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/405Establishing or using transaction specific rules
    • 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/389Keeping log of transactions for guaranteeing non-repudiation of a transaction

Definitions

  • This specification relates to the field of data processing technology, and in particular, to a blockchain-based data storage and acquisition method and device.
  • Blockchain technology also known as distributed ledger technology, is an emerging technology in which several computing devices jointly participate in "bookkeeping" and jointly maintain a complete distributed database.
  • Blockchain technology has the characteristics of decentralization, openness and transparency, each computing device can participate in database records, and data synchronization can be quickly performed between computing devices, making blockchain technology widely used in many fields. To apply.
  • this specification provides a blockchain-based event certificate storage method, which is applied to the blockchain including the node device of the depositor; the blockchain is deployed on the There are smart contracts for data storage and reading; the methods include:
  • the depositor node device sends a first target transaction to the blockchain, where the first target transaction includes target event data to be stored;
  • the target data further includes a digital signature made by a target event related party, so that the acquirer node device can verify the target event data based on the digital signature;
  • the generating at least a certificate identification image based on the identification of the smart contract includes:
  • a certificate identification image is generated based at least on the identification of the smart contract and the identification name of the target event related party.
  • the generation of the certificate identification image based at least on the identification of the smart contract includes:
  • the stored digital codes are sequentially generated to generate color blocks with a preset pattern.
  • the method further includes:
  • the generating at least a certificate identification image based on the identification of the smart contract includes:
  • a certificate identification image is generated based at least on the identification of the smart contract and the mapping code.
  • the method further includes:
  • Invoking the smart contract executing the logic set by the smart contract to set the user's data acquisition authority, and setting the target user's authority to acquire the target event data.
  • the method further includes:
  • This specification also provides a blockchain-based event acquisition method, which is applied to a blockchain that includes a depositor node device and an acquirer node device; the blockchain has deployed intelligence that has stored target event data Contract; the method includes:
  • the acquiring node device recognizes the certificate identification image provided by the certificate depositor node device to at least acquire the identification of the smart contract; wherein, the certificate identification image is generated based at least on the identification of the smart contract;
  • the target event data further includes a digital signature made by a party related to the target event
  • the method also includes:
  • the target data is verified based on the digital signature.
  • the identification of the certificate identification image to obtain at least the identification of the smart contract includes:
  • the certificate identification image is generated based at least on the identification of the smart contract and the mapping code assigned by the smart contract to the target event data;
  • the recognizing the certificate storage identification image to obtain at least the identification of the smart contract includes: identifying the certificate storage identification image to obtain at least the identification of the smart contract and the mapping code;
  • the second target transaction also includes the mapping code.
  • the smart contract sets the acquiring party to acquire the target event data;
  • the data acquiring logic that executes the smart contract declaration acquires the target event data ,include:
  • the data acquisition logic declared by the smart contract is executed based on the acquisition authority of the acquirer on the target data.
  • this specification also provides a blockchain-based event certificate storage device, which is applied to the blockchain including the node device of the depositor; the blockchain is equipped with intelligence for data storage and reading Contract; the device includes:
  • a sending unit the certificate depositor node device sends a first target transaction to the blockchain, the first target transaction includes target event data to be stored;
  • the smart contract execution unit calls the smart contract, executes the data storage logic declared by the smart contract, and stores the target event data to the smart contract;
  • the image generating unit generates a certificate storage logo image based at least on the logo of the smart contract.
  • the target data further includes a digital signature made by a target event related party, so that the acquirer node device can verify the target event data based on the digital signature;
  • the image generating unit :
  • a certificate identification image is generated based at least on the identification of the smart contract and the identification name of the target event related party.
  • the image generating unit :
  • the stored digital codes are sequentially generated to generate color blocks with a preset pattern.
  • the device further includes:
  • the receiving unit receives the mapping code allocated by the smart contract to the target event data
  • the image generating unit :
  • a certificate identification image is generated based at least on the identification of the smart contract and the mapping code.
  • the sending unit :
  • the smart contract execution unit invokes the smart contract, executes the logic set by the smart contract to set the user's data acquisition authority, and sets the target user's authority to acquire the target event data.
  • the apparatus further includes a receiving unit: receiving a notification message that the acquiring node device sent by the smart contract acquires the target data.
  • this specification also provides a blockchain-based event acquisition device, which is applied to a blockchain including a depositor node device and an acquirer node device; a stored target event is deployed on the blockchain Smart contract for data; the device includes:
  • the certificate depositor node device recognizes the certificate deposit identification image provided by the certificate depositor node device to obtain at least the identification of the smart contract; wherein the certificate deposit identification image is based at least on the smart contract Logo generation;
  • the sending unit sends a second target transaction to the blockchain, where the second target transaction includes the identifier of the smart contract;
  • the smart contract execution unit calls the smart contract, executes the data acquisition logic declared by the smart contract, and acquires the target event data.
  • the target event data further includes a digital signature made by a party related to the target event
  • the device also includes:
  • the data verification unit verifies the target data based on the digital signature.
  • the image recognition unit :
  • the certificate identification image is generated based at least on the identification of the smart contract and the mapping code assigned by the smart contract to the target event data;
  • the image recognition unit recognize the certificate identification image to obtain at least the identification of the smart contract and the mapping code;
  • the second target transaction also includes the mapping code.
  • the smart contract sets the acquirer to obtain the right to acquire the target event data; the smart contract execution unit:
  • the data acquisition logic declared by the smart contract is executed based on the acquisition authority of the acquirer on the target data.
  • This specification also provides a computer device, including: a memory and a processor; a computer program executable by the processor is stored on the memory; when the processor runs the computer program, the above blockchain-based event is executed The steps described in the certificate deposit method.
  • This specification also provides a computer device, including: a memory and a processor; a computer program executable by the processor is stored on the memory; when the processor runs the computer program, the above blockchain-based event is executed Obtain the steps described in the method.
  • the data certification and acquisition method and device based on the blockchain provided in this specification a smart contract for data storage and reading is deployed on the blockchain, and the smart contract can execute data Store or read.
  • the target data stored by the depository user in the smart contract is decentralized and recorded in all nodes, which are jointly maintained by the nodes of all participants; based on the blockchain In the consensus mechanism, the data information provided by each user of the depositor will not be tampered after being provided, thus achieving the effect of depositing the target data.
  • the certificate depositor generates the certificate identification image at least based on the identification of the smart contract, so that the acquirer can identify the certificate identification image through the image to obtain the identification of the smart contract, and then call the smart contract to obtain the target data.
  • the smart contract can complete the deposit or acquisition of the target data at any time according to the user's call, which greatly improves the efficiency of the deposit or acquisition of the target data; and the smart contract execution has low human intervention and decentralized authority. Advantages, increase the fairness of data storage and access behavior.
  • FIG. 1 is a flowchart of a blockchain-based data certification and acquisition method provided by an exemplary embodiment of the present specification
  • FIG. 2 is a schematic diagram of a certificate identification image provided by another embodiment of this specification.
  • FIG. 3 is a schematic diagram of a blockchain-based data certification device provided by an exemplary embodiment of the present specification
  • FIG. 4 is a schematic diagram of a blockchain-based data acquisition device provided by an exemplary embodiment of the present specification
  • FIG. 5 is a hardware structure diagram of an embodiment of a blockchain-based data certification or verification device provided by an exemplary embodiment of this specification.
  • the steps of the corresponding method are not necessarily performed in the order shown and described in this specification.
  • the method may include more or fewer steps than described in this specification.
  • the single step described in this specification may be decomposed into multiple steps for description in other embodiments; and the multiple steps described in this specification may also be combined into a single step in other embodiments description.
  • an exemplary embodiment of this specification provides a blockchain-based target event deposit and acquisition method, which is applied to a blockchain including a depositor node device and an acquirer node device, Smart contracts for data storage and reading are deployed on the blockchain.
  • the blockchain described in this embodiment may specifically refer to a P2P network system with a distributed data storage structure reached by each node device through a consensus mechanism, and the data in the blockchain is distributed one after another in time.
  • the latter block contains the data summary of the previous block, and according to the specific consensus mechanism (such as POW, POS, DPOS or PBFT, etc.), all or part of the data of the node device is reached Full backup.
  • the specific consensus mechanism such as POW, POS, DPOS or PBFT, etc.
  • the blockchain using Pow consensus requires at least a full Only an attack of 51% of the network's computing power can tamper with the existing data. Therefore, the blockchain system has the characteristics of ensuring data security and preventing attack and tampering comparable to other centralized database systems.
  • node devices described in this specification can include not only full-node devices that back up the full amount of data in the distributed database of the blockchain, but also part of the data in the distributed database that backs up the blockchain
  • the light-node devices, as well as other terminal devices or clients, are not limited in this specification.
  • the smart contract deployed on the blockchain is an executable computer programming language that is verified by the consensus of the node devices of the blockchain to be saved to the distributed database of the blockchain; any node device on the blockchain can receive the area
  • the user of the block chain calls the smart contract to execute the logic of the smart contract declaration; the above execution result can also be saved to the distributed database of the block chain after being verified by the node device consensus of the block chain.
  • a smart contract with data storage and reading is deployed on the blockchain.
  • the user can call the smart contract's interface and corresponding functions by sending transactions to the smart contract's account address or other identifiers.
  • the operation of storing data in the smart contract or reading data already stored in the smart contract is completed.
  • the blockchain-based data certification method provided in this embodiment includes:
  • Step 102 The depositor node device sends a first target transaction to the blockchain, where the first target transaction includes target event data to be stored.
  • the transaction described in this specification refers to a piece of data that a user creates through a node device of the blockchain and needs to be finally released to the distributed database of the blockchain.
  • a narrowly defined transaction refers to a value transfer issued by the user to the blockchain; for example, in the traditional Bitcoin blockchain network, the transaction can be a transfer initiated by the user in the blockchain.
  • the broad sense of transactions refers to an arbitrary piece of data released by users to the blockchain.
  • the first target transaction described in this embodiment includes target event data to be stored.
  • the target event data may include data describing a process in which all or part of the event occurs, or data describing the characteristic values of the event, etc., which may be specific It is expressed in various forms such as contracts, notices, instructions, business profiles, orders, etc., and is not limited in this instruction.
  • the target event data may be encrypted and the first target transaction containing the target event data ciphertext may be sent to the blockchain .
  • the certificate depositor described in this embodiment may be the above-mentioned target event related party or one of the target event related parties, or may not belong to the above target event related party, but as a neutral party or event
  • the certificate depository shall execute the event certificate depositing method described in the embodiments of this specification.
  • the target event data further includes a digital signature made by the relevant party of the target event, for example, a digital signature made by the signing party of the contract on the body of the contract, and a signature issued by the notice issuer on the body of the notice.
  • Digital signatures digital signatures, digital signatures made by the specification writer on the body of the specification, digital signatures made by the ordering party on the content of the order, digital signatures made by the sender of the email on the content of the body of the email, etc. Similar to the signature in actual business, the above digital signature can be expressed as the identification of the target event data by the target event related party, such as the digital signature made by the contract signing party on the electronic contract.
  • Digital signature is the mathematical encryption that the signer performs on the mathematical summary of the data content recognized by the signer based on his own private key; by verifying the digital signature, not only can the identity of the signer ’s public key be verified, but also the private key
  • the encrypted mathematical abstract is compared with the mathematical abstract obtained from the existing data content to verify whether the existing data content is consistent with the data content signed by the signer, thereby knowing whether the existing data content has been tampered with. Therefore, in this embodiment, by verifying the above digital signature, the acquirer of the target event data is generally available to verify whether the identity of the signer of the target event data and the content of the target event data have been tampered with.
  • the first target transaction can be included in the distributed database of the blockchain; any node device in the blockchain , Including the depositor node device, can receive the first target transaction sent by the depositor node device to the blockchain to call the above based on the address of the smart contract in the first target transaction Smart contract.
  • Step 104 Call the smart contract, execute the data storage logic declared by the smart contract, and store the target event data in the smart contract.
  • the process of storing the target event data in the smart contract described above can also be regarded as the process of updating the smart contract in the distributed database of the blockchain.
  • the storing of the target event data in the smart contract includes:
  • a node with accounting authority in the blockchain adds the smart contract code that stores the target event data to the candidate block
  • the consensus accounting node broadcasts the candidate block to the nodes of the blockchain
  • the candidate block After the candidate block passes the verification and approval of the predetermined number of nodes of the blockchain, the candidate block is regarded as the latest block and is added to the distributed database of the blockchain.
  • the node with accounting authority refers to a node with authority to generate candidate blocks, which may include the depositor node device, the acquirer node device and other nodes in the blockchain described in this specification device.
  • a consensus accounting node can be determined from the nodes that have accounting authority for the candidate block.
  • the consensus mechanism may include a proof of work mechanism (PoW) or a proof of rights mechanism ( PoS), or share authorization certification mechanism (DPoS), or PBFT algorithm mechanism, etc.
  • the above target event data is stored in the smart contract, that is, stored in the distributed database of the blockchain, thereby completing the blockchain certificate storage of the above target event data.
  • the smart contract can decrypt the ciphertext and verify the original text of the target event data in the smart contract; or directly deposit the target
  • the ciphertext of event data is not limited in this manual.
  • the depositor node device may also perform step 106: at least generate a certificate identification image based on the identifier of the smart contract for other users
  • the identification of the smart contract is obtained based on image recognition, so that the smart contract is called in the above-mentioned blockchain, the data acquisition logic declared by the smart contract is executed, and the target event data is obtained.
  • the identifier of the smart contract may generally include an address of the smart contract, or an account name of the smart contract, or a digital summary value of the smart contract, etc., which can uniquely identify the identifier of the smart contract.
  • the node device when the target data further includes a digital signature made by the target event related party, to facilitate the acquisition of the target event data, the node device, after acquiring the target event data, is based on the digital The signature verifies the target event data-for example, to verify the identity of the target event related party, or to verify whether the target event data stored on the blockchain is consistent with the target event data signed by the digital signature of the target event related party.
  • the certificate identification image can be generated based on the identification of the above-mentioned smart contract and the identity name of the relevant party of the target event.
  • the identification image of the identification of the identification of the smart contract or the identification name of the target event-related party can usually be digitally imaged using a two-dimensional code or barcode, and the image of the smart contract can be easily obtained by scanning the image.
  • the identification or / and the identity name of the relevant party of the target event which is used to obtain or / and verify the target event data; however, the above-mentioned certified identification image in the form of two-dimensional code or bar code usually cannot intuitively reflect the data information it represents.
  • FIG. 2 illustrates a certificate identification image provided by an exemplary embodiment of the present specification.
  • the certificate identification image is a picture (including color) generated based at least on the identification of the smart contract.
  • the identifier of the smart contract is encoded to generate a certificate-preserving digital code
  • the certificate-preserving digital code is sequentially generated to generate color blocks of corresponding colors according to a preset mapping relationship between the code and the color.
  • the color block may be a pattern with a fixed pattern, such as flowers shown in FIG. 2, and the color pictures may be generated in the order in which the color blocks are generated (the order of petals 1 to 8 shown in FIG. 2).
  • the identity name of the target event related party may be presented together with the above color picture in the form of a handwritten signature, as shown in the handwritten signature “Lin Li” in FIG. 2 ( The reference number is 9).
  • the color image shown in FIG. 1 Compared with the above-mentioned certificate identification image presented in the form of a two-dimensional code or bar code, the color image shown in FIG.
  • handwriting signature means that the user of the acquiring party can observe the handwriting Signature, directly obtain the identity name of the target event related party to be obtained or to be verified, which has better intuitiveness, and can also identify the above-mentioned handwritten signature through image recognition to obtain the user name of the event related party; compared with the barcode or the two
  • the image style of the dimension code, the color pattern shown in Figure 2 also has better aesthetics.
  • the smart contract for data storage and reading described in the above embodiments can be used to deposit evidence for a specified target business event, or for multiple target business events; it can be multiple records for a target event.
  • the target event data can be used as evidence, and the target event data of multiple target events can also be used as evidence.
  • the above smart contract can also allocate a corresponding mapping code to the target event data for The acquirer of the target event data may obtain the corresponding target event data based on the mapping code.
  • the mapping code may include the serial number assigned by the smart contract to the target event data, or may include the identification number assigned by the smart contract to the name of the related party of the target event data, and so on.
  • the above-mentioned generation of the certificate identification image based at least on the identification of the smart contract should also include: generation of the certificate identification image based on at least the identification of the smart contract and the mapping code.
  • the above smart contract can also be different blockchain users Set its access rights to the above target event data.
  • the above access rights may include: no target event data can be obtained, some preset target event data can be obtained, and all target event data can be obtained. Set for specific scenes.
  • the setting of the above-mentioned permission to obtain target event data can be set by the deployer of the smart contract before the deployment of the smart contract is launched, or by an administrator user with permission settings after the deployment of the smart contract, and It can be set by the depositor of the target event according to the specific target event.
  • the process of setting the target user's data acquisition authority by the depositor of the target event includes: any node device (including the depositor node device) in the blockchain receives the The data storage authority transaction of the target user sent to the blockchain by the depository node device, the data acquisition authority transaction is used to set the target user's access authority to the target event data; call the smart contract , Execute the logic set by the smart contract to set the user's data acquisition authority, and set the target user's authority to acquire the target event data.
  • the smart contract also declares the notification message notification logic to send a notification message to the depositor of the target event data about the acquirer node device acquiring the target event data; accordingly, the depositor node device can receive the smart The notification message sent by the contract about the acquiring node device acquiring the target event data.
  • One or more of the above embodiments describe one or more blockchain-based event deposit methods. After the depositor node device completes the deposit of the target event data, the depositor can identify the above deposits The image is sent to any blockchain node device that needs to obtain or verify the above target event data, so that the above node device as the acquiring node device can obtain the above target event data. As shown in Figure 1, the process of obtaining the above target event data may include:
  • Step 108 The acquirer node device recognizes the certificate identification image provided by the certificate provider node device to at least obtain the identification of the smart contract; wherein, the certificate identification image is based at least on the identification of the smart contract generate;
  • Step 110 Send a second target transaction to the blockchain, where the second target transaction includes the identifier of the smart contract;
  • Step 112 Call the smart contract, execute the data acquisition logic declared by the smart contract, and obtain the target event data.
  • the above target event data may include data describing the process in which all or part of the target event occurs, or data describing the characteristic values of the target event, etc., which may be embodied as contracts, notices, specifications, business profiles, orders Various forms such as these are not limited in this specification.
  • the target event data further includes a digital signature made by the relevant party of the target event, for example, a digital signature made by the signing party of the contract on the body of the contract, and a signature issued by the notice issuer on the body of the notice.
  • Digital signatures digital signatures, digital signatures made by the specification writer on the body of the specification, digital signatures made by the ordering party on the content of the order, digital signatures made by the sender of the email on the content of the body of the email, etc. Similar to the signature in actual business, the above digital signature can be expressed as the identification of the target event data by the target event related party, such as the digital signature made by the contract signing party on the electronic contract.
  • the above-mentioned blockchain-based event acquisition method further includes: verifying the target data based on the digital signature.
  • Digital signature is the mathematical encryption that the signer performs on the mathematical summary of the data content recognized by the signer based on his private key; by verifying the digital signature, not only can the signer ’s public key be obtained, and then the above public key is provided to the identity certification authority Identity authentication, so as to know the identity corresponding to the signer's public key, and can also verify whether the existing data content is signed with the signer by comparing the mathematical digest encrypted by the above private key with the mathematical digest obtained from the existing data content Whether the content of the data is consistent, so as to know whether the existing data content has been tampered with. Therefore, in this embodiment, by verifying the above digital signature, the acquirer of the target event data is generally available to verify whether the identity of the signer of the target event data and the content of the target event data have been tampered with.
  • the node device when the target data further includes a digital signature made by the target event related party, to facilitate the acquisition of the target event data, the node device, after acquiring the target event data, is based on the digital The signature verifies the target event data-for example, to verify the identity of the target event related party, or to verify whether the target event data stored on the blockchain is consistent with the target event data signed by the digital signature of the target event related party.
  • the certificate identification image can be generated based on the identification of the above-mentioned smart contract and the identity name of the relevant party of the target event.
  • the identification image of the identification of the identification of the smart contract or the identification name of the target event-related party can usually be digitally imaged using a two-dimensional code or barcode, and the image of the smart contract can be easily obtained by scanning the image.
  • the identification or / and the identity name of the relevant party of the target event which is used to obtain or / and verify the target event data; however, the above-mentioned certified identification image in the form of two-dimensional code or bar code usually cannot intuitively reflect the data information it represents.
  • FIG. 2 illustrates a certificate identification image provided by an exemplary embodiment of the present specification.
  • the certificate identification image is a picture (including color) generated based at least on the identification of the smart contract.
  • the identifier of the smart contract is encoded to generate a certificate-preserving digital code
  • the certificate-preserving digital code is sequentially generated to generate color blocks of corresponding colors according to a preset mapping relationship between the code and the color.
  • the color block may be a pattern with a fixed pattern, such as flowers shown in FIG. 2, and a color picture may be generated in the order in which the color blocks are generated (the order of petals 1 to 8 shown in FIG. 2).
  • the acquiring party can scan the color picture through the image recognition terminal, and recognize the color of the color block with a preset pattern according to the generation order of the color blocks (the order of petals 1 to 8 shown in FIG. 2); according to the preset Mapping relationship between the digital encoding and the color, decoding the color of the color block to obtain the certificated digital encoding; according to the preset decoding rules, decoding the certificated digital encoding to obtain at least the identification of the smart contract .
  • the identity name of the target event related party may be presented together with the above color picture in the form of a handwritten signature, as shown in the handwritten signature “Lin Li” in FIG. 2 ( The reference number is 9).
  • the color image shown in FIG. 1 Compared with the above-mentioned certificate identification image presented in the form of a two-dimensional code or bar code, the color image shown in FIG.
  • handwriting signature means that the user of the acquiring party can observe the handwriting Signature, directly obtain the identity name of the target event related party to be obtained or to be verified, which has better intuitiveness, and can also identify the above-mentioned handwritten signature through image recognition to obtain the user name of the event related party; compared with the barcode or the two
  • the image style of the dimension code, the color pattern shown in Figure 2 also has better aesthetics.
  • the smart contract for data storage and reading described in the above embodiments can be used to deposit evidence for a specified target business event, or for multiple target business events; it can be multiple records for a target event.
  • the target event data can be used as evidence, and the target event data of multiple target events can also be used as evidence.
  • the above smart contract can also allocate a corresponding mapping code to the target event data for The acquirer of the target event data may obtain the corresponding target event data based on the mapping code.
  • the mapping code may include the serial number assigned by the smart contract to the target event data, or may include the identification number assigned by the smart contract to the name of the related party of the target event data, and so on.
  • the above-mentioned generation of the certificate identification image based at least on the identification of the smart contract should also include: generation of the certificate identification image based on at least the identification of the smart contract and the mapping code.
  • the acquirer node device recognizes the certificate identification image
  • the identifier of the smart contract and the mapping code can be obtained, and the identifier of the smart contract and the mapping code are placed together in the second target transaction to call
  • the above smart contract obtains corresponding target event data based on the above mapping code.
  • the above smart contract can also be different blockchain users Set its access rights to the above target event data.
  • the above access rights may include: no target event data can be obtained, some preset target event data can be obtained, and all target event data can be obtained. Set for specific scenes.
  • the setting of the above-mentioned permission to obtain target event data can be set by the deployer of the smart contract before the deployment of the smart contract is launched, or by an administrator user with permission settings after the deployment of the smart contract It can be set by the depositor of the target event according to the specific target event.
  • the data acquisition logic that executes the smart contract declaration to acquire the target data includes: acquiring the acquirer's authority to acquire the target data; based on the acquirer's authority to acquire the target data To execute the data acquisition logic declared by the smart contract.
  • the setting of the data acquiring authority of the acquiring party may be implemented by setting a user whitelist, a user blacklist, a user authority setting table, and other technical means, which will not be repeated here.
  • the embodiments of the present specification also provide a blockchain-based event certificate storage device and a blockchain-based event acquisition.
  • the device can be implemented by software, or by hardware or a combination of hardware and software. Taking software implementation as an example, as a logical device, it is formed by reading the corresponding computer program instructions into the memory through the CPU (Central Processing Unit) of the device. From a hardware perspective, in addition to the CPU, memory, and storage shown in FIG. 5, the device where the network risk service implementation device is located usually also includes other hardware such as chips for wireless signal transmission and reception, and / or for implementation Network communication function boards and other hardware.
  • CPU Central Processing Unit
  • this specification also provides a blockchain-based event certificate storage device 30, which is applied to a blockchain including a node device of a depositor; the blockchain is deployed for data storage and Read smart contract; the device 30 includes:
  • the depositor node device sends a first target transaction to the blockchain, the first target transaction includes target event data to be stored;
  • the smart contract execution unit 304 calls the smart contract, executes the data storage logic declared by the smart contract, and stores the target event data to the smart contract;
  • the image generating unit 306 generates a certificate storage identification image based at least on the identification of the smart contract.
  • the target event data further includes a digital signature made by the target event related party for the acquirer node device to verify the target event data based on the digital signature;
  • the image generating unit 306 The image generating unit 306:
  • a certificate identification image is generated based at least on the identification of the smart contract and the identification name of the target event related party.
  • the image generating unit 306 :
  • the stored digital codes are sequentially generated to generate color blocks with a preset pattern.
  • the device 30 further includes:
  • the receiving unit 308 receives the mapping code allocated by the smart contract to the target event data
  • the image generating unit 306 The image generating unit 306:
  • a certificate identification image is generated based at least on the identification of the smart contract and the mapping code.
  • the sending unit 302 is a first sending unit 302:
  • the smart contract execution unit 304 invokes the smart contract, executes the logic set by the smart contract to set the user's data acquisition authority, and sets the target user's authority to acquire the target event data.
  • the apparatus 30 further includes a receiving unit 310: receiving a notification message that the acquiring node device sent by the smart contract acquires the target data.
  • this specification also provides a blockchain-based event acquisition device 40, which is applied to a blockchain including a depositor node device and an acquirer node device; the blockchain A smart contract that has stored target event data is deployed on the device; the device 40 includes:
  • An image recognition unit 402 the certificate depositor node device recognizes the certificate deposit identification image provided by the certificate depositor node device to obtain at least the identification of the smart contract; wherein, the certificate deposit identification image is based on at least Contract logo generation;
  • the sending unit 404 sends a second target transaction to the blockchain, where the second target transaction includes the identifier of the smart contract;
  • the smart contract execution unit 406 calls the smart contract, executes the data acquisition logic declared by the smart contract, and acquires the target event data.
  • the target event data further includes a digital signature made by a party related to the target event
  • the device 40 also includes:
  • the data verification unit 408 verifies the target data based on the digital signature.
  • the certificate identification image is generated based at least on the identification of the smart contract and the mapping code assigned by the smart contract to the target event data;
  • the image identification unit 402 identify the certificate identification image to obtain at least the identification of the smart contract and the mapping code;
  • the second target transaction also includes the mapping code.
  • the smart contract sets the acquirer to obtain the target event data acquisition authority; the smart contract execution unit 404:
  • the data acquisition logic declared by the smart contract is executed based on the acquisition authority of the acquirer on the target data.
  • the device embodiments described above are only schematics, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical modules, that is, may be located One place, or it can be distributed to multiple network modules. Some or all of the units or modules may be selected according to actual needs to achieve the objectives of the solutions in this specification. Those of ordinary skill in the art can understand and implement without paying creative labor.
  • a typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, and a game control Desk, tablet computer, wearable device, or any combination of these devices.
  • the embodiments of the present specification also provide a computer device, which includes a memory and a processor.
  • a computer program that can be executed by the processor is stored on the memory; when the processor runs the stored computer program, each step of the event certification method based on the blockchain in the embodiments of the present specification is executed.
  • each step of the event certification method based on the blockchain in the embodiments of the present specification is executed.
  • the embodiments of the present specification also provide a computer device, which includes a memory and a processor.
  • a computer program that can be executed by the processor is stored on the memory; when the processor runs the stored computer program, each step of the blockchain-based event acquisition method in the embodiment of the present specification is executed.
  • each step of the blockchain-based event acquisition method please refer to the previous content, and it will not be repeated.
  • the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
  • processors CPUs
  • input / output interfaces output interfaces
  • network interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-permanent memory, random access memory (RAM) and / or non-volatile memory in computer-readable media, such as read only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
  • RAM random access memory
  • ROM read only memory
  • flash RAM flash memory
  • Computer-readable media including permanent and non-permanent, removable and non-removable media, can store information by any method or technology.
  • the information may be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technologies
  • CD-ROM compact disc read-only memory
  • DVD digital
  • the embodiments of the present specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of this specification may take the form of computer program products implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code .
  • computer usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

本说明书的一个或多个实施例提供了一种基于区块链的事件存证、获取方法和装置,应用于包括存证方节点设备和获取方节点设备的区块链中;所述区块链上部署有用于数据存储和读取的智能合约;所述基于区块链的事件存证方法包括:所述存证方节点设备向所述区块链发送第一目标交易,所述第一目标交易包括待存储的目标事件数据;调用所述智能合约,执行所述智能合约声明的数据存储逻辑,存储所述目标事件数据至所述智能合约;至少基于所述智能合约的标识生成存证标识图像。

Description

基于区块链的数据存证、获取方法和装置 技术领域
本说明书涉及数据处理技术领域,尤其涉及一种基于区块链的数据存证、获取方法和装置。
背景技术
区块链技术,也被称之为分布式账本技术,是一种由若干台计算设备共同参与“记账”,共同维护一份完整的分布式数据库的新兴技术。由于区块链技术具有去中心化、公开透明、每台计算设备可以参与数据库记录、并且各计算设备之间可以快速的进行数据同步的特性,使得区块链技术已在众多的领域中广泛的进行应用。
发明内容
针对以上提出的区块链数据处理流程的现状,本说明书提供了一种基于区块链的事件存证方法,应用于包括存证方节点设备的区块链中;所述区块链上部署有用于数据存储和读取的智能合约;所述方法包括:
所述存证方节点设备向所述区块链发送第一目标交易,所述第一目标交易包括待存储的目标事件数据;
调用所述智能合约,执行所述智能合约声明的数据存储逻辑,存储所述目标事件数据至所述智能合约;
至少基于所述智能合约的标识生成存证标识图像。
在又一示出的实施方式中,所述目标数据还包括目标事件相关方所作的数字签名,以供获取方节点设备基于所述数字签名对所述目标事件数据进行验证;
所述至少基于所述智能合约的标识生成存证标识图像,包括:
至少基于所述智能合约的标识和所述目标事件相关方的身份名称生成存证标识图像。
在又一示出的实施方式中,所述至少基于所述智能合约的标识生成存证标识图像,包括:
根据预设的编码规则至少对所述智能合约的标识进行编码以生成存证数字编码;
根据预设的编码与色彩的映射关系和预设的色块生成顺序,将所述存证数字编码依次生成具有预设样式的色块。
在又一示出的实施方式中,所述的方法还包括:
接收所述智能合约为所述目标事件数据分配的映射码;
所述至少基于所述智能合约的标识生成存证标识图像,包括:
至少基于所述智能合约的标识和所述映射码生成存证标识图像。
在又一示出的实施方式中,所述的方法还包括:
向所述区块链发送目标用户的数据获取权限交易,所述数据获取权限交易用以设置所述目标用户对所述目标事件数据的获取权限;
调用所述智能合约,执行所述智能合约声明的设置用户的数据获取权限的逻辑,为所述目标用户设置获取所述目标事件数据的权限。
在又一示出的实施方式中,所述的方法还包括:
接收所述智能合约发送的获取方节点设备获取所述目标数据的通知消息。
本说明书还提供了一种基于区块链的事件获取方法,应用于包括存证方节点设备和获取方节点设备的区块链中;所述区块链上部署有已存储目标事件数据的智能合约;所述方法包括:
所述获取方节点设备识别所述存证方节点设备提供的存证标识图像,以至少获取所述智能合约的标识;其中,所述存证标识图像至少基于所述智能合约的标识生成;
向所述区块链发送第二目标交易,所述第二目标交易包括所述智能合约的标识;
调用所述智能合约,执行所述智能合约声明的数据获取逻辑,获取所述目标事件数据。
在又一示出的实施方式中,所述目标事件数据还包括目标事件相关方所作的数字签名;
所述方法还包括:
基于所述数字签名对所述目标数据进行验证。
在又一示出的实施方式中,所述识别所述存证标识图像以至少获取所述智能合约的标识,包括:
根据预设的色块生成顺序和预设的数字编码与色彩的映射关系,将所述色块的色彩依次转化为存证数字编码;
根据预设的解码规则,对所述存证数字编码进行解码以至少获取所述智能合约的标识。
在又一示出的实施方式中,所述存证标识图像至少基于所述智能合约的标识和所述智能合约为所述目标事件数据分配的映射码生成;
所述识别所述存证标识图像以至少获取所述智能合约的标识,包括:识别所述存证标识图像以至少获取所述智能合约的标识和所述映射码;
所述第二目标交易还包括所述映射码。
在又一示出的实施方式中,所述智能合约为所述获取方设置有对所述目标事件数据的获取权限;所述执行所述智能合约声明的数据获取逻辑,获取所述目标事件数据,包括:
获得所述获取方对所述目标事件数据的获取权限;
基于所述获取方对所述目标数据的获取权限,执行所述智能合约声明的数据获取逻辑。
相应的,本说明书还提供了一种基于区块链的事件存证装置,应用于包括存证方节点设备的区块链中;所述区块链上部署有用于数据存储和读取的智能合约;所述装置包括:
发送单元,所述存证方节点设备向所述区块链发送第一目标交易,所述第一目标交易包括待存储的目标事件数据;
智能合约执行单元,调用所述智能合约,执行所述智能合约声明的数据存储逻辑,存储所述目标事件数据至所述智能合约;
图像生成单元,至少基于所述智能合约的标识生成存证标识图像。
在又一示出的实施方式中,所述目标数据还包括目标事件相关方所作的数字签名,以供获取方节点设备基于所述数字签名对所述目标事件数据进行验证;
所述图像生成单元:
至少基于所述智能合约的标识和所述目标事件相关方的身份名称生成存证标识图像。
在又一示出的实施方式中,所述图像生成单元:
根据预设的编码规则至少对所述智能合约的标识进行编码以生成存证数字编码;
根据预设的编码与色彩的映射关系和预设的色块生成顺序,将所述存证数字编码依次生成具有预设样式的色块。
在又一示出的实施方式中,所述的装置还包括:
接收单元,接收所述智能合约为所述目标事件数据分配的映射码;
所述图像生成单元:
至少基于所述智能合约的标识和所述映射码生成存证标识图像。
在又一示出的实施方式中,所述发送单元:
向所述区块链发送目标用户的数据获取权限交易,所述数据获取权限交易用以设置所述目标用户对所述目标事件数据的获取权限;
所述智能合约执行单元,调用所述智能合约,执行所述智能合约声明的设置用户的数据获取权限的逻辑,为所述目标用户设置获取所述目标事件数据的权限。
在又一示出的实施方式中,所述的装置还包括接收单元:接收所述智能合约发送的获取方节点设备获取所述目标数据的通知消息。
相应的,本说明书还提供了一种基于区块链的事件获取装置,应用于包括存证方节点设备和获取方节点设备的区块链中;所述区块链上部署有已存储目标事件数据的智能合约;所述装置包括:
图像识别单元,所述存证方节点设备识别所述存证方节点设备提供的存证标识图像,以至少获取所述智能合约的标识;其中,所述存证标识图像至少基于所述智能合约的标识生成;
发送单元,向所述区块链发送第二目标交易,所述第二目标交易包括所述智能合约的标识;
智能合约执行单元,调用所述智能合约,执行所述智能合约声明的数据获取逻辑,获取所述目标事件数据。
在又一示出的实施方式中,所述目标事件数据还包括目标事件相关方所作的数字签名;
所述装置还包括:
数据验证单元,基于所述数字签名对所述目标数据进行验证。
在又一示出的实施方式中,所述图像识别单元:
根据预设的色块生成顺序和预设的数字编码与色彩的映射关系,将所述色块的色彩依次转化为存证数字编码;
根据预设的解码规则,对所述存证数字编码进行解码以至少获取所述智能合约的标识。
在又一示出的实施方式中,所述存证标识图像至少基于所述智能合约的标识和所述智能合约为所述目标事件数据分配的映射码生成;
所述图像识别单元:识别所述存证标识图像以至少获取所述智能合约的标识和所述映射码;
所述第二目标交易还包括所述映射码。
在又一示出的实施方式中,所述智能合约为所述获取方设置有对所述目标事件数据的获取权限;所述智能合约执行单元:
获得所述获取方对所述目标事件数据的获取权限;
基于所述获取方对所述目标数据的获取权限,执行所述智能合约声明的数据获取逻辑。
本说明书还提供了一种计算机设备,包括:存储器和处理器;所述存储器上存储有可由处理器运行的计算机程序;所述处理器运行所述计算机程序时,执行上述基于区块链的事件存证方法所述的步骤。
本说明书还提供了一种计算机设备,包括:存储器和处理器;所述存储器上存储有可由处理器运行的计算机程序;所述处理器运行所述计算机程序时,执行上述基于区块链的事件获取方法所述的步骤。
本说明书提供的基于区块链的数据存证、获取方法和装置,在所述区块链上部署有用于数据存储和读取的智能合约,该智能合约可应用户的调用而执行对数据的存储或读 取。基于区块链技术的分布式数据库存储机制,存证方用户在所述智能合约内存储的目标数据被去中心化地记录在所有节点中,由所有参与方的节点共同维护;基于区块链的共识机制,每个存证方用户提供的数据信息不会在提供后被篡改,从而达到了存证目标数据的效果。存证方至少基于所述智能合约的标识生成存证标识图像,以供获取方可通过图像识别该存证标识图像而获取上述智能合约的标识,进而调用该智能合约以获取上述目标数据。
智能合约可在任何时候应用户的调用而完成对目标数据的存证或获取,大大提升对目标数据的存证或获取的效率;且智能合约执行有着较低的人为干预、去中心化权威的优势,更加增加了数据存证及获取行为的公平性。
附图说明
图1为本说明书一示例性实施例提供的基于区块链的数据存证、获取方法的流程图;
图2为本说明书又一实施例提供的存证标识图像示意图;
图3为本说明书一示例性实施例提供的基于区块链的数据存证装置的示意图;
图4为本说明书一示例性实施例提供的基于区块链的数据获取装置的示意图;
图5为运行本说明书示例性实施例所提供的基于区块链的数据存证或验证装置实施例的一种硬件结构图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书一个或多个实施例的一些方面相一致的装置和方法的例子。
需要说明的是:在其他实施例中并不一定按照本说明书示出和描述的顺序来执行相应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本说明书所描述的更多或更少。此外,本说明书中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本说明书中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。
如图1所示,本说明书一示意性实施例提供了一种基于区块链的目标事件存证、及获取方法,应用于包括存证方节点设备和获取方节点设备的区块链中,所述区块链上部署有用于数据存储和读取的智能合约。
本实施例所述的区块链,具体可指一个各节点设备通过共识机制达成的、具有分布式数据存储结构的P2P网络系统,该区块链内的数据分布在时间上相连的一个个“区块(block)”之内,后一区块包含前一区块的数据摘要,且根据具体的共识机制(如POW、POS、DPOS或PBFT等)的不同,达成全部或部分节点设备的数据全备份。本领域的技术人员熟知,由于区块链系统在相应共识机制下运行,已收录至区块链数据库内的数据很难被任意的节点设备篡改,例如采用Pow共识的区块链,至少需要全网51%算力的攻击才有可能篡改已有数据,因此区块链系统有着其他中心化数据库系统所法比拟的保证数据安全、防攻击篡改的特性。
另外,值得注意的是,本说明书所述的节点设备,不仅可包括备份有区块链的分布式数据库的全量数据的全节点设备,还可包括备份有区块链的分布式数据库的部分数据的轻节点设备,以及其他的终端设备或客户端,在本说明书中不做限定。
区块链上部署的智能合约,是被区块链的节点设备共识验证以保存至区块链的分布式数据库的可执行的计算机程序语言;区块链上的任一节点设备均可接收区块链的用户对智能合约的调用,以执行该智能合约声明的逻辑;上述执行结果经区块链的节点设备共识验证后也可被保存至区块链的分布式数据库。
在本实施例中,区块链上部署有用以数据存储和读取的智能合约,用户可通过向该智能合约的账户地址或其他标识发送交易,调用该智能合约的接口、及相应的函数,完成向所述智能合约内存储数据或读取所述智能合约内已存储的数据的操作。
如图1所示,本实施例所提供的基于区块链的数据存证方法包括:
步骤102,所述存证方节点设备向所述区块链发送第一目标交易,所述第一目标交易包括待存储的目标事件数据。
在本说明书中所描述的交易(transaction),是指用户通过区块链的节点设备创建,并需要最终发布至区块链的分布式数据库中的一笔数据。其中,区块链中的交易,存在狭义的交易以及广义的交易之分。狭义的交易是指用户向区块链发布的一笔价值转移;例如,在传统的比特币区块链网络中,交易可以是用户在区块链中发起的一笔转账。而广义的交易是指用户向区块链发布的一笔任意的数据。本实施例所述的第一目标交易, 是包括待存储的目标事件数据,上述目标事件数据可以包括描述全部或部分事件发生的过程的数据,或描述事件的特征值的数据等,其可以具体表现为合同、通知书、说明书、业务概况、订单等各种形式,在本说明书中不做限定。为了防止区块链中的其他节点获知上述目标事件数据的原文,引起一些隐私信息的泄露,可对上述目标事件数据加密,将上述包含目标事件数据密文的第一目标交易向区块链发送。
本领域的技术人员容易知道,本实施例所述的存证方,可以是上述目标事件相关方或目标事件相关方之一,也可以不属于上述目标事件相关方,而作为一个中立方或事件存证机构方,执行本说明书实施例所述的事件存证方法。
在又一示出的实施例中,上述目标事件数据还包括所述目标事件相关方所作的数字签名,例如合同的签署方对合同正文所作的数字签名,通知书发布方对通知书正文所作的数字签名,说明书撰写方对说明书正文所作的数字签名,订单订购方对订单内容所作的数字签名,电子邮件的发送方对电子邮件的正文内容所作的数字签名等等。类似于实际业务中的签名,上述的数字签名可以表达为目标事件相关方对目标事件数据的认定,例如合同签署方对电子合同所作的数字签名等。
数字签名是签名者基于自身的私钥对其认可的数据内容的数学摘要所进行的数学加密;通过验证数字签名,不仅可验证签名者的公钥所对应的身份,还可通过将上述私钥加密的数学摘要与现有的数据内容所得的数学摘要进行对比,验证现有的数据内容是否与签名者签署的数据内容是否一致,从而获知现有的数据内容是否被篡改过。因此在本实施例中,通过验证上述数字签名,通常可供该目标事件数据的获取方对目标事件数据的签署方身份及目标事件数据的内容是否经篡改进行验证。
在所述第一目标交易经过所述区块链节点设备的共识验证后,该第一目标交易即可被收录至所述区块链的分布式数据库中;区块链中的任一节点设备,包括存证方节点设备在内,均可接收所述存证方节点设备发送至所述区块链的第一目标交易,以基于所述第一目标交易内的智能合约的地址,调用上述智能合约。
步骤104,调用所述智能合约,执行所述智能合约声明的数据存储逻辑,存储所述目标事件数据至所述智能合约。
上述将目标事件数据存储至所述智能合约的过程,也可被视为在上述区块链的分布式数据库内更新上述智能合约的过程。在一示出的实施例中,所述存储所述目标事件数据至所述智能合约,包括:
所述区块链中具有记账权限的节点将所述存储有所述目标事件数据的智能合约代码加入到候选区块;
从所述具有记账权限的节点中确定满足所述区块链共识机制的共识记账节点;
所述共识记账节点向所述区块链的节点广播所述候选区块;
在所述候选区块通过所述区块链符合预设数量的节点的验证认可后,所述候选区块被视为最新区块,加入到所述区块链的分布式数据库中。
在上述的实施例中,具有记账权限的节点是指具有生成候选区块权限的节点,可包括本说明书所述的存证方节点设备、获取方节点设备及上述区块链中的其他节点设备。根据所述区块链的共识机制,可从上述对所述候选区块具有记账权限的节点中确定共识记账节点,上述共识机制可以包括工作量证明机制(PoW)、或权利证明机制(PoS)、或股份授权证明机制(DPoS)、或PBFT算法机制等。
基于以上的具体过程,上述目标事件数据被存储至所述智能合约,也即被存储在所述区块链的分布式数据库中,从而完成对上述目标事件数据的区块链存证。
当上述第一目标交易中包含的目标事件数据为加密的密文状态时,上述智能合约既可以将上述密文解密,在智能合约内存证上述目标事件数据的原文;也可以直接存证上述目标事件数据的密文,在本说明书中不做限定。
在本实施例中,为了方便其他用户获取到上述已存证的目标事件数据,存证方节点设备还可执行步骤106:至少基于所述智能合约的标识生成存证标识图像,以供其他用户基于图像识别的方式获取到所述智能合约的标识,从而在上述区块链中调用所述智能合约,执行所述智能合约声明的数据获取逻辑,获取所述目标事件数据。上述智能合约的标识通常可包括智能合约的地址、或智能合约的账户名称、或智能合约的数字摘要值等可唯一性识别上述智能合约的标识。
在又一示出的实施方式中,当所述目标数据还包括所述目标事件相关方所作的数字签名时,为方便目标事件数据的获取方节点设备在获取目标事件数据后,基于所述数字签名对所述目标事件数据进行验证——例如,验证目标事件相关方的身份,或验证区块链上存证的目标事件数据是否与目标事件相关方数字签名所签署的目标事件数据一致,上述存证标识图像可基于上述智能合约的标识和目标事件相关方的身份名称而生成。
表征所述智能合约的标识或所述目标事件相关方的身份名称的存证标识图像通 常可采用二维码或条形码等数字图像化的方式,便捷地通过图像扫码的方式获取上述智能合约的标识或/和目标事件相关方的身份名称,以用于对目标事件数据的获取或/和验证;但是上述二维码或条形码形式的存证识别图像通常不能直观的体现其代表的数据信息。
图2示意了本说明书一示例性实施例提供的存证标识图像,该存证标识图像为至少基于所述智能合约的标识生成的图片(含色彩),例如根据预设的编码规则至少对所述智能合约的标识进行编码以生成存证数字编码,根据预设的编码与色彩的映射关系,将所述存证数字编码依次生成相应色彩的色块。可选的,上述色块可以为具有固定样式的图案,如图2所示的花朵等,可以按照上述色块生成的顺序(如图2所示的花瓣1至8的顺序)生成彩色图片。
当存证标识图像还包括目标事件相关方的身份名称信息时,上述目标事件相关方的身份名称可以采用手写签名的方式与上述彩色图片共同呈现,如图2所示的手写签名“林立”(标号为9),相较于上述以二维码或条形码的形式呈现的存证标识图像,图2所示的彩色图片加手写签名方式呈现的存证标识图像,获取方用户既可以通过观察手写签名,直接获取待获取或待验证的目标事件相关方的身份名称,具有更好的直观性,也可以通过图像识别的方式识别上述手写签名获得事件相关方的用户名称;相较于条形码或二维码的图像样式,图2所示的用彩色图案也具有更好的美观性。
上述实施例所述的用于数据存储和读取的智能合约,可以为指定的一个目标业务事件作存证,也可以为多个目标业务事件作存证;既可以为一个目标事件的多条目标事件数据作存证,也可以为多个目标事件的目标事件数据作存证。当上述智能合约用于为多个目标业务事件作存证或为一个目标业务事件的多条目标事件数据作存证时,上述智能合约还可为上述目标事件数据分配相应的映射码,以供目标事件数据的获取方可基于该映射码获取到相应的目标事件数据。上述映射码可以包括上述智能合约为目标事件数据分配的序列号,也可包括上述智能合约为目标事件数据的相关方的名称分配的识别号,等等。相应地,上述至少基于所述智能合约的标识生成存证标识图像,也应包括:至少基于所述智能合约的标识和所述映射码生成存证标识图像。
为了保证上述目标事件数据不会应任何区块链用户对该智能合约的调取而被获得,保证该目标事件数据的隐私性和安全性,上述智能合约内还可为不同的区块链用户设置其对上述目标事件数据的获取权限,上述获取权限可包括:不可获取任何目标事件数据、可获取预设的部分目标事件数据、可获得全部的目标事件数据等,可依据上述智 能合约应用的具体场景而设置。上述对目标事件数据的获取权限的设置,可以在该智能合约的部署上链前由该智能合约的部署方设置,也可在该智能合约部署后由具有权限设置的管理员用户给予设置,还可根据具体的目标事件,由该目标事件的存证方给予设置。
在一示出的实施方式中,上述由目标事件的存证方设置目标用户的数据获取权限的过程包括:该区块链中的任一节点设备(包括所述存证方节点设备)接收所述存证方节点设备向所述区块链发送的目标用户的数据获取权限交易,所述数据获取权限交易用以设置所述目标用户对所述目标事件数据的获取权限;调用所述智能合约,执行所述智能合约声明的设置用户的数据获取权限的逻辑,为所述目标用户设置获取所述目标事件数据的权限。
为了保证存证方节点设备监控上述目标事件数据的获取以保证数据的安全性,包括及时获知从上述智能合约内获取到上述目标事件数据的获取方用户,在又一示出的实施方式中,该智能合约还声明有获取消息通知逻辑,用以向上述目标事件数据的存证方发送关于获取方节点设备获取上述目标事件数据的通知消息;相应地,上述存证方节点设备可接收上述智能合约发送的关于获取方节点设备获取上述目标事件数据的通知消息。
以上的一个或多个实施例描述了一种或多种基于区块链的事件存证方法,在存证方节点设备完成对目标事件数据的存证后,存证方可将上述存证识别图像发送至任何需要获取或验证上述目标事件数据的区块链节点设备,以供上述节点设备作为获取方节点设备获取上述目标事件数据。如图1所示,获取上述目标事件数据的过程可以包括:
步骤108,所述获取方节点设备识别所述存证方节点设备提供的存证标识图像,以至少获取所述智能合约的标识;其中,所述存证标识图像至少基于所述智能合约的标识生成;
步骤110,向所述区块链发送第二目标交易,所述第二目标交易包括所述智能合约的标识;
步骤112,调用所述智能合约,执行所述智能合约声明的数据获取逻辑,获取所述目标事件数据。
如前所述,上述目标事件数据可以包括描述全部或部分目标事件发生的过程的数据,或描述目标事件的特征值的数据等,其可以具体表现为合同、通知书、说明书、业务概况、订单等各种形式,在本说明书中不做限定。
在又一示出的实施例中,上述目标事件数据还包括所述目标事件相关方所作的数字签名,例如合同的签署方对合同正文所作的数字签名,通知书发布方对通知书正文所作的数字签名,说明书撰写方对说明书正文所作的数字签名,订单订购方对订单内容所作的数字签名,电子邮件的发送方对电子邮件的正文内容所作的数字签名等等。类似于实际业务中的签名,上述的数字签名可以表达为目标事件相关方对目标事件数据的认定,例如合同签署方对电子合同所作的数字签名等。
相应地,上述基于区块链的事件获取方法还包括:基于所述数字签名对所述目标数据进行验证。数字签名是签名者基于自身的私钥对其认可的数据内容的数学摘要所进行的数学加密;通过验证数字签名,不仅可获得签名者的公钥,进而将上述公钥提供至身份认证机构予以身份认证,从而获知签名者的公钥所对应的身份,还可通过将上述私钥加密的数学摘要与现有的数据内容所得的数学摘要进行对比,验证现有的数据内容是否与签名者签署的数据内容是否一致,从而获知现有的数据内容是否被篡改过。因此在本实施例中,通过验证上述数字签名,通常可供该目标事件数据的获取方对目标事件数据的签署方身份及目标事件数据的内容是否经篡改进行验证。
在又一示出的实施方式中,当所述目标数据还包括所述目标事件相关方所作的数字签名时,为方便目标事件数据的获取方节点设备在获取目标事件数据后,基于所述数字签名对所述目标事件数据进行验证——例如,验证目标事件相关方的身份,或验证区块链上存证的目标事件数据是否与目标事件相关方数字签名所签署的目标事件数据一致,上述存证标识图像可基于上述智能合约的标识和目标事件相关方的身份名称而生成。
表征所述智能合约的标识或所述目标事件相关方的身份名称的存证标识图像通常可采用二维码或条形码等数字图像化的方式,便捷地通过图像扫码的方式获取上述智能合约的标识或/和目标事件相关方的身份名称,以用于对目标事件数据的获取或/和验证;但是上述二维码或条形码形式的存证识别图像通常不能直观的体现其代表的数据信息。
图2示意了本说明书一示例性实施例提供的存证标识图像,该存证标识图像为至少基于所述智能合约的标识生成的图片(含色彩),例如根据预设的编码规则至少对所述智能合约的标识进行编码以生成存证数字编码,根据预设的编码与色彩的映射关系,将所述存证数字编码依次生成相应色彩的色块。可选的,上述色块可以为具有固定样式的图案,如图2所示的花朵等,可以按照上述色块生成的顺序(如图2所示的花瓣1至 8的顺序)生成彩色图片。获取方可通过图像识别终端扫描上述彩色图片,根据所述色块的生成顺序(如图2所示的花瓣1至8的顺序),识别上述具有预设样式的色块的色彩;根据预设的数字编码与色彩的映射关系,将所述色块的色彩解码,以获得存证数字编码;根据预设的解码规则,对所述存证数字编码进行解码以至少获取所述智能合约的标识。
当存证标识图像还包括目标事件相关方的身份名称信息时,上述目标事件相关方的身份名称可以采用手写签名的方式与上述彩色图片共同呈现,如图2所示的手写签名“林立”(标号为9),相较于上述以二维码或条形码的形式呈现的存证标识图像,图2所示的彩色图片加手写签名方式呈现的存证标识图像,获取方用户既可以通过观察手写签名,直接获取待获取或待验证的目标事件相关方的身份名称,具有更好的直观性,也可以通过图像识别的方式识别上述手写签名获得事件相关方的用户名称;相较于条形码或二维码的图像样式,图2所示的用彩色图案也具有更好的美观性。
上述实施例所述的用于数据存储和读取的智能合约,可以为指定的一个目标业务事件作存证,也可以为多个目标业务事件作存证;既可以为一个目标事件的多条目标事件数据作存证,也可以为多个目标事件的目标事件数据作存证。当上述智能合约用于为多个目标业务事件作存证或为一个目标业务事件的多条目标事件数据作存证时,上述智能合约还可为上述目标事件数据分配相应的映射码,以供目标事件数据的获取方可基于该映射码获取到相应的目标事件数据。上述映射码可以包括上述智能合约为目标事件数据分配的序列号,也可包括上述智能合约为目标事件数据的相关方的名称分配的识别号,等等。相应地,上述至少基于所述智能合约的标识生成存证标识图像,也应包括:至少基于所述智能合约的标识和所述映射码生成存证标识图像。在获取方节点设备进行存证标识图像识别后,可获得所述智能合约的标识和所述映射码,并将上述智能合约的标识和所述映射码一起放置于第二目标交易中,以调用上述智能合约,并基于上述映射码获取到相应的目标事件数据。
为了保证上述目标事件数据不会应任何区块链用户对该智能合约的调取而被获得,保证该目标事件数据的隐私性和安全性,上述智能合约内还可为不同的区块链用户设置其对上述目标事件数据的获取权限,上述获取权限可包括:不可获取任何目标事件数据、可获取预设的部分目标事件数据、可获得全部的目标事件数据等,可依据上述智能合约应用的具体场景而设置。上述对目标事件数据的获取权限的设置,可以在该智能合约的部署上链前由该智能合约的部署方设置,也可在该智能合约部署后由具有权限设 置的管理员用户给予设置,还可根据具体的目标事件,由该目标事件的存证方给予设置。
因此,所述执行所述智能合约声明的数据获取逻辑,获取所述目标数据,包括:获得所述获取方对所述目标数据的获取权限;基于所述获取方对所述目标数据的获取权限,执行所述智能合约声明的数据获取逻辑。具体的,上述获取方的数据获取权限的设置可以通过设置用户白名单、用户黑名单、用户权限设置表等技术手段来实现,在此不再赘述。
与上述流程实现对应,本说明书的实施例还提供了一种基于区块链的事件存证装置和一种基于区块链的事件获取。该装置可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为逻辑意义上的装置,是通过所在设备的CPU(Central Process Unit,中央处理器)将对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,除了图5所示的CPU、内存以及存储器之外,网络风险业务的实现装置所在的设备通常还包括用于进行无线信号收发的芯片等其他硬件,和/或用于实现网络通信功能的板卡等其他硬件。
如图3所示,本说明书还提供了一种基于区块链的事件存证装置30,应用于包括存证方节点设备的区块链中;所述区块链上部署有用于数据存储和读取的智能合约;所述装置30包括:
发送单元302,所述存证方节点设备向所述区块链发送第一目标交易,所述第一目标交易包括待存储的目标事件数据;
智能合约执行单元304,调用所述智能合约,执行所述智能合约声明的数据存储逻辑,存储所述目标事件数据至所述智能合约;
图像生成单元306,至少基于所述智能合约的标识生成存证标识图像。
在又一示出的实施方式中,所述目标事件数据还包括目标事件相关方所作的数字签名,以供获取方节点设备基于所述数字签名对所述目标事件数据进行验证;
所述图像生成单元306:
至少基于所述智能合约的标识和所述目标事件相关方的身份名称生成存证标识图像。
在又一示出的实施方式中,所述图像生成单元306:
根据预设的编码规则至少对所述智能合约的标识进行编码以生成存证数字编码;
根据预设的编码与色彩的映射关系和预设的色块生成顺序,将所述存证数字编码依次生成具有预设样式的色块。
在又一示出的实施方式中,所述的装置30还包括:
接收单元308,接收所述智能合约为所述目标事件数据分配的映射码;
所述图像生成单元306:
至少基于所述智能合约的标识和所述映射码生成存证标识图像。
在又一示出的实施方式中,所述发送单元302:
向所述区块链发送目标用户的数据获取权限交易,所述数据获取权限交易用以设置所述目标用户对所述目标事件数据的获取权限;
所述智能合约执行单元304,调用所述智能合约,执行所述智能合约声明的设置用户的数据获取权限的逻辑,为所述目标用户设置获取所述目标事件数据的权限。
在又一示出的实施方式中,所述的装置30还包括接收单元310:接收所述智能合约发送的获取方节点设备获取所述目标数据的通知消息。
相应的,如图4所示,本说明书还提供了一种基于区块链的事件获取装置40,应用于包括存证方节点设备和获取方节点设备的区块链中;所述区块链上部署有已存储目标事件数据的智能合约;所述装置40包括:
图像识别单元402,所述存证方节点设备识别所述存证方节点设备提供的存证标识图像,以至少获取所述智能合约的标识;其中,所述存证标识图像至少基于所述智能合约的标识生成;
发送单元404,向所述区块链发送第二目标交易,所述第二目标交易包括所述智能合约的标识;
智能合约执行单元406,调用所述智能合约,执行所述智能合约声明的数据获取逻辑,获取所述目标事件数据。
在又一示出的实施方式中,所述目标事件数据还包括目标事件相关方所作的数字签名;
所述装置40还包括:
数据验证单元408,基于所述数字签名对所述目标数据进行验证。
在又一示出的实施方式中,所述图像识别单元402:
根据预设的色块生成顺序和预设的数字编码与色彩的映射关系,将所述色块的色彩依次转化为存证数字编码;
根据预设的解码规则,对所述存证数字编码进行解码以至少获取所述智能合约的标识。
在又一示出的实施方式中,所述存证标识图像至少基于所述智能合约的标识和所述智能合约为所述目标事件数据分配的映射码生成;
所述图像识别单元402:识别所述存证标识图像以至少获取所述智能合约的标识和所述映射码;
所述第二目标交易还包括所述映射码。
在又一示出的实施方式中,所述智能合约为所述获取方设置有对所述目标事件数据的获取权限;所述智能合约执行单元404:
获得所述获取方对所述目标事件数据的获取权限;
基于所述获取方对所述目标数据的获取权限,执行所述智能合约声明的数据获取逻辑。
上述装置中各个单元的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,相关之处参见方法实施例的部分说明即可,在此不再赘述。
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部单元或模块来实现本说明书方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
上述实施例阐明的装置、单元、模块,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
与上述方法实施例相对应,本说明书的实施例还提供了一种计算机设备,该计 算机设备包括存储器和处理器。其中,存储器上存储有能够由处理器运行的计算机程序;处理器在运行存储的计算机程序时,执行本说明书实施例中基于区块链的事件存证方法的各个步骤。对基于区块链的事件存证方法的各个步骤的详细描述请参见之前的内容,不再重复。
与上述方法实施例相对应,本说明书的实施例还提供了一种计算机设备,该计算机设备包括存储器和处理器。其中,存储器上存储有能够由处理器运行的计算机程序;处理器在运行存储的计算机程序时,执行本说明书实施例中基于区块链的事件获取方法的各个步骤。对基于区块链的事件获取方法的各个步骤的详细描述请参见之前的内容,不再重复。
以上所述仅为本说明书的较佳实施例而已,并不用以限制本说明书,凡在本说明书的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书保护的范围之内。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。
计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素, 而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
本领域技术人员应明白,本说明书的实施例可提供为方法、系统或计算机程序产品。因此,本说明书的实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书的实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。

Claims (24)

  1. 一种基于区块链的事件存证方法,应用于包括存证方节点设备的区块链中;所述区块链上部署有用于数据存储和读取的智能合约;所述方法包括:
    所述存证方节点设备向所述区块链发送第一目标交易,所述第一目标交易包括待存储的目标事件数据;
    调用所述智能合约,执行所述智能合约声明的数据存储逻辑,存储所述目标事件数据至所述智能合约;
    至少基于所述智能合约的标识生成存证标识图像。
  2. 根据权利要求1所述的方法,所述目标事件数据还包括目标事件相关方所作的数字签名,以供获取方节点设备基于所述数字签名对所述目标事件数据进行验证;
    所述至少基于所述智能合约的标识生成存证标识图像,包括:
    至少基于所述智能合约的标识和所述目标事件相关方的身份名称生成存证标识图像。
  3. 根据权利要求1或2所述的方法,所述至少基于所述智能合约的标识生成存证标识图像,包括:
    根据预设的编码规则至少对所述智能合约的标识进行编码以生成存证数字编码;
    根据预设的编码与色彩的映射关系和预设的色块生成顺序,将所述存证数字编码依次生成具有预设样式的色块。
  4. 根据权利要求1或2所述的方法,还包括:
    接收所述智能合约为所述目标事件数据分配的映射码;
    所述至少基于所述智能合约的标识生成存证标识图像,包括:
    至少基于所述智能合约的标识和所述映射码生成存证标识图像。
  5. 根据权利要求1或2所述的方法,还包括:
    向所述区块链发送目标用户的数据获取权限交易,所述数据获取权限交易用以设置所述目标用户对所述目标事件数据的获取权限;
    调用所述智能合约,执行所述智能合约声明的设置用户的数据获取权限的逻辑,为所述目标用户设置获取所述目标事件数据的权限。
  6. 根据权利要求1所述的方法,还包括:
    接收所述智能合约发送的获取方节点设备获取所述目标数据的通知消息。
  7. 一种基于区块链的事件获取方法,应用于包括存证方节点设备和获取方节点设备的区块链中;所述区块链上部署有已存储目标事件数据的智能合约;所述方法包括:
    所述获取方节点设备识别所述存证方节点设备提供的存证标识图像,以至少获取所述智能合约的标识;其中,所述存证标识图像至少基于所述智能合约的标识生成;
    向所述区块链发送第二目标交易,所述第二目标交易包括所述智能合约的标识;
    调用所述智能合约,执行所述智能合约声明的数据获取逻辑,获取所述目标事件数据。
  8. 根据权利要求7所述的方法,所述目标事件数据还包括目标事件相关方所作的数字签名;
    所述方法还包括:
    基于所述数字签名对所述目标数据进行验证。
  9. 根据权利要求7或8所述的方法,所述识别所述存证标识图像以至少获取所述智能合约的标识,包括:
    根据预设的色块生成顺序和预设的数字编码与色彩的映射关系,将所述色块的色彩依次转化为存证数字编码;
    根据预设的解码规则,对所述存证数字编码进行解码以至少获取所述智能合约的标识。
  10. 根据权利要求7或8所述的方法,所述存证标识图像至少基于所述智能合约的标识和所述智能合约为所述目标事件数据分配的映射码生成;
    所述识别所述存证标识图像以至少获取所述智能合约的标识,包括:识别所述存证标识图像以至少获取所述智能合约的标识和所述映射码;
    所述第二目标交易还包括所述映射码。
  11. 根据权利要求7所述的方法,所述智能合约为所述获取方设置有对所述目标事件数据的获取权限;所述执行所述智能合约声明的数据获取逻辑,获取所述目标事件数据,包括:
    获得所述获取方对所述目标事件数据的获取权限;
    基于所述获取方对所述目标数据的获取权限,执行所述智能合约声明的数据获取逻辑。
  12. 一种基于区块链的事件存证装置,应用于包括存证方节点设备的区块链中;所述区块链上部署有用于数据存储和读取的智能合约;所述装置包括:
    发送单元,所述存证方节点设备向所述区块链发送第一目标交易,所述第一目标交易包括待存储的目标事件数据;
    智能合约执行单元,调用所述智能合约,执行所述智能合约声明的数据存储逻辑, 存储所述目标事件数据至所述智能合约;
    图像生成单元,至少基于所述智能合约的标识生成存证标识图像。
  13. 根据权利要求12所述的装置,所述目标数据还包括目标事件相关方所作的数字签名,以供获取方节点设备基于所述数字签名对所述目标事件数据进行验证;
    所述图像生成单元:
    至少基于所述智能合约的标识和所述目标事件相关方的身份名称生成存证标识图像。
  14. 根据权利要求12或13所述的装置,所述图像生成单元:
    根据预设的编码规则至少对所述智能合约的标识进行编码以生成存证数字编码;
    根据预设的编码与色彩的映射关系和预设的色块生成顺序,将所述存证数字编码依次生成具有预设样式的色块。
  15. 根据权利要求12或13所述的装置,还包括:
    接收单元,接收所述智能合约为所述目标事件数据分配的映射码;
    所述图像生成单元:
    至少基于所述智能合约的标识和所述映射码生成存证标识图像。
  16. 根据权利要求12或13所述的装置,所述发送单元:
    向所述区块链发送目标用户的数据获取权限交易,所述数据获取权限交易用以设置所述目标用户对所述目标事件数据的获取权限;
    所述智能合约执行单元,调用所述智能合约,执行所述智能合约声明的设置用户的数据获取权限的逻辑,为所述目标用户设置获取所述目标事件数据的权限。
  17. 根据权利要求12所述的装置,还包括接收单元:接收所述智能合约发送的获取方节点设备获取所述目标数据的通知消息。
  18. 一种基于区块链的事件获取装置,应用于包括存证方节点设备和获取方节点设备的区块链中;所述区块链上部署有已存储目标事件数据的智能合约;所述装置包括:
    图像识别单元,所述存证方节点设备识别所述存证方节点设备提供的存证标识图像,以至少获取所述智能合约的标识;其中,所述存证标识图像至少基于所述智能合约的标识生成;
    发送单元,向所述区块链发送第二目标交易,所述第二目标交易包括所述智能合约的标识;
    智能合约执行单元,调用所述智能合约,执行所述智能合约声明的数据获取逻辑,获取所述目标事件数据。
  19. 根据权利要求18所述的装置,所述目标事件数据还包括目标事件相关方所作的数字签名;
    所述装置还包括:
    数据验证单元,基于所述数字签名对所述目标数据进行验证。
  20. 根据权利要求18或19所述的装置,所述图像识别单元:
    根据预设的色块生成顺序和预设的数字编码与色彩的映射关系,将所述色块的色彩依次转化为存证数字编码;
    根据预设的解码规则,对所述存证数字编码进行解码以至少获取所述智能合约的标识。
  21. 根据权利要求18或19所述的装置,所述存证标识图像至少基于所述智能合约的标识和所述智能合约为所述目标事件数据分配的映射码生成;
    所述图像识别单元:识别所述存证标识图像以至少获取所述智能合约的标识和所述映射码;
    所述第二目标交易还包括所述映射码。
  22. 根据权利要求18所述的装置,所述智能合约为所述获取方设置有对所述目标事件数据的获取权限;所述智能合约执行单元:
    获得所述获取方对所述目标事件数据的获取权限;
    基于所述获取方对所述目标数据的获取权限,执行所述智能合约声明的数据获取逻辑。
  23. 一种计算机设备,包括:存储器和处理器;所述存储器上存储有可由处理器运行的计算机程序;所述处理器运行所述计算机程序时,执行如权利要求1到6任意一项所述的方法。
  24. 一种计算机设备,包括:存储器和处理器;所述存储器上存储有可由处理器运行的计算机程序;所述处理器运行所述计算机程序时,执行如权利要求7到11任意一项所述的方法。
PCT/CN2019/103270 2018-10-26 2019-08-29 基于区块链的数据存证、获取方法和装置 WO2020082894A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811260957.4 2018-10-26
CN201811260957.4A CN109615383B (zh) 2018-10-26 2018-10-26 基于区块链的数据存证、获取方法和装置

Publications (1)

Publication Number Publication Date
WO2020082894A1 true WO2020082894A1 (zh) 2020-04-30

Family

ID=66001654

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103270 WO2020082894A1 (zh) 2018-10-26 2019-08-29 基于区块链的数据存证、获取方法和装置

Country Status (3)

Country Link
CN (2) CN109615383B (zh)
TW (1) TWI706360B (zh)
WO (1) WO2020082894A1 (zh)

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109615383B (zh) * 2018-10-26 2021-03-16 创新先进技术有限公司 基于区块链的数据存证、获取方法和装置
CN110099108B (zh) * 2019-04-26 2022-04-01 深圳前海微众银行股份有限公司 一种区块链事件去重方法、装置、计算机设备及存储介质
CN110162470B (zh) * 2019-04-28 2023-08-18 创新先进技术有限公司 一种区块链的测试方法和装置
CN110163691B (zh) * 2019-04-29 2020-12-04 创新先进技术有限公司 基于区块链的发票创建方法和装置、电子设备
US11087371B2 (en) 2019-04-29 2021-08-10 Advanced New Technologies Co., Ltd. Blockchain-based invoice creation method apparatus, and electronic device
US10795882B2 (en) 2019-04-30 2020-10-06 Alibaba Group Holding Limited Blockchain-based data compression and searching
CN110163755B (zh) * 2019-04-30 2020-11-24 创新先进技术有限公司 基于区块链的数据压缩、查询方法及装置和电子设备
CN115632854A (zh) * 2019-04-30 2023-01-20 创新先进技术有限公司 一种基于区块链的数据处理方法和装置
CN110264196B (zh) * 2019-05-20 2021-04-23 创新先进技术有限公司 结合代码标注与用户类型的有条件的收据存储方法和节点
CN110363527B (zh) * 2019-06-26 2023-07-04 创新先进技术有限公司 基于区块链的存证、监管方法和装置
CN110472201B (zh) * 2019-07-26 2020-07-21 阿里巴巴集团控股有限公司 基于区块链的文本相似性检测方法及装置、电子设备
US10909317B2 (en) 2019-07-26 2021-02-02 Advanced New Technologies Co., Ltd. Blockchain-based text similarity detection method, apparatus and electronic device
CN110958319B (zh) * 2019-12-05 2022-07-12 腾讯科技(深圳)有限公司 一种基于区块链的侵权存证管理方法及装置
CN111260469A (zh) * 2020-01-10 2020-06-09 杭州溪塔科技有限公司 基于区块链的存证方法、查询方法及相应装置和电子设备
CN111339182A (zh) * 2020-02-10 2020-06-26 叮当快药科技集团有限公司 用于基于以太坊区块链的信息共享系统的用户数据调用的方法和装置
CN111523147B (zh) * 2020-07-03 2020-11-24 支付宝(杭州)信息技术有限公司 一种基于区块链的核身方法及相关硬件
CN112199446B (zh) * 2020-12-01 2021-05-28 支付宝(杭州)信息技术有限公司 一种物品流通记录的存证方法、装置、设备和存储介质
CN112487497A (zh) * 2020-12-10 2021-03-12 杭州溪塔科技有限公司 基于智能合约对链外文件的管理方法、装置和电子设备
CN113011422A (zh) * 2021-05-12 2021-06-22 青岛冠成软件有限公司 基于图形识别的供应链监管方法、装置及计算机设备
CN114066446A (zh) * 2021-11-16 2022-02-18 上海鸿米信息科技有限责任公司 区块链数据处理方法、装置、存储介质及区块链节点
CN114241248B (zh) * 2022-02-24 2022-07-01 北京市农林科学院信息技术研究中心 河蟹产地溯源方法及系统
CN115168489B (zh) * 2022-06-28 2024-03-22 杭州钛度科技有限公司 基于区块链的数据存证方法和装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107862215A (zh) * 2017-09-29 2018-03-30 阿里巴巴集团控股有限公司 一种数据存储方法、数据查询方法及装置
CN107944868A (zh) * 2017-12-07 2018-04-20 杭州趣链科技有限公司 一种基于区块链智能合约的电子存证系统和管理方法
WO2018125370A1 (en) * 2016-12-28 2018-07-05 Mastercard International Incorporated Method and system for providing validated, auditable, and immutable inputs to a smart contract
CN109615383A (zh) * 2018-10-26 2019-04-12 阿里巴巴集团控股有限公司 基于区块链的数据存证、获取方法和装置

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106209877A (zh) * 2016-07-19 2016-12-07 井创(北京)科技有限公司 一种以区块链后台为认证核心的防伪认证系统
CN106156345B (zh) * 2016-07-21 2019-11-05 北京源创云网络科技有限公司 项目文件存证方法、存证设备及终端设备
US11176519B2 (en) * 2016-11-11 2021-11-16 International Business Machines Corporation Smart contract admission check and fault tolerance in a blockchain
WO2018111295A1 (en) * 2016-12-16 2018-06-21 Hitachi, Ltd. Blockchain monitoring and management
CN107248074A (zh) * 2017-03-29 2017-10-13 阿里巴巴集团控股有限公司 一种基于区块链的业务处理方法及设备
CN107273759B (zh) * 2017-05-08 2020-07-14 上海点融信息科技有限责任公司 用于保护区块链数据的方法、设备以及计算机可读存储介质
CN107403303B (zh) * 2017-06-16 2020-10-30 兴业数字金融服务(上海)股份有限公司 一种基于区块链存证的电子合同系统的签署方法
CN107464118A (zh) * 2017-08-16 2017-12-12 济南浪潮高新科技投资发展有限公司 一种基于区块链智能合约的数据交易方法
CN107844978A (zh) * 2017-11-30 2018-03-27 中链科技有限公司 一种基于区块链的大宗商品交易处理方法及系统
TWM561279U (zh) * 2018-02-12 2018-06-01 林俊良 用於處理金融資產之策略模型腳本之區塊鏈系統與節點伺服器
CN108305056B (zh) * 2018-03-27 2023-11-10 北京蓝亚盒子科技有限公司 基于区块链的数据处理方法、装置及区块链节点网络
CN108520462B (zh) * 2018-03-30 2020-07-24 阿里巴巴集团控股有限公司 基于区块链的业务执行方法及装置、电子设备
CN108550037B (zh) * 2018-04-11 2022-05-17 北京知金链网络技术有限公司 基于区块链的文件处理方法和装置
CN108648056A (zh) * 2018-05-10 2018-10-12 中链科技有限公司 一种基于区块链的房屋租赁合约处理方法及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018125370A1 (en) * 2016-12-28 2018-07-05 Mastercard International Incorporated Method and system for providing validated, auditable, and immutable inputs to a smart contract
CN107862215A (zh) * 2017-09-29 2018-03-30 阿里巴巴集团控股有限公司 一种数据存储方法、数据查询方法及装置
CN107944868A (zh) * 2017-12-07 2018-04-20 杭州趣链科技有限公司 一种基于区块链智能合约的电子存证系统和管理方法
CN109615383A (zh) * 2018-10-26 2019-04-12 阿里巴巴集团控股有限公司 基于区块链的数据存证、获取方法和装置

Also Published As

Publication number Publication date
TWI706360B (zh) 2020-10-01
CN109615383B (zh) 2021-03-16
CN109615383A (zh) 2019-04-12
CN113283905A (zh) 2021-08-20
TW202016853A (zh) 2020-05-01

Similar Documents

Publication Publication Date Title
WO2020082894A1 (zh) 基于区块链的数据存证、获取方法和装置
CN110046996B (zh) 数据处理方法和装置
CN108681853B (zh) 基于区块链的物流信息传输方法、系统和装置
CN110060162B (zh) 基于区块链的数据授权、查询方法和装置
CN109584066B (zh) 基于区块链的隐私交易及其应用方法和装置
WO2020082887A1 (zh) 一种区块链的交易方法和装置
CN110166442B (zh) 一种基于区块链的数据处理方法和装置
CN111970129B (zh) 一种基于区块链的数据处理方法、设备以及可读存储介质
CN111080295A (zh) 一种基于区块链的电子合同处理方法以及设备
CN110298755B (zh) 一种区块链交易方法和装置
US11423473B2 (en) Blockchain-based leasing
CN108377187A (zh) 一种基于生物特征的区块链私钥使用方法与装置
WO2020051710A1 (en) System and process for managing digitized security tokens
TW202018567A (zh) 基於區塊鏈的隱私交易方法、裝置及其應用方法、裝置
CN111192146B (zh) 区块链数据的订正方法及装置
CN111211911B (zh) 一种协同签名方法、装置、设备及系统
CN113255014B (zh) 一种基于区块链的数据处理方法以及相关设备
CN111985007A (zh) 一种基于区块链的合同签署与执行方法及装置
CN112149077B (zh) 基于区块链技术的供应链票据方法、系统和计算机设备
CN110347750B (zh) 基于区块链的数据处理方法和装置
CN111669434A (zh) 一种通信群组的建立方法、系统、装置及设备
CN109388923B (zh) 一种程序执行方法及装置
CN110458541B (zh) 基于区块链的对象置换方法及装置
CN110781526A (zh) 数字奖章创建方法、装置、电子设备及介质
CN114519206B (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: 19877231

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19877231

Country of ref document: EP

Kind code of ref document: A1