WO2021238514A1 - 基于区块链的数据处理方法、装置、设备及可读存储介质 - Google Patents
基于区块链的数据处理方法、装置、设备及可读存储介质 Download PDFInfo
- Publication number
- WO2021238514A1 WO2021238514A1 PCT/CN2021/088899 CN2021088899W WO2021238514A1 WO 2021238514 A1 WO2021238514 A1 WO 2021238514A1 CN 2021088899 W CN2021088899 W CN 2021088899W WO 2021238514 A1 WO2021238514 A1 WO 2021238514A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- consensus
- accounting
- node
- voting information
- target block
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2379—Updates performed during online database operations; commit processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
- G06F16/1834—Distributed file systems implemented based on peer-to-peer networks, e.g. gnutella
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/389—Keeping log of transactions for guaranteeing non-repudiation of a transaction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3236—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/50—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
Definitions
- This application relates to the field of computer technology, in particular to a blockchain-based data processing method, device, equipment, and readable storage medium.
- Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. It is mainly used to sort data in chronological order and encrypt it into a ledger so that it cannot be tampered with or forged At the same time, data can be verified, stored and updated. Blockchain can also carry out data encryption transmission, node identification and secure access, and it is an advanced distributed infrastructure.
- the process for the transaction data to be written into the ledger can be: the consensus node obtains the transaction data, then packs the transaction data into the block, executes the consensus process on the block, and the transaction will be carried after the consensus is passed.
- the data block is written into the ledger.
- the processing speed of the accounting of different consensus nodes may be different, that is, there are fast or slow, then the consensus node that completes the accounting first will enter the consensus process of the next block first ; Consensus nodes with slower bookkeeping will be slow, and the stored blocks cannot keep up with the consensus nodes with faster bookkeeping.
- the consensus process of the next block is executed, the stored block height may be inconsistent This leads to consensus failure, which affects the consensus success rate.
- a blockchain-based data processing method executed by a first node, which is a computer device, and includes:
- the consensus result of the target block is determined.
- the accounting time window is activated, and the accounting processing of the target block is performed in the accounting time window. , Receiving the first accounting completion message for the target block sent by the second node within the accounting time window;
- the accounting duration window is closed and the consensus business process of the subsequent block of the target block is entered.
- a block chain-based data processing device includes:
- the voting information interaction module is used to send the first consensus voting information for the target block to the second node, and receive the second consensus voting information for the target block sent by the second node;
- the consensus result determination module is used to determine the consensus result of the target block according to the first consensus voting information and the second consensus voting information;
- the accounting processing module is used to start the accounting time window when the consensus result is the consensus passed result, and perform accounting processing on the target block in the accounting time window;
- the accounting completion receiving module is configured to receive the first accounting completion message for the target block sent by the second node within the accounting time window;
- the accounting completion notification module is used to send a second accounting completion message to the second node if the accounting processing of the target block is completed within the accounting time window;
- the window closing module is used to close the accounting time window and enter the consensus business process of the subsequent blocks of the target block if the sum of the total number of the first accounting completion message and the second accounting completion message is greater than or equal to the number threshold .
- a computer device that includes a memory and one or more processors.
- the memory stores computer-readable instructions.
- the one or more processors execute the above-mentioned blockchain-based The steps of the data processing method.
- One or more non-volatile computer-readable storage media storing computer-readable instructions on which are stored computer-readable instructions.
- the computer-readable instructions are executed by one or more processors, one or more processing
- the device executes the steps of the above-mentioned blockchain-based data processing method.
- a computer program product or computer program, the computer program product or computer program includes computer readable instructions, the computer readable instructions are stored in a computer readable storage medium, the processor of the computer device reads the computer readable from the computer readable storage medium Instruction, the processor executes the computer-readable instruction, so that the computer device executes the steps of the above-mentioned blockchain-based data processing method.
- FIG. 1 is a schematic diagram of a network architecture provided by an embodiment of the present application.
- FIG. 2 is a schematic flowchart of a data processing method based on blockchain provided by an embodiment of the present application
- FIG. 3 is a schematic diagram of a billing scenario provided by an embodiment of the present application.
- FIG. 4 is a schematic diagram of a billing scenario provided by an embodiment of the present application.
- FIG. 5 is a schematic diagram of a billing scenario provided by an embodiment of the present application.
- Fig. 6 is a schematic diagram of a billing scenario provided by an embodiment of the present application.
- FIG. 7 is a schematic flowchart of a blockchain-based data processing method provided by an embodiment of the present application.
- FIG. 8 is a schematic structural diagram of a block chain-based data processing device provided by an embodiment of the present application.
- Fig. 9 is a schematic diagram of a computer device provided by an embodiment of the present application.
- Fig. 1 is a schematic diagram of a network architecture provided by an embodiment of the present application.
- Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. It is mainly used to sort data in chronological order and encrypt it into a ledger so that it cannot be tampered with or forged At the same time, data can be verified, stored and updated.
- the blockchain is essentially a decentralized database. Each node in the database stores the same blockchain.
- the blockchain network divides the nodes into core nodes, data nodes, and light nodes.
- the core node is responsible for The consensus of the entire blockchain network means that the core node is the consensus node in the blockchain network.
- the client sends the transaction data to the data node or light node, and then the transaction data is in a baton way among the data nodes or light nodes in the blockchain network.
- the consensus node packs the transaction data into a block and performs a consensus with other consensus nodes.
- the block carrying the transaction data is written into the ledger.
- the system architecture may include a first node cluster 1000 and a second node cluster 100.
- the first node cluster 1000 may include at least two first nodes
- the second node cluster 100 may include at least two second nodes. node.
- the first node cluster 1000 may include a first node 1000a, a first node 1000b, ..., a first node 1000c
- the second node cluster 100 may specifically include a second node 100a, a second node 100b, ..., the second node 100c.
- the first node 1000a, the first node 1000b,..., the first node 1000c, and the second node 100a, the second node 100b,..., the second node 100c are all core nodes (that is, consensus nodes).
- the second node 100a, the second node 100b,..., the second node 100c may be connected to the first node 1000a, the first node 1000b,..., the first node 1000c, respectively, to facilitate the second node
- the data can be exchanged with the first node through the network connection; the second node 100a, the second node 100b,..., the second node 100c are connected to each other so that the second node can exchange data, the first node 1000a, the first node 1000a, the second node 100c
- One node 1000b,..., and the first node 1000c are connected to each other, so that data exchange can be performed between the first nodes. Take the first node 1000a as an example.
- the first node 1000a After receiving the transaction data sent by the data node or light node, the first node 1000a can store the transaction data in a memory pool (such as a transaction pool) and update it for recording input The hash tree of the data; afterwards, the update timestamp is updated to the time when the transaction data is received, and different random numbers are tried to calculate the characteristic value.
- the transaction data can be correspondingly stored to generate the area
- the block header and the main body of the block obtain the newly generated block; subsequently, the first node 1000a can send the newly generated block to its location according to the node identification of other core nodes (ie consensus nodes) in the blockchain network.
- each core node in the blockchain network has a corresponding node identifier, and each core node in the blockchain network can store the node identifiers of other core nodes in the blockchain network for subsequent According to the node identification of other core nodes, broadcast the generated block to other core nodes in the blockchain network, and other core nodes will reach a consensus on the newly generated block, and the newly generated block will be transferred after the consensus is passed. The block is also added to the ledger to which other core nodes belong, so that the transaction data stored on all core nodes in the blockchain network are consistent.
- this application adds a new record The accounting duration window. After the block has passed the consensus, the core node needs to perform accounting processing on the block in the accounting duration window.
- the specific method may be, taking the first node 1000a, the second node 100a, the second node 100b, and the second node 100c as examples, for the consensus of the target block, the first node 1000a, the second node 100a, the second node 100b, and the The second node 100c may broadcast consensus voting information to each other, where the first node 1000a, the second node 100a, and the second node 100b all agree to vote, and the second node 100c has not broadcast the consensus voting information due to network reasons.
- the consensus voting information of 3 consensus nodes are all yes votes, and the number of yes nodes accounts for all nodes The ratio 3/4 of the quantity exceeds the ratio threshold 2/3, the consensus result of the target block can be determined as the consensus passing result, then the first node 1000a, the second node 100a, the second node 100b, and the second node 100c You can start the accounting time window and perform accounting processing on the target block in the accounting time window; in the accounting time window, if a node has completed the accounting processing task for the target block, you can proceed Broadcast to notify other nodes that they have completed the accounting processing of the target block.
- the first node 1000a completes the accounting processing of the target block in the second second, and broadcasts the notification.
- the first node 1000a will wait for the second node 100a and the second node 100a and the second node within the accounting time window.
- the completion notification of the node 100b and the second node 100c are determined.
- the second node 100a completed the accounting processing of the target block and broadcasted the notification.
- the second node 100b completed the target block Block accounting processing and broadcast notification, then in the 3.5s, a total of 3 consensus nodes (the first node 1000a, the second node 100a, the second node 100b) have completed the accounting processing of the target block Among the four consensus nodes of the first node 1000a, the second node 100a, the second node 100b, and the second node 100c, 3 consensus nodes have completed the accounting processing task of the target block.
- Each consensus node in 100a and the second node 100b can be determined that at 3.5s, the proportion of the number of consensus nodes that complete the accounting processing task to the total number of all consensus nodes is 3/4, which exceeds the ratio threshold 2 /3, then in the 3.5s, the first node 1000a, the second node 100a, and the second node 100b will close the accounting time window and enter the subsequent process, that is, no longer wait for the second node 100c to complete the accounting.
- the accounting time window is added, so that the consensus nodes (such as the first node and the second node) are performed within the accounting time window Accounting
- each consensus node can broadcast notifications after the accounting is completed.
- the consensus nodes that perform accounting when the consensus nodes exceeding the number threshold have completed the block accounting, these consensus nodes that have completed the accounting
- the accounting duration window will be closed, and the consensus process of the next block will be entered together. In this way, the consensus node that completes the block accounting first can wait for other consensus nodes to complete the block accounting within the accounting time window, and then enter the consensus process of the next block together.
- the consensus node that enters the consensus process of the next block can store the same block. In this way, when the consensus of the next block is carried out, it can reduce the consensus failure of the consensus node due to the high inconsistency of the block, thereby improving the consensus success rate of the consensus business process.
- each first node in the first node cluster 1000 and each second node in the second node cluster 100 can be cloud servers, and these cloud servers can provide cloud services, cloud databases, cloud computing, Basic cloud computing services such as cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
- the terminal and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in this application.
- Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or a local area network to realize the calculation, storage, processing, and sharing of data.
- Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc., based on the application of cloud computing business models. It can form a resource pool, which can be used as needed, which is flexible and convenient. Cloud computing technology will become an important support.
- the background service of the technical network system requires a large amount of computing and storage resources, such as video websites, image websites and more portal websites.
- each item may have its own identification mark, which needs to be transmitted to the back-end system for logical processing. Data of different levels will be processed separately, and all types of industry data need to be powerful The backing of the system can only be achieved through cloud computing.
- the method provided in the embodiments of the present application can be executed by a computer device, and the computer device includes but is not limited to a terminal or a server.
- the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server.
- the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but it is not limited to this.
- the terminal and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in this application.
- the node in the embodiment of the present application may be a computer device.
- FIG 2 is a schematic flowchart of a blockchain-based data processing method provided by an embodiment of the present application.
- the method is applied to the first node as an example for description.
- the first node is a computer device, and the computer device may be
- the terminal can also be a server.
- the blockchain-based data processing method includes the following steps:
- Step S101 Send the first consensus voting information for the target block to the second node, and receive the second consensus voting information for the target block sent by the second node.
- both the first node and the second node can be the core nodes (consensus nodes) in the blockchain network, which can be responsible for the consensus of the entire blockchain network and write the blocks carrying transaction data to the local ledger .
- the consensus node After the consensus node receives the transaction data, it can package the transaction data into a block and make a consensus with other consensus nodes.
- the other consensus nodes will send their own consensus voting information to each other.
- the consensus voting information includes the consensus voting information ( (Or agree to vote) and reject consensus through voting, then the first consensus voting information and second consensus voting information here may also include agreeing to consensus through voting and rejecting consensus through voting.
- each core node when each core node generates a new block (such as a target block) based on transaction data, it can send the newly generated block to other core nodes in the blockchain network, and Other core nodes verify the newly generated block, that is, the core node in the blockchain network will send consensus voting information for the newly generated block, and notify other core nodes of their verification results , If the verification is passed, the consensus voting information is that the newly generated block passes the consensus; if the verification fails, the consensus voting information is the rejection of the newly generated block to pass the consensus.
- the core node that generates a new block it can be used as a block producing node, and the first node and the second node here can be used as block producing nodes.
- the consensus voting information is in favor of the block passing Consensus.
- Step S102 Determine the consensus result of the target block according to the first consensus voting information and the second consensus voting information.
- the consensus result is the consensus passed result
- start the accounting time window and perform the accounting for the target block in the accounting time window.
- Accounting processing receiving the first accounting completion message for the target block sent by the second node within the accounting duration window.
- determining the consensus result of the target block according to the first consensus voting information and the second consensus voting information includes:
- the second consensus voting information determine the number of second consensus voting information that belongs to the voting information as the first target quantity; if the first consensus voting information belongs to the voting information, then according to the first consensus voting information and the first target quantity, Determine the total number of votes for approval; if the ratio of the total number of votes for approval to the total number of nodes is greater than or equal to the ratio threshold, the consensus result of the target block is determined as the consensus passing result; the total number of nodes is the total of the first node and the second node Quantity; if the ratio of the total number of votes to the total number of nodes is less than the ratio threshold, the consensus result of the target block is determined as the consensus failure result.
- the first node may determine the consensus result of the target block according to the received second consensus voting information sent by the second node.
- the specific determination method can be as follows: the first node can determine the number of second voting information belonging to the approval vote (that is, the approval of the target block through the consensus) in the second consensus voting information, as the first target quantity; If a node approves the consensus of the target block, the total number of votes can be determined according to the first consensus vote and the first target number; if the ratio of the total number of votes to the total number of nodes is greater than or equal to the ratio threshold , The consensus result of the target block can be determined as the consensus passed result; where the total number of nodes is the total number of the first node and the second node; if the ratio of the total number of votes to the total number of nodes is less than With this ratio threshold, the consensus result of the target block can be determined as the consensus failure result.
- the first node and the second node are the core nodes (consensus nodes) in the blockchain network, that is to say, in the blockchain network, there are consensus nodes that exceed or reach the ratio threshold when they agree to the consensus of the target block .
- the consensus result of the target block will be determined as the consensus passed result; in the blockchain network, the core nodes that agree to the target block’s consensus do not exceed the proportion threshold, and the consensus result of the target block will be determined as consensus failure result.
- the ratio threshold may be in the form of numerical values such as decimals, percentages, fractions, etc., for example, the ratio thresholds are 0.67, 2/3, 80%, etc., and no examples are given here.
- the consensus nodes include the first node a, the second node d, the second node b, and the second node c.
- the first consensus voting information of the first node a is the approval vote
- the second The second consensus voting information of node d is the rejection of the consensus vote
- the second consensus voting information of the second node b is approval voting
- the second consensus voting information of the second node c is approval voting.
- the total number of votes for approval is 3, and the ratio of the total number of votes for approval of 3 to the total number of nodes 4 is 3/4.
- the ratio threshold is 2/3. It can be seen that the ratio 3/4 is greater than the ratio threshold 2/3, and the first node a can determine the consensus result of the block a as the consensus passing result.
- the method further includes:
- the total number of votes for the consensus is determined according to the first target number.
- the first node can determine the quantity of the second voting information belonging to the approval vote (that is, the approval of the target block through the consensus) as the first target quantity; if the first node is If the target block is rejected to pass the consensus, the total number of votes for the target block can be determined according to the first target number; if the ratio of the total number of votes for the target block to the total number of nodes is greater than or equal to the ratio threshold, the consensus of the target block can be determined The result is determined to be the consensus approval result; where the total number of nodes is the total number of the first node and the second node; if the ratio of the total number of votes for the node to the total number of the node is less than the ratio threshold, the target area can be The consensus result of the block is determined to be the consensus failure result.
- the consensus result of the target block can be determined as the consensus pass result. Therefore, even if the first node rejects the target block to pass the consensus, as long as there are consensus nodes in the blockchain network that exceed or reach the ratio threshold and all agree to the target block to pass the consensus, the consensus result of the target block is determined to be a consensus Pass the result.
- the accounting time window is activated, and accounting processing is performed on the target block within the accounting time window, including:
- the first node when it is determined that the target block is the consensus approval result, can obtain the number of second consensus voting information, and obtain the number of nodes of the second node, and use the number of nodes of the second node as the second target number ; If the quantity of the second consensus voting information is less than the second target quantity, the first node can start the accounting time window, and perform accounting processing on the target block within the accounting time window.
- the quantity of the second consensus voting information is less than the second target quantity, which means that the first node only received part of the consensus voting information of the second node, and some second nodes may be delayed due to network delays, For reasons such as slow verification speed, the consensus voting information was not sent to the first node in time, and the first node did not receive this part of the consensus voting information of the second node. In this case, the first node will start the accounting period window , And keep accounts in the accounting time window. In other words, when the consensus result of the target block is the consensus passed result, and the first node only receives part of the consensus voting information of the second node, the first node will start the accounting time window, in the accounting time window Perform accounting processing on the target block.
- the consensus nodes include the first node a, the second node d, the second node b, and the second node c.
- the first node a agrees to the consensus of the block b
- the second node d In order to approve the consensus of block b, and the second node b agrees to the consensus of block b, the consensus voting information of the first node a, the second node d, and the second node b are all in favor of voting; and the second node c is because Consensus voting information has not been broadcast due to the network, then for the first node a, the first consensus voting information of the first node a is a vote of approval, and the consensus voting information of the second node d is the second consensus voting information, which is approval Voting; the consensus vote of the second node b is the second consensus voting information.
- the blockchain network there are a total of 3 consensus nodes of the first node a, the second node d, and the second node b.
- favor of voting although the consensus voting information of the second node c has not been received (the first node a has only received part of the consensus voting information of the second node, and the number of second consensus voting information is less than the number of nodes of the second node), but In the received consensus voting information, the ratio 3/4 of the number of nodes in favor of voting (3) to the total number of nodes in the blockchain network (4) has exceeded the ratio threshold 2/3, then the first node a The accounting time window will be activated, and accounting processing will be performed in the accounting time window.
- the first node only receives part of the consensus voting information sent by the second node, and in these part of the second node and the first node, the proportion of votes in favor of the total number of nodes in the blockchain network exceeds If the proportion threshold is exceeded, the first node will no longer control whether the consensus voting information of the remaining second nodes is approved or not, and will directly start the accounting time window, and perform accounting processing on the target block within the accounting time window.
- the first node and the second node When the first node and the second node perform accounting processing within the accounting time window, if a node has completed the consensus on the target block, it can broadcast the accounting completion message to notify other nodes that they have completed the target area. Block accounting processing. Then in the accounting time window, if a second node completes the accounting processing of the target block, the second node will broadcast the notification, and the first node can receive the accounting completion of the second node that completed the accounting information.
- Step S103 If the first node completes the accounting processing of the target block within the accounting time window, then sends a second accounting complete message to the second node.
- the number of second nodes is multiple; if the accounting processing of the target block is completed within the accounting time window, the second accounting completion message is sent to the second node, including:
- the accounting time window receive the third consensus voting information for the target block sent by the remaining second nodes; the remaining second nodes are among multiple second nodes, except for the second node that has sent the second consensus voting information If the accounting processing of the target block is completed within the accounting time window, the number of third consensus voting information is obtained; the number of third consensus voting information is added to the number of second consensus voting information, Obtain the total number of consensus votes; detect the message sending authority of the first node according to the total number of consensus votes and the second target number; when the first node has the message sending authority, send a second accounting completion message to the second node.
- the first node when the first node only receives part of the consensus voting information of the second node, it will enter the accounting time window. When the first node performs accounting processing on the target block in the accounting time window, it still Can continue to receive consensus voting information (third Consensus voting information). That is to say, the remaining second node may not send the consensus voting information in time due to the network or other reasons, and only receive the consensus of the remaining second node when the first node performs accounting processing in the accounting period window Voting information, the first node can determine whether it has the message sending authority to send the accounting completion message according to the third consensus voting information of the remaining second nodes.
- consensus voting information third Consensus voting information
- the specific method can be as follows: if the first node completes the accounting processing of the target block within the accounting time window, the first node can obtain the number of third consensus voting information, and the first node can use the third The number of consensus voting information is added to the number of second consensus voting information to obtain the total number of consensus votes. According to the total number of consensus votes and the second target number, it is determined whether the first node has the right to send messages, and the first node has the message When sending the authority, the first node sends the second accounting complete message to the second node.
- detecting the message sending authority of the first node according to the total number of consensus votes and the second target number includes:
- the first node has the message sending authority; if the total number of consensus votes is equal to the second target number, it is determined that the first node does not have the message sending authority.
- the first node can determine that it has the right to send messages, and the first node can send an accounting completion message to the second node, and broadcast a notification He has completed the block accounting; on the contrary, if the total number of consensus votes is equal to the second target number of the second node, the first node can determine that it does not have the right to send messages, and the first node completes the area within the accounting time window During block accounting, the accounting completion message will not be sent to the second node, and the accounting duration window can be directly closed and entered into the consensus business process of subsequent blocks of the target block.
- the method further includes:
- the accounting duration window is closed, and the consensus business process of the subsequent blocks of the target block is entered.
- the first node can determine that it does not have the right to send messages, and when the first node completes block accounting within the accounting time window, it does not The accounting completion message will be sent to the second node, the accounting duration window can be closed directly, and the consensus business process of subsequent blocks of the target block can be entered. It should be noted that if the total number of consensus votes is equal to the second target number of the second node, the first node can determine that it has received all the consensus voting information of the second node in the accounting period window, and the first node will By default, other nodes in the blockchain network have also received all consensus voting information, and other nodes can maintain a similar accounting speed.
- the first node will cancel the message sending authority. Therefore, because it does not have the message sending authority, the consensus node can no longer give other nodes when the accounting is completed. Send the accounting completion message. This can not only reduce traffic consumption, but also increase the speed of the consensus business process entering the subsequent block. Once the accounting is completed and the full ticket is received, the completion notification is no longer sent, and the accounting duration window is directly closed to enter the subsequent block. Consensus business process.
- the first node can also choose to send the accounting completion message to the second node when the accounting is completed. Therefore, the second node in the accounting time window that has not received all the voting information due to network problems can determine whether it can close the accounting time window according to the accounting completion message sent by the first node.
- the first node when the first node performs accounting processing on the target block in the accounting period window, if the first node only receives part of the consensus voting information sent by the remaining second nodes in the accounting period window, or If the consensus voting information of the remaining second node is not received (the total number of consensus votes is equal to the second target number of the second node), the first node will send the accounting to the second node when the accounting of the target block is completed Complete the message and wait for the node that has not completed the accounting within the accounting time window to perform accounting; if all the remaining consensus voting information sent by the second node is received, that is to say, the first node has received it within the accounting time window
- the consensus voting information of all the second nodes the consensus voting information of all the second nodes (the total number of consensus votes is equal to the second target number of the second node)
- the first node can directly close the accounting when completing the accounting of the target block Time window, no longer waiting for other consensus nodes, and directly enters the process of the next block of the target block
- the first node can determine that the status of each consensus node (such as network status, information synchronization status, etc.) is not much different, and the speed of block accounting can be basically Keep the same, even if you don't wait, you can complete the block accounting in a small time difference, and when you enter the subsequent process together, the stored blocks will also have a small difference.
- the status of each consensus node such as network status, information synchronization status, etc.
- Step S104 If the sum of the total number of the first accounting completion message and the second accounting completion message is greater than or equal to the number threshold, the first node closes the accounting duration window and enters the consensus business process of the subsequent block of the target block .
- the accounting time window if there are nodes exceeding the number threshold, they have completed the accounting processing of the target block (the sum of the total number of the first accounting completion message and the second accounting completion message is greater than or Equal to the number threshold), these nodes that have completed the accounting process can close the accounting time window, that is, jump out of the accounting time window and enter the subsequent process, such as entering the consensus business process of the next block of the target block. It is understandable that in the accounting time window, the node that completed the accounting process first has not received the consensus voting information of all the remaining nodes (in the blockchain network, the node that has not successfully sent the consensus voting information before), It will broadcast to notify itself that the accounting process has been completed, and will wait for other nodes to perform accounting within the accounting time window.
- the number threshold here can be determined according to the total number of nodes in the blockchain network and a given ratio. If the given ratio is 3/5, the number threshold here can be 3/5 of the total number of nodes. That is, when there are more than 3/5 nodes in the blockchain network that complete the accounting, the nodes that can complete the accounting can close the accounting duration window.
- the method further includes:
- consensus nodes in the blockchain network include consensus node A (called the first node), consensus node B, consensus node C, consensus node D, and consensus node E (consensus node B, consensus node C, and consensus node D) And the consensus node E is called the second node).
- consensus node A is for voting
- consensus node B is for voting
- consensus node C is for voting
- consensus node D is for voting
- consensus node E does not send out voting information due to network delays.
- consensus node A receives the voting information of consensus node B, consensus node C, and consensus node D.
- consensus node B, consensus node C, consensus node D, and consensus node E can also determine the consensus result of block a after receiving the voting information of other consensus nodes (not receiving the voting information of consensus node E) For the consensus to pass the result, consensus node B, consensus node C, consensus node D, and consensus node E will also start the accounting time window after confirming that the consensus of block a is passed.
- consensus node A, consensus node B, consensus node C, consensus node D, and consensus node E will all perform accounting processing on block a within the accounting time window, where the accounting time window is 10s.
- consensus node B When entering the 2s in the accounting time window, consensus node B has completed the accounting processing of block a, then consensus node B will broadcast to notify itself that the accounting processing of block a has been completed in the 2s, because In the second second, consensus node B has not received the accounting completion message sent by other nodes, and only consensus node B has completed the accounting processing of block a, then consensus node B will wait for others within the accounting time window Node accounting is completed; in the 3s, consensus node A also completed the accounting processing of block a, consensus node A will also broadcast notifications, in the 3s, consensus node B received the accounting sent by consensus node A After the message is completed, both consensus node B and consensus node A can confirm that two nodes, namely, consensus node A and consensus node B, have completed the accounting processing of block
- consensus node A and consensus node B both receive the accounting completion message of consensus node D in the 4s
- consensus node A and consensus Node B and consensus node D (consensus node D has received the accounting completion message of consensus node A and consensus node B) can confirm that there are 3 nodes in the 4s: consensus node A, consensus node B, and consensus node D Block accounting is completed, and the number of nodes that completed accounting 3 is equal to the number threshold 3.
- Consensus node C and consensus node E that have not completed block accounting can continue to perform accounting within the accounting time window, and when the block accounting is completed and it has been determined that all nodes exceeding the number threshold have completed accounting, Close the accounting time window and enter the consensus business process of the next block of block a; if there are nodes in the consensus node C and consensus node E that have not completed the accounting processing of block a within the accounting time window , If the consensus node E has not completed the block accounting within the accounting time window within 10s, the consensus node E can enter the accounting time window when the accumulated time reaches the accounting time window's time threshold (10s), Close the accounting time window and enter the consensus business process of block b.
- the method further includes:
- the node that completed the accounting process first will wait for other nodes to do the accounting after the broadcast notification, and the node that completed the accounting process has not received the consensus voting information sent by all the remaining nodes. , And other nodes have not completed accounting or have not received the accounting completion message of other nodes, then when the time threshold of the accounting time window is reached, the node will determine that the number of completed nodes is less than the number threshold, then the first Both the first node and the second node (including nodes that have completed accounting and nodes that have not completed accounting) can close the accounting time window when the time threshold is reached, and enter the subsequent process together.
- the blockchain network includes a total of 5 consensus nodes: the first node A, the second node B, the second node C, the second node D, and the second node E.
- the first node A, the second node B, the second node C, the second node D, and the second node E perform accounting processing on block a within the accounting period window, where the period threshold of the accounting period window is 10s.
- the second node B completes the accounting in the 2s
- the first node A completes the accounting in the 3s
- the second node B and the first node A will wait for the second node C, the second node D, and the first node within the accounting time window.
- the second node E keeps accounts.
- the second node C, the second node D, and the second node E have not completed the accounting of block a, and the cumulative time of the second node B and the first node A in the accounting time window has reached 10s ( When the time threshold of the accounting time window is reached), that is, if the accumulated time is equal to the time threshold, the second node B and the first node A will close the accounting time window and enter the consensus business process of the next block of block a . And when the second node C, the second node D, and the second node E reach the time threshold of 10s, they will also close the accounting time window and enter the consensus business process of the next block of block a.
- the blockchain network includes a total of 5 consensus nodes: the first node A, the second node B, the second node C, the second node D, and the second node E.
- the first node A, the second node B, the second node C, and the second node E did not receive the consensus voting information of the second node D (that is, only received the consensus voting information of some consensus nodes, and the approval votes exceeded the threshold) ,
- the first node A, the second node B, the second node C, the second node D, and the second node E will enter the accounting period window, and perform accounting processing on the block a in the accounting period window, where,
- the duration threshold of the accounting duration window is 10s.
- the second node B completes the accounting in the 2s after entering the accounting time window
- the first node A completes the accounting in the 3s
- the second node B and the first node A receive each other's accounting completion message each other
- the second Node B and the first node A will wait for the second node C, the second node D, and the second node E within the accounting time window.
- the second node B and the first node A receive the first The consensus voting information of the second node D, at this time, both the second node B and the first node A have received the consensus voting information sent by all the remaining nodes (the second node D) (that is, they have received all other nodes in the blockchain network).
- the second node B and the first node A will no longer wait for the second node C, the second node D, and the second node E to keep accounts, even if the number of nodes that have completed the block accounting is 2 ( 1 second node B + 1 first node A) is less than the number threshold 3, the second node B and the first node A will still close the accounting duration window and enter the subsequent process such as the consensus of the next block of block a In the business process.
- the second consensus voting information carries the performance parameters of the second node, and the method further includes:
- the accounting duration window is updated according to the performance parameters of the second node to obtain the updated accounting duration window; the duration threshold corresponding to the updated accounting duration window is less than the accounting duration The duration threshold corresponding to the accounting time window; start the updated accounting time window, and perform accounting processing on the target block in the updated accounting time window; if the target block is completed in the updated accounting time window The accounting processing of the target block enters the consensus business process of the subsequent block of the target block.
- the first node can obtain the number of voting information of the second consensus, and obtain the number of nodes of the second node, and the number of nodes of the second node As the second target quantity; if the quantity of the second consensus voting information is equal to the second target quantity, the first node can obtain the performance parameters of the second node carried in the second consensus voting information, according to the performance of the second node Parameters are used to update the accounting time window to obtain the updated accounting time window; the first node can start the updated accounting time window, and book the target block in the updated accounting time window Processing; if the first node completes the accounting processing of the target block within the updated accounting time window, it can enter the consensus business process of the subsequent blocks of the target block.
- the second consensus voting information carries the performance parameters of the second node, and the performance parameters may include network parameters, information transmission speed, etc.
- the quantity of second consensus voting information is equal to the second target quantity, That is to say, the first node has received the consensus voting information of all second nodes in the blockchain network.
- the first node can consider other second nodes The network status of the consensus nodes are all good (because the second node will soon send the voting information, and all the second nodes will soon send it), then the status of each node is good.
- the first node can reduce the duration threshold of the accounting duration window according to the performance parameters of the second node.
- the first node and the second node can perform accounting in a very short accounting time window (such as 1s) when they are in good condition.
- the duration threshold can also be reduced to 0, that is, when the performance parameters are good, the accounting duration window may not be activated.
- the first node has received all the consensus voting information of the second node and the performance parameters of the second node are very good, it can be considered that the accounting speed of the first node and the second node is not much different, and there is no need to exchange each other within the accounting time window. Waiting can also make the stored blocks the same or the difference is small, and the duration threshold of the accounting time window can be reduced, so that the node can not be restricted by the time of the accounting time window, and can quickly enter the subsequent consensus business process.
- the embodiment of this application adds an accounting time window for the consensus node. If the consensus node receives the consensus voting information of the consensus node exceeding the number threshold as a vote, the consensus node will no longer manage the unreceived consensus node. The voting result will enter the accounting time window, and block accounting will be performed in the accounting time window. If the consensus node receives all voting information in the accounting time window, the consensus node will close the accounting time window after the accounting is completed and enter the subsequent process; if the accounting time window still has not received all the voting information, Then the consensus node will wait for other consensus nodes to book after the bookkeeping is completed.
- Consensus nodes can synchronize blocks with small differences in a short period of time through block synchronization, so that when the consensus of the next block is carried out, the consensus nodes can be reduced due to inconsistent block heights.
- the failure of consensus can improve the success rate of consensus for the consensus business process.
- FIG. 3 is a schematic diagram of a billing scenario provided by an embodiment of the present application.
- consensus node A can be the block producer, and consensus node A can be the first node.
- consensus node A will receive other consensus nodes (the consensus in Figure 3) Node B, consensus node C) voting information, consensus node B and consensus node C can both be the second node. Because each consensus node sends information at different speeds, the voting information received by consensus node A is not received at the same time.
- the consensus node counts that among the received voting information, the passing votes have exceeded the threshold or When the threshold is reached, the consensus node can determine that the target block has passed the consensus.
- consensus node A has received the voting information of consensus node B, but has not yet received the voting information of consensus node C, but there are three consensus nodes: consensus node A, consensus node B, and consensus node C , There have been 2 passing votes (consensus node A is the block producer, and the voting information of the block producer is approved). The number of passed votes (2) accounts for 2/3 of the total number of consensus nodes (3). This ratio has been When the expected passing ratio of 2/3 is reached, the consensus node A can determine that the target block has passed the consensus. The consensus node A will no longer manage the voting information of the consensus node C, and will directly start the accounting time window. The target block is accounted for in the duration window.
- consensus node B can also receive the voting information of consensus node A, and consensus node B can also determine that the target block has passed the consensus, then consensus node B will also start the accounting time window, and the accounting period will be checked in the accounting time window.
- the target block is accounted for; in the same way, consensus node C can also receive the voting information of consensus node A and consensus node B, combined with the consensus node’s own voting information, consensus node C can determine that the number of votes passed is 3 votes, then consensus node C can also determine that the target block has passed the consensus, and the consensus node C will also start the accounting time window, and perform accounting processing on the target block within the accounting time window.
- the accounting time window is 6s in total, that is, consensus node A, consensus node B, and consensus node C need to perform accounting processing on the target block within 6s.
- the consensus node A when the consensus node A has completed the accounting of the target block when entering the 2s of the accounting time window, the consensus node A can send the accounting completion message to the consensus node B and the consensus node C to notify I have completed the accounting task of the target block. Because the voting information of consensus node C has not been received, and at the second second of the accounting window, only consensus node A has completed accounting for the target block, consensus node A has not received consensus node B or If the accounting completion message of the consensus node C, the consensus node A will not enter the subsequent process, and will wait for the consensus node B and the consensus node C to perform accounting within the accounting time window.
- the consensus node B when entering the 3s of the accounting time window, the consensus node B has also completed accounting for the target block, and the consensus node B can send an accounting completion message to the consensus node A and the consensus node C to notify The other party has completed the accounting task of the target block. Because in the 3s of the accounting time window, consensus node A received the accounting completion message sent by consensus node B, and consensus node B also received the accounting completion message sent by consensus node A before, then consensus node A and consensus Node B can be determined, only consensus node A and consensus node B, a total of 2 consensus nodes, have completed accounting for the target block. The number of nodes that completed accounting 2 accounts for the ratio of the total number of blockchain network nodes 3 to 2/ 3.
- consensus node A and consensus node B will close the accounting time window and enter the subsequent process.
- Consensus node C which has not completed accounting, will continue to book the target block within the accounting time window, because consensus node C has received all the voting information (including the voting information of consensus node A and the voting of consensus node B Information), no matter whether the consensus node C has received the accounting completion message of the consensus node A or the consensus node B, as long as the consensus node C is completing the accounting, it can close the accounting time window and enter the subsequent process.
- the consensus node that completes block accounting first (such as consensus node A) can wait for other consensus nodes to perform block accounting until it exceeds or reaches the specified ratio (such as 2/ 3)
- the consensus nodes that have completed the block accounting will close the accounting duration window and enter the consensus process of the next block together. Because the consensus node with fast accounting speed waits for the consensus node with slow accounting speed to perform accounting, it can make the consensus nodes that enter the consensus process of the next block store the same block, so that the next block is being processed. When the consensus is reached, it can reduce the consensus failure of consensus nodes due to inconsistent blocks, and improve the success rate of subsequent consensus.
- the consensus node A can be the block producer, and the consensus node A can be the first node.
- the consensus node A will receive other consensus nodes (the consensus in Figure 4) Node B, consensus node C) voting information, consensus node B and consensus node C can both be the second node. Because each consensus node sends information at different speeds, the voting information received by consensus node A is not received at the same time.
- the consensus node counts that among the received voting information, the passing votes have exceeded the threshold or When the threshold is reached, the consensus node can determine that the target block has passed the consensus.
- consensus node A has received the voting information of consensus node B, but has not yet received the voting information of consensus node C, but there are three consensus nodes in total: consensus node A, consensus node B, and consensus node C , There have been 2 passing votes (consensus node A is the block producer, and the voting information of the block producer is approved). The number of passed votes (2) accounts for 2/3 of the total number of consensus nodes (3). This ratio has been When the expected passing ratio of 2/3 is reached, the consensus node A can determine that the target block has passed the consensus. The consensus node A will no longer manage the voting information of the consensus node C, and will directly start the accounting time window. The target block is accounted for in the duration window.
- consensus node B can also receive the voting information of consensus node A, and consensus node B can also determine that the target block has passed the consensus, then consensus node B will also start the accounting time window, and the accounting period will be checked in the accounting time window.
- the target block is accounted for; in the same way, consensus node C can also receive the voting information of consensus node A and consensus node B, combined with the consensus node’s own voting information, consensus node C can determine that the number of votes passed is 3 votes, then consensus node C can also determine that the target block has passed the consensus, and the consensus node C will also start the accounting time window, and perform accounting processing on the target block within the accounting time window.
- the consensus node A when the consensus node A has completed the accounting of the target block when entering the 2s of the accounting time window, the consensus node A can send an accounting completion message to the consensus node B and the consensus node C to notify The other party has completed the accounting task of the target block. Because at the second second of the accounting window, the voting information of consensus node C has not been received, and the accounting completion message of consensus node B or consensus node C has not been received, consensus node A can determine that there is only consensus node A When the consensus node completes the accounting of the target block, the consensus node A will not enter the subsequent process, and will wait for the consensus node B and the consensus node C to keep the accounts within the accounting time window.
- consensus node A when entering the 2.5s of the accounting time window, consensus node A receives the voting information sent by consensus node C, then consensus node A received the 2.5s of the accounting time window The voting information of all consensus nodes in the blockchain (including consensus node B and consensus node C), consensus node A will not continue to wait for consensus node B and consensus node C to keep accounts at 2.5 hours, and will directly close the accounting
- the time window enters into the consensus business process of the next block of the target block.
- FIG. 5 is a schematic diagram of a billing scenario provided by an embodiment of the present application.
- consensus node A can be the block producer, and consensus node A can be the first node.
- consensus node A will receive other consensus nodes (the consensus in Figure 5) Node B, consensus node C) voting information, consensus node B and consensus node C can both be the second node. Because each consensus node sends information at different speeds, the voting information received by consensus node A is not received at the same time.
- the consensus node counts that among the received voting information, the passing votes have exceeded the threshold or When the threshold is reached, the consensus node can determine that the target block has passed the consensus.
- consensus node A has received the voting information of consensus node B, but has not yet received the voting information of consensus node C, but there are 3 consensus nodes in consensus node A, consensus node B, and consensus node C Among them, there have been 2 passing votes (consensus node A is the block producer, and the voting information of the block producer is approved), and the ratio of the passing votes (2) to the total number of consensus nodes (3) is 2/3, the ratio Has reached the expected pass ratio of 2/3, then consensus node A can determine that the target block has passed the consensus, consensus node A will no longer manage the voting information of consensus node C, and will directly start the accounting time window, in the record The target block is accounted for in the account duration window.
- consensus node B can also receive the voting information of consensus node A, and consensus node B can also determine that the target block has passed the consensus, then consensus node B will also start the accounting time window, and the accounting period will be checked in the accounting time window.
- the target block is accounted for; in the same way, consensus node C can also receive the voting information of consensus node A and consensus node B, combined with the consensus node’s own voting information, consensus node C can determine that the number of votes passed is 3 votes, then consensus node C can also determine that the target block has passed the consensus, and the consensus node C will also start the accounting time window, and perform accounting processing on the target block within the accounting time window.
- consensus node B has not completed the accounting of the target block, and consensus node B will continue accounting.
- the consensus node B completed the accounting of the target block, because in the previous 2.5s, the consensus node B received the vote of the consensus node C Information, when the consensus node B completes accounting in the 3s, although the consensus node B thinks that only one of its own nodes has completed the block accounting and has not yet reached the number threshold 2, the consensus node will still close the accounting period window. Then wait for other consensus nodes, and directly enter the subsequent process, such as entering the consensus business process of the next block of the target block.
- consensus node C when entering the accounting time window for the second second, consensus node A completed the block accounting, and consensus node C received the accounting completion message of consensus node A in the second second. , Because the consensus node C has not completed the block accounting, the consensus node C will continue to perform the accounting for the block A. In the 3s, consensus node C receives the accounting completion message of consensus node B, and consensus node C will continue to perform block accounting. In the accounting time window, consensus node C has not completed the accounting processing of the target block. When the time threshold of 6s is reached, consensus node C will close the accounting time window and enter the next block of the target block In the consensus business process.
- consensus node A and the consensus node B have not received the voting information sent by the consensus node C within the accounting time window. That is to say, in the 2.5s, consensus node A and consensus node B did not receive the voting information sent by consensus node C, then consensus node A will not close the accounting when it completes accounting in the second second of the accounting window.
- the account duration window will wait for consensus node B and consensus node C to keep accounts.
- consensus node B and consensus node C have not completed accounting. When it reaches 6s, consensus node A that has completed accounting, consensus node B and consensus node C that have not completed accounting will close the accounting time window and enter together Go to the consensus business process of the next block of the target block.
- the consensus node that completed the block bookkeeping first will wait for the consensus node with the slow bookkeeping speed within the bookkeeping time window, and when it reaches the bookkeeping time window At the time threshold, it enters the consensus process of the next block together with the consensus node with slow billing speed, which can reduce the difference between the block stored by the consensus node with slow billing speed and the node with fast billing speed.
- the blocks stored by each consensus node are not much different, which improves the success rate of subsequent consensus.
- the consensus node receives the voting information of all consensus nodes in the accounting time window, the consensus node that completed the accounting first can directly close the accounting time window when completing the block accounting, and enter the consensus of the next block Process. Because other consensus nodes have successfully sent voting information, the network status of each consensus node is in a good state. It can be considered that the status of each consensus node is not much different, and the speed of block accounting can be basically the same, then When entering the consensus process of the next block, the blocks stored by each consensus node are also very small, and these consensus nodes can synchronize through the block to synchronize the slightly behind nodes to the difference area in a short time. In this way, each consensus node can keep the stored blocks consistent in a short period of time, which can improve the consensus success rate of subsequent consensus.
- the consensus node A can be the block producer, and the consensus node A can be the first node.
- the consensus node A will receive other consensus nodes (the consensus in Figure 6) Node B, consensus node C) voting information, consensus node B and consensus node C can both be the second node. Consensus node B and consensus node C will soon send out voting information.
- the voting information of consensus node B is passed, and the voting information of consensus node C is also passed, because the number of votes passed is 3 and the total number of nodes in the blockchain network If the number 3 is equal, the consensus node A can determine that the consensus result of the target block is a consensus. Because the consensus node has received all the voting information in the blockchain network (the voting information of the consensus node B and the consensus node C), the consensus node A can obtain the performance of the consensus node B carried in the voting information sent by the consensus node B Parameters, and the performance parameters of consensus node C carried in the voting information sent by consensus node C.
- consensus node A can update the accounting duration window with a duration threshold of 6s , The time threshold of the updated accounting time window obtained after the update becomes 3s.
- Consensus node A, consensus node B, and consensus node C can enter the updated accounting time window to perform accounting processing on the target block.
- Consensus node A , Consensus node B and consensus node C need to perform accounting processing on the target block within 3s.
- the consensus node A when the consensus node A completes the block accounting in the first second, it can also choose not to broadcast notification, that is, when the block accounting is completed, it does not send the accounting completion message to the consensus node B and the consensus node C. Directly close the window for updating the accounting duration and enter the consensus business process of the next block.
- the consensus node A can send the accounting completion message to the consensus node B and the consensus node C without closing the update accounting. Accounting duration window. Consensus node A can wait for consensus node B and consensus node C to perform accounting within the update accounting duration window, and close the update accounting duration until it is determined that 2/3 of the consensus nodes have completed block accounting. Window to enter the consensus business process of the next block.
- consensus node B completes block accounting at 1.5s, and broadcasts notification, consensus node A receives the accounting completion message of consensus node B, at this time, consensus node A can determine that there are 2 consensus nodes (consensus Node A and Consensus Node B) complete block bookkeeping, the number of nodes that have completed bookkeeping (2) accounts for 2/3 of the total number of nodes in the blockchain network (3), which has reached a given ratio of 2/3, then When the consensus node A is 1.5s, it can close the window for updating the accounting duration and enter the consensus business process of the next block.
- 2 consensus nodes consistensus Node A and Consensus Node B
- each consensus node can update the accounting time window according to the performance parameters of other consensus nodes (reduce the time threshold of the accounting time window), and update the accounting time window.
- Block accounting is performed in the accounting time window, and after the block accounting is completed, it enters the subsequent consensus process. Because the status of each consensus node is good and there is not much difference, the accounting speed can also be basically the same.
- the stored blocks can also be basically the same. In this case, reduce the accounting The duration threshold of the duration window can make the consensus node not need to wait for other consensus nodes or reduce the waiting time, so that the consensus node can quickly enter the subsequent consensus business process and the stored blocks can also be basically consistent.
- FIG. 7 is a schematic flowchart of a blockchain-based data processing method provided by an embodiment of the present application. As shown in Figure 7, the process of this solution can be:
- step S201 the consensus node receives voting information for the target block.
- the consensus nodes in the blockchain network need to vote for the block production before accounting for the block.
- the consensus node receives the voting results of the consensus nodes that exceed the threshold, the voting results are passed.
- the block is confirmed as the consensus passed.
- the consensus node will perform block accounting.
- step S202 the consensus node determines that the target block consensus is passed.
- consensus nodes are voting for block generation, because the speed of each consensus node sending messages is inconsistent, the voting information of other consensus nodes received by each consensus node is not received at the same time.
- the consensus node counts In the received voting information, when the passing votes have exceeded the threshold, the consensus node will determine that the voting block has passed the consensus.
- step S203 the consensus node determines that the unanimous vote is received.
- each consensus node if each consensus node is in a good state, it will soon send its own voting information, and each consensus node may have received voting information from all consensus nodes when the statistically passed votes exceed the threshold.
- step S204 the consensus node updates the accounting time window when receiving the unanimous vote.
- each consensus node If in the blockchain network, each consensus node is in good condition and will soon send its own voting information, each consensus node has received the voting information of all consensus nodes when the counted votes exceed the threshold. Then in the blockchain network, because each consensus node is in a good state and the accounting speed is not much different, the blocks stored between each consensus node are also not much different, and the consensus success rate in the subsequent consensus process It will also be very high. In this case, the consensus node can update the accounting time window according to the performance parameters of other consensus nodes, reduce the time threshold of the accounting time window, and obtain the updated accounting time window, and then the updated accounting Block accounting is performed in the time window.
- Step S205 After the consensus node completes accounting, it enters the subsequent process.
- the consensus node can enter the subsequent process, such as entering the consensus business process of the next block of the target block; if it is not within the updated accounting time period
- the update accounting time window will jump out and enter the subsequent process.
- step S206 the consensus node determines that a part of the votes has been received.
- step S207 the consensus node enters the accounting duration window.
- the accounting speed will be slow. If the consensus node with a fast accounting speed does not wait for a consensus node with a slow accounting speed, the consensus node with a slow accounting speed will The blocks stored between the consensus nodes with fast accounting speed will be very different, which will affect the consensus success rate in the subsequent consensus process. In this case, the consensus node may enter the accounting period window without updating the accounting period window, and perform block accounting in the accounting period window.
- the accounting time window can be understood as setting a waiting time for the consensus node, so that the consensus node with a fast accounting speed can wait for the consensus node with a slow accounting speed after the accounting is completed.
- step S208 the consensus node has not received a full ticket within the accounting time window.
- consensus nodes when consensus nodes perform block accounting in the accounting period window, they can still continue to receive voting information from other consensus nodes. Some consensus nodes have slow sending speeds. In the accounting period window, those consensus nodes that send slow are still The voting information is not sent, or some consensus nodes that are slow to send the voting information, but there are still a small number of consensus nodes that have not yet sent the voting information. In other words, the consensus node may have not received a full vote within the accounting time window.
- step S209 the consensus node completes accounting within the accounting time window.
- the consensus node when the consensus node has not received the unanimous vote, when the consensus node completes the block accounting within the accounting time window, it will broadcast a notification in the accounting time window, and need to wait for other consensus nodes to book and receive Notification messages from other nodes that have completed bookkeeping until the proportion of nodes that have completed bookkeeping to the total nodes reaches or exceeds the given proportion value.
- step S210 the consensus node jumps out of the accounting duration window.
- consensus nodes that have completed block accounting can jump out of the accounting duration window and enter the subsequent process; and if Consensus nodes that have completed block bookkeeping have not exceeded or reached the given ratio, then consensus nodes that have completed block bookkeeping and unfinished block bookkeeping will close the bookkeeping together when the time threshold of the bookkeeping window is reached. Time window, enter the follow-up process together.
- a given ratio such as 2/3
- step S211 if a given proportion of consensus nodes have not completed accounting, the consensus nodes will wait forever.
- step S212 when the time threshold of the accounting time window is reached, all nodes close the accounting time window and enter the subsequent process.
- step S213 the consensus node receives a full ticket within the accounting time window.
- consensus node when the consensus node performs block accounting in the accounting period window, those consensus nodes that send slowly also send voting information (that is, the voting information of all consensus nodes is received in the accounting period window) , It can be understood that the consensus node has received unanimous votes.
- step S214 the consensus node jumps out of the accounting duration window after the accounting is completed.
- the consensus node when the consensus node receives a full ticket in the accounting time window, it will continue to perform block accounting in the accounting time window, and directly jump out of the accounting time window after the accounting is completed, and enter the subsequent process (because in the time window If the voting information of all consensus nodes is successfully received within, the status of each consensus node is the same, and the accounting speed is not much different from the network status. Accounting can be completed in about the same time, and the storage area is stored when entering the subsequent process. The blocks are not much different, and there is no need to wait).
- FIG. 8 is a schematic structural diagram of a blockchain-based data processing device provided by an embodiment of the present application.
- the blockchain-based data processing device can be a computer-readable instruction (including program code) running in a computer device.
- the blockchain-based data processing device is an application software; the device can be used to execute this application The corresponding steps in the method provided in the embodiment.
- the data processing device 1 may include: a voting information interaction module 11, a consensus result determination module 12, an accounting processing module 13, an accounting completion receiving module 14, an accounting completion notification module 15, and a window closing module 16.
- the voting information interaction module 11 is configured to send the first consensus voting information for the target block to the second node, and receive the second consensus voting information for the target block sent by the second node;
- the consensus result determining module 12 is used to determine the consensus result of the target block according to the first consensus voting information and the second consensus voting information;
- the accounting processing module 13 is used to start the accounting time window when the consensus result is the consensus passed result, and perform accounting processing on the target block in the accounting time window;
- the accounting completion receiving module 14 is configured to receive the first accounting completion message for the target block sent by the second node within the accounting time window;
- the accounting completion notification module 15 is configured to send a second accounting completion message to the second node if the accounting processing of the target block is completed within the accounting time window;
- the window closing module 16 is used to close the accounting time window and enter the consensus business of the subsequent block of the target block if the sum of the total number of the first accounting completion message and the second accounting completion message is greater than or equal to the number threshold Process.
- step S101 to step S104 in the example will not be repeated here.
- the consensus result determining module 12 may include: a first target quantity determining unit 121, a positive vote quantity determining unit 122, a consensus passing determining unit 123, and a consensus failure determining unit 124.
- the first target quantity determining unit 121 is configured to determine the quantity of the second consensus voting information belonging to the approval voting in the second consensus voting information, as the first target quantity;
- the affirmative vote quantity determining unit 122 is configured to determine the total number of affirmative votes based on the first consensus vote information and the first target number if the first consensus voting information belongs to the affirmative vote. If the first consensus vote information belongs to the rejection consensus vote, Determine the total number of votes in favor of the first target number;
- the consensus passing determination unit 123 is used to determine the consensus result of the target block as the consensus passing result if the ratio of the total number of votes to the total number of nodes is greater than or equal to the ratio threshold; the total number of nodes is the first node and the second node The total number of;
- the consensus failure determination unit 124 is configured to determine the consensus result of the target block as the consensus failure result if the ratio of the total number of approval votes to the total number of nodes is less than the ratio threshold.
- the affirmative vote quantity determining unit 122 the consensus passing determining unit 123, and the consensus failure determining unit 124, please refer to the description in step S102 in the embodiment corresponding to FIG. 2. Do not repeat it here.
- the accounting processing module 13 may include: a quantity acquiring unit 131, a second target quantity determining unit 132, and an accounting processing unit 133.
- the quantity obtaining unit 131 is configured to obtain the quantity of second consensus voting information when the consensus result is a consensus passed result
- the second target quantity determining unit 132 is configured to obtain the node quantity of the second node as the second target quantity
- the accounting processing unit 133 is configured to, if the quantity of the second consensus voting information is less than the second target quantity, start the accounting time window, and perform accounting processing on the target block in the accounting time window.
- step S102 for the specific implementation of the quantity acquisition unit 131, the second target quantity determination unit 132, and the billing processing unit 133, please refer to the description of step S102 in the embodiment corresponding to FIG. 2, which will not be repeated here.
- the data processing device 1 may include a voting information interaction module 11, a consensus result determination module 12, an accounting processing module 13, an accounting completion receiving module 14, an accounting completion notification module 15, and a window closing module 16, and It may include: a window update module 17, a window activation module 18, and a process entry module 19.
- the window update module 17 is used to update the accounting duration window according to the performance parameters of the second node if the quantity of the second consensus voting information is equal to the second target quantity to obtain the updated accounting duration window; the updated accounting duration The duration threshold corresponding to the window is less than the duration threshold corresponding to the accounting duration window;
- the window activation module 18 is used to activate the updated accounting time window, and perform accounting processing on the target block in the updated accounting time window;
- the process entry module 19 is used to enter the consensus business process of subsequent blocks of the target block if the first node completes the accounting processing of the target block within the updated accounting time window.
- window update module 17 the window activation module 18, and the process entry module 19, please refer to the description in step S104 in the embodiment corresponding to FIG. 2, which will not be repeated here.
- the accounting completion notification module 15 may include a voting information receiving unit 151, a voting quantity obtaining unit 152, an addition processing unit 153, a permission detection unit 154, and an accounting completion sending unit 155.
- the voting information receiving unit 151 is configured to receive the third consensus voting information for the target block sent by the remaining second nodes within the accounting time window; the remaining second nodes are among multiple second nodes, except for the second node that has already sent Nodes other than the second node of consensus voting information;
- the voting quantity obtaining unit 152 is configured to obtain the total quantity of third consensus voting information if the accounting processing of the target block is completed within the accounting time window;
- the addition processing unit 153 is configured to add the quantity of the third consensus voting information and the quantity of the second consensus voting information to obtain the total number of consensus votes;
- the permission detection unit 154 is configured to detect the message sending permission of the first node according to the total number of consensus votes and the first target number;
- the accounting completion sending unit 155 is configured to send a second accounting completion message to the second node when the first node has the message sending authority.
- the specific implementation of the voting information receiving unit 151, the voting quantity obtaining unit 152, the addition processing unit 153, the permission detection unit 154, and the accounting completion sending unit 155 can be referred to the description of step S103 in the embodiment corresponding to FIG. 2. I will not repeat them here.
- the authority detecting unit 154 may include: a first authority determining subunit 1541 and a second authority determining subunit 1542.
- the first authority determining subunit 1541 is configured to determine that the first node has the message sending authority if the total number of consensus votes is less than the second target number;
- the second authority determining subunit 1542 is configured to determine that the first node does not have the message sending authority if the total number of consensus votes is equal to the second target number.
- step S103 for the specific implementation of the first authority determining sub-unit 1541 and the second authority determining sub-unit 1542, please refer to the description of step S103 in the embodiment corresponding to FIG. 2, which will not be repeated here.
- the data processing device 1 may include a voting information interaction module 11, a consensus result determining module 12, an accounting processing module 13, an accounting completion receiving module 14, an accounting completion notification module 15, and a window closing module 16, window
- the update module 17, the window activation module 18, and the process entry module 19 may also include: a consensus process entry module 20.
- the consensus process entry module 20 is used to close the accounting time window when the first node does not have the message sending authority, and enter the consensus business process of subsequent blocks of the target block.
- step S104 in the embodiment corresponding to FIG. 2, which will not be repeated here.
- the data processing device 1 may include a voting information interaction module 11, a consensus result determining module 12, an accounting processing module 13, an accounting completion receiving module 14, an accounting completion notification module 15, and a window closing module 16, window
- the update module 17, the window activation module 18, the process entry module 19, and the consensus process entry module 20 may also include: a first duration threshold acquisition module 21, a first cumulative duration statistics module 22, and a first block consensus entry module 23.
- the first duration threshold acquisition module 21 is configured to acquire the duration threshold corresponding to the accounting duration window
- the first accumulated time statistics module 22 is used to count the accumulated time that the first node is in the accounting time window;
- the first block consensus entry module 23 is used to close the accounting time window if the accumulated time is equal to the time threshold, and the sum of the total number of the first accounting completion message and the second accounting completion message is less than the number threshold, The consensus business process of subsequent blocks that enter the target block.
- the specific implementation of the first duration threshold acquisition module 21, the first cumulative duration statistics module 22, and the first block consensus entry module 23 can be found in the description of step 104 in the embodiment corresponding to FIG. 2, which will not be omitted here. Go ahead and repeat.
- the data processing device 1 may include a voting information interaction module 11, a consensus result determining module 12, an accounting processing module 13, an accounting completion receiving module 14, an accounting completion notification module 15, and a window closing module 16, window Update module 17, window start module 18, process entry module 19, consensus process entry module 20, first duration threshold acquisition module 21, first cumulative duration statistics module 22, and first block consensus entry module 23, and may also include a second The duration threshold obtaining module 24, the second cumulative duration statistics module 25, and the second block consensus entry module 26.
- the second duration threshold acquisition module 24 is used to acquire the duration threshold corresponding to the accounting duration window
- the second accumulated time statistics module 25 is used to obtain the accumulated time that the first node is in the accounting time window;
- the second block consensus entry module 26 is used to close the accounting time window and enter the target area if the accumulated time is equal to the time threshold and the first node has not completed the accounting processing of the target block within the accounting time window.
- the consensus business process of the subsequent blocks of the block is used to close the accounting time window and enter the target area if the accumulated time is equal to the time threshold and the first node has not completed the accounting processing of the target block within the accounting time window.
- step S104 the specific implementation of the second duration threshold acquisition module 24, the second cumulative duration statistics module 25, and the second block consensus entry module 26 can be found in the description of step S104 in the embodiment corresponding to FIG. 2, which will not be omitted here. Go ahead and repeat.
- the consensus node when the block is booked after the consensus is reached, the consensus node is added with a billing time window, so that the consensus nodes (such as the first node and the second node) perform billing within the billing time window.
- Each consensus node can broadcast notifications after the accounting is completed.
- these consensus nodes that have completed the accounting will close the accounting.
- Account time window enter the consensus process of the next block together. In this way, the consensus node that completes the block accounting first can wait for other consensus nodes to complete the block accounting within the accounting time window, and then enter the consensus process of the next block together.
- Consensus nodes can synchronize blocks with small differences in a short period of time through block synchronization, so that when the consensus of the next block is carried out, the consensus nodes can be reduced due to inconsistent block heights. Consensus failures can improve the consensus success rate of subsequent consensus business processes.
- FIG. 9 is a schematic diagram of a computer device provided by an embodiment of the present application.
- the apparatus 1 in the embodiment corresponding to FIG. 8 may be applied to a computer device 1000.
- the computer device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, a user interface 1003, and a memory 1005 , At least one communication bus 1002.
- the communication bus 1002 is used to implement connection and communication between these components.
- the user interface 1003 may include a display screen (Display) and a keyboard (Keyboard), and the network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
- the memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory.
- the memory 1005 may also be at least one storage device located far away from the aforementioned processor 1001.
- the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
- the network interface 1004 is mainly used for network communication with the service server; and the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the storage in the memory 1005
- the device control application to achieve:
- the consensus result of the target block is determined.
- the accounting time window is activated, and the accounting processing of the target block is performed in the accounting time window. , Receiving the first accounting completion message for the target block sent by the second node within the accounting time window;
- the accounting duration window is closed and the consensus business process of subsequent blocks of the target block is entered.
- the computer device 1000 described in the embodiment of the present application can execute the description of the blockchain-based data processing method in the foregoing embodiment corresponding to FIG. 2 to FIG. 7 and may also execute the foregoing embodiment corresponding to FIG. 8
- the description of the data processing device 1 in, will not be repeated here.
- the description of the beneficial effects of using the same method will not be repeated.
- the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores the aforementioned computer program executed by the video data processing computer device 1000, and
- the computer program includes computer-readable instructions.
- the processor executes the computer-readable instructions, it can execute the description of the blockchain-based data processing method in the previous embodiment corresponding to Figures 2 to 7. Therefore, it will not be repeated here. Go into details.
- the description of the beneficial effects of using the same method will not be repeated.
- technical details not disclosed in the embodiment of the computer-readable storage medium involved in this application please refer to the description of the method embodiment of this application.
- a computer device including a memory and one or more processors, in which computer-readable instructions are stored, and the one or more processors implement the above-mentioned methods when the computer-readable instructions are executed. Steps in the embodiment.
- one or more non-volatile computer-readable storage media storing computer-readable instructions, and the computer-readable instructions are stored by one or more processors.
- the steps in the foregoing method embodiments are implemented during execution.
- a computer program product or computer program includes computer-readable instructions stored in a computer-readable storage medium.
- the processor reads the computer-readable instructions from the computer-readable storage medium, and the processor executes the computer-readable instructions so that the computer device executes the steps in the foregoing method embodiments.
- the computer-readable storage medium may be a blockchain-based data processing device or an internal storage unit of a computer device provided in any of the foregoing embodiments, such as a hard disk or memory of a computer device.
- the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), or a secure digital (SD) card equipped on the computer device. Flash card, etc.
- the computer-readable storage medium may also include both an internal storage unit of the computer device and an external storage device.
- the computer-readable storage medium is used to store the computer-readable instructions and other programs and data required by the computer device.
- the computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
- These computer-readable instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated
- These computer-readable instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
- the instruction device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the schematic structural diagram.
- These computer-readable instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, which can be executed on the computer or other programmable equipment.
- the instructions provide steps for implementing the functions specified in a block or blocks in a flow or multiple flows and/or structures in the flowchart.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Data Mining & Analysis (AREA)
- Computer Security & Cryptography (AREA)
- Accounting & Taxation (AREA)
- Computing Systems (AREA)
- Finance (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- General Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Health & Medical Sciences (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
Description
Claims (22)
- 一种基于区块链的数据处理方法,由第一节点执行,第一节点为计算机设备,包括:向第二节点发送针对目标区块的第一共识投票信息,接收所述第二节点发送的针对所述目标区块的第二共识投票信息;根据所述第一共识投票信息与所述第二共识投票信息,确定所述目标区块的共识结果,在所述共识结果为共识通过结果时,启动记账时长窗口,在所述记账时长窗口内对所述目标区块进行记账处理,在所述记账时长窗口内接收所述第二节点发送的针对所述目标区块的第一记账完成消息;若在所述记账时长窗口内完成对所述目标区块的记账处理,则向所述第二节点发送第二记账完成消息;及若所述第一记账完成消息与所述第二记账完成消息的总数量之和大于或等于数量阈值,则关闭所述记账时长窗口,进入所述目标区块的后继区块的共识业务流程。
- 根据权利要求1所述的方法,其特征在于,所述根据所述第一共识投票信息与所述第二共识投票信息,确定所述目标区块的共识结果,包括:在所述第二共识投票信息中,确定属于赞成投票的第二共识投票信息的数量,作为第一目标数量;若所述第一共识投票信息属于赞成投票,则根据所述第一共识投票信息和所述第一目标数量,确定赞成投票总数量;若所述赞成投票总数量与节点总数量的比值大于或等于比例阈值,则将所述目标区块的共识结果确定为共识通过结果;所述节点总数量为所述第一节点与所述第二节点的总数量;及若所述赞成投票总数量与所述节点总数量的比值小于所述比例阈值,则将所述目标区块的共识结果确定为共识失败结果。
- 根据权利要求2所述的方法,其特征在于,所述方法还包括:若所述第一共识投票信息属于拒绝共识通过投票,则根据所述第一目标数量确定所述赞成投票总数量。
- 根据权利要求1所述的方法,其特征在于,所述在所述共识结果为共识通过结果时,启动记账时长窗口,在所述记账时长窗口内对所述目标区块进行记账处理,包括:在所述共识结果为共识通过结果时,获取所述第二共识投票信息的数量;获取所述第二节点的节点数量,作为第二目标数量;及若所述第二共识投票信息的数量小于所述第二目标数量,则启动所述记账时长窗口,在所述记账时长窗口内对所述目标区块进行记账处理。
- 根据权利要求4所述的方法,其特征在于,所述第二共识投票信息携带所述第二节点的性能参数;所述方法还包括:若所述第二共识投票信息的数量等于所述第二目标数量,则根据所述第二节点的性能参数更新所述记账时长窗口,得到更新后的记账时长窗口;所述更新后的记账时长窗口对应的时长阈值小于所述记账时长窗口对应的时长阈值;启动所述更新后的记账时长窗口,在所述更新后的记账时长窗口内对所述目标区块进行记账处理;及若在所述更新后的记账时长窗口内完成对所述目标区块的记账处理,则进入所述目标区块的后继区块的共识业务流程。
- 根据权利要求4所述的方法,其特征在于,所述第二节点的数量为多个;所述若在所述记账时长窗口内完成对所述目标区块的记账处理,则向所述第二节点发送第二记账完成消息,包括:在所述记账时长窗口内,接收剩余第二节点发送的针对所述目标区块的第三共识投票信 息;所述剩余第二节点为多个所述第二节点中,除了已发送所述第二共识投票信息的第二节点以外的节点;若在所述记账时长窗口内完成对所述目标区块的记账处理,则获取所述第三共识投票信息的数量;将所述第三共识投票信息的数量与所述第二共识投票信息的数量进行相加,得到共识投票总数量;根据所述共识投票总数量与所述第二目标数量,检测所述第一节点的消息发送权限;及在所述第一节点具备所述消息发送权限时,向所述第二节点发送第二记账完成消息。
- 根据权利要求6所述的方法,其特征在于,所述根据所述共识投票总数量与所述第二目标数量,检测所述第一节点的消息发送权限,包括:若所述共识投票总数量小于所述第二目标数量,则确定所述第一节点具备所述消息发送权限;及若所述共识投票总数量等于所述第二目标数量,则确定所述第一节点未具备所述消息发送权限。
- 根据权利要求6所述的方法,其特征在于,所述方法还包括:在所述第一节点未具备所述消息发送权限时,关闭所述记账时长窗口,进入所述目标区块的后继区块的共识业务流程。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:获取所述记账时长窗口对应的时长阈值;统计所述第一节点处于所述记账时长窗口中的累计时长;及若所述累计时长与所述时长阈值相等,且所述第一记账完成消息与所述第二记账完成消息的总数量之和,小于所述数量阈值,则关闭所述记账时长窗口,进入所述目标区块的后继区块的共识业务流程。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:获取所述记账时长窗口对应的时长阈值;获取所述第一节点处于所述记账时长窗口中的累计时长;及若所述累计时长与所述时长阈值相等,且所述第一节点在所述记账时长窗口内未完成对所述目标区块的记账处理,则关闭所述记账时长窗口,进入所述目标区块的后继区块的共识业务流程。
- 一种基于区块链的数据处理装置,其特征在于,包括:投票信息交互模块,用于向第二节点发送针对目标区块的第一共识投票信息,接收所述第二节点发送的针对所述目标区块的第二共识投票信息;共识结果确定模块,用于根据所述第一共识投票信息与所述第二共识投票信息,确定所述目标区块的共识结果;记账处理模块,用于在所述共识结果为共识通过结果时,启动记账时长窗口,在所述记账时长窗口内对所述目标区块进行记账处理;记账完成接收模块,用于在所述记账时长窗口内接收所述第二节点发送的针对所述目标区块的第一记账完成消息;记账完成通知模块,用于若在所述记账时长窗口内完成对所述目标区块的记账处理,则向所述第二节点发送第二记账完成消息;及窗口关闭模块,用于若所述第一记账完成消息与所述第二记账完成消息的总数量之和大于或等于数量阈值,则关闭所述记账时长窗口,进入所述目标区块的后继区块的共识业务流程。
- 根据权利要求11所述的装置,其特征在于,所述共识结果确定模块包括:第一目标数量确定单元,用于在所述第二共识投票信息中,确定属于赞成投票的第二共识投票信息的数量,作为第一目标数量;赞成票数量确定单元,用于若所述第一共识投票信息属于赞成投票,则根据所述第一共识投票信息和所述第一目标数量,确定赞成投票总数量,若所述第一共识投票信息属于拒绝共识通过投票,则根据所述第一目标数量确定赞成投票总数量;共识通过确定单元,用于若所述赞成投票总数量与节点总数量的比值大于或等于比例阈值,则将所述目标区块的共识结果确定为共识通过结果;所述节点总数量为所述第一节点与所述第二节点的总数量;及共识失败确定单元,用于若所述赞成投票总数量与所述节点总数量的比值小于所述比例阈值,则将所述目标区块的共识结果确定为共识失败结果。
- 根据权利要求12所述的装置,其特征在于,所述赞成票数量确定单元还用于若所述第一共识投票信息属于拒绝共识通过投票,则根据所述第一目标数量确定所述赞成投票总数量。
- 根据权利要求11所述的装置,其特征在于,所述记账处理模块包括:数量获取单元,用于在所述共识结果为共识通过结果时,获取所述第二共识投票信息的数量;第二目标数量确定单元,用于获取所述第二节点的节点数量,作为第二目标数量;及记账处理单元,用于若所述第二共识投票信息的数量小于所述第二目标数量,则启动所述记账时长窗口,在所述记账时长窗口内对所述目标区块进行记账处理。
- 根据权利要求14所述的装置,其特征在于,所述第二共识投票信息携带所述第二节点的性能参数,所述装置还包括:窗口更新模块,用于若所述第二共识投票信息的数量等于所述第二目标数量,则根据所述第二节点的性能参数更新所述记账时长窗口,得到更新后的记账时长窗口;所述更新后的记账时长窗口对应的时长阈值小于所述记账时长窗口对应的时长阈值;窗口启动模块,用于启动所述更新后的记账时长窗口,在所述更新后的记账时长窗口内对所述目标区块进行记账处理;及流程进入模块,用于若在所述更新后的记账时长窗口内完成对所述目标区块的记账处理,则进入所述目标区块的后继区块的共识业务流程。
- 根据权利要求14所述的装置,其特征在于,所述第二节点的数量为多个,所述记账完成通知模块包括:投票信息接收单元,用于在所述记账时长窗口内,接收剩余第二节点发送的针对所述目标区块的第三共识投票信息;所述剩余第二节点为多个所述第二节点中,除了已发送所述第二共识投票信息的第二节点以外的节点;投票数量获取单元,用于若在所述记账时长窗口内完成对所述目标区块的记账处理,则获取所述第三共识投票信息的数量;相加处理单元,用于将所述第三共识投票信息的数量与所述第二共识投票信息的数量进行相加,得到共识投票总数量;权限检测单元,用于根据所述共识投票总数量与所述第二目标数量,检测所述第一节点的消息发送权限;及记账完成发送单元,用于在所述第一节点具备所述消息发送权限时,向所述第二节点发送第二记账完成消息。
- 根据权利要求16所述的装置,其特征在于,所述权限检测单元包括:第一权限确定子单元,用于若所述共识投票总数量小于所述第二目标数量,则确定所述第一节点具备所述消息发送权限;及第二权限确定子单元,用于若所述共识投票总数量等于所述第二目标数量,则确定所述第一节点未具备所述消息发送权限。
- 根据权利要求16所述的装置,其特征在于,所述装置还包括:共识流程进入模块,用于在所述第一节点未具备所述消息发送权限时,关闭所述记账时 长窗口,进入所述目标区块的后继区块的共识业务流程。
- 根据权利要求11所述的装置,其特征在于,所述装置还包括:第一时长阈值获取模块,用于获取所述记账时长窗口对应的时长阈值;第一累计时长统计模块,用于统计所述第一节点处于所述记账时长窗口中的累计时长;及第一区块共识进入模块,用于若所述累计时长与所述时长阈值相等,且所述第一记账完成消息与所述第二记账完成消息的总数量之和,小于所述数量阈值,则关闭所述记账时长窗口,进入所述目标区块的后继区块的共识业务流程。
- 根据权利要求11所述的装置,其特征在于,所述装置还包括:第二时长阈值获取模块,用于获取所述记账时长窗口对应的时长阈值;第二累计时长统计模块,用于获取所述第一节点处于所述记账时长窗口中的累计时长;及第二区块共识进入模块,用于若所述累计时长与所述时长阈值相等,且所述第一节点在所述记账时长窗口内未完成对所述目标区块的记账处理,则关闭所述记账时长窗口,进入所述目标区块的后继区块的共识业务流程。
- 一种计算机设备,包括存储器和一个或多个处理器,所述存储器存储有计算机可读指令,其特征在于,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器实现权利要求1至10中任一项所述的方法的步骤。
- 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,存储有计算机可读指令,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器实现权利要求1至10中任一项所述的方法的步骤。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP21812015.2A EP4030314A4 (en) | 2020-05-27 | 2021-04-22 | BLOCKCHAIN BASED DATA PROCESSING METHOD, APPARATUS AND DEVICE AND READABLE STORAGE MEDIA |
JP2022539707A JP7325894B2 (ja) | 2020-05-27 | 2021-04-22 | ブロックチェーンに基づくデータ処理方法、装置、デバイス及びコンピュータプログラム |
KR1020227016044A KR20220074971A (ko) | 2020-05-27 | 2021-04-22 | 블록체인 기반 데이터 프로세싱 방법, 장치 및 디바이스, 그리고 판독가능 저장 매체 |
US17/730,044 US11914579B2 (en) | 2020-05-27 | 2022-04-26 | Blockchain-based data processing method and apparatus, device, and readable storage medium |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010458171.4 | 2020-05-27 | ||
CN202010458171.4A CN111368008B (zh) | 2020-05-27 | 2020-05-27 | 基于区块链的数据处理方法、装置、设备及可读存储介质 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US17/730,044 Continuation US11914579B2 (en) | 2020-05-27 | 2022-04-26 | Blockchain-based data processing method and apparatus, device, and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021238514A1 true WO2021238514A1 (zh) | 2021-12-02 |
Family
ID=71207558
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/088899 WO2021238514A1 (zh) | 2020-05-27 | 2021-04-22 | 基于区块链的数据处理方法、装置、设备及可读存储介质 |
Country Status (6)
Country | Link |
---|---|
US (1) | US11914579B2 (zh) |
EP (1) | EP4030314A4 (zh) |
JP (1) | JP7325894B2 (zh) |
KR (1) | KR20220074971A (zh) |
CN (1) | CN111368008B (zh) |
WO (1) | WO2021238514A1 (zh) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111368008B (zh) | 2020-05-27 | 2020-08-25 | 腾讯科技(深圳)有限公司 | 基于区块链的数据处理方法、装置、设备及可读存储介质 |
CN112261145B (zh) * | 2020-10-22 | 2022-07-12 | 中国联合网络通信集团有限公司 | 一种新区块链生成方法及装置 |
CN114638452A (zh) * | 2020-12-16 | 2022-06-17 | 中兴通讯股份有限公司 | 区块组头的获取方法及装置,存储介质及电子装置 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108776929A (zh) * | 2018-04-02 | 2018-11-09 | 成都云创智融科技有限公司 | 基于区块链数据库的账单处理方法、系统和可读存储介质 |
CN108848055A (zh) * | 2018-05-03 | 2018-11-20 | 中国银联股份有限公司 | 一种区块链共识方法、记账节点及节点 |
CN109903155A (zh) * | 2019-01-14 | 2019-06-18 | 无锡一邦网络科技有限公司 | Iift区块链共识算法 |
US20190279107A1 (en) * | 2018-03-09 | 2019-09-12 | Lenovo (Beijing) Co., Ltd. | Blockchain-based data processing method, apparatus, and electronic device thereof |
CN111368008A (zh) * | 2020-05-27 | 2020-07-03 | 腾讯科技(深圳)有限公司 | 基于区块链的数据处理方法、装置、设备及可读存储介质 |
Family Cites Families (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2929988A1 (en) * | 2013-08-12 | 2015-02-19 | Selventa | Systems and methods for crowd-verification of biological networks |
US10417217B2 (en) * | 2016-08-05 | 2019-09-17 | Chicago Mercantile Exchange Inc. | Systems and methods for blockchain rule synchronization |
CN107103459A (zh) * | 2017-04-27 | 2017-08-29 | 电子科技大学 | 基于主权区块链的记账系统及方法 |
JP2019012415A (ja) | 2017-06-30 | 2019-01-24 | 株式会社bitFlyer | ネットワークにおける合意形成方法及び当該ネットワークを構成するノード |
EP3457623B1 (en) * | 2017-09-15 | 2024-03-06 | Panasonic Intellectual Property Corporation of America | Electronic voting system |
CN109274717B (zh) * | 2018-08-22 | 2021-08-24 | 泰康保险集团股份有限公司 | 基于区块链的共享存储方法、装置、介质及电子设备 |
US20200084019A1 (en) * | 2018-09-07 | 2020-03-12 | Nebulas IO Limited | Blockchain Ranking Engine |
CN109544310A (zh) * | 2018-11-13 | 2019-03-29 | 孙晞瑜 | 一种基于区块链联盟链的快速共识记账方法及其系统 |
CN110168582A (zh) | 2018-11-30 | 2019-08-23 | 阿里巴巴集团控股有限公司 | 使用去中心化决策更新区块链智能合约 |
US11042849B2 (en) * | 2019-02-26 | 2021-06-22 | Apifiny Group Inc. | Adjusting transaction distribution based on predicted open transaction execution rates |
KR20200132518A (ko) * | 2019-05-17 | 2020-11-25 | 삼성에스디에스 주식회사 | 블록체인 네트워크 간에 트랜잭션 연동을 지원하는 시스템 및 그 방법 |
CN110535836B (zh) * | 2019-08-12 | 2021-10-29 | 安徽师范大学 | 一种基于角色分类的信任区块链共识方法 |
CN110505091B (zh) * | 2019-08-23 | 2021-09-10 | 昆明理工大学 | 一种基于pbft改进的共识方法 |
CN111061769B (zh) * | 2019-12-24 | 2021-09-10 | 腾讯科技(深圳)有限公司 | 一种区块链系统的共识方法及相关设备 |
-
2020
- 2020-05-27 CN CN202010458171.4A patent/CN111368008B/zh active Active
-
2021
- 2021-04-22 WO PCT/CN2021/088899 patent/WO2021238514A1/zh unknown
- 2021-04-22 JP JP2022539707A patent/JP7325894B2/ja active Active
- 2021-04-22 EP EP21812015.2A patent/EP4030314A4/en active Pending
- 2021-04-22 KR KR1020227016044A patent/KR20220074971A/ko not_active Application Discontinuation
-
2022
- 2022-04-26 US US17/730,044 patent/US11914579B2/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190279107A1 (en) * | 2018-03-09 | 2019-09-12 | Lenovo (Beijing) Co., Ltd. | Blockchain-based data processing method, apparatus, and electronic device thereof |
CN108776929A (zh) * | 2018-04-02 | 2018-11-09 | 成都云创智融科技有限公司 | 基于区块链数据库的账单处理方法、系统和可读存储介质 |
CN108848055A (zh) * | 2018-05-03 | 2018-11-20 | 中国银联股份有限公司 | 一种区块链共识方法、记账节点及节点 |
CN109903155A (zh) * | 2019-01-14 | 2019-06-18 | 无锡一邦网络科技有限公司 | Iift区块链共识算法 |
CN111368008A (zh) * | 2020-05-27 | 2020-07-03 | 腾讯科技(深圳)有限公司 | 基于区块链的数据处理方法、装置、设备及可读存储介质 |
Also Published As
Publication number | Publication date |
---|---|
US11914579B2 (en) | 2024-02-27 |
EP4030314A1 (en) | 2022-07-20 |
CN111368008B (zh) | 2020-08-25 |
JP2023508210A (ja) | 2023-03-01 |
CN111368008A (zh) | 2020-07-03 |
US20220253432A1 (en) | 2022-08-11 |
KR20220074971A (ko) | 2022-06-03 |
JP7325894B2 (ja) | 2023-08-15 |
EP4030314A4 (en) | 2022-12-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021238514A1 (zh) | 基于区块链的数据处理方法、装置、设备及可读存储介质 | |
US11403636B2 (en) | Blockchain-based transaction processing method and apparatus, and electronic device | |
WO2021233049A1 (zh) | 基于区块链的数据处理方法、装置、设备及可读存储介质 | |
US11823178B2 (en) | Optimization of high volume transaction performance on a blockchain | |
US11971877B2 (en) | Method, apparatus, device, and storage medium for proposal message processing for blockchain | |
US20230315891A1 (en) | Transaction data processing method and apparatus, computer device and storage medium | |
CN111124917B (zh) | 公共测试用例的管控方法、装置、设备及存储介质 | |
US11966400B2 (en) | Common database architecture to support largescale transactions and node archival on a MaaS platform | |
US20220239668A1 (en) | Blockchain-based message processing method and apparatus, device, and storage medium | |
CN111260421B (zh) | 一种基于区块链的电子发票管控方法及装置 | |
CN109886695A (zh) | 不同区块链之间的信息共享方法及装置和电子设备 | |
CN109766365A (zh) | 基于redis的运行事件控制方法、装置及电子设备 | |
CN111556115A (zh) | 一种基于区块链的数据处理方法、装置、设备及存储介质 | |
CN114282011B (zh) | 知识图谱的构建方法和装置、图计算方法及装置 | |
CN110381150B (zh) | 区块链上的数据处理方法、装置、电子设备及存储介质 | |
CN116739596A (zh) | 基于区块链的交易监管方法、装置、设备、介质和产品 | |
CN115099925A (zh) | 一种基于区块链的风险评估方法、装置及设备 | |
US12099855B2 (en) | Data processing method and apparatus, computer device, and readable storage medium | |
Fang | Research on blockchain consensus algorithm based on DWBA protocol | |
US20240129143A1 (en) | Dividing data storage and service operations among plural blockchains | |
CN117195199A (zh) | 一种用户信息整合方法及相关装置 | |
CN116703505A (zh) | 一种订单信息的判断方法及装置 | |
CN117520442A (zh) | 数据同步方法、装置、计算机程序产品、设备及存储介质 | |
CN113010799A (zh) | 媒体信息的获取方法、装置、电子设备及存储介质 | |
CN117061258A (zh) | 计费检测方法、装置、设备和介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21812015 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2021812015 Country of ref document: EP Effective date: 20220414 |
|
ENP | Entry into the national phase |
Ref document number: 20227016044 Country of ref document: KR Kind code of ref document: A |
|
ENP | Entry into the national phase |
Ref document number: 2022539707 Country of ref document: JP Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |