CN113673996A - Block chain-based block node detection method and device - Google Patents

Block chain-based block node detection method and device Download PDF

Info

Publication number
CN113673996A
CN113673996A CN202110900614.5A CN202110900614A CN113673996A CN 113673996 A CN113673996 A CN 113673996A CN 202110900614 A CN202110900614 A CN 202110900614A CN 113673996 A CN113673996 A CN 113673996A
Authority
CN
China
Prior art keywords
block
transaction
node
challenge
blockchain
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.)
Pending
Application number
CN202110900614.5A
Other languages
Chinese (zh)
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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202110900614.5A priority Critical patent/CN113673996A/en
Publication of CN113673996A publication Critical patent/CN113673996A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • 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

Abstract

The embodiment of the invention provides a block chain-based method and a block chain-based device for detecting block nodes, wherein the method comprises the steps that when a first block in a local block chain account book is determined not to meet a block outlet condition by a first block chain node, block challenge transactions aiming at the first block are constructed, the block challenge transactions are broadcasted to m-1 second block chain nodes, the m-1 second block chain nodes are used for verifying the block challenge transactions, and after the block challenge transactions are determined to be successfully identified, the block outlet node corresponding to the first block is determined to be a rogue node. Therefore, the scheme can effectively prevent a certain node in the block chain network from maliciously and inefficiently blocking, and can effectively prevent a certain node in the block chain network from maliciously presenting challenges, thereby effectively solving the problem that the node in the block chain network maliciously and inefficiently blocks.

Description

Block chain-based block node detection method and device
Technical Field
The embodiment of the invention relates to the field of financial technology (Fintech), in particular to a method and a device for detecting block nodes based on a block chain.
Background
With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually changing to financial technology, but due to the requirements of the financial industry on safety and real-time performance, higher requirements are also put forward on the technologies.
At this stage, when a certain node in the blockchain network is determined to be a block output node, the current round of block output operation is executed by the node. However, if the node is a malicious node or a failed node, a normal block can be generated, but the transaction number contained in the block is small, and the block is a legal block no matter what consensus algorithm (such as a byzantine fault-tolerant algorithm, a workload certification consensus algorithm, or a commission benefit certification consensus algorithm) is adopted. Thus, the transaction count contained in the block is small, which results in a significant reduction in the efficiency of the blockchain system in processing transactions. For the problem, in the existing scheme, when a node is determined to have an empty block, the node of the block is forced to be replaced, but the scheme only aims at the empty block, and cannot effectively solve the problem that the node in the block chain network has a malicious and low-efficiency block output.
In summary, a method for detecting a block node based on a blockchain is needed to effectively solve the problem of malicious and inefficient block generation of a node in a blockchain network.
Disclosure of Invention
The embodiment of the invention provides a block chain-based method and a block chain-based device for detecting block nodes, which are used for effectively solving the problem that the nodes in a block chain network maliciously and inefficiently generate blocks.
In a first aspect, an embodiment of the present invention provides a method for detecting a block node based on a block chain, which is applicable to a block chain network having m block chain nodes, and the method includes:
the method comprises the steps that when a first block in a local block chain account book is determined to not meet a block outlet condition, a first block chain node constructs a block challenge transaction aiming at the first block; the first blockchain node is any one of the m blockchain nodes; the first block is any block in the block chain account book;
the first block link node broadcasts the block challenge transaction to m-1 second block link nodes; the m-1 second tile linked points are used for verifying the tile challenge transaction; the second block chain node is any one of the m block chain nodes except the first block chain link point;
and after the first block chain node determines that the block challenging transaction consensus is successful, determining the block outlet node corresponding to the first block as a rogue node.
In the above technical solution, since a certain node in the blockchain network in the prior art maliciously and inefficiently generates a block, the consensus efficiency of the blockchain network is greatly reduced, and meanwhile, because the number of transactions included in the block generated by the certain node is small, the processing efficiency of the blockchain network for the transactions is reduced, which affects the normal execution of the transactions. Based on this, in the technical scheme of the invention, when a certain blockchain node determines that a first block in a local blockchain account book does not meet a block outlet condition, a challenge can be provided for the first block, and a consensus verification process for block challenge transaction of the first block is initiated. Specifically, when the first block does not satisfy the block output condition, the first block chain node constructs a block challenge transaction for the first block, and broadcasts the block challenge transaction to m-1 second block chain nodes, so that the m-1 second block chain nodes verify the block challenge transaction, and whether the challenge of the first block chain node for the first block is correct is determined. If the m-1 second block chain nodes successfully identify the challenge transaction for the block, the corresponding out-blocking node of the first block is determined as a rogue node, and the rogue node is determined to maliciously and inefficiently go out of the block, and then a penalty is made for the rogue node. Therefore, the scheme can effectively prevent a certain node in the block chain network from maliciously and inefficiently blocking, and can effectively prevent a certain node in the block chain network from maliciously presenting challenges, thereby effectively solving the problem that the node in the block chain network maliciously and inefficiently blocks.
Optionally, the first block link point determines that the first block in the local block chain account does not satisfy the block output condition by:
the first block chain node acquires the generation timestamp of the first block from the first block;
the first blockchain node determines a nearest first acquisition timestamp before the generation timestamp from a local transaction pool record, and determines a first transaction quantity in the transaction pool corresponding to the first acquisition timestamp;
and when the first block chain node determines that the difference value between the first transaction quantity in the transaction pool corresponding to the first acquisition timestamp and the transaction quantity of the first block is greater than or equal to a first set threshold value, determining that the first block does not meet the block outlet condition.
In the above technical solution, when determining whether to issue a challenge for the first block, the first blockchain node may determine, from the local transaction pool record, a latest first collection timestamp located before the generation timestamp through the generation timestamp of the first block, and determine, based on the first transaction number in the transaction pool corresponding to the first collection timestamp, whether a difference between the first transaction number in the transaction pool corresponding to the first collection timestamp and the transaction number of the first block is greater than or equal to a first set threshold, that is, determine whether the transaction number in the transaction pool when the first block exits from the block is greater than a transaction number included in the first block, and if the transaction number is greater than the first set threshold, may issue a challenge in time. Or, a challenge may be raised for a certain block at any time according to the requirement of the first block link point, and the first transaction quantity in the transaction pool corresponding to the first acquisition timestamp does not need to be determined, for example, if the first acquisition timestamp finds that a certain block has a problem or senses that the transaction quantity packed by a certain block is insufficient, the challenge may be raised for the certain block in time.
Optionally, the constructing a block challenge transaction for the first block comprises:
the first block link point determines a second transaction quantity in the transaction pool corresponding to the first acquisition timestamp;
the first block link point constructs the block challenge transaction based on a second transaction quantity in a transaction pool corresponding to the first acquisition timestamp and a block identifier of the first block.
In the technical scheme, the block challenge transaction is constructed based on the second transaction quantity in the transaction pool corresponding to the first acquisition timestamp and the block identifier of the first block, so that the subsequent verification of the second block link point for the block challenge transaction can be facilitated, whether the challenge of the first block link point for the first block is correct or not can be determined, and the first block link point can be prevented from maliciously presenting the challenge to 35820and trap out the block node. The second transaction quantity in the transaction pool corresponding to the first acquisition timestamp can be the first transaction quantity in the transaction pool corresponding to the first acquisition timestamp, or can be the transaction quantity in the transaction pool corresponding to the first acquisition timestamp intentionally set at the link point of the first block, so that 35820may be obtained, and the block outlet node corresponding to the first block is trapped.
Optionally, the transaction pool record is determined by:
the first block chain node periodically collects the transaction quantity in the transaction pool according to a first set time interval;
and the first block chain link point stores each acquisition time stamp and the transaction quantity in the transaction pool corresponding to each acquisition time stamp into the transaction pool record.
In the technical scheme, the transaction quantity in the transaction pool is periodically collected according to a first set time interval, and each collection timestamp and the transaction quantity in the transaction pool corresponding to each collection timestamp are stored in the transaction pool record, so that whether a certain block meets a block outlet condition or not is determined for a subsequent block link point, or whether a challenge transaction for the block of the certain block meets requirements or not is verified to provide support.
Optionally, after confirming that the out-block node corresponding to the first block is a bad node, the method further includes:
the first block link point constructs a penalty transaction for the rogue node;
the first block link point initiates a consensus process for the punished transaction; the consensus process is used for verifying the punished transaction by any second block link point;
and after determining that the penalty transaction consensus is successful, the first blockchain node punishs the malignant node.
In the above technical solution, consensus verification is performed on penalty transactions proposed for the first block link point, so as to determine whether to penalize a rogue node. Therefore, according to the scheme, a certain node in the block chain network can be effectively prevented from being maliciously and inefficiently blocked, and meanwhile, a first block chain node can be effectively prevented from maliciously giving a punishment.
In a second aspect, an embodiment of the present invention provides a method for detecting a blockchain node based on a blockchain, which is applicable to a blockchain network having m blockchain nodes, and the method includes:
the second blockchain node receives the block challenge transaction broadcasted by the first blockchain node; the block challenge transaction is constructed by the first blockchain node for a first block in a local blockchain ledger upon determining that the first block does not satisfy a block out condition; the first block is any block in the block chain account book; the first blockchain node is any one of the m blockchain nodes; the second block chain node is any one of the m block chain nodes except the first block chain link point;
the second block chain node acquires the block information of the first block from a local block chain account book; the block information comprises a generation timestamp of the first block and a transaction number of the first block;
the second tile link point verifies the tile challenge transaction at least once based on the generation timestamp of the first tile and/or the transaction number of the first tile.
In the above technical solution, after receiving the block challenge transaction, the second blockchain node may start a verification process for the block challenge transaction. Specifically, the second blockchain node acquires the generation timestamp of the first block and the transaction quantity of the first block from a local blockchain book, and verifies the block challenge transaction at least once based on the generation timestamp of the first block and/or the transaction quantity of the first block, so as to determine whether to approve or disapprove the block challenge transaction, thereby determining whether the challenge of the first block link point to the first block is correct, further effectively solving the problem that a node in the blockchain network maliciously breaks out a block, and effectively preventing a certain node in the blockchain network from maliciously presenting the challenge.
Optionally, the second block link point performs a first verification of the block challenge transaction based on the transaction number of the first block, including:
the second block link point determines whether the transaction quantity of the first block is greater than or equal to a second set threshold value; the second set threshold is the maximum value of the transaction number contained in the block;
if the transaction quantity of the first block is larger than or equal to the second set threshold value, the second block link point makes a negative vote for the block challenge transaction;
and if the transaction quantity of the first block is smaller than the second set threshold, the second block link point verifies the block challenge transaction for the second time based on the generation timestamp of the first block.
In the above technical solution, the first verification is performed on the block challenge transaction by determining whether the transaction quantity of the first block is greater than or equal to a second set threshold. If the transaction quantity of the first block is larger than or equal to the second set threshold value, the block challenge transaction is objected to the ticket, the verification process is ended without performing subsequent verification, and the challenge is not necessarily provided at all because the transaction quantity packaged by the first block reaches the upper limit value of the block packaging transaction; if the transaction number of the first block is smaller than the second set threshold, the block challenge transaction needs to be verified for a second time based on the generation timestamp of the first block, so as to further determine whether the challenge of the first block link point for the first block is correct.
Optionally, the second block chaining point performs a second verification of the block challenge transaction based on the generation timestamp of the first block, including:
the second block link point determines a delay time stamp according to the generation time stamp and a second set time interval; the second set time interval is used for representing that any transaction is synchronized to the m blockchain nodes when the second set time interval is met;
the second blockchain node determines a nearest second acquisition timestamp positioned after the delay timestamp from a local transaction pool record, and determines the transaction quantity in the transaction pool corresponding to the second acquisition timestamp;
the second block link point determines whether the transaction quantity in the transaction pool corresponding to the second acquisition timestamp is less than or equal to a second transaction quantity in the transaction pool corresponding to the first acquisition timestamp recorded in the block challenge transaction;
if the transaction quantity in the transaction pool corresponding to the second acquisition timestamp is less than or equal to the second transaction quantity in the transaction pool corresponding to the first acquisition timestamp, the second block link point makes an objection to the block challenge transaction;
and if the transaction number in the transaction pool corresponding to the second acquisition timestamp is greater than the second transaction number in the transaction pool corresponding to the first acquisition timestamp, the second block link point performs third verification on the block challenge transaction based on the generation timestamp of the first block and the transaction number of the first block.
In the above technical scheme, when the transaction amount of the first block is smaller than the second set threshold, the transaction amount in the transaction pool corresponding to the second acquisition timestamp determined according to the second set time interval can be used to more accurately further verify whether the challenge of the first block link point to the first block is correct. Since one or more transactions are synchronized from the generation timestamp of the first block, and after a second set time interval, each block chain node has received the one or more transactions, if the transaction number in the transaction pool corresponding to the second acquisition timestamp is smaller than the second transaction number in the transaction pool corresponding to the first acquisition timestamp recorded in the block challenge transaction, it indicates that the first block chain node is malicious 35820and the block output node corresponding to the first block is trapped, that is, the first block chain node is malicious in raising the challenge, and therefore, the second block chain node can directly object to the block challenge transaction for voting, thereby effectively preventing the first block chain node from malicious raising the challenge.
Optionally, the second tile link point performs a third verification of the tile challenge transaction based on the generation timestamp of the first tile and the transaction number of the first tile, including:
the second blockchain node determines a third latest acquisition timestamp which is positioned before the generation timestamp from the transaction pool records, and determines the transaction quantity in the transaction pool corresponding to the third acquisition timestamp;
the second block link point determines whether the difference value between the transaction quantity in the transaction pool corresponding to the third acquisition timestamp and the transaction quantity of the first block is greater than or equal to a third set threshold value;
if the difference is larger than or equal to the third set threshold, the second block link point agrees with the block challenge transaction;
and if the difference value is smaller than the third set threshold value, the second block link point makes a negative vote on the block challenge transaction.
In the above technical scheme, when the transaction amount in the transaction pool corresponding to the second acquisition timestamp is greater than the second transaction amount in the transaction pool corresponding to the first acquisition timestamp, the challenge of the first block link point to the first block can be further verified more accurately by the transaction amount in the transaction pool corresponding to the third acquisition timestamp. If the difference is greater than or equal to the third set threshold, it indicates that the transaction number included in the first block does not meet the block requirement, for example, the first block formed by packing the out-block nodes corresponding to the first block is unsaturated, so that the transaction approval is issued for the block challenge, thereby effectively preventing the out-block nodes corresponding to the first block from maliciously and inefficiently going out of the block; if the difference is smaller than the third set threshold, it indicates that the transaction quantity contained in the first block meets the block requirement, so that the block challenges the transaction against the ticket, thereby effectively avoiding the first block link point from maliciously posing a challenge.
In a third aspect, an embodiment of the present invention provides an apparatus for detecting a block node based on a block chain, which is applicable to a block chain network having m block chain nodes, and the apparatus includes:
the system comprises a construction unit, a processing unit and a processing unit, wherein the construction unit is used for constructing a block challenge transaction aiming at a first block in a local block chain account book when the first block is determined not to meet a block outlet condition; the first block is any block in the block chain account book;
a first processing unit for broadcasting the block challenge transaction to m-1 second blockchain nodes; the m-1 second tile linked points are used for verifying the tile challenge transaction; the second block chain node is any one of the m block chain nodes except the first block chain link node; the first blockchain node is any one of the m blockchain nodes; and after the block challenge transaction consensus is determined to be successful, confirming that the out-block node corresponding to the first block is a malignant node.
Optionally, the construction unit is specifically configured to:
acquiring a generation timestamp of the first block from the first block;
determining a latest first acquisition timestamp before the generation timestamp from a local transaction pool record, and determining a first transaction number in the transaction pool corresponding to the first acquisition timestamp;
and when the difference value between the first transaction quantity in the transaction pool corresponding to the first acquisition timestamp and the transaction quantity of the first block is determined to be larger than or equal to a first set threshold value, determining that the first block does not meet the block outlet condition.
Optionally, the construction unit is specifically configured to:
determining a second transaction quantity in the transaction pool corresponding to the first acquisition timestamp;
and constructing the block challenge transaction based on the second transaction quantity in the transaction pool corresponding to the first acquisition timestamp and the block identifier of the first block.
Optionally, the construction unit is specifically configured to:
periodically collecting the transaction quantity in the transaction pool according to a first set time interval;
and storing each acquisition time stamp and the transaction quantity in the transaction pool corresponding to each acquisition time stamp into the transaction pool record.
Optionally, the first processing unit is further configured to:
after confirming that the block outlet node corresponding to the first block is a malignant node, constructing a penalty transaction aiming at the malignant node;
initiating a consensus process for the punished transaction; the consensus process is used for verifying the punished transaction by any second block link point;
and after determining that the punishment transaction consensus is successful, punishing the malignant node.
In a fourth aspect, an embodiment of the present invention provides an apparatus for detecting a block node based on a block chain, where the apparatus is applicable to a block chain network having m block chain nodes, and the apparatus includes:
a receiving unit, configured to receive a block challenge transaction broadcasted by a first block link node; the block challenge transaction is constructed by the first blockchain node for a first block in a local blockchain ledger upon determining that the first block does not satisfy a block out condition; the first block is any block in the block chain account book; the first blockchain node is any one of the m blockchain nodes;
the second processing unit is used for acquiring the block information of the first block from a local block chain account book; the block information comprises a generation timestamp of the first block and a transaction number of the first block; at least one verification of the block challenge transaction is performed based on the generation timestamp of the first block and/or the transaction number of the first block.
Optionally, the second processing unit is specifically configured to:
determining whether the transaction quantity of the first block is larger than or equal to a second set threshold value; the second set threshold is the maximum value of the transaction number contained in the block;
if the transaction quantity of the first block is larger than or equal to the second set threshold value, the block challenge transaction is subjected to a negative vote;
and if the transaction quantity of the first block is smaller than the second set threshold, performing second verification on the block challenge transaction based on the generation timestamp of the first block.
Optionally, the second processing unit is specifically configured to:
determining a delay time stamp according to the generation time stamp and a second set time interval; the second set time interval is used for representing that any transaction is synchronized to the m blockchain nodes when the second set time interval is met;
determining a nearest second acquisition timestamp positioned after the delay timestamp from a local transaction pool record, and determining the transaction quantity in the transaction pool corresponding to the second acquisition timestamp;
determining whether the transaction quantity in the transaction pool corresponding to the second acquisition timestamp is less than or equal to a second transaction quantity in the transaction pool corresponding to the first acquisition timestamp recorded in the block challenge transaction;
if the transaction quantity in the transaction pool corresponding to the second acquisition timestamp is less than or equal to the second transaction quantity in the transaction pool corresponding to the first acquisition timestamp, the block challenge transaction is subjected to a negative vote;
and if the transaction quantity in the transaction pool corresponding to the second acquisition timestamp is greater than the second transaction quantity in the transaction pool corresponding to the first acquisition timestamp, performing third verification on the block challenge transaction based on the generation timestamp of the first block and the transaction quantity of the first block.
Optionally, the second processing unit is specifically configured to:
determining a third latest acquisition timestamp which is positioned before the generation timestamp from the transaction pool records, and determining the transaction quantity in the transaction pool corresponding to the third acquisition timestamp;
determining whether the difference value between the transaction quantity in the transaction pool corresponding to the third acquisition timestamp and the transaction quantity of the first block is greater than or equal to a third set threshold value;
if the difference is larger than or equal to the third set threshold, the block challenge transaction is approved;
and if the difference value is smaller than the third set threshold value, the block challenge transaction is subjected to a negative vote.
In a fifth aspect, an embodiment of the present invention provides a computing device, including at least one processor and at least one memory, where the memory stores a computer program, and when the program is executed by the processor, the processor is caused to execute the method for detecting a block node based on a block chain according to any of the first or second aspects.
In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program executable by a computing device, and when the program is run on the computing device, the computer program causes the computing device to execute the method for detecting a block node based on a block chain according to any of the first aspect or the second aspect.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a system architecture for detecting a block node based on a block chain according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for detecting a block node based on a block chain according to an embodiment of the present invention;
fig. 3 is a schematic diagram of the transaction amount in the collected transaction pool corresponding to the first collection timestamp according to an embodiment of the present invention;
fig. 4 is a schematic diagram of the transaction amount in the collected transaction pool corresponding to the second collection timestamp according to the embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus for detecting a block node based on a block chain according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another apparatus for detecting a block node based on a block chain according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a computing device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
In the following, some terms related to the embodiments of the present invention are first explained to facilitate understanding by those skilled in the art.
(1) Unsaturated block discharging: in the blockchain network, when a certain blockchain node is determined as the block outlet node of the current round, namely the blockchain node is responsible for the block outlet operation of the current round, if the blockchain node is a malicious node, a normal block can be extracted, but the block contains a small number of transactions.
(2) A transaction pool: after a certain block chain link point in the block chain network receives the transaction, the transaction is stored in a transaction pool, and after a period of time is waited for later, the block outlet node packs part of or all transactions in the transaction pool into a block. In addition, the blockchain node broadcasts the transactions in the transaction pool to other blockchain nodes in the blockchain network, and after a certain time, the transactions are received by other blockchain nodes.
As described above, some terms related to the embodiments of the present invention are described, and the technical features related to the embodiments of the present invention are described below.
To facilitate understanding of the embodiment of the present invention, first, a system architecture for detecting block nodes based on a block chain, which is applicable to the embodiment of the present invention, is described by taking the system architecture shown in fig. 1 as an example. As shown in fig. 1, the system architecture may include a client 100 and a blockchain network 200. The blockchain network 200 may include at least one blockchain node, such as a blockchain node 201, a blockchain link point 202, a blockchain link point 203, a blockchain link point 204, and the like, where any two blockchain link points in the at least one blockchain node may be in communication connection; the client 100 and the blockchain network 200 may be communicatively connected in a wired manner, or may be communicatively connected in a wireless manner, which is not limited in the embodiment of the present invention.
Any blockchain node in the blockchain network 200 may be a server, or may be a process or a series of processes running on the server, for example, the blockchain node 201 may be a server, or may be a process running on the server, which is not limited in the embodiment of the present invention.
Specifically, the client 100 may send one transaction or multiple transactions submitted by the user to any blockchain node in the blockchain network 200, and the blockchain node may synchronize the one transaction or multiple transactions to other blockchain nodes in the blockchain network 200, for example, the client 100 may send one transaction submitted by the user to the blockchain node 201, and the blockchain node 201 broadcasts the transaction to the blockchain node 202, the blockchain node 203, the blockchain node 204, and the like. Wherein each tile link stores received transactions in a local transaction pool. Alternatively, the client 100 may also send one transaction or multiple transactions submitted by the user to each blockchain node in the blockchain network 200. When a certain blockchain node in the blockchain network 200 is determined to be a blockchain node of the current round, the blockchain node of the current round performs a blockchain operation, and the blockchain node is responsible for packing a plurality of transactions in the local transaction pool into a block, then initiates a consensus process for the block, for example, a byzantine fault-tolerant algorithm or a workload certification consensus algorithm is adopted, and after the block consensus succeeds, the block is uplinked. For example, when the blockchain node 201 is determined to be the block output node of the current round, the blockchain node 201 is responsible for packaging multiple transactions in the local transaction pool into a block, then initiating a consensus process for the block, and linking the block after the block consensus is successful. If a block link point in the blockchain network 200 is in question for a block on the blockchain, that is, the block does not satisfy the block-out condition, a challenge for the block can be initiated. For example, the block chain node 202 may challenge the 10 th block in the block chain, for example, it is suspected that the block output node corresponding to the 10 th block is not saturated, and thus the 10 th block is not saturated, and then a challenge for the 10 th block may be initiated, and the challenge for the 10 th block is broadcast to other block chain points in the block chain network 200 for verification.
It should be noted that the structure shown in fig. 1 is only an example, and the embodiment of the present invention is not limited thereto.
Based on the above description, fig. 2 exemplarily illustrates a flow of a method for detecting a block node based on a block chain according to an embodiment of the present invention, where the flow may be performed by an apparatus for detecting a block node based on a block chain. The block chain based block node detection method in the embodiment of the invention is suitable for a block chain network with m block chain nodes.
As shown in fig. 2, the process specifically includes:
in step 201, when a first block in a local block chain account book is determined not to satisfy a block output condition, a first block chain node constructs a block challenge transaction for the first block.
In an embodiment of the present invention, when determining whether to perform a challenge on a first block, a first block link node may, when sensing that a problem exists in a certain block (for example, a first block) in a block chain directory, find that the first block does not satisfy a block exiting condition, for example, the first block is an unsaturated block, that is, the first block is unsaturated due to unsaturated block exiting by a block exiting node corresponding to the first block, and may initiate a challenge on the first block. Alternatively, the first block link point may provide a challenge to a certain block (for example, the first block) in the block chain book at any time according to its own needs, for example, the first block may be considered to have a problem by its own idea, and the challenge to the first block may be provided at any time. Or the first block chain node acquires the generation timestamp of the first block from the first block, determines the latest first acquisition timestamp before the generation timestamp from the local transaction pool record, determines the first transaction number in the transaction pool corresponding to the first acquisition timestamp, and then determines that the first block does not satisfy the block output condition and can present a challenge for the first block when it is determined that the difference between the first transaction number in the transaction pool corresponding to the first acquisition timestamp and the transaction number of the first block is greater than or equal to a first set threshold. In this way, the first block link point may determine, from the local transaction pool record, the latest first collection timestamp before the generation timestamp through the generation timestamp of the first block, and determine, based on the first transaction number in the transaction pool corresponding to the first collection timestamp, whether a difference between the first transaction number in the transaction pool corresponding to the first collection timestamp and the transaction number of the first block is greater than or equal to a first set threshold, that is, determine whether the transaction number in the transaction pool when the first block is out of block is greater than the transaction number included in the first block, and if the difference is greater, may challenge in time. The first blockchain node may then construct a block challenge transaction for the first block when the challenge is raised for the first block. The first block chain node is any one of the m block chain nodes; the first block is any block in the block chain account book; the first set threshold value may be set according to an empirical value of a person skilled in the art or according to results obtained from a plurality of experiments.
Further, a tile challenge transaction for the first tile may be constructed by: and the first block chain node determines a second transaction quantity in the transaction pool corresponding to the first acquisition timestamp, and constructs a block challenge transaction based on the second transaction quantity in the transaction pool corresponding to the first acquisition timestamp and the block identifier of the first block. In this way, by constructing the block challenge transaction based on the second transaction number in the transaction pool corresponding to the first collection timestamp and the block identifier of the first block, it is possible to facilitate verification of the subsequent second block link point for the block challenge transaction, so as to determine whether the challenge of the first block link point for the first block is correct, and prevent the first block link point from maliciously presenting the challenge \3582and0 sinking out the block node. The second transaction quantity in the transaction pool corresponding to the first acquisition timestamp can be the first transaction quantity in the transaction pool corresponding to the first acquisition timestamp, or can be the transaction quantity in the transaction pool corresponding to the first acquisition timestamp intentionally set at the link point of the first block, so that 35820may be obtained, and the block outlet node corresponding to the first block is trapped.
For example, taking a block link point a in a block chain network as an example, when it is determined that block No. 5 in a local block chain book does not satisfy a block condition, the block chain node a may construct a block challenge transaction for the block No. 5, for example, may determine a latest first collection timestamp before a generation timestamp from a local transaction pool record, determine a first transaction number (for example, 520) in a transaction pool corresponding to the first collection timestamp, and construct a block challenge transaction for the block No. 5 based on the first transaction number in the transaction pool corresponding to the first collection timestamp and a block identifier of the block No. 5. Alternatively, the transaction amount in the transaction pool corresponding to the first collection timestamp may be intentionally set (e.g., 700), and then the block challenge transaction for block No. 5 may be constructed based on the transaction amount in the transaction pool corresponding to the intentionally set first collection timestamp and the block id of block No. 5. The block challenge transaction for a block may be constructed as shown in table 1.
TABLE 1
Figure BDA0003199649790000151
When the transaction quantity in the transaction pool corresponding to the first collection timestamp is determined, for example, a challenge is initiated for the block i, the generation timestamp t (i) corresponding to the block i is read from the block i, and then, in the sampling table, the transaction quantity in the transaction pool at the last sampling before the generation timestamp t (i) is searched in a manner of binary search and the like as the transaction quantity in the transaction pool corresponding to the first collection timestamp when the block i is challenged. Fig. 3 is a schematic diagram of the transaction amount in the collected transaction pool corresponding to the first collection timestamp according to an embodiment of the present invention. Where solid dots represent acquisition timestamps. Based on the graph, if the transaction number in the transaction pool at the last sampling before the generation timestamp t (i) corresponding to the block i is 560, the 560 transactions are regarded as the transaction number in the transaction pool corresponding to the challenged block i.
Additionally, the transaction pool record may be determined by: the first block chain node periodically collects the transaction quantity in the transaction pool according to a first set time interval, and stores each collection timestamp and the transaction quantity in the transaction pool corresponding to each collection timestamp into a transaction pool record, so that whether a certain block meets a block condition or not can be conveniently determined for a subsequent block chain node point, or whether the block challenge transaction for the certain block meets requirements or not is verified to provide support.
For any blockchain node in the blockchain network, the blockchain node periodically collects the transaction amount in the transaction pool according to a first set time interval (i.e. a collection period), and then stores the collected collection timestamp and the transaction amount in the transaction pool corresponding to the collection timestamp into the transaction pool record. Wherein, the collection period can be 50ms, 100ms, 200ms, 300ms, 500ms or 1s, etc. The form of the collection table for the transaction number in the transaction pool for each block link point may be as shown in table 2.
TABLE 2
Acquisition time stamp Number of transactions in a transaction pool
08:00:00 500
08:00:01 506
08:00:02 530
08:00:03 550
Step 202, the first blockchain node broadcasts the blockchallenge transaction to m-1 second blockchain nodes.
In the embodiment of the invention, after constructing the block challenge transaction for the first block, the first block chain node signs the block challenge transaction for the first block by using a private key of the first block, and then broadcasts the signed block challenge transaction for the first block to m-1 second block chain nodes, so that the m-1 second block chain nodes verify the signed block challenge transaction for the first block, and thus whether the challenge of the first block chain node for the first block is correct is determined.
Illustratively, assume that there are four blockchain nodes in the blockchain network, namely, blockchain node a, blockchain link point B, blockchain link point C, and blockchain link point D. For example, the block chain node a is used as a node for challenging a certain block, assuming that the block chain node a challenges the block No. 6, the block chain node a constructs a block challenge transaction for the block No. 6, signs the block challenge transaction for the block No. 6 using its own private key, and then broadcasts the signed block challenge transaction for the block No. 6 to the block chain node B, the block chain node C, and the block chain node D, so that after receiving the signed block challenge transaction for the block No. 6, the block chain node B, the block chain node C, and the block chain node D use the public key provided by the block chain node a to sign the signed block challenge transaction for the block No. 6, and after the sign is successful, verify and vote for the block challenge transaction for the block No. 6, thereby determining whether the challenge of blockchain node a for block No. 6 is correct.
In step 203, the second blockchain node obtains the block information of the first block from the local blockchain book.
The second tile link point verifies the tile challenge transaction at least once based on the generation timestamp of the first tile and/or the transaction number of the first tile, step 204.
In step 203 and step 204, after the second blockchain node receives the block challenge transaction broadcast by the first blockchain node, the verification process for the block challenge transaction can be started. Specifically, the second blockchain node acquires the generation timestamp of the first block and the transaction quantity of the first block from a local blockchain book, and verifies the block challenge transaction at least once based on the generation timestamp of the first block and/or the transaction quantity of the first block, so as to determine whether to approve or disapprove the block challenge transaction, thereby determining whether the challenge of the first block link point to the first block is correct, further effectively solving the problem that a node in the blockchain network maliciously breaks out a block, and effectively preventing a certain node in the blockchain network from maliciously presenting the challenge. The structural form of the second blockchain node voting for the blockchallenge transaction can be as shown in table 3.
TABLE 3
Figure BDA0003199649790000171
Specifically, the second tile linked point verifies the tile challenge transaction for the first time based on the transaction amount of the first tile. That is, the second block link point determines whether the transaction number of the first block is greater than or equal to a second set threshold. Wherein, the second set threshold is the maximum value of the transaction quantity contained in the block; the second setting threshold may be set according to an experience value or an actual application scenario of a person skilled in the art. If the transaction quantity of the first block is larger than or equal to the second set threshold value, the block challenge transaction is objected to, the verification process is ended without performing subsequent verification, and the challenge is not necessarily provided at all because the transaction quantity packaged by the first block reaches the upper limit value of the block packaging transaction; if the transaction number of the first block is smaller than the second set threshold, the block challenge transaction needs to be verified for a second time based on the generation timestamp of the first block, so as to further determine whether the challenge of the first block link point for the first block is correct.
When the block challenging transaction is verified for the second time, the second block chain node determines a delay time stamp according to the generation time stamp and a second set time interval, determines a nearest second acquisition time stamp behind the delay time stamp from the local transaction pool record, determines the transaction quantity in the transaction pool corresponding to the second acquisition time stamp, and then determines whether the transaction quantity in the transaction pool corresponding to the second acquisition time stamp is less than or equal to the second transaction quantity in the transaction pool corresponding to the first acquisition time stamp recorded in the block challenging transaction. And the second set time interval is used for representing that any transaction is synchronized to the m blockchain nodes when the second set time interval is met. And if the transaction number in the transaction pool corresponding to the second acquisition timestamp is less than or equal to the second transaction number in the transaction pool corresponding to the first acquisition timestamp, intentionally challenging the first block link point, namely 35820, and trapping the block outlet node corresponding to the first block, so that the second block link point is objected to the block challenging transaction for the first block. If the transaction number in the transaction pool corresponding to the second acquisition timestamp is greater than the second transaction number in the transaction pool corresponding to the first acquisition timestamp, a third verification needs to be performed on the block challenge transaction based on the generation timestamp of the first block and the transaction number of the first block, so as to further determine whether the challenge of the first block link point for the first block is correct.
When the third verification is carried out on the block challenge transaction, the second block chain node determines a third latest acquisition timestamp before the generation timestamp from the transaction pool record, determines the transaction number in the transaction pool corresponding to the third acquisition timestamp, and then determines whether the difference value between the transaction number in the transaction pool corresponding to the third acquisition timestamp and the transaction number of the first block is larger than or equal to a third set threshold value. If the difference is greater than or equal to the third set threshold, it indicates that the transaction number contained in the first block does not meet the block requirement, for example, the first block formed by packing the out-block nodes corresponding to the first block is unsaturated, so that the link points of the second block vote for the block challenging transaction, thereby effectively preventing the out-block nodes corresponding to the first block from maliciously and inefficiently out-blocking. If the difference is smaller than the third set threshold, it indicates that the transaction quantity contained in the first block meets the block requirement, so that the second block link point makes a negative vote for the block challenge transaction, thereby effectively avoiding the first block link point from maliciously posing a challenge.
Illustratively, the description is made by taking the block link point B in the above block chain network as an example of the verification node. After blockchain node B receives a block challenge transaction for the first block, such as a block challenge transaction for block No. 6, blockchain node B verifies the block challenge transaction for block No. 6 at least once based on generation timestamp t (6) for block No. 6 and/or transaction number tsize (6) for block No. 6. Specifically, block link point B verifies the block challenge transaction for the first time based on the transaction number for block No. 6. That is, if the transaction amount packed by the block in the blockchain network has the upper limit, the block link point B determines whether the transaction amount of the block No. 6 is greater than or equal to a second set threshold, assuming that the second set threshold is 1000. For example, if the transaction amount tsize (6) for block 6 is 1100, it may be determined that the transaction amount for block 6 is greater than the second set threshold, and a counteroffer ticket is issued for the block challenge transaction for block 6. For example, if the transaction amount tsize (6) of the block No. 6 is 700, and it may be determined that the transaction amount of the block No. 6 is smaller than the second set threshold, the block challenge transaction for the block No. 6 needs to be verified for the second time based on the generation timestamp t (6) of the block No. 6.
When the second verification is performed on the block challenge transaction of block No. 6, the block link point B determines a delay time stamp according to the generation time stamp t (6) and a second set time interval Delta, namely the delay time stamp is t (6) + Delta. And determining the transaction quantity in the transaction pool at the first sampling time after the delay time stamp from the local transaction pool records, and assuming that the transaction quantity in the transaction pool at the first sampling time after the delay time stamp is 500. Then, whether the transaction quantity in the transaction pool at the first sampling time after the delay time stamp is less than or equal to a second transaction quantity in the transaction pool corresponding to the first acquisition time stamp recorded in the block challenge transaction is determined. Assuming that the second transaction amount in the transaction pool corresponding to the first collection timestamp recorded in the block challenge transaction is 1000 transactions, it may be determined that the transaction amount in the transaction pool at the first sampling time after the delay timestamp is less than the second transaction amount in the transaction pool corresponding to the first collection timestamp recorded in the block challenge transaction, which may indicate that the blockchain node a maliciously presents a challenge, i.e., \ 35820, and intentionally traps the block exit node corresponding to block No. 6, so that the blockchain node B submits an objection to the block challenge transaction for block No. 6. Assuming that the second transaction number in the transaction pool corresponding to the first collecting timestamp recorded in the block challenge transaction is 400, it may be determined that the transaction number in the transaction pool at the first sampling time after the delay timestamp is greater than the second transaction number in the transaction pool corresponding to the first collecting timestamp recorded in the block challenge transaction, and then a third verification needs to be performed on the block challenge transaction for block No. 6 based on the generation timestamp t (6) of block No. 6 and the transaction number tsize (6) of the first block. The second verification can effectively prevent the blockchain node a from maliciously challenging, and the transaction number in the transaction pool corresponding to the first collection timestamp is intentionally written into the blockchain challenging transaction to be very large. Fig. 4 is a schematic diagram of the transaction amount in the collected transaction pool corresponding to the second collection timestamp according to an embodiment of the present invention. Based on fig. 4, it can be seen that the transaction number in the transaction pool corresponding to the first collection timestamp in the block challenge transaction is 1000, and after the verification node finds that the second set time interval Δ passes, the theoretically synchronized transactions should all be received, but the transaction number in the transaction pool at the first sampling time after the delay timestamp is 500, so it can be said that the block chain node a is malicious 35820, and the block exit node corresponding to block 6, so that an objection ticket is issued for the block challenge transaction of block 6.
When the third verification is performed on the block challenge transaction of the No. 6 block, the block chain node B determines a nearest third acquisition time stamp before the generation time stamp t (6) from the local transaction pool record, determines the transaction number in the transaction pool corresponding to the third acquisition time stamp, and then determines whether the difference between the transaction number in the transaction pool corresponding to the third acquisition time stamp and the transaction number of the No. 6 block is greater than or equal to a third set threshold. The third set threshold value may be set according to an empirical value of a person skilled in the art or according to results obtained from a plurality of experiments. For example, if the ratio of the difference to the transaction number of the block No. 6 is greater than or equal to 10%, it indicates that the transaction number contained in the block No. 6 does not meet the block requirement, that is, the block No. 6 block formed by packing the block output nodes corresponding to the block No. 6 block is not saturated, so that the block chaining node B votes for the transaction challenging of the block No. 6 block. If the ratio of the difference to the transaction amount of block No. 6 is less than 10%, it indicates that the transaction amount contained in block No. 6 meets the block requirement, and therefore the blockchain node B votes against the block challenge transaction for block No. 6.
Step 205, the second blockchain node sends the verification result for the blockchallenge transaction to the first blockchain node.
In step 206, after determining that the block challenge transaction consensus is successful, the first blockchain node confirms that the out-blockchain node corresponding to the first block is a bad node.
In the above steps 205 and 206, each second blockchain node sends the verification result to the first blockchain node after the verification of the block challenge transaction for the first block is completed. The first block link point determines whether the out-block node corresponding to the first block is a rogue node based on the verification result of each second block link node. If most of the second block chain nodes in each second block chain node ask the block of the first block to agree with the transaction, for example, 2f +1 agreement is received, the block node corresponding to the first block is determined as a bad node, a penalty transaction for the bad node is constructed, and a consensus process for the penalty transaction is initiated, so that the second block chain nodes verify the penalty transaction, and after the successful consensus of the penalty transaction is determined, for example, 2f +1 agreement with the penalty is received, the bad node is punished, for example, the block node corresponding to the first block is blackened or the block node corresponding to the first block is removed from the block chain network. Wherein punished transactions need to carry a private key signature of a positive ticket as evidence. If no 2f +1 tickets are received with a positive penalty or 2f +1 tickets are received with a negative penalty, no penalty is applied to the offending node. If most of the second block chain nodes in each second block chain node apply an objection ticket to the block challenge transaction of the first block, for example, 2f +1 objection tickets are received or 2f +1 approval tickets are not received within a specific time, the out-block node corresponding to the first block is determined not to be a malignant node, and no penalty transaction is initiated. Therefore, according to the scheme, a certain node in the block chain network can be effectively prevented from being maliciously and inefficiently blocked, and meanwhile, a first block chain node can be effectively prevented from maliciously giving a punishment.
Illustratively, the description continues with the block chain node a in the block chain network described above as an example. The block chain node a receives the verification results of the block challenge transaction for the No. 6 block by the block chain node B, the block chain node C, and the block chain node D, for example, if the block chain node a receives at least two approval tickets, it determines the out-block node corresponding to the No. 6 block as a malicious node, and initiates a penalty transaction for the out-block node corresponding to the No. 6 block. If the block chain link point A receives 2f +1 tickets for approving punishment, punishing the malignant node; if no 2f +1 tickets are received with a positive penalty or 2f +1 tickets are received with a negative penalty, no penalty is applied to the offending node. For example, if the blockchain node a receives at least two negative tickets or does not receive at least two positive tickets within a specific time (e.g., 30s, 1min, or 2min, etc.), it is determined that the out-blockchain node corresponding to block No. 6 is not a bad node, and no penalty transaction is initiated.
The above embodiments show that, because a certain node in the blockchain network in the prior art maliciously and inefficiently generates a block, the consensus efficiency of the blockchain network is greatly reduced, and meanwhile, because the number of transactions included in the block generated by the certain node is small, the processing efficiency of the blockchain network for the transactions is reduced, which affects the normal execution of the transactions. Based on this, in the technical scheme of the invention, when a certain blockchain node determines that a first block in a local blockchain account book does not meet a block outlet condition, a challenge can be provided for the first block, and a consensus verification process for block challenge transaction of the first block is initiated. Specifically, when the first block does not satisfy the block output condition, the first block chain node constructs a block challenge transaction for the first block, and broadcasts the block challenge transaction to m-1 second block chain nodes, so that the m-1 second block chain nodes verify the block challenge transaction, and whether the challenge of the first block chain node for the first block is correct is determined. If the m-1 second block chain nodes successfully identify the challenge transaction for the block, the corresponding out-blocking node of the first block is determined as a rogue node, and the rogue node is determined to maliciously and inefficiently go out of the block, and then a penalty is made for the rogue node. Therefore, the scheme can effectively prevent a certain node in the block chain network from maliciously and inefficiently blocking, and can effectively prevent a certain node in the block chain network from maliciously presenting challenges, thereby effectively solving the problem that the node in the block chain network maliciously and inefficiently blocks.
Based on the same technical concept, fig. 5 exemplarily illustrates an apparatus for detecting a block node based on a block chain according to an embodiment of the present invention, which may perform a flow of a method for detecting a block node based on a block chain. The device for detecting the block nodes based on the block chain in the embodiment of the invention is suitable for a block chain network with m block chain nodes.
As shown in fig. 5, the apparatus includes:
a constructing unit 501, configured to construct a block challenge transaction for a first block in a local blockchain ledger when it is determined that the first block does not satisfy a block output condition; the first block is any block in the block chain account book;
a first processing unit 502, configured to broadcast the block challenge transaction to m-1 second blockchain nodes; the m-1 second tile linked points are used for verifying the tile challenge transaction; the second block chain node is any one of the m block chain nodes except the first block chain link node; the first blockchain node is any one of the m blockchain nodes; and after the block challenge transaction consensus is determined to be successful, confirming that the out-block node corresponding to the first block is a malignant node.
Optionally, the constructing unit 501 is specifically configured to:
acquiring a generation timestamp of the first block from the first block;
determining a latest first acquisition timestamp before the generation timestamp from a local transaction pool record, and determining a first transaction number in the transaction pool corresponding to the first acquisition timestamp;
and when the difference value between the first transaction quantity in the transaction pool corresponding to the first acquisition timestamp and the transaction quantity of the first block is determined to be larger than or equal to a first set threshold value, determining that the first block does not meet the block outlet condition.
Optionally, the constructing unit 501 is specifically configured to:
determining a second transaction quantity in the transaction pool corresponding to the first acquisition timestamp;
and constructing the block challenge transaction based on the second transaction quantity in the transaction pool corresponding to the first acquisition timestamp and the block identifier of the first block.
Optionally, the constructing unit 501 is specifically configured to:
periodically collecting the transaction quantity in the transaction pool according to a first set time interval;
and storing each acquisition time stamp and the transaction quantity in the transaction pool corresponding to each acquisition time stamp into the transaction pool record.
Optionally, the first processing unit 502 is further configured to:
after confirming that the block outlet node corresponding to the first block is a malignant node, constructing a penalty transaction aiming at the malignant node;
initiating a consensus process for the punished transaction; the consensus process is used for verifying the punished transaction by any second block link point;
and after determining that the punishment transaction consensus is successful, punishing the malignant node.
Based on the same technical concept, fig. 6 exemplarily shows another apparatus for detecting a block node based on a block chain according to an embodiment of the present invention, which may perform a flow of a method for detecting a block node based on a block chain. The device for detecting the block nodes based on the block chain in the embodiment of the invention is suitable for a block chain network with m block chain nodes.
As shown in fig. 6, the apparatus includes:
a receiving unit 601, configured to receive a block challenge transaction broadcasted by a first block link node; the block challenge transaction is constructed by the first blockchain node for a first block in a local blockchain ledger upon determining that the first block does not satisfy a block out condition; the first block is any block in the block chain account book; the first blockchain node is any one of the m blockchain nodes;
a second processing unit 602, configured to obtain block information of the first block from a local block chain ledger; the block information comprises a generation timestamp of the first block and a transaction number of the first block; at least one verification of the block challenge transaction is performed based on the generation timestamp of the first block and/or the transaction number of the first block.
Optionally, the second processing unit 602 is specifically configured to:
determining whether the transaction quantity of the first block is larger than or equal to a second set threshold value; the second set threshold is the maximum value of the transaction number contained in the block;
if the transaction quantity of the first block is larger than or equal to the second set threshold value, the block challenge transaction is subjected to a negative vote;
and if the transaction quantity of the first block is smaller than the second set threshold, performing second verification on the block challenge transaction based on the generation timestamp of the first block.
Optionally, the second processing unit 602 is specifically configured to:
determining a delay time stamp according to the generation time stamp and a second set time interval; the second set time interval is used for representing that any transaction is synchronized to the m blockchain nodes when the second set time interval is met;
determining a nearest second acquisition timestamp positioned after the delay timestamp from a local transaction pool record, and determining the transaction quantity in the transaction pool corresponding to the second acquisition timestamp;
determining whether the transaction quantity in the transaction pool corresponding to the second acquisition timestamp is less than or equal to a second transaction quantity in the transaction pool corresponding to the first acquisition timestamp recorded in the block challenge transaction;
if the transaction quantity in the transaction pool corresponding to the second acquisition timestamp is less than or equal to the second transaction quantity in the transaction pool corresponding to the first acquisition timestamp, the block challenge transaction is subjected to a negative vote;
and if the transaction quantity in the transaction pool corresponding to the second acquisition timestamp is greater than the second transaction quantity in the transaction pool corresponding to the first acquisition timestamp, performing third verification on the block challenge transaction based on the generation timestamp of the first block and the transaction quantity of the first block.
Optionally, the second processing unit 602 is specifically configured to:
determining a third latest acquisition timestamp which is positioned before the generation timestamp from the transaction pool records, and determining the transaction quantity in the transaction pool corresponding to the third acquisition timestamp;
determining whether the difference value between the transaction quantity in the transaction pool corresponding to the third acquisition timestamp and the transaction quantity of the first block is greater than or equal to a third set threshold value;
if the difference is larger than or equal to the third set threshold, the block challenge transaction is approved;
and if the difference value is smaller than the third set threshold value, the block challenge transaction is subjected to a negative vote.
Based on the same technical concept, an embodiment of the present invention further provides a computing device, as shown in fig. 7, including at least one processor 701 and a memory 702 connected to the at least one processor, where a specific connection medium between the processor 701 and the memory 702 is not limited in the embodiment of the present invention, and the processor 701 and the memory 702 in fig. 7 are connected through a bus as an example. The bus may be divided into an address bus, a data bus, a control bus, etc.
In the embodiment of the present invention, the memory 702 stores instructions executable by the at least one processor 701, and the at least one processor 701 may execute the steps included in the method for detecting a block node based on a block chain by executing the instructions stored in the memory 702.
The processor 701 is a control center of the computing device, and may be connected to various parts of the computing device by using various interfaces and lines, and implement data processing by executing or executing instructions stored in the memory 702 and calling data stored in the memory 702. Optionally, the processor 701 may include one or more processing units, and the processor 701 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application program, and the like, and the modem processor mainly processes an issued instruction. It will be appreciated that the modem processor described above may not be integrated into the processor 701. In some embodiments, processor 701 and memory 702 may be implemented on the same chip, or in some embodiments, they may be implemented separately on separate chips.
The processor 701 may be a general-purpose processor, such as a Central Processing Unit (CPU), a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof, configured to implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the disclosed method in connection with the block chain based method for detecting block nodes may be directly embodied as being performed by a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
Memory 702, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 702 may include at least one type of storage medium, and may include, for example, a flash Memory, a hard disk, a multimedia card, a card-type Memory, a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Programmable Read Only Memory (PROM), a Read Only Memory (ROM), a charge Erasable Programmable Read Only Memory (EEPROM), a magnetic Memory, a magnetic disk, an optical disk, and so on. The memory 702 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 702 of embodiments of the present invention may also be circuitry or any other device capable of performing a storage function to store program instructions and/or data.
Based on the same technical concept, embodiments of the present invention further provide a computer-readable storage medium storing a computer program executable by a computing device, where the computer program is configured to, when running on the computing device, cause the computing device to perform the steps of the above method for detecting a block node based on a block chain.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present application and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (11)

1. A method for detecting a blockchain node based on a blockchain, the method being applicable to a blockchain network having m blockchain nodes, the method comprising:
the method comprises the steps that when a first block in a local block chain account book is determined to not meet a block outlet condition, a first block chain node constructs a block challenge transaction aiming at the first block; the first blockchain node is any one of the m blockchain nodes; the first block is any block in the block chain account book;
the first block link node broadcasts the block challenge transaction to m-1 second block link nodes; the m-1 second tile linked points are used for verifying the tile challenge transaction; the second block chain node is any one of the m block chain nodes except the first block chain link point;
and after the first block chain node determines that the block challenging transaction consensus is successful, determining the block outlet node corresponding to the first block as a rogue node.
2. The method of claim 1, wherein the first block link point determines that the first block in the local block chain ledger does not satisfy the block out condition by:
the first block chain node acquires the generation timestamp of the first block from the first block;
the first blockchain node determines a nearest first acquisition timestamp before the generation timestamp from a local transaction pool record, and determines a first transaction quantity in the transaction pool corresponding to the first acquisition timestamp;
and when the first block chain node determines that the difference value between the first transaction quantity in the transaction pool corresponding to the first acquisition timestamp and the transaction quantity of the first block is greater than or equal to a first set threshold value, determining that the first block does not meet the block outlet condition.
3. The method of claim 1, wherein constructing a block challenge transaction for the first block comprises:
the first block link point determines a second transaction quantity in the transaction pool corresponding to the first acquisition timestamp;
the first block link point constructs the block challenge transaction based on a second transaction quantity in a transaction pool corresponding to the first acquisition timestamp and a block identifier of the first block.
4. The method of claim 2, wherein the transaction pool record is determined by:
the first block chain node periodically collects the transaction quantity in the transaction pool according to a first set time interval;
and the first block chain link point stores each acquisition time stamp and the transaction quantity in the transaction pool corresponding to each acquisition time stamp into the transaction pool record.
5. The method of claim 1, wherein after identifying the corresponding out-of-block node for the first block as a bad node, further comprising:
the first block link point constructs a penalty transaction for the rogue node;
the first block link point initiates a consensus process for the punished transaction; the consensus process is used for verifying the punished transaction by any second block link point;
and after determining that the penalty transaction consensus is successful, the first blockchain node punishs the malignant node.
6. A method for detecting a blockchain node based on a blockchain, the method being applicable to a blockchain network having m blockchain nodes, the method comprising:
the second blockchain node receives the block challenge transaction broadcasted by the first blockchain node; the block challenge transaction is constructed by the first blockchain node for a first block in a local blockchain ledger upon determining that the first block does not satisfy a block out condition; the first block is any block in the block chain account book; the first blockchain node is any one of the m blockchain nodes; the second block chain node is any one of the m block chain nodes except the first block chain link point;
the second block chain node acquires the block information of the first block from a local block chain account book; the block information comprises a generation timestamp of the first block and a transaction number of the first block;
the second tile link point verifies the tile challenge transaction at least once based on the generation timestamp of the first tile and/or the transaction number of the first tile.
7. The method of claim 6, wherein the second block link point verifies the block challenge transaction for a first time based on the transaction number of the first block, comprising:
the second block link point determines whether the transaction quantity of the first block is greater than or equal to a second set threshold value; the second set threshold is the maximum value of the transaction number contained in the block;
if the transaction quantity of the first block is larger than or equal to the second set threshold value, the second block link point makes a negative vote for the block challenge transaction;
and if the transaction quantity of the first block is smaller than the second set threshold, the second block link point verifies the block challenge transaction for the second time based on the generation timestamp of the first block.
8. The method of claim 7, wherein the second tile nexus verifies the tile challenge transaction a second time based on the generation timestamp of the first tile, comprising:
the second block link point determines a delay time stamp according to the generation time stamp and a second set time interval; the second set time interval is used for representing that any transaction is synchronized to the m blockchain nodes when the second set time interval is met;
the second blockchain node determines a nearest second acquisition timestamp positioned after the delay timestamp from a local transaction pool record, and determines the transaction quantity in the transaction pool corresponding to the second acquisition timestamp;
the second block link point determines whether the transaction quantity in the transaction pool corresponding to the second acquisition timestamp is less than or equal to a second transaction quantity in the transaction pool corresponding to the first acquisition timestamp recorded in the block challenge transaction;
if the transaction quantity in the transaction pool corresponding to the second acquisition timestamp is less than or equal to the second transaction quantity in the transaction pool corresponding to the first acquisition timestamp, the second block link point makes an objection to the block challenge transaction;
and if the transaction number in the transaction pool corresponding to the second acquisition timestamp is greater than the second transaction number in the transaction pool corresponding to the first acquisition timestamp, the second block link point performs third verification on the block challenge transaction based on the generation timestamp of the first block and the transaction number of the first block.
9. The method of claim 8, wherein the second tile link point verifies the tile challenge transaction a third time based on the generation timestamp of the first tile and the transaction quantity of the first tile, comprising:
the second blockchain node determines a third latest acquisition timestamp which is positioned before the generation timestamp from the transaction pool records, and determines the transaction quantity in the transaction pool corresponding to the third acquisition timestamp;
the second block link point determines whether the difference value between the transaction quantity in the transaction pool corresponding to the third acquisition timestamp and the transaction quantity of the first block is greater than or equal to a third set threshold value;
if the difference is larger than or equal to the third set threshold, the second block link point agrees with the block challenge transaction;
and if the difference value is smaller than the third set threshold value, the second block link point makes a negative vote on the block challenge transaction.
10. An apparatus for detecting a blockchain node based on a blockchain, the apparatus being adapted to a blockchain network having m blockchain nodes, the apparatus comprising:
the system comprises a construction unit, a processing unit and a processing unit, wherein the construction unit is used for constructing a block challenge transaction aiming at a first block in a local block chain account book when the first block is determined not to meet a block outlet condition; the first block is any block in the block chain account book;
a first processing unit for broadcasting the block challenge transaction to m-1 second blockchain nodes; the m-1 second tile linked points are used for verifying the tile challenge transaction; the second block chain node is any one of the m block chain nodes except the first block chain link node; the first blockchain node is any one of the m blockchain nodes; and after the block challenge transaction consensus is determined to be successful, confirming that the out-block node corresponding to the first block is a malignant node.
11. An apparatus for detecting a blockchain node based on a blockchain, the apparatus being adapted to a blockchain network having m blockchain nodes, the apparatus comprising:
a receiving unit, configured to receive a block challenge transaction broadcasted by a first block link node; the block challenge transaction is constructed by the first blockchain node for a first block in a local blockchain ledger upon determining that the first block does not satisfy a block out condition; the first block is any block in the block chain account book; the first blockchain node is any one of the m blockchain nodes;
the second processing unit is used for acquiring the block information of the first block from a local block chain account book; the block information comprises a generation timestamp of the first block and a transaction number of the first block; at least one verification of the block challenge transaction is performed based on the generation timestamp of the first block and/or the transaction number of the first block.
CN202110900614.5A 2021-08-06 2021-08-06 Block chain-based block node detection method and device Pending CN113673996A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110900614.5A CN113673996A (en) 2021-08-06 2021-08-06 Block chain-based block node detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110900614.5A CN113673996A (en) 2021-08-06 2021-08-06 Block chain-based block node detection method and device

Publications (1)

Publication Number Publication Date
CN113673996A true CN113673996A (en) 2021-11-19

Family

ID=78541718

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110900614.5A Pending CN113673996A (en) 2021-08-06 2021-08-06 Block chain-based block node detection method and device

Country Status (1)

Country Link
CN (1) CN113673996A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115118436A (en) * 2022-08-23 2022-09-27 北京优品三悦科技发展有限公司 Block chain consensus method and device, storage medium and electronic equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109064328A (en) * 2018-07-09 2018-12-21 夸克链科技(深圳)有限公司 A kind of construction and its common recognition algorithm of novel block chain
CN109472601A (en) * 2018-11-21 2019-03-15 北京蓝石环球区块链科技有限公司 The block chain framework of privacy transaction can be supervised
KR20190093012A (en) * 2018-01-31 2019-08-08 지송학 The method for block generation and validation in block-chain system
US20200162264A1 (en) * 2017-05-22 2020-05-21 Visa International Service Association Network for improved verification speed with tamper resistant data
CN112070610A (en) * 2020-09-01 2020-12-11 中国联合网络通信集团有限公司 Method, node, system, electronic device and medium for verifying block validity
CN112329028A (en) * 2020-09-29 2021-02-05 华南师范大学 Abnormal data identification method, system, device and medium based on block chain
CN112804333A (en) * 2021-01-15 2021-05-14 北京百度网讯科技有限公司 Exception handling method, device and equipment for out-of-block node and storage medium
CN112883106A (en) * 2020-12-31 2021-06-01 北京百度网讯科技有限公司 Method, device, equipment and medium for determining out-of-block node of block chain
CN112907369A (en) * 2021-02-08 2021-06-04 网易(杭州)网络有限公司 Block chain-based data consensus method and device, electronic equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200162264A1 (en) * 2017-05-22 2020-05-21 Visa International Service Association Network for improved verification speed with tamper resistant data
KR20190093012A (en) * 2018-01-31 2019-08-08 지송학 The method for block generation and validation in block-chain system
CN109064328A (en) * 2018-07-09 2018-12-21 夸克链科技(深圳)有限公司 A kind of construction and its common recognition algorithm of novel block chain
CN109472601A (en) * 2018-11-21 2019-03-15 北京蓝石环球区块链科技有限公司 The block chain framework of privacy transaction can be supervised
CN112070610A (en) * 2020-09-01 2020-12-11 中国联合网络通信集团有限公司 Method, node, system, electronic device and medium for verifying block validity
CN112329028A (en) * 2020-09-29 2021-02-05 华南师范大学 Abnormal data identification method, system, device and medium based on block chain
CN112883106A (en) * 2020-12-31 2021-06-01 北京百度网讯科技有限公司 Method, device, equipment and medium for determining out-of-block node of block chain
CN112804333A (en) * 2021-01-15 2021-05-14 北京百度网讯科技有限公司 Exception handling method, device and equipment for out-of-block node and storage medium
CN112907369A (en) * 2021-02-08 2021-06-04 网易(杭州)网络有限公司 Block chain-based data consensus method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115118436A (en) * 2022-08-23 2022-09-27 北京优品三悦科技发展有限公司 Block chain consensus method and device, storage medium and electronic equipment
CN115118436B (en) * 2022-08-23 2022-11-22 北京优品三悦科技发展有限公司 Block chain consensus method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN110648137B (en) Block processing method, node and system
CN107220130B (en) Method, device and system for realizing information consensus at nodes of block chain
CN107679863B (en) Block chain system and method for quickly verifying block
CN110659988A (en) Parallel processing method and device for block chain consensus and execution and electronic equipment
US11366932B2 (en) Consensus method and data verification method, apparatus, and system of consortium blockchain
CN111010284B (en) Processing method of block to be identified, related device and block chain system
CN110855761A (en) Data processing method and device based on block chain system
US20210314179A1 (en) Methods and consensus nodes for block generation
CN109951534B (en) Consensus method, device and system
CN111698244B (en) Method and device for rapidly participating in consensus of newly added nodes and electronic equipment
CN110784521B (en) Block chain consensus method, electronic device and storage medium
CN111698094A (en) Consensus method based on block chain system and block chain system
CN113673996A (en) Block chain-based block node detection method and device
CN111711623A (en) Data verification method and device
CN112700248B (en) Block chain consensus method, device and system based on Byzantine fault-tolerant algorithm
CN111327565B (en) Block chaining and deblocking method and system
CN112887436B (en) Consensus method, consensus node and block chain system of pipeline mode
CN112988470B (en) Consensus method, consensus node and system in alliance chain
CN112132669A (en) Online auction system, method, device and electronic equipment
CN112258184A (en) Method and device for freezing area block chain network, electronic equipment and readable storage medium
CN110175181B (en) Information updating method based on data analysis and related equipment
CN114445220A (en) Transaction data clearing method and device, database server and storage medium
CN111179524B (en) ATM (automatic Teller machine) card retaining and retrieving method and device
CN109246216B (en) Access request processing method and device
CN111738855A (en) Intelligent contract management method and device

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