WO2022121612A1 - 区块链网络的信息处理方法、装置、设备及存储介质 - Google Patents

区块链网络的信息处理方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2022121612A1
WO2022121612A1 PCT/CN2021/129944 CN2021129944W WO2022121612A1 WO 2022121612 A1 WO2022121612 A1 WO 2022121612A1 CN 2021129944 W CN2021129944 W CN 2021129944W WO 2022121612 A1 WO2022121612 A1 WO 2022121612A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
information
consensus
target
consensus verification
Prior art date
Application number
PCT/CN2021/129944
Other languages
English (en)
French (fr)
Inventor
刘攀
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to EP21902319.9A priority Critical patent/EP4198861A4/en
Publication of WO2022121612A1 publication Critical patent/WO2022121612A1/zh
Priority to US17/978,906 priority patent/US11899652B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • 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/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • 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/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/36Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes
    • 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/3827Use of message hashing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Definitions

  • the present application relates to the field of blockchain technology, and in particular, to an information processing method, device, device and storage medium of a blockchain network.
  • the speed at which the consensus node processes messages depends on the resources of the node and the transmission speed of the network.
  • Consensus network resources in the entire blockchain may be different and network resources are differentiated, resulting in different speed of message processing by each consensus node.
  • the message transmission between the known consensus nodes is usually one-time and the consensus node processing consensus verification messages needs to follow strict protocol rules, such as only processing consensus verification messages with the same block height as its own node. All of the above factors may cause the consensus process to be stuck and unable to provide external services. Therefore, how to effectively perform consensus verification in the blockchain network to ensure the reliability of the blockchain network has become a hot research issue today.
  • the embodiments of the present application provide an information processing method, device, device, and storage medium for a blockchain network, which can improve the reliability of the blockchain network.
  • an embodiment of the present application provides an information processing method for a blockchain network, the blockchain network includes a target consensus node, and the method includes:
  • the target consensus verification information for performing consensus verification on the second block is received, then according to the block attribute information of the second block, determine Whether the target consensus verification information satisfies the cache condition;
  • the target consensus verification information satisfies the cache condition, storing the target consensus verification information in the information buffer pool corresponding to the target consensus node;
  • consensus verification is performed on the second block.
  • an embodiment of the present application provides an information processing device of a blockchain network, the device comprising:
  • a receiving unit configured to receive target consensus verification information for performing consensus verification on the second block in the process of performing consensus verification on the first block by the target consensus node;
  • a processing unit configured to determine whether the target consensus verification information satisfies the cache condition according to the block attribute information of the second block;
  • a storage unit configured to store the target consensus verification information in the information buffer pool corresponding to the target consensus node if the target consensus verification information satisfies the cache condition
  • the processing unit is further configured to perform consensus verification on the second block based on the target consensus verification information in the information buffer pool after the consensus verification on the first block is completed.
  • an embodiment of the present application provides a computer device, which is characterized by comprising: a processor, adapted to implement a computer program; and a computer storage medium, where the computer storage medium stores a computer program, and the computer program is adapted to The information processing method of the above-mentioned blockchain network is loaded and executed by the processor.
  • an embodiment of the present application provides a computer storage medium, wherein a computer program is stored in the computer storage medium, and when the computer program is executed by a processor, the information used to execute the above-mentioned blockchain network Approach.
  • an embodiment of the present application provides a computer program product or a computer program
  • the computer program product includes a computer program
  • the computer program is stored in a computer-readable storage medium;
  • the processor of the computer device is stored from the computer.
  • the computer program is read from the medium, and the processor executes the computer program, so that the computer device executes the information processing method of the blockchain network.
  • FIG. 1 is a schematic structural diagram of a blockchain network provided by an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of another blockchain provided by an embodiment of the present application.
  • FIG. 3 is a structural diagram of a blockchain provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of an information processing method for a blockchain network provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of another information processing method of a blockchain network provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an information processing device of a blockchain network provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • the embodiment of the present application provides an information processing solution, which is applied in a blockchain network.
  • the target consensus node in the blockchain network receives a For the target consensus verification information to be verified, if the target consensus verification information meets the caching conditions, the target consensus verification information is cached.
  • the target consensus verification information is retrieved from the cache, and the second block is verified based on the target consensus verification information.
  • the information processing solutions proposed in the embodiments of the present application can ensure that the blockchain network services can be continuously provided externally in the case of the blockchain asynchronous network, and the reliability of the blockchain network can be improved.
  • the blockchain network can be understood as a data sharing system, and the data sharing system is used for data sharing between nodes.
  • FIG. 1 which is a schematic structural diagram of a blockchain network provided by an embodiment of the present application, 100 represents a blockchain network.
  • the blockchain network 100 may include multiple nodes 101 , and the multiple nodes 101 may be access areas.
  • the terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart car, and the like.
  • the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, and can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, and cloud communications. , middleware services, domain name services, security services, CDN, and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.
  • each node 101 in the blockchain network 100 can receive information input into the blockchain network 100 during normal operation, and maintain the internal information of the blockchain network based on the received input information. of shared data.
  • there may be an information connection between each node 101 in the blockchain network and information transmission may be performed among the nodes through the above-mentioned information connection.
  • any node 101 in the blockchain network receives input information
  • other nodes 101 in the blockchain network obtain the input information according to the consensus algorithm, and store the input information as data in the shared data, so that The data stored on all nodes 101 in the blockchain network are consistent.
  • Each node 101 in the blockchain network has a corresponding node identifier, and each node 101 in the blockchain network can store the node identifiers of other nodes 101 in the blockchain network for subsequent
  • a node identifier list as described in the following table is maintained, and the node names and node identifiers are stored in the node identifier list correspondingly.
  • the node identifier may be an IP (Internet Protocol, a protocol for interconnection between networks) address and any other information that can be used to identify the node.
  • Table 1 only takes the IP address as an example for description.
  • the nodes included in the blockchain network include routing functions and various applications.
  • the routing function is the basic function that the nodes in the blockchain network should have, which is used to support the communication between the nodes.
  • the data input into the blockchain network can be shared among the above-mentioned multiple nodes, which is the routing that depends on the nodes. function is realized.
  • the applications include wallets, shared ledgers, smart contracts, and blockchains.
  • the wallet is used to provide the function of conducting electronic currency transactions;
  • the shared ledger is used to provide functions such as data storage, query and modification;
  • the smart contract is a computerized agreement that can execute a certain contract.
  • the terms are implemented through the code deployed on the shared ledger to execute when certain conditions are met, for example, query the logistics status of the goods purchased by the buyer, and transfer the buyer's electronic currency to the merchant's electronic currency after the buyer signs for the goods. address;
  • the blockchain includes a series of blocks that are consecutive in the chronological order of generation.
  • the multiple nodes 101 in the blockchain network 100 can be divided into the following types: light nodes, routing nodes, consensus nodes and full nodes.
  • the light node refers to the node with wallet, routing function and blockchain
  • the routing node refers to the node with only routing function and blockchain
  • the consensus node refers to the node with consensus function, routing function and blockchain.
  • a full node refers to a node with wallet function, routing function, consensus function, blockchain and smart contract functions. It should be understood that when a full node has a consensus function, the full node can also be a consensus node.
  • the above information processing solution may be executed by a target consensus node, and the target consensus node refers to any one of a plurality of consensus nodes included in the blockchain network.
  • an embodiment of the present application provides a schematic structural diagram of another blockchain network, as shown in FIG. 2 .
  • 2 shows the functions of each node, for example, the full node 102 has the routing function and all the application functions; for another example, the light node 103 has the wallet, the routing function and stores the blockchain.
  • each node in the blockchain network stores an identical blockchain.
  • the blockchain is composed of multiple blocks.
  • FIG. 3 it is a schematic structural diagram of a blockchain provided in an embodiment of the present application.
  • the blockchain shown in Figure 3 may include multiple blocks, each block includes the hash value of the current block and the hash value of the previous block, and each block is formed by connecting the hash values.
  • Blockchain (Blockchain) is essentially a decentralized database, which is a series of data blocks associated with cryptographic methods. Each data block contains relevant information to verify the validity of its information. (anti-counterfeiting) and generate the next block.
  • a consensus node before each block on the blockchain is added to the blockchain, a consensus node needs to perform consensus verification on it, and the block after the consensus verification can be added to the blockchain superior.
  • there is a consensus algorithm running in the blockchain network and each consensus node performs consensus verification on the block based on the consensus algorithm running in the blockchain network.
  • a complete process of block verification by the Zantine consensus algorithm can include: block proposal stage, pre-voting stage, and pre-submission stage.
  • the flow of states in these three stages is driven by consensus verification information such as proposal information, pre-voting information, and pre-commit information.
  • any consensus node has two trigger conditions from the block proposal stage to the pre-voting stage. One is that the proposal information is received within the preset time; the other is that the proposal information has not been received after the preset time. .
  • the pre-voting stage When in the block proposal stage, if the proposal information for proposing the first block is received within a preset time, the pre-voting stage is entered; after entering the pre-voting stage, any consensus node Vote on the received proposal information, generate pre-voting information, and broadcast the pre-voting information to other consensus nodes; if any consensus node is in the pre-voting stage, the number of pre-voting information received from other consensus nodes satisfies the first If the number threshold is reached, it will enter the pre-commit stage; when in the pre-commit stage, if the number of pre-commit information received by any node from other consensus nodes meets the second number threshold, then determine the block's Verification is complete.
  • both the first number threshold and the second number threshold may refer to 2/3 of the total number of consensus nodes.
  • the consensus node can wait all the time, or use a timeout method to enter the pre-commit stage. In the embodiment of the present application, it is assumed that any consensus node will wait for a sufficient amount of pre-voting information before entering the pre-submission stage.
  • the consensus node can wait until a sufficient number of pre-commits are received. information, or enter timeout processing. In the embodiment of the present application, it is assumed that any consensus node will always wait for a sufficient amount of pre-submission information to complete the consensus verification of the block.
  • the circulation speed of multiple consensus nodes in the blockchain network is asynchronous in the above three stages, and the speed is not the same. Especially when proposing a new block, there is a high probability that some consensus nodes have completed the above three stages. Entering the consensus verification process for the new block, and some nodes are still processing the consensus verification logic of the previous block.
  • the node that has already verified the consensus of the new block will broadcast the consensus verification information of the new block, and the consensus node that continues to process the consensus verification logic of the previous block will consider the consensus verification information and the consensus verification information of the new block when receiving the consensus verification information of the new block.
  • the current consensus verification process does not match, and the consensus verification information for the new block is discarded.
  • the consensus verification process of the new block is also entered.
  • the consensus node has discarded the consensus verification information of the consensus verification of the new block, and the message transmission between the consensus nodes is usually It is one-time, based on the Byzantine consensus algorithm, which requires the existence of the entire consensus network, because it needs to wait for enough consensus verification information, which causes the consensus verification to be stuck.
  • the embodiments of the present application propose the information processing scheme in the above-mentioned blockchain network.
  • any consensus node in the blockchain network is in the process of performing consensus verification on the first block, if it receives a
  • the target consensus verification information for block verification is cached when the target consensus verification information meets the caching conditions.
  • the target consensus verification information is retrieved from the cache, and the second block is verified based on the target consensus verification information.
  • the information processing solutions proposed in the embodiments of the present application can ensure that the blockchain network services can be continuously provided externally in the case of the blockchain asynchronous network, and the reliability of the blockchain network can be improved.
  • an embodiment of the present application provides an information processing method of a blockchain network.
  • FIG. 4 the flow of the information processing method of a blockchain network provided by the embodiment of the present application Schematic.
  • the information processing method shown in FIG. 4 is executed by a computer device, for example, by a target consensus node, and the target consensus node is any one of a plurality of consensus nodes included in the blockchain network, such as the node serving as a consensus node in FIG. 1 . 101.
  • the information processing method shown in FIG. 4 may include the following steps:
  • Step S401 During the process of the target consensus node performing consensus verification on the first block, if the target consensus verification information for performing consensus verification on the second block is received, the target is determined according to the block attribute information of the second block. Consensus verifies whether the information meets the cache conditions.
  • the verification of any block by any consensus node includes the block proposal stage, the pre-voting stage and the pre-submission stage, and the consensus verification of the first block by the target consensus node is no exception.
  • the process of performing consensus verification on the first block by the target consensus node may include a block proposal stage, a pre-voting stage, and a pre-submission stage.
  • the pre-voting stage When in the block proposal stage, if the proposal information for proposing the first block is received within a preset time, the pre-voting stage is entered, and the target node votes on the proposal information process, obtain pre-voting information, and broadcast the pre-voting information to other consensus nodes; when in the pre-voting stage, if the number of pre-voting information received by the target consensus node from other consensus nodes satisfies the first If the target consensus receives the pre-commit information from the other consensus nodes and satisfies the second quantity threshold, then enter the pre-commit node; when in the pre-commit stage, determine the first area Consensus verification of the block is complete.
  • the process of performing consensus verification on the first block described in step S401 may refer to any one of the above-mentioned proposal stage, pre-voting stage and pre-submission stage.
  • the target consensus verification information if the target consensus verification information for the consensus verification of the second block is received, the target consensus verification information is not directly discarded, but the target consensus verification information is not directly discarded, but the target consensus verification information is not discarded directly.
  • the block attribute information determines whether the target consensus verification information satisfies the cache condition; when the target consensus node satisfies the cache condition, the target consensus verification information is stored in the information buffer pool corresponding to the target consensus node through step S402.
  • the block attribute information of the second block may include the block height of the second block, and the determining whether the target consensus verification information meets the requirements of the block attribute information of the second block
  • the cache condition includes: determining the height difference between the block height of the second block and the block height of the first block; if the height difference is less than or equal to a height difference threshold, determining the target Consensus verification information satisfies the cache condition.
  • the height difference threshold may be determined by the target consensus node according to the current transmission speed of the blockchain network and the resource situation of the target consensus node; The consensus verification process of consensus nodes that lag behind a threshold height difference threshold can catch up.
  • the height difference between the block height of the second block and the block height of the first block is less than or equal to the height difference threshold, it is not necessary to discard the target consensus verification information for consensus verification on the second block, Just store the target consensus verification information, wait for the completion of the first block and verification, and then verify the stored target consensus verification information in turn.
  • the consensus verification information generated by the consensus verification process for any block can include block proposal information, pre-voting information and pre-submission information.
  • the target consensus node receives the consensus verification information for the second block.
  • the target consensus verification information may include any one or more of target proposal information for proposing the second block, target pre-voting information, and target pre-submission information.
  • each consensus node in the blockchain network has the right to make block proposals, but not every block proposed by each consensus node will pass consensus verification. If a block proposed by a consensus node fails consensus verification, the next consensus node in the consensus node set (called the consensus governance committee) will continue to propose the block, and each consensus node will take turns to perform the block. proposal.
  • the consensus node that proposes the second block can be the first consensus node, and the consensus view identifier corresponding to the second block is n, n can be any integer; if the consensus verification of the second block fails, the second block needs to be proposed by a second consensus node different from the first consensus node. At this time, the consensus view corresponding to the second block It is identified as n+1.
  • the block attribute information of the second block may also include the consensus view identifier corresponding to the second block; according to the block attribute information of the second block, Determining whether the target consensus verification information satisfies the cache condition includes: if the block height of the second block is the same as the block height of the first block, and the target consensus verification information is target proposal information, Obtain the consensus view difference between the consensus view identifier corresponding to the second block and the consensus view identifier corresponding to the first block; if the consensus view difference is less than or equal to the consensus view difference threshold, determine The target proposal information satisfies the caching condition.
  • the target proposal information refers to proposal information for proposing the second block, which is generated during the block proposal stage of performing consensus verification on the second block.
  • the target consensus verification information is stored; however, if the block height of the second block is the same as the block height of the first block, then the target consensus verification information is the target.
  • the proposal information is used, and the consensus view difference between the consensus view ID of the first block and the consensus view ID of the second block is less than or equal to the consensus view difference threshold, it can also be stored; if it is target pre-voting information or target Pre-commit information is not required to be stored.
  • Step S402 if the target consensus verification information satisfies the cache condition, store the target consensus verification information in the information buffer pool corresponding to the target consensus node.
  • an information cache pool may be introduced for each consensus node, and the information corresponding to each consensus node may be A buffer pool can be an information caching component.
  • the target consensus node stores the target consensus verification information in the information buffer pool corresponding to the target consensus node.
  • the implementation of storing the target consensus verification information in the information buffer pool corresponding to the target consensus node may be: storing the target consensus verification information, the block height of the second block, and the consensus view identifier of the second block Relational storage is performed, which facilitates subsequent consensus verification of the second block based on the target consensus verification information.
  • the storage method of the target consensus verification information in the information cache pool can be: block height 3—consensus view identifier 1—target proposal information; another example is block height 3 - consensus view identification 1 - target pre-voting information.
  • the target consensus node stores the target consensus verification information in the information buffer pool corresponding to the target consensus node through the information writing component.
  • the information writing component may include any one of a proposal information writing component, a pre-voting information writing component, and a pre-submission information writing component.
  • the target consensus node can write the proposal information into the component and store the target consensus verification information in the information cache pool corresponding to the target consensus node; if the target consensus verification information is the target consensus verification information pre-voting information, the target consensus node can write the component through the pre-voting information, and store the target consensus verification information in the information buffer pool corresponding to the target consensus node; if the target consensus verification information is the target pre-commit information, the target consensus node can Through the pre-commit information writing component, the target consensus verification information is stored in the information buffer pool corresponding to the target consensus node.
  • Step S403 After the consensus verification on the first block is completed, based on the target consensus verification information in the information buffer pool, perform consensus verification on the second block.
  • the target consensus verification information can be taken out from the information buffer pool. It should be understood that the number of second blocks may be one or more, and the number of target consensus verification information may also be one or more. Based on the target consensus verification information taken out from the information buffer pool, the target consensus node performs consensus verification on the second block in an implementation manner that may include:
  • the target consensus verification information is the target proposal information, The target proposal information is voted to generate a pre-vote information, and the pre-vote information is broadcast to other consensus nodes; if the target consensus verification information is the target pre-vote information, the number of target pre-vote information is counted to meet the first number threshold, if If it is not satisfied, continue to wait for the target pre-voting information; if satisfied, it will generate a pre-commit information and broadcast the generated pre-commit information to other consensus nodes in the consensus network; if the target consensus verification information is the target pre-commit information, Then count whether the number of received target pre-submission information satisfies the second quantity threshold, if not, continue to wait for the target pre-submission information, if satisfied, then determine that the verification of the target second block is passed, and the target second block is passed. added to
  • the target consensus verification information in order to release the storage space in the information buffer pool in time, after the target consensus node performs consensus verification on the second block based on the target consensus verification information, the target consensus verification information can be changed from the information corresponding to the target consensus node Deleted from the cache pool.
  • the target is determined according to the block height of the second block. Whether the consensus verification information satisfies the caching conditions; if the consensus verification information satisfies the caching conditions, store the target consensus verification information in the information buffer pool corresponding to the target consensus node; wait for the target consensus node to verify the consensus of the first block Upon completion, the second block is verified based on the target consensus verification information stored in the information buffer pool.
  • the embodiments of the present application further provide another information processing method in a blockchain network.
  • FIG. 5 is a schematic flowchart of another information processing method of a blockchain network provided by an embodiment of the present application
  • the information processing method shown in FIG. 5 can be executed by a target consensus node, and the target consensus node belongs to the consensus node set.
  • member nodes such as node 101 as a consensus node in FIG. 1 .
  • the information processing method may include the following steps:
  • Step S501 During the process of the target consensus node performing consensus verification on the first block, if the target consensus verification information for performing consensus verification on the second block is received, determine the information storage function of the information buffer pool corresponding to the target consensus node Whether to open.
  • the scope of cached information in the information cache pool of the target consensus node can be limited, such as limiting the target consensus
  • the node's information cache pool can only cache the consensus verification information of a preset number of blocks at most.
  • the target consensus node can temporarily turn off the information storage function of the information buffer pool.
  • the target consensus node cannot send information to the The consensus verification information is stored in the cache pool.
  • the target consensus node receives the consensus verification information for the new block, it can only discard it; as the target consensus node verifies the corresponding block according to the consensus verification information stored in the cache pool After completion, a part of the storage space of the information buffer pool is released, and the information storage function of the information buffer pool can be enabled at this time.
  • Step S502 If the information storage function of the information buffer pool is enabled, determine whether the target consensus verification information satisfies the buffer conditions according to the block attribute information of the second block.
  • the power consumption overhead required to determine whether the information storage function of the information buffer pool is enabled is less than the power consumption overhead required to determine whether the target consensus verification information satisfies the cache conditions. Therefore, in order to save the power consumption overhead of the target consensus node, Before determining whether the target consensus verification information meets the caching conditions, it is necessary to first determine whether the information storage function of the information buffer pool is enabled; if it is enabled, it means that the target consensus verification information can be stored in the information buffer pool if it meets the caching conditions.
  • Step S503 if the target consensus verification information satisfies the cache condition, store the target consensus verification information in the information buffer pool corresponding to the target consensus node.
  • step S503 for some feasible implementation manners included in step S503, reference may be made to the specific description of the relevant steps in the embodiment of FIG. 4 , which will not be repeated here.
  • Step S504 After the consensus verification of the first block is completed, if it is detected that the member nodes in the consensus node set are switched, it is determined whether the target consensus node belongs to the member nodes in the switched consensus node set.
  • Step S505 if yes, perform consensus verification on the second block based on the target consensus verification information.
  • the target consensus node belongs to the member nodes in the consensus node set, that is to say, the target consensus node has the right to perform consensus verification on the block; After the consensus verification of the block is completed, the member nodes in the consensus node set may change, and the target consensus node may not belong to the member nodes in the changed consensus node set. At this time, the target consensus node cannot agree on the second block. verify. In other words, the consensus verification of the second block by the target consensus node is invalid.
  • step S504 if it is detected that the member nodes in the consensus node set are switched, it is determined whether the target consensus node belongs to A member node in the switched consensus node set; if the target consensus node belongs to a member node in the switched consensus node set, step S505 is executed, that is, the second block is verified according to the target consensus verification information stored in the information buffer pool. Consensus verification; if the target consensus node does not belong to a member node in the switched consensus node set, delete the target consensus verification information stored in the information cache. Further, a block synchronization request may be sent to other consensus nodes to instruct the other consensus nodes to synchronize the second block after verification to the target consensus node.
  • the target consensus node after the target consensus node stores the target consensus verification information in the information buffer pool corresponding to the target consensus node, it can detect whether the consensus verification information of a preset number of blocks has been stored in the current information buffer pool ; If yes, in order to avoid the accumulation of messages of multiple blocks to be verified at the target consensus node, resulting in lower block verification efficiency, the information storage function of the information buffer pool corresponding to the target consensus node can be turned off.
  • the consensus verification information of the third block can be directly discarded.
  • the third block can be chased by the ledger synchronization module in the blockchain network.
  • the information storage function of the information buffer pool can be turned on, and the third block that has completed the consensus verification can be synchronized from other consensus nodes, that is, a block synchronization request is sent to other consensus nodes to instruct other consensus nodes to complete the verification.
  • the third block after that is sent to the target consensus node.
  • the information storage of the information buffer pool corresponding to the target consensus node is determined. Whether the function is enabled; when the information storage function of the information cache pool is enabled, it is further judged whether the target consensus verification information satisfies the cache conditions, and if the target consensus verification information meets the cache conditions, the target consensus verification information is stored in the information cache. in the pool. In this way, unnecessary overhead of the target consensus node can be saved.
  • the consensus verification of the second block can be performed according to the target consensus verification information stored in the information buffer pool.
  • the member nodes in the consensus node set may change, and the target consensus node may no longer belong to the consensus node set. If the target consensus node no longer belongs to the consensus node set, there is no need to Then perform consensus verification on the second block.
  • the target consensus node first determines whether the member nodes in the consensus node set are members before performing consensus verification on the second block according to the target verification information. If a switch occurs, whether the target consensus node belongs to the member nodes in the set of consensus nodes after the switch. If so, the target consensus node then performs the step of performing consensus verification on the second block according to the target consensus verification information.
  • an embodiment of the present application provides an information processing apparatus of a blockchain network.
  • FIG. 6 it is a schematic structural diagram of an information processing apparatus of a blockchain network according to an embodiment of the present application.
  • the information processing apparatus shown in FIG. 6 may be a computer program (including program code) running in computer equipment, for example, the information processing apparatus is an application software; the information processing apparatus shown in FIG. 6 may also be a hardware apparatus.
  • the information processing apparatus shown in FIG. 6 can be used to execute the information processing method in the blockchain network shown in FIG. 4 and FIG. 5 .
  • the information processing apparatus shown in FIG. 6 can operate the following units:
  • a receiving unit 601, configured to receive target consensus verification information for performing consensus verification on the second block in the process of performing consensus verification on the first block by the target consensus node;
  • a processing unit 602 configured to determine whether the target consensus verification information satisfies the cache condition according to the block attribute information of the second block;
  • a storage unit 603, configured to store the target consensus verification information in an information buffer pool corresponding to the target consensus node if the target consensus verification information satisfies the cache condition;
  • the processing unit 602 is further configured to perform consensus verification on the second block based on the target consensus verification information in the information buffer pool after the consensus verification on the first block is completed.
  • the consensus verification includes a block proposal stage, a pre-voting stage, and a pre-submission stage; the target consensus node performing consensus verification on the first block includes:
  • the pre-voting stage When in the block proposal stage, if the proposal information for proposing the first block is received within a preset time, the pre-voting stage is entered, and the target consensus node performs a Voting processing, obtaining pre-voting information, and broadcasting the pre-voting information to other consensus nodes in the blockchain network;
  • the pre-submission stage When in the pre-voting stage, if the number of pre-voting information received by the target consensus node from the other consensus nodes meets the first number threshold, the pre-submission stage is entered;
  • the block attribute information of the second block includes a block height of the second block
  • the processing unit 602 determines the target consensus according to the block attribute information of the second block To verify whether the information meets the cache conditions, perform the following steps:
  • the block attribute information of the second block includes a block height of the second block and a consensus view identifier corresponding to the second block.
  • the target consensus verification information is target proposal information
  • the consensus view difference between the consensus view identifiers corresponding to the first block, and the target proposal information refers to the block proposal stage generated during the consensus verification of the second block, and the block proposal information; if the consensus view difference is less than or equal to the consensus view difference threshold, it is determined that the target proposal information satisfies the caching condition.
  • the target consensus node when the target consensus node is performing consensus verification on the first block, the target consensus node belongs to a member node in a consensus node set; the processing unit 602 is in the process of verifying the first block. After the consensus verification of one block is completed, when performing consensus verification on the second block based on the target consensus verification information in the information buffer pool, perform the following steps:
  • the consensus verification of the first block After the consensus verification of the first block is completed, if it is detected that the member nodes in the consensus node set are switched, it is determined whether the target consensus node belongs to the member nodes in the switched consensus node set; if If yes, perform consensus verification on the second block based on the target consensus verification information in the information buffer pool.
  • the blockchain network further includes other consensus nodes;
  • the information processing apparatus further includes a sending unit 604;
  • the processing unit 602 is further configured to: if the target consensus node does not belong to the consensus after switching member nodes in the node set, delete the target consensus verification information stored in the information buffer pool;
  • the sending unit 604 is configured to send a block synchronization request to the other consensus nodes to indicate the other consensus nodes The node synchronizes the second block after the consensus verification is completed to the target consensus node.
  • the processing unit 602 performs the following steps when determining whether the target consensus verification information satisfies the cache condition according to the block attribute information of the second block:
  • the processing unit 602 is further configured to: if a preset number of pieces of information have been stored in the information buffer pool When the consensus verification information of the third block is received, the information storage function of the information buffer pool is turned off; when the consensus verification information of the third block is received, the consensus verification information of the third block is discarded.
  • the processing unit 602 is further configured to: delete the target consensus verification information from the information cache pool if consensus verification is performed on the second block based on the target consensus verification information .
  • the processing unit 602 is further configured to: enable the information storage function of the information buffer pool, and synchronize the third block after consensus verification from other consensus nodes.
  • each step involved in the information processing method shown in FIG. 4 and FIG. 5 may be performed by each unit in the information processing apparatus shown in FIG. 6 .
  • step S401 shown in FIG. 4 can be performed by the receiving unit 601 and the processing unit 602 in the information processing apparatus shown in FIG. 6
  • step S402 can be performed by the storage unit 603 in the information processing apparatus shown in FIG. 6
  • Step S40 can be executed by the processing unit 602 in the information processing apparatus shown in FIG. 6; for another example, step S501 shown in FIG. 5 can be executed by the receiving unit 601 and the processing unit 602 in the information processing apparatus shown in FIG. S502 can be executed by the processing unit 602 in the information processing apparatus shown in FIG.
  • step S503 can be executed by the storage unit 603 in the information processing apparatus shown in FIG. 6
  • steps S504 and S505 can be executed by the information processing shown in FIG. 6 . It is executed by the processing unit 602 in the device.
  • each unit in the information processing apparatus shown in FIG. 6 may be respectively or all combined into one or several other units to form, or some of the unit(s) may be further disassembled It is divided into a plurality of units with smaller functions, which can realize the same operation without affecting the realization of the technical effects of the embodiments of the present application.
  • the above-mentioned units are divided based on logical functions.
  • the function of one unit may also be implemented by multiple units, or the functions of multiple units may be implemented by one unit.
  • the information-based processing apparatus may also include other units, and in practical applications, these functions may also be implemented with the assistance of other units, and may be implemented by cooperation of multiple units.
  • a general-purpose computing device such as a computer
  • a general-purpose computing device may be implemented on a general-purpose computing device including a central processing unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and other processing elements and storage elements.
  • CPU central processing unit
  • RAM random access storage medium
  • ROM read-only storage medium
  • Running a computer program capable of executing the steps involved in the corresponding methods as shown in FIG. 4 and FIG. 5 , to construct an information processing apparatus as shown in FIG. 6 , and to realize the information processing of the embodiments of the present application method.
  • the computer program can be recorded on, for example, a computer-readable storage medium, loaded into the above-mentioned computing device through the computer-readable storage medium, and executed therein.
  • the target is determined according to the block height of the second block. Whether the consensus verification information satisfies the caching conditions; if the consensus verification information satisfies the caching conditions, store the target consensus verification information in the information buffer pool corresponding to the target consensus node; wait for the target consensus node to verify the consensus of the first block Upon completion, the second block is verified based on the target consensus verification information stored in the information buffer pool.
  • the consensus verification information is used to verify the new block based on the stored consensus verification information after the verification of the current block is completed. In this way, the situation where the consensus is stuck due to directly discarding the consensus verification information inconsistent with the current block height is effectively avoided, and the reliability of the blockchain network is improved.
  • an embodiment of the present application further provides a computer device, where the computer device may be a node device, such as the aforementioned target consensus node.
  • FIG. 7 it is a schematic structural diagram of a computer device provided in the implementation of the present application.
  • the computer device shown in FIG. 7 may include at least a processor 701 , an input interface 702 , an output interface 703 , and a computer storage medium 704 .
  • the processor 701, the input interface 702, the output interface 703 and the computer storage medium 704 may be connected by a bus or other means.
  • the computer storage medium 704 can be stored in the memory of the computer device, the computer storage medium 701 is used for storing a computer program, the computer program includes a program computer program, and the processor 701 is used for executing the program stored in the computer storage medium 704.
  • the processor 701 (or called CPU (Central Processing Unit, central processing unit)) is the computing core and the control core of the computer device, which is suitable for implementing a computer program, and is specifically suitable for loading and executing:
  • the target consensus verification information for performing consensus verification on the second block is received, then according to the block attribute information of the second block, determine Whether the target consensus verification information satisfies the cache condition; if the target consensus verification information satisfies the cache condition, the target consensus verification information is stored in the information buffer pool corresponding to the target consensus node; After the consensus verification of one block is completed, consensus verification is performed on the second block based on the target consensus verification information in the information buffer pool.
  • Embodiments of the present application further provide a computer storage medium (Memory), where the computer storage medium is a memory device in a computer device, used to store programs and data.
  • the computer storage medium here may include both the built-in storage medium of the computer device, and certainly also the extended storage medium supported by the computer device.
  • Computer storage media provide storage space in which the operating system of the computer device is stored.
  • computer programs suitable for being loaded and executed by the processor 701 are also stored in the storage space, and these computer programs may be more than one computer program (including program codes).
  • the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory; optionally, it can also be at least one memory located far away from the aforementioned processor. computer storage media.
  • the computer storage medium can be loaded by the processor 701 and execute the computer program stored in the computer storage medium, so as to realize the corresponding steps of the above-mentioned information processing method of the blockchain network shown in FIG. 4 and FIG. 5 .
  • the computer program in the computer storage medium is loaded by the processor 701 and executes the following steps:
  • the target consensus verification information for performing consensus verification on the second block is received, then according to the block attribute information of the second block, determine Whether the target consensus verification information satisfies the cache condition; if the target consensus verification information satisfies the cache condition, the target consensus verification information is stored in the information buffer pool corresponding to the target consensus node; After the consensus verification of one block is completed, consensus verification is performed on the second block based on the target consensus verification information in the information buffer pool.
  • the target is determined according to the block height of the second block. Whether the consensus verification information satisfies the caching conditions; if the consensus verification information satisfies the caching conditions, store the target consensus verification information in the information buffer pool corresponding to the target consensus node; wait for the target consensus node to verify the consensus of the first block Upon completion, the second block is verified based on the target consensus verification information stored in the information buffer pool.
  • an embodiment of the present application further provides a computer product or computer program, where the computer product or computer program includes a computer program, and the computer program is stored in a computer-readable storage medium.
  • the processor 701 reads the computer program from the computer-readable storage medium, and the processor 701 executes the computer program, so that the computer device executes the information processing method of the blockchain network described in FIG. 3, specifically:
  • the target consensus verification information is determined according to the block attribute information of the second block. whether the target consensus verification information satisfies the caching conditions; if the target consensus verification information satisfies the caching conditions, the target consensus verification information is stored in the information buffer pool corresponding to the target consensus node; After the consensus verification of the block is completed, consensus verification is performed on the second block based on the target consensus verification information in the information buffer pool.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Accounting & Taxation (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

本申请实施例公开了一种区块链网络的信息处理方法、装置、设备及存储介质,其中信息处理方法包括:在目标共识节点对第一区块进行共识验证的过程中,若接收到对第二区块进行共识验证的目标共识验证信息,则根据第二区块的区块属性信息,确定目标共识验证信息是否满足缓存条件;如果目标共识验证信息满足缓存条件,则将目标共识验证信息存储至目标共识节点对应的信息缓存池;在对第一区块的共识验证完成后,基于信息缓存池中的目标共识验证信息,对第二区块进行共识验证。

Description

区块链网络的信息处理方法、装置、设备及存储介质
本申请要求于2020年12月8日提交中国专利局、申请号202011420516.3、申请名称为“区块链网络的信息处理方法、装置及节点设备”的中国专利申请的优先权。
技术领域
本申请涉及区块链技术领域,尤其涉及一种区块链网络的信息处理方法、装置、设备及存储介质。
发明背景
目前的区块链网络,尤其是基于拜占庭共识算法的网络,共识节点处理消息的速度都是依赖于本节点资源以及网络传输速度。在整个区块链共识网络资源可能各不相同以及网络资源的差异化,导致各个共识节点处理消息的速度也不尽相同。而且通常情况下,已知的共识节点之间消息传递通常是一次性的以及共识节点处理共识验证消息需要遵循严格的协议规则,比如只处理与自己节点区块高度相同的共识验证消息。以上这些因素都可能导致共识过程卡住,无法对外提供服务。因此,在区块链网络中如何有效地进行共识验证以保证区块链网络的可靠性成为当今研究的热点问题。
发明内容
本申请实施例提供了一种区块链网络的信息处理方法、装置、设备及存储介质,可提高区块链网络的可靠性。
一方面,本申请实施例提供了一种区块链网络的信息处理方法,所述区块链网络包括目标共识节点,所述方法包括:
在所述目标共识节点对第一区块进行共识验证的过程中,若接收到对第二区块进行共识验证的目标共识验证信息,则根据所述第二区块的区块属性信息,确定所述目标共识验证信息是否满足缓存条件;
如果所述目标共识验证信息满足所述缓存条件,则将所述目标共识验证信息存储至所述目标共识节点对应的信息缓存池;
在对所述第一区块的共识验证完成后,基于所述信息缓存池中的目标共识验证信息,对所述第二区块进行共识验证。
一方面,本申请实施例提供了一种区块链网络的信息处理装置,所述装置包括:
接收单元,用于在所述目标共识节点对第一区块进行共识验证的过程中,接收对第二区块进行共识验证的目标共识验证信息;
处理单元,用于根据所述第二区块的区块属性信息,确定所述目标共识验证信息是否满足缓存条件;
存储单元,用于如果所述目标共识验证信息满足所述缓存条件,则将所述目标 共识验证信息存储至所述目标共识节点对应的信息缓存池;
所述处理单元,还用于在对所述第一区块的共识验证完成后,基于所述信息缓存池中的所述目标共识验证信息,对所述第二区块进行共识验证。
一方面,本申请实施例提供了一种计算机设备,其特征在于,包括:处理器,适于实现计算机程序;以及计算机存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序适于由所述处理器加载并执行上述区块链网络的信息处理方法。
一方面,本申请实施例提供了一种计算机存储介质,其特征在于,所述计算机存储介质中存储有计算机程序,所述计算机程序被处理器执行时,用于执行上述区块链网络的信息处理方法。
一方面,本申请实施例提供了一种计算机程序产品或计算机程序,所述计算机程序产品包括计算机程序,所述计算机程序存储在计算机可读存储介质中;计算机设备的处理器从所述计算机存储介质中读取所述计算机程序,所述处理器执行所述计算机程序,使得所述计算机设备执行上述区块链网络的信息处理方法。
附图简要说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种区块链网络的结构示意图;
图2是本申请实施例提供的另一种区块链的结构示意图;
图3是本申请实施例提供的一种区块链的结构图;
图4是本申请实施例提供的一种区块链网络的信息处理方法的流程示意图;
图5是本申请实施例提供的另一种区块链网络的信息处理方法的流程示意图;
图6是本申请实施例提供的一种区块链网络的信息处理装置的结构示意图;
图7是本申请实施例提供的一种计算机设备的结构示意图。
实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
本申请实施例提供了一种信息处理方案,应用于区块链网络中,在区块链网络中的目标共识节点在对第一区块进行共识验证过程中,如果接收到对第二区块进行验证的目标共识验证信息,则在目标共识验证信息满足缓存条件的情况下,将目标共识验证信息缓存起来。当处理完对第一区块的共识验证,从缓存中取出目标共识验证信息,并基于目标共识验证信息对第二区块进行验证。本申请实施例提出的信息处理方案,能保证在区块链异步网络情况下能持续对外提供区块链网络服务,提高区块链网络的可靠性。
在一个实施例中,所述区块链网络可以理解成一个数据共享系统,该数据共 享系统用于进行节点与节点之间的数据共享。参见图1,为本申请实施例提供的一种区块链网络的结构示意图,100表示区块链网络,区块链网络100中可包括多个节点101,多个节点101可以是接入区块链网络100中的终端设备或者服务器。其中,所述终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表、智能车载等。所述服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN、以及大数据和人工智能平台等基础云计算服务的云服务器。
在一个实施例中,区块链网络100中每个节点101,在进行正常工作时,可以接收输入到区块链网络100中的信息,并基于接收到的输入信息,维护区块链网络内的共享数据。为了保证区块链网络内的信息互通,区块链网络中的每个节点101之间可以存在信息连接,节点中间可以通过上述信息连接进行信息传输。例如,当区块链网络中的任意节点101接收到输入信息时,区块链网络中的其他节点101便根据共识算法获取该输入信息,将该输入信息作为共享数据中的数据进行存储,使得区块链网络中全部节点101上存储的数据均一致。
对于区块链网络中的每个节点101,均具有与其对应的节点标识,而且区块链网络中的每个节点101均可以存储有区块链网络中其他节点101的节点标识,以便后续根据其他节点101的节点标识,维护一个如下表所述的节点标识列表,将节点名称和节点标识对应存储至节点标识列表中。其中,节点标识可以为IP(Internet Protocol,网络之间互联的协议)地址以及其他任一种能够用于标识该节点的信息,表1中仅以IP地址为例进行说明。
表1
节点名称 节点标识
节点1 117.114.151.174
节点2 117.116.189.145
节点N 119.123.789.258
在一个实施例中,区块链网络中包括的节点包括:路由功能以及各种应用。其中,路由功能是区块链网络中的节点应当具备的基本功能,用于支持节点之间的通信,上述多个节点之间可以共享输入到区块链网络中的数据,就是依赖节点的路由功能实现的。
所述应用包括钱包、共享账本、智能合约以及区块链。所述钱包是用于提供进行电子货币的交易的功能;所述共享账本是用于提供数据的存储、查询和修改等操作的功能;所述智能合约是计算机化的协议,可以执行某个合约的条款,通 过部署在共享账本上的用于满足一定条件时而执行的代码实现,例如,查询买家所购买商品的物流状态,在买家签收货物后,将买家的电子货币转移到商户的地址;所述区块链包括一系列按照产生的时间顺序先后接续的区块。
基于上述区块链中节点具有的功能,按照每个节点101具有的功能不同,区块链网络100中多个节点101可以分为以下几种:轻节点、路由节点、共识节点以及全节点。其中,轻节点是指具有钱包、路由功能以及区块链的节点,路由节点是指仅具有路由功能和区块链的节点,共识节点是指具有共识功能、路由功能以及区块链的节点。全节点是指具有钱包功能、路由功能、共识功能、区块链及智能合约功能的节点。应当理解的,当全节点具有共识功能时,全节点也可以是共识节点。本申请实施例中上述信息处理方案可以由目标共识节点执行,所述目标共识节点是指区块链网络中包括的多个共识节点中的任意一个。
基于上述描述,本申请实施例提供了另一种区块链网络的结构示意图,参见图2所示。在图2中示出了各个节点具有的功能,比如全节点102具有路由功能和全部应用功能;再如,轻节点103具有钱包、路由功能以及存储有区块链。
由上述图2可知,区块链网络中的每个节点中均存储一条相同的区块链。区块链由多个区块组成,参见图3,为本申请实施例提供的一种区块链的结构示意图。图3所示的区块链中可以包括多个区块,每个区块中包括本区块的哈希值,以及前一个区块的哈希值,各个区块通过哈希值进行连接形成区块链。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了相关的信息,用于验证其信息的有效性(防伪)和生成下一个区块。
在一个实施例中,区块链上的每个区块在被添加到区块链上之前,都需要共识节点对其进行共识验证,共识验证通过后的区块才可被添加到区块链上。可选的,区块链网络中运行有一个共识算法,各个共识节点基于区块链网络中运行的共识算法对区块进行共识验证。
不失一般性,以拜占庭共识算法为例,占庭共识算法对区块验证的一个完整过程,可以包括:区块提案阶段、预投票阶段、预提交阶段。这三个阶段状态的流转是通过提案信息、预投票信息以及预提交信息等共识验证信息驱动的。
具体来讲,任一共识节点从区块提案阶段到预投票阶段有两种触发条件,一种是在预设时间内收到提案信息;另一种是超过预设时间还未收到提案信息。
当处于所述区块提案阶段时,若在预设时间内接收到对所述第一区块进行提案的提案信息,则进入所述预投票阶段;进入到预投票阶段后,任一共识节点对接收到的提案信息进行投票,生成预投票信息,并将预投票信息广播给其他共识节点;如果任一共识节点在预投票阶段,接收到来自其他共识节点的预投票信息的数量满足第一数量阈值,则进入到预提交阶段;当处于所述预提交阶段时,若所述任一节点接收到来自其他共识节点的预提交信息的数量满足第二数量阈值,则确定对该区块的验证完成。
可选的,第一数量阈值和第二数量阈值均可以指共识节点总数量的2/3。在预投票阶段,如果任一共识节点接收到来自其他共识节点的预投票消息的数量不满足第一数量阈值,则该共识节点可以一直等待,或者采用超时的方法,进入到预提交阶段。本申请实施例中,假设任一共识节点会一直等待足够数量的预投票信息,才会进入到预提交阶段。
同理的,当在预提交阶段,如果任一共识节点接收到来自其他共识节点的预提交信息的数量不满足第二数量阈值,则该共识节点可以一直等待,直到接收到足够数量的预提交信息,或者进入超时处理。本申请实施例中,假设任一共识节点会一直等待足够数量的预提交信息,以完成对区块的共识验证。
区块链网络中多个共识节点在上述三个阶段的流转速度都是异步的,速度也不尽相同,特别是在提案新区块时,大概率存在部分共识节点已经完成了上述三个阶段,进入对新区块的共识验证过程,还有部分节点仍在继续处理上个区块的共识验证逻辑。
已经对新区块进行共识验证的节点会广播对新区块的共识验证信息,而继续处理上个区块共识验证逻辑的共识节点在接收到新区块的共识验证信息时,会认为该共识验证信息与自己当前的共识验证过程不匹配,丢弃对新区块的共识验证信息。
当共识节点对上个区块的共识验证完成后,也进入新区块的共识验证过程,但是,由于该共识节点已将对新区块共识验证的共识验证信息丢弃,并且共识节点之间消息传递通常是一次性的,基于拜占庭共识算法要求存在整个共识网络,因为,需要等待足够多的共识验证信息,而导致共识验证卡住。
基于此考虑,本申请实施例提出了上述区块链网络中的信息处理方案,当区块链网络中的任一共识节点在对第一区块进行共识验证过程中,如果接收到对第二区块进行验证的目标共识验证信息,则在目标共识验证信息满足缓存条件的情况下,将目标共识验证信息缓存起来。当处理完对第一区块的共识验证,从缓存中取出目标共识验证信息,并基于目标共识验证信息对第二区块进行验证。本申请实施例提出的信息处理方案,能保证在区块链异步网络情况下能持续对外提供区块链网络服务,提高区块链网络的可靠性。
基于上述区块链网络的信息处理方案,本申请实施例提供了一种区块链网络的信息处理方法,参见图4为本申请实施例提供的一种区块链网络的信息处理方法的流程示意图。图4所示的信息处理方法由计算机设备执行,例如,由目标共识节点执行,所述目标共识节点是区块链网络包括的多个共识节点中任意一个,例如图1中作为共识节点的节点101。图4所示的信息处理方法可包括如下步骤:
步骤S401、在目标共识节点对第一区块进行共识验证的过程中,若接收到对第二区块进行共识验证的目标共识验证信息,则根据第二区块的区块属性信 息,确定目标共识验证信息是否满足缓存条件。
由前述可知,任一共识节点对任一区块的验证均包括区块提案阶段、预投票阶段以及预提交阶段,目标共识节点对第一区块的共识验证也不例外。具体地,所述目标共识节点对第一区块进行共识验证的过程可以包括区块提案阶段、预投票阶段以及预提交阶段。
当处于所述区块提案阶段时,若在预设时间内接收到对所述第一区块进行提案的提案信息,则进入所述预投票阶段,所述目标节点针对所述提案信息进行投票处理,得到预投票信息,并将所述预投票信息广播至其他共识节点;当处于所述预投票阶段时,若所述目标共识节点接收到来自其他共识节点的预投票信息的数量满足第一数量阈值,则进入所述预提交节点;当处于所述预提交阶段时,若所述目标共识接收到来自所述其他共识节点的预提交信息满足第二数量阈值,则确定所述第一区块的共识验证完成。
可选的,步骤S401中所述的对第一区块进行共识验证的过程可以是指上述的提案阶段、预投票阶段以及预提交阶段中任意一个。
在目标共识节点对第一区块进行共识验证的过程中,如果接收到对第二区块进行共识验证的目标共识验证信息,不是直接将目标共识验证信息丢弃,而是根据第二区块的区块属性信息,确定目标共识验证信息是否满足缓存条件;当目标共识节点满足缓存条件时,则通过步骤S402将目标共识验证信息存储在目标共识节点对应的信息缓存池中。
在一个实施例中,所述第二区块的区块属性信息可以包括第二区块的区块高度,则所述根据第二区块的区块属性信息确定所述目标共识验证信息是否满足缓存条件,包括:确定所述第二区块的区块高度与所述第一区块的区块高度之间的高度差;若所述高度差小于或等于高度差阈值,则确定所述目标共识验证信息满足缓存条件。
其中,所述高度差阈值可以是目标共识节点根据当前区块链网络的传输速度以及目标共识节点资源情况确定的;高度差阈值用于表示在当前网络传输速度以及目标共识节点资源情况下,目标共识节点落后高度差阈值个区块的共识验证过程是可以追赶上的。
因此,当第二区块的区块高度和第一区块的区块高度之间的高度差小于或等于高度差阈值时,可以不必丢弃对第二区块进行共识验证的目标共识验证信息,只需将目标共识验证信息存储起来,等待对第一区块与验证完成后,便会依次对存储的目标共识验证信息进行验证。
由前述可知,对任一区块进行共识验证过程产生的共识验证信息可以包括区块提案信息、预投票信息以及预提交信息,同样的,目标共识节点接收到对第二区块进行共识验证的目标共识验证信息,可以包括对第二区块进行提案的目标提案信息、目标预投票信息以及目标预提交信息中任意一个或多个。
应当理解的,区块链网络中每个共识节点都有进行区块提案的权利,但是并 不是每个共识节点提案的区块会通过共识验证。如果一个共识节点提案的区块未通过共识验证,则换共识节点集合(被称为共识治理委员会)中的下一个共识节点继续对该区块进行提案,各个共识节点依次轮流对该区块进行提案。
假设以第二区块为例,如果第二区块是第一次被提案,提案第二区块的共识节点可以为第一共识节点,此时第二区块对应的共识视图标识为n,n可以为任意整数;如果在对第二区块的共识验证未通过,则第二区块需要被不同于第一共识节点的第二共识节点继续提案,此时第二区块对应的共识视图标识为n+1。
基于上述描述,第二区块的区块属性信息除了包括第二区块的区块高度,还可以包括第二区块对应的共识视图标识;根据所述第二区块的区块属性信息,确定所述目标共识验证信息是否满足缓存条件,包括:若所述第二区块的区块高度与所述第一区块的区块高度相同,且所述目标共识验证信息为目标提案信息,则获取所述第二区块对应的共识视图标识和所述第一区块对应的共识视图标识之间的共识视图差值;如果所述共识视图差值小于或等于共识视图差阈值,则确定所述目标提案信息满足所述缓存条件。由前述可知,所述目标提案信息是指在对所述第二区块进行共识验证的区块提案阶段产生的、对所述第二区块进行提案的提案信息。
总结而言,本申请实施例中,如果第二区块的区块高度与第一区块的区块高度之间的高度差小于或等于高度差阈值,则无论目标共识验证信息是目标提案信息、目标预投票信息还是目标预提交信息,都将目标共识验证信息存储起来;但是,如果第二区块的区块高度与第一区块的区块高度相同,则当目标共识验证信息为目标提案信息时,且第一区块的共识视图标识和第二区块的共识视图标识之间的共识视图差值小于或等于共识视图差阈值时,也可以存储;如果是目标预投票信息或者目标预提交信息,则不需要存储。
步骤S402、如果目标共识验证信息满足缓存条件,则将目标共识验证信息存储至目标共识节点对应的信息缓存池。
在一个实施例中,本申请实施例为了提高区块链网络的可靠性,以及避免对区块的共识过程卡住,可以针对每个共识节点引入一个信息缓存池,每个共识节点对应的信息缓存池可以是一个信息缓存组件。在确定出对第二区块进行共识验证的目标共识验证信息满足缓存条件的情况下,目标共识节点将目标共识验证信息存储至目标共识节点对应的信息缓存池中。
在一个实施例中,将目标共识验证信息存储至目标共识节点对应的信息缓存池的实施方式可以是:将目标共识验证信息、第二区块的区块高度以及第二区块的共识视图标识进行关系存储,如此方便后续基于目标共识验证信息对第二区块进行共识验证。假设第二区块的区块高度为3,第二区块的共识视图标识为1,则信息缓存池中目标共识验证信息的存储方式可以是:区块高度3—共识视图标识1—目标提案信息;再如区块高度3—共识视图标识1—目标预投票信息。
在一个实施例中,目标共识节点将目标共识验证信息存储到目标共识节点 对应的信息缓存池是通过信息写入组件实现的。其中,所述信息写入组件可以包括提案信息写入组件、预投票信息写入组件以及预提交信息写入组件中任意一个。
具体实现中,如果目标共识验证信息是目标提案信息,则目标共识节点可以通过提案信息写入组件,将目标共识验证信息存储到目标共识节点对应的信息缓存池中;如果目标共识验证信息是目标预投票信息,则目标共识节点可以通过预投票信息写入组件,将目标共识验证信息存储到目标共识节点对应的信息缓存池中;如果目标共识验证信息是目标预提交信息,则目标共识节点可以通过预提交信息写入组件,将目标共识验证信息存储到目标共识节点对应的信息缓存池中。
步骤S403、在对第一区块的共识验证完成后,基于信息缓存池中的目标共识验证信息,对第二区块进行共识验证。
在一个实施例中,如果目标共识节点对第一区块的共识验证完成后,可以从信息缓存池中取出目标共识验证信息。应当理解的,第二区块的数量可以为一个或多个,那么目标共识验证信息的数量也可以是一个或多个。目标共识节点基于信息缓存池中取出的目标共识验证信息,对第二区块进行共识验证的实施方式可以包括:
确定多个第二区块中区块高度最小的目标第二区块;并获取所述目标第二区块对应的目标共识验证信息;如果所述目标共识验证信息为目标提案信息,则针对该目标提案信息进行投票处理生成一个预投票信息,并将预投票信息广播给其他共识节点;如果目标共识验证信息为目标预投票信息,则统计目标预投票信息的数量是否满足第一数量阈值,如果不满足,则继续等待目标预投票信息;如果满足,则会生成一个预提交信息,并将生成的预提交信息广播给共识网络中的其他共识节点;如果目标共识验证信息为目标预提交信息,则统计接收到的目标预提交信息的数量是否满足第二数量阈值,如果不满足,则继续等待目标预提交信息,如果满足,则确定对目标第二区块验证通过,将目标第二区块添加到区块链上。
在一个实施例中,为了及时释放信息缓存池中的存储空间,目标共识节点基于目标共识验证信息对第二区块进行共识验证后,可以将目标共识验证信息从所述目标共识节点对应的信息缓存池中删除。
本申请实施例中,在目标共识节点对第一区块进行共识验证过程中,若接收到对第二区块进行共识验证的目标共识验证信息,则根据第二区块的区块高度判断目标共识验证信息是否满足缓存条件;在所述共识验证信息满足缓存条件的情况下,将目标共识验证信息存储至目标共识节点对应的信息缓存池中;等待目标共识节点对第一区块的共识验证完成时,基于存储在信息缓存池中的目标共识验证信息对第二区块进行验证。上述信息处理方法中,在对当前区块共识验证的过程中,当接受到对新的区块的共识验证信息时,不是直接丢弃而是在该共 识验证信息满足缓存条件的情况下,存储该共识验证信息,以便于对当前区块验证结束后,基于存储的共识验证信息对新的区块进行验证。如此一来,有效避免了由于直接丢弃与当前区块高度不相符的共识验证信息,而导致共识卡住的情况,提高了区块链网络的可靠性。
基于上述的信息处理方法,本申请实施例还提供了另一种区块链网络中的信息处理方法。参见图5,为本申请实施例提供的另一种区块链网络的信息处理方法的流程示意图,图5所示的信息处理方法可由目标共识节点执行,所述目标共识节点属于共识节点集合中的成员节点,例如图1中作为共识节点的节点101。所述信息处理方法可包括如下步骤:
步骤S501、在目标共识节点对第一区块进行共识验证的过程中,若接收到对第二区块进行共识验证的目标共识验证信息,则确定目标共识节点对应的信息缓存池的信息存储功能是否开启。
在一个实施例中,考虑到区块链网络中对区块共识验证的效率以及区块链网络中存储账本同步功能,可以限制目标共识节点的信息缓存池中缓存信息的范围,比如限制目标共识节点的信息缓存池中最多只能缓存预设数量个区块的共识验证信息。
基于此,如果目标共识节点中已经存储了预设数量个区块的共识验证信息,则目标共识节点可以暂时关闭信息缓存池的信息存储功能,当信息存储功能关闭时,目标共识节点不能向信息缓存池中存储共识验证信息,此时目标共识节点如果接收到对新的区块的共识验证信息,只能丢弃;随着目标共识节点根据缓存池中存储的共识验证信息对相应区块进行验证完成后,信息缓存池的一部分存储空间被释放,则此时可以开启信息缓存池的信息存储功能。
步骤S502、如果信息缓存池的信息存储功能开启,则根据第二区块的区块属性信息,确定目标共识验证信息是否满足缓存条件。
应当理解的,判断信息缓存池的信息存储功能是否开启所需要的功耗开销,小于确定目标共识验证信息是否满足缓存条件所需的功耗开销,因此,为了节省目标共识节点的功耗开销,在确定目标共识验证信息是否满足缓存条件之前,需要先判断信息缓存池的信息存储功能是否开启;如果开启,则表明目标共识验证信息若满足缓存条件的话,可以被存储在信息缓存池中,因此需要进一步判断目标共识验证信息是否满足缓存条件;如果信息存储功能关闭,则表明即使目标共识验证信息满足缓存条件,也不会存储在信息缓存池中,那么目标共识节点则不必浪费多余的功耗开销去检测了。
步骤S503、如果目标共识验证信息满足缓存条件,则将目标共识验证信息存储至目标共识节点对应的信息缓存池中。
在一个实施例中,步骤S503中包括的一些可行的实施方式可参见图4实施例中相关步骤的具体描述,在此不再赘述。
步骤S504、在对第一区块的共识验证完成后,若检测到共识节点集合中的成员节点发生切换,则判断目标共识节点是否属于切换后的共识节点集合中的成员节点。
步骤S505、如果是,则基于目标共识验证信息,对第二区块进行共识验证。
由前述可知,在对第一区块进行共识验证时,目标共识节点属于共识节点集合中的成员节点,也就是说目标共识节点具有对区块进行共识验证的权利;考虑到在对第一区块进行共识验证完成后,共识节点集合中的成员节点可能会发生变化,目标共识节点有可能不属于变化后的共识节点集合中的成员节点,此时目标共识节点不能对第二区块进行共识验证。或者说,目标共识节点对第二区块的共识验证是无效的。
基于此,为了节省目标共识节点的非必要功耗开销,在步骤S504中对第一区块的共识验证完成后,若检测到共识节点集合中的成员节点发生切换,则判断目标共识节点是否属于切换后的共识节点集合中的成员节点;如果目标共识节点属于切换后的共识节点集合中的成员节点,则执行步骤S505,即根据信息缓存池中存储的目标共识验证信息对第二区块进行共识验证;如果目标共识节点不属于切换后的共识节点集合中的成员节点,则删除所述信息缓存吃中存储的目标共识验证信息。进一步的,可以向他共识节点发送区块同步请求,以指示所述其他共识节点将验证完成后的第二区块同步给所述目标共识节点。
在一个实施例中,目标共识节点将目标共识验证信息存储至所述目标共识节点对应的信息缓存池中后,可以检测当前信息缓存池中是否已存储了预设数量个区块的共识验证信息;如果是,则为了避免目标共识节点处堆积了多个待验证区块的消息,而导致区块验证效率降低,可以关闭所述目标共识节点对应的信息缓存池的信息存储功能。
在信息缓存池的信息存储功能关闭后,如果接收到第三区块的共识验证信息,则可以直接将第三区块的共识验证信息丢弃。
在一个实施例中,当目标共识节点根据目标共识验证信息对第二区块的共识验证完成后,可以通过区块链网络中的账本同步模块追赶第三区块。具体来讲,可以开启所述信息缓存池的信息存储功能,并从其他共识节点同步共识验证完成的第三区块,即向其他共识节点发送区块同步请求,以指示其他共识节点将验证完成后的第三区块发送给目标共识节点。
本申请实施例中,在目标节点对第一区块进行共识验证过程中,若接收到对第二区块进行共识验证的目标共识验证信息,则判断目标共识节点对应的信息缓存池的信息存储功能是否开启;在信息缓存池的信息存储功能开启的情况下,进一步判断目标共识验证信息是否满足缓存条件,并在目标共识验证信息满足缓存条件的情况下,将目标共识验证信息存储在信息缓存池中。如此一来,可以节省目标共识节点不必要的开销。
接着,在目标共识节点对第一区块的共识验证完成后,可以根据信息缓存池 中存储的目标共识验证信息对第二区块进行共识验证。但是考虑到在对第一区块的共识验证完成后,共识节点集合中的成员节点可能发生变化,目标共识节点可能不再属于共识节点集合,如果目标共识节点不再属于共识节点集合,则无需再对第二区块进行共识验证。基于此,为了节省目标共识节点的功耗开销,以及提高区块验证的有效性,目标共识节点在根据目标验证信息对第二区块进行共识验证之前,先判断共识节点集合中的成员节点是否发生切换,若发生切换,目标共识节点是否属于切换后的共识节点集合中的成员节点。如果是,目标共识节点再执行根据目标共识验证信息对第二区块进行共识验证的步骤。
基于上述的区块链网络的信息处理方法,本申请实施例提供了一种区块链网络的信息处理装置。参见图6,为本申请实施例提供的一种区块链网络的信息处理装置的结构示意图。图6所示的信息处理装置可以是运行于计算机设备中的一个计算机程序(包括程序代码),例如该信息处理装置为一个应用软件;图6所示的信息处理装置也可以是一个硬件装置。图6所示的信息处理装置可用于执行图4和图5所示的区块链网络中的信息处理方法。图6所示的信息处理装置可运行如下单元:
接收单元601,用于在所述目标共识节点对第一区块进行共识验证的过程中,接收对第二区块进行共识验证的目标共识验证信息;
处理单元602,用于根据所述第二区块的区块属性信息,确定所述目标共识验证信息是否满足缓存条件;
存储单元603,用于如果所述目标共识验证信息满足所述缓存条件,则将所述目标共识验证信息存储至所述目标共识节点对应的信息缓存池;
所述处理单元602,还用于在对所述第一区块的共识验证完成后,基于所述信息缓存池中的目标共识验证信息,对所述第二区块进行共识验证。
在一个实施例中,所述共识验证包括区块提案阶段、预投票阶段以及预提交阶段;所述目标共识节点对所述第一区块进行共识验证包括:
当处于所述区块提案阶段时,若在预设时间内接收到对所述第一区块进行提案的提案信息,则进入所述预投票阶段,所述目标共识节点针对所述提案信息进行投票处理,得到预投票信息,并将所述预投票信息广播至所述区块链网络中的其他共识节点;
当处于所述预投票阶段时,若所述目标共识节点接收到来自所述其他共识节点的预投票信息的数量满足第一数量阈值,则进入所述预提交阶段;
当处于所述预提交阶段时,若所述目标共识节点接收到来自所述其他共识节点的预提交信息的数量满足第二数量阈值,则确定对所述第一区块的共识验证完成。
在一个实施例中,所述第二区块的区块属性信息包括第二区块的区块高度,所述处理单元602在根据所述第二区块的区块属性信息确定所述目标共识验证 信息是否满足缓存条件时,执行如下步骤:
确定所述第二区块的区块高度与所述第一区块的区块高度之间的高度差;若所述高度差小于或等于高度差阈值,则确定所述目标共识验证信息满足缓存条件。
在一个实施例中,所述第二区块的区块属性信息包括所述第二区块的区块高度以及所述第二区块对应的共识视图标识,所述处理单元602在根据所述第二区块的区块属性信息确定所述目标共识验证信息是否满足缓存条件时,执行如下步骤:
若所述第二区块的区块高度与所述第一区块的区块高度相同,且所述目标共识验证信息为目标提案信息,则获取所述第二区块对应的共识视图标识和所述第一区块对应的共识视图标识之间的共识视图差值,所述目标提案信息是指在对所述第二区块进行共识验证的区块提案阶段产生的、对所述第二区块进行提案的提案信息;如果所述共识视图差值小于或等于共识视图差阈值,则确定所述目标提案信息满足所述缓存条件。
在一个实施例中,所述目标共识节点在对所述第一区块进行共识验证的过程中,所述目标共识节点属于共识节点集合中的成员节点;所述处理单元602在对所述第一区块的共识验证完成后,基于所述信息缓存池中的所述目标共识验证信息对所述第二区块进行共识验证时,执行如下步骤:
在对所述第一区块的共识验证完成后,若检测到所述共识节点集合中的成员节点发生切换,则判断所述目标共识节点是否属于切换后的共识节点集合中的成员节点;如果是,则基于所述信息缓存池中的所述目标共识验证信息,对所述第二区块进行共识验证。
在一个实施例中,所述区块链网络还包括其他共识节点;所述信息处理装置还包括发送单元604;所述处理单元602还用于:如果所述目标共识节点不属于切换后的共识节点集合中的成员节点,则删除所述信息缓存池中存储的所述目标共识验证信息;所述发送单元604,用于向所述其他共识节点发送区块同步请求,以指示所述其他共识节点将共识验证完成后的第二区块同步给所述目标共识节点。
在一个实施例中,所述处理单元602在根据所述第二区块的区块属性信息确定所述目标共识验证信息是否满足缓存条件时,执行如下步骤:
确定所述目标共识节点对应的信息缓存池的信息存储功能是否开启;若所述信息缓存池的信息存储功能开启,则根据所述第二区块的区块属性信息,确定所述目标共识验证信息是否满足所述缓存条件。
在一个实施例中,将所述目标共识验证信息存储至所述目标共识节点对应的信息缓存池后,所述处理单元602还用于:若所述信息缓存池中已存储了预设数量个区块的共识验证信息,则关闭所述信息缓存池的信息存储功能;当接收到第三区块的共识验证信息时,丢弃所述第三区块的共识验证信息。
在一个实施例中,所述处理单元602还用于:若基于所述目标共识验证信息对所述第二区块进行共识验证后,将所述目标共识验证信息从所述信息缓存池中删除。
在一个实施例中,所述处理单元602还用于:开启所述信息缓存池的信息存储功能,并从其他共识节点同步共识验证完成的第三区块。
根据本申请的一个实施例,图4和图5所示的信息处理方法所涉及各个步骤可以是由图6所示的信息处理装置中的各个单元来执行的。例如,图4所述的步骤S401可由图6所示的信息处理装置中的接收单元601和处理单元602来执行,步骤S402可由图6所示的信息处理装置中的存储单元603来执行,步骤S40可由图6所示的信息处理装置中的处理单元602来执行;再如,图5所示的步骤S501可由图6所示的信息处理装置中的接收单元601和处理单元602来执行,步骤S502可由图6所示的信息处理装置中的处理单元602来执行,步骤S503可由图6所示的信息处理装置中的存储单元603来执行,步骤S504和步骤S505可由图6所示的信息处理装置中处理单元602来执行。
根据本申请的另一个实施例,图6所示的信息处理装置中的各个单元可以分别或全部合并为一个或若干个另外的单元来构成,或者其中的某个(些)单元还可以再拆分为功能上更小的多个单元来构成,这可以实现同样的操作,而不影响本申请的实施例的技术效果的实现。上述单元是基于逻辑功能划分的,在实际应用中,一个单元的功能也可以由多个单元来实现,或者多个单元的功能由一个单元实现。在本申请的其它实施例中,基于信息处理装置也可以包括其它单元,在实际应用中,这些功能也可以由其它单元协助实现,并且可以由多个单元协作实现。
根据本申请的另一个实施例,可以通过在包括中央处理单元(CPU)、随机存取存储介质(RAM)、只读存储介质(ROM)等处理元件和存储元件的例如计算机的通用计算设备上运行能够执行如图4和图5所示的相应方法所涉及的各步骤的计算机程序(包括程序代码),来构造如图6中所示的信息处理装置,以及来实现本申请实施例信息处理方法。所述计算机程序可以记载于例如计算机可读存储介质上,并通过计算机可读存储介质装载于上述计算设备中,并在其中运行。
本申请实施例中,在目标共识节点对第一区块进行共识验证过程中,若接收到对第二区块进行共识验证的目标共识验证信息,则根据第二区块的区块高度判断目标共识验证信息是否满足缓存条件;在所述共识验证信息满足缓存条件的情况下,将目标共识验证信息存储至目标共识节点对应的信息缓存池中;等待目标共识节点对第一区块的共识验证完成时,基于存储在信息缓存池中的目标共识验证信息对第二区块进行验证。上述信息处理方法中,在对当前区块共识验证的过程中,当接受到对新的区块的共识验证信息时,不是直接丢弃=而是在该共识验证信息满足缓存条件的情况下,存储该共识验证信息,以便于对当前区块 验证结束后,基于存储的共识验证信息对新的区块进行验证。如此一来,有效避免了由于直接丢弃与当前区块高度不相符的共识验证信息,而导致共识卡住的情况,提高了区块链网络的可靠性。
基于上述的方法实施例以及装置实施例,本申请实施例还提供了一种计算机设备,该计算机设备可以是节点设备,例如前述的目标共识节点。参见图7,为本申请实施提供的一种计算机设备的结构示意图。图7所示的计算机设备可至少包括处理器701、输入接口702、输出接口703以及计算机存储介质704。其中,处理器701、输入接口702、输出接口703以及计算机存储介质704可通过总线或其他方式连接。
计算机存储介质704可以存储在计算机设备的存储器中,所述计算机存储介质701用于存储计算机程序,所述计算机程序包括程序计算机程序,所述处理器701用于执行所述计算机存储介质704存储的程序计算机程序。处理器701(或称CPU(Central Processing Unit,中央处理器))是计算机设备的计算核心以及控制核心,其适于实现计算机程序,具体适于加载并执行:
在所述目标共识节点对第一区块进行共识验证的过程中,若接收到对第二区块进行共识验证的目标共识验证信息,则根据所述第二区块的区块属性信息,确定所述目标共识验证信息是否满足缓存条件;如果所述目标共识验证信息满足所述缓存条件,则将所述目标共识验证信息存储至所述目标共识节点对应的信息缓存池;在对所述第一区块的共识验证完成后,基于所述信息缓存池中的目标共识验证信息,对所述第二区块进行共识验证。
本申请实施例还提供了一种计算机存储介质(Memory),所述计算机存储介质是计算机设备中的记忆设备,用于存放程序和数据。可以理解的是,此处的计算机存储介质既可以包括计算机设备的内置存储介质,当然也可以包括计算机设备所支持的扩展存储介质。计算机存储介质提供存储空间,该存储空间存储了计算机设备的操作系统。并且,在该存储空间中还存放了适于被处理器701加载并执行的计算机程序,这些计算机程序可以是一个以上的计算机程序(包括程序代码)。需要说明的是,此处的计算机存储介质可以是高速RAM存储器,也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器;可选的还可以是至少一个位于远离前述处理器的计算机存储介质。
在一个实施例中,所述计算机存储介质可由处理器701加载并执行计算机存储介质中存放计算机程序,以实现上述有关图4和图5所示的区块链网络的信息处理方法的相应步骤。具体实现中,计算机存储介质中的计算机程序由处理器701加载并执行如下步骤:
在所述目标共识节点对第一区块进行共识验证的过程中,若接收到对第二区块进行共识验证的目标共识验证信息,则根据所述第二区块的区块属性信息,确定所述目标共识验证信息是否满足缓存条件;如果所述目标共识验证信息满 足所述缓存条件,则将所述目标共识验证信息存储至所述目标共识节点对应的信息缓存池;在对所述第一区块的共识验证完成后,基于所述信息缓存池中的所述目标共识验证信息,对所述第二区块进行共识验证。
本申请实施例中,在目标共识节点对第一区块进行共识验证过程中,若接收到对第二区块进行共识验证的目标共识验证信息,则根据第二区块的区块高度判断目标共识验证信息是否满足缓存条件;在所述共识验证信息满足缓存条件的情况下,将目标共识验证信息存储至目标共识节点对应的信息缓存池中;等待目标共识节点对第一区块的共识验证完成时,基于存储在信息缓存池中的目标共识验证信息对第二区块进行验证。上述信息处理方法中,在对当前区块共识验证的过程中,当接受到对新的区块的共识验证信息时,不是直接丢弃而是在该共识验证信息满足缓存条件的情况下,存储该共识验证信息,以便于对当前区块验证结束后,基于存储的共识验证信息对新的区块进行验证。如此一来,有效避免了由于直接丢弃与当前区块高度不相符的共识验证信息,而导致共识卡住的情况,提高了区块链网络的可靠性。
根据本申请的一个方面,本申请实施例还提供了一种计算机产品或计算机程序,该计算机产品或计算机程序包括计算机程序,该计算机程序存储在计算机可读存储介质中。处理器701从计算机可读存储介质中读取该计算机程序,处理器701执行该计算机程序,使得计算机设备执行图3所述的区块链网络的信息处理方法,具体地:
在所述目标共识节点对第一区块进行共识验证过程中,若接收到对第二区块进行共识验证的目标共识验证信息,则根据所述第二区块的区块属性信息,确定所述目标共识验证信息是否满足缓存条件;如果所述目标共识验证信息满足所述缓存条件,则将所述目标共识验证信息存储至所述目标共识节点对应的信息缓存池;在对所述第一区块的共识验证完成后,基于所述信息缓存池中的目标共识验证信息,对所述第二区块进行共识验证。
本领域普通技术人员可以意识到,结合本申请上述各个实施例描述的各示例单元以及算法步骤,能够以电子硬件、计算机软件或者二者结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明书中已经按照功能一般性地描述了各示例的组成以及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。

Claims (16)

  1. 一种区块链网络的信息处理方法,由计算机设备执行,所述区块链网络包括目标共识节点,所述方法包括:
    在所述目标共识节点对第一区块进行共识验证的过程中,若接收到对第二区块进行共识验证的目标共识验证信息,则根据所述第二区块的区块属性信息,确定所述目标共识验证信息是否满足缓存条件;
    如果所述目标共识验证信息满足所述缓存条件,则将所述目标共识验证信息存储至所述目标共识节点对应的信息缓存池;
    在对所述第一区块的共识验证完成后,基于所述信息缓存池中的所述目标共识验证信息,对所述第二区块进行共识验证。
  2. 如权利要求1所述的方法,其中,所述共识验证的过程包括区块提案阶段、预投票阶段以及预提交阶段;所述目标共识节点对所述第一区块进行共识验证,包括:
    当处于所述区块提案阶段时,若在预设时间内接收到对所述第一区块进行提案的提案信息,则进入所述预投票阶段,所述目标共识节点针对所述提案信息进行投票处理,得到预投票信息,并将所述预投票信息广播至所述区块链网络中的其他共识节点;
    当处于所述预投票阶段时,若所述目标共识节点接收到来自所述其他共识节点的预投票信息的数量满足第一数量阈值,则进入所述预提交阶段;
    当处于所述预提交阶段时,若所述目标共识节点接收到来自所述其他共识节点的预提交信息的数量满足第二数量阈值,则确定对所述第一区块的共识验证完成。
  3. 如权利要求1所述的方法,其中,所述第二区块的区块属性信息包括第二区块的区块高度,所述根据所述第二区块的区块属性信息,确定所述目标共识验证信息是否满足缓存条件,包括:
    确定所述第二区块的区块高度与所述第一区块的区块高度之间的高度差;
    若所述高度差小于或等于高度差阈值,则确定所述目标共识验证信息满足缓存条件。
  4. 如权利要求1所述的方法,其中,所述第二区块的区块属性信息包括所述第二区块的区块高度以及所述第二区块对应的共识视图标识,所述根据所述第二区块的区块属性信息,确定所述目标共识验证信息是否满足缓存条件,包括:
    若所述第二区块的区块高度与所述第一区块的区块高度相同,且所述目标共识验证信息为目标提案信息,则获取所述第二区块对应的共识视图标识和所述第一区块对应的共识视图标识之间的共识视图差值,所述目标提案信息是指在对所述第二 区块进行共识验证的区块提案阶段产生的、对所述第二区块进行提案的提案信息;
    如果所述共识视图差值小于或等于共识视图差阈值,则确定所述目标提案信息满足所述缓存条件。
  5. 如权利要求1所述的方法,其中,所述目标共识节点在对所述第一区块进行共识验证的过程中,所述目标共识节点属于共识节点集合中的成员节点;所述在对所述第一区块的共识验证完成后,基于所述信息缓存池中的所述目标共识验证信息,对所述第二区块进行共识验证,包括:
    在对所述第一区块的共识验证完成后,若检测到所述共识节点集合中的成员节点发生切换,则判断所述目标共识节点是否属于切换后的共识节点集合中的成员节点;
    如果是,则基于所述信息缓存池中的所述目标共识验证信息,对所述第二区块进行共识验证。
  6. 如权利要求5所述的方法,其中,所述区块链网络还包括其他共识节点,所述方法还包括:
    如果所述目标共识节点不属于切换后的共识节点集合中的成员节点,则删除所述信息缓存池中存储的所述目标共识验证信息;
    向所述其他共识节点发送区块同步请求,以指示所述其他共识节点将共识验证完成后的第二区块同步给所述目标共识节点。
  7. 如权利要求1所述的方法,其中,所述根据所述第二区块的区块属性信息,确定所述目标共识验证信息是否满足缓存条件,包括:
    确定所述目标共识节点对应的信息缓存池的信息存储功能是否开启;
    若所述信息缓存池的信息存储功能开启,则根据所述第二区块的区块属性信息,确定所述目标共识验证信息是否满足所述缓存条件。
  8. 如权利要求7所述的方法,其中,所述将所述目标共识验证信息存储至所述目标共识节点对应的信息缓存池后,所述方法还包括:
    若所述信息缓存池中已存储了预设数量个区块的共识验证信息,则关闭所述信息缓存池的信息存储功能;
    当接收到第三区块的共识验证信息时,丢弃所述第三区块的共识验证信息。
  9. 如权利要求8所述的方法,其中,所述方法还包括:
    若基于所述目标共识验证信息对所述第二区块进行共识验证后,将所述目标共识验证信息从所述信息缓存池中删除。
  10. 如权利要求9所述的方法,其中,所述基于所述目标共识验证信息对所述第二区块进行共识验证后,所述方法还包括:
    开启所述信息缓存池的信息存储功能,并从其他共识节点同步共识验证完成的第三区块。
  11. 一种区块链网络的信息处理装置,所述区块链网络包括目标共识节点,所述装置包括:
    接收单元,用于在所述目标共识节点对第一区块进行共识验证的过程中,接收对第二区块进行共识验证的目标共识验证信息;
    处理单元,用于根据所述第二区块的区块属性信息,确定所述目标共识验证信息是否满足缓存条件;
    存储单元,用于如果所述目标共识验证信息满足所述缓存条件,则将所述目标共识验证信息存储至所述目标共识节点对应的信息缓存池;
    所述处理单元,还用于在对所述第一区块的共识验证完成后,基于所述信息缓存池中的所述目标共识验证信息,对所述第二区块进行共识验证。
  12. 如权利要求11所述的装置,其中,所述第二区块的区块属性信息包括第二区块的区块高度,所述处理单元用于,确定所述第二区块的区块高度与所述第一区块的区块高度之间的高度差;若所述高度差小于或等于高度差阈值,则确定所述目标共识验证信息满足缓存条件。
  13. 如权利要求11所述的装置,其中,所述第二区块的区块属性信息包括所述第二区块的区块高度以及所述第二区块对应的共识视图标识,所述处理单元用于,若所述第二区块的区块高度与所述第一区块的区块高度相同,且所述目标共识验证信息为目标提案信息,则获取所述第二区块对应的共识视图标识和所述第一区块对应的共识视图标识之间的共识视图差值,所述目标提案信息是指在对所述第二区块进行共识验证的区块提案阶段产生的、对所述第二区块进行提案的提案信息;如果所述共识视图差值小于或等于共识视图差阈值,则确定所述目标提案信息满足所述缓存条件。
  14. 如权利要求11所述的装置,其中,所述目标共识节点在对所述第一区块进行共识验证的过程中,所述目标共识节点属于共识节点集合中的成员节点;所述处理单元用于,在对所述第一区块的共识验证完成后,若检测到所述共识节点集合中的成员节点发生切换,则判断所述目标共识节点是否属于切换后的共识节点集合中的成员节点;如果是,则基于所述信息缓存池中的所述目标共识验证信息,对所述第二区块进行共识验证。
  15. 一种计算机设备,包括:
    处理器,适用于实现计算机程序;以及
    计算机存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序适于由所述处理器加载并执行如权利要求1-10任一项所述的区块链网络的信息处理方法。
  16. 一种非易失性计算机存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序被处理器执行时,用于执行如权利要求1-10任一项所述的区块链网络的信息处理方法。
PCT/CN2021/129944 2020-12-08 2021-11-11 区块链网络的信息处理方法、装置、设备及存储介质 WO2022121612A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21902319.9A EP4198861A4 (en) 2020-12-08 2021-11-11 INFORMATION PROCESSING METHOD AND DEVICE FOR A BLOCKCHAIN NETWORK AND DEVICE AND STORAGE MEDIUM
US17/978,906 US11899652B2 (en) 2020-12-08 2022-11-01 Method and apparatus for processing information of blockchain network, device and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011420516.3 2020-12-08
CN202011420516.3A CN112202933B (zh) 2020-12-08 2020-12-08 区块链网络的信息处理方法、装置及节点设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/978,906 Continuation US11899652B2 (en) 2020-12-08 2022-11-01 Method and apparatus for processing information of blockchain network, device and storage medium

Publications (1)

Publication Number Publication Date
WO2022121612A1 true WO2022121612A1 (zh) 2022-06-16

Family

ID=74033790

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/129944 WO2022121612A1 (zh) 2020-12-08 2021-11-11 区块链网络的信息处理方法、装置、设备及存储介质

Country Status (4)

Country Link
US (1) US11899652B2 (zh)
EP (1) EP4198861A4 (zh)
CN (1) CN112202933B (zh)
WO (1) WO2022121612A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112202933B (zh) 2020-12-08 2021-03-05 腾讯科技(深圳)有限公司 区块链网络的信息处理方法、装置及节点设备
CN113342902B (zh) * 2021-08-09 2021-11-12 腾讯科技(深圳)有限公司 区块链网络的数据处理方法、装置、计算机设备和介质
CN115186035B (zh) * 2022-09-13 2022-11-22 腾讯科技(深圳)有限公司 一种区块处理方法、相关系统及存储介质和服务器

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3563553A1 (en) * 2017-02-24 2019-11-06 NEC Laboratories Europe GmbH Method for signing a new block in a decentralized blockchain consensus network
CN110493148A (zh) * 2019-08-12 2019-11-22 深圳前海微众银行股份有限公司 一种区块处理、区块共识和区块同步方法及装置
CN110708171A (zh) * 2019-12-13 2020-01-17 腾讯科技(深圳)有限公司 区块链共识投票方法、装置、设备以及存储介质
CN111241188A (zh) * 2018-11-29 2020-06-05 北京京东尚科信息技术有限公司 区块链网络中的共识方法、节点及存储介质
CN111506656A (zh) * 2020-04-20 2020-08-07 腾讯科技(深圳)有限公司 区块链系统的共识处理方法、装置及智能设备、存储介质
CN112202933A (zh) * 2020-12-08 2021-01-08 腾讯科技(深圳)有限公司 区块链网络的信息处理方法、装置及节点设备

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10740733B2 (en) * 2017-05-25 2020-08-11 Oracle International Corporaton Sharded permissioned distributed ledgers
CN112804349B (zh) * 2017-07-14 2023-07-04 创新先进技术有限公司 区块链共识网络中处理共识请求的方法、装置和电子设备
US20190303623A1 (en) * 2018-04-02 2019-10-03 Ca, Inc. Promotion smart contracts for software development processes
US11153070B2 (en) * 2018-09-11 2021-10-19 International Business Machines Corporation Access to data broadcast in encrypted form based on blockchain
US11423016B2 (en) * 2019-06-26 2022-08-23 Indian Institute Of Technology Bombay Method for scaling computation in blockchain by delaying transaction execution
US11637687B2 (en) * 2019-12-20 2023-04-25 Intel Corporation Methods and apparatus to determine provenance for data supply chains
CN111061769B (zh) * 2019-12-24 2021-09-10 腾讯科技(深圳)有限公司 一种区块链系统的共识方法及相关设备
CN111654395B (zh) * 2020-06-01 2021-10-26 腾讯科技(深圳)有限公司 投票信息处理方法、装置、设备以及存储介质
CN111382456B (zh) * 2020-06-01 2020-10-23 腾讯科技(深圳)有限公司 提案消息处理方法、装置、设备以及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3563553A1 (en) * 2017-02-24 2019-11-06 NEC Laboratories Europe GmbH Method for signing a new block in a decentralized blockchain consensus network
CN111241188A (zh) * 2018-11-29 2020-06-05 北京京东尚科信息技术有限公司 区块链网络中的共识方法、节点及存储介质
CN110493148A (zh) * 2019-08-12 2019-11-22 深圳前海微众银行股份有限公司 一种区块处理、区块共识和区块同步方法及装置
CN110708171A (zh) * 2019-12-13 2020-01-17 腾讯科技(深圳)有限公司 区块链共识投票方法、装置、设备以及存储介质
CN111506656A (zh) * 2020-04-20 2020-08-07 腾讯科技(深圳)有限公司 区块链系统的共识处理方法、装置及智能设备、存储介质
CN112202933A (zh) * 2020-12-08 2021-01-08 腾讯科技(深圳)有限公司 区块链网络的信息处理方法、装置及节点设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4198861A4 *

Also Published As

Publication number Publication date
US20230066467A1 (en) 2023-03-02
CN112202933A (zh) 2021-01-08
US11899652B2 (en) 2024-02-13
EP4198861A1 (en) 2023-06-21
CN112202933B (zh) 2021-03-05
EP4198861A4 (en) 2024-02-14

Similar Documents

Publication Publication Date Title
WO2022121612A1 (zh) 区块链网络的信息处理方法、装置、设备及存储介质
WO2022188831A1 (zh) 一种基于区块链的区块共识方法以及相关设备
US11388043B2 (en) System and method for data replication using a single master failover protocol
CN107579848B (zh) 实用拜占庭容错共识机制中动态更改共识节点的方法
US20210406279A1 (en) System and method for maintaining a master replica for reads and writes in a data store
US11863624B2 (en) Fast propagation of recent transactions over a blockchain network
US11823178B2 (en) Optimization of high volume transaction performance on a blockchain
US8930312B1 (en) System and method for splitting a replicated data partition
US9489434B1 (en) System and method for replication log branching avoidance using post-failover rejoin
US20230315891A1 (en) Transaction data processing method and apparatus, computer device and storage medium
CN110730204A (zh) 区块链网络中删除节点的方法和区块链系统
WO2019042101A1 (zh) 一种跨链交易方法及装置
CN111241589A (zh) 一种数据库系统、节点和方法
US20230370285A1 (en) Block-chain-based data processing method, computer device, computer-readable storage medium
US20230275771A1 (en) Pre-execution of block chain transaction in parallel during block consensus
CN110597922A (zh) 数据处理方法、装置、终端及存储介质
Vizier et al. ComChain: A blockchain with Byzantine fault‐tolerant reconfiguration
CN116977067A (zh) 基于区块链的数据处理方法、装置、设备及可读存储介质
CN113760519A (zh) 分布式事务处理方法、装置、系统和电子设备
JP2024035121A (ja) ブロック同期方法、ブロックチェーンシステム、デバイス及び記憶媒体
Zhi et al. Data management solutions based on the data distribution service communication model
CN116582549A (zh) 用于多规模区块链网络的通信协议切换方法、介质及设备
CN117874131A (zh) 通行数据的整合方法、装置、电子设备及存储介质
CN115796863A (zh) 区块链系统的共识方法及相关设备
CN117255130A (zh) 一种基于区块链的数据处理方法、装置、设备及介质

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2021902319

Country of ref document: EP

Effective date: 20230315

NENP Non-entry into the national phase

Ref country code: DE