CN111415161B - Block chain-based data verification method and device and computer readable storage medium - Google Patents

Block chain-based data verification method and device and computer readable storage medium Download PDF

Info

Publication number
CN111415161B
CN111415161B CN202010343356.0A CN202010343356A CN111415161B CN 111415161 B CN111415161 B CN 111415161B CN 202010343356 A CN202010343356 A CN 202010343356A CN 111415161 B CN111415161 B CN 111415161B
Authority
CN
China
Prior art keywords
target
verification
transaction data
service node
tree root
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010343356.0A
Other languages
Chinese (zh)
Other versions
CN111415161A (en
Inventor
刘攀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tenpay Payment Technology Co Ltd
Original Assignee
Tenpay Payment Technology Co Ltd
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 Tenpay Payment Technology Co Ltd filed Critical Tenpay Payment Technology Co Ltd
Priority to CN202010343356.0A priority Critical patent/CN111415161B/en
Publication of CN111415161A publication Critical patent/CN111415161A/en
Application granted granted Critical
Publication of CN111415161B publication Critical patent/CN111415161B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or 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/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • G06Q20/4014Identity check for transactions
    • 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
    • G06Q30/00Commerce
    • G06Q30/04Billing or invoicing
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/12Accounting
    • G06Q40/123Tax preparation or submission
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • Finance (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Development Economics (AREA)
  • Computer Security & Cryptography (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Technology Law (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The application discloses a data verification method, a device and a computer readable storage medium based on a blockchain, which are applied to a first service node, wherein the method comprises the following steps: acquiring target transaction data and sending the target transaction data to a second service node; the target transaction data belongs to a first service chain of the second service node; acquiring verification confirmation information returned by the second service node; the verification confirmation information is information of the merck tree root for generating the target block; the target block is a block where target transaction data stored on the first service chain is located; obtaining a data verification result of the target transaction data according to the verification confirmation information and the target merck tree root corresponding to the target transaction data; the target merck tree root is the merck tree root stored in the second service chain and associated with the target block; the second service chain is a service chain held by the first service node. By adopting the method and the device, the verification reliability of the target transaction data can be improved.

Description

Block chain-based data verification method and device and computer readable storage medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a data verification method and apparatus based on a blockchain, and a computer readable storage medium.
Background
Due to the non-tamperability of data stored in the blockchain network, in many business processing scenarios, the authenticity of certain transaction data (the actual transaction data of which exists in the blockchain network) that is subsequently acquired is often verified by the transaction data stored in the blockchain network.
In the prior art, a plurality of blockchains can exist, different transaction data can be stored in each blockchain, and each blockchain can verify the transaction data held by the blockchain, namely, the authenticity of the transaction data is verified. Therefore, when a certain blockchain is tampered maliciously, the subsequent blockchain tampered maliciously is likely to be unreliable in verification of the transaction data of the blockchain.
Disclosure of Invention
The application provides a data verification method, device and computer readable storage medium based on a blockchain, which can improve verification reliability of target transaction data.
In one aspect, the present application provides a blockchain-based data verification method, which is executed by a first service node, including:
acquiring target transaction data and sending the target transaction data to a second service node; the target transaction data belongs to a first service chain, wherein the first service chain is a service chain held by a second service node;
Acquiring verification confirmation information returned by the second service node; the verification confirmation information is generated when the second service node traverses to the target transaction data in the first service chain; the verification confirmation information is information of the merck tree root for generating the target block; the target block is a block where target transaction data stored on the first service chain is located;
obtaining a data verification result aiming at the target transaction data according to the verification confirmation information and the target merck tree root corresponding to the target transaction data; the target merck tree root is the merck tree root stored in the second service chain and associated with the target block; the second service chain is a service chain held by the first service node.
In one aspect, the present application provides a blockchain-based data verification method, which is executed by a second service node, including:
when the target block is added to the first service chain, determining the merck tree root of the target block as a target merck tree root, and sending the target merck tree root to the first service node so that the first service node stores the target merck tree root to the second service chain; the target block comprises target transaction data; the first service chain is a service chain held by the second service node; the second service chain is a service chain held by the first service node;
Acquiring verification transaction data sent by a first service node, and generating verification confirmation information aiming at the verification transaction data when the verification transaction data is detected to be the same as target transaction data in a first service chain; the verification confirmation information is information of the merck tree root for generating the target block;
and sending the verification confirmation information to the first service node so that the first service node obtains a data verification result aiming at verification transaction data according to the verification confirmation information and the stored target merck tree root.
In one aspect, the present application provides a blockchain-based data verification method, which is executed by a first service node, including:
acquiring target transaction data, and traversing the target transaction data in a second service chain; the second service chain is a service chain held by the first service node;
when traversing to the target transaction data in the second service chain, sending the merck tree root of the target block and the block height of the target block to the second service node, so that the second service node obtains the associated merck tree root according to the block height of the target block, and when detecting that the associated merck tree root is the same as the merck tree root of the target block, generating matching confirmation information; the target block is a block where target transaction data stored in the second service chain is located; the associated merck tree root is stored in a first service chain held by the second service node; correlation between the associated merck tree root and the block height of the target block;
And obtaining the matching confirmation information sent by the second service node, and obtaining a legal verification result aiming at the target transaction data according to the matching confirmation information.
In one aspect, the present application provides a data verification device based on a blockchain, which is applied to a first service node, and includes:
the data acquisition module is used for acquiring target transaction data and transmitting the target transaction data to the second service node; the target transaction data belongs to a first service chain, wherein the first service chain is a service chain held by a second service node;
the information acquisition module is used for acquiring verification confirmation information returned by the second service node; the verification confirmation information is generated when the second service node traverses to the target transaction data in the first service chain; the verification confirmation information is information of the merck tree root for generating the target block; the target block is a block where target transaction data stored on the first service chain is located;
the first result acquisition module is used for acquiring a data verification result aiming at the target transaction data according to the verification confirmation information and the target merck tree root corresponding to the target transaction data; the target merck tree root is the merck tree root stored in the second service chain and associated with the target block; the second service chain is a service chain held by the first service node.
Wherein, data verification device still includes:
the acquiring module is used for acquiring a target merck tree root in a target block sent by the second service node and the block height of the target block; the target merck tree root and the block height of the target block are sent to the first service node by the second service node when the target block is added to the first service chain;
and the association module is used for adding the association between the target merck tree root and the block height of the target block into the second service chain.
Wherein, the association module includes:
the generation unit is used for generating association information according to the target merck tree root and the block height of the target block;
and the packing unit is used for packing the associated information to obtain an associated block, and adding the associated block into the second service chain.
Wherein, the verification confirmation information comprises the block height of the target block;
the first result acquisition module includes:
the searching unit is used for searching a target merck tree root associated with the block height of the target block in the second service chain according to the block height of the target block in the verification and confirmation information;
and the result determining unit is used for obtaining a data verification result aiming at the target transaction data according to the retrieved target merck tree root and verification confirmation information.
The data verification result comprises a legal verification result and an illegal verification result; verifying that the confirmation information comprises path information of the merck tree root in the target block and a hash value associated with the path information;
a result determination unit including:
an operation subunit, configured to perform hash operation on the hash value in the verification confirmation information according to the path information in the verification confirmation information, so as to obtain a verification merck tree root;
the first result subunit is used for obtaining a legal verification result when detecting that the verification merck tree root is identical with the target merck tree root;
and the second result subunit is used for obtaining an illegal verification result when detecting that the verification merck tree root is different from the target merck tree root.
Wherein the operation subunit comprises:
the hash subunit is used for carrying out hash operation on the target transaction data to obtain a target hash value corresponding to the target transaction data;
the path acquisition subunit is used for acquiring the hash value which is positioned on the same path with the target hash value from the verification confirmation information according to the path information;
and the verification tree root acquisition subunit is used for obtaining the verification merck tree root according to the target hash value and the hash value which is positioned on the same path with the target hash value.
The data verification result comprises an illegal verification result;
the data verification device further comprises:
the warning information acquisition module is used for acquiring warning information sent by the second service node; the warning information is generated when the second service node does not traverse to the target transaction data in the first service chain;
and the third result acquisition module is used for acquiring an illegal verification result according to the warning information.
The data acquisition module is specifically configured to:
acquiring target transaction data sent by a client;
then, the data verification apparatus further includes:
the prompt information generation module is used for generating verification result prompt information according to the data verification result;
and the information sending module is used for sending the verification result prompt information to the client so that the client outputs the verification result prompt information.
In one aspect, the present application provides a data verification device based on a blockchain, which is applied to a second service node, and is characterized in that the device includes:
the tree root sending module is used for determining the merck tree root of the target block as a target merck tree root when the target block is added to the first service chain, and sending the target merck tree root to the first service node so that the first service node stores the target merck tree root to the second service chain; the target block comprises target transaction data; the first service chain is a service chain held by the second service node; the second service chain is a service chain held by the first service node;
The verification data acquisition module is used for acquiring verification transaction data sent by the first service node, and generating verification confirmation information aiming at the verification transaction data when the verification transaction data is detected to be the same as target transaction data in the first service chain; the verification confirmation information is information of the merck tree root for generating the target block;
and the confirmation information sending module is used for sending the verification confirmation information to the first service node so that the first service node can obtain a data verification result aiming at verification transaction data according to the verification confirmation information and the stored target merck tree root.
In one aspect, the present application provides a data verification device based on a blockchain, which is applied to a first service node, and is characterized in that the device includes:
the data traversing module is used for acquiring target transaction data and traversing the target transaction data in the second service chain; the second service chain is a service chain held by the first service node;
the tree root synchronization module is used for transmitting the merck tree root of the target block and the block height of the target block to the second service node when traversing to the target transaction data in the second service chain, so that the second service node obtains the associated merck tree root according to the block height of the target block, and generates matching confirmation information when detecting that the associated merck tree root is the same as the merck tree root of the target block; the target block is a block where target transaction data stored in the second service chain is located; the associated merck tree root is stored in a first service chain held by the second service node; correlation between the associated merck tree root and the block height of the target block;
And the matching confirmation module is used for acquiring the matching confirmation information sent by the second service node and obtaining a legal verification result aiming at the target transaction data according to the matching confirmation information.
In one aspect the present application provides a computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform a method as in one aspect of the present application.
An aspect of the present application provides a computer readable storage medium storing a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of the above aspect.
The method and the system can realize verification of the target transaction data through cooperative work of the first service node and the second service node, and obtain a data verification result aiming at the target transaction data. In the verification of the target transaction data to obtain the data verification result of the target transaction data, both the verification result of the first service node (for example, through verification confirmation information and target merck tree root verification) and the verification result of the second service node (for example, when the verification confirmation information for the target transaction data is generated, the second service node is indicated to pass the verification of the target transaction data), so that the reliability of the obtained data verification result for the target transaction data can be ensured even if the first service node or the second service node is attacked.
Drawings
In order to more clearly illustrate the technical solutions of the present application or the prior art, the following description will briefly introduce the drawings that are required to be used in the embodiments or the prior art descriptions, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a system architecture provided herein;
FIG. 2 is a schematic view of a scenario of data verification provided in the present application;
FIG. 3 is a flow chart of a blockchain-based data verification method provided by the present application;
FIG. 4 is a schematic view of a scenario of data verification provided herein;
FIG. 5 is a schematic view of a scenario of data verification provided herein;
FIG. 6 is a schematic diagram of a scenario of data verification provided herein;
FIG. 7 is a flow chart of a blockchain-based data verification method provided herein;
FIG. 8 is a flow chart of a blockchain-based data verification method provided herein;
FIG. 9 is a schematic diagram of a block chain based data verification device provided herein;
FIG. 10 is a schematic diagram of a block chain based data verification device provided herein;
FIG. 11 is a schematic diagram of a block chain based data verification device provided herein;
fig. 12 is a schematic structural diagram of a computer device provided in the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The present application relates to blockchain related technology. The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer. The blockchain comprises a series of blocks (blocks) which are mutually connected according to the sequence of the generated time, the new blocks are not removed once being added into the blockchain, and record data submitted by nodes in the blockchain system are recorded in the blocks.
Please refer to fig. 1, which is a schematic diagram of a system architecture provided in the present application. As shown in fig. 1, the system architecture schematic includes a plurality of service nodes, which are service nodes in the blockchain network, and the plurality of service nodes specifically include a service node 100a, a service node 101a, a service node 102a, and a service node 103a. One service node may be formed by one server or may be formed by a plurality of servers, and the number of servers forming one service node is determined according to the actual application scenario, which is not limited. The service nodes 100a, 101a, 102a and 103a are connected with each other, and the service nodes 100a, 101a, 102a and 103a can send the merck tree roots of the blocks on their own service chains to each other, so that each service node can perform cross-chain verification on the transaction data not belonging to itself but belonging to other service nodes, and it can be understood that the service nodes 100a, 101a, 102a and 103a can all store different transaction data. Here, the description of the present application is given by taking the transaction data of the service node 101a for verifying the service node 102a as an example.
Please refer to fig. 2, which is a schematic diagram of a scenario of data verification provided in the present application. As shown in fig. 2, service node 102a holds service chain 100b, and each time service node 102a adds a chunk in service chain 100b, the merck tree root in the uplink chunk is sent to service node 101a. The service node 102a may send the block height of the block where the merck tree root is located and the merck tree root to the service node 101a. Service node 101a may store each acquired merck tree root in association with the tile height of the tile in which it is located. Here, it is assumed that the service chain 100b includes 3 blocks, i.e., block 103b. Block 104b and block 105b. Thus, the collection of merck tree roots 101b stored by service node 101a includes merck tree root m1 (merck tree root in block 103 b), merck tree root m2 (merck tree root in block 104 b), and merck tree root m3 (merck tree root in block 105 b).
Subsequently, when the service node 101a obtains a transaction data s of the service node 102a (the transaction data s belongs to the service node 102a and does not belong to the service node 101 a), which needs to be subjected to data verification (i.e. verification of the authenticity of the data), the service node 101a may send the transaction data s to the service node 102a. The service node 102a may traverse the blocks on the service chain 100b and take the traversed blocks containing the transaction data s as the blocks to be verified. The service node 102a may send acknowledgement information 102b to the service node 101a, where the acknowledgement information 102b includes a block height of the block to be verified in the service chain 100b, a hash value used to calculate a merck tree root of the block to be verified, and path information corresponding to the hash value. The service node 101a may calculate the verification merck tree root by using the obtained hash value of the merck tree root of the block to be verified and the corresponding path information sent by the service node 102a. The service node 101a may further obtain, as the target merck tree root, an merck tree root associated with the block height of the block to be verified in the merck tree root set 101b according to the obtained block height of the block to be verified.
The service node can compare the target merck tree root with the verification merck tree root, and obtain a data verification result aiming at the transaction data s through the comparison result. Specifically, the data verification result includes a legal verification result and an illegal verification result. When the target merck tree root is compared with the verification merck tree root, a legal verification result can be obtained, wherein the legal verification result indicates that the transaction data s is real data. When the target merck tree root is not the same as the verification merck tree root, an illegal verification result can be obtained, wherein the illegal verification result indicates that the transaction data s is not real data.
By the method provided by the application, a certain service node can verify transaction data which does not belong to the service node, and verification flexibility of the transaction data is improved. Meanwhile, by the method provided by the application, when certain transaction data is verified, the data verification result aiming at the transaction data can be obtained through the cooperative work of the two service nodes, and the reliability of the obtained data verification result aiming at the transaction data is improved.
Referring to fig. 3, a flowchart of a data verification method based on a blockchain is provided, and as shown in fig. 3, the data verification method may include:
Step S101, target transaction data is obtained and sent to a second service node; the target transaction data belongs to a first service chain, wherein the first service chain is a service chain held by a second service node;
specifically, the execution body of the embodiment may be a first service node, where the first service node may be any one of the blockchain nodes in the blockchain network, and the blockchain network may include a plurality of service nodes. The method provided by the application can support cross-chain data verification, namely, transaction data of another service node is verified through one service node. The verification process of the transaction data is described by taking the first service node and the second service node as examples, wherein it can be understood that any two service nodes in the blockchain network can adopt the verification mode of the transaction data by the first service node and the second service node.
When the first service node acquires the target transaction data of the second service node, the first service node can send the target transaction data to the second service node. The service chain held by the second service node is a first service chain, and the target transaction data belongs to the second service node, which indicates that the target transaction data is stored in the second service chain. It will be appreciated that a business chain held by a business node may be used to store all transaction blocks held by the business node, and that a transaction block may include a plurality of transaction data. The target transaction data may be sent by the client to the first service node, and the client requests the first service node to verify the authenticity of the target transaction data by sending the target transaction data to the first service node.
More, the client may submit the target transaction data to the owner of the target transaction data when sending the target transaction data to the first service node, e.g., the client may indicate that the target transaction data belongs to the second service node if the owner of the target transaction data is the second service node when submitting the target transaction data to the first service node. Or when the client sends the target transaction data to the first service node, the client does not need to submit the affiliated person aiming at the target transaction data, and when the first service node acquires the target transaction data, the target transaction data can be judged to belong to the second service node according to the data contained in the target transaction data, for example, the target transaction data can contain certain identification information and the like of the transaction data owned by the second service node.
Step S102, obtaining verification confirmation information returned by a second service node; the verification confirmation information is generated when the second service node traverses to the target transaction data in the first service chain; the verification confirmation information is information of the merck tree root for generating the target block; the target block is a block where target transaction data stored on the first service chain is located;
Specifically, the second service node may obtain the target transaction data sent by the first service node to the second service node, and the second service node may traverse the block in the first service chain according to the obtained target transaction data. When the second service node traverses the block in the first service chain to the target transaction data, the target transaction data is indicated to belong to the second service node. The process that the second service node traverses the target transaction data in the first service chain is a process of verifying the target transaction data, and when the second service node traverses the target transaction data in the first service chain, the second service node is indicated to successfully verify the target transaction data, otherwise, the second service node is indicated to fail to verify.
The second service node may generate verification confirmation information according to the traversed block containing the target transaction data. The block traversed by the second service node over the first service chain that includes the target transaction data may be referred to as a target block. The verification confirmation information may include a block height of the target block, a hash value of the merck tree root used for calculating the target block, and path information corresponding to the hash value, where the verification confirmation information is information used for calculating the merck tree root of the target block. The verification confirmation information may also indicate that the second service node successfully verifies the target transaction data, in other words, the second service node generates the verification confirmation information to indicate that the second service node verifies that the target transaction data is real transaction data which has not been tampered with.
The second service node may send the generated verification confirmation information to the first service node, where the first service node may obtain the verification confirmation information returned by the second service node, and the second service node may verify the target transaction data again according to the verification confirmation information, which will be described below.
Step S103, obtaining a data verification result aiming at target transaction data according to verification confirmation information and target merck tree roots corresponding to the target transaction data; the target merck tree root is the merck tree root stored in the second service chain and associated with the target block; the second service chain is a service chain held by the first service node;
specifically, it should be noted that, if the second service node wants to enable the first service node to have the authority of verifying its own transaction data, each time a block is added in the first service chain by the second service node, the merck tree root in the added block is sent to the first service node. The first service node may store the acquired merck tree root in each block on the first service chain, for example, in a second service chain, where the second service chain is a service chain held by the first service node. Subsequently, the first service node may verify the transaction data (e.g., the target transaction data described above) of the second service node through the stored merck tree root for each chunk on the first service chain. It can be appreciated, therefore, that the merck tree root of the target chunk containing the target transaction data is already stored in the second service chain held by the first service node before the first service node obtains the target transaction data. Wherein the merck tree root of the target chunk stored in the second business chain may be referred to as a target merck tree root.
For example, when the second service node adds the target block to a service chain, the second service node may send the block height of the target block and the merck tree root in the target block to the first service node. The first service node may store the obtained target merck root and the block height of the target block in association, for example, in association with the second service chain. By storing the block height of the target block in association with the target merck tree root, the first service node may then quickly obtain the target merck tree root according to the block height of the target block.
The manner in which the first service node stores the target merck tree root and the block of the target block in a highly correlated manner may be: the first service node may generate the association information according to the target merck root and the block height of the target block. The association information may include a target merck root and a target tile height. The first service node may package the generated association information to obtain an associated block, where the associated block may include a plurality of association information (including association information generated by a block height of the target block and a target merck tree root). The first service node may add the associated block to the second service chain.
Thus, the first service node may retrieve a target merck tree root associated with the block height of the target block in the acquired verification confirmation information on the second service chain according to the block height of the target block. For example, the first service node may search the second service chain for an associated block including the block height of the target block, and use the merck root in the associated information including the block height of the target block in the searched associated block as the target merck root.
Furthermore, the first service node can obtain a data verification result aiming at the target transaction data according to the retrieved target merck tree root and verification confirmation information, wherein the data verification result comprises an illegal verification result and a legal verification result. The illegal verification result indicates that the first service node verifies that the target transaction data is unreal transaction data, and the legal verification result indicates that the first service node verifies that the target transaction data is true transaction data which is not tampered.
The verification process of the first service node on the target transaction data may be: the verification confirmation information may include path information of the merck tree root in the target block and a hash value associated with the path information, where the path information in the verification confirmation information indicates how to perform a hash operation on the hash value in the verification confirmation information to obtain the merck tree root for the target block. The merck tree root for the target tile calculated from the validation information may be referred to as the validation merck tree root for the target tile.
The path information in the verification confirmation information may include a path in the merck tree of the target block corresponding to each transaction data in the target block, one transaction data corresponds to one path, and one transaction data corresponds to a unique hash value, so it may be understood that the hash value of one transaction data corresponds to one path, one path includes a plurality of hash values, and the merck tree root in the corresponding block may be calculated by the hash value in one path. The first service node may perform hash operation on the target transaction data to obtain a hash value corresponding to the target transaction data, and may refer to the hash value of the target transaction data as a target hash value. The first service node may obtain, from the path information in the verification confirmation information, a path corresponding to the target hash value according to the calculated target hash value, and may obtain, from the path corresponding to the target hash value, a hash value on the same path as the target hash value. The first service node may obtain the verification merck root according to the hash value on the same path as the target hash value.
The first service node may compare the calculated verification merck tree root for the target block with a target merck tree root of a target block stored in advance, when the verification merck tree root is identical to the target merck tree root, the legal verification result for the target transaction data may be obtained, and when the verification merck tree root is different from the target merck tree root, the illegal verification result for the target transaction data may be obtained.
Fig. 4 is a schematic diagram of a scenario of data verification provided in the present application. As shown in fig. 4, each time a block is added to the second service chain 111c by the second service node 101c, the block height of the added block and the corresponding merck tree root are sent to the first service node 100c for storage. Here, the second service chain 111c includes a block 107c, a block 108c, a block 109c, and a block 110c thereon. Accordingly, the first service node 100c stores the merck root a1 in the block 107c and the block height b1 of the block 107c in association with the merck root a2 in the block 108c and the block height b2 of the block 108c in association with the merck root a3 in the block 109c and the block height b3 of the block 109c in association with the merck root a4 in the block 110c and the block height b4 of the block 110c in association with the second service chain 102c, as shown in the second service chain 102 c. The first service node may send the obtained target transaction data to the second service node, and when the verification acknowledgement information returned by the second service node 101c obtained by the first service node 100c includes the block height b3, the hash value of the merck tree root of the block 109c corresponding to the block height b3 and the path information corresponding to the hash value, the first service node 100c may obtain the merck tree root a3 associated with the block height b3 stored in advance by using the block height b3, and use the merck tree root a3 as the target merck tree root. The first service node may further calculate a verification merck tree root according to the hash value in the obtained verification confirmation information. Then, the first service node may compare the merck root a3 with the verified merck root, thereby obtaining the data verification result 112c for the target transaction data.
Fig. 5 is a schematic diagram of a scenario of data verification provided in the present application. The merck tree in the target tile may be the merck tree 100d. The merck tree 100d includes a hash value h1 of the transaction data j1, a hash value h2 of the transaction data j2, a hash value h3 of the transaction data j3, and a hash value of the transaction data j 4. The root nodes of the hash value h1 and the hash value h2 are all hash value h12, the root nodes of the hash values h3 and h4 are all h34, the root nodes of the hash value h12 and the hash value h34 are hash value h1234, and the merck tree root in the target block is the hash value h1234. Therefore, the path information 101d in the authentication acknowledgement information transmitted from the second service node to the first service node may include a path 102d (a path corresponding to the transaction data j 1), a path 103d (a path corresponding to the transaction data j 2), a path 104d (a path corresponding to the transaction data j 3), and a path 105d (a path corresponding to the transaction data j 4). When the hash value of the target transaction data calculated by the first service node is the hash value h2 (i.e., the target transaction data is the transaction data j 2), the path on which the target transaction data is located is the path 103d, and the hash values on the same path as the hash value h2 of the target transaction data are the hash value h12 and the hash value h34. Therefore, the first service node may perform hash operation on the hash value h12 and the hash value h34, so as to obtain the verification merck tree root. The first service node may compare the verification merck tree root with a pre-stored merck tree root (i.e., a target merck tree root) associated with the block height of the block where the transaction data j2 is located, to obtain a data verification result for the target transaction data.
When the first service node transmits the target transaction data to the second service node and the second service node does not traverse the target transaction data on the first service chain, the second service node may generate warning information for the target transaction data. The second service node may send the alert information to the first service node, where the alert information indicates that the second service node fails to verify the target transaction data, i.e., fails to verify. In other words, the alert information indicates that the second service node verifies that the target transaction data is unrealistic transaction data. After the first service node acquires the warning information, the first service node can obtain the illegal verification result aiming at the target transaction data without verifying the target transaction data, namely, the target transaction data is verified to be not real transaction data.
The above process is a verification process of the target transaction data through the first service node and the second service node under the scene that the target transaction data belongs to the second service node but not to the first service node. By the above process, it can be understood that when the first service node and the second service node pass the verification of the target transaction data at the same time, a legal verification result for the target transaction data is obtained, otherwise, an illegal verification result for the target transaction data is obtained, so that the reliability of the data verification result for the obtained target transaction data is improved.
More, if the target transaction data is sent to the first service node by the client, the first service node may further generate verification result prompt information according to the obtained data verification result for the target transaction data, where the verification result prompt information includes a data verification result. For example, if the data verification result is an illegal verification result, the verification result prompt message may be "the transaction data input by you is illegal data"; if the data verification result is a legal verification result, the verification result prompt message may be "the transaction data input by you is legal data". The first service node may send the generated verification result prompt information to the client, and the client may input the verification result prompt information. For example, the client may display the verification result prompt information in the visual interface, or the client may play the verification result prompt information in a voice manner.
Fig. 6 is a schematic diagram of a scenario of data verification provided in the present application. As shown in fig. 6, the client 100e may send target transaction data to the first service node 101e, which belongs to the second service node, and the first service node may send the target transaction data to the second service node 102e. After traversing the first traffic chain to the target transaction data, the second traffic node 102e may generate verification confirmation information and send the verification confirmation information to the first traffic node 101e. The first service node 101e may obtain a data verification result for the target transaction data according to the verification confirmation information and the stored target merck tree root. The first service node 101e may generate a verification result prompt message according to the data verification result, the first service node 101e may send the verification result prompt message to the client 100e, and the client 100e may display the obtained verification result prompt message in the visual interface 103 e. Here, the verification result prompt displayed by the client 100e is the verification result prompt 104e (i.e. "the target transaction data submitted by you is legal data").
Similarly, it has been described above that the target transaction data of the second service node may be verified by the first service node, and vice versa. For example, when transaction data x is transaction data belonging to a first service node but not belonging to a second service node, the transaction data x may be validated by the second service node. The method comprises the following steps: each time a block is added to the second service chain by the first service node, the block height of each block in the uplink and the corresponding merck tree root may also be sent to the second service node, and the second service node may store the block height of the block sent by the first service node and the corresponding merck tree root (including the block height of the block containing the transaction data x and the corresponding merck tree root). The second service node may send the transaction data x (which may be sent by the client to the second service node) belonging to the first service node after obtaining the transaction data x. The first service node may traverse a plurality of blocks in the second service chain, and the block traversed by the first service node that includes the transaction data x may also be referred to as a target block. The first service node may generate verification confirmation information according to the block height of the target block, a hash value of the transaction data in the target block (the hash value may be used to calculate the merck tree root of the target block), and path information corresponding to the hash value. The first service node may send the generated verification confirmation information to the second service node, where the second service node may obtain the data verification result for the transaction data x through the verification confirmation information and the pre-stored merck tree root associated with the block height of the target block where the transaction data x is located (the process is the same as the process that the first service node obtains the data verification result for the target transaction data through the verification confirmation information and the target merck tree root). Likewise, the data verification results for the transaction data x may also include illegal verification results (indicating that the transaction data x is verified as being unrealistic transaction data) and legal verification results (indicating that the transaction data x is verified as being authentic transaction data).
The method and the system can realize verification of the target transaction data through cooperative work of the first service node and the second service node, and obtain a data verification result aiming at the target transaction data. In the verification of the target transaction data to obtain the data verification result of the target transaction data, both the verification result of the first service node (for example, through verification confirmation information and target merck tree root verification) and the verification result of the second service node (for example, when the verification confirmation information for the target transaction data is generated, the second service node is indicated to pass the verification of the target transaction data), so that the reliability of the obtained data verification result for the target transaction data can be ensured even if the first service node or the second service node is attacked.
Fig. 7 is a flowchart of a block chain-based data verification method provided in the present application. The execution body in the embodiment corresponding to fig. 7 is the second service node in the embodiment corresponding to fig. 3, and the data verification method described in fig. 7 is the other side method corresponding to the data verification method described in fig. 3. In other words, the data verification method described in fig. 7 and the data verification method described in fig. 3 both involve an interaction process between the first service node and the second service node, whereas the data verification method described in fig. 7 uses the second service node as an execution subject, and the data verification method described in fig. 3 uses the first service node as an execution subject. As shown in fig. 7, the data verification method may include:
Step S201, when adding the target block to the first service chain, determining the merck tree root of the target block as the target merck tree root, and sending the target merck tree root to the first service node, so that the first service node stores the target merck tree root to the second service chain; the target block comprises target transaction data; the first service chain is a service chain held by the second service node; the second service chain is a service chain held by the first service node;
specifically, when the second service node is adding the target block containing the target transaction data to the first service chain, the second service node may send the merck tree root of the target block to the first service node. Wherein the merck tree root of the target block sent by the second service node to the first service node may be referred to as the target merck tree root. The target block may refer to any block owned by the second service node.
After the first service node obtains the target merck tree root sent by the second service node, the target merck tree root may be stored on the second service chain. Wherein the first traffic chain is a traffic chain held by a second traffic node, the second traffic chain is a traffic chain held by the first traffic node, and the first traffic chain and the second traffic chain are two different blockchains.
Step S202, acquiring verification transaction data sent by a first service node, and generating verification confirmation information aiming at the verification transaction data when the verification transaction data is detected to be the same as target transaction data in a first service chain; the verification confirmation information is information of the merck tree root for generating the target block;
specifically, when the first service node obtains the verification transaction data belonging to the second service node, the verification transaction data may be sent to the second service node (this step is the step S101 of the embodiment corresponding to fig. 3, where the first service node sends the target transaction data to the second service node). The second service node may traverse the verification transaction data in the block in the first service chain when obtaining the verification transaction data sent thereto by the first service node, and may generate verification confirmation information for the verification transaction data when traversing on the first service chain that the target transaction data is the same as the verification transaction data. The verification confirmation information is used for calculating the merck tree root of the target block where the target transaction data is located, and the verification confirmation information is the verification confirmation information in the embodiment corresponding to fig. 3.
Step S203, the verification confirmation information is sent to the first service node, so that the first service node obtains a data verification result aiming at verification transaction data according to the verification confirmation information and the stored target merck tree root;
specifically, the second service node may send the generated verification confirmation information to the first service node, and after the first service node obtains the verification confirmation information for verifying the transaction data, the first service node may obtain a data verification result for verifying the transaction data according to the verification confirmation information and a target merck tree root stored in advance. The process of obtaining the data verification result for the verification transaction data by the first service node according to the verification confirmation information and the target merck tree root is the same as the process of obtaining the data verification result for the target transaction data by the first service node according to the verification confirmation information and the target merck tree root in the embodiment corresponding to fig. 3, and is not described herein.
In the above embodiment corresponding to fig. 3 and the embodiment corresponding to fig. 7, the verification process of the target transaction data is described in the case that the target transaction data acquired by the first service node belongs to the second service node, but does not belong to the first service node. In the following, in the case that the target transaction data acquired by the first service node belongs to the first service node, but not to the second service node, according to the embodiment corresponding to fig. 8, the verification process of the target transaction data is as follows:
Fig. 8 is a flowchart of a block chain-based data verification method provided in the present application. As shown in fig. 8, the data verification method includes:
step S301, target transaction data is acquired, and the target transaction data is traversed in a second service chain; the second service chain is a service chain held by the first service node;
specifically, the execution body in this embodiment is the first service node in the embodiment corresponding to fig. 3 and fig. 7. When the first service node obtains the target transaction data and does not know which service node the target transaction data belongs to, the first service node can traverse the transaction data in the block in the second service chain held by the first service node. When the first service node traverses to the target transaction data in the second service chain, the target transaction data is indicated to be the transaction data belonging to the first service node.
Step S302, when traversing to the target transaction data in the second service chain, the merck tree root of the target block and the block height of the target block are sent to the second service node, so that the second service node obtains the associated merck tree root according to the block height of the target block, and when detecting that the associated merck tree root is the same as the merck tree root of the target block, matching confirmation information is generated; the target block is a block where target transaction data stored in the second service chain is located; the associated merck tree root is stored in a first service chain held by the second service node; correlation between the associated merck tree root and the block height of the target block;
Specifically, the block where the target transaction data is located in the second service chain may be referred to as a target block, and when the first service node traverses the target transaction data on the second service chain, the first service node may also send the block height of the target block where the target transaction data is located and the merck tree root of the target block to the second service node, so that the second service node may cooperatively verify the target transaction data together. See below:
it should be noted that, each time the first service node adds a block (including the target block) in the second service chain, the block height of the block and the merck tree root in the block may be sent to the second service node. The second service node may store the block height sent by the first service node and the corresponding merck tree root in an associated manner, and may store the block height and the corresponding merck tree root in an associated manner in a first service chain held by the second service node. Therefore, when verifying the target transaction data, before the second service node obtains the block height of the target block sent by the first service node and the merck tree root in the target block, the merck tree root associated with the block height of the target block is already stored in the second service node in advance, and the merck tree root associated with the block height of the target block stored in advance in the second service node may be referred to as the associated merck tree root.
Therefore, the second service node may compare the merck tree root of the target block acquired at this time with the pre-stored associated merck tree root, and generate the above-mentioned matching confirmation information when comparing that the merck tree root of the target block acquired at this time is identical to the pre-stored associated merck tree root. The matching confirmation information indicates that the second service node verifies the target transaction data to pass, namely, verifies that the target transaction data is real transaction data. The second service node may send the match confirmation information to the first service node.
Step S303, obtaining the matching confirmation information sent by the second service node, and obtaining a legal verification result aiming at the target transaction data according to the matching confirmation information;
specifically, since the first service node has traversed the target transaction data in the second service chain in the above step S301, it indicates that the first service node has verified the target transaction data. Therefore, when the first service node acquires the matching confirmation information sent by the second service node, the first service node and the second service node are indicated to pass the verification of the target transaction data. Therefore, when the first service node obtains the matching confirmation information sent by the second service node, the first service node can directly obtain a legal verification result aiming at the target transaction data, wherein the legal verification result is a final data verification result aiming at the target transaction data, and the legal verification result indicates that the final verification target transaction data is real transaction data.
More, in step S302, when the second service node compares that the merck tree root of the target block obtained at this time is different from the pre-stored associated merck tree root, the second service node may generate the matching failure information, where the matching failure information indicates that the second service node does not pass the verification of the target transaction data, that is, verifies that the target transaction data is not real transaction data. The second service node can send the matching failure information to the first service node, and the first service node can obtain an illegal verification result aiming at the target transaction data when acquiring the matching failure information, wherein the illegal verification result indicates that the target transaction data is finally verified to be not real transaction data.
Fig. 9 is a schematic structural diagram of a block chain-based data verification device provided in the present application. As shown in fig. 9, the data verification apparatus 1 may include: a data acquisition module 101, an information acquisition module 102, and a first result acquisition module 103;
a data acquisition module 101, configured to acquire target transaction data, and send the target transaction data to a second service node; the target transaction data belongs to a first service chain, wherein the first service chain is a service chain held by a second service node;
The information acquisition module 102 is configured to acquire verification confirmation information returned by the second service node; the verification confirmation information is generated when the second service node traverses to the target transaction data in the first service chain; the verification confirmation information is information of the merck tree root for generating the target block; the target block is a block where target transaction data stored on the first service chain is located;
the first result obtaining module 103 is configured to obtain a data verification result for the target transaction data according to the verification confirmation information and a target merck tree root corresponding to the target transaction data; the target merck tree root is the merck tree root stored in the second service chain and associated with the target block; the second service chain is a service chain held by the first service node.
The specific function implementation manner of the data acquisition module 101, the information acquisition module 102, and the first result acquisition module 103 is please refer to step S101 to step S103 in the embodiment corresponding to fig. 3, and no further description is given here.
Wherein, the data verification device 1 further comprises: an acquisition module 104 and an association module 105;
an obtaining module 104, configured to obtain a target merck tree root in a target block and a block height of the target block sent by the second service node; the target merck tree root and the block height of the target block are sent to the first service node by the second service node when the target block is added to the first service chain;
An association module 105, configured to add the association between the target merck root and the block height of the target block to the second service chain.
In step S103 in the embodiment corresponding to fig. 3, the specific function implementation manner of the obtaining module 104 and the associating module 105 is not described herein.
Wherein the association module 105 comprises: a generation unit 1051 and a bundling unit 1052;
a generating unit 1051, configured to generate association information according to the target merck root and the tile height of the target tile;
and a packing unit 1052, configured to pack the association information to obtain an association block, and add the association block to the second service chain.
In the specific function implementation manner of the generating unit 1051 and the packing unit 1052, please refer to step S103 in the corresponding embodiment of fig. 3, and a detailed description is omitted herein.
Wherein, the verification confirmation information comprises the block height of the target block;
the first result obtaining module 103 includes: a retrieval unit 1031 and a result determination unit 1032;
a retrieving unit 1031, configured to retrieve, in the second service chain, a target merck tree root associated with the block height of the target block according to the block height of the target block in the verification confirmation information;
The result determining unit 1032 is configured to obtain a data verification result for the target transaction data according to the retrieved target merck root and the verification confirmation information.
The specific functional implementation manner of the retrieving unit 1031 and the result determining unit 1032 is please refer to step S103 in the embodiment corresponding to fig. 3, and a detailed description is omitted herein.
The data verification result comprises a legal verification result and an illegal verification result; verifying that the confirmation information comprises path information of the merck tree root in the target block and a hash value associated with the path information;
the result determination unit 1032 includes: an operation subunit 10321, a first result subunit 10322, and a second result subunit 10323;
an operation subunit 10321, configured to perform hash operation on the hash value in the verification confirmation information according to the path information in the verification confirmation information, to obtain a verification merck tree root;
the first result subunit 10322, when detecting that the verification merck tree root is the same as the target merck tree root, obtains a legal verification result;
the second result subunit 10323 is configured to obtain an illegal authentication result when it is detected that the authentication merck root is different from the target merck root.
The specific functional implementation manner of the operation subunit 10321, the first result subunit 10322, and the second result subunit 10323 is please refer to step S103 in the embodiment corresponding to fig. 3, and a detailed description is omitted herein.
Wherein the operator subunit 10321 includes: a hash subunit 103211, a path acquisition subunit 103212, and a verification root acquisition subunit 103213;
the hash subunit 103211 is configured to perform hash operation on the target transaction data to obtain a target hash value corresponding to the target transaction data;
a path obtaining subunit 103212, configured to obtain, from the verification confirmation information, a hash value that is on the same path as the target hash value according to the path information;
the verification root obtaining subunit 103213 is configured to obtain a verification merck root according to the target hash value and a hash value that is on the same path as the target hash value.
The specific functional implementation manner of the hash subunit 103211, the path obtaining subunit 103212, and the verification root obtaining subunit 103213 is please refer to step S103 in the embodiment corresponding to fig. 3, and a detailed description is omitted here.
The data verification result comprises an illegal verification result;
the data verification apparatus 1 further includes: a warning information acquisition module 106 and a third result acquisition module 107;
The warning information obtaining module 106 is configured to obtain warning information sent by the second service node; the warning information is generated when the second service node does not traverse to the target transaction data in the first service chain;
and the third result obtaining module 107 is configured to obtain an illegal verification result according to the alert information.
The specific function implementation manner of the alert information obtaining module 106 and the third result obtaining module 107 is please refer to step S103 in the embodiment corresponding to fig. 3, and a detailed description is omitted herein.
The data acquisition module 101 is specifically configured to:
acquiring target transaction data sent by a client;
then, the data verification apparatus 1 further includes: a prompt information generation module 108 and an information transmission module 109;
the prompt information generating module 108 is configured to generate verification result prompt information according to the data verification result; the verification result prompt information comprises a data verification result;
the information sending module 109 is configured to send the verification result prompt information to the client, so that the client outputs the verification result prompt information.
The specific function implementation manner of the prompt message generating module 108 and the message sending module 109 is please refer to step S103 in the embodiment corresponding to fig. 3, and a detailed description is omitted herein.
Fig. 10 is a schematic structural diagram of a block chain-based data verification device provided in the present application. The data authentication device is applied to a second service node, as shown in fig. 10, and the data authentication device 2 may include: a tree root transmitting module 21, a verification data acquiring module 22 and a confirmation information transmitting module 23;
the tree root sending module 21 is configured to determine, when the target block is added to the first service chain, a merck tree root of the target block as a target merck tree root, send the target merck tree root to the first service node, so that the first service node stores the target merck tree root to the second service chain; the target block comprises target transaction data; the first service chain is a service chain held by the second service node; the second service chain is a service chain held by the first service node;
the verification data acquisition module 22 is configured to acquire verification transaction data sent by the first service node, and generate verification confirmation information for the verification transaction data when detecting that the verification transaction data is the same as target transaction data in the first service chain; the verification confirmation information is information of the merck tree root for generating the target block;
The confirmation information sending module 23 is configured to send the verification confirmation information to the first service node, so that the first service node obtains a data verification result for the verification transaction data according to the verification confirmation information and the stored target merck tree root.
The specific function implementation manner of the root sending module 21, the verification data obtaining module 22, and the confirmation information sending module 23 is please refer to step S201-step S203 in the embodiment corresponding to fig. 7, and no further description is given here.
Fig. 11 is a schematic structural diagram of a block chain-based data verification device provided in the present application. The data authentication device is applied to a first service node, as shown in fig. 11, and the data authentication device 3 may include: a data traversing module 31, a tree root synchronizing module 32 and a matching confirming module 33;
the data traversing module 31 is configured to acquire target transaction data, and traverse the target transaction data in the second service chain; the second service chain is a service chain held by the first service node;
the tree root synchronization module 32 is configured to send, when traversing to the target transaction data in the second service chain, the merck tree root of the target block and the block height of the target block to the second service node, so that the second service node obtains the associated merck tree root according to the block height of the target block, and when detecting that the associated merck tree root is the same as the merck tree root of the target block, generates the matching confirmation information; the target block is a block where target transaction data stored in the second service chain is located; the associated merck tree root is stored in a first service chain held by the second service node; correlation between the associated merck tree root and the block height of the target block;
And the matching confirmation module 33 is configured to obtain matching confirmation information sent by the second service node, and obtain a legal verification result for the target transaction data according to the matching confirmation information.
The specific function implementation manner of the data traversing module 31, the tree root synchronizing module 32 and the matching confirming module 33 is referred to step S301-step S303 in the embodiment corresponding to fig. 8, and will not be described herein.
The method and the system can realize verification of the target transaction data through cooperative work of the first service node and the second service node, and obtain a data verification result aiming at the target transaction data. In the verification of the target transaction data to obtain the data verification result of the target transaction data, both the verification result of the first service node (for example, through verification confirmation information and target merck tree root verification) and the verification result of the second service node (for example, when the verification confirmation information for the target transaction data is generated, the second service node is indicated to pass the verification of the target transaction data), so that the reliability of the obtained data verification result for the target transaction data can be ensured even if the first service node or the second service node is attacked.
Fig. 12 is a schematic structural diagram of a computer device provided in the present application. As shown in fig. 12, the computer device 1000 may include: processor 1001, network interface 1004, and memory 1005, in addition, computer device 1000 may further comprise: a user interface 1003, and at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display (Display), a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface, among others. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may also optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 12, an operating system, a network communication module, a user interface module, and a device control application program may be included in the memory 1005, which is one type of computer storage medium.
In the computer device 1000 shown in fig. 12, the network interface 1004 may provide network communication functions; while user interface 1003 is primarily used as an interface for providing input to a user; and the processor 1001 may be used to invoke the device control application stored in the memory 1005 to implement the description of the blockchain-based data validation method in the previous embodiment. It should be understood that the computer apparatus 1000 described in the present application may also perform the description of the data verification device 1, the data verification device 2, and the data verification device 3 in the foregoing embodiments, and will not be described herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the present application also provides a computer readable storage medium, in which the aforementioned computer programs executed by the data verification device 1, the data verification device 2, and the data verification device 3 based on blockchain are stored, and the computer programs include program instructions, which when executed by a processor, are capable of executing the description of the data verification method based on blockchain in the foregoing embodiments, and therefore, will not be described in detail herein. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer storage medium related to the present application, please refer to the description of the method embodiments of the present application.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of computer programs, which may be stored on a computer-readable storage medium, and which, when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
The foregoing disclosure is only illustrative of the preferred embodiments of the present application and is not intended to limit the scope of the claims herein, as the equivalent of the claims herein shall be construed to fall within the scope of the claims herein.

Claims (13)

1. A blockchain-based data verification method performed by a first service node, comprising:
acquiring a target merck tree root in a target block and a block height of the target block, which are sent by a second service node when the target block is added to a first service chain;
adding the block height association of the target merck tree root and the target block into a second service chain held by the first service node;
acquiring target transaction data and sending the target transaction data to the second service node; the target transaction data belongs to the first service chain, wherein the first service chain is a service chain held by the second service node;
acquiring verification confirmation information returned by the second service node; the validation confirmation information is generated when the second service node traverses to the target transaction data in the first service chain; the verification confirmation information is information for generating the merck tree root of the target block; the target block is a block where the target transaction data stored on the first service chain is located;
Obtaining a data verification result aiming at the target transaction data according to the verification confirmation information and the target merck tree root corresponding to the target transaction data; the target merck tree root is the merck tree root associated with the target chunk stored in the second business chain.
2. The method of claim 1, wherein the associating the target merck root and the block height of the target block into the second business chain comprises:
generating associated information according to the target merck tree root and the block height of the target block;
and packaging the association information to obtain an association block, and adding the association block into the second service chain.
3. The method of claim 1, wherein the validation information includes a block height of the target block;
the step of obtaining a data verification result for the target transaction data according to the verification confirmation information and the target merck tree root corresponding to the target transaction data, including:
retrieving the target merck tree root associated with the block height of the target block in the second service chain according to the block height of the target block in the verification confirmation information;
And obtaining the data verification result aiming at the target transaction data according to the retrieved target merck tree root and the verification confirmation information.
4. A method according to claim 3, wherein the data verification results include legal verification results and illegal verification results; the verification confirmation information comprises path information of the Merker tree root in the target block and a hash value associated with the path information;
the step of obtaining the data verification result for the target transaction data according to the retrieved target merck tree root and the verification confirmation information, including:
carrying out hash operation on the hash value in the verification confirmation information according to the path information in the verification confirmation information to obtain a verification merck tree root;
when the verification merck tree root is detected to be the same as the target merck tree root, obtaining the legal verification result;
and when the verification merker tree root is detected to be different from the target merker tree root, obtaining the illegal verification result.
5. The method of claim 4, wherein the hashing the hash value in the verification confirmation information according to the path information in the verification confirmation information to obtain a verification merck tree root includes:
Performing hash operation on the target transaction data to obtain a target hash value corresponding to the target transaction data;
according to the path information, acquiring a hash value which is positioned on the same path as the target hash value from the verification confirmation information;
and obtaining the verification merck tree root according to the target hash value and the hash value which is in the same path with the target hash value.
6. The method of claim 1, wherein the data verification result comprises an illegal verification result;
further comprises:
acquiring warning information sent by the second service node; the alert information is generated when the second service node does not traverse to the target transaction data in the first service chain;
and obtaining the illegal verification result according to the warning information.
7. The method of claim 1, wherein the obtaining the target transaction data comprises:
acquiring the target transaction data sent by a client;
then, further comprising:
generating verification result prompt information according to the data verification result;
and sending the verification result prompt information to the client so that the client outputs the verification result prompt information.
8. A blockchain-based data validation method performed by a second service node, comprising:
when a target block is added to a first service chain, determining the merck tree root of the target block as a target merck tree root, and sending the target merck tree root to a first service node so that the first service node stores the target merck tree root to a second service chain; the target block comprises target transaction data; the first service chain is a service chain held by the second service node; the second service chain is a service chain held by the first service node;
acquiring verification transaction data sent by the first service node, and generating verification confirmation information for the verification transaction data when the verification transaction data is detected to be identical with the target transaction data traversed in the first service chain; the verification confirmation information is information for generating the merck tree root of the target block;
and sending the verification confirmation information to the first service node so that the first service node obtains a data verification result aiming at the verification transaction data according to the verification confirmation information and the stored target merck tree root.
9. A blockchain-based data verification device applied to a first service node, comprising:
the acquisition module is used for acquiring a target merck tree root in a target block and the block height of the target block, wherein the target merck tree root and the block height are sent by a second service node when the target block is added to a first service chain;
the association module is used for adding the block height association of the target merck tree root and the target block into a second service chain held by the first service node;
the data acquisition module is used for acquiring target transaction data and transmitting the target transaction data to the second service node; the target transaction data belongs to a first service chain, wherein the first service chain is a service chain held by the second service node;
the information acquisition module is used for acquiring verification confirmation information returned by the second service node; the validation confirmation information is generated when the second service node traverses to the target transaction data in the first service chain; the verification confirmation information is information of the merck tree root for generating the target block; the target block is a block where the target transaction data stored on the first service chain is located;
The first result acquisition module is used for acquiring a data verification result aiming at the target transaction data according to the verification confirmation information and the target merck tree root corresponding to the target transaction data; the target merck tree root is the merck tree root stored in a second business chain and associated with the target block; the second service chain is a service chain held by the first service node.
10. The apparatus of claim 9, wherein the association module comprises:
the generation unit is used for generating associated information according to the target merck tree root and the block height of the target block;
and the packing unit is used for packing the association information to obtain an association block, and adding the association block into the second service chain.
11. A blockchain-based data verification device for use in a second service node, comprising:
the tree root sending module is used for determining the merck tree root of the target block as a target merck tree root when the target block is added to the first service chain, and sending the target merck tree root to the first service node so that the first service node stores the target merck tree root to the second service chain; the target block comprises target transaction data; the first service chain is a service chain held by the second service node; the second service chain is a service chain held by the first service node;
The verification data acquisition module is used for acquiring verification transaction data sent by the first service node, and generating verification confirmation information aiming at the verification transaction data when the verification transaction data is detected to be the same as the target transaction data traversed in the first service chain; the verification confirmation information is information for generating the merck tree root of the target block;
and the confirmation information sending module is used for sending the verification confirmation information to the first service node so that the first service node obtains a data verification result aiming at the verification transaction data according to the verification confirmation information and the stored target merck tree root.
12. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method of any of claims 1-8.
13. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the method of any of claims 1-8.
CN202010343356.0A 2020-04-27 2020-04-27 Block chain-based data verification method and device and computer readable storage medium Active CN111415161B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010343356.0A CN111415161B (en) 2020-04-27 2020-04-27 Block chain-based data verification method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010343356.0A CN111415161B (en) 2020-04-27 2020-04-27 Block chain-based data verification method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111415161A CN111415161A (en) 2020-07-14
CN111415161B true CN111415161B (en) 2024-03-19

Family

ID=71493743

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010343356.0A Active CN111415161B (en) 2020-04-27 2020-04-27 Block chain-based data verification method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111415161B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111882842B (en) * 2020-08-04 2022-12-02 珠海格力电器股份有限公司 Early warning method of sharing equipment and sharing equipment
CN112131235A (en) * 2020-09-21 2020-12-25 中国电子科技网络信息安全有限公司 Method for realizing transaction credibility verification in block chain system
CN112200682B (en) * 2020-12-04 2021-03-09 腾讯科技(深圳)有限公司 Block chain-based cross-chain transaction method and device and computer-readable storage medium
CN112651044B (en) * 2020-12-29 2024-03-01 杭州趣链科技有限公司 Business transaction method, system and storage medium based on block chain technology
CN113157809B (en) * 2021-04-28 2021-12-31 广东省机场集团物流有限公司 Traversal method and device based on block chain side chain and computer readable storage medium
CN114679466B (en) * 2021-06-04 2023-02-10 腾讯云计算(北京)有限责任公司 Consensus processing method, device, computer equipment and medium for block chain network
CN113626532B (en) * 2021-09-03 2023-11-24 杭州复杂美科技有限公司 Illegal node identification method, anti-cheating method, computer device and storage medium
CN116627664B (en) * 2023-07-26 2024-03-29 中信证券股份有限公司 Service verification method, device, electronic equipment and computer readable medium

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107220130A (en) * 2017-05-12 2017-09-29 北京众享比特科技有限公司 A kind of information common recognition method realized at the node of block chain, apparatus and system
CN108256859A (en) * 2018-01-02 2018-07-06 中国工商银行股份有限公司 Financial product transaction common recognition method, node and system based on block chain
CN108876378A (en) * 2018-07-11 2018-11-23 杨国超 Publicly-owned chain data enciphering back-up method
CN109067849A (en) * 2018-07-11 2018-12-21 杨国超 Method of data synchronization based on block
WO2019019056A1 (en) * 2017-07-26 2019-01-31 杭州复杂美科技有限公司 Method for frontal machine to participate in block chain consensus
CN109377232A (en) * 2018-12-20 2019-02-22 众安信息技术服务有限公司 The transaction method for sequencing and equipment of block chain based on DAG
CN109409878A (en) * 2018-10-11 2019-03-01 上海保险交易所股份有限公司 The method traded via double-deck alliance's chain
CA2986731A1 (en) * 2017-11-27 2019-05-27 Lee, James A blockchain based smart home security solution
WO2019125814A1 (en) * 2017-12-21 2019-06-27 Eland Blockchain Fintech Inc. Blockchain based information security system and method
KR20190093012A (en) * 2018-01-31 2019-08-08 지송학 The method for block generation and validation in block-chain system
CN110175840A (en) * 2019-04-19 2019-08-27 华中科技大学 Method, client, alliance's chain and the system of light wallet mechanism are realized in alliance's chain
CN110175913A (en) * 2019-04-12 2019-08-27 阿里巴巴集团控股有限公司 Data processing system, method, calculating equipment and storage medium based on block chain
CN110543788A (en) * 2019-09-11 2019-12-06 腾讯科技(深圳)有限公司 Data storage method, data storage device, computer-readable storage medium and computer equipment
CN110633323A (en) * 2019-09-16 2019-12-31 腾讯科技(深圳)有限公司 Business data storage method, device, storage medium and computer equipment
CN110889729A (en) * 2019-11-29 2020-03-17 腾讯科技(深圳)有限公司 Data verification method and device based on block chain network

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107392040B (en) * 2017-04-28 2019-08-09 阿里巴巴集团控股有限公司 A kind of method and device of common recognition verifying

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107220130A (en) * 2017-05-12 2017-09-29 北京众享比特科技有限公司 A kind of information common recognition method realized at the node of block chain, apparatus and system
WO2019019056A1 (en) * 2017-07-26 2019-01-31 杭州复杂美科技有限公司 Method for frontal machine to participate in block chain consensus
CA2986731A1 (en) * 2017-11-27 2019-05-27 Lee, James A blockchain based smart home security solution
WO2019125814A1 (en) * 2017-12-21 2019-06-27 Eland Blockchain Fintech Inc. Blockchain based information security system and method
CN108256859A (en) * 2018-01-02 2018-07-06 中国工商银行股份有限公司 Financial product transaction common recognition method, node and system based on block chain
KR20190093012A (en) * 2018-01-31 2019-08-08 지송학 The method for block generation and validation in block-chain system
CN109067849A (en) * 2018-07-11 2018-12-21 杨国超 Method of data synchronization based on block
CN108876378A (en) * 2018-07-11 2018-11-23 杨国超 Publicly-owned chain data enciphering back-up method
CN109409878A (en) * 2018-10-11 2019-03-01 上海保险交易所股份有限公司 The method traded via double-deck alliance's chain
CN109377232A (en) * 2018-12-20 2019-02-22 众安信息技术服务有限公司 The transaction method for sequencing and equipment of block chain based on DAG
CN110175913A (en) * 2019-04-12 2019-08-27 阿里巴巴集团控股有限公司 Data processing system, method, calculating equipment and storage medium based on block chain
CN110175840A (en) * 2019-04-19 2019-08-27 华中科技大学 Method, client, alliance's chain and the system of light wallet mechanism are realized in alliance's chain
CN110543788A (en) * 2019-09-11 2019-12-06 腾讯科技(深圳)有限公司 Data storage method, data storage device, computer-readable storage medium and computer equipment
CN110633323A (en) * 2019-09-16 2019-12-31 腾讯科技(深圳)有限公司 Business data storage method, device, storage medium and computer equipment
CN110889729A (en) * 2019-11-29 2020-03-17 腾讯科技(深圳)有限公司 Data verification method and device based on block chain network

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
区块链技术及其应用研究;谢辉;王健;;信息网络安全;20161231(第09期);全文 *
区块链技术基础及应用;张舒;杨宇光;;信息安全研究(第06期);全文 *
网格中基于伸展树检索的匿名存储模型;黄文明;曾宪立;朱英;;计算机仿真;第25卷(第08期);全文 *

Also Published As

Publication number Publication date
CN111415161A (en) 2020-07-14

Similar Documents

Publication Publication Date Title
CN111415161B (en) Block chain-based data verification method and device and computer readable storage medium
CN109542888B (en) Data modification and synchronization method, device, equipment and storage medium of block chain
US10747721B2 (en) File management/search system and file management/search method based on block chain
JP4078454B2 (en) Digital signature management method, digital signature processing apparatus, program, and recording medium
CN110889729B (en) Data verification method and device based on blockchain network
CA3087297A1 (en) Blockchain-based data verification method and apparatus, and electronic device
US20160283920A1 (en) Authentication and verification of digital data utilizing blockchain technology
US20150278487A1 (en) Security scheme for authenticating digital entities and aggregate object origins
US10924281B2 (en) Method and apparatus for inter-blockchain transmission of authenticable message
CN110599174B (en) Block chain information processing method and related equipment
CN112069262B (en) Account checking data uplink method based on block chain intelligent contract
US11356258B2 (en) Methods and systems for distributed cryptographically secured data validation
JP2010165231A (en) Server authentication method and client terminal
CN110086780B (en) Method and device for processing tampered transaction based on Ether house and storage medium
CN108880820B (en) Code management method and device
CN111899019A (en) Method and system for cross validation and sharing of blacklist and multiple parties
WO2020231328A1 (en) An ownership data management system and method
KR20210102470A (en) A method and system for verifying blockchain data stored in a storage format different from that of the blockchain.
CN113505138A (en) Method and apparatus for state attestation and execution of blocks in a blockchain system
CN115952515B (en) Data security processing method and device based on big data
WO2007074992A1 (en) Method for detecting malicious code changes from hacking of program loaded and executed on memory through network
CN112732676B (en) Block chain-based data migration method, device, equipment and storage medium
JP2017169147A (en) Verification device, electronic apparatus, program, and verification system
CN112948847B (en) Block chain-based data sharing system and data correctness verification method
CN116361383A (en) Block generation method, block chain system, storage medium and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40026384

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant