Data storage, acquisition method and device based on blockchain

By deploying smart contracts on the blockchain, generating evidence identification images and obtaining data through image recognition, the problems of data tampering and privacy protection in blockchain data processing are solved, and efficient data storage and acquisition are achieved, and enhanced Data security and fairness.

CN113283905BActive Publication Date: 2024-12-24ANTCHAIN TECHNOLOGY PTE LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110507765.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-10-26
Publication Date
2024-12-24
Estimated Expiration
2038-10-26

AI Technical Summary

Technical Problem

The existing blockchain data processing process has problems with data tampering and privacy protection in the process of evidence storage and data acquisition, and lacks an efficient evidence storage and acquisition mechanism.

Method used

By deploying smart contracts on the blockchain, the proof-deposit party node device sends target event data and generates proof-deposit identification images. The acquisition party node device obtains the smart contract identifier to obtain data by identifying the image. The smart contract executes data storage and acquisition logic. Ensure decentralized storage and security of data.

Benefits of technology

It realizes decentralized storage and security of data, improves evidence storage and acquisition efficiency, reduces artificial intervention, increases fairness and data immutability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113283905B_ABST
    Figure CN113283905B_ABST
Patent Text Reader

Abstract

One or more embodiments of the present specification provide a blockchain-based data notarization and acquisition method and device, which are applied to a blockchain including a notarization node device and an acquisition node device; a smart contract for data storage and reading is deployed on the blockchain; the blockchain-based event notarization method includes: the notarization node device sends a first target transaction to the blockchain, and the first target transaction includes target event data to be stored; calling the smart contract, executing the data storage logic declared by the smart contract, and storing the target event data to the smart contract; generating a notarization identification image based at least on the identification of the smart contract.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method and device for storing and acquiring data based on blockchain. Background Art

[0002] 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 been widely used in many fields because of its decentralized, open and transparent characteristics, each computing device can participate in database records, and data can be quickly synchronized between computing devices. Summary of the invention

[0003] In view of the current status of the blockchain data processing flow proposed above, this specification provides a blockchain-based event evidence storage method, which is applied to a blockchain including an evidence storage node device; a smart contract for data storage and reading is deployed on the blockchain; the method includes:

[0004] The depository node device sends a first target transaction to the blockchain, where the first target transaction includes target event data to be stored;

[0005] Calling the smart contract, executing the data storage logic declared by the smart contract, and storing the target event data in the smart contract;

[0006] Generate a proof identification image based at least on the identification of the smart contract.

[0007] In yet another illustrated embodiment, the target data further includes a digital signature made by a party related to the target event, so that the acquiring node device can verify the target event data based on the digital signature;

[0008] The generating of the evidence identification image based at least on the identification of the smart contract includes:

[0009] Generate a proof identification image based at least on the identification of the smart contract and the identity name of the party related to the target event.

[0010] In another illustrated embodiment, generating a storage identification image based at least on the identification of the smart contract includes:

[0011] Encode at least the identifier of the smart contract according to a preset encoding rule to generate a digital code for storage;

[0012] According to the preset mapping relationship between the code and the color and the preset color block generation order, the stored digital code is sequentially generated into color blocks with a preset style.

[0013] In yet another illustrated embodiment, the method further comprises:

[0014] Receiving a mapping code assigned by the smart contract to the target event data;

[0015] The generating of the evidence identification image based at least on the identification of the smart contract includes:

[0016] Generate a proof identification image based at least on the identification of the smart contract and the mapping code.

[0017] In yet another illustrated embodiment, the method further comprises:

[0018] Sending a data acquisition permission transaction of a target user to the blockchain, wherein the data acquisition permission transaction is used to set the target user's acquisition permission for the target event data;

[0019] The smart contract is called to execute the logic of setting the user's data acquisition authority declared in the smart contract, and the authority to obtain the target event data is set for the target user.

[0020] In yet another illustrated embodiment, the method further comprises:

[0021] Receive a notification message sent by the smart contract that the acquirer node device acquires the target data.

[0022] This specification also provides a blockchain-based event acquisition method, which is applied to a blockchain including a depository node device and an acquirer node device; a smart contract with stored target event data is deployed on the blockchain; the method includes:

[0023] The acquiring node device identifies the evidence storage identification image provided by the evidence storage node device to at least obtain the identification of the smart contract; wherein the evidence storage identification image is generated based on at least the identification of the smart contract;

[0024] Sending a second target transaction to the blockchain, wherein the second target transaction includes an identifier of the smart contract;

[0025] The smart contract is called, the data acquisition logic declared in the smart contract is executed, and the target event data is acquired.

[0026] In yet another illustrated embodiment, the target event data further includes a digital signature made by a party associated with the target event;

[0027] The method further comprises:

[0028] The target data is verified based on the digital signature.

[0029] In another illustrated embodiment, the identifying the stored identification image to obtain at least the identification of the smart contract includes:

[0030] According to a preset color block generation sequence and a preset mapping relationship between digital codes and colors, the colors of the color blocks are sequentially converted into digital codes for storage;

[0031] According to a preset decoding rule, the digital code of the stored evidence is decoded to obtain at least the identifier of the smart contract.

[0032] In yet another illustrated embodiment, the evidence identification image is generated based on at least an identification of the smart contract and a mapping code assigned by the smart contract to the target event data;

[0033] The identifying the stored identification image to obtain at least the identification of the smart contract includes: identifying the stored identification image to obtain at least the identification of the smart contract and the mapping code;

[0034] The second target transaction also includes the mapping code.

[0035] In another illustrated embodiment, the smart contract sets the acquisition party with the acquisition right to the target event data; the executing the data acquisition logic declared by the smart contract to acquire the target event data includes:

[0036] Obtaining the acquisition authority of the acquisition party to the target event data;

[0037] Based on the acquisition authority of the acquirer to the target data, the data acquisition logic declared in the smart contract is executed.

[0038] Accordingly, this specification also provides a blockchain-based event evidence storage device, which is applied to a blockchain including an evidence storage node device; a smart contract for data storage and reading is deployed on the blockchain; the device includes:

[0039] A sending unit, wherein the depository node device sends a first target transaction to the blockchain, wherein the first target transaction includes target event data to be stored;

[0040] A smart contract execution unit, calling the smart contract, executing the data storage logic declared by the smart contract, and storing the target event data in the smart contract;

[0041] An image generation unit generates a storage identification image based at least on the identification of the smart contract.

[0042] In another illustrated embodiment, the target data further includes a digital signature made by a party related to the target event, so that the acquiring node device can verify the target event data based on the digital signature;

[0043] The image generating unit:

[0044] Generate a proof identification image based at least on the identification of the smart contract and the identity name of the party related to the target event.

[0045] In yet another illustrated embodiment, the image generation unit:

[0046] Encode at least the identifier of the smart contract according to a preset encoding rule to generate a digital code for storage;

[0047] According to the preset mapping relationship between the code and the color and the preset color block generation order, the stored digital code is sequentially generated into color blocks with a preset style.

[0048] In yet another illustrated embodiment, the device further comprises:

[0049] A receiving unit, receiving a mapping code assigned by the smart contract to the target event data;

[0050] The image generating unit:

[0051] Generate a proof identification image based at least on the identification of the smart contract and the mapping code.

[0052] In yet another illustrated embodiment, the sending unit:

[0053] Sending a data acquisition permission transaction of a target user to the blockchain, wherein the data acquisition permission transaction is used to set the target user's acquisition permission for the target event data;

[0054] The smart contract execution unit calls the smart contract, executes the logic of setting the user's data acquisition authority declared in the smart contract, and sets the authority for the target user to obtain the target event data.

[0055] In another illustrated embodiment, the device further includes a receiving unit: receiving a notification message sent by the smart contract that the acquirer node device acquires the target data.

[0056] Accordingly, the present specification also provides a blockchain-based event acquisition device, which is applied to a blockchain including a depository node device and an acquisition node device; a smart contract with stored target event data is deployed on the blockchain; the device includes:

[0057] An image recognition unit, wherein the evidence storage node device recognizes the evidence storage identification image provided by the evidence storage node device to at least obtain the identification of the smart contract; wherein the evidence storage identification image is generated based on at least the identification of the smart contract;

[0058] A sending unit, sending a second target transaction to the blockchain, where the second target transaction includes an identifier of the smart contract;

[0059] The smart contract execution unit calls the smart contract, executes the data acquisition logic declared in the smart contract, and acquires the target event data.

[0060] In yet another illustrated embodiment, the target event data further includes a digital signature made by a party associated with the target event;

[0061] The device also includes:

[0062] A data verification unit verifies the target data based on the digital signature.

[0063] In yet another illustrated embodiment, the image recognition unit:

[0064] According to a preset color block generation sequence and a preset mapping relationship between digital codes and colors, the colors of the color blocks are sequentially converted into digital codes for storage;

[0065] According to a preset decoding rule, the digital code of the stored evidence is decoded to obtain at least the identifier of the smart contract.

[0066] In yet another illustrated embodiment, the evidence identification image is generated based on at least an identification of the smart contract and a mapping code assigned by the smart contract to the target event data;

[0067] The image recognition unit is configured to recognize the stored identification image to obtain at least the identification of the smart contract and the mapping code;

[0068] The second target transaction also includes the mapping code.

[0069] In another illustrated embodiment, the smart contract sets the acquisition authority of the target event data for the acquirer; the smart contract execution unit:

[0070] Obtaining the acquisition authority of the acquisition party to the target event data;

[0071] Based on the acquisition authority of the acquirer to the target data, the data acquisition logic declared in the smart contract is executed.

[0072] This specification also provides a computer device, including: a memory and a processor; the memory stores a computer program that can be executed by the processor; when the processor runs the computer program, it executes the steps described in the above-mentioned blockchain-based event notarization method.

[0073] This specification also provides a computer device, including: a memory and a processor; the memory stores a computer program that can be executed by the processor; when the processor runs the computer program, it executes the steps described in the above-mentioned blockchain-based event acquisition method.

[0074] The blockchain-based data storage and acquisition method and device provided in this specification deploys a smart contract for data storage and reading on the blockchain, and the smart contract can execute data storage or reading in response to the user's call. Based on the distributed database storage mechanism of blockchain technology, the target data stored by the user of the evidence depository in the smart contract is decentralized and recorded in all nodes, and is jointly maintained by the nodes of all participating parties; based on the consensus mechanism of blockchain, the data information provided by each user of the evidence depository will not be tampered with after being provided, thereby achieving the effect of storing the target data. The evidence depository generates a storage identification image based on at least the identification of the smart contract, so that the acquiring party can obtain the identification of the above-mentioned smart contract by identifying the storage identification image through the image, and then call the smart contract to obtain the above-mentioned target data.

[0075] Smart contracts can complete the storage or acquisition of target data at any time in response to user calls, greatly improving the efficiency of storing or acquiring target data; and smart contract execution has the advantages of low human intervention and decentralized authority, which further increases the fairness of data storage and acquisition. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 A flowchart of a method for storing and acquiring data based on blockchain provided as an exemplary embodiment of this specification;

[0077] Figure 2 A schematic diagram of an evidence storage identification image provided in yet another embodiment of this specification;

[0078] Figure 3 A schematic diagram of a blockchain-based data evidence storage device provided as an exemplary embodiment of this specification;

[0079] Figure 4 A schematic diagram of a data acquisition device based on blockchain provided by an exemplary embodiment of this specification;

[0080] Figure 5 A hardware structure diagram for running the blockchain-based data storage or verification device embodiment provided by the exemplary embodiment of this specification. DETAILED DESCRIPTION

[0081] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0082] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0083] like Figure 1 As shown, an illustrative embodiment of the present specification provides a target event notarization and acquisition method based on blockchain, which is applied to a blockchain including a notarization node device and an acquisition node device, and a smart contract for data storage and reading is deployed on the blockchain.

[0084] 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. The data in the blockchain is distributed in "blocks" connected 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.), the data of all or part of the node devices are fully backed up. It is well known to those skilled in the art that since the blockchain system operates under the corresponding consensus mechanism, the data included in the blockchain database is difficult to be tampered by any node device. For example, for a blockchain using Pow consensus, at least 51% of the computing power of the entire network is required to tamper with the existing data. Therefore, the blockchain system has the characteristics of ensuring data security and preventing attacks and tampering that other centralized database systems cannot match.

[0085] In addition, it is worth noting that the node devices described in this specification may include not only full-node devices that back up the full data of the distributed database of the blockchain, but also light-node devices that back up partial data of the distributed database of the blockchain, as well as other terminal devices or clients, which are not limited in this specification.

[0086] The smart contract deployed on the blockchain is an executable computer program language that is verified by the consensus of the blockchain's node devices and saved in the blockchain's distributed database; any node device on the blockchain can receive a call to a smart contract from a blockchain user to execute the logic declared in the smart contract; the above execution results can also be saved in the blockchain's distributed database after being verified by the consensus of the blockchain's node devices.

[0087] In this embodiment, a smart contract for storing and reading data is deployed on the blockchain. Users can send transactions to the account address or other identifier of the smart contract, call the interface of the smart contract, and the corresponding function to complete the operation of storing data in the smart contract or reading the data stored in the smart contract.

[0088] like Figure 1 As shown, the blockchain-based data storage method provided in this embodiment includes:

[0089] Step 102: The depository node device sends a first target transaction to the blockchain, where the first target transaction includes target event data to be stored.

[0090] The transaction described in this specification refers to a piece of data created by a user through a node device of a blockchain and ultimately published to a distributed database of the blockchain. Among them, transactions in the blockchain are divided into transactions in a narrow sense and transactions in a broad sense. A transaction in a narrow sense refers to a transfer of value published by a user to the blockchain. A transaction in a broad sense refers to any data published by a user to the blockchain. The first target transaction described in this embodiment includes target event data to be stored, and the target event data may include data describing the process of all or part of the event, or data describing the characteristic values ​​of the event, etc. It may be specifically manifested in various forms such as contracts, notices, instructions, business profiles, orders, etc., which are not limited in this specification. In order to prevent other nodes in the blockchain from knowing the original text of the target event data, causing the leakage of some privacy information, the target event data may be encrypted, and the first target transaction containing the ciphertext of the target event data may be sent to the blockchain.

[0091] It is easy for those skilled in the art to know that the evidence storage party described in this embodiment may be the above-mentioned target event-related party or one of the target event-related parties, or may not be one of the above-mentioned target event-related parties, but act as a neutral party or event evidence storage institution to execute the event evidence storage method described in the embodiments of this specification.

[0092] In another illustrated embodiment, the target event data also includes digital signatures made by parties related to the target event, such as digital signatures made by the signatory of the contract on the body of the contract, digital signatures made by the issuer of the notice on the body of the notice, digital signatures made by the author of the specification on the body of the specification, digital signatures made by the orderer on the content of the order, digital signatures made by the sender of the email on the body of the email, etc. Similar to signatures in actual business, the digital signatures can be expressed as the recognition of the target event data by parties related to the target event, such as digital signatures made by the signatory of the contract on the electronic contract, etc.

[0093] A digital signature is a mathematical encryption of the mathematical summary of the data content that the signer approves based on his own private key; by verifying the digital signature, not only can the identity corresponding to the signer's public key be verified, but also by comparing the mathematical summary encrypted by the private key with the mathematical summary obtained from the existing data content, it can be verified 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 can usually verify the identity of the signatory of the target event data and whether the content of the target event data has been tampered with.

[0094] After the first target transaction has been verified by the consensus of the blockchain node device, the first target transaction can be included in the distributed database of the blockchain; any node device in the blockchain, including the evidence depository node device, can receive the first target transaction sent by the evidence depository node device to the blockchain, so as to call the above-mentioned smart contract based on the address of the smart contract in the first target transaction.

[0095] 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.

[0096] The process of storing the target event data in the smart contract can also be regarded as a process of updating the smart contract in the distributed database of the blockchain. In an illustrated embodiment, storing the target event data in the smart contract includes:

[0097] The node with bookkeeping authority in the blockchain adds the smart contract code storing the target event data to the candidate block;

[0098] Determining a consensus accounting node that satisfies the blockchain consensus mechanism from the nodes with accounting authority;

[0099] The consensus accounting node broadcasts the candidate block to the nodes of the blockchain;

[0100] After the candidate block is verified and approved by a preset number of nodes of the blockchain, the candidate block is regarded as the latest block and added to the distributed database of the blockchain.

[0101] In the above embodiment, the node with accounting authority refers to the node with the authority to generate the candidate block, which may include the depository node device, the acquisition node device and other node devices in the above blockchain described in this specification. According to the consensus mechanism of the blockchain, the consensus accounting node can be determined from the nodes with accounting authority for the candidate block, and the above consensus mechanism may include the proof of work mechanism (PoW), or the proof of rights mechanism (PoS), or the share authorization proof mechanism (DPoS), or the PBFT algorithm mechanism, etc.

[0102] Based on the above specific process, 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 notarization of the above target event data.

[0103] When the target event data included in the above-mentioned first target transaction is in an encrypted ciphertext state, the above-mentioned smart contract can either decrypt the above-mentioned ciphertext and store the original text of the above-mentioned target event data in the smart contract; or directly store the ciphertext of the above-mentioned target event data, which is not limited in this specification.

[0104] In this embodiment, in order to facilitate other users to obtain the above-mentioned stored target event data, the node device of the storage party may also perform step 106: at least generate a storage identification image based on the identification of the smart contract, so that other users can obtain the identification of the smart contract based on image recognition, thereby calling the smart contract in the above-mentioned blockchain, executing the data acquisition logic declared by the smart contract, and obtaining the target event data. The identification of the above-mentioned smart contract may generally include the address of the smart contract, or the account name of the smart contract, or the digital summary value of the smart contract, etc., which can uniquely identify the identification of the above-mentioned smart contract.

[0105] In another illustrated embodiment, when the target data also includes a digital signature made by the target event-related party, in order to facilitate the acquisition node device of the target event data to verify the target event data based on the digital signature after acquiring the target event data - for example, verifying the identity of the target event-related party, or verifying 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 above-mentioned evidence identification image can be generated based on the identification of the above-mentioned smart contract and the identity name of the target event-related party.

[0106] The deposit identification image representing the identification of the smart contract or the identity name of the relevant party of the target event can usually be in the form of a digital image such as a QR code or a barcode, and the identification of the smart contract or / and the identity name of the relevant party of the target event can be conveniently obtained by scanning the image, so as to be used for obtaining or / and verifying the target event data; however, the deposit identification image in the form of the above QR code or barcode usually cannot intuitively reflect the data information it represents.

[0107] Figure 2 Figure 4 shows a deposit identification image provided by an exemplary embodiment of this specification. The deposit identification image is a picture (including colors) generated at least based on the identification of the smart contract. For example, at least the identification of the smart contract is encoded according to a preset encoding rule to generate a deposit digital code, and according to the mapping relationship between the preset encoding and colors, the deposit digital code is sequentially generated into color blocks of corresponding colors. Optionally, the above color blocks can be patterns with a fixed style, such as Figure 2 the flowers shown in Figure 5, and a color picture can be generated according to the order of the generation of the above color blocks (such as Figure 2 the order of petals 1 to 8 shown in Figure 6).

[0108] When the deposit identification image also includes the identity name information of the relevant party of the target event, the identity name of the relevant party of the target event can be presented together with the above color picture in the form of a handwritten signature, such as Figure 2 the handwritten signature "Lin Li" (labeled 9) shown in Figure 7. Compared with the deposit identification image presented in the form of the above QR code or barcode, Figure 2 for the deposit identification image presented in the form of a color picture plus a handwritten signature shown in Figure 8, the acquiring user can directly obtain the identity name of the relevant party of the target event to be acquired or verified by observing the handwritten signature, which has better intuitiveness, and can also identify the user name of the relevant party of the event by identifying the above handwritten signature through image recognition; compared with the image styles of barcodes or QR codes, Figure 2 the color pattern shown in Figure 9 also has better aesthetics.

[0109] The smart contract for data storage and reading described in the above embodiment can be used to store evidence for a specified target business event, or multiple target business events; it can be used to store evidence for multiple target event data for a target event, or multiple target event data for multiple target events. When the above smart contract is used to store evidence for multiple target business events or multiple target event data for a target business event, the above smart contract can also assign a corresponding mapping code to the above target event data, so that the acquirer of the target event data can obtain the corresponding target event data based on the mapping code. The above mapping code may include a serial number assigned by the above smart contract to the target event data, and may also include an identification number assigned by the above smart contract to the name of the relevant party of the target event data, and so on. Accordingly, the above-mentioned generation of the evidence identification image based at least on the identification of the smart contract should also include: generating the evidence identification image based at least on the identification of the smart contract and the mapping code.

[0110] In order to ensure that the target event data will not be obtained by any blockchain user calling the smart contract, and to ensure the privacy and security of the target event data, the smart contract can also set the access rights of different blockchain users to the target event data. The access rights may include: not being able to obtain any target event data, being able to obtain a preset part of the target event data, being able to obtain all the target event data, etc., which can be set according to the specific scenario of the smart contract application. The setting of the access rights to the target event data can be set by the deployer of the smart contract before the smart contract is deployed on the chain, or by the administrator user with permission settings after the smart contract is deployed, or by the depository of the target event according to the specific target event.

[0111] In one illustrated embodiment, the process of setting the target user's data acquisition rights by the depository of the target event includes: any node device in the blockchain (including the depository node device) receives the target user's data acquisition rights transaction sent by the depository node device to the blockchain, and the data acquisition rights transaction is used to set the target user's access rights to the target event data; calling the smart contract, executing the logic of setting the user's data acquisition rights declared in the smart contract, and setting the target user's access rights to the target event data.

[0112] In order to ensure that the evidence depository node device monitors the acquisition of the above-mentioned target event data to ensure the security of the data, including timely notifying the acquirer user who has obtained the above-mentioned target event data from the above-mentioned smart contract, in another illustrated embodiment, the smart contract also declares an acquisition message notification logic, which is used to send a notification message to the evidence depository of the above-mentioned target event data regarding the acquirer node device acquiring the above-mentioned target event data; accordingly, the above-mentioned evidence depository node device can receive the notification message sent by the above-mentioned smart contract regarding the acquirer node device acquiring the above-mentioned target event data.

[0113] One or more of the above embodiments describe one or more event evidence storage methods based on blockchain. After the evidence storage node device completes the evidence storage of the target event data, the evidence storage party can send the evidence identification image to any blockchain node device that needs to obtain or verify the target event data, so that the node device can obtain the target event data as the acquiring node device. Figure 1 As shown, the process of obtaining the above target event data may include:

[0114] Step 108: the acquiring node device identifies the evidence storage identification image provided by the evidence storage node device to at least obtain the identification of the smart contract; wherein the evidence storage identification image is generated based on at least the identification of the smart contract;

[0115] Step 110, sending a second target transaction to the blockchain, where the second target transaction includes an identifier of the smart contract;

[0116] Step 108: call the smart contract, execute the data acquisition logic declared in the smart contract, and acquire the target event data.

[0117] As mentioned above, the above-mentioned target event data may include data describing the process of occurrence of all or part of the target event, or data describing the characteristic values ​​of the target event, etc., which can be specifically expressed in various forms such as contracts, notices, instructions, business profiles, orders, etc., and are not limited in this specification.

[0118] In another illustrated embodiment, the target event data also includes digital signatures made by parties related to the target event, such as digital signatures made by the signatory of the contract on the body of the contract, digital signatures made by the issuer of the notice on the body of the notice, digital signatures made by the author of the specification on the body of the specification, digital signatures made by the orderer on the content of the order, digital signatures made by the sender of the email on the body of the email, etc. Similar to signatures in actual business, the digital signatures can be expressed as the recognition of the target event data by parties related to the target event, such as digital signatures made by the signatory of the contract on the electronic contract, etc.

[0119] Correspondingly, the above-mentioned blockchain-based event acquisition method also includes: verifying the target data based on the digital signature. A digital signature is a mathematical encryption of 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 signer's public key be obtained, and then the above-mentioned public key is provided to the identity authentication agency for identity authentication, so as to know the identity corresponding to the signer's public key, but also by comparing the mathematical summary encrypted by the above-mentioned private key with the mathematical summary obtained from the existing data content, it can be verified whether the existing data content is consistent with the data content signed by the signer, so as to know whether the existing data content has been tampered with. Therefore, in this embodiment, by verifying the above-mentioned digital signature, the acquirer of the target event data can usually verify the identity of the signatory of the target event data and whether the content of the target event data has been tampered with.

[0120] In another illustrated embodiment, when the target data also includes a digital signature made by the target event-related party, in order to facilitate the acquisition node device of the target event data to verify the target event data based on the digital signature after acquiring the target event data - for example, verifying the identity of the target event-related party, or verifying 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 above-mentioned evidence identification image can be generated based on the identification of the above-mentioned smart contract and the identity name of the target event-related party.

[0121] The evidence identification image representing the identifier of the smart contract or the identity name of the party related to the target event can usually be in the form of digital images such as QR code or bar code, so that the identifier of the smart contract and / or the identity name of the party related to the target event can be easily obtained by scanning the image code, so as to obtain and / or verify the target event data; however, the evidence identification image in the form of the above-mentioned QR code or bar code usually cannot intuitively reflect the data information it represents.

[0122] Figure 2 The example of an exemplary embodiment of the present specification provides a storage identification image, which is a picture (including color) generated based on at least the identification of the smart contract. For example, at least the identification of the smart contract is encoded according to a preset encoding rule to generate a storage digital code, and according to a preset mapping relationship between the code and the color, the storage digital code is sequentially generated into color blocks of corresponding colors. Optionally, the color block can be a pattern with a fixed style, such as Figure 2 The flowers shown in the figure can be generated in the order of the above color blocks (such as Figure 2 The acquiring party may scan the above color picture through an image recognition terminal and generate a color picture according to the generation order of the color blocks (such as Figure 2in the order of the shown petals 1 to 8), identify the color of the color blocks with the preset style; according to the mapping relationship between the preset digital code and the color, decode the color of the color blocks to obtain the digital code for evidence storage; according to the preset decoding rule, decode the digital code for evidence storage to at least obtain the identifier of the smart contract.

[0123] When the evidence storage identification image further includes the identity name information of the relevant party of the target event, the identity name of the relevant party of the target event can be presented together with the above color picture in the form of a handwritten signature, such as Figure 2 the shown handwritten signature "Lin Li" (labeled as 9). Compared with the evidence storage identification image presented in the form of a two-dimensional code or a bar code, Figure 2 for the evidence storage identification image presented in the form of a color picture plus a handwritten signature as shown, the acquiring user can directly obtain the identity name of the relevant party of the target event to be acquired or verified by observing the handwritten signature, which has better intuitiveness, or can also identify the user name of the relevant party of the event by identifying the handwritten signature through image recognition; compared with the image style of the bar code or the two-dimensional code, Figure 2 the shown color pattern also has better aesthetics.

[0124] The smart contract for data storage and reading described in the above embodiments can be used to store evidence for a specified target business event, or can be used to store evidence for multiple target business events; it can be used to store evidence for multiple target event data of one target event, or can be used to store evidence for the target event data of multiple target events. When the smart contract is used to store evidence for multiple target business events or for multiple target event data of one target business event, the smart contract can also assign corresponding mapping codes to the target event data, so that the acquirer of the target event data can obtain the corresponding target event data based on the mapping code. The mapping code can include the serial number assigned by the smart contract to the target event data, or can also include the identification number assigned by the smart contract to the name of the relevant party of the target event data, etc. Correspondingly, the generation of the evidence storage identification image based at least on the identifier of the smart contract should also include: generating the evidence storage identification image based at least on the identifier of the smart contract and the mapping code. After the acquirer node device performs the identification of the evidence storage 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 smart contract and obtain the corresponding target event data based on the mapping code.

[0125] In order to ensure that the target event data will not be obtained by any blockchain user calling the smart contract, and to ensure the privacy and security of the target event data, the smart contract can also set the access rights of different blockchain users to the target event data. The access rights may include: not being able to obtain any target event data, being able to obtain a preset part of the target event data, being able to obtain all the target event data, etc., which can be set according to the specific scenario of the smart contract application. The setting of the access rights to the target event data can be set by the deployer of the smart contract before the smart contract is deployed on the chain, or by the administrator user with permission settings after the smart contract is deployed, or by the depository of the target event according to the specific target event.

[0126] Therefore, the execution of the data acquisition logic declared by the smart contract to acquire the target data includes: obtaining the acquisition authority of the acquirer to the target data; and executing the data acquisition logic declared by the smart contract based on the acquisition authority of the acquirer to the target data. Specifically, the setting of the data acquisition authority of the acquirer can be achieved by setting a user whitelist, a user blacklist, a user authority setting table and other technical means, which will not be repeated here.

[0127] Corresponding to the above process implementation, the embodiments of this specification also provide a blockchain-based event evidence storage device and a blockchain-based event acquisition device. The device can be implemented by software, hardware, or a combination of software and hardware. Taking software implementation as an example, as a device in the logical sense, the CPU (Central Process Unit) of the device reads the corresponding computer program instructions into the memory and runs them. From the hardware level, in addition to Figure 5 In addition to the CPU, memory and storage shown, the device where the network risk business implementation device is located usually also includes other hardware such as chips for sending and receiving wireless signals, and / or other hardware such as boards for implementing network communication functions.

[0128] like Figure 3 As shown, this specification also provides a blockchain-based event evidence storage device 30, which is applied to a blockchain including an evidence storage node device; a smart contract for data storage and reading is deployed on the blockchain; the device 30 includes:

[0129] The sending unit 302, the depository node device sends a first target transaction to the blockchain, where the first target transaction includes target event data to be stored;

[0130] A smart contract execution unit 304 calls the smart contract, executes the data storage logic declared in the smart contract, and stores the target event data in the smart contract;

[0131] The image generation unit 306 generates a storage identification image based at least on the identification of the smart contract.

[0132] In yet another illustrated embodiment, the target event data further includes a digital signature made by a party related to the target event, so that the acquiring node device can verify the target event data based on the digital signature;

[0133] The image generating unit 306:

[0134] Generate a proof identification image based at least on the identification of the smart contract and the identity name of the party related to the target event.

[0135] In yet another illustrated embodiment, the image generation unit 306:

[0136] Encode at least the identifier of the smart contract according to a preset encoding rule to generate a digital code for storage;

[0137] According to the preset mapping relationship between the code and the color and the preset color block generation order, the stored digital code is sequentially generated into color blocks with a preset style.

[0138] In yet another illustrated embodiment, the device 30 further comprises:

[0139] A receiving unit 308 receives a mapping code assigned by the smart contract to the target event data;

[0140] The image generating unit 306:

[0141] Generate a proof identification image based at least on the identification of the smart contract and the mapping code.

[0142] In yet another illustrated embodiment, the sending unit 302:

[0143] Sending a data acquisition permission transaction of a target user to the blockchain, wherein the data acquisition permission transaction is used to set the target user's acquisition permission for the target event data;

[0144] The smart contract execution unit 304 calls the smart contract, executes the logic of setting the user's data acquisition authority declared in the smart contract, and sets the authority for the target user to obtain the target event data.

[0145] In another illustrated embodiment, the device 30 further includes a receiving unit 310: receiving a notification message sent by the smart contract that the acquirer node device acquires the target data.

[0146] Correspondingly, such as Figure 4 As shown, this specification also provides a blockchain-based event acquisition device 40, which is applied to a blockchain including a depository node device and an acquisition node device; a smart contract with stored target event data is deployed on the blockchain; the device 40 includes:

[0147] The image recognition unit 402, the evidence storage node device recognizes the evidence storage identification image provided by the evidence storage node device to at least obtain the identification of the smart contract; wherein the evidence storage identification image is generated based on at least the identification of the smart contract;

[0148] A sending unit 404 sends a second target transaction to the blockchain, where the second target transaction includes an identifier of the smart contract;

[0149] The smart contract execution unit 406 calls the smart contract, executes the data acquisition logic declared in the smart contract, and acquires the target event data.

[0150] In yet another illustrated embodiment, the target event data further includes a digital signature made by a party associated with the target event;

[0151] The device 40 further comprises:

[0152] The data verification unit 408 verifies the target data based on the digital signature.

[0153] In yet another illustrated embodiment, the image recognition unit 402:

[0154] According to a preset color block generation sequence and a preset mapping relationship between digital codes and colors, the colors of the color blocks are sequentially converted into digital codes for storage;

[0155] According to a preset decoding rule, the digital code of the stored evidence is decoded to obtain at least the identifier of the smart contract.

[0156] In yet another illustrated embodiment, the evidence identification image is generated based on at least an identification of the smart contract and a mapping code assigned by the smart contract to the target event data;

[0157] The image recognition unit 402: recognizes the stored identification image to obtain at least the identification of the smart contract and the mapping code;

[0158] The second target transaction also includes the mapping code.

[0159] In another illustrated embodiment, the smart contract sets the acquisition authority of the target event data for the acquirer; the smart contract execution unit 404:

[0160] Obtaining the acquisition authority of the acquisition party to the target event data;

[0161] Based on the acquisition authority of the acquirer to the target data, the data acquisition logic declared in the smart contract is executed.

[0162] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically detailed in the implementation process of the corresponding steps in the above-mentioned method. For relevant parts, please refer to the partial description of the method embodiment, which will not be repeated here.

[0163] The device embodiments described above are merely illustrative, 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, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the units or modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. Those of ordinary skill in the art may understand and implement it without creative work.

[0164] The devices, units, and modules described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of 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 transceiver, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0165] Corresponding to the above method embodiment, the embodiment of this specification also provides a computer device, which includes a memory and a processor. Among them, the memory stores a computer program that can be run by the processor; when the processor runs the stored computer program, it executes each step of the event evidence method based on blockchain in the embodiment of this specification. For a detailed description of each step of the event evidence method based on blockchain, please refer to the previous content and will not be repeated.

[0166] Corresponding to the above method embodiment, the embodiment of this specification also provides a computer device, which includes a memory and a processor. Among them, the memory stores a computer program that can be run by the processor; when the processor runs the stored computer program, it executes each step of the event acquisition method based on blockchain in the embodiment of this specification. For a detailed description of each step of the event acquisition method based on blockchain, please refer to the previous content and will not be repeated.

[0167] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

[0168] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0169] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0170] Computer readable media include permanent and non-permanent, removable and non-removable media and can store information by any method or technology. The information can be computer readable instructions, data structures, program modules or other data.

[0171] 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0172] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0173] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, the embodiments of this specification may take the form of complete hardware embodiments, complete software embodiments or embodiments combining software and hardware. Moreover, the embodiments of this specification may take the form of a computer program product 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 codes.

Claims

1. A blockchain-based event evidence storage method, applied to node devices in the blockchain; A smart contract for data storage and reading is deployed on the blockchain; the method comprises: Receiving a first target transaction sent by a depositor, wherein the first target transaction includes target event data to be stored; In response to the first target transaction, calling the smart contract, executing the data storage logic declared by the smart contract, and storing the target event data in the smart contract; Receiving a mapping code assigned by the smart contract to the target event data; A storage identification image corresponding to the target event data is generated based at least on the identifier of the smart contract and the mapping code, and the storage identification image is provided to an acquirer corresponding to the target event data.

2. According to the method of claim 1, the step of generating a storage identification image based at least on the identification of the smart contract comprises: Generate a proof identification image based at least on the identification of the smart contract and the identity name of the party related to the target event.

3. According to the method according to claim 1 or 2, the evidence identification image includes a pattern composed of multiple color blocks with a preset style.

4. The method according to claim 3, wherein generating a storage identification image based at least on the identification of the smart contract comprises: Encode at least the identifier of the smart contract according to a preset encoding rule to generate a digital code for storage; According to the preset mapping relationship between the code and the color, the codes in the digital code of the evidence are sequentially generated into color blocks of corresponding colors, and further according to the preset color block generation order, the generated color blocks are generated into patterns with the preset style.

5. A blockchain-based event acquisition method, applied to node devices in the blockchain; A smart contract storing target event data is deployed on the blockchain; the method comprises: receiving a second target transaction sent by the acquirer, wherein the second target transaction includes the identifier of the smart contract and a mapping code assigned by the smart contract to the target event data; the identifier of the smart contract and the mapping code are acquired by the acquirer by identifying a stored evidence identifier image corresponding to the target event data and provided by the depositor; the stored evidence identifier image is generated based on at least the identifier of the smart contract and the mapping code; In response to the second target transaction, the smart contract is called, the data acquisition logic declared in the smart contract is executed, and the target event data is acquired.

6. According to the method of claim 5, the evidence identification image includes a pattern composed of multiple color blocks with a preset style.

7. According to the method of claim 6, the acquiring party identifies the evidence storage identification image corresponding to the target event data provided by the evidence storage party node device through the following steps: Identify the color blocks in the pattern with the preset style according to the preset color block generation order, and further convert the colors of the identified color blocks into the codes in the digital code for evidence storage according to the preset mapping relationship between digital codes and colors; According to a preset decoding rule, the digital code of the stored evidence is decoded to obtain at least the identifier of the smart contract.

8. An event evidence storage device based on blockchain, applied to node devices in blockchain; A smart contract for data storage and reading is deployed on the blockchain; the device includes: A sending unit, receiving a first target transaction sent by a depositor, wherein the first target transaction includes target event data to be stored; A smart contract execution unit, in response to the first target transaction, calls the smart contract, executes the data storage logic declared by the smart contract, and stores the target event data in the smart contract; A receiving unit, receiving a mapping code assigned by the smart contract to the target event data; An image generation unit generates an evidence identification image corresponding to the target event data based at least on the identifier of the smart contract and the mapping code, and provides the evidence identification image to an acquirer corresponding to the target event data.

9. The device according to claim 8, wherein the image generating unit: Generate a proof identification image based at least on the identification of the smart contract and the identity name of the party related to the target event.

10. According to the device according to claim 8 or 9, the evidence identification image includes a pattern composed of multiple color blocks with a preset style.

11. The device according to claim 10, wherein the image generating unit: Encode at least the identifier of the smart contract according to a preset encoding rule to generate a digital code for storage; According to the preset mapping relationship between the code and the color, the codes in the digital code of the evidence are sequentially generated into color blocks of corresponding colors, and further according to the preset color block generation order, the generated color blocks are generated into patterns with the preset style.

12. A blockchain-based event acquisition device, applied to node devices in blockchain; A smart contract storing target event data is deployed on the blockchain; the device comprises: A sending unit receives a second target transaction sent by an acquirer, wherein the second target transaction includes an identifier of the smart contract and a mapping code assigned by the smart contract to the target event data; the identifier of the smart contract and the mapping code are acquired by the acquirer by identifying a stored evidence identification image corresponding to the target event data and provided by the evidence depositor; the stored evidence identification image is generated based on at least the identifier of the smart contract and the mapping code; The smart contract execution unit, in response to the second target transaction, calls the smart contract, executes the data acquisition logic declared in the smart contract, and acquires the target event data.

13. According to the device of claim 12, the evidence identification image includes a pattern composed of multiple color blocks with a preset style.

14. The apparatus according to claim 13, wherein the acquiring party identifies the evidence storage identification image corresponding to the target event data and provided by the evidence storage party node device through the following steps: Identify the color blocks in the pattern with the preset style according to the preset color block generation order, and further convert the colors of the identified color blocks into the codes in the digital code for evidence storage according to the preset mapping relationship between digital codes and colors; According to a preset decoding rule, the digital code of the stored evidence is decoded to obtain at least the identifier of the smart contract.

15. A computer device comprising: Memory and processor; The memory stores a computer program executable by the processor; When the processor runs the computer program, the processor performs the method according to any one of claims 1 to 4.

16. A computer device comprising: Memory and processor; The memory stores a computer program executable by the processor; When the processor runs the computer program, the processor performs the method according to any one of claims 5 to 7.

Citation Information

Patent Citations

  • Project file recording method and equipment as well as terminal equipment

    CN106156345A

  • Blockchain-based data processing method, device and blockchain node network

    CN108305056A