WO2019213867A1 - 区块链共识达成方法和装置 - Google Patents

区块链共识达成方法和装置 Download PDF

Info

Publication number
WO2019213867A1
WO2019213867A1 PCT/CN2018/086154 CN2018086154W WO2019213867A1 WO 2019213867 A1 WO2019213867 A1 WO 2019213867A1 CN 2018086154 W CN2018086154 W CN 2018086154W WO 2019213867 A1 WO2019213867 A1 WO 2019213867A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
blockchain
node
blockchain node
transaction
Prior art date
Application number
PCT/CN2018/086154
Other languages
English (en)
French (fr)
Inventor
张焱
施逸
Original Assignee
合肥达朴汇联科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 合肥达朴汇联科技有限公司 filed Critical 合肥达朴汇联科技有限公司
Priority to EP18918012.8A priority Critical patent/EP3793158A4/en
Priority to PCT/CN2018/086154 priority patent/WO2019213867A1/zh
Priority to US17/053,171 priority patent/US11483129B2/en
Publication of WO2019213867A1 publication Critical patent/WO2019213867A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/02Payment architectures, schemes or protocols involving a neutral party, e.g. certification authority, notary or trusted third party [TTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/22Payment schemes or models
    • G06Q20/223Payment schemes or models based on the use of peer-to-peer networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/36Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes
    • G06Q20/367Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes
    • G06Q20/3678Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes e-cash details, e.g. blinded, divisible or detecting double spending
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/389Keeping log of transactions for guaranteeing non-repudiation of a transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • G06Q20/4016Transaction verification involving fraud or risk level assessment in transaction processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic 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/3236Cryptographic 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
    • H04L9/3239Cryptographic 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 involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/46Secure multiparty computation, e.g. millionaire problem
    • H04L2209/463Electronic voting

Definitions

  • the present invention relates to the field of Internet technologies, and in particular, to a method and apparatus for achieving blockchain consensus.
  • Blockchain technology is a kind of distributed accounting technology, which has been decentralized, can not be falsified, and has received extensive attention without the advantages of third-party trust guarantee. Due to the distributed storage and decentralization of blockchain technology, the consensus mechanism is particularly important in blockchain technology. Among them, the Proof of Work consensus mechanism, the Proof of Stake consensus mechanism, and the Delegated Proof of Stake consensus mechanism are widely known.
  • the inventor has found that at least the following problems exist in the prior art: the workload proof consensus mechanism needs to consume a large amount of computing resources, and the equity proof consensus mechanism and the entrusted equity proof consensus mechanism have a certain degree.
  • the problem of centralization because the blockchain nodes of the block data structure in the blockchain network will receive token rewards, based on the above two consensus mechanisms, the blockchain nodes that initially hold more tokens will get more The opportunity to produce block data structures to obtain more tokens has led to a growing centralization of blockchain networks.
  • the present invention provides a method and apparatus for achieving blockchain consensus.
  • An aspect of an embodiment of the present invention provides a method for achieving a blockchain consensus, comprising: receiving election data sent by a blockchain node having a first account balance and/or a second account balance, each election data including: issuing Information of the blockchain node selected by the blockchain node of the election data; based on the election data received in the current round, the consensus blockchain node is determined from the blockchain nodes selected by the respective election data, so that The determined consensus blockchain node performs a block packing operation in a new round.
  • the value in the first account of each blockchain node is used to characterize the number of digital currencies possessed by the blockchain node
  • the value in the second account of each blockchain node is used to characterize the block The number of votes that the chain node has.
  • the method further includes: receiving transaction information sent by the blockchain node, determining whether the transaction information meets a preset condition, and determining a first value, where the first value is used to represent a transaction corresponding to the transaction information.
  • the added value in the second account of the blockchain node of the object provider sending the determined first value to the other block chain node, so that each block chain node stores the first value into the corresponding block In the chain database.
  • determining whether the transaction information meets the preset condition comprises: determining whether the transaction corresponding to the transaction information belongs to a consumable resource; and if yes, monitoring whether the transaction corresponding to the transaction information is purchased as a transaction corresponding to the transaction information. After the square block chain node is used, it is determined that the transaction information meets the preset condition.
  • the consumable resource includes at least one of the following: a network traffic data resource, and a computing power resource of the processor.
  • whether the transaction corresponding to the monitoring transaction information is used as a blockchain node of the transaction purchaser corresponding to the transaction information includes: receiving transaction feedback information sent by a blockchain node as a transaction purchaser, The transaction feedback information is used to determine whether the transaction object is used by the blockchain node; or, the usage log of the transaction object is obtained, and whether the transaction object is used as the blockchain node of the transaction object purchaser is determined according to the usage log.
  • each election data further includes: a second value and/or a third value.
  • the sum of the second values in the election data is not greater than the first account balance of the blockchain node, and the sum of the third values in the election data is not greater than the blockchain node. The second account balance.
  • the method further includes: obtaining a weight of the second value and a weight of the third value; and determining, according to the election data received in the current round, the consensus blockchain node from the blockchain node selected by each election data includes: Counting the sum of the second values corresponding to each of the selected blockchain nodes in the election data received in this round, and the corresponding blockchain nodes corresponding to the selected electoral data in the current round a sum of third values; for each selected block chain node, based on the sum of the second value corresponding to the block chain node and the weight of the second value, and the sum of the third values corresponding to the block chain node And the weight of the third value, the election score of the blockchain node is obtained; the selected blockchain nodes in the election data received in the current round are sorted according to the election score, and the pre-predetermined
  • the number of blockchain nodes is a consensus blockchain node, so that the determined consensus blockchain nodes sequentially perform block packing operations according to a preset rule in a new round.
  • obtaining the weight of the second value and the weight of the third value includes: counting the sum of the second value and the sum of the third values in the election data received in the current round; determining the weight of the second value and the third The weight of the value is such that the product of the sum of the second value and the weight of the second value is equal to the product of the sum of the third value and the weight of the third value.
  • the method further includes: determining, for each blockchain node that issues the election data, a fourth value, where the fourth value is equal to the third value of the election data sent by the blockchain node in the current round. a sum of values for characterizing a decrease from a second account of the blockchain node; transmitting the fourth value to other blockchain nodes such that each blockchain node will The fourth value is stored in the corresponding blockchain database.
  • the foregoing method further includes: after determining a predetermined number of consensus blockchain nodes, generating a non-repeating random number for each consensus blockchain node, so that the consensus blockchain nodes are in a new round
  • the block packing operation of the preset number of times is sequentially executed in the order of the corresponding random numbers.
  • a blockchain consensus achievement device including: a receiving module, configured to receive election data sent by a blockchain node having a first account balance and/or a second account balance. Each of the election data includes: information of a blockchain node selected by the blockchain node that issued the election data. a consensus module, configured to determine a consensus blockchain node from the blockchain nodes selected by each election data based on the election data received in the current round, so that the determined consensus blockchain node is in a new round Perform block packing operations.
  • the value in the first account of each blockchain node is used to characterize the number of digital currencies possessed by the blockchain node
  • the value in the second account of each blockchain node is used to characterize the block The number of votes that the chain node has.
  • the foregoing apparatus further includes: a ballot issuing module.
  • the receiving module is further configured to receive transaction information sent by the blockchain node.
  • a ballot issuing module configured to determine whether the transaction information meets a preset condition, and determining a first value, wherein the first value is used to represent the second account added to the blockchain node of the transaction provider corresponding to the transaction information The value is sent to the other block chain nodes, so that each block chain node stores the first value in its corresponding blockchain database.
  • the ballot issuing module is configured to determine whether the transaction corresponding to the transaction information belongs to a consumable resource; if yes, whether the transaction corresponding to the monitoring transaction information is used as a blockchain node of the transaction purchaser corresponding to the transaction information Finished; yes, the transaction information is determined to meet the pre-set conditions.
  • the consumable resource includes at least one of the following: a network traffic data resource, and a computing power resource of the processor.
  • a ballot issuing module configured to receive transaction feedback information sent by the blockchain node of the transaction purchaser, determine, according to the transaction feedback information, whether the transaction object is used by the blockchain node; or acquire the transaction object Using the log, it is judged based on the usage log whether the transaction object is used as the blockchain node of the transaction purchaser.
  • the election data further includes: a second value and/or a third value.
  • the sum of the second values in the election data is not greater than the first account balance of the blockchain node, and the sum of the third values in the election data is not greater than the blockchain node.
  • the consensus module is further configured to obtain the weight of the second value and the weight of the third value.
  • a consensus module configured to count the sum of the second values corresponding to each selected blockchain node in the election data received in the current round, and each selected region in the election data received in the current round a sum of third values corresponding to the block chain nodes; for each selected block chain node, according to the sum of the second value corresponding to the block chain node and the weight of the second value, and the corresponding blockchain node The sum of the third value and the weight of the third value obtain the election score of the block chain node; according to the election score, the selected blockchain node in the election data received in the current round is performed from high to low. Sorting, determining that the pre-preset number of blockchain nodes are consensus blockchain nodes, so that the consensus blockchain nodes sequentially perform block packing operations according to a preset rule in a new round.
  • the consensus module is configured to count the sum of the second value and the third value in the election data received in the current round; determine the weight of the second value and the weight of the third value to satisfy: The product of the sum of the values and the weight of the second value is equal to the product of the sum of the third value and the weight of the third value.
  • the consensus module is further configured to determine, for each blockchain node that issues the election data, a fourth value, where the fourth value is equal to the third of the election data sent by the blockchain node in the current round.
  • the sum of the values, the fourth value is used to characterize the reduced value from the second account of the blockchain node; the fourth value is sent to the other blockchain nodes so that each block chain node stores the fourth value in its Corresponding blockchain database.
  • the consensus module is further configured to generate a non-repeating random number for each consensus block chain node after determining a predetermined number of consensus blockchain nodes, so that each consensus block chain node is in a new round
  • the block packing operation of the preset number of times is sequentially executed in the order of the corresponding random numbers.
  • Another aspect of an embodiment of the present invention provides a computer system including a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor executing the program, as described above Methods.
  • Another aspect of an embodiment of the present invention provides a non-volatile storage medium storing computer-executable instructions that, when executed, are used to implement the method as described above.
  • Another aspect of an embodiment of the present invention provides a computer program comprising computer executable instructions that, when executed, are used to implement the method as described above.
  • the problem that the prior art needs to consume a large amount of computing resources of the blockchain node in an insignificant manner in the process of reaching the blockchain consensus can be at least partially solved/reduced/inhibited/even At least partially solving/alleviating/suppressing/even avoiding the centralization trend of the accumulation of digital currency generated by the prior art in the process of reaching the blockchain consensus in a few blockchain nodes, without wasting the blockchain nodes Under the premise of computing resources, the decentralization of the blockchain network can be largely maintained.
  • FIG. 1 schematically illustrates an exemplary system architecture in which a blockchain consensus achievement method and apparatus can be applied in accordance with an embodiment of the present invention
  • FIG. 2 is a flow chart schematically showing a method for achieving a blockchain consensus according to an embodiment of the present invention
  • FIG. 3 is a block diagram schematically showing a blockchain consensus achievement device according to an embodiment of the present invention.
  • FIG. 4 is a block diagram schematically showing a blockchain consensus achievement device according to another embodiment of the present invention.
  • FIG. 5 is a block diagram schematically showing a computer system suitable for implementing a blockchain consensus achievement method in accordance with an embodiment of the present invention.
  • FIG. 1 schematically illustrates an exemplary system architecture in which a blockchain consensus achievement method and apparatus can be applied in accordance with an embodiment of the present invention.
  • FIG. 1 is only an example of a system architecture to which the embodiments of the present invention may be applied, to help those skilled in the art understand the technical content of the present invention, but does not mean that the embodiments of the present invention may not be used in other embodiments.
  • the system architecture 100 may include blockchain nodes 101, 102, 103, 104, 105, 106, 107, 108, ... (not shown in other blockchain node diagrams),
  • a blockchain network is formed by the plurality of blockchain nodes, and each blockchain node corresponds to a blockchain database, and the plurality of blockchain nodes form a database storage system that can be operated cooperatively around the world.
  • Each blockchain node enjoys the same rights and obligations as all other blockchain nodes.
  • Each blockchain node will determine some blockchain nodes as consensus blockchain nodes through some consensus mechanism, and any consensus blockchain nodes
  • the corresponding blockchain database performs read and write operations, and other blockchain nodes complete synchronization according to a certain mechanism, thereby realizing consistent data in the blockchain database corresponding to all blockchain nodes in the blockchain network. .
  • the plurality of blockchain nodes are respectively deployed servers around the world, and each blockchain node may be a server or a server cluster, and the server/server cluster may be a server/server cluster providing various services, for example, using a terminal for a user.
  • the back-end management server provided by the website that the device browses (for example only).
  • the background management server may perform processing such as analyzing the received user request and the like, and feed back the processing result (for example, a web page, information, or data acquired or generated according to the user request) to the terminal device.
  • FIG. 2 is a flow chart schematically showing a blockchain consensus achievement method in accordance with an embodiment of the present invention.
  • the method includes receiving, at operation S201, election data issued by a blockchain node having a first account balance and/or a second account balance.
  • the value in the first account of each blockchain node is used to characterize the number of digital currencies that the blockchain node has, and the value in the second account of each blockchain node is used for Characterizes the number of votes that the blockchain node has.
  • the blockchain node having the first account balance refers to the blockchain node holding the digital currency
  • the blockchain node having the second account balance refers to the blockchain node holding the voter
  • the operation is performed in S201.
  • the source of the received election data may be: a blockchain node holding a digital currency, a blockchain node holding a ballot, and a blockchain node holding both a digital currency and a ballot.
  • the digital currency is the virtual currency in the blockchain network for the exchange
  • the ballot is the virtual currency different from the digital currency issued to the blockchain node according to certain rules.
  • the election data is used to represent the event that the blockchain node that issued the election data selects another blockchain node to vote for election, and each of the received election data includes: a blockchain node that issues the election data.
  • Information about the selected blockchain node For example, the blockchain node A issues an election data including the information of the blockchain node B selected by the blockchain node A, indicating that the blockchain node A selects the blockchain node B to vote.
  • the consensus blockchain node is determined from the blockchain nodes selected by the respective election data, so that the consensus blockchain node is in a new round. Perform block packing operations.
  • the method shown in FIG. 2 determines the consensus blockchain node by the election data sent by each blockchain node.
  • the blockchain node that issues the voting data is a blockchain node holding the ballot and/or digital currency.
  • the election data includes information of the blockchain node selected by the blockchain node that issues the election data, and the consensus blockchain node is determined from the blockchain nodes selected by the respective election data in one round.
  • the scheme does not need to consume the computing power of the blockchain node, and because the scheme elects the blockchain node by the ballot and the digital currency. By exerting influence, it can effectively avoid the development of the centralization trend of the blockchain consensus toward the aggregation of digital currencies in a few blockchain nodes, and maintain the decentralization characteristics of the blockchain network.
  • the method shown in FIG. 2 further includes: receiving transaction information sent by the blockchain node; determining whether the received transaction information meets a preset condition, and determining the first a value; the determined first value is sent to other blockchain nodes such that each block chain node stores the first value in its respective blockchain database.
  • the first value is used to represent a value added to the second account of the blockchain node that is the transaction provider corresponding to the transaction information.
  • This embodiment describes a scheme for issuing a ballot to a blockchain node.
  • the transaction information is information of an event that is traded between the blockchain nodes.
  • the blockchain node as the transaction provider may be a full node.
  • the blockchain node as the transaction purchaser can be a full node or a light node; the whole node is a zone capable of performing block data structure packing operations, capable of performing data recording operations, and capable of running smart contracts.
  • a block chain node while a light node cannot perform a block data structure packing operation and a data recording operation cannot run a smart contract, but a full account or a light node can have a first account and a second account.
  • the transaction information sent by the blockchain node includes at least one of the following: information of the transaction object, information of the transaction provider, and information of the purchaser of the transaction object.
  • the first value of the ballot is issued to the blockchain node as the transaction provider.
  • the identification information of the blockchain node as the transaction provider and the determined first value may be broadcast together to each blockchain node, so that each blockchain node having data recording capability will be provided as a transaction object.
  • the identification information of the blockchain node and the first value are stored in the respective blockchain database, so that the identification information of the blockchain node as the transaction provider is uniformly recorded in each blockchain database.
  • a numerical correspondence that is, a unified record of information that adds a first value to a second account of a blockchain node that is a transaction provider, the information is not tampered with on the blockchain database.
  • determining whether the transaction information meets the preset condition comprises: first determining whether the transaction corresponding to the transaction information belongs to a consumable resource, and when the transaction belongs to the consumable resource, monitoring the transaction corresponding to the transaction information. Whether the object is used as the blockchain node of the transaction purchaser corresponding to the transaction information, and if the corresponding transaction is used as the blockchain node of the transaction purchaser, it is determined that the transaction information meets the preset condition.
  • the consumable resource refers to a resource that will cease to exist once it is used, for example, one or more of a network traffic data resource, a computing power resource of a processor, and the like.
  • the consumable resources are directly traded between the blockchain nodes in the blockchain network, and the blockchain nodes serving as the transaction provider provide the consumed consumable resources as the transaction purchaser.
  • the blockchain node uses the consumable resources traded, and when the use is completed, the transaction is completed. That is, in the present embodiment, for the transaction of the consumable resource, when the transaction is completed, the first value may be determined according to the quantity and/or quality of the transaction, and the blockchain node that provides the consumable resource is issued.
  • a numerical ballot is provided to provide the blockchain node with the authority to participate in the electoral consensus blockchain node.
  • the so-called bifurcation problem refers to a special case, such as a network.
  • Delay the blockchain node of a production block data structure maliciously changes the location of the block data structure into the blockchain data structure, etc., resulting in bifurcation in the blockchain database, that is, two different chains are formed.
  • the consensus mechanism stipulates that all blockchain nodes should produce block data structures on the longest chain, the blockchain of the current production block data structure is uncertain because which chain will become the longest chain in the future.
  • nodes may simultaneously produce block data structures on two different chains, and this decision will lead to the problem that there are always multiple forks in the blockchain database.
  • the solution of the above embodiment utilizes the characteristic that the consumable resource cannot be reused, so that the transaction information of the consumable resource can not be recorded on another branch chain after being recorded on a forked chain of the blockchain database.
  • the transaction chain information is confirmed by each blockchain node and stored in the blockchain database, only the branch chain that will become the longest chain in the future will be saved.
  • the transaction information due to this choice as a blockchain node of the transaction provider, results in a significant reduction in the use of the chain in the blockchain database except for the longest chain.
  • each block chain node has the same number of digital currencies based on different bifurcation chains, and the consumable resources are irreversibly reusable, resulting in the provision of consumable resources.
  • the blockchain node will be at a disadvantage, so the blockchain node as the transaction provider will strictly monitor the consensus blockchain node of the production block data structure for the purpose of protecting its own interests, as a transaction provider.
  • the blockchain node selects the consensus blockchain node, it does not select the consensus blockchain nodes that are simultaneously maintained for the multiple forked chains. For the above two reasons, the above embodiment can improve the problem of improving the book balance.
  • whether the transaction corresponding to the monitoring transaction information is used by the blockchain node of the transaction purchaser corresponding to the transaction information includes at least the following two types.
  • a usage log of the transaction object is obtained, and it is determined according to the usage log whether the transaction object is used as a blockchain node of the transaction object purchaser.
  • the above embodiment is exemplarily illustrated by a specific example.
  • the block chain node A and the block chain node B perform transactions, the transaction object is a network traffic data resource, and the transaction object provider is a block chain node A, and the transaction object purchase party
  • the blockchain node A is a full node
  • the blockchain node B is a light node
  • the blockchain node B wants to use the network traffic data resource provided by the blockchain node A.
  • Receiving transaction information sent by the blockchain node A the transaction information includes a rule part: a quality parameter, a quantity, a price of the network traffic data resource of the transaction, information of the block chain node A, and information of the block chain node B.
  • the transaction information further comprises a digital signature of the transaction information, the digital signature of the transaction information comprising a first digital signature and a second digital signature, the first digital signature being generated based on a private part of the blockchain node B and a rule portion of the transaction information
  • the second digital signature is generated based on the private key of the blockchain node A, the first digital signature, and the rule portion of the transaction information.
  • the blockchain node that receives the transaction information sent by the blockchain node A verifies the digital signature of the transaction information through the public key of the blockchain node A and the public key of the blockchain node B, and the verification indicates that the transaction information is True and effective, since the transaction object is a network traffic data resource, that is, a consumable resource, the ticket issuing smart contract that is deployed in the blockchain database is triggered to run in the blockchain node of the current execution block data structure packing operation, and the ballot is issued.
  • the smart contract tracks and confirms the use of the network traffic data resource by the block chain node B.
  • the ballot issuing smart contract determines the first value according to the quality parameter and quantity of the network traffic data resource recorded in the transaction information, and The information of the block chain node A and the first value are sent to each block chain node, so that each block chain node saves the information of the block chain node A and the first value to the respective blockchain database after the consensus verification. Indicates that the first value is added to the second account of the blockchain node A.
  • each of the election data issued by the blockchain node having the first account balance and/or the second account balance is selected from the blockchain node selected by the blockchain node that issued the election data.
  • the second value and/or the third value are also included.
  • the sum of the second values in the election data is not greater than the first account balance of the blockchain node
  • the sum of the third values in the election data is not greater than the The second account balance of the blockchain node. That is to say, the second value contained in an election data represents the number of digital currencies in the first account cast by the election data, and the third value contained in the election data represents The number of votes in the second account cast by the election using the election data.
  • each blockchain node not only includes the information of the selected blockchain node, but also includes the blockchain node that issues the election data in selecting other blockchains.
  • the number of digital currencies and/or ballots used can be seen. Only when holding digital currency and/or ballots, blockchain nodes are eligible to issue election data, ie digital currency and ballots affect blocks in two ways. Election authority for the chain node.
  • determining the consensus blockchain node from the blockchain nodes selected by the respective election data based on the election data received in the current round includes:
  • the selected blockchain nodes in the election data received in the current round are sorted according to the election score from high to low, and the preset preset number of blockchain nodes are determined as the consensus blockchain nodes.
  • the consensus blockchain node is caused to sequentially perform the block packing operation according to a preset rule in a new round.
  • one or more election data of the blockchain node A are selected, and one or more election data of the blockchain node B are selected, and the blockchain node C is selected.
  • the sum of the second values in the election data of the selected blockchain node A is statistically selected, that is, the total number of digital currencies used to select the election data of the blockchain node A, and statistics Selecting the sum of the third values in the election data of the blockchain node A, that is, the total number of votes used to select the election data of the blockchain node A, such as the second in the election data of all the selected blockchain nodes A.
  • the sum of the values is x
  • the sum of the third values is y.
  • the sum of the respective second value and the third value are also calculated.
  • the election score L(A) of the blockchain node A can be obtained as follows:
  • the election score L(B) of the selected blockchain node B and the election score L(C) of the selected blockchain node C can be calculated. Sort the selected blockchain nodes in the election data received in this round according to the election score from high to low, assuming that the sort result is L(A)>L(C)>L(B), indicating selection The total weight of the electoral data of the blockchain node A as the consensus blockchain node is greater than the total weight of the electoral data of the selected blockchain node C as the consensus blockchain node is greater than the selected blockchain node B as the consensus blockchain node. The total weight of the election data.
  • the first two corresponding blockchain nodes A and C are selected as the consensus blockchain nodes, so that the consensus blockchain nodes A and C perform the block packing operations in sequence according to the preset rules in a new round, such as in the new one.
  • the block chain node A reads the data from the to-be-processed memory pool and packs the verified data into a block data structure and links the blockchain.
  • Node A corresponds to the blockchain database, and broadcasts other blockchain nodes, so that other blockchain nodes synchronously link the same block data structure into their corresponding blockchain databases to implement the blockchain database. Unified update. It is the turn of the blockchain node B to perform the block packing operation in the same way, and will not be described again.
  • the various implementation processes involved in operations S201-S202 of the method illustrated in FIG. 2 may be performed by an election smart contract deployed in a blockchain database.
  • the election smart contract When the predetermined election condition is satisfied, such as when the specified round period ends, when the specified block height is reached, etc., the election smart contract is triggered to start executing the receiving election data as described in the above embodiments, and determining the consensus area based on the election data.
  • the operation of the blockchain node It should be noted that the above mentioned various smart contracts, such as ballot issuing smart contracts, electing smart contracts, etc. Smart contracts are essentially code that can be triggered to execute, usually preset in the blockchain database.
  • the smart contract stored in the blockchain database is difficult to be tampered with, so the smart contract can be used to execute the preset code logic, and the execution process is not interfered by the blockchain node.
  • smart code is used to execute different code logic in a plurality of different operations, wherein different code logic can be executed by different smart contracts or by the same smart contract, and no limitation is imposed thereon.
  • the role of smart contracts is to ensure that blockchain nodes execute preset code logic to prevent blockchain nodes from doing evil.
  • the weight of the second value and the weight of the third value can affect the voting result. Therefore, the solution can adjust the weight of the second value and the weight of the third value to adjust the digital currency and the ballot in the election scenario.
  • the extent to which the election results can exert an impact which in turn can adjust the trend and extent of centralization throughout the blockchain network.
  • the method for obtaining the weight of the second value and the weight of the third value may be: counting the sum of the second value and the sum of the third values in the election data received in the current round; determining The weight of the second value and the weight of the third value are such that the product of the sum of the second value and the weight of the second value is equal to the product of the sum of the third value and the weight of the third value.
  • the blockchain node holding the digital currency and the blockchain node holding the ballot can participate in the election process.
  • the election smart contract receives the electoral data sent by the blockchain node holding the digital currency and the blockchain node holding the ballot, and each electoral data records the blockchain selected by the blockchain node that issued the election data.
  • the smart contract calculates the election score corresponding to each block chain node selected, and sorts all the selected block chain nodes according to the election score, and determines the first 100 selected block chain nodes as the consensus block.
  • the chain node rotates the block production in the next round according to the preset rules.
  • the digital currency used in each election data can be returned to the blockchain node that issued the election data.
  • the ballot paper used in each election data can be destroyed and not returned to the blockchain node that issued the election data.
  • the digital currency used in this election process can continue to be used by the blockchain nodes for transactions, and the ballot papers used in the election process cannot be used any more.
  • the method shown in FIG. 2 further includes, after operation S202, for a blockchain node that issues an election data, when the election data includes the second value, The balance of the first account of the blockchain node does not change due to the issuance of the election data.
  • the balance of the second account of the blockchain node is reduced due to the issuance of the election data.
  • a fourth value is determined, the fourth value being equal to the sum of the third values in the election data sent by the blockchain node in the current round, and the fourth value is used. Characterizing the decrease in the second account from the blockchain node.
  • the determined fourth value is sent to the other block chain nodes such that each block chain node stores the fourth value in its respective blockchain database.
  • blockchain node A issues a total of three election data
  • the third value in the first election data is 8
  • the third value in the second election data is 5
  • the third election The third value in the data is 0, and the third value in each election data indicates the number of votes cast by the blockchain node A for the piece of election data, that is, the election issued by the block chain node A in this round.
  • the sum of the third values in the data is 13, that is, a total of 13 votes are cast. These 13 votes are invalid and cannot be used any more. Therefore, the fourth value is determined to be 13, indicating that the node A is from the block chain.
  • the number of votes in the second account is reduced by 13, that is, the number of votes held by the blockchain node A is reduced by 13.
  • the identifier of the blockchain node A and the fourth value representing a certain value from the second account of the blockchain node A are broadcast together to each blockchain node, and are stored by each blockchain node.
  • the blockchain database records the number of votes used by each blockchain node in each round, and the number of votes in the second account is reduced. The record cannot be tampered with.
  • the method illustrated in FIG. 2 further includes: generating, for each consensus blockchain node, a non-repeating random number such that the consensus block
  • the chain node sequentially performs a preset number of block packing operations in the order of the corresponding random numbers in a new round. For example, after sorting the selected blockchain nodes according to the election score from high to low, determining that the first 100 blockchain nodes are consensus blockchain nodes, for each of the 100 blockchain nodes
  • the block chain node generates a non-repeating random number of 1 to 100, and the random number corresponding to each block chain node is not repeated, starting from the blockchain corresponding to 1 in the order of random numbers, in a new round.
  • the new round and the current round may be two adjacent rounds, or may be two rounds separated by several rounds, such as this round is the first round
  • the new round can be the second round, or the third round, the fourth round..., there is no limit here, as long as the next round is determined within the previous round.
  • the consensus blockchain node can be.
  • FIG. 3 schematically shows a block diagram of a blockchain consensus achievement device in accordance with an embodiment of the present invention.
  • the blockchain consensus achievement device 300 includes a receiving module 310 and a consensus module 320.
  • the receiving module 310 is configured to receive election data sent by the blockchain node having the first account balance and/or the second account balance.
  • Each of the election data includes: information of a blockchain node selected by the blockchain node that issues the election data.
  • the consensus module 320 is configured to determine a consensus blockchain node from the blockchain nodes selected by each election data based on the election data received in the current round, so that the determined consensus blockchain node is in a new round Perform block packing operations in .
  • the value in the first account of each blockchain node is used to characterize the number of digital currencies possessed by the blockchain node
  • the value in the second account of each blockchain node is used to characterize the block The number of votes that the chain node has.
  • the device shown in FIG. 3 determines the consensus blockchain node by the election data sent by each blockchain node.
  • the blockchain node that issues the voting data is a blockchain node holding the ballot and/or digital currency.
  • the election data includes information of the blockchain node selected by the blockchain node that issues the election data, and the consensus blockchain node is determined from the blockchain nodes selected by the respective election data in one round.
  • the scheme does not need to consume the computing power of the blockchain node, and because the scheme elects the blockchain node by the ballot and the digital currency. By exerting influence, it can effectively avoid the development of the centralization trend of the blockchain consensus toward the aggregation of digital currencies in a few blockchain nodes, and maintain the decentralization characteristics of the blockchain network.
  • the election data further includes: a second value and/or a third value; for the election data sent by each block chain node, the sum of the second values in the election data is not greater than the block The first account balance of the chain node, the sum of the third values in the election data is not greater than the second account balance of the blockchain node.
  • the consensus module 320 is further configured to obtain the weight of the second value and the weight of the third value, and the consensus module 320 determines the consensus area from the blockchain nodes selected by the respective election data based on the election data received in the current round.
  • the method of the block chain node may be: counting the sum of the second values corresponding to each selected blockchain node in the election data received in this round, and each of the election data received in the current round. The sum of the third values corresponding to the selected blockchain node.
  • the node is a consensus blockchain node, so that the consensus blockchain node sequentially performs a block packing operation according to a preset rule in a new round.
  • the manner in which the consensus module 320 obtains the weight of the second value and the weight of the third value may be: the consensus module 320 is configured to collect the sum of the second value and the sum of the third values in the election data received in the current round. Determining the weight of the second value and the weight of the third value such that the product of the sum of the second value and the weight of the second value is equal to the product of the sum of the third value and the weight of the third value.
  • the ballot is one-time, that is, the ballot paper used in the election data sent by each block chain node cannot be used again, and needs to be deducted from the second account of the corresponding block chain node. Therefore, the consensus module 320 is further configured to determine a fourth value for each blockchain node that issues the election data, the fourth value being equal to the sum of the third values in the election data sent by the blockchain node in the current round. The fourth value is used to characterize the reduced value from the second account of the blockchain node; the fourth value is sent to the other blockchain nodes such that each block chain node stores the fourth value in its respective correspondence In the blockchain database.
  • the consensus module 320 is further configured to: after determining a predetermined number of consensus blockchain nodes, generate a non-repeating random number for each consensus block chain node, so that the consensus block The chain node sequentially performs a preset number of block packing operations in the order of the corresponding random numbers in a new round.
  • FIG. 4 is a block diagram schematically showing a blockchain consensus achievement device in accordance with another embodiment of the present invention.
  • the blockchain consensus achievement device 400 includes a receiving module 310, a consensus module 320, and a ballot issuing module 330.
  • the receiving module 310 and the consensus module 320 have been described above, and the repeated portions are not described again. On the basis of this, the receiving module 310 is further configured to receive transaction information sent by the blockchain node.
  • the ballot issuing module 330 is configured to determine whether the transaction information meets a preset condition, and determine a first value, where the first value is used to represent a blockchain node that is a transaction provider corresponding to the transaction information. The added value in the second account; the first value is sent to other blockchain nodes such that each block chain node stores the first value in its corresponding blockchain database.
  • the ballot issuing module 330 is configured to determine whether the transaction corresponding to the transaction information belongs to a consumable resource; if yes, whether the transaction corresponding to the monitoring transaction information is used as a transaction purchaser corresponding to the transaction information.
  • the blockchain node is used; yes, it is determined that the transaction information meets the preset condition.
  • the consumable resource includes at least one of: a network traffic data resource, a computing power resource of the processor; and/or a ballot issuing module 330, configured to receive the buyer as a transaction object.
  • the transaction feedback information sent by the blockchain node determines whether the transaction object is used as the blockchain node of the transaction object purchaser according to the transaction feedback information; or, obtains the usage log of the transaction object, and judges the transaction object according to the usage log Whether it is used as a blockchain node of the purchaser of the transaction.
  • Any of a plurality of modules, sub-modules, units, sub-units, or at least some of the functions of any one of the plurality of modules, sub-modules, or any of the plurality of functions according to an embodiment of the present invention may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to an embodiment of the present invention may be implemented by being split into a plurality of modules.
  • any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present invention may be implemented at least in part as hardware circuits, such as Field Programmable Gate Arrays (FPGAs), Programmable Logic Arrays (PLAs), System-on-a-chip, system on a substrate, system on a package, an application specific integrated circuit (ASIC), or any other reasonable means of hardware or firmware that integrates or encapsulates the circuit, or in software, hardware, and firmware. Any one of the implementations or in any suitable combination of any of them.
  • one or more of the modules, sub-modules, units, sub-units in accordance with embodiments of the present invention may be implemented at least in part as a computer program module that, when executed, may perform the corresponding functions.
  • any of the receiving module 310, the consensus module 320, and the ballot issuing module 330 may be combined and implemented in one module, or any one of the modules may be split into multiple modules. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of the other modules and implemented in one module. According to an embodiment of the present invention, at least one of the receiving module 310, the consensus module 320, and the ballot issuing module 330 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA).
  • FPGA field programmable gate array
  • PDA programmable logic array
  • At least one of the receiving module 310, the consensus module 320, and the ballot issuing module 330 can be implemented at least in part as a computer program module that can perform the corresponding functions when the computer program module is executed.
  • FIG. 5 is a block diagram schematically showing a computer system suitable for implementing a blockchain consensus achievement method in accordance with an embodiment of the present invention.
  • the computer system shown in FIG. 5 is merely an example and should not impose any limitation on the function and scope of use of the embodiments of the present invention.
  • computer system 500 in accordance with an embodiment of the present invention includes a processor 501 that can be loaded into random access memory (RAM) 503 according to a program stored in read only memory (ROM) 502 or from storage portion 508.
  • the program performs various appropriate actions and processes.
  • Processor 501 can include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor, and/or a related chipset and/or a special purpose microprocessor (e.g., an application specific integrated circuit (ASIC)), and the like.
  • Processor 501 can also include an onboard memory for caching purposes.
  • Processor 501 can include a single processing unit or a plurality of processing units for performing different acts of a method flow in accordance with an embodiment of the present invention.
  • processor 501 In the RAM 503, various programs and data required for the operation of the system 500 are stored.
  • the processor 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504.
  • Processor 501 performs various operations of the method flow in accordance with embodiments of the present invention by executing programs in ROM 502 and/or RAM 503. It is noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503.
  • the processor 501 can also perform various operations of the method flow in accordance with an embodiment of the present invention by executing a program stored in the one or more memories.
  • System 500 may also include an input/output (I/O) interface 505 to which an input/output (I/O) interface 505 is also coupled, in accordance with an embodiment of the present invention.
  • System 500 can also include one or more of the following components coupled to I/O interface 505: an input portion 506 including a keyboard, mouse, etc.; including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker
  • An output portion 507 of the like a storage portion 508 including a hard disk or the like; and a communication portion 509 including a network interface card such as a LAN card, a modem, and the like.
  • the communication section 509 performs communication processing via a network such as the Internet.
  • Driver 510 is also coupled to I/O interface 505 as needed.
  • a removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory or the like is mounted on the drive 510 as needed so that a computer program read therefrom is installed into the storage portion 508 as needed.
  • a method flow according to an embodiment of the present invention may be implemented as a computer software program.
  • an embodiment of the invention includes a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for executing the method illustrated in the flowchart.
  • the computer program can be downloaded and installed from the network via the communication portion 509, and/or installed from the removable medium 511.
  • the above-described functions defined in the system of the embodiment of the present invention are performed.
  • the systems, devices, devices, modules, units, and the like described above may be implemented by a computer program module in accordance with an embodiment of the present invention.
  • the present invention also provides a computer readable medium, which may be included in the device/device/system described in the above embodiments; or may be separately present without being incorporated into the device/device/ In the system.
  • the computer readable medium carries one or more programs, and when the one or more programs are executed, implements the blockchain consensus achievement method described in the above embodiments.
  • the computer readable medium may be a computer readable signal medium or a computer readable storage medium or any combination of the two.
  • the computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
  • a computer readable storage medium may be any tangible medium that can contain or store a program, which can be used by or in connection with an instruction execution system, apparatus or device.
  • a computer readable signal medium may include a data signal that is propagated in the baseband or as part of a carrier, in which computer readable program code is carried. Such propagated data signals can take a variety of forms including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer readable signal medium can also be any computer readable medium other than a computer readable storage medium, which can transmit, propagate, or transport a program for use by or in connection with the instruction execution system, apparatus, or device.
  • Program code embodied on a computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wireline, optical cable, radio frequency signals, and the like, or any suitable combination of the foregoing.
  • a computer readable medium may include one or more memories other than ROM 502 and/or RAM 503 and/or ROM 502 and RAM 503 described above, in accordance with an embodiment of the present invention.
  • each block of the flowchart or block diagrams can represent a module, a program segment, or a portion of code that includes one or more Executable instructions.
  • the functions noted in the blocks may also occur in a different order than that illustrated in the drawings. For example, two successively represented blocks may in fact be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams or flowcharts, and combinations of blocks in the block diagrams or flowcharts can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be used A combination of dedicated hardware and computer instructions is implemented.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Finance (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明提供了一种区块链共识达成方法,包括:接收具有第一账户余额和/或第二账户余额的区块链节点发出的选举数据,每条选举数据包括:发出该选举数据的区块链节点所选择的区块链节点的信息;基于本轮次内接收到的选举数据,从各选举数据所选择的区块链节点中确定共识区块链节点,使得所确定的共识区块链节点在新一轮次中执行区块打包操作。其中,每个区块链节点的第一账户中的数值用于表征该区块链节点所具有的数字货币的数量,每个区块链节点的第二账户中的数值用于表征该区块链节点所具有的选票的数量。本发明还提供了一种区块链共识达成装置、计算机系统和计算机可读介质。

Description

区块链共识达成方法和装置 技术领域
本发明涉及互联网技术领域,更具体地,涉及一种区块链共识达成方法和装置。
背景技术
区块链技术是一种分布式记账技术,以其具有去中心化,不可篡改,无需第三方信任担保的优点而得到广泛重视。由于区块链技术分布式存储且去中心化的特点,共识机制在区块链技术中显得尤为重要。其中被广泛熟知的有工作量证明(Proof of Work)共识机制、权益证明(Proof of Stake)共识机制和委托权益证明(Delegated Proof of Stake)共识机制。
在实现本发明构思的过程中,发明人发现现有技术中至少存在如下问题:工作量证明共识机制需要耗费大量的算力资源,而权益证明共识机制和委托权益证明共识机制都存在一定程度的中心化的问题,由于在区块链网络中生产区块数据结构的区块链节点会获得代币奖励,基于上述两种共识机制中,初始持有代币多的区块链节点会得到更多的生产区块数据结构的机会,从而获得更多的代币,这就造成区块链网络越来越趋于中心化。
发明内容
有鉴于此,本发明提供了一种区块链共识达成方法和装置。
本发明实施例的一个方面提供了一种区块链共识达成方法,包括:接收具有第一账户余额和/或第二账户余额的区块链节点发出的选举数据,每条选举数据包括:发出该选举数据的区块链节点所选择的区块链节点的信息;基于本轮次内接收到的选举数据,从各选举数据所选择的区块链节点中确定共识区块链节点,使得所确定的共识区块链节点在新一轮次中执行区块打包操作。
其中,每个区块链节点的第一账户中的数值用于表征该区块链节点所具有的数字货币的数量,每个区块链节点的第二账户中的数值用于表征该区块链节点所具有的选票的数量。
可选的,上述方法还包括:接收区块链节点发出的交易信息,判断该交易信息是否符合预设条件,是则确定第一数值,第一数值用于表征向作为上述交易信息对应的交易物提供方的区块链节点的第二账户中增加的数值;将所确定的第一数值发送至其他区块链节点,以使各区块链节点将该第一数值存入各自对应的区块链数据库中。
可选的,上述判断交易信息是否符合预设条件包括:判断交易信息对应的交易物是否属于消耗性资源;是则,监听该交易信息对应的交易物是否被作为该交易信息对应的交易物购 买方的区块链节点使用完毕,是则确定该交易信息符合预设条件。
可选的,消耗性资源包括如下至少一项:网络流量数据资源,处理器的算力资源。并且/或者,上述监听交易信息对应的交易物是否被作为该交易信息对应的交易物购买方的区块链节点使用完毕包括:接收作为交易物购买方的区块链节点发送的交易反馈信息,根据交易反馈信息判断交易物是否被该区块链节点使用完毕;或者,获取交易物的使用日志,根据该使用日志判断交易物是否被作为交易物购买方的区块链节点使用完毕。
可选的,每条选举数据还包括:第二数值和/或第三数值。对于每个区块链节点发出的选举数据,选举数据中的第二数值的总和不大于该区块链节点的第一账户余额,选举数据中的第三数值的总和不大于该区块链节点的第二账户余额。
上述方法还包括获取第二数值的权重和第三数值的权重;则上述基于本轮次内接收到的选举数据,从各选举数据所选择的区块链节点中确定共识区块链节点包括:统计本轮次内接收到的选举数据中每个被选择的区块链节点对应的第二数值的总和,以及本轮次内接收到的选举数据中每个被选择的区块链节点对应的第三数值的总和;对于每个被选择的区块链节点,根据该区块链节点对应的第二数值的总和和第二数值的权重、以及该区块链节点对应的第三数值的总和和第三数值的权重,得到该区块链节点的选举分值;依据选举分值从高至低对本轮次内接收到的选举数据中被选择的区块链节点进行排序,确定前预设数量的区块链节点为共识区块链节点,使得所确定的共识区块链节点在新一轮次中按照预设规则依次执行区块打包操作。
可选的,获取第二数值的权重和第三数值的权重包括:统计本轮次内接收到的选举数据中第二数值的总和以及第三数值的总和;确定第二数值的权重和第三数值的权重,使满足:第二数值的总和与第二数值的权重的乘积等于第三数值的总和与第三数值的权重的乘积。
可选的,上述方法还包括:对于发出选举数据的每个区块链节点,确定第四数值,所述第四数值等于该区块链节点在本轮次内发出的选举数据中第三数值的总和,,所述第四数值用于表征从该区块链节点的第二账户中减少的数值;将所述第四数值发送至其他区块链节点,以使各区块链节点将所述第四数值存入各自对应的区块链数据库中。
可选的,上述方法还包括:在确定预定数量的共识区块链节点之后,对于每个共识区块链节点,生成不重复的随机数,使得各共识区块链节点在新一轮次中按照相应的随机数的顺序依次执行预设次数的区块打包操作。
本发明实施例的另一方面提供了一种区块链共识达成装置,包括:接收模块,用于接收具有第一账户余额和/或第二账户余额的区块链节点发出的选举数据。其中每条选举数据包括:发出该选举数据的区块链节点所选择的区块链节点的信息。共识模块,用于基于本轮次内接 收到的选举数据,从各选举数据所选择的区块链节点中确定共识区块链节点,使得所确定的共识区块链节点在新一轮次中执行区块打包操作。
其中,每个区块链节点的第一账户中的数值用于表征该区块链节点所具有的数字货币的数量,每个区块链节点的第二账户中的数值用于表征该区块链节点所具有的选票的数量。
可选的,上述装置还包括:选票发放模块。接收模块,还用于接收区块链节点发出的交易信息。选票发放模块,用于判断交易信息是否符合预设条件,是则确定第一数值,第一数值用于表征向作为交易信息对应的交易物提供方的区块链节点的第二账户中增加的数值;将所确定的第一数值发送至其他区块链节点,以使各区块链节点将第一数值存入各自对应的区块链数据库中。
可选的,选票发放模块,用于判断交易信息对应的交易物是否属于消耗性资源;是则,监听交易信息对应的交易物是否被作为交易信息对应的交易物购买方的区块链节点使用完毕;是则,确定交易信息符合预设条件。
可选的,消耗性资源包括如下至少一项:网络流量数据资源,处理器的算力资源。并且/或者,选票发放模块,用于接收作为交易物购买方的区块链节点发送的交易反馈信息,根据交易反馈信息判断交易物是否被该区块链节点使用完毕;或者,获取交易物的使用日志,根据使用日志判断交易物是否被作为交易物购买方的区块链节点使用完毕。
可选的,选举数据还包括:第二数值和/或第三数值。对于每个区块链节点发出的选举数据,选举数据中的第二数值的总和不大于该区块链节点的第一账户余额,选举数据中的第三数值的总和不大于该区块链节点的第二账户余额。共识模块,还用于获取第二数值的权重和第三数值的权重。共识模块,用于统计本轮次内接收到的选举数据中每个被选择的区块链节点对应的第二数值的总和,以及本轮次内接收到的选举数据中每个被选择的区块链节点对应的第三数值的总和;对于每个被选择的区块链节点,根据该区块链节点对应的第二数值的总和和第二数值的权重、以及该区块链节点对应的第三数值的总和和第三数值的权重,得到该区块链节点的选举分值;依据选举分值从高至低对本轮次内接收到的选举数据中被选择的区块链节点进行排序,确定前预设数量的区块链节点为共识区块链节点,使得所述共识区块链节点在新一轮次中按照预设规则依次执行区块打包操作。
可选的,共识模块,用于统计本轮次内接收到的选举数据中第二数值的总和以及第三数值的总和;确定第二数值的权重和第三数值的权重,使满足:第二数值的总和与第二数值的权重的乘积等于第三数值的总和与第三数值的权重的乘积。
可选的,共识模块,还用于对于发出选举数据的每个区块链节点,确定第四数值,所述第四数值等于该区块链节点在本轮次内发出的选举数据中第三数值的总和,第四数值用于表 征从该区块链节点的第二账户中减少的数值;将第四数值发送至其他区块链节点,以使各区块链节点将第四数值存入各自对应的区块链数据库中。
可选的,共识模块,还用于在确定预定数量的共识区块链节点之后,对于每个共识区块链节点,生成不重复的随机数,使得各共识区块链节点在新一轮次中按照相应的随机数的顺序依次执行预设次数的区块打包操作。
本发明实施例的另一方面提供了一种计算机系统,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时,实现如上所述的方法。
本发明实施例的另一方面提供了一种非易失性存储介质,存储有计算机可执行指令,所述指令在被执行时用于实现如上所述的方法。
本发明实施例的另一方面提供了一种计算机程序,所述计算机程序包括计算机可执行指令,所述指令在被执行时用于实现如上所述的方法。
根据本发明的实施例,可以至少部分地解决/减轻/抑制/甚至避免现有技术在达成区块链共识的过程中需要无意义地消耗区块链节点的大量算力资源的问题,以及可以至少部分地解决/减轻/抑制/甚至避免现有技术在达成区块链共识的过程中所产生的数字货币在少数区块链节点中聚集的中心化发展趋势,在不浪费区块链节点的算力资源的前提下能够很大程度上维持区块链网络的去中心化特点。
附图说明
通过以下参照附图对本发明实施例的描述,本发明的上述以及其他目的、特征和优点将更为清楚,在附图中:
图1示意性示出了根据本发明实施例的可以应用区块链共识达成方法和装置的示例性系统架构;
图2示意性示出了根据本发明实施例的区块链共识达成方法的流程图;
图3示意性示出了根据本发明实施例的区块链共识达成装置的框图;
图4示意性示出了根据本发明另一实施例的区块链共识达成装置的框图;
图5示意性示出了根据本发明实施例的适于实现区块链共识达成方法的计算机系统的方框图。
具体实施方式
以下,将参照附图来描述本发明的实施例。但是应该理解,这些描述只是示例性的,而并非要限制本发明的范围。在下面的详细描述中,为便于解释,阐述了许多具体的细节以提 供对本发明实施例的全面理解。然而,明显地,一个或多个实施例在没有这些具体细节的情况下也可以被实施。此外,在以下说明中,省略了对公知结构和技术的描述,以避免不必要地混淆本发明的概念。
在此使用的术语仅仅是为了描述具体实施例,而并非意在限制本发明。在此使用的术语“包括”、“包含”等表明了所述特征、步骤、操作和/或部件的存在,但是并不排除存在或添加一个或多个其他特征、步骤、操作或部件。
在此使用的所有术语(包括技术和科学术语)具有本领域技术人员通常所理解的含义,除非另外定义。应注意,这里使用的术语应解释为具有与本说明书的上下文相一致的含义,而不应以理想化或过于刻板的方式来解释。
在使用类似于“A、B和C等中至少一个”这样的表述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B和C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。在使用类似于“A、B或C等中至少一个”这样的表述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B或C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。本领域技术人员还应理解,实质上任意表示两个或更多可选项目的转折连词和/或短语,无论是在说明书、权利要求书还是附图中,都应被理解为给出了包括这些项目之一、这些项目任一方、或两个项目的可能性。例如,短语“A或B”应当被理解为包括“A”或“B”、或“A和B”的可能性。
图1示意性示出了根据本发明实施例的可以应用区块链共识达成方法和装置的示例性系统架构。需要注意的是,图1所示仅为可以应用本发明实施例的系统架构的示例,以帮助本领域技术人员理解本发明的技术内容,但并不意味着本发明实施例不可以用于其他设备、系统、环境或场景。
如图1所示,根据该实施例的系统架构100可以包括区块链节点101、102、103、104、105、106、107、108……(其他区块链节点图中未示出),由这多个区块链节点构成区块链网络,每个区块链节点对应一个区块链数据库,这多个区块链节点形成了一个分布在全球各地、能够协同运转的数据库存储系统,各区块链节点享有同其他所有区块链节点同样的权利与义务,各区块链节点会通过某种共识机制来确定一些区块链节点作为共识区块链节点,任意一个共识区块链节点在其对应的区块链数据库中进行读写操作,其他区块链节点会根据某种机制完成同步,从而实现在区块链网络中所有区块链节点对应的区块链数据库中的数据完全一 致。
这多个区块链节点分别是部署于全球各地的服务器,每个区块链节点可以是服务器或服务器集群,服务器/服务器集群可以是提供各种服务的服务器/服务器集群,例如对用户利用终端设备所浏览的网站提供支持的后台管理服务器(仅为示例)。后台管理服务器可以对接收到的用户请求等数据进行分析等处理,并将处理结果(例如根据用户请求获取或生成的网页、信息、或数据等)反馈给终端设备。
应该理解,图1示出的区块链节点的数目仅仅是示意性的。根据实现需要,可以具有任意数目的区块链节点。
图2示意性示出了根据本发明实施例的区块链共识达成方法的流程图。
如图2所示,该方法包括在操作S201,接收具有第一账户余额和/或第二账户余额的区块链节点发出的选举数据。
需要预先说明的是,每个区块链节点的第一账户中的数值用于表征该区块链节点所具有的数字货币的数量,每个区块链节点的第二账户中的数值用于表征该区块链节点所具有的选票的数量。具有第一账户余额的区块链节点是指持有数字货币的区块链节点,具有第二账户余额的区块链节点是指是指持有选票的区块链节点,则操作S201中所接收的选举数据的来源可以是:持有数字货币的区块链节点,持有选票的区块链节点,既持有数字货币又持有选票的区块链节点。其中数字货币是区块链网络中进行交易所流通的虚拟货币,而选票是依据一定规则发放给区块链节点的不同于数字货币的虚拟货币。
本操作中,选举数据用于表征发出该选举数据的区块链节点选择一个其他区块链节点进行投票选举的事件,所接收的每条选举数据中包括:发出该选举数据的区块链节点所选择的区块链节点的信息。例如,区块链节点A发出一条选举数据,该选举数据中包括区块链节点A所选择的区块链节点B的信息,表示区块链节点A选择区块链节点B进行投票选举。
然后,在操作S202,基于本轮次内接收到的选举数据,从各选举数据所选择的区块链节点中确定共识区块链节点,使得所述共识区块链节点在新一轮次中执行区块打包操作。
可见,图2所示的方法通过各区块链节点发出的选举数据来确定共识区块链节点,具体地,发出投票数据的区块链节点是持有选票和/或数字货币的区块链节点,选举数据中包含发出选举数据的区块链节点所选择的区块链节点的信息,在一个轮次内从各选举数据所选择的区块链节点中确定共识区块链节点。与现有技术中确定共识区块链节点的方案相比,本方案不需要消耗区块链节点的算力资源,且由于本方案通过选票和数字货币两种方式对区块链节点的选举权限施加影响,能够有效地避免区块链共识向着数字货币在少数区块链节点中聚集的中心化趋势发展,维持区块链网络的去中心化特点。
在本发明的一个实施例中,图2所示的方法在操作S201之前,还包括:接收区块链节点发出的交易信息;判断所接收的交易信息是否符合预设条件,是则确定第一数值;将所确定的第一数值发送至其他区块链节点,以使各区块链节点将所述第一数值存入各自对应的区块链数据库中。其中,第一数值用于表征向作为交易信息对应的交易物提供方的区块链节点的第二账户中增加的数值。本实施例描述了向区块链节点发放选票的方案,交易信息为区块链节点之间进行交易的事件的信息,在不同情况下,作为交易物提供方的区块链节点可以是全节点也可以是轻节点,作为交易物购买方的区块链节点可以是全节点也可以是轻节点;全节点是能够执行区块数据结构打包操作、能够执行数据记录操作、能够运行智能合约的区块链节点,而轻节点无法执行区块数据结构打包操作和数据记录操作也不能运行智能合约,但无论全节点还是轻节点,都可以具有第一账户和第二账户。
区块链节点发出的交易信息中包括如下至少一项:交易物的信息,交易物提供方的信息,交易物购买方的信息。当判定交易信息符合预设条件时,对作为交易物提供方的区块链节点发放第一数值的选票。发放选票时,可以将作为交易物提供方的区块链节点的标识信息以及所确定的第一数值一同广播至各区块链节点,使得各具有数据记录能力的各区块链节点将作为交易物提供方的区块链节点的标识信息和第一数值对应存入各自的区块链数据库中,以在各区块链数据库中都统一记录了作为交易物提供方的区块链节点的标识信息和第一数值的对应关系,即统一记录了表征向作为交易物提供方的区块链节点的第二账户增加第一数值的信息,该信息在区块链数据库上,不会被篡改。
在本发明的一个实施例中,上述判断交易信息是否符合预设条件包括:首先判断交易信息对应的交易物是否属于消耗性资源,当交易物属于消耗性资源时,再监听交易信息对应的交易物是否被作为该交易信息对应的交易物购买方的区块链节点使用完毕,如果相应的交易物被作为交易物购买方的区块链节点使用完毕,确定该交易信息符合预设条件。
具体地,消耗性资源是指一旦被使用将不复存在的资源,例如可以是网络流量数据资源、处理器的算力资源等一种或多种。在本实施例中,消耗性资源直接在区块链网络中的区块链节点之间进行交易,作为交易物提供方的区块链节点提供所交易的消耗性资源,作为交易物购买方的区块链节点使用所交易的消耗性资源,使用完毕即表示交易完成。即在本实施例中,对于消耗性资源的交易,当交易完成时,可以根据交易物的数量和/或质量,确定第一数值具体为多少,对提供消耗性资源的区块链节点发放第一数值的选票,以提供该区块链节点参与选举共识区块链节点的权限。
比较而言,现有技术中的权益证明共识机制和委托权益证明共识机制容易产生账本分叉问题(nothing-at-stake problem),所谓账本分叉问题是指在某些特殊情况下,如网络延迟、某 个生产区块数据结构的区块链节点恶意改变区块数据结构链入区块链数据结构的位置等原因,导致区块链数据库中出现分叉,即形成两条不同的链。虽然共识机制中规定所有区块链节点应在最长链上生产区块数据结构,但由于哪一条链会在将来成为最长链具有不确定性,所以当前生产区块数据结构的区块链节点为了将自己的利益最大化,有可能同时在两条不同的链上生产区块数据结构,而这种决策就会导致区块链数据库中永远有多条分叉同时存在的问题。而上述实施例的方案利用了消耗性资源无法重复使用的特性,使得消耗性资源的交易信息在区块链数据库的一条分叉链上被记录后则无法再在另一条分叉链上被记录,进而使得作为交易物提供方的区块链节点为了确保自己的交易信息被各区块链节点确认并保存于区块链数据库中,将仅选择通过未来会成为最长链的分叉链保存相应的交易信息,由于作为交易物提供方的区块链节点的这种选择,导致了区块链数据库中除最长链以外其余链的使用率大大减少。另外,若区块链数据库产生多条分叉链,每个区块链节点基于不同分叉链拥有相同数量的数字货币,又由于消耗性资源不可复重复使用的特性,导致提供消耗性资源的区块链节点将会处于劣势,因此作为交易物提供方的区块链节点出于保护自己利益的目的,会对生产区块数据结构的共识区块链节点严格监视,在作为交易物提供方的区块链节点选择共识区块链节点时,不会选择那些对多条分叉链同时维护的共识区块链节点。出于以上两个方面的原因,上述实施例可以改善改善账本分叉问题。
在本发明的一个实施例中,在确定交易信息属于消耗性资源时,上述监听交易信息对应的交易物是否被作为交易信息对应的交易物购买方的区块链节点使用完毕至少包括以下两种方式:接收作为交易物购买方的区块链节点发送的交易反馈信息,根据该交易反馈信息判断交易物是否被该作为交易物购买方的区块链节点使用完毕。或者,获取交易物的使用日志,根据该使用日志判断交易物是否被作为交易物购买方的区块链节点使用完毕。
以一个具体的例子示例性地说明上述实施例,区块链节点A与区块链节点B进行交易,交易物为网络流量数据资源,交易物提供方为区块链节点A,交易物购买方为区块链节点B,区块链节点A为全节点,区块链节点B为轻节点,区块链节点B欲使用区块链节点A提供的网络流量数据资源。接收区块链节点A发出的交易信息,该交易信息包括规则部分:交易的网络流量数据资源的质量参数、数量、价格,区块链节点A的信息,区块链节点B的信息。优选地,交易信息还包括交易信息的数字签名,交易信息的数字签名包括第一数字签名和第二数字签名,第一数字签名是基于区块链节点B的私钥和交易信息的规则部分生成的,第二数字签名是基于区块链节点A的私钥、第一数字签名和交易信息的规则部分生成的。收到区块链节点A发出的交易信息的区块链节点通过区块链节点A的公钥和区块链节点B的公钥对交易信息的数字签名进行验证,验证通过说明该交易信息是真实有效的,由于交易物是网络 流量数据资源即消耗性资源,触发部署于区块链数据库中的选票发放智能合约在当前执行区块数据结构打包操作的区块链节点中运行,该选票发放智能合约跟踪并确认区块链节点B对网络流量数据资源的使用情况,当使用结束时,选票发放智能合约根据交易信息中记录的网络流量数据资源的质量参数和数量,确定第一数值,将区块链节点A的信息和第一数值发送至各区块链节点,使得各区块链节点通过共识验证后将区块链节点A的信息和第一数值对应保存至各自的区块链数据库中,表示向区块链节点A的第二账户中增加第一数值的选票。
在本发明的一个实施例中,具有第一账户余额和/或第二账户余额的区块链节点所发出的每条选举数据除了发出该选举数据的区块链节点所选择的区块链节点的信息之外,还包括:第二数值和/或第三数值。其中,对于每个区块链节点发出的选举数据,该选举数据中的第二数值的总和不大于该区块链节点的第一账户余额,该选举数据中的第三数值的总和不大于该区块链节点的第二账户余额。也就是说,一条选举数据中所包含的第二数值表征了利用该条选举数据进行选举所投出的第一账户中的数字货币的数量,该条选举数据中所包含的第三数值表征了利用该条选举数据进行选举所投出的第二账户中的选票的数量。各区块链节点在选举共识区块链节点的过程中,所发出的选举数据中不仅包括被选择的区块链节点的信息,还包括发出该选举数据的区块链节点在选择其他区块链时所使用的数字货币和/或选票的数量,可见,只有在持有数字货币和/或选票时,区块链节点才有资格发出选举数据,即数字货币和选票从两个方面影响区块链节点的选举权限。
在接收到各区块链节点在本轮次内发出的选举数据之后,为了基于本轮次内接收到的选举数据,从各选举数据所选择的区块链节点中确定共识区块链节点,需要先获取第二数值的权重和第三数值的权重。在本发明的实施例中,第二数值的权重表征数字货币在进行选举情景下所占的权重,第三数值的权重表征选票在进行选举情景下所占的权重。则图2中操作S202基于本轮次内接收到的选举数据,从各选举数据所选择的区块链节点中确定共识区块链节点包括:
在操作S2021,统计本轮次内接收到的选举数据中每个被选择的区块链节点对应的第二数值的总和,以及本轮次内接收到的选举数据中每个被选择的区块链节点对应的第三数值的总和。
在操作S2022,对于每个被选择的区块链节点,根据该区块链节点对应的第二数值的总和和第二数值的权重、以及该区块链节点对应的第三数值的总和和第三数值的权重,得到该区块链节点的选举分值。
在操作S2023,依据选举分值从高至低对本轮次内接收到的选举数据中被选择的区块链节点进行排序,确定前预设数量的区块链节点为共识区块链节点,使得所述共识区块链节点 在新一轮次中按照预设规则依次执行区块打包操作。
例如,在本轮次内接收到的选举数据中,选择区块链节点A的选举数据有一条或多条,选择区块链节点B的选举数据有一条或多条,选择区块链节点C的选举数据有一条或多条。对于被选择的区块链节点A,统计选择区块链节点A的选举数据中的第二数值的总和,即统计选择区块链节点A的选举数据所使用的数字货币的总数量,以及统计选择区块链节点A的选举数据中的第三数值的总和,即统计选择区块链节点A的选举数据所使用的选票的总数量,如所有选择区块链节点A的选举数据中第二数值的总和是x、第三数值的总和是y。对于被选择的区块链节点B和C中的每一个,同理也计算各自对应的第二数值的总和和第三数值的总和。
已获知第二数值的权重为a,第三数值的权重为b。对于被选择的区块链节点A,根据该区块链节点对应的第二数值的总和和第二数值的权重、以及该区块链节点对应的第三数值的总和和第三数值的权重,可以通过如下方式得到该区块链节点A的选举分值L(A):
L(A)=a×x+b×y
同理,可以计算被选择的区块链节点B的选举分值L(B)和被选择的区块链节点C的选举分值L(C)。依据选举分值从高至低对本轮次内接收到的选举数据中被选择的区块链节点进行排序,假设排序结果是L(A)>L(C)>L(B),表示选择区块链节点A作为共识区块链节点的选举数据的总权重大于选择区块链节点C作为共识区块链节点的选举数据的总权重大于选择区块链节点B作为共识区块链节点的选举数据的总权重。选择前2个对应的区块链节点A、C为共识区块链节点,使得共识区块链节点A和C在新一轮次中按照预设规则依次执行区块打包操作,如在新一轮次中,当轮到区块链节点A执行区块打包操作时,区块链节点A从待处理内存池中读取数据并将通过验证的数据打包为区块数据结构链入区块链节点A对应的区块链数据库中,并广播告知其他区块链节点,使得其他区块链节点将同样的区块数据结构同步地链入各自对应的区块链数据库中,实现区块链数据库的统一更新。轮到区块链节点B执行区块打包操作同理,不再赘述。
在上述实施例中,图2所示方法的操作S201-S202中所涉及的各实施过程可以由部署在区块链数据库中的选举智能合约执行。当预先规定的选举条件满足时,如规定轮次周期结束时、规定区块高度达到时等,选举智能合约被触发开始执行如上文中各实施例所述的接收选举数据、基于选举数据确定共识区块链节点的操作。需要说明的是,前文中提到了各种智能合约,如选票发放智能合约、选举智能合约等,智能合约本质上是可以被触发执行的代码,通常预置于区块链数据库中。而区块链数据库中存储的智能合约难以被篡改,因而智能合约就可用于执行预设的代码逻辑,执行过程不受区块链节点干预。在本说明书实施例中,在多 个不同的操作中使用智能合约执行不同的代码逻辑,其中,不同的代码逻辑可以通过不同的智能合约执行,也可以通过同一智能合约执行,对此不做限制。总之,智能合约的作用是保证区块链节点执行预设的代码逻辑,防止区块链节点作恶。
由上述实施例可知,第二数值的权重和第三数值的权重能够影响投票结果,因此本方案可以通过控制第二数值的权重和第三数值的权重来调整选举情境下数字货币和选票分别对选举结果能够施加的影响的程度,进而能够调整整个区块链网络中中心化的趋势和程度。在本发明的一个实施例中,上述获取第二数值的权重和第三数值的权重方式可以是:统计本轮次内接收到的选举数据中第二数值的总和以及第三数值的总和;确定第二数值的权重和第三数值的权重,使满足:第二数值的总和与第二数值的权重的乘积等于第三数值的总和与第三数值的权重的乘积。
例如,在新一轮次开始时,持有数字货币的区块链节点和持有选票的区块链节点可以共同参加选举过程。为了使得数字货币和选票对于选举结构所能施加的影响程度大致平衡,在本例中令在本轮次内接收的所有选举数据所使用的数字货币的总权重和所使用的选票的总权重之比为1比1。如本轮次内全部选举数据共使用了500个数字货币,本轮次内全部选举数据共使用了100张选票,则每个数字货币的权重为0.5/500=0.001,每张选票所占权重为0.5/100=0.005,即第二数值的权重为0.001,第三数值的权重为0.005。选举智能合约接收持有数字货币的区块链节点和持有选票的区块链节点发出的选举数据,每条选举数据中记录有发出该条选举数据的区块链节点所选择的区块链节点的信息、第二数值和/或第三数值。智能合约计算被选择的每个区块链节点对应的选举分值,并按照选举分值将被选择的所有区块链节点进行排序,确定前100个被选择的区块链节点作为共识区块链节点在下一轮次中按照预设规则轮流进行区块生产。
在确定新一轮次的共识区块链节点之后,即选举过程结束后,可以将每条选举数据中所用的数字货币返回给发出该选举数据的区块链节点。可以将每条选举数据中所用的选票销毁,不返回给发出该选举数据的区块链节点。这样选举过程所用的数字货币可以继续被区块链节点用于进行交易,而选举过程所用的选票则不可以再做任何使用。为此,在本发明的一个实施例中,图2所示的方法在操作S202之后还包括:对于发出一条选举数据的一个区块链节点来说,当该选举数据中包含第二数值时,该区块链节点的第一账户的余额不因为发出选举数据而变化,当该选举数据中包含第三数值时,该区块链节点的第二账户的余额会因为发出选举数据而减少。具体地,对于发出选举数据的每个区块链节点,确定第四数值,该第四数值等于该区块链节点在本轮次内发出的选举数据中第三数值的总和,第四数值用于表征从该区块链节点的第二账户中减少的数值。将所确定的第四数值发送至其他区块链节点,以使各区 块链节点将所述第四数值存入各自对应的区块链数据库中。
例如,在本轮次内,区块链节点A共发出3条选举数据,第1条选举数据中的第三数值为8,第2条选举数据中的第三数值为5,第3条选举数据中的第三数值为0,每条选举数据中的第三数值表示区块链节点A为该条选举数据所投出的选票的数量,即本轮次内区块链节点A发出的选举数据中的第三数值的总和为13,即共投出13张选票,这13张选票用过即无效,不能再继续使用,因此确定第四数值为13,表示从区块链节点A的第二账户中减少13,即区块链节点A持有的选票数量减少13张。为了使得该过程更加安全可靠,将区块链节点A的标识和表示从区块链节点A的第二账户减少一定数值的第四数值一同广播至各区块链节点,由各区块链节点存入各自对应的区块链数据库中,这样区块链数据库中就记录了每一轮次各区块链节点使用了多少选票、第二账户中减少了多少选票的信息,该记录不可被篡改。
在本发明的一个实施例中,在确定预定数量的共识区块链节点之后,图2所示的方法还包括:对于每个共识区块链节点,生成不重复的随机数,使得共识区块链节点在新一轮次中按照相应的随机数的顺序依次执行预设次数的区块打包操作。例如,在依据选举分值从高到低为被选择的区块链节点排序后,确定前100个区块链节点为共识区块链节点,对于这100个区块链节点中的每个区块链节点,生成一个1~100的不重复的随机数,且各区块链节点对应的随机数不重复,按照随机数的顺序从对应于1的区块链开始,在一个新轮次中依次进行区块打包操作。本例中的数值均为示意性举例,不对本发明做出任何限制。在本方案中,所述新一轮次和所述本轮次可以是相邻的两个轮次,也可以是间隔几个轮次的两个轮次,如本轮次是第1轮次,新一轮次可以是第2轮次,也可以是第3轮次、第4轮次……,在此不做限制,只要是在在先的轮次内确定出在后的轮次的共识区块链节点即可。
图3示意性示出了根据本发明实施例的区块链共识达成装置的框图。
如图3所示,该区块链共识达成装置300包括:接收模块310和共识模块320。
接收模块310,用于接收具有第一账户余额和/或第二账户余额的区块链节点发出的选举数据。
其中,每条选举数据包括:发出该选举数据的区块链节点所选择的区块链节点的信息。
共识模块320,用于基于本轮次内接收到的选举数据,从各选举数据所选择的区块链节点中确定共识区块链节点,使得所确定的共识区块链节点在新一轮次中执行区块打包操作。
其中,每个区块链节点的第一账户中的数值用于表征该区块链节点所具有的数字货币的数量,每个区块链节点的第二账户中的数值用于表征该区块链节点所具有的选票的数量。
可见,图3所示的装置通过各区块链节点发出的选举数据来确定共识区块链节点,具体地,发出投票数据的区块链节点是持有选票和/或数字货币的区块链节点,选举数据中包含发 出选举数据的区块链节点所选择的区块链节点的信息,在一个轮次内从各选举数据所选择的区块链节点中确定共识区块链节点。与现有技术中确定共识区块链节点的方案相比,本方案不需要消耗区块链节点的算力资源,且由于本方案通过选票和数字货币两种方式对区块链节点的选举权限施加影响,能够有效地避免区块链共识向着数字货币在少数区块链节点中聚集的中心化趋势发展,维持区块链网络的去中心化特点。
在本发明的一个实施例中,选举数据还包括:第二数值和/或第三数值;对于每个区块链节点发出的选举数据,选举数据中的第二数值的总和不大于该区块链节点的第一账户余额,选举数据中的第三数值的总和不大于该区块链节点的第二账户余额。
共识模块320,还用于获取第二数值的权重和第三数值的权重,则共识模块320基于本轮次内接收到的选举数据,从各选举数据所选择的区块链节点中确定共识区块链节点的方式可以是:统计本轮次内接收到的选举数据中每个被选择的区块链节点对应的第二数值的总和,以及本轮次内接收到的选举数据中每个被选择的区块链节点对应的第三数值的总和。对于每个被选择的区块链节点,根据该区块链节点对应的第二数值的总和和第二数值的权重、以及该区块链节点对应的第三数值的总和和第三数值的权重,得到该区块链节点的选举分值;依据选举分值从高至低对本轮次内接收到的选举数据中被选择的区块链节点进行排序,确定前预设数量的区块链节点为共识区块链节点,使得所述共识区块链节点在新一轮次中按照预设规则依次执行区块打包操作。
其中,共识模块320获取第二数值的权重和第三数值的权重的方式可以是:共识模块320,用于统计本轮次内接收到的选举数据中第二数值的总和以及第三数值的总和;确定第二数值的权重和第三数值的权重,使满足:第二数值的总和与第二数值的权重的乘积等于第三数值的总和与第三数值的权重的乘积。
进一步地,在本发明的一个实施例中,选票是一次性的,即各区块链节点发出的选举数据中所用的选票不能再次被使用,需要从相应区块链节点的第二账户中扣除,因此,共识模块320,还用于对于发出选举数据的每个区块链节点,确定第四数值,第四数值等于该区块链节点在本轮次内发出的选举数据中第三数值的总和,第四数值用于表征从该区块链节点的第二账户中减少的数值;将第四数值发送至其他区块链节点,以使各区块链节点将所述第四数值存入各自对应的区块链数据库中。
在本发明的一个实施例中,共识模块320,还用于在确定预定数量的共识区块链节点之后,对于每个共识区块链节点,生成不重复的随机数,使得所述共识区块链节点在新一轮次中按照相应的随机数的顺序依次执行预设次数的区块打包操作。
图4示意性示出了根据本发明另一实施例的区块链共识达成装置的框图。
如图4所示,该区块链共识达成装置400包括:接收模块310、共识模块320和选票发放模块330。
上文已对接收模块310和共识模块320进行说明,重复的部分不再赘述,在此基础上,接收模块310,还用于接收区块链节点发出的交易信息。
选票发放模块330,用于判断所述交易信息是否符合预设条件,是则确定第一数值,所述第一数值用于表征向作为所述交易信息对应的交易物提供方的区块链节点的第二账户中增加的数值;将所述第一数值发送至其他区块链节点,以使各区块链节点将所述第一数值存入各自对应的区块链数据库中。
在本发明的一个实施例中,选票发放模块330,用于判断交易信息对应的交易物是否属于消耗性资源;是则,监听交易信息对应的交易物是否被作为交易信息对应的交易物购买方的区块链节点使用完毕;是则,确定交易信息符合预设条件。
具体地,在本发明的一个实施例中,消耗性资源包括如下至少一项:网络流量数据资源,处理器的算力资源;并且/或者,选票发放模块330,用于接收作为交易物购买方的区块链节点发送的交易反馈信息,根据该交易反馈信息判断交易物是否被作为交易物购买方的区块链节点使用完毕;或者,获取该交易物的使用日志,根据使用日志判断交易物是否被作为所述交易物购买方的区块链节点使用完毕。
需要说明的是,装置部分实施例中各模块/单元/子单元等的实施方式、解决的技术问题、实现的功能、以及达到的技术效果分别与方法部分实施例中各对应的步骤的实施方式、解决的技术问题、实现的功能、以及达到的技术效果相同或类似,在此不再赘述。
根据本发明的实施例的模块、子模块、单元、子单元中的任意多个、或其中任意多个的至少部分功能可以在一个模块中实现。根据本发明实施例的模块、子模块、单元、子单元中的任意一个或多个可以被拆分成多个模块来实现。根据本发明实施例的模块、子模块、单元、子单元中的任意一个或多个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上系统、基板上的系统、封装上的系统、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式的硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任意几种的适当组合来实现。或者,根据本发明实施例的模块、子模块、单元、子单元中的一个或多个可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。
例如,接收模块310、共识模块320、以及选票发放模块330中的任意多个可以合并在一个模块中实现,或者其中的任意一个模块可以被拆分成多个模块。或者,这些模块中的一个或多个模块的至少部分功能可以与其他模块的至少部分功能相结合,并在一个模块中实现。 根据本发明的实施例,接收模块310、共识模块320、以及选票发放模块330中的至少一个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上系统、基板上的系统、封装上的系统、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式等硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任意几种的适当组合来实现。或者,接收模块310、共识模块320、以及选票发放模块330中的至少一个可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。
图5示意性示出了根据本发明实施例的适于实现区块链共识达成方法的计算机系统的方框图。图5示出的计算机系统仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。
如图5所示,根据本发明实施例的计算机系统500包括处理器501,其可以根据存储在只读存储器(ROM)502中的程序或者从存储部分508加载到随机访问存储器(RAM)503中的程序而执行各种适当的动作和处理。处理器501例如可以包括通用微处理器(例如CPU)、指令集处理器和/或相关芯片组和/或专用微处理器(例如,专用集成电路(ASIC)),等等。处理器501还可以包括用于缓存用途的板载存储器。处理器501可以包括用于执行根据本发明实施例的方法流程的不同动作的单一处理单元或者是多个处理单元。
在RAM 503中,存储有系统500操作所需的各种程序和数据。处理器501、ROM 502以及RAM 503通过总线504彼此相连。处理器501通过执行ROM 502和/或RAM 503中的程序来执行根据本发明实施例的方法流程的各种操作。需要注意,所述程序也可以存储在除ROM 502和RAM 503以外的一个或多个存储器中。处理器501也可以通过执行存储在所述一个或多个存储器中的程序来执行根据本发明实施例的方法流程的各种操作。
根据本发明的实施例,系统500还可以包括输入/输出(I/O)接口505,输入/输出(I/O)接口505也连接至总线504。系统500还可以包括连接至I/O接口505的以下部件中的一项或多项:包括键盘、鼠标等的输入部分506;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分507;包括硬盘等的存储部分508;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分509。通信部分509经由诸如因特网的网络执行通信处理。驱动器510也根据需要连接至I/O接口505。可拆卸介质511,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器510上,以便于从其上读出的计算机程序根据需要被安装入存储部分508。
根据本发明的实施例,根据本发明实施例的方法流程可以被实现为计算机软件程序。例如,本发明的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程 序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分509从网络上被下载和安装,和/或从可拆卸介质511被安装。在该计算机程序被处理器501执行时,执行本发明实施例的系统中限定的上述功能。根据本发明的实施例,上文描述的系统、设备、装置、模块、单元等可以通过计算机程序模块来实现。
本发明还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的设备/装置/系统中所包含的;也可以是单独存在,而未装配入该设备/装置/系统中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被执行时,实现:上文各实施例所描述的区块链共识达成方法。
根据本发明的实施例,计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本发明中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本发明中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、有线、光缆、射频信号等等,或者上述的任意合适的组合。
例如,根据本发明的实施例,计算机可读介质可以包括上文描述的ROM 502和/或RAM 503和/或ROM 502和RAM 503以外的一个或多个存储器。
附图中的流程图和框图,图示了按照本发明各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的 是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
本领域技术人员可以理解,本发明的各个实施例和/或权利要求中记载的特征可以进行多种组合或/或结合,即使这样的组合或结合没有明确记载于本发明中。特别地,在不脱离本发明精神和教导的情况下,本发明的各个实施例和/或权利要求中记载的特征可以进行多种组合和/或结合。所有这些组合和/或结合均落入本发明的范围。
以上对本发明的实施例进行了描述。但是,这些实施例仅仅是为了说明的目的,而并非为了限制本发明的范围。尽管在以上分别描述了各实施例,但是这并不意味着各个实施例中的措施不能有利地结合使用。本发明的范围由所附权利要求及其等同物限定。不脱离本发明的范围,本领域技术人员可以做出多种替代和修改,这些替代和修改都应落在本发明的范围之内。

Claims (18)

  1. 一种区块链共识达成方法,包括:
    接收具有第一账户余额和/或第二账户余额的区块链节点发出的选举数据,所述选举数据包括:发出所述选举数据的区块链节点所选择的区块链节点的信息;
    基于本轮次内接收到的选举数据,从各选举数据所选择的区块链节点中确定共识区块链节点,使得所述共识区块链节点在新一轮次中执行区块打包操作;
    其中,每个区块链节点的第一账户中的数值用于表征该区块链节点所具有的数字货币的数量,每个区块链节点的第二账户中的数值用于表征该区块链节点所具有的选票的数量。
  2. 根据权利要求1所述的方法,还包括:
    接收区块链节点发出的交易信息;
    判断所述交易信息是否符合预设条件,是则确定第一数值,所述第一数值用于表征向作为所述交易信息对应的交易物提供方的区块链节点的第二账户中增加的数值;
    将所述第一数值发送至其他区块链节点,以使各区块链节点将所述第一数值存入各自对应的区块链数据库中。
  3. 根据权利要求2所述的方法,其中,所述判断所述交易信息是否符合预设条件包括:
    判断所述交易信息对应的交易物是否属于消耗性资源;
    是则,监听所述交易信息对应的交易物是否被作为所述交易信息对应的交易物购买方的区块链节点使用完毕;
    是则,确定所述交易信息符合预设条件。
  4. 根据权利要求3所述的方法,其中:
    所述消耗性资源包括如下至少一项:
    网络流量数据资源,处理器的算力资源;并且/或者
    所述监听所述交易信息对应的交易物是否被作为所述交易信息对应的交易物购买方的区块链节点使用完毕包括:
    接收作为所述交易物购买方的区块链节点发送的交易反馈信息,根据所述交易反馈信息判断所述交易物是否被该区块链节点使用完毕;或者,获取所述交易物的使用日志,根据所述使用日志判断所述交易物是否被作为所述交易物购买方的区块链节点使用完毕。
  5. 根据权利要求1所述的方法,其中:
    所述选举数据还包括:
    第二数值和/或第三数值;对于每个区块链节点发出的选举数据,所述选举数据中的第二 数值的总和不大于该区块链节点的第一账户余额,所述选举数据中的第三数值的总和不大于该区块链节点的第二账户余额;
    该方法还包括:获取第二数值的权重和第三数值的权重;
    所述基于本轮次内接收到的选举数据,从各选举数据所选择的区块链节点中确定共识区块链节点包括:
    统计本轮次内接收到的选举数据中每个被选择的区块链节点对应的第二数值的总和,以及本轮次内接收到的选举数据中每个被选择的区块链节点对应的第三数值的总和;
    对于每个被选择的区块链节点,根据该区块链节点对应的第二数值的总和和第二数值的权重、以及该区块链节点对应的第三数值的总和和第三数值的权重,得到该区块链节点的选举分值;
    依据选举分值从高至低对本轮次内接收到的选举数据中被选择的区块链节点进行排序,确定前预设数量的区块链节点为共识区块链节点,使得所述共识区块链节点在新一轮次中按照预设规则依次执行区块打包操作。
  6. 根据权利要求5所述的方法,其中,获取第二数值的权重和第三数值的权重包括:
    统计本轮次内接收到的选举数据中第二数值的总和以及第三数值的总和;
    确定第二数值的权重和第三数值的权重,使满足:第二数值的总和与第二数值的权重的乘积等于第三数值的总和与第三数值的权重的乘积。
  7. 根据权利要求5所述的方法,还包括:
    对于发出选举数据的每个区块链节点,确定第四数值,所述第四数值等于该区块链节点在本轮次内发出的选举数据中第三数值的总和,所述第四数值用于表征从该区块链节点的第二账户中减少的数值;
    将所述第四数值发送至其他区块链节点,以使各区块链节点将所述第四数值存入各自对应的区块链数据库中。
  8. 根据权利要求5所述的方法,还包括:
    在确定预定数量的共识区块链节点之后,对于每个共识区块链节点,生成不重复的随机数,使得所述共识区块链节点在新一轮次中按照相应的随机数的顺序依次执行预设次数的区块打包操作。
  9. 一种区块链共识达成装置,包括:
    接收模块,用于接收具有第一账户余额和/或第二账户余额的区块链节点发出的选举数据,所述选举数据包括:发出所述选举数据的区块链节点所选择的区块链节点的信息;
    共识模块,用于基于本轮次内接收到的选举数据,从各选举数据所选择的区块链节点中 确定共识区块链节点,使得所述共识区块链节点在新一轮次中执行区块打包操作;
    其中,每个区块链节点的第一账户中的数值用于表征该区块链节点所具有的数字货币的数量,每个区块链节点的第二账户中的数值用于表征该区块链节点所具有的选票的数量。
  10. 根据权利要求9所述的装置,还包括:选票发放模块;
    所述接收模块,还用于接收区块链节点发出的交易信息;
    所述选票发放模块,用于判断所述交易信息是否符合预设条件,是则确定第一数值,所述第一数值用于表征向作为所述交易信息对应的交易物提供方的区块链节点的第二账户中增加的数值;将所述第一数值发送至其他区块链节点,以使各区块链节点将所述第一数值存入各自对应的区块链数据库中。
  11. 根据权利要求10所述的装置,其中:
    所述选票发放模块,用于判断所述交易信息对应的交易物是否属于消耗性资源;是则,监听所述交易信息对应的交易物是否被作为所述交易信息对应的交易物购买方的区块链节点使用完毕;是则,确定所述交易信息符合预设条件。
  12. 根据权利要求11所述的装置,其中:
    所述消耗性资源包括如下至少一项:网络流量数据资源,处理器的算力资源;并且/或者
    所述选票发放模块,用于接收作为所述交易物购买方的区块链节点发送的交易反馈信息,根据所述交易反馈信息判断所述交易物是否被该区块链节点使用完毕;或者,获取所述交易物的使用日志,根据所述使用日志判断所述交易物是否被作为所述交易物购买方的区块链节点使用完毕。
  13. 根据权利要求9所述的装置,其中:
    所述选举数据还包括:第二数值和/或第三数值;对于每个区块链节点发出的选举数据,所述选举数据中的第二数值的总和不大于该区块链节点的第一账户余额,所述选举数据中的第三数值的总和不大于该区块链节点的第二账户余额;
    所述共识模块,还用于获取第二数值的权重和第三数值的权重;
    所述共识模块,用于统计本轮次内接收到的选举数据中每个被选择的区块链节点对应的第二数值的总和,以及本轮次内接收到的选举数据中每个被选择的区块链节点对应的第三数值的总和;对于每个被选择的区块链节点,根据该区块链节点对应的第二数值的总和和第二数值的权重、以及该区块链节点对应的第三数值的总和和第三数值的权重,得到该区块链节点的选举分值;依据选举分值从高至低对本轮次内接收到的选举数据中被选择的区块链节点进行排序,确定前预设数量的区块链节点为共识区块链节点,使得所述共识区块链节点在新一轮次中按照预设规则依次执行区块打包操作。
  14. 根据权利要求13所述的装置,其中:
    所述共识模块,用于统计本轮次内接收到的选举数据中第二数值的总和以及第三数值的总和;确定第二数值的权重和第三数值的权重,使满足:第二数值的总和与第二数值的权重的乘积等于第三数值的总和与第三数值的权重的乘积。
  15. 根据权利要求13所述的装置,其中:
    所述共识模块,还用于对于发出选举数据的每个区块链节点,确定第四数值,所述第四数值等于该区块链节点在本轮次内发出的选举数据中第三数值的总和,所述第四数值用于表征从该区块链节点的第二账户中减少的数值;将所述第四数值发送至其他区块链节点,以使各区块链节点将所述第四数值存入各自对应的区块链数据库中。
  16. 根据权利要求13所述的装置,其中:
    所述共识模块,还用于在确定预定数量的共识区块链节点之后,对于每个共识区块链节点,生成不重复的随机数,使得所述共识区块链节点在新一轮次中按照相应的随机数的顺序依次执行预设次数的区块打包操作。
  17. 一种计算机系统,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时,实现如权利要求1-8中任一项所述的方法。
  18. 一种计算机可读介质,其上存储有可执行指令,该指令被处理器执行时使处理器执行如权利要求1-8中任一项所述的方法。
PCT/CN2018/086154 2018-05-09 2018-05-09 区块链共识达成方法和装置 WO2019213867A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP18918012.8A EP3793158A4 (en) 2018-05-09 2018-05-09 PROCESS AND DEVICE FOR ACHIEVING CONSENSUS IN A CHAIN OF BLOCKS
PCT/CN2018/086154 WO2019213867A1 (zh) 2018-05-09 2018-05-09 区块链共识达成方法和装置
US17/053,171 US11483129B2 (en) 2018-05-09 2018-05-09 Method and apparatus for reaching blockchain consensus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/086154 WO2019213867A1 (zh) 2018-05-09 2018-05-09 区块链共识达成方法和装置

Publications (1)

Publication Number Publication Date
WO2019213867A1 true WO2019213867A1 (zh) 2019-11-14

Family

ID=68467287

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/086154 WO2019213867A1 (zh) 2018-05-09 2018-05-09 区块链共识达成方法和装置

Country Status (3)

Country Link
US (1) US11483129B2 (zh)
EP (1) EP3793158A4 (zh)
WO (1) WO2019213867A1 (zh)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111177262A (zh) * 2019-12-27 2020-05-19 中思博安科技(北京)有限公司 一种区块链共识方法、相关装置及系统
CN111858773A (zh) * 2020-07-30 2020-10-30 杭州复杂美科技有限公司 交易打包方法、设备和存储介质
CN112508661A (zh) * 2020-12-17 2021-03-16 北京金山云网络技术有限公司 记账权的确定方法、装置和线上竞拍系统
CN113128998A (zh) * 2019-12-31 2021-07-16 航天信息股份有限公司 一种区块链系统的业务处理方法、装置及系统
CN113626530A (zh) * 2021-09-03 2021-11-09 杭州复杂美科技有限公司 区块生成方法、计算机设备和存储介质
CN113922993A (zh) * 2021-09-18 2022-01-11 深圳时空云科技有限公司 一种分布式采集数据控制方法及装置
CN113961545A (zh) * 2021-10-26 2022-01-21 北京市科学技术情报研究所 基于区块链的信息价值数据库构建方法
CN114553434A (zh) * 2021-10-09 2022-05-27 支付宝(杭州)信息技术有限公司 一种共识方法、区块链系统和共识节点
CN114584312A (zh) * 2021-10-09 2022-06-03 支付宝(杭州)信息技术有限公司 一种共识方法、区块链系统和共识节点
CN116260707A (zh) * 2023-05-15 2023-06-13 安徽中科晶格技术有限公司 基于共识的区块链节点灾备方法、装置、设备及存储介质

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111899104B (zh) * 2018-11-27 2023-12-01 创新先进技术有限公司 一种业务执行方法及装置
US11593321B2 (en) * 2019-03-06 2023-02-28 0Chain Corp. Systems and methods of self-administered protocols on a blockchain platform
US20210051019A1 (en) * 2019-08-13 2021-02-18 Realtime Applications, Inc. Blockchain communication architecture
US11520904B2 (en) * 2019-08-27 2022-12-06 Accenture Global Solutions Limited AI-based blockchain hybrid consensus
CN113486118B (zh) * 2021-07-21 2023-09-22 银清科技有限公司 共识节点选取方法及装置
CN113708968B (zh) * 2021-08-27 2023-08-11 中国互联网络信息中心 区块链的节点选举控制方法和装置
CN113807850B (zh) * 2021-09-30 2023-03-31 北京优品三悦科技发展有限公司 一种共识节点的状况评估方法、装置及电子设备
CN114301918B (zh) * 2021-12-29 2023-09-22 吉林大学 一种基于作恶节点淘汰树的高效区块链共识方法
CN114900535B (zh) * 2022-05-09 2023-07-04 深圳嘉业产业发展有限公司 一种基于区块链的数据传输方法及系统
CN115801553A (zh) * 2022-11-29 2023-03-14 中国科学院深圳先进技术研究院 一种基于Raft改进的共识方法及相关设备
CN116192881B (zh) * 2023-04-27 2023-06-30 天津市城市规划设计研究总院有限公司 城市规划领域区块链数据的访问控制方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106060036A (zh) * 2016-05-26 2016-10-26 布比(北京)网络技术有限公司 去中心化共识方法及装置
CN107341660A (zh) * 2017-05-27 2017-11-10 唐盛(北京)物联技术有限公司 一种区块链底层共识机制以及基于该共识机制的区块链系统
CN107395353A (zh) * 2017-04-24 2017-11-24 阿里巴巴集团控股有限公司 一种区块链共识方法及装置
CN107450981A (zh) * 2017-05-31 2017-12-08 阿里巴巴集团控股有限公司 一种区块链共识方法及设备
CN107578336A (zh) * 2017-09-29 2018-01-12 左鹏 基于动态股权的区块链记账方法

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9875510B1 (en) * 2015-02-03 2018-01-23 Lance Kasper Consensus system for tracking peer-to-peer digital records
GB2531828A (en) * 2015-03-24 2016-05-04 Intelligent Energy Ltd An energy resource network
US10304143B2 (en) 2016-05-05 2019-05-28 Lance Timothy Kasper Consensus system for manipulation resistant digital record keeping
CN110024422B (zh) * 2016-12-30 2023-07-18 英特尔公司 物联网的命名和区块链记录
US20200059369A1 (en) * 2017-05-16 2020-02-20 Peking University Shenzhen Graduate School Determining consensus by parallel proof of voting in consortium blockchain
CN107679857B (zh) 2017-10-10 2021-04-27 马晶瑶 区块链的跨链交易方法和存储介质
US11488433B2 (en) * 2018-01-11 2022-11-01 Mastercard International Incorporated Method and system for public elections on a moderated blockchain
US11799630B2 (en) 2018-05-09 2023-10-24 Hefei Dappworks Technology Co., Ltd. Method and device for blockchain nodes
EP3905636A1 (en) 2018-12-28 2021-11-03 Hefei Dappworks Technology Co., Ltd. Data processing method and apparatus for blockchain, and blockchain system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106060036A (zh) * 2016-05-26 2016-10-26 布比(北京)网络技术有限公司 去中心化共识方法及装置
CN107395353A (zh) * 2017-04-24 2017-11-24 阿里巴巴集团控股有限公司 一种区块链共识方法及装置
CN107341660A (zh) * 2017-05-27 2017-11-10 唐盛(北京)物联技术有限公司 一种区块链底层共识机制以及基于该共识机制的区块链系统
CN107450981A (zh) * 2017-05-31 2017-12-08 阿里巴巴集团控股有限公司 一种区块链共识方法及设备
CN107578336A (zh) * 2017-09-29 2018-01-12 左鹏 基于动态股权的区块链记账方法

Non-Patent Citations (1)

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

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111177262A (zh) * 2019-12-27 2020-05-19 中思博安科技(北京)有限公司 一种区块链共识方法、相关装置及系统
CN113128998A (zh) * 2019-12-31 2021-07-16 航天信息股份有限公司 一种区块链系统的业务处理方法、装置及系统
CN113128998B (zh) * 2019-12-31 2024-04-12 航天信息股份有限公司 一种区块链系统的业务处理方法、装置及系统
CN111858773B (zh) * 2020-07-30 2023-11-28 杭州复杂美科技有限公司 交易打包方法、设备和存储介质
CN111858773A (zh) * 2020-07-30 2020-10-30 杭州复杂美科技有限公司 交易打包方法、设备和存储介质
CN112508661A (zh) * 2020-12-17 2021-03-16 北京金山云网络技术有限公司 记账权的确定方法、装置和线上竞拍系统
CN113626530A (zh) * 2021-09-03 2021-11-09 杭州复杂美科技有限公司 区块生成方法、计算机设备和存储介质
CN113922993A (zh) * 2021-09-18 2022-01-11 深圳时空云科技有限公司 一种分布式采集数据控制方法及装置
CN113922993B (zh) * 2021-09-18 2024-04-12 深圳时空云科技有限公司 一种分布式采集数据控制方法及装置
CN114584312A (zh) * 2021-10-09 2022-06-03 支付宝(杭州)信息技术有限公司 一种共识方法、区块链系统和共识节点
CN114553434B (zh) * 2021-10-09 2024-03-12 支付宝(杭州)信息技术有限公司 一种共识方法、区块链系统和共识节点
CN114584312B (zh) * 2021-10-09 2024-03-29 支付宝(杭州)信息技术有限公司 一种共识方法、区块链系统和共识节点
CN114553434A (zh) * 2021-10-09 2022-05-27 支付宝(杭州)信息技术有限公司 一种共识方法、区块链系统和共识节点
CN113961545A (zh) * 2021-10-26 2022-01-21 北京市科学技术情报研究所 基于区块链的信息价值数据库构建方法
CN116260707B (zh) * 2023-05-15 2023-10-10 安徽中科晶格技术有限公司 基于共识的区块链节点灾备方法、装置、设备及存储介质
CN116260707A (zh) * 2023-05-15 2023-06-13 安徽中科晶格技术有限公司 基于共识的区块链节点灾备方法、装置、设备及存储介质

Also Published As

Publication number Publication date
US20210167942A1 (en) 2021-06-03
US11483129B2 (en) 2022-10-25
EP3793158A4 (en) 2021-12-08
EP3793158A1 (en) 2021-03-17

Similar Documents

Publication Publication Date Title
WO2019213867A1 (zh) 区块链共识达成方法和装置
CN108596623B (zh) 一种区块链共识达成方法
US20210255995A1 (en) PROOF OF LOTTERY (PoL) BLOCKCHAIN
US11509464B2 (en) System and method using a fitness-gradient blockchain consensus and providing advanced distributed ledger capabilities via specialized data records
CN110688425B (zh) 针对区块链的条件性延期事务的方法和系统
Majeed et al. Blockchain for IoT-based smart cities: Recent advances, requirements, and future challenges
US10762564B2 (en) Autonomous peer-to-peer energy networks operating on a blockchain
CN110121727B (zh) 一种为智能合同提供经证实、可审计和不可变输入的方法和系统
CN108665363B (zh) 一种区块链共识达成装置
CN108629588B (zh) 一种用于区块链共识达成的计算机可读介质
WO2020133148A1 (zh) 区块链的数据处理方法、装置和区块链系统
TWI754133B (zh) 基於中心化與去中心化的雙重交易方法及系統
US10708071B1 (en) Consensus protocols in distributed computing systems
CN112055023B (zh) 基于预言机的访问请求处理方法、装置、设备和介质
US20120317034A1 (en) Transparent virtual currency using verifiable tokens
CN109391480A (zh) 一种数据存储方法、装置及电子设备
CN110838063B (zh) 基于区块链的交易处理方法、电子设备和存储介质
US20190114707A1 (en) Distribution of Blockchain Tokens
CN109727132B (zh) 区块链共识节点的获取方法、装置、电子设备及存储介质
CN112270501B (zh) 一种基于SaaS的供应链物流云系统
CN108648082A (zh) 一种用于区块链共识达成的计算机系统
CN113221163B (zh) 一种训练模型的方法及系统
CN111414434B (zh) 基于区块链的数据交易管理网络、交易设备和存储介质
CN114127771A (zh) 经由区块链进行观看证明的系统和方法
US20190139068A1 (en) Systems and methods for randomized reward distribution exchange for loyalty points

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: 18918012

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2018918012

Country of ref document: EP

Effective date: 20201209