CN112037058A - Data verification method, device and storage medium - Google Patents

Data verification method, device and storage medium Download PDF

Info

Publication number
CN112037058A
CN112037058A CN202010883730.6A CN202010883730A CN112037058A CN 112037058 A CN112037058 A CN 112037058A CN 202010883730 A CN202010883730 A CN 202010883730A CN 112037058 A CN112037058 A CN 112037058A
Authority
CN
China
Prior art keywords
branch
block
target
verification
mvcc
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.)
Granted
Application number
CN202010883730.6A
Other languages
Chinese (zh)
Other versions
CN112037058B (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202010883730.6A priority Critical patent/CN112037058B/en
Publication of CN112037058A publication Critical patent/CN112037058A/en
Priority to PCT/CN2021/097243 priority patent/WO2022041901A1/en
Application granted granted Critical
Publication of CN112037058B publication Critical patent/CN112037058B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • 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/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/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

Abstract

The application relates to the technical field of block chains, in particular to a data verification method, a data verification device and a storage medium, which are applied to a server, wherein the method comprises the following steps: performing conflict comparison on the target block and a plurality of branches in a preset DAG network structure; if the target block does not conflict with a plurality of blocks in a plurality of branches, adding a branch for storing the target block; when MVCC verification is carried out, a target branch and a plurality of branches are verified in parallel; if the target block conflicts with the block of at least one first branch in the plurality of branches, selecting one first branch from the at least one first branch as a target branch; when the MVCC verification is performed, the MVCC verification may be performed on the target block after waiting for the completion of the MVCC verification by the at least one first branch. By adopting the embodiment of the application, the data verification efficiency is favorably improved.

Description

Data verification method, device and storage medium
Technical Field
The present application relates to the field of block chaining technologies, and in particular, to a data verification method, an apparatus, and a storage medium.
Background
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. One node in the block chain can provide endorsement services for the client, wherein the endorsement services comprise services of repeated check of transaction ID, generation of transaction read-write set and final signature and the like; when each transaction in the block chain is verified and stored, the verification process generally includes procedures such as identity authentication, signature authentication, Multi-Version Concurrency Control (MVCC) verification and the like, wherein the Multi-Version Concurrency Control (MVCC) verifies whether the data Version in the verifiable transaction is correct, currently, single thread is mostly adopted to verify all transactions one by one, and thus the data verification efficiency in the block chain is poor.
Disclosure of Invention
The embodiment of the application provides a data verification method, a data verification device and a storage medium, which are beneficial to improving the data verification efficiency.
A first aspect of the embodiments of the present application provides a data verification method, which is applied to a server, and includes:
acquiring a read set and a write set corresponding to a target block; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block;
judging whether the target block conflicts with at least one block in each branch or not according to the reading set; if there is no conflict between the target block and at least one block in each branch, performing a new target branch for storing the write set of the target block; when the MVCC verification is carried out on the plurality of branches, the MVCC verification is carried out on the target branch and the plurality of branches in parallel;
if the target block and at least one block of at least one first branch in the plurality of branches have conflict, executing to select any one first branch in the at least one first branch as the target branch, and adding the target block into the target branch; when the MVCC verification is carried out on the at least one first branch, waiting for each block in the branches except the target branch in the at least one first branch to finish the MVCC verification, and carrying out the MVCC verification on the target block after waiting for each block except the target block in the target branch to finish the MVCC verification.
A second aspect of the embodiments of the present application provides a data verification apparatus, which is applied to a server, and the apparatus includes: an acquisition unit, a judgment unit and a verification unit, wherein,
the acquisition unit is used for acquiring a read set and a write set corresponding to the target block; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block;
the judging unit is used for judging whether the target block conflicts with at least one block in each branch according to the read set; if there is no conflict between the target block and at least one block in each branch, performing a new target branch for storing the write set of the target block; when the MVCC verification is carried out on the plurality of branches, the MVCC verification is carried out on the target branch and the plurality of branches in parallel;
the verification unit is configured to, if a conflict exists between the target block and at least one block of at least one first branch of the multiple branches, perform selecting any one of the at least one first branch as the target branch, and add the target block to the target branch; when the MVCC verification is carried out on the at least one first branch, waiting for each block in the branches except the target branch in the at least one first branch to finish the MVCC verification, and carrying out the MVCC verification on the target block after waiting for each block except the target block in the target branch to finish the MVCC verification.
A third aspect of embodiments of the present application provides a server, which includes a processor, a communication interface, a memory, and one or more programs, where the processor, the communication interface, and the memory are connected to each other, where the memory is used to store a computer program, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to the first aspect of embodiments of the present application.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program makes a computer perform part or all of the steps as described in the first aspect of embodiments of the present application.
A fifth aspect of embodiments of the present application provides a computer program product, wherein the computer program product comprises a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps as described in the first aspect of embodiments of the present application. The computer program product may be a software installation package.
The embodiment of the application has at least the following beneficial effects: the reading set and the writing set corresponding to the target block can be obtained; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block; judging whether the target block conflicts with at least one block in each branch or not according to the read set; if the target block does not conflict with at least one block in each branch, executing a new target branch to store the write set of the target block; when the MVCC verification is carried out on the multiple branches, the MVCC verification is carried out on the target branch and the multiple branches in parallel; if the target block conflicts with at least one block of at least one first branch in the plurality of branches, executing to select any one first branch in the at least one first branch as a target branch, and adding the target block into the target branch; when the MVCC verification is carried out on at least one first branch, waiting for each block in the branches except the target branch in the at least one first branch to finish the MVCC verification, and carrying out the MVCC verification on the target block after waiting for each block except the target block in the target branch to finish the MVCC verification. Thus, the target block and a plurality of branches in the preset DAG network structure are subjected to conflict comparison; if the target block does not conflict with a plurality of blocks in a plurality of branches, adding a branch for storing the target block; when MVCC verification is carried out, a target branch and a plurality of branches are verified in parallel; if the target block conflicts with the block of at least one first branch in the plurality of branches, selecting one first branch from the at least one first branch as a target branch; when the MVCC verification is carried out, the MVCC verification can be carried out on the target block after the MVCC verification is finished by at least one first branch, so that the smooth proceeding of the MVCC verification can be ensured, and meanwhile, the blocks in the branches are verified in series by parallelly verifying the branches, the data verification efficiency is improved, and the performance of a block chain network is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1A is a schematic flowchart of a data verification method according to an embodiment of the present application;
fig. 1B is a network structure diagram of a directed acyclic graph according to an embodiment of the present application;
fig. 2A is a schematic flowchart of a data verification method according to an embodiment of the present application;
FIG. 2B is a network structure diagram of a DAG graph according to an embodiment of the present disclosure;
FIG. 2C is a network structure diagram of a DAG graph according to an embodiment of the present disclosure;
FIG. 2D is a diagram of a network structure of a DAG graph according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a data verification method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a server according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data verification apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to better understand the embodiments of the present application, methods of applying the embodiments of the present application will be described below.
The servers mentioned in the embodiments of the present application may include, but are not limited to, a background server, a component server, a cloud server, a data verification system server, or a data verification software server, which are merely examples, and are not exhaustive, and include, but are not limited to, the above devices.
Referring to fig. 1A, fig. 1A is a schematic flowchart of a data verification method provided in an embodiment of the present application, and is applied to a server, where the method includes the following steps:
101. acquiring a read set and a write set corresponding to a target block; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block.
The embodiment of the application is applied to a server, and the server can comprise a block chain network, wherein the block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.
The embodiments of the present application can be specifically applied to a wimax blockchain platform, where the wimax blockchain platform is a blockchain network composed of frames based on S3C, and S3C is a frame system composed of a blockchain solution module, a blockchain kernel module, a blockchain privacy protection module, and a blockchain network management module.
In this embodiment of the application, the preset DAG (Directed acyclic graph) network structure may be set by a user or default to a system, which is not limited herein.
In an embodiment of the present application, the directed acyclic graph is only one possible permutation and combination manner, and is not limited herein; each number may represent a block, the directed acyclic graph may include a plurality of (two or more) branches, each branch may include at least one block, and the predetermined DAG network structure is configured to store write sets and read sets corresponding to the plurality of blocks. The plurality of blocks are stored through the preset DAG network structure, the plurality of blocks are classified in a process mode, so that MVCC verification can be performed on the plurality of blocks in parallel according to a plurality of branches when the plurality of blocks are subjected to MVCC verification subsequently, verification efficiency is improved, and meanwhile performance of the block chain is improved.
The target block or block may refer to a data organization unit in a blockchain network, and the blocks may be concatenated by a linked list, each block being packed with at least one transaction, which is actual data stored in the blockchain network, and the block may record when and in what order certain transactions are to be part of the blockchain.
At least one transaction can be stored or packaged in the target block, each transaction can correspond to a set of transaction data, and the transaction data can include at least one of the following items: version number, block ID, data key value pair, certificate information, signature information, public key, etc., which are not limited herein; the at least one transaction may be related or unrelated, and is not limited herein.
Optionally, after obtaining the read set and the write set corresponding to the target block, the method may further include the following steps: acquiring at least one corresponding target transaction in the target block; respectively performing identity authentication and signature authentication on each target transaction; if any target transaction A in the at least one target transaction fails in identity authentication and/or signature authentication, executing a data verification step of terminating the target transaction A, wherein the data verification step at least comprises the following steps: the signature authentication or the MVCC verification.
Each target transaction may include transaction data, and the transaction data may include at least one of the following: version number, block ID, data key value pair, certificate information, signature information, public and private keys, etc., which are not limited herein.
The identity (VACC) authentication is to Verify whether the initiator of the transaction has the right to initiate the transaction by using the corresponding certificate information in the transaction data in the target block.
The Signature (VSCC) authentication is to Verify whether the number of executors of the transaction meets the requirement and whether the Signature of the transaction executor included in the transaction data is correct.
The Multi-Version Concurrency Control (MVCC) verification is a Concurrency Control method, and is used for verifying whether the data Version of the transaction data included in the block is correct; that is, whether the read set of the transaction in the check block is consistent with the version in the current database book (i.e., has no change), if not, it indicates that the modification of the data in the transaction write set is valid, the transaction is marked as valid, and the write set of the transaction is updated to a specific database (e.g., a status database).
Generally, identity authentication, signature authentication, MVCC verification and the like can be respectively performed on each transaction to verify whether the transaction data is correct, whether the initiator has the right and the like, and then the verified data can be stored in the corresponding database, so that the security of the transaction data is ensured.
In a specific implementation, the verification may be performed on the transaction data included in any one of the target transactions, and if any one of the signature authentication, the identity authentication, and the MVCC verification fails, the subsequent authentication is terminated.
102. Judging whether the target block conflicts with at least one block in each branch or not according to the reading set; if there is no conflict between the target block and at least one block in each branch, performing a new target branch for storing the write set of the target block; and when the MVCC verification is carried out on the plurality of branches, the MVCC verification is carried out on the target branch and the plurality of branches in parallel.
In the MVCC verification, the server mainly obtains the block from the database and mainly verifies the version of the read set of the transaction contained in the block, but when there are many blocks to be verified, if one block is obtained from the database and MVCC verification is implemented in a single thread, the efficiency is not high.
In the embodiment of the present application, only one block, that is, a target block, obtained by a server from a database is taken as an example to describe the data verification method.
After the target block is obtained, the transaction data in the target block may be associated with transaction data in other stored blocks in the database, for example, when one transaction data in the target block is subjected to MVCC verification, the transaction data in the block may need to be used as reference data; thus, when performing MVCC verification, the block associated with the target block may conflict or affect the MVCC verification process; therefore, the target block and the rest of the blocks can be judged to be in conflict before the MVCC verification is carried out.
In a specific implementation, the read set of the target block may be compared with the write set corresponding to a block already stored in the database, or the stored block information may be acquired from the database, and if there is no conflict between the target block and each block in each branch, it is indicated that there is no data association between the target block and each block in the multiple branches of the preset DAG network structure, and then, a target branch may be newly added to store the write set of the target block.
In a possible example, the determining whether the target block conflicts with at least one block in each branch according to the read set may include: verifying whether the read set is related to a write set corresponding to at least one block in each branch or not according to the read set; if the read set is not associated with the write set corresponding to each block, determining that no conflict exists between the target block and at least one block in each branch; determining that a conflict exists between the target block and at least one of the plurality of branches if there is an association between the read set and a write set of at least one block in at least one branch.
In one possible example, the verifying whether there is a relationship between the read set and the write set corresponding to at least one block in each branch may include: determining at least one first key value pair in a reading set corresponding to the target block, wherein each first key value corresponds to one target transaction; determining at least one second key-value pair included in each block in each branch, each second key-value pair corresponding to a transaction in one block; if at least one first key-value pair is equal to at least one second key-value pair, performing to determine that there is an association between the read set and a write set corresponding to at least one block; and if any one first key-value pair is not equal to any one second key-value pair, determining that the read set is not related to the write set corresponding to each block.
The key-value pair is a mapping set of a key and a value, and the key-value pair may also be a hash value, which is not limited herein.
The key value pairs can all have data version numbers, and the versions of the key value pairs can be recorded in a reading set; the latest value of the key value pair can be stored in a writing set, the current values of all the key value pairs in the book can be recorded in a database of the blockchain network, which is equivalent to indexing the transaction log of the current book, and when the transaction changes, the corresponding key value pair is correspondingly updated, and the data in the corresponding database is also updated; thus, the server may effect a determination of whether a conflict exists between the blocks by comparing the most recent value of a first key-value pair in the read set in the target block to a second key-value pair stored in the write set of each block in the plurality of branches.
In a specific implementation, a read set of a target block can be read from a database, the read set includes at least one target transaction, each target transaction can correspond to one first key-value pair, similarly, a plurality of branches in a preset DAG network structure can be obtained, and a second key-value pair corresponding to each block in each branch is obtained, if there is a relationship between a certain target transaction data in the target block and transaction data corresponding to any one block in the plurality of blocks, the key-value pairs corresponding to the two transactions are updated, and the two key-value pairs are equal, so that if there is a relationship between any one first key-value pair and at least one second key-value pair, it is indicated that there is a relationship between the target block and the transaction data corresponding to the at least one second key-value pair; on the contrary, if there is no case that any one of the first key-value pair and the second key-value pair is equal, it indicates that there is no association between the target block and the plurality of blocks.
103. If the target block and at least one block of at least one first branch in the plurality of branches have conflict, executing to select any one first branch in the at least one first branch as the target branch, and adding the target block into the target branch; when the MVCC verification is carried out on the at least one first branch, waiting for each block in the branches except the target branch in the at least one first branch to finish the MVCC verification, and carrying out the MVCC verification on the target block after waiting for each block except the target block in the target branch to finish the MVCC verification.
If there is a conflict between the target block and any one of the first branches, it indicates that there is related transaction data between the target block and the block in the first branch that generates the conflict, and then when performing MVCC verification subsequently, serial verification can be performed between the target branch corresponding to the target block and the conflicting first branch, otherwise, if there is no conflict, parallel verification can be performed between the target branch corresponding to the target block and the multiple branches.
Further, taking a target block in the target branch as an example, if there is a conflict between the target block and at least one block of at least one first branch in the plurality of branches, selecting any one first branch in the at least one first branch as the target branch; then, when the MVCC verification is subsequently performed on the at least one first branch (including the target branch), since the target branch collides with the remaining at least one first branch, the MVCC verification may be performed on the target block after the verification of the remaining at least one first branch is completed and after the verification of all the remaining blocks in the target branch is completed.
Optionally, if there is no conflict between the at least one first branch except the target branch, the at least one first branch may be verified in parallel during the verification process of MVCC, and after the verification of each block in all the first branches is completed, the target block in the target branch may be verified; similarly, for the target branch, if there is no conflict between the remaining blocks in the target branch, the MVCC verification may be performed on the multiple blocks in the target branch without conflict in parallel, and after the verification of the multiple blocks without conflict is completed, the MVCC verification may be performed on the target block.
It can be seen that, by adopting the embodiment of the application, the classification of a plurality of blocks can be realized by presetting a DAG network structure, the blocks corresponding to branches are not conflicted, and the blocks in the branches may have conflicts; furthermore, when performing MVCC authentication, the MVCC authentication can be performed in parallel between branches, and the MVCC authentication can be performed in series within a branch,
it can be seen that the data verification method described in the embodiment of the present application is applied to a server, and can obtain a read set and a write set corresponding to a target block; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block; judging whether the target block conflicts with at least one block in each branch or not according to the read set; if the target block does not conflict with at least one block in each branch, executing a new target branch to store the write set of the target block; when the MVCC verification is carried out on the multiple branches, the MVCC verification is carried out on the target branch and the multiple branches in parallel; if the target block conflicts with at least one block of at least one first branch in the plurality of branches, executing to select any one first branch in the at least one first branch as a target branch, and adding the target block into the target branch; when the MVCC verification is carried out on at least one first branch, waiting for each block in the branches except the target branch in the at least one first branch to finish the MVCC verification, and carrying out the MVCC verification on the target block after waiting for each block except the target block in the target branch to finish the MVCC verification. Thus, the target block and a plurality of branches in the preset DAG network structure are subjected to conflict comparison; if the target block does not conflict with a plurality of blocks in a plurality of branches, adding a branch for storing the target block; when MVCC verification is carried out, a target branch and a plurality of branches are verified in parallel; if the target block conflicts with the block of at least one first branch in the plurality of branches, selecting one first branch from the at least one first branch as a target branch; when the MVCC verification is carried out, the MVCC verification can be carried out on the target block after the MVCC verification is finished by at least one first branch, so that the smooth proceeding of the MVCC verification can be ensured, and meanwhile, the blocks in the branches are verified in series by parallelly verifying the branches, the data verification efficiency is improved, and the performance of a block chain network is improved.
In accordance with the above, please refer to fig. 2A, fig. 2A is a flowchart illustrating a data verification method disclosed in an embodiment of the present application, and the data verification method is applied to a server, and the data verification method may include the following steps:
201. acquiring a read set and a write set corresponding to a target block; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block.
202. And verifying whether the read set is related to the read set corresponding to at least one block in each branch or not according to the read set.
203. And if the read set is not associated with the read set corresponding to each block, determining that no conflict exists between the target block and at least one block in each branch.
204. Determining that a conflict exists between the target block and at least one of the plurality of branches if there is an association between the read set and a read set of at least one block in at least one branch.
205. And if the target block conflicts with at least one block of at least one first branch in the plurality of branches, executing to select any one first branch in the at least one first branch as the target branch, and adding the target block into the target branch.
206. If there is no conflict between the target block and at least one block in each branch, performing a new target branch for storing the write set of the target block; and when the MVCC verification is carried out on the plurality of branches, the MVCC verification is carried out on the target branch and the plurality of branches in parallel.
The detailed description of the above steps 201-206 can refer to the corresponding description of the data verification method described in fig. 1B, and will not be described herein again.
207. Determining at least one second branch of the plurality of branches that does not conflict with the target branch.
The second branch does not conflict with the target branch, which means that the transaction data corresponding to any block in each second branch is not related to the target transaction data corresponding to the target block.
208. Performing the MVCC validation in parallel with the at least one first branch and the at least one second branch.
Since each second branch is not in conflict with the first branch and the target branch, the at least one second branch, the at least one first branch and the target branch can be verified in parallel during the MVCC verification, so as to improve the data verification efficiency.
In addition, inside the branch, since the blocks inside the branch may be in conflict, the blocks in conflict may be verified in series, and the blocks in no conflict may be verified in parallel.
209. When the MVCC verification is carried out on the at least one first branch, waiting for each block in the branches except the target branch in the at least one first branch to finish the MVCC verification, and carrying out the MVCC verification on the target block after waiting for each block except the target block in the target branch to finish the MVCC verification.
The detailed description of step 209 may refer to the corresponding description of the data verification method described in fig. 1B, and is not repeated herein.
For example, as shown in fig. 2B, which is a network structure diagram of a DAG graph, each number may correspond to a block, and first, before performing MVCC verification, the server may obtain block 1, read the corresponding read set and write set of block 1, and may establish a branch based on block 1, which is a first branch in which read set 1 and write set 1 of block 1 may be stored; then, a block 2 and a read set 2 and a write set 2 corresponding to the block 2 can be obtained, and by judging that a conflict exists between the read set 2 and the read set 1, the read set 2 and the write set 2 corresponding to the block 2 are correspondingly stored in a first branch; acquiring a block 3, and a read set 3 and a write set 3 corresponding to the block 3, comparing the read set 3 with the read set 2 and the read set 1, and determining that the read set 3 does not conflict with the read set 2 and the read set 1, adding a new branch, namely a second branch, in the preset DGA network structure, for storing the read set 3 and the write set 4 corresponding to the block 3; similarly, the block 4 and the read set 4 and the write set 4 corresponding to the block 4 can be obtained, and if the read set 4 does not conflict with the read set 1, the read set 2, and the read set 3, a third branch is added for storing the write set 4 and the read set 4 of the block 4.
Still further, at this time, the block 5 and the corresponding read set 5 and write set 5 thereof may be obtained, and the read set 5 is compared with the read set 2, the read set 1, the read set 3, and the read set 4, respectively, to determine that the read set 5 conflicts with both the read set 3 and the read set 4, and then a branch where one read set is located may be selected as a target branch of the read set 5, as shown in fig. 2C, a third branch may be selected as the target branch, and the third branch is added.
In addition, as shown in fig. 2D, if the block 5 is added to the second branch, the second branch can be selected as the target branch of the block 5, and the third branch is added.
Furthermore, when MVCC verification is subsequently performed, the first branch, the second branch and the third branch may be verified in parallel, and inside the branches, serial verification may be performed, for example, for the first branch, block 1 may be verified before block 2 is verified; since the block 5 in the third branch also conflicts with the block 3 in the second branch, that is, the transaction data in the block 5 is associated with both the block 3 and the block 4, the block 5 can be verified after the block 3 and the block 4 are verified during the MVCC verification.
It can be seen that the data verification method described in the embodiment of the present application is applied to a server, and obtains a read set and a write set corresponding to a target block; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block; verifying whether the read set is related to the read set corresponding to at least one block in each branch or not according to the read set; if the read set is not associated with the read set corresponding to each block, determining that no conflict exists between the target block and at least one block in each branch; if there is a correlation between the read set and the read set of at least one block in the at least one branch, performing a determination that a conflict exists between the target block and at least one branch in the plurality of branches; if the target block and at least one block of at least one first branch in the plurality of branches have conflict, performing selecting any one first branch in the at least one first branch as a target branch, and adding the target block into the target branch. Determining at least one second branch of the plurality of branches that does not conflict with the target branch; if the target block does not conflict with at least one block in each branch, executing a new target branch to store the write set of the target block; when the MVCC verification is carried out on the multiple branches, the MVCC verification is carried out on the target branch and the multiple branches in parallel; when the MVCC verification is carried out on at least one first branch, waiting for each block in the branches except the target branch in the at least one first branch to finish the MVCC verification, and carrying out the MVCC verification on the target block after waiting for each block except the target block in the target branch to finish the MVCC verification. Thus, the blocks can be classified based on the preset DAG network structure, the blocks corresponding to the related transaction data are placed in the same branch, and the blocks corresponding to the unrelated transaction data are placed in different branches; and when the MVCC high-concurrency verification is carried out subsequently, the parallel verification can be carried out between the branches, and the serial or parallel verification can be carried out in the branches, so that the data verification efficiency is improved.
In accordance with the above, please refer to fig. 3, fig. 3 is a flowchart illustrating a data verification method disclosed in an embodiment of the present application, applied to a server, where the data verification method may include the following steps:
301. acquiring a read set and a write set corresponding to a target block; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block.
302. Judging whether the target block conflicts with at least one block in each branch or not according to the reading set; if there is no conflict between the target block and at least one block in each branch, performing a new target branch for storing the write set of the target block; and when the MVCC verification is carried out on the plurality of branches, the MVCC verification is carried out on the target branch and the plurality of branches in parallel.
303. And if the target block conflicts with at least one block of at least one first branch in the plurality of branches, executing to select any one first branch in the at least one first branch as the target branch, and adding the target block into the target branch.
The detailed description of the steps 301-303 can refer to the corresponding description of the data verification method described in fig. 1B, and will not be described herein again.
304. Determining at least one second branch of the plurality of branches that does not conflict with the target branch.
305. Performing the MVCC validation in parallel with the at least one first branch and the at least one second branch.
The detailed description of the step 304-305 can refer to the corresponding description of the data verification method described in fig. 2A, and is not repeated herein.
306. When the MVCC verification is carried out on the at least one first branch, waiting for each block in the other branches except the target branch in the at least one first branch to finish the MVCC verification, and after waiting for each block except the target block in the target branch to finish the MVCC verification, executing to determine the transaction data corresponding to each target transaction to obtain at least one transaction data.
307. And acquiring a data version number corresponding to each transaction data to obtain at least one data version number.
308. Comparing each data version number with a preset version number, and if each data version number is the same as the preset version number, determining that the MVCC verification is successful on the target block; and if one data version number is different from the preset version number, determining that the MVCC verification of the target block fails.
The preset version number may be set by the user or default to the system, and is not limited herein. The preset version number may be set by a background worker, for example, the preset version number may be 100 or 200, and if the MVCC verification is successful for one transaction, it indicates that the transaction is valid, the block corresponding to the transaction may be stored in the local chain, and the corresponding result data that is successfully verified may be stored in the database.
In the embodiment of the present application, only one block is taken as an example for data verification, each block may include at least one transaction, and generally, hundreds of transactions may be correspondingly packed in the block. The target block may include at least one target transaction, and when the target block is subjected to MVCC verification, each target transaction is taken as a unit, and the completion of MVCC verification of the target block can be determined until the completion of each target transaction verification.
In a specific implementation, the version number corresponding to the transaction data corresponding to each target transaction may be stored in a corresponding read set of the block in the database, and whether the transaction is valid or not may be verified through the transaction version number, that is, whether the transaction is a normal transaction or not may be verified, if the data version number changes, the transaction is indicated to be invalid, that is, the transaction may be overtime or outdated, the transaction may be determined to be invalid, and the target block is determined to fail to perform MVCC verification; if the data version number corresponding to the transaction is the same as the preset version number, the transaction can be determined to be a normal transaction, and the verification of the target block MVCC can be determined to be successful.
309. And when the MVCC verification of the target block is completed, deleting the write set corresponding to the target block in the target branch.
The server deletes the write set corresponding to the target block and writes the operation into the database after the MVCC verification of the target block is completed, so as to prevent the repeated MVCC verification, in addition, after a new block is acquired from the database during the next MVCC verification, because the write set can store the latest key value pair, the read set corresponding to the new block and the write set of the target block can be compared to determine whether the conflict exists between the read set and the write set, if the conflict exists, the related steps can be repeated when the MVCC verification is performed on the write set of the new block, so as to complete the verification of the MVCC of the new block.
It can be seen that the data verification method described in the embodiment of the present application is applied to a server, and obtains a read set and a write set corresponding to a target block; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block; judging whether the target block conflicts with at least one block in each branch or not according to the read set; if the target block does not conflict with at least one block in each branch, executing a new target branch to store the write set of the target block; when the MVCC verification is carried out on the multiple branches, the MVCC verification is carried out on the target branch and the multiple branches in parallel; if the target block and at least one block of at least one first branch in the plurality of branches have conflict, performing selecting any one first branch in the at least one first branch as a target branch, and adding the target block into the target branch. When the MVCC verification is carried out on at least one first branch, waiting for each block in other branches except the target branch in the at least one first branch to finish the MVCC verification, and after waiting for each block except the target block in the target branch to finish the MVCC verification, executing and determining transaction data corresponding to each target transaction to obtain at least one transaction data; determining at least one second branch of the plurality of branches that does not conflict with the target branch; performing MVCC verification on the at least one first branch and the at least one second branch in parallel; when the MVCC verification is carried out on at least one first branch, waiting for each block in other branches except the target branch in the at least one first branch to finish the MVCC verification, and after waiting for each block except the target block in the target branch to finish the MVCC verification, executing and determining transaction data corresponding to each target transaction to obtain at least one transaction data; acquiring a data version number corresponding to each transaction data to obtain at least one data version number; comparing each data version number with a preset version number, and if each data version number is the same as the preset version number, determining that the MVCC verification is successful on the target block; if one data version number is different from the preset version number, determining that the MVCC verification of the target block fails; and when the MVCC verification of the target block is completed, deleting the write set corresponding to the target block in the target branch. Thus, the blocks can be classified based on the preset DAG network structure, the blocks corresponding to the related transaction data are placed in the same branch, and the blocks corresponding to the unrelated transaction data are placed in different branches; and when the MVCC high-concurrency verification is carried out subsequently, the parallel verification can be carried out between the branches, and the serial or parallel verification can be carried out in the branches, so that the data verification efficiency is improved. In addition, after the verification of the target block MVCC is completed, the write set corresponding to the target block can be deleted to avoid repeated verification.
In accordance with the above, please refer to fig. 4, fig. 4 is a schematic structural diagram of a server according to an embodiment of the present application, and as shown in fig. 4, the server includes a processor, a communication interface, a memory and one or more programs, where the processor, the communication interface and the memory are connected to each other, the memory is used for storing a computer program, the computer program includes program instructions, the processor is configured to call the program instructions, and the one or more program programs include instructions for performing the following steps:
acquiring a read set and a write set corresponding to a target block; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block;
judging whether the target block conflicts with at least one block in each branch or not according to the reading set; if there is no conflict between the target block and at least one block in each branch, performing a new target branch for storing the write set of the target block; when the MVCC verification is carried out on the plurality of branches, the MVCC verification is carried out on the target branch and the plurality of branches in parallel;
if the target block and at least one block of at least one first branch in the plurality of branches have conflict, executing to select any one first branch in the at least one first branch as the target branch, and adding the target block into the target branch; when the MVCC verification is carried out on the at least one first branch, waiting for each block in the branches except the target branch in the at least one first branch to finish the MVCC verification, and carrying out the MVCC verification on the target block after waiting for each block except the target block in the target branch to finish the MVCC verification.
It can be seen that the server described in the embodiment of the present application can obtain a read set and a write set corresponding to a target block; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block; judging whether the target block conflicts with at least one block in each branch or not according to the read set; if the target block does not conflict with at least one block in each branch, executing a new target branch to store the write set of the target block; when the MVCC verification is carried out on the multiple branches, the MVCC verification is carried out on the target branch and the multiple branches in parallel; if the target block conflicts with at least one block of at least one first branch in the plurality of branches, executing to select any one first branch in the at least one first branch as a target branch, and adding the target block into the target branch; when the MVCC verification is carried out on at least one first branch, waiting for each block in the branches except the target branch in the at least one first branch to finish the MVCC verification, and carrying out the MVCC verification on the target block after waiting for each block except the target block in the target branch to finish the MVCC verification. Thus, the target block and a plurality of branches in the preset DAG network structure are subjected to conflict comparison; if the target block does not conflict with a plurality of blocks in a plurality of branches, adding a branch for storing the target block; when MVCC verification is carried out, a target branch and a plurality of branches are verified in parallel; if the target block conflicts with the block of at least one first branch in the plurality of branches, selecting one first branch from the at least one first branch as a target branch; when the MVCC verification is carried out, the MVCC verification can be carried out on the target block after the MVCC verification is finished by at least one first branch, so that the smooth proceeding of the MVCC verification can be ensured, and meanwhile, the blocks in the branches are verified in series by parallelly verifying the branches, the data verification efficiency is improved, and the performance of a block chain network is improved.
In one possible example, after obtaining the read set and the write set corresponding to the target block, the program is configured to execute the following steps:
acquiring at least one corresponding target transaction in the target block;
respectively performing identity authentication and signature authentication on each target transaction;
if any target transaction A in the at least one target transaction fails in identity authentication and/or signature authentication, executing a data verification step of terminating the target transaction A, wherein the data verification step at least comprises the following steps: the signature authentication or the MVCC verification.
In one possible example, in said determining whether there is a conflict between said target block and at least one block in said each branch according to said read set, said program is configured to perform the following steps:
verifying whether the read set is related to the write set corresponding to at least one block in each branch or not according to the read set;
if the read set is not associated with the write set corresponding to each block, determining that no conflict exists between the target block and at least one block in each branch;
determining that a conflict exists between the target block and at least one of the plurality of branches if there is an association between the read set and a write set of at least one block in at least one branch.
In one possible example, in the verifying whether there is a relationship between the read set and a write set corresponding to at least one block in the each branch, the program is for instructions to:
determining at least one first key value pair in a reading set corresponding to the target block, wherein each first key value corresponds to one target transaction;
determining at least one second key-value pair included in each block in each branch, each second key-value pair corresponding to a transaction in one block;
if at least one first key-value pair is equal to at least one second key-value pair, performing to determine that there is an association between the read set and a write set corresponding to at least one block; and if any one first key-value pair is not equal to any one second key-value pair, determining that the read set is not related to the write set corresponding to each block.
In one possible example, in the MVCC verification of the target block, the program is to perform the instructions of:
determining transaction data corresponding to each target transaction to obtain at least one transaction data;
acquiring a data version number corresponding to each transaction data to obtain at least one data version number;
comparing each data version number with a preset version number, and if each data version number is the same as the preset version number, determining that the MVCC verification is successful on the target block; and if one data version number is different from the preset version number, determining that the MVCC verification of the target block fails.
In one possible example, if the read set conflicts with at least one of the plurality of branches, the program is operable to, in the MVCC verification of the at least one first branch, execute the instructions of:
determining at least one second branch of the plurality of branches that does not conflict with the target branch;
performing the MVCC validation in parallel with the at least one first branch and the at least one second branch.
In one possible example, the program is further for instructions to perform the steps of:
and when the MVCC verification of the target block is completed, deleting the write set corresponding to the target block in the target branch.
The above description has introduced the solution of the embodiment of the present application mainly from the perspective of the method-side implementation process. It is understood that the server includes hardware structures and/or software modules for performing the respective functions in order to implement the above-described functions. Those of skill in the art will readily appreciate that the present application is capable of hardware or a combination of hardware and computer software implementing the various illustrative elements and algorithm steps described in connection with the embodiments provided herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the server may be divided into the functional units according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
In accordance with the above, please refer to fig. 5, fig. 5 is a schematic structural diagram of a data verification apparatus disclosed in the embodiment of the present application, which is applied to a server, and the apparatus includes: an acquisition unit 501, a judgment unit 502, and a verification unit 503, wherein,
the acquiring unit 501 is configured to acquire a read set and a write set corresponding to a target block; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block;
the determining unit 502 is configured to determine whether a conflict exists between the target block and at least one block in each branch according to the read set; if there is no conflict between the target block and at least one block in each branch, performing a new target branch for storing the write set of the target block; when the MVCC verification is carried out on the plurality of branches, the MVCC verification is carried out on the target branch and the plurality of branches in parallel;
the verification unit 503 is configured to, if there is a conflict between the target block and at least one block of at least one first branch of the multiple branches, perform selecting any one of the at least one first branch as the target branch, and add the target block to the target branch; when the MVCC verification is carried out on the at least one first branch, waiting for each block in the branches except the target branch in the at least one first branch to finish the MVCC verification, and carrying out the MVCC verification on the target block after waiting for each block except the target block in the target branch to finish the MVCC verification.
It can be seen that, the data verification apparatus described in the embodiment of the present application is applied to a server, and can obtain a read set and a write set corresponding to a target block; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block; judging whether the target block conflicts with at least one block in each branch or not according to the read set; if the target block does not conflict with at least one block in each branch, executing a new target branch to store the write set of the target block; when the MVCC verification is carried out on the multiple branches, the MVCC verification is carried out on the target branch and the multiple branches in parallel; if the target block conflicts with at least one block of at least one first branch in the plurality of branches, executing to select any one first branch in the at least one first branch as a target branch, and adding the target block into the target branch; when the MVCC verification is carried out on at least one first branch, waiting for each block in the branches except the target branch in the at least one first branch to finish the MVCC verification, and carrying out the MVCC verification on the target block after waiting for each block except the target block in the target branch to finish the MVCC verification. Thus, the target block and a plurality of branches in the preset DAG network structure are subjected to conflict comparison; if the target block does not conflict with a plurality of blocks in a plurality of branches, adding a branch for storing the target block; when MVCC verification is carried out, a target branch and a plurality of branches are verified in parallel; if the target block conflicts with the block of at least one first branch in the plurality of branches, selecting one first branch from the at least one first branch as a target branch; when the MVCC verification is carried out, the MVCC verification can be carried out on the target block after the MVCC verification is finished by at least one first branch, so that the smooth proceeding of the MVCC verification can be ensured, and meanwhile, the blocks in the branches are verified in series by parallelly verifying the branches, the data verification efficiency is improved, and the performance of a block chain network is improved.
In a possible example, in the aspect of determining whether the target block and at least one block in each branch have a conflict according to the read set, the determining unit 502 is specifically configured to:
verifying whether the read set is related to the write set corresponding to at least one block in each branch or not according to the read set;
if the read set is not associated with the write set corresponding to each block, determining that no conflict exists between the target block and at least one block in each branch;
determining that a conflict exists between the target block and at least one of the plurality of branches if there is an association between the read set and a write set of at least one block in at least one branch.
In one possible example, in the verifying whether there is a relationship between the read set and the write set corresponding to at least one block in each branch, the verifying unit 503 is specifically configured to:
determining at least one first key value pair in a reading set corresponding to the target block, wherein each first key value corresponds to one target transaction;
determining at least one second key-value pair included in each block in each branch, each second key-value pair corresponding to a transaction in one block;
if at least one first key-value pair is equal to at least one second key-value pair, performing to determine that there is an association between the read set and a write set corresponding to at least one block; and if any one first key-value pair is not equal to any one second key-value pair, determining that the read set is not related to the write set corresponding to each block.
In one possible example, in terms of the MVCC verification on the target block, the verification unit 503 is further specifically configured to:
determining transaction data corresponding to each target transaction to obtain at least one transaction data;
acquiring a data version number corresponding to each transaction data to obtain at least one data version number;
comparing each data version number with a preset version number, and if each data version number is the same as the preset version number, determining that the MVCC verification is successful on the target block; and if one data version number is different from the preset version number, determining that the MVCC verification of the target block fails.
In a possible example, if the read set conflicts with at least one of the plurality of branches, in the MVCC verification on the at least one first branch, the verification unit 503 is further specifically configured to:
determining at least one second branch of the plurality of branches that does not conflict with the target branch;
performing the MVCC validation in parallel with the at least one first branch and the at least one second branch.
Embodiments of the present application also provide a computer-readable storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any one of the data verification methods as described in the above method embodiments.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any one of the data verification methods as described in the above method embodiments.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may be implemented in the form of a software program module.
The integrated units, if implemented in the form of software program modules and sold or used as stand-alone products, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned memory comprises: various media capable of storing program codes, such as a usb disk, a read-only memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and the like.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash disk, ROM, RAM, magnetic or optical disk, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A data verification method is applied to a server and comprises the following steps:
acquiring a read set and a write set corresponding to a target block; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block;
judging whether the target block conflicts with at least one block in each branch or not according to the reading set; if there is no conflict between the target block and at least one block in each branch, performing a new target branch for storing the write set of the target block; when the MVCC verification is carried out on the plurality of branches, the MVCC verification is carried out on the target branch and the plurality of branches in parallel;
if the target block and at least one block of at least one first branch in the plurality of branches have conflict, executing to select any one first branch in the at least one first branch as the target branch, and adding the target block into the target branch; when the MVCC verification is carried out on the at least one first branch, waiting for each block in the branches except the target branch in the at least one first branch to finish the MVCC verification, and carrying out the MVCC verification on the target block after waiting for each block except the target block in the target branch to finish the MVCC verification.
2. The method of claim 1, wherein after obtaining the read set and the write set corresponding to the target block, the method further comprises:
acquiring at least one corresponding target transaction in the target block;
respectively performing identity authentication and signature authentication on each target transaction;
if any target transaction A in the at least one target transaction fails in identity authentication and/or signature authentication, executing a data verification step of terminating the target transaction A, wherein the data verification step at least comprises the following steps: the signature authentication or the MVCC verification.
3. The method of claim 1, wherein said determining whether the target block conflicts with at least one block in each branch according to the read set comprises:
verifying whether the read set is related to the write set corresponding to at least one block in each branch or not according to the read set;
if the read set is not associated with the write set corresponding to each block, determining that no conflict exists between the target block and at least one block in each branch;
determining that a conflict exists between the target block and at least one of the plurality of branches if there is an association between the read set and a write set of at least one block in at least one branch.
4. The method according to any of claims 1-3, wherein said verifying whether there is a relationship between said read set and a write set corresponding to at least one block in each of said branches comprises:
determining at least one first key value pair in a reading set corresponding to the target block, wherein each first key value corresponds to one target transaction;
determining at least one second key-value pair included in each block in each branch, each second key-value pair corresponding to a transaction in one block;
if at least one first key-value pair is equal to at least one second key-value pair, performing to determine that there is an association between the read set and a write set corresponding to at least one block; and if any one first key-value pair is not equal to any one second key-value pair, determining that the read set is not related to the write set corresponding to each block.
5. The method of claim 1 or 2, wherein the performing MVCC verification on the target block comprises:
determining transaction data corresponding to each target transaction to obtain at least one transaction data;
acquiring a data version number corresponding to each transaction data to obtain at least one data version number;
comparing each data version number with a preset version number, and if each data version number is the same as the preset version number, determining that the MVCC verification is successful on the target block; and if one data version number is different from the preset version number, determining that the MVCC verification of the target block fails.
6. The method of claim 1 or 5, wherein if the read set conflicts with at least one of the plurality of branches, the method further comprises, upon performing the MVCC verification on the at least one first branch:
determining at least one second branch of the plurality of branches that does not conflict with the target branch;
performing the MVCC validation in parallel with the at least one first branch and the at least one second branch.
7. The method of any one of claims 1-6, wherein the method further comprises:
and when the MVCC verification of the target block is completed, deleting the write set corresponding to the target block in the target branch.
8. A data verification apparatus, applied to a server, the apparatus comprising: an acquisition unit, a judgment unit and a verification unit, wherein,
the acquisition unit is used for acquiring a read set and a write set corresponding to the target block; obtaining a plurality of branches in a preset DAG network structure, wherein each branch corresponds to at least one block;
the judging unit is used for judging whether the target block conflicts with at least one block in each branch according to the read set; if there is no conflict between the target block and at least one block in each branch, performing a new target branch for storing the write set of the target block; when the MVCC verification is carried out on the plurality of branches, the MVCC verification is carried out on the target branch and the plurality of branches in parallel;
the verification unit is configured to, if a conflict exists between the target block and at least one block of at least one first branch of the multiple branches, perform selecting any one of the at least one first branch as the target branch, and add the target block to the target branch; when the MVCC verification is carried out on the at least one first branch, waiting for each block in the branches except the target branch in the at least one first branch to finish the MVCC verification, and carrying out the MVCC verification on the target block after waiting for each block except the target block in the target branch to finish the MVCC verification.
9. A server comprising a processor, a communication interface, a memory and one or more programs, the processor, the communication interface and the memory being interconnected, wherein the memory is configured to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to carry out the method according to any one of claims 1-7.
CN202010883730.6A 2020-08-28 2020-08-28 Data verification method, device and storage medium Active CN112037058B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010883730.6A CN112037058B (en) 2020-08-28 2020-08-28 Data verification method, device and storage medium
PCT/CN2021/097243 WO2022041901A1 (en) 2020-08-28 2021-05-31 Data verification method and apparatus, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010883730.6A CN112037058B (en) 2020-08-28 2020-08-28 Data verification method, device and storage medium

Publications (2)

Publication Number Publication Date
CN112037058A true CN112037058A (en) 2020-12-04
CN112037058B CN112037058B (en) 2024-03-26

Family

ID=73587610

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010883730.6A Active CN112037058B (en) 2020-08-28 2020-08-28 Data verification method, device and storage medium

Country Status (2)

Country Link
CN (1) CN112037058B (en)
WO (1) WO2022041901A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113746908A (en) * 2021-08-19 2021-12-03 卓尔智联(武汉)研究院有限公司 Data processing method and system, electronic device and computer storage medium
WO2022041901A1 (en) * 2020-08-28 2022-03-03 平安科技(深圳)有限公司 Data verification method and apparatus, and storage medium
CN114221961A (en) * 2021-12-14 2022-03-22 深圳前海微众银行股份有限公司 Hierarchical DAG block chain generation method, apparatus, medium, and program product
CN115796874A (en) * 2023-01-09 2023-03-14 杭州安节科技有限公司 Operation-level block chain transaction concurrent execution method

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180254093A1 (en) * 2017-03-02 2018-09-06 Allocrypt Inc. Cryptographically secure medical test data distribution system using smart testing/diagnostic devices
US20180260212A1 (en) * 2017-03-10 2018-09-13 Salesforce.Com, Inc. Blockchain version control systems
CN109559226A (en) * 2018-11-28 2019-04-02 杭州有盾网络科技有限公司 Block chain transaction execution method, system and electronic equipment and storage medium
US20190238525A1 (en) * 2018-01-31 2019-08-01 Salesforce.Com, Inc. Systems, methods, and apparatuses for implementing super community and community sidechains with consent management for distributed ledger technologies in a cloud based computing environment
US20200026552A1 (en) * 2018-07-20 2020-01-23 Fujitsu Limited Method and apparatus for managing effectiveness of information processing task
CN110851535A (en) * 2019-11-18 2020-02-28 腾讯科技(深圳)有限公司 Data processing method and device based on block chain, storage medium and terminal
US20200133955A1 (en) * 2018-10-31 2020-04-30 Salesforce.Com, Inc. Systems, methods, and apparatuses for implementing consumer data validation, matching, and merging across tenants with optional verification prompts utilizing blockchain
WO2020108289A1 (en) * 2018-11-29 2020-06-04 华为技术有限公司 Database system, node and method
CN111241061A (en) * 2020-01-09 2020-06-05 平安科技(深圳)有限公司 Writing method of state database, data processing device and storage medium
US20200250295A1 (en) * 2019-01-31 2020-08-06 Salesforce.Com, Inc. Systems, methods, and apparatuses for protecting consumer data privacy using solid, blockchain and ipfs integration

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10922692B2 (en) * 2017-04-05 2021-02-16 Samsung Sds Co., Ltd. Method for calculating confirmation reliability for blockchain based transaction and blockchain network monitoring system for performing the method
US11521202B2 (en) * 2018-08-30 2022-12-06 International Business Machines Corporation Distributed computing and storage network implementing high integrity, high bandwidth, low latency, secure processing
CN109614206A (en) * 2018-10-25 2019-04-12 深圳壹账通智能科技有限公司 Device, method and the storage medium of block chain issued transaction
CN110781196A (en) * 2019-09-06 2020-02-11 深圳壹账通智能科技有限公司 Block chain transaction processing method and device, computer equipment and storage medium
CN112037058B (en) * 2020-08-28 2024-03-26 平安科技(深圳)有限公司 Data verification method, device and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180254093A1 (en) * 2017-03-02 2018-09-06 Allocrypt Inc. Cryptographically secure medical test data distribution system using smart testing/diagnostic devices
US20180260212A1 (en) * 2017-03-10 2018-09-13 Salesforce.Com, Inc. Blockchain version control systems
US20190238525A1 (en) * 2018-01-31 2019-08-01 Salesforce.Com, Inc. Systems, methods, and apparatuses for implementing super community and community sidechains with consent management for distributed ledger technologies in a cloud based computing environment
US20200026552A1 (en) * 2018-07-20 2020-01-23 Fujitsu Limited Method and apparatus for managing effectiveness of information processing task
US20200133955A1 (en) * 2018-10-31 2020-04-30 Salesforce.Com, Inc. Systems, methods, and apparatuses for implementing consumer data validation, matching, and merging across tenants with optional verification prompts utilizing blockchain
CN109559226A (en) * 2018-11-28 2019-04-02 杭州有盾网络科技有限公司 Block chain transaction execution method, system and electronic equipment and storage medium
WO2020108289A1 (en) * 2018-11-29 2020-06-04 华为技术有限公司 Database system, node and method
US20200250295A1 (en) * 2019-01-31 2020-08-06 Salesforce.Com, Inc. Systems, methods, and apparatuses for protecting consumer data privacy using solid, blockchain and ipfs integration
CN110851535A (en) * 2019-11-18 2020-02-28 腾讯科技(深圳)有限公司 Data processing method and device based on block chain, storage medium and terminal
CN111241061A (en) * 2020-01-09 2020-06-05 平安科技(深圳)有限公司 Writing method of state database, data processing device and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022041901A1 (en) * 2020-08-28 2022-03-03 平安科技(深圳)有限公司 Data verification method and apparatus, and storage medium
CN113746908A (en) * 2021-08-19 2021-12-03 卓尔智联(武汉)研究院有限公司 Data processing method and system, electronic device and computer storage medium
CN114221961A (en) * 2021-12-14 2022-03-22 深圳前海微众银行股份有限公司 Hierarchical DAG block chain generation method, apparatus, medium, and program product
CN114221961B (en) * 2021-12-14 2024-03-26 深圳前海微众银行股份有限公司 Hierarchical DAG blockchain generation method, apparatus, medium, and program product
CN115796874A (en) * 2023-01-09 2023-03-14 杭州安节科技有限公司 Operation-level block chain transaction concurrent execution method

Also Published As

Publication number Publication date
CN112037058B (en) 2024-03-26
WO2022041901A1 (en) 2022-03-03

Similar Documents

Publication Publication Date Title
US11196572B2 (en) Blockchain-based content verification
CN112037058A (en) Data verification method, device and storage medium
US20200294048A1 (en) Blockchain-based data verification method and apparatus, and electronic device
TWI737944B (en) Block chain-based transaction execution method and device, and electronic equipment
CN108764870B (en) Transaction processing method and device based on block chain and electronic equipment
JPWO2018158936A1 (en) Blockchain management device, blockchain management method and program
US20210049715A1 (en) Blockchain-based data procesing method, apparatus, and electronic device
CN109992285B (en) Independent updating method and device for block chain code block and electronic equipment
US11663595B1 (en) Blockchain transactional identity verification
CN111984421B (en) Data processing method, device and storage medium
CN112015558A (en) Data verification method, device and storage medium
CN109033818B (en) Terminal, authentication method, and computer-readable storage medium
CN115756966A (en) Block chain data archiving and recovering method and system
US11822795B2 (en) Secure data processing
CN112488261A (en) Method and system for identifying authenticity of article based on block chain information storage
CN113221164A (en) Block chain-based data verification method and device and electronic equipment
CN111209602A (en) Block chain based data development method, system, server and storage medium
CN111461721A (en) Block chain-based method and device for protecting account and verifying transaction
US11893587B2 (en) System for enhanced authentication using non-fungible tokens (NFTs)
CN116488822B (en) Identification method and system for digital blind box subscription legal user
CN110992022B (en) Verification result acquisition method and device
CN111915313B (en) Digital asset transfer control method, device and communication system for blockchain
CN113569276A (en) Block chain evidence storage method and related equipment
KR20230109029A (en) Method for notarizing non-fungible token based on blockchain network and notarization server using the same
CN115906029A (en) Authentication method, authentication device, electronic equipment, storage medium and product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant