WO2020011182A1 - Consensus method, device and system based on effective computation power contribution - Google Patents

Consensus method, device and system based on effective computation power contribution Download PDF

Info

Publication number
WO2020011182A1
WO2020011182A1 PCT/CN2019/095368 CN2019095368W WO2020011182A1 WO 2020011182 A1 WO2020011182 A1 WO 2020011182A1 CN 2019095368 W CN2019095368 W CN 2019095368W WO 2020011182 A1 WO2020011182 A1 WO 2020011182A1
Authority
WO
WIPO (PCT)
Prior art keywords
computing
calculation
consensus
task
node
Prior art date
Application number
PCT/CN2019/095368
Other languages
French (fr)
Chinese (zh)
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 云图有限公司
Publication of WO2020011182A1 publication Critical patent/WO2020011182A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • the present invention relates to the field of blockchain technology, and in particular, to a consensus method, device, and system based on effective computing power contributions.
  • blockchain technology is developing rapidly.
  • some current digital currencies (Bitcoin, Ethereum, etc.) all use blockchain technology.
  • a consensus mechanism is needed, that is, the verification and confirmation of the transaction is completed in a short time through the voting of special nodes; for a transaction, if several nodes with irrelevant interests can reach a consensus , It can be considered that the entire network can reach consensus on this.
  • the blockchain especially the public chain mainstream, still uses consensus such as Proof of Work (PoW), Proof of Stake (PoS), or Delegated Proof of Stake (DPoS).
  • PoW Proof of Work
  • PoS Proof of Stake
  • DoS Delegated Proof of Stake
  • hash mining that is, use an exhaustive algorithm to calculate a qualified hash value.
  • the role of mining is to compete for accounting rights, that is, Whoever mines first, who is responsible for packaging the transactions on the chain into blocks to get rewards.
  • all mainstream blockchain platforms basically use the method of local replay of the transaction process to verify the transaction, that is, when the node that has obtained the accounting right generates a block, it needs to execute the transaction based on the latest local ledger status and send the transaction itself.
  • execution results are packaged into blocks, and the blocks are synchronized to other nodes.
  • Other nodes need to re-execute the transaction based on their latest local ledger status. If the execution results are consistent with the results received in the block, they will be received.
  • the obtained block is written on the local chain.
  • all nodes need to perform transactions, which is called the local replay verification method of the transaction process. It can be seen that, on the one hand, this method wastes a lot of computing power, and on the other hand, it also makes the cycle of consensus reaching longer.
  • EOS Enterprise Operation System, a blockchain operating system designed for commercial distributed applications
  • Cosmos blockchain internet
  • DPoS consensus mechanism to solve the problems of low consensus efficiency and wasted computing power.
  • This technology simply removes the mining process, and the problem is that the rights are too concentrated, and the computing power of the existing mining machine cannot be used for useful calculations.
  • Cosmos's consensus protocol Tendermint is actually an improved version of the classic Byzantine fault tolerance (BFT) algorithm.
  • BFT Byzantine fault tolerance
  • This technology can also solve the problems of low consensus efficiency and wasted computing power to a certain extent.
  • the nodes that have voting rights determined in advance through the deposit are called validators.
  • the disadvantage is that it cannot guarantee that the rights are excessively concentrated in the hands of the verifier, and it cannot use the existing mining machine's computing power to perform useful calculations.
  • Embodiments of the present invention provide a consensus method, device, and system based on effective computing power contributions to solve the problems of wasted computing power, low consensus efficiency, and excessive power concentration in the consensus mechanism in the current blockchain.
  • the present invention adopts the following technical solutions:
  • a consensus method based on effective computing power contributions including:
  • the N preset candidate nodes that get the most votes are taken as the N consensus nodes; among these N consensus nodes, a practical Byzantine fault tolerance algorithm is used to complete the consensus on the block data.
  • the computing requirements corresponding to the computing tasks include a verifiable computing algorithm.
  • performing a corresponding configuration of a computing task according to the computing requirements includes:
  • corresponding parameters of the verifiable computing algorithm are configured.
  • acquiring data required for the computing task and compiling the computing task into a Boolean circuit includes:
  • the data required for the calculation task is obtained, and the calculation task is compiled into a Boolean circuit according to a preset compiler; the Boolean circuit includes a plurality of gate circuits, and each gate circuit has a corresponding consumption weight.
  • the corresponding configuration of the computing task, and the data required for the computing task, forming multiple parallel computing tasks, and distributing the multiple parallel computing tasks to multiple computing nodes for calculation including:
  • receiving a calculation result and a calculation certificate performed by the computing node for the parallel computing task and determining whether the calculation result is valid according to the calculation certificate includes:
  • the actual workload of the calculation performed by the calculation node is determined according to the calculation certificate, and the calculation result is verified to be correct; the actual workload of the calculation performed by the calculation node includes the number of gate circuits that are actually correctly calculated.
  • determining a cumulative calculation contribution value of a calculation node corresponding to the calculation result, and assigning a preset reward to each calculation node according to the accumulated calculation contribution value includes:
  • the cumulative calculation contribution of the calculation node corresponding to the calculation result is determined according to the number of gate circuits that are actually calculated correctly and the consumption weight of each gate circuit. value;
  • receiving the voting data of each computing node as the cumulative calculation contribution value and voting on the candidate nodes includes:
  • the voting information includes the candidate node that was voted and the cumulative calculation contribution value information that was voted;
  • the preset N candidate nodes that get the most votes are taken as the N consensus nodes; among them, the N consensus nodes use a practical Byzantine fault tolerance algorithm to complete consensus on the block data, including:
  • the N preset candidate nodes that get the most votes are taken as N consensus nodes; among them, the N consensus nodes use a practical Byzantine fault tolerance algorithm to rotate out of the block and complete consensus on the block data; the N Consensus nodes are used to write the correct calculation results and corresponding cumulative calculation contribution values into the blocks of the blockchain network.
  • a consensus device based on effective computing power contributions including:
  • a computing task and a demand receiving unit configured to receive a computing task issued by a computing publisher and a computing requirement corresponding to the computing task
  • a computing task configuration unit configured to perform a corresponding configuration of a computing task according to the computing demand
  • a Boolean circuit compiling unit configured to obtain data required for the computing task and compile the computing task into a Boolean circuit
  • a parallel computing task distribution unit configured to form multiple parallel computing tasks according to the Boolean circuit, the corresponding configuration of the computing task, and data required by the computing task, and distribute the multiple parallel computing tasks to multiple computing nodes Calculation;
  • a calculation result and certificate receiving unit configured to receive a calculation result and a calculation certificate performed by the computing node on the parallel computing task, and determine whether the calculation result is valid according to the calculation certificate;
  • a reward distribution unit configured to determine a cumulative calculation contribution value of a computing node corresponding to the calculation result after determining that the calculation result is valid, and allocate a preset reward to each computing node according to the cumulative calculation contribution value;
  • a voting unit configured to receive voting data of each computing node as a cumulative calculation contribution value, and vote on candidate nodes
  • the consensus node determining unit is configured to use the preset N candidate nodes that have received the most votes as N consensus nodes.
  • N consensus nodes a practical Byzantine fault tolerance algorithm is used to complete the consensus on the block data.
  • the computing task corresponding to the computing task and the computing task in the demand receiving unit includes a verifiable computing algorithm.
  • computing task configuration unit is specifically configured to:
  • corresponding parameters of the verifiable computing algorithm are configured.
  • Boolean circuit compilation unit is specifically configured to:
  • the data required for the calculation task is obtained, and the calculation task is compiled into a Boolean circuit according to a preset compiler; the Boolean circuit includes a plurality of gate circuits, and each gate circuit has a corresponding consumption weight.
  • the parallel computing task distribution unit is specifically configured to:
  • calculation result and the certificate receiving unit are specifically used to:
  • the actual workload of the calculation performed by the calculation node is determined according to the calculation certificate, and the calculation result is verified to be correct; the actual workload of the calculation performed by the calculation node includes the number of gate circuits that are actually correctly calculated.
  • the reward allocation unit is specifically configured to:
  • the cumulative calculation contribution of the calculation node corresponding to the calculation result is determined according to the number of gate circuits that are actually calculated correctly and the consumption weight of each gate circuit. value;
  • voting unit is specifically configured to:
  • the voting information includes the candidate node that was voted and the cumulative calculation contribution value information that was voted;
  • consensus node determining unit is specifically configured to:
  • the N preset candidate nodes that get the most votes are taken as N consensus nodes; among them, the N consensus nodes use a practical Byzantine fault tolerance algorithm to rotate out of the block and complete consensus on the block data; the N Consensus nodes are used to write the correct calculation results and corresponding cumulative calculation contribution values into the blocks of the blockchain network.
  • a consensus system based on effective computing power contributions including: a calculation issuer, a consensus device based on effective computing power contributions, and multiple computing nodes;
  • the calculation issuer is configured to issue a calculation task and a calculation request corresponding to the calculation task to a consensus device based on an effective calculation power contribution;
  • the consensus device based on the contribution of effective computing power is configured to perform a corresponding configuration of a computing task according to the computing demand; acquire data required for the computing task, and compile the computing task into a Boolean circuit; according to the Boolean circuit
  • the corresponding configuration of the computing task and the data required for the computing task form multiple parallel computing tasks, and distribute the multiple parallel computing tasks to multiple computing nodes;
  • the computing node is configured to calculate the parallel computing task, form a calculation result and a calculation certificate, and send the calculation result and the consensus device based on the effective computing power contribution;
  • the consensus device based on the effective computing power contribution is further configured to determine whether the calculation result is valid according to the calculation certificate; and after determining that the calculation result is valid, determine a cumulative calculation contribution value of a computing node corresponding to the calculation result, And assign preset rewards to each computing node according to the cumulative calculated contribution value; receive voting data of the cumulative computing contribution value of each computing node, and vote on alternative nodes; the preset N backups with the most votes will be obtained
  • the nodes are selected as N consensus nodes; among them, the N consensus nodes adopt a practical Byzantine fault tolerance algorithm to complete consensus on the block data.
  • a consensus method, device, and system based on effective computing power contributions provided by embodiments of the present invention first receive a computing task issued by a computing publisher and a computing requirement corresponding to the computing task; and perform a corresponding computing task according to the computing requirement.
  • Configuration acquiring data required for the computing task and compiling the computing task into a Boolean circuit; forming a plurality of parallel computing tasks according to the corresponding configuration of the Boolean circuit, the computing task, and data required for the computing task, and Distributing the plurality of parallel computing tasks to a plurality of computing nodes for calculation; receiving a calculation result and a calculation certificate performed by the computing node on the parallel computing task, and determining whether the calculation result is based on the calculation certificate Valid; after determining that the calculation result is valid, determine the accumulated calculation contribution value of the calculation node corresponding to the calculation result, and assign a preset reward to each calculation node according to the accumulated calculation contribution value; receive each calculation node for the accumulated calculation Contribution value as voting data and voting on
  • the present invention is based on an effective proof-of-work algorithm, which separates consensus from calculation.
  • the computing power is only used to perform the actual computing work and not used for mining, so that the waste of computing power existing in the consensus mechanism in the current blockchain can be solved. , Low consensus efficiency and overly concentrated power.
  • FIG. 1 is a first flowchart of a consensus method based on effective computing power contribution provided by an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a consensus device based on an effective computing power contribution according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a consensus system based on effective computing power contribution provided by an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of an electronic device in an embodiment of the present application.
  • an embodiment of the present invention provides a consensus method based on effective computing power contributions, including:
  • Step 101 Receive a computing task issued by a computing publisher and a computing requirement corresponding to the computing task.
  • Step 102 Perform a corresponding configuration of a computing task according to the computing requirements.
  • Step 103 Obtain data required for the computing task, and compile the computing task into a Boolean circuit.
  • Step 104 Form a plurality of parallel computing tasks according to the Boolean circuit, a corresponding configuration of the computing task, and data required for the computing task, and distribute the plurality of parallel computing tasks to a plurality of computing nodes for calculation.
  • Step 105 Receive a calculation result and a calculation certificate performed by the calculation node on the parallel computing task, and determine whether the calculation result is valid according to the calculation certificate.
  • Step 106 After determining that the calculation result is valid, determine a cumulative calculation contribution value of a computing node corresponding to the calculation result, and allocate a preset reward to each computing node according to the accumulated calculation contribution value.
  • Step 107 Receive voting data of each computing node as a cumulative calculation contribution value, and vote on candidate nodes.
  • Step 108 Use the preset N candidate nodes that get the most votes as N consensus nodes.
  • the N consensus nodes use a practical Byzantine fault tolerance algorithm to complete consensus on the block data. Therefore, since N consensus nodes are selected, and the N consensus nodes use a practical Byzantine fault tolerance algorithm to complete consensus on the block data, the next step 101 can be performed after receiving the calculation task issued by the calculation publisher. Go to step 106. That is, after step 108, the process may return to step 101.
  • An embodiment of the present invention provides a consensus method based on the contribution of effective computing power, which is based on an effective proof-of-work algorithm to separate consensus from calculation.
  • the computing power is only used to perform the actual computing work, not used for mining, and there is no calculation.
  • consensus nodes use a practical Byzantine fault-tolerant algorithm to complete consensus on block data. For complex calculations, the block directly contains the transaction results and their proofs. Verification nodes can perform fast and effective verification through cryptographic algorithms without the need for a calculation process. Local replay method to verify transactions, avoid waste of computing power, and at the same time improve the consensus efficiency of the blockchain as a whole, thereby improving the transaction throughput of the entire network.
  • the invention can solve the problems of wasted computing power, low consensus efficiency and excessive power concentration in the current consensus mechanism in the blockchain.
  • the embodiment of the present invention provides a consensus method based on effective computing power contributions, including:
  • Step 201 Receive a computing task issued by a computing publisher and a computing requirement corresponding to the computing task.
  • the computing requirement corresponding to the computing task includes a verifiable computing algorithm (Verifiable Compilation, VC for short).
  • Step 202 Configure corresponding parameters of the verifiable computing algorithm according to the verifiable computing algorithm included in the computing requirement.
  • Step 203 Obtain data required for the computing task, and compile the computing task into a Boolean circuit according to a preset compiler.
  • the calculation task can be compiled into a Boolean circuit here.
  • the Boolean circuit includes multiple gate circuits, and each gate circuit has a corresponding consumption weight.
  • Step 204 The Boolean circuit is divided into multiple Boolean sub-circuits, and each Boolean sub-circuit includes one or more gate circuits.
  • Step 205 Integrate corresponding parameters of the verifiable computing algorithm, Boolean subcircuits, and data required for the computing task into multiple parallel computing tasks.
  • Step 206 Distribute the multiple parallel computing tasks to multiple computing nodes for calculation through a computing channel; the same parallel computing task is simultaneously distributed to multiple computing nodes, and a preset computing redundancy is retained.
  • Step 207 Receive a calculation result obtained by the calculation node for the parallel calculation task and a calculation certificate obtained by performing a verifiable calculation according to a corresponding parameter of the verifiable calculation algorithm.
  • Step 208 Determine the actual workload of the calculation performed by the computing node according to the calculation certificate, and verify whether the calculation result is correct; the actual workload of the calculation performed by the calculation node includes the number of gate circuits that are actually correctly calculated.
  • Step 209 After determining the actual workload of the computing node for calculation and verifying that the calculation result is correct, determine the calculation node corresponding to the calculation result according to the number of gate circuits that are actually calculated correctly and the consumption weight of each gate circuit. Cumulatively calculate the contribution value.
  • the cumulative calculation contribution value of the computing node may be a value obtained by summing the gate circuits that it actually calculates correctly according to the consumption weights.
  • Step 210 Assign preset rewards to each computing node according to the cumulative calculated contribution value; wherein the preset reward is proportional to the cumulative calculated contribution value.
  • Step 211 Receive voting information of each computing node, and determine whether the voting is successful according to the voting information.
  • the voting information includes voted candidate nodes and voted cumulative calculation contribution value information.
  • each computing node can be sorted according to the size of the cumulative calculation contribution value, and a computing node with a large cumulative calculation contribution value is used as an alternative node.
  • N computing nodes with a large cumulative calculation contribution value can be set in advance.
  • step 212 After step 211, step 212 or step 213 is performed.
  • Step 212 When the cumulative calculated contribution value owned by the computing node satisfies the cumulative calculated contribution value information,
  • Step 213 When the accumulated calculated contribution value owned by the computing node does not satisfy the accumulated calculated contribution value information, determine that the voting has failed.
  • step 214 is performed.
  • Step 214 Use the preset N candidate nodes that get the most votes as N consensus nodes.
  • the N consensus nodes use a practical Byzantine fault tolerance algorithm to round out blocks and complete consensus on the block data; the N consensus nodes are used to write the correct calculation results and corresponding cumulative calculation contribution values Into the block of the blockchain network. Therefore, since N consensus nodes are selected and the N consensus nodes use a practical Byzantine fault tolerance algorithm to complete consensus on the block data, the next step 201 can be performed after receiving the calculation task issued by the calculation publisher. Go to step 213. That is, step 201 can be continued after step 214.
  • the revenue obtained by the consensus node that produced the block can be distributed to the computing node that voted according to the voting proportion. If a consensus node is found to be fraudulent, it may be disqualified from acting as a consensus node and deduct all accumulated calculated contribution values and certain funds. The election process is repeated in the next cycle.
  • the system can adaptively configure the verification method according to the complexity of the contract.
  • simple contracts contracts that do not involve parallel or outsourced calculations, that is, local node calculations are called simple contracts
  • nodes only need to recalculate the contracts and check whether the results are consistent.
  • complex contracts parallel computing or outsourced computing, that is, contracts that require other nodes to assist in computing in addition to local nodes are called complex contracts
  • the system will distribute the functional calculations carried in the contract to multiple computing nodes. Each computing node feeds back the calculation results and calculation proof. Consensus nodes place the calculation results and calculation proofs in the blocks in the blockchain. Other nodes only need to verify the proof to determine the legitimacy of the block.
  • parallel computing can greatly reduce the block verification time and improve performance.
  • An embodiment of the present invention provides a consensus method based on effective computing power contributions.
  • a computing task issued by a computing publisher and a computing requirement corresponding to the computing task are received; a corresponding configuration of the computing task is performed according to the computing requirement; Describe the data required for the computing task, and compile the computing task into a Boolean circuit; form multiple parallel computing tasks according to the Boolean circuit, the corresponding configuration of the computing task, and the data required for the computing task, and convert the multiple Distribute parallel computing tasks to multiple computing nodes to perform calculations; receive calculation results and calculation certificates of the parallel computing tasks performed by the computing nodes, and determine whether the calculation results are valid according to the calculation certificates; After the calculation result is valid, determine the accumulated calculation contribution value of the calculation node corresponding to the calculation result, and assign a preset reward to each calculation node according to the accumulated calculation contribution value; and receive each calculation node as the accumulated calculation contribution value.
  • the present invention is based on an effective proof-of-work algorithm, which separates consensus from calculation.
  • the computing power is only used to perform the actual computing work and not used for mining, so that the waste of computing power existing in the consensus mechanism in the current blockchain can be solved. , Low consensus efficiency and overly concentrated power.
  • the invention can be applied to related products or services of the blockchain, including public chain products or products of the alliance chain.
  • an embodiment of the present invention further provides a consensus device based on effective computing power contributions, including:
  • the computing task and requirement receiving unit 31 is configured to receive a computing task issued by a computing issuer and a computing requirement corresponding to the computing task.
  • the computing task configuration unit 32 is configured to perform a corresponding configuration of a computing task according to the computing requirements.
  • the Boolean circuit compiling unit 33 is configured to acquire data required for the computing task and compile the computing task into a Boolean circuit.
  • a parallel computing task distribution unit 34 is configured to form a plurality of parallel computing tasks according to the Boolean circuits, corresponding configurations of the computing tasks, and data required by the computing tasks, and distribute the plurality of parallel computing tasks to multiple computing nodes. Calculations.
  • the calculation result and certificate receiving unit 35 is configured to receive a calculation result and a calculation certificate performed by the computing node on the parallel computing task, and determine whether the calculation result is valid according to the calculation certificate.
  • the reward distribution unit 36 is configured to determine a cumulative calculation contribution value of a computing node corresponding to the calculation result after determining that the calculation result is valid, and allocate a preset reward to each computing node according to the cumulative calculation contribution value.
  • the voting unit 37 is configured to receive voting data of each computing node as a cumulative calculation contribution value, and vote on candidate nodes.
  • the consensus node determining unit 38 is configured to use the preset N candidate nodes that have received the most votes as the N consensus nodes. Among the N consensus nodes, a practical Byzantine fault tolerance algorithm is used to complete the consensus on the block data.
  • the computing task corresponding to the computing task in the computing task and the demand receiving unit 31 includes a verifiable computing algorithm.
  • computing task configuration unit 32 is specifically configured to:
  • corresponding parameters of the verifiable computing algorithm are configured.
  • Boolean circuit compiling unit 33 is specifically configured to:
  • the data required for the calculation task is obtained, and the calculation task is compiled into a Boolean circuit according to a preset compiler; the Boolean circuit includes a plurality of gate circuits, and each gate circuit has a corresponding consumption weight.
  • parallel computing task distribution unit 34 is specifically configured to:
  • the Boolean circuit is divided into a plurality of Boolean sub-circuits, and each Boolean sub-circuit includes one or more gate circuits.
  • calculation result and certification receiving unit 35 is specifically configured to:
  • the actual workload of the calculation performed by the calculation node is determined according to the calculation certificate, and the calculation result is verified to be correct; the actual workload of the calculation performed by the calculation node includes the number of gate circuits that are actually correctly calculated.
  • the reward distribution unit 36 is specifically configured to:
  • the cumulative calculation contribution of the calculation node corresponding to the calculation result is determined according to the number of gate circuits that are actually calculated correctly and the consumption weight of each gate circuit. value.
  • voting unit 37 is specifically configured to:
  • the voting information includes the candidate node that was voted on and the cumulative calculation contribution value information that was voted on.
  • the voting is determined to be successful, and after the end of the consensus period, the computing contribution value corresponding to the successful voting is deducted from the computing node.
  • consensus node determining unit 38 is specifically configured to:
  • the N preset candidate nodes that get the most votes are taken as N consensus nodes; among them, the N consensus nodes use a practical Byzantine fault tolerance algorithm to rotate out of the block and complete consensus on the block data; the N Consensus nodes are used to write the correct calculation results and corresponding cumulative calculation contribution values into the blocks of the blockchain network.
  • An embodiment of the present invention provides a consensus device based on the contribution of effective computing power, which is based on an effective proof-of-work algorithm to separate consensus from calculation.
  • the computing power is only used to perform the actual computing work and not used for mining, which can solve the problem.
  • the current consensus mechanisms in blockchains have problems such as wasted computing power, low consensus efficiency, and excessive power concentration.
  • an embodiment of the present invention further provides a consensus system based on effective computing power contributions, including: a calculation issuer 41, a consensus device 42 based on effective computing power contributions, and a plurality of computing nodes 43.
  • the calculation issuer 41 is configured to issue a calculation task and a calculation request corresponding to the calculation task to a consensus device 42 based on an effective calculation power contribution.
  • the consensus device 42 based on the effective computing power contribution is used to perform the corresponding configuration of the computing task according to the computing demand; obtain the data required for the computing task (available from a third-party system, on or off the blockchain) Required data), and compile the computing task into a Boolean circuit; according to the Boolean circuit, the corresponding configuration of the computing task, and the data required for the computing task, form a plurality of parallel computing tasks, and Computing tasks are distributed to multiple computing nodes 43.
  • the computing node 43 is configured to perform calculation on the parallel computing task, form a calculation result and a calculation certificate, and send the calculation result and the consensus device 42 based on the effective computing power contribution.
  • the consensus device 42 based on the effective computing power contribution is further configured to determine whether the calculation result is valid according to the calculation certificate; after determining that the calculation result is valid, determine a cumulative calculation contribution value of a computing node corresponding to the calculation result, And assign preset rewards to each computing node according to the cumulative calculated contribution value; receive voting data of each computing node 43 using the cumulative calculated contribution value, and vote on alternative nodes; the preset N number of most votes will be obtained
  • the candidate nodes serve as N consensus nodes; among these N consensus nodes, a practical Byzantine fault tolerance algorithm is used to complete consensus on the block data.
  • An embodiment of the present invention provides a consensus system based on effective computing power contribution, which is based on an effective proof-of-work algorithm that separates consensus from calculation.
  • the computing power is only used to perform the actual computing work and not used for mining, so it can be solved.
  • the current consensus mechanisms in blockchains have problems such as wasted computing power, low consensus efficiency, and excessive power concentration.
  • An embodiment of the present application further provides a specific implementation of an electronic device capable of implementing all the steps in the consensus method based on the effective computing power contribution in the foregoing embodiment.
  • the electronic device specifically includes the following content:
  • the electronic device may be a desktop computer, a tablet computer, a mobile terminal, etc., and this embodiment is not limited thereto.
  • the electronic device may be implemented by referring to the embodiment of the embodiment for the consensus method based on effective computing power contribution and the embodiment of the consensus device based on effective computing power contribution, the contents of which are incorporated herein, The duplicates will not be repeated.
  • FIG. 5 is a schematic block diagram of a system configuration of an electronic device 600 according to an embodiment of the present application.
  • the electronic device 600 may include a central processing unit 100 and a memory 140; the memory 140 is coupled to the central processing unit 100. It is worth noting that this figure is exemplary; other types of structures can also be used to supplement or replace the structure to implement telecommunication functions or other functions.
  • a consensus function based on effective computing power contributions may be integrated into the central processing unit 100.
  • the central processing unit 100 may be configured to perform the following control:
  • the N preset candidate nodes that get the most votes are taken as the N consensus nodes; among these N consensus nodes, a practical Byzantine fault tolerance algorithm is used to complete the consensus on the block data.
  • the embodiment of the present application provides an electronic device that separates consensus from calculation based on an effective proof-of-work algorithm.
  • the computing power is only used to perform the actual calculation work and not used for mining, thereby solving the current area.
  • the consensus mechanism in the blockchain has the problems of wasted computing power, low consensus efficiency, and excessive power concentration.
  • the consensus device based on the effective computing power contribution may be configured separately from the central processing unit 100.
  • the consensus device based on the effective computing power contribution may be configured as a chip connected to the central processing unit 100. Control to achieve a consensus function based on effective computing power contributions.
  • the electronic device 600 may further include a communication module 110, an input unit 120, an audio processor 130, a display 160, and a power source 170. It is worth noting that the electronic device 600 does not necessarily include all the components shown in FIG. 5; in addition, the electronic device 600 may further include components not shown in FIG. 5, and reference may be made to the prior art.
  • the central processing unit 100 is sometimes referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices.
  • the central processing unit 100 receives input and controls each of the electronic devices 600. Operation of parts.
  • the memory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices.
  • the above-mentioned failure-related information can be stored, and in addition, a program for executing the related information can be stored.
  • the central processing unit 100 may execute the program stored in the memory 140 to implement information storage or processing.
  • the input unit 120 provides input to the central processing unit 100.
  • the input unit 120 is, for example, a key input or a touch input device.
  • the power source 170 is used to provide power to the electronic device 600.
  • the display 160 is used for displaying display objects such as images and characters.
  • the display may be, for example, an LCD display, but is not limited thereto.
  • the memory 140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, and the like. It may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data. An example of this memory is sometimes called EPROM or the like.
  • the memory 140 may also be some other type of device.
  • the memory 140 includes a buffer memory 141 (sometimes referred to as a buffer).
  • the memory 140 may include an application / function storage section 142 for storing application programs and function programs or a flow for performing operations of the electronic device 600 through the central processing unit 100.
  • the memory 140 may further include a data storage section 143 for storing data.
  • the driver storage section 144 of the memory 140 may include various driver programs for the communication function of the electronic device and / or for performing other functions of the electronic device (such as a messaging application, an address book application, etc.).
  • the communication module 110 is a transmitter / receiver 110 that transmits and receives signals via the antenna 111.
  • a communication module (transmitter / receiver) 110 is coupled to the central processing unit 100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
  • multiple communication modules 110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module.
  • the communication module (transmitter / receiver) 110 is also coupled to the speaker 131 and the microphone 132 via the audio processor 130 to provide audio output via the speaker 131 and to receive audio input from the microphone 132, thereby realizing general telecommunication functions.
  • the audio processor 130 may include any suitable buffers, decoders, amplifiers, and the like.
  • the audio processor is also coupled to the central processing unit 100, thereby enabling recording on the unit through the microphone 132, and enabling sounds stored on the unit to be played through the speaker 131.
  • An embodiment of the present application further provides a computer-readable storage medium capable of realizing all the steps in the consensus method based on effective computing power contribution in the foregoing embodiment.
  • the computer-readable storage medium stores a computer program, the computer program When executed by a processor, all steps of the consensus method based on effective computing power contributions in the above embodiments are implemented. For example, when the processor executes the computer program, the following steps are implemented:
  • the N preset candidate nodes that get the most votes are taken as the N consensus nodes; among these N consensus nodes, a practical Byzantine fault tolerance algorithm is used to complete the consensus on the block data.
  • the embodiment of the present application provides a computer-readable storage medium that separates consensus from calculation based on an effective proof-of-work algorithm.
  • the computing power is only used to perform the actual calculation work, not used for mining, so that Solve the problems of waste of computing power, low consensus efficiency, and excessive power concentration in the current consensus mechanism of the blockchain.
  • the embodiments of the present invention may be provided as a method, a system, or a computer program product. Therefore, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a specific manner such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, the instructions
  • the device implements the functions specified in one or more flowcharts and / or one or more blocks of the block diagram.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of steps can be performed on the computer or other programmable device to produce a computer-implemented process, which can be executed on the computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.

Abstract

A consensus method, device (42) and system based on effective computation power contribution. The method comprises receiving a computation task issued by a computation publisher (41) and a computation requirement corresponding to the computation task (101); creating a corresponding configuration of the computation task according to a computation requirement (102); acquiring the data needed by the computation task and compiling the computation task into a Boolean circuit (103); according to the Boolean circuit, the corresponding configuration of the computation task, and the data required for the computation task, forming a plurality of parallel computation tasks, and distributing the plurality of parallel computation tasks to a plurality of computation nodes (43) for computation (104); receiving a computation result and proof of computation created by the computation nodes (43) for the parallel computation tasks, and determining whether the computation result is valid according to the computation proof (105); if it is determined that the computation result is valid, determining a cumulative computation contribution value of the computation nodes (43) corresponding to the computation result, and allocating a preset reward for each computation node (43) according to the cumulative computation contribution value (106); receiving voting data regarding which the cumulative computation contribution value is taken by each computation node (43), and voting on candidate nodes (107); and using N preset candidate nodes that are the most voted for as N consensus nodes (108), wherein a practical Byzantine fault-tolerant algorithm is used to complete the consensus of block data among the N consensus nodes.

Description

一种基于有效算力贡献的共识方法、装置及系统Consensus method, device and system based on effective computing power contribution 技术领域Technical field
本发明涉及区块链技术领域,尤其涉及一种基于有效算力贡献的共识方法、装置及系统。The present invention relates to the field of blockchain technology, and in particular, to a consensus method, device, and system based on effective computing power contributions.
背景技术Background technique
目前,区块链技术发展迅速,例如当前的一些数字货币(比特币、以太坊等)均采用的是区块链技术。而在区块链技术中,需要采用共识机制,即通过特殊节点的投票,在很短的时间内完成对交易的验证和确认;对一笔交易,如果利益不相干的若干个节点能够达成共识,就可以认为全网对此也能够达成共识。At present, blockchain technology is developing rapidly. For example, some current digital currencies (Bitcoin, Ethereum, etc.) all use blockchain technology. In the blockchain technology, a consensus mechanism is needed, that is, the verification and confirmation of the transaction is completed in a short time through the voting of special nodes; for a transaction, if several nodes with irrelevant interests can reach a consensus , It can be considered that the entire network can reach consensus on this.
而目前区块链,特别是公链主流还是使用工作量证明(Proof of Work,简称PoW)、股权证明(Proof of Stake,简称PoS)或者股份授权证明(Delegated Proof of Stake,简称DPoS)等共识机制或其变种,而PoW、PoS等共识机制需要哈希(Hash)挖矿,也就是用穷举的算法来计算一个符合条件的Hash值,挖矿的作用就是为了竞争记账权,也就是谁先挖到矿,谁负责把链上的交易打包出块,从而获取奖励。而目前所有主流区块链平台基本都是使用交易过程本地重放的方法来验证交易,即获得记账权的节点出块的时候,需要基于本地最新的账本状态来执行交易,并把交易本身以及执行的结果打包出块,并把区块同步给其他节点,其他节点需要基于自己本地的最新的账本状态来重新执行交易,如果执行的结果跟收到块里面的结果一致,才会把收到的区块写到本地链上。导致所有的节点都需要执行交易,这称为交易过程本地重放验证方法。可见,该方式一方面浪费大量算力,另一方面也使得共识达成的周期较长。At present, the blockchain, especially the public chain mainstream, still uses consensus such as Proof of Work (PoW), Proof of Stake (PoS), or Delegated Proof of Stake (DPoS). Mechanism or its variants, and consensus mechanisms such as PoW and PoS require hash mining, that is, use an exhaustive algorithm to calculate a qualified hash value. The role of mining is to compete for accounting rights, that is, Whoever mines first, who is responsible for packaging the transactions on the chain into blocks to get rewards. At present, all mainstream blockchain platforms basically use the method of local replay of the transaction process to verify the transaction, that is, when the node that has obtained the accounting right generates a block, it needs to execute the transaction based on the latest local ledger status and send the transaction itself. And the execution results are packaged into blocks, and the blocks are synchronized to other nodes. Other nodes need to re-execute the transaction based on their latest local ledger status. If the execution results are consistent with the results received in the block, they will be received. The obtained block is written on the local chain. As a result, all nodes need to perform transactions, which is called the local replay verification method of the transaction process. It can be seen that, on the one hand, this method wastes a lot of computing power, and on the other hand, it also makes the cycle of consensus reaching longer.
而随着数字货币挖矿难度的提升,挖矿成了一个重投入,目前已经先后出现专业矿工、矿场和矿池等角色,个人用户以自由设备挖矿已是遥不可及。具现有数据显示,比特币和以太坊50%以上的哈希率分别在前四大矿工和前三大矿工手中,形成隐形权力结构,这已经偏离了区块链技术的初衷。With the increase in the difficulty of digital currency mining, mining has become a heavy investment. Currently, there have been roles of professional miners, mines, and mining pools. Individual users can no longer mine with free equipment. According to the existing data, Bitcoin and Ethereum have more than 50% hash rate in the hands of the top four miners and the top three miners, respectively, forming an invisible power structure, which has deviated from the original intention of blockchain technology.
为了克服上述问题,目前现有技术一般采用EOS(Enterprise Operation System,即为商用分布式应用设计的一款区块链操作系统)、Cosmos(区块链的互联网,旨在解决很多密码学货币问题的网络)等技术:其中,EOS采用了DPoS共识机制来解决共识效率低和算力浪费的问题。但该技术简单的将挖矿过程去掉,带来的问题是权利过于集中,也不能把现有的矿机的算力利用起来,进行有用的计算。而Cosmos的共识协议 Tendermint其实是经典拜占庭容错(BFT)算法的改进版本。该技术也能在一定程度上解决共识效率低和算力浪费的问题,在通过保证金提前确定拥有投票权的节点叫做验证人。但缺陷在于也不能保证权利的过度集中在验证人的手里,同时也不能把现有的矿机的算力利用起来,进行有用的计算。In order to overcome the above problems, the current technology generally uses EOS (Enterprise Operation System, a blockchain operating system designed for commercial distributed applications) and Cosmos (blockchain internet), which aims to solve many cryptocurrency issues Network) and other technologies: Among them, EOS uses the DPoS consensus mechanism to solve the problems of low consensus efficiency and wasted computing power. However, this technology simply removes the mining process, and the problem is that the rights are too concentrated, and the computing power of the existing mining machine cannot be used for useful calculations. Cosmos's consensus protocol Tendermint is actually an improved version of the classic Byzantine fault tolerance (BFT) algorithm. This technology can also solve the problems of low consensus efficiency and wasted computing power to a certain extent. The nodes that have voting rights determined in advance through the deposit are called validators. However, the disadvantage is that it cannot guarantee that the rights are excessively concentrated in the hands of the verifier, and it cannot use the existing mining machine's computing power to perform useful calculations.
发明内容Summary of the invention
本发明的实施例提供一种基于有效算力贡献的共识方法、装置及系统,以解决目前区块链中的共识机制存在的算力浪费、共识效率低和权力过于集中的问题。Embodiments of the present invention provide a consensus method, device, and system based on effective computing power contributions to solve the problems of wasted computing power, low consensus efficiency, and excessive power concentration in the consensus mechanism in the current blockchain.
为达到上述目的,本发明采用如下技术方案:To achieve the above object, the present invention adopts the following technical solutions:
一种基于有效算力贡献的共识方法,包括:A consensus method based on effective computing power contributions, including:
接收计算发布方发布的计算任务以及所述计算任务对应的计算需求;Receiving a computing task issued by a computing publisher and a computing requirement corresponding to the computing task;
根据所述计算需求进行计算任务的相应配置;Performing a corresponding configuration of a computing task according to the computing requirements;
获取所述计算任务所需的数据,并将所述计算任务编译成为布尔电路;Acquiring data required for the computing task, and compiling the computing task into a Boolean circuit;
根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点处进行计算;Forming a plurality of parallel computing tasks according to the Boolean circuit, a corresponding configuration of the computing task, and data required for the computing task, and distributing the multiple parallel computing tasks to multiple computing nodes for calculation;
接收所述计算节点对所述并行计算任务进行计算的计算结果和计算证明,并根据所述计算证明确定所述计算结果是否有效;Receiving a calculation result and a calculation certificate performed by the calculation node on the parallel computing task, and determining whether the calculation result is valid according to the calculation certificate;
在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励;After determining that the calculation result is valid, determining a cumulative calculation contribution value of a calculation node corresponding to the calculation result, and assigning a preset reward to each calculation node according to the accumulated calculation contribution value;
接收各计算节点以累计计算贡献值作为的投票数据,并对备选节点进行投票;Receiving voting data of each computing node using the cumulative calculation contribution value, and voting on alternative nodes;
将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的。The N preset candidate nodes that get the most votes are taken as the N consensus nodes; among these N consensus nodes, a practical Byzantine fault tolerance algorithm is used to complete the consensus on the block data.
具体的,所述计算任务对应的计算需求,包括可验证计算算法。Specifically, the computing requirements corresponding to the computing tasks include a verifiable computing algorithm.
具体的,根据所述计算需求进行计算任务的相应配置,包括:Specifically, performing a corresponding configuration of a computing task according to the computing requirements includes:
根据所述计算需求中包括的可验证计算算法,配置可验证计算算法的相应参数。According to the verifiable computing algorithm included in the computing requirement, corresponding parameters of the verifiable computing algorithm are configured.
具体的,获取所述计算任务所需的数据,并将所述计算任务编译成为布尔电路,包括:Specifically, acquiring data required for the computing task and compiling the computing task into a Boolean circuit includes:
获取所述计算任务所需的数据,并根据预先设置的编译器将所述计算任务编译成为布尔电路;所述布尔电路包括多个门电路,各个门电路具有相应的消耗权重。The data required for the calculation task is obtained, and the calculation task is compiled into a Boolean circuit according to a preset compiler; the Boolean circuit includes a plurality of gate circuits, and each gate circuit has a corresponding consumption weight.
具体的,根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点处进行计算,包括:Specifically, according to the Boolean circuit, the corresponding configuration of the computing task, and the data required for the computing task, forming multiple parallel computing tasks, and distributing the multiple parallel computing tasks to multiple computing nodes for calculation, including:
将所述布尔电路拆分为多个布尔子电路,每个布尔子电路包括一至多个门电路;Dividing the Boolean circuit into a plurality of Boolean sub-circuits, each of which includes one or more gate circuits;
将可验证计算算法的相应参数、布尔子电路和计算任务所需的数据整合成多个并行计算任务;Integrate corresponding parameters of verifiable computing algorithms, Boolean subcircuits, and data required for computing tasks into multiple parallel computing tasks;
将所述多个并行计算任务通过计算通道分发到多个计算节点处进行计算;其中,同一并行计算任务被同时分发到多个计算节点处,并保留预先设置的计算冗余度。Distributing the multiple parallel computing tasks to multiple computing nodes for calculation through a computing channel; wherein the same parallel computing task is distributed to multiple computing nodes simultaneously, and a preset computing redundancy is retained.
具体的,接收所述计算节点对所述并行计算任务进行计算的计算结果和计算证明,并根据所述计算证明确定所述计算结果是否有效,包括:Specifically, receiving a calculation result and a calculation certificate performed by the computing node for the parallel computing task and determining whether the calculation result is valid according to the calculation certificate includes:
接收所述计算节点对所述并行计算任务进行计算的计算结果和根据可验证计算算法的相应参数进行可验证计算得到的计算证明;Receiving a calculation result obtained by the calculation node for the parallel calculation task and a calculation certificate obtained by performing a verifiable calculation according to a corresponding parameter of the verifiable calculation algorithm;
根据所述计算证明确定计算节点进行计算的实际工作量,以及验证所述计算结果是否正确;所述计算节点进行计算的实际工作量包括实际正确计算的门电路个数。The actual workload of the calculation performed by the calculation node is determined according to the calculation certificate, and the calculation result is verified to be correct; the actual workload of the calculation performed by the calculation node includes the number of gate circuits that are actually correctly calculated.
具体的,在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励,包括:Specifically, after determining that the calculation result is valid, determining a cumulative calculation contribution value of a calculation node corresponding to the calculation result, and assigning a preset reward to each calculation node according to the accumulated calculation contribution value, includes:
在确定计算节点进行计算的实际工作量,以及验证所述计算结果正确后,根据实际正确计算的门电路个数和各门电路的消耗权重,确定所述计算结果对应的计算节点的累计计算贡献值;After determining the actual workload of the calculation performed by the calculation node and verifying that the calculation result is correct, the cumulative calculation contribution of the calculation node corresponding to the calculation result is determined according to the number of gate circuits that are actually calculated correctly and the consumption weight of each gate circuit. value;
根据所述累计计算贡献值为各计算节点分配预设奖励;其中所述预设奖励和所述累计计算贡献值成正比。Allocating a preset reward to each computing node according to the cumulative calculated contribution value; wherein the preset reward is directly proportional to the cumulative calculated contribution value.
具体的,接收各计算节点以累计计算贡献值作为的投票数据,并对备选节点进行投票,包括:Specifically, receiving the voting data of each computing node as the cumulative calculation contribution value and voting on the candidate nodes includes:
接收各计算节点的投票信息,并根据所述投票信息确定投票是否成功;所述投票信息包括所投票的备选节点和所投票的累计计算贡献值信息;Receiving voting information of each computing node, and determining whether the voting is successful or not according to the voting information; the voting information includes the candidate node that was voted and the cumulative calculation contribution value information that was voted;
在计算节点所拥有的累计计算贡献值满足所述累计计算贡献值信息时,确定投票成功,并在共识周期结束后,将投票成功对应的计算贡献值从所述计算节点处扣除;When the accumulated calculation contribution value owned by the calculation node satisfies the accumulated calculation contribution value information, determining that the voting is successful, and deducting the calculation contribution value corresponding to the successful voting from the calculation node after the end of the consensus period;
在计算节点所拥有的累计计算贡献值未满足所述累计计算贡献值信息时,确定投票失败。When the cumulative computing contribution value owned by the computing node does not satisfy the cumulative computing contribution value information, it is determined that the voting has failed.
具体的,将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的,包括:Specifically, the preset N candidate nodes that get the most votes are taken as the N consensus nodes; among them, the N consensus nodes use a practical Byzantine fault tolerance algorithm to complete consensus on the block data, including:
将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法轮流出块,并对区块数据完成共识的;该N个共识节点被用于将正确的计算结果和对应的累计计算贡献值写入到区块链网络的区块中。The N preset candidate nodes that get the most votes are taken as N consensus nodes; among them, the N consensus nodes use a practical Byzantine fault tolerance algorithm to rotate out of the block and complete consensus on the block data; the N Consensus nodes are used to write the correct calculation results and corresponding cumulative calculation contribution values into the blocks of the blockchain network.
一种基于有效算力贡献的共识装置,包括:A consensus device based on effective computing power contributions, including:
计算任务及需求接收单元,用于接收计算发布方发布的计算任务以及所述计算任务对应的计算需求;A computing task and a demand receiving unit, configured to receive a computing task issued by a computing publisher and a computing requirement corresponding to the computing task;
计算任务配置单元,用于根据所述计算需求进行计算任务的相应配置;A computing task configuration unit, configured to perform a corresponding configuration of a computing task according to the computing demand;
布尔电路编译单元,用于获取所述计算任务所需的数据,并将所述计算任务编译成为布尔电路;A Boolean circuit compiling unit, configured to obtain data required for the computing task and compile the computing task into a Boolean circuit;
并行计算任务分发单元,用于根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点处进行计算;A parallel computing task distribution unit, configured to form multiple parallel computing tasks according to the Boolean circuit, the corresponding configuration of the computing task, and data required by the computing task, and distribute the multiple parallel computing tasks to multiple computing nodes Calculation;
计算结果及证明接收单元,用于接收所述计算节点对所述并行计算任务进行计算的计算结果和计算证明,并根据所述计算证明确定所述计算结果是否有效;A calculation result and certificate receiving unit, configured to receive a calculation result and a calculation certificate performed by the computing node on the parallel computing task, and determine whether the calculation result is valid according to the calculation certificate;
奖励分配单元,用于在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励;A reward distribution unit, configured to determine a cumulative calculation contribution value of a computing node corresponding to the calculation result after determining that the calculation result is valid, and allocate a preset reward to each computing node according to the cumulative calculation contribution value;
投票单元,用于接收各计算节点以累计计算贡献值作为的投票数据,并对备选节点进行投票;A voting unit, configured to receive voting data of each computing node as a cumulative calculation contribution value, and vote on candidate nodes;
共识节点确定单元,用于将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的。The consensus node determining unit is configured to use the preset N candidate nodes that have received the most votes as N consensus nodes. Among the N consensus nodes, a practical Byzantine fault tolerance algorithm is used to complete the consensus on the block data.
具体的,所述计算任务及需求接收单元中的计算任务对应的计算需求,包括可验证计算算法。Specifically, the computing task corresponding to the computing task and the computing task in the demand receiving unit includes a verifiable computing algorithm.
另外,所述计算任务配置单元,具体用于:In addition, the computing task configuration unit is specifically configured to:
根据所述计算需求中包括的可验证计算算法,配置可验证计算算法的相应参数。According to the verifiable computing algorithm included in the computing requirement, corresponding parameters of the verifiable computing algorithm are configured.
另外,所述布尔电路编译单元,具体用于:In addition, the Boolean circuit compilation unit is specifically configured to:
获取所述计算任务所需的数据,并根据预先设置的编译器将所述计算任务编译成为布尔电路;所述布尔电路包括多个门电路,各个门电路具有相应的消耗权重。The data required for the calculation task is obtained, and the calculation task is compiled into a Boolean circuit according to a preset compiler; the Boolean circuit includes a plurality of gate circuits, and each gate circuit has a corresponding consumption weight.
另外,所述并行计算任务分发单元,具体用于:In addition, the parallel computing task distribution unit is specifically configured to:
将所述布尔电路拆分为多个布尔子电路,每个布尔子电路包括一至多个门电路;Dividing the Boolean circuit into a plurality of Boolean sub-circuits, each of which includes one or more gate circuits;
将可验证计算算法的相应参数、布尔子电路和计算任务所需的数据整合成多个并行计算任务;Integrate corresponding parameters of verifiable computing algorithms, Boolean subcircuits, and data required for computing tasks into multiple parallel computing tasks;
将所述多个并行计算任务通过计算通道分发到多个计算节点处进行计算;其中,同一并行计算任务被同时分发到多个计算节点处,并保留预先设置的计算冗余度。Distributing the multiple parallel computing tasks to multiple computing nodes for calculation through a computing channel; wherein the same parallel computing task is distributed to multiple computing nodes simultaneously, and a preset computing redundancy is retained.
此外,所述计算结果及证明接收单元,具体用于:In addition, the calculation result and the certificate receiving unit are specifically used to:
接收所述计算节点对所述并行计算任务进行计算的计算结果和根据可验证计算算法的相应参数进行可验证计算得到的计算证明;Receiving a calculation result obtained by the calculation node for the parallel calculation task and a calculation certificate obtained by performing a verifiable calculation according to a corresponding parameter of the verifiable calculation algorithm;
根据所述计算证明确定计算节点进行计算的实际工作量,以及验证所述计算结果是否正确;所述计算节点进行计算的实际工作量包括实际正确计算的门电路个数。The actual workload of the calculation performed by the calculation node is determined according to the calculation certificate, and the calculation result is verified to be correct; the actual workload of the calculation performed by the calculation node includes the number of gate circuits that are actually correctly calculated.
此外,所述奖励分配单元,具体用于:In addition, the reward allocation unit is specifically configured to:
在确定计算节点进行计算的实际工作量,以及验证所述计算结果正确后,根据实际正确计算的门电路个数和各门电路的消耗权重,确定所述计算结果对应的计算节点的累计计算贡献值;After determining the actual workload of the calculation performed by the calculation node and verifying that the calculation result is correct, the cumulative calculation contribution of the calculation node corresponding to the calculation result is determined according to the number of gate circuits that are actually calculated correctly and the consumption weight of each gate circuit. value;
根据所述累计计算贡献值为各计算节点分配预设奖励;其中所述预设奖励和所述累计计算贡献值成正比。Allocating a preset reward to each computing node according to the cumulative calculated contribution value; wherein the preset reward is directly proportional to the cumulative calculated contribution value.
此外,所述投票单元,具体用于:In addition, the voting unit is specifically configured to:
接收各计算节点的投票信息,并根据所述投票信息确定投票是否成功;所述投票信息包括所投票的备选节点和所投票的累计计算贡献值信息;Receiving voting information of each computing node, and determining whether the voting is successful or not according to the voting information; the voting information includes the candidate node that was voted and the cumulative calculation contribution value information that was voted;
在计算节点所拥有的累计计算贡献值满足所述累计计算贡献值信息时,确定投票成功,并在共识周期结束后,将投票成功对应的计算贡献值从所述计算节点处扣除;When the accumulated calculation contribution value owned by the calculation node satisfies the accumulated calculation contribution value information, determining that the voting is successful, and deducting the calculation contribution value corresponding to the successful voting from the calculation node after the end of the consensus period;
在计算节点所拥有的累计计算贡献值未满足所述累计计算贡献值信息时,确定投票失败。When the cumulative computing contribution value owned by the computing node does not satisfy the cumulative computing contribution value information, it is determined that the voting has failed.
此外,所述共识节点确定单元,具体用于:In addition, the consensus node determining unit is specifically configured to:
将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法轮流出块,并对区块数据完成共识的;该N个共识节点被用于将正确的计算结果和对应的累计计算贡献值写入到区块链网络的区块中。The N preset candidate nodes that get the most votes are taken as N consensus nodes; among them, the N consensus nodes use a practical Byzantine fault tolerance algorithm to rotate out of the block and complete consensus on the block data; the N Consensus nodes are used to write the correct calculation results and corresponding cumulative calculation contribution values into the blocks of the blockchain network.
一种基于有效算力贡献的共识系统,包括:计算发布方、基于有效算力贡献的共识装置和多个计算节点;A consensus system based on effective computing power contributions, including: a calculation issuer, a consensus device based on effective computing power contributions, and multiple computing nodes;
所述计算发布方用于向基于有效算力贡献的共识装置发布计算任务以及所述计算任务对应的计算需求;The calculation issuer is configured to issue a calculation task and a calculation request corresponding to the calculation task to a consensus device based on an effective calculation power contribution;
所述基于有效算力贡献的共识装置用于根据所述计算需求进行计算任务的相应配置;获取所述计算任务所需的数据,并将所述计算任务编译成为布尔电路;根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点处;The consensus device based on the contribution of effective computing power is configured to perform a corresponding configuration of a computing task according to the computing demand; acquire data required for the computing task, and compile the computing task into a Boolean circuit; according to the Boolean circuit The corresponding configuration of the computing task and the data required for the computing task form multiple parallel computing tasks, and distribute the multiple parallel computing tasks to multiple computing nodes;
所述计算节点用于对所述并行计算任务进行计算,形成计算结果和计算证明,并发送至所述基于有效算力贡献的共识装置;The computing node is configured to calculate the parallel computing task, form a calculation result and a calculation certificate, and send the calculation result and the consensus device based on the effective computing power contribution;
所述基于有效算力贡献的共识装置还用于根据所述计算证明确定所述计算结果是否有效;在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励;接收各计算节点以累计计算贡献值作为的投票数据,并对备选节点进行投票;将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的。The consensus device based on the effective computing power contribution is further configured to determine whether the calculation result is valid according to the calculation certificate; and after determining that the calculation result is valid, determine a cumulative calculation contribution value of a computing node corresponding to the calculation result, And assign preset rewards to each computing node according to the cumulative calculated contribution value; receive voting data of the cumulative computing contribution value of each computing node, and vote on alternative nodes; the preset N backups with the most votes will be obtained The nodes are selected as N consensus nodes; among them, the N consensus nodes adopt a practical Byzantine fault tolerance algorithm to complete consensus on the block data.
本发明实施例提供的一种基于有效算力贡献的共识方法、装置及系统,首先接收计算发布方发布的计算任务以及所述计算任务对应的计算需求;根据所述计算需求进行计算任务的相应配置;获取所述计算任务所需的数据,并将所述计算任务编译成为布尔电路;根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点处进行计算;接收所述计算节点对所述并行计算任务进行计算的计算结果和计算证明,并根据所述计算证明确定所述计算结果是否有效;在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励;接收各计算节点以累计计算贡献值作为的投票数据,并对备选节点进行投票;将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的。可见,本发明是基于有效工作量证明算法,将共识与计算分离,算力只用来执行实际的计算工作,不用来挖矿,从而可以解决目前区块链中的共识机制存在的算力浪费、共识效率低和权力过于集中的问题。A consensus method, device, and system based on effective computing power contributions provided by embodiments of the present invention first receive a computing task issued by a computing publisher and a computing requirement corresponding to the computing task; and perform a corresponding computing task according to the computing requirement. Configuration; acquiring data required for the computing task and compiling the computing task into a Boolean circuit; forming a plurality of parallel computing tasks according to the corresponding configuration of the Boolean circuit, the computing task, and data required for the computing task, and Distributing the plurality of parallel computing tasks to a plurality of computing nodes for calculation; receiving a calculation result and a calculation certificate performed by the computing node on the parallel computing task, and determining whether the calculation result is based on the calculation certificate Valid; after determining that the calculation result is valid, determine the accumulated calculation contribution value of the calculation node corresponding to the calculation result, and assign a preset reward to each calculation node according to the accumulated calculation contribution value; receive each calculation node for the accumulated calculation Contribution value as voting data and voting on candidate nodes; Alternatively, the N most votes node set in advance as a consensus of N nodes; wherein, between the N nodes consensus Byzantine fault tolerance is the practical use of the consensus algorithm to complete the data block. It can be seen that the present invention is based on an effective proof-of-work algorithm, which separates consensus from calculation. The computing power is only used to perform the actual computing work and not used for mining, so that the waste of computing power existing in the consensus mechanism in the current blockchain can be solved. , Low consensus efficiency and overly concentrated power.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本 发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are merely These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without paying creative labor.
图1为本发明实施例提供的一种基于有效算力贡献的共识方法的流程图一;FIG. 1 is a first flowchart of a consensus method based on effective computing power contribution provided by an embodiment of the present invention; FIG.
图2为本发明实施例提供的一种基于有效算力贡献的共识方法的流程图二;2 is a second flowchart of a consensus method based on effective computing power contribution provided by an embodiment of the present invention;
图3为本发明实施例提供的一种基于有效算力贡献的共识装置的结构示意图;FIG. 3 is a schematic structural diagram of a consensus device based on an effective computing power contribution according to an embodiment of the present invention; FIG.
图4为本发明实施例提供的一种基于有效算力贡献的共识系统的结构示意图;4 is a schematic structural diagram of a consensus system based on effective computing power contribution provided by an embodiment of the present invention;
图5为本申请的实施例中的电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device in an embodiment of the present application.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In the following, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
如图1所示,本发明实施例提供一种基于有效算力贡献的共识方法,包括:As shown in FIG. 1, an embodiment of the present invention provides a consensus method based on effective computing power contributions, including:
步骤101、接收计算发布方发布的计算任务以及所述计算任务对应的计算需求。Step 101: Receive a computing task issued by a computing publisher and a computing requirement corresponding to the computing task.
步骤102、根据所述计算需求进行计算任务的相应配置。Step 102: Perform a corresponding configuration of a computing task according to the computing requirements.
步骤103、获取所述计算任务所需的数据,并将所述计算任务编译成为布尔电路。Step 103: Obtain data required for the computing task, and compile the computing task into a Boolean circuit.
步骤104、根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点处进行计算。Step 104: Form a plurality of parallel computing tasks according to the Boolean circuit, a corresponding configuration of the computing task, and data required for the computing task, and distribute the plurality of parallel computing tasks to a plurality of computing nodes for calculation.
步骤105、接收所述计算节点对所述并行计算任务进行计算的计算结果和计算证明,并根据所述计算证明确定所述计算结果是否有效。Step 105: Receive a calculation result and a calculation certificate performed by the calculation node on the parallel computing task, and determine whether the calculation result is valid according to the calculation certificate.
步骤106、在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励。Step 106: After determining that the calculation result is valid, determine a cumulative calculation contribution value of a computing node corresponding to the calculation result, and allocate a preset reward to each computing node according to the accumulated calculation contribution value.
步骤107、接收各计算节点以累计计算贡献值作为的投票数据,并对备选节点进行投票。Step 107: Receive voting data of each computing node as a cumulative calculation contribution value, and vote on candidate nodes.
步骤108、将得到投票最多的预先设置的N个备选节点作为N个共识节点。Step 108: Use the preset N candidate nodes that get the most votes as N consensus nodes.
其中,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的。从而由于选出N个共识节点,且该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的,则可以在下一次接收计算发布方发布的计算任务后,能够执行上述步骤101至步骤106。即在步骤108之后可返回继续执行步骤101。Among them, the N consensus nodes use a practical Byzantine fault tolerance algorithm to complete consensus on the block data. Therefore, since N consensus nodes are selected, and the N consensus nodes use a practical Byzantine fault tolerance algorithm to complete consensus on the block data, the next step 101 can be performed after receiving the calculation task issued by the calculation publisher. Go to step 106. That is, after step 108, the process may return to step 101.
本发明实施例提供的一种基于有效算力贡献的共识方法,是基于有效工作量证明算法,将共识与计算分离,算力只用来执行实际的计算工作,不用来挖矿,不存在算力浪费的问题。另外,共识节点之间采用实用拜占庭容错算法对区块数据完成共识对于复杂计算,区块中直接包含交易结果及其证明,验证节点可通过密码学算法进行快速有效的验证,不需要采用计算过程本地重放的方法来验证交易,避免算力的浪费,同时也从整体上提升了区块链的共识效率,从而提升全网的交易吞吐量。本发明可以解决目前区块链中的共识机制存在的算力浪费、共识效率低和权力过于集中的问题。An embodiment of the present invention provides a consensus method based on the contribution of effective computing power, which is based on an effective proof-of-work algorithm to separate consensus from calculation. The computing power is only used to perform the actual computing work, not used for mining, and there is no calculation. The problem of wasting power. In addition, consensus nodes use a practical Byzantine fault-tolerant algorithm to complete consensus on block data. For complex calculations, the block directly contains the transaction results and their proofs. Verification nodes can perform fast and effective verification through cryptographic algorithms without the need for a calculation process. Local replay method to verify transactions, avoid waste of computing power, and at the same time improve the consensus efficiency of the blockchain as a whole, thereby improving the transaction throughput of the entire network. The invention can solve the problems of wasted computing power, low consensus efficiency and excessive power concentration in the current consensus mechanism in the blockchain.
为了使本领域技术人员更好的了解本发明,下面列举一个更为详细的实施例,如图2所示,本发明实施例提供一种基于有效算力贡献的共识方法,包括:In order to enable those skilled in the art to better understand the present invention, a more detailed embodiment is enumerated below. As shown in FIG. 2, the embodiment of the present invention provides a consensus method based on effective computing power contributions, including:
步骤201、接收计算发布方发布的计算任务以及所述计算任务对应的计算需求。Step 201: Receive a computing task issued by a computing publisher and a computing requirement corresponding to the computing task.
具体的,所述计算任务对应的计算需求包括可验证计算算法(Verifiable Compilation,简称VC)。Specifically, the computing requirement corresponding to the computing task includes a verifiable computing algorithm (Verifiable Compilation, VC for short).
步骤202、根据所述计算需求中包括的可验证计算算法,配置可验证计算算法的相应参数。Step 202: Configure corresponding parameters of the verifiable computing algorithm according to the verifiable computing algorithm included in the computing requirement.
步骤203、获取所述计算任务所需的数据,并根据预先设置的编译器将所述计算任务编译成为布尔电路。Step 203: Obtain data required for the computing task, and compile the computing task into a Boolean circuit according to a preset compiler.
此处可将计算任务编译成为布尔电路,该布尔电路包括多个门电路,各个门电路具有相应的消耗权重。The calculation task can be compiled into a Boolean circuit here. The Boolean circuit includes multiple gate circuits, and each gate circuit has a corresponding consumption weight.
步骤204、将所述布尔电路拆分为多个布尔子电路,每个布尔子电路包括一至多个门电路。Step 204: The Boolean circuit is divided into multiple Boolean sub-circuits, and each Boolean sub-circuit includes one or more gate circuits.
步骤205、将可验证计算算法的相应参数、布尔子电路和计算任务所需的数据整合成多个并行计算任务。Step 205: Integrate corresponding parameters of the verifiable computing algorithm, Boolean subcircuits, and data required for the computing task into multiple parallel computing tasks.
步骤206、将所述多个并行计算任务通过计算通道分发到多个计算节点处进行计算;同一并行计算任务被同时分发到多个计算节点处,并保留预先设置的计算冗余度。Step 206: Distribute the multiple parallel computing tasks to multiple computing nodes for calculation through a computing channel; the same parallel computing task is simultaneously distributed to multiple computing nodes, and a preset computing redundancy is retained.
步骤207、接收所述计算节点对所述并行计算任务进行计算的计算结果和根据可验证计算算法的相应参数进行可验证计算得到的计算证明。Step 207: Receive a calculation result obtained by the calculation node for the parallel calculation task and a calculation certificate obtained by performing a verifiable calculation according to a corresponding parameter of the verifiable calculation algorithm.
步骤208、根据所述计算证明确定计算节点进行计算的实际工作量,以及验证所述计算结果是否正确;所述计算节点进行计算的实际工作量包括实际正确计算的门电路个数。Step 208: Determine the actual workload of the calculation performed by the computing node according to the calculation certificate, and verify whether the calculation result is correct; the actual workload of the calculation performed by the calculation node includes the number of gate circuits that are actually correctly calculated.
步骤209、在确定计算节点进行计算的实际工作量,以及验证所述计算结果正确后,根据实际正确计算的门电路个数和各门电路的消耗权重,确定所述计算结果对应的计算节点的累计计算贡献值。Step 209: After determining the actual workload of the computing node for calculation and verifying that the calculation result is correct, determine the calculation node corresponding to the calculation result according to the number of gate circuits that are actually calculated correctly and the consumption weight of each gate circuit. Cumulatively calculate the contribution value.
该计算节点的累计计算贡献值可以是其实际正确计算的门电路按照消耗权重求和得出的值。The cumulative calculation contribution value of the computing node may be a value obtained by summing the gate circuits that it actually calculates correctly according to the consumption weights.
步骤210、根据所述累计计算贡献值为各计算节点分配预设奖励;其中所述预设奖励和所述累计计算贡献值成正比。Step 210: Assign preset rewards to each computing node according to the cumulative calculated contribution value; wherein the preset reward is proportional to the cumulative calculated contribution value.
步骤211、接收各计算节点的投票信息,并根据所述投票信息确定投票是否成功。Step 211: Receive voting information of each computing node, and determine whether the voting is successful according to the voting information.
其中,所述投票信息包括所投票的备选节点和所投票的累计计算贡献值信息。The voting information includes voted candidate nodes and voted cumulative calculation contribution value information.
此处,在一个时间周期内,可以按累计计算贡献值大小对各计算节点进行排序,累计计算贡献值多的计算节点作为备选节点,例如可预先设置N个累计计算贡献值多的计算节点作为备选节点。Here, in a time period, each computing node can be sorted according to the size of the cumulative calculation contribution value, and a computing node with a large cumulative calculation contribution value is used as an alternative node. For example, N computing nodes with a large cumulative calculation contribution value can be set in advance. As an alternative node.
在步骤211之后执行步骤212或者步骤213。After step 211, step 212 or step 213 is performed.
步骤212、在计算节点所拥有的累计计算贡献值满足所述累计计算贡献值信息时,Step 212: When the cumulative calculated contribution value owned by the computing node satisfies the cumulative calculated contribution value information,
确定投票成功,并在共识周期结束后,将投票成功对应的计算贡献值从所述计算节点处扣除。It is determined that the voting is successful, and after the end of the consensus period, the calculated contribution value corresponding to the successful voting is deducted from the computing node.
步骤213、在计算节点所拥有的累计计算贡献值未满足所述累计计算贡献值信息时,确定投票失败。Step 213: When the accumulated calculated contribution value owned by the computing node does not satisfy the accumulated calculated contribution value information, determine that the voting has failed.
在步骤212和步骤213之后执行步骤214。After step 212 and step 213, step 214 is performed.
步骤214、将得到投票最多的预先设置的N个备选节点作为N个共识节点。Step 214: Use the preset N candidate nodes that get the most votes as N consensus nodes.
其中,该N个共识节点之间是采用实用拜占庭容错算法轮流出块,并对区块数据完成共识的;该N个共识节点被用于将正确的计算结果和对应的累计计算贡献值写入到区块链网络的区块中。从而由于选出N个共识节点,且该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的,则可以在下一次接收计算发布方发布的计算任务后,能够执行上述步骤201至步骤213。即在步骤214之后可以继续执行步骤201。Among them, the N consensus nodes use a practical Byzantine fault tolerance algorithm to round out blocks and complete consensus on the block data; the N consensus nodes are used to write the correct calculation results and corresponding cumulative calculation contribution values Into the block of the blockchain network. Therefore, since N consensus nodes are selected and the N consensus nodes use a practical Byzantine fault tolerance algorithm to complete consensus on the block data, the next step 201 can be performed after receiving the calculation task issued by the calculation publisher. Go to step 213. That is, step 201 can be continued after step 214.
另外,对于出块的共识节点获得的收益可按照投票比例分给进行投票的计算节点。如果发现共识节点作假,可取消其作为共识节点的资格,并扣除所有累计计算贡献值以及一定的资金。下一个周期再重复选举过程。In addition, the revenue obtained by the consensus node that produced the block can be distributed to the computing node that voted according to the voting proportion. If a consensus node is found to be fraudulent, it may be disqualified from acting as a consensus node and deduct all accumulated calculated contribution values and certain funds. The election process is repeated in the next cycle.
在验证区块的有效性时,系统可按照合约的复杂程度自适应的配置验证方法。针对简单合约(合约不涉及并行或者外包计算,也就是本地节点计算就能完成的称为简单合 约),节点只需要重新计算合约,并检查结果是否一致。对于复杂合约(并行计算或者外包计算,也就是除了本地节点之外,还需要其他节点协助计算才能完成的合约称为复杂合约),系统会将合约中承载的功能计算分发给多个计算节点,每个计算节点在反馈计算结果以及计算证明。共识节点将计算结果与计算证明放在区块链中的区块中,其他节点只需验证证明确定区块的合法性,当合约非常复杂时,并行计算可以大幅降低区块验证的时间,提高性能。When verifying the validity of the block, the system can adaptively configure the verification method according to the complexity of the contract. For simple contracts (contracts that do not involve parallel or outsourced calculations, that is, local node calculations are called simple contracts), nodes only need to recalculate the contracts and check whether the results are consistent. For complex contracts (parallel computing or outsourced computing, that is, contracts that require other nodes to assist in computing in addition to local nodes are called complex contracts), the system will distribute the functional calculations carried in the contract to multiple computing nodes. Each computing node feeds back the calculation results and calculation proof. Consensus nodes place the calculation results and calculation proofs in the blocks in the blockchain. Other nodes only need to verify the proof to determine the legitimacy of the block. When the contract is very complicated, parallel computing can greatly reduce the block verification time and improve performance.
本发明实施例提供的一种基于有效算力贡献的共识方法,首先接收计算发布方发布的计算任务以及所述计算任务对应的计算需求;根据所述计算需求进行计算任务的相应配置;获取所述计算任务所需的数据,并将所述计算任务编译成为布尔电路;根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点处进行计算;接收所述计算节点对所述并行计算任务进行计算的计算结果和计算证明,并根据所述计算证明确定所述计算结果是否有效;在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励;接收各计算节点以累计计算贡献值作为的投票数据,并对备选节点进行投票;将得到投票最多的预先设置的N个备选节点作为N个共识节点,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的。可见,本发明是基于有效工作量证明算法,将共识与计算分离,算力只用来执行实际的计算工作,不用来挖矿,从而可以解决目前区块链中的共识机制存在的算力浪费、共识效率低和权力过于集中的问题。本发明可适用于区块链的相关产品或者服务,包括公链产品或者联盟链的产品。An embodiment of the present invention provides a consensus method based on effective computing power contributions. First, a computing task issued by a computing publisher and a computing requirement corresponding to the computing task are received; a corresponding configuration of the computing task is performed according to the computing requirement; Describe the data required for the computing task, and compile the computing task into a Boolean circuit; form multiple parallel computing tasks according to the Boolean circuit, the corresponding configuration of the computing task, and the data required for the computing task, and convert the multiple Distribute parallel computing tasks to multiple computing nodes to perform calculations; receive calculation results and calculation certificates of the parallel computing tasks performed by the computing nodes, and determine whether the calculation results are valid according to the calculation certificates; After the calculation result is valid, determine the accumulated calculation contribution value of the calculation node corresponding to the calculation result, and assign a preset reward to each calculation node according to the accumulated calculation contribution value; and receive each calculation node as the accumulated calculation contribution value. Voting data, and voting on alternative nodes; will get the most votes Alternatively, the first set of N nodes as the nodes of N consensus, the consensus between the N nodes Byzantine fault tolerance is the practical use of the consensus algorithm to complete the data block. It can be seen that the present invention is based on an effective proof-of-work algorithm, which separates consensus from calculation. The computing power is only used to perform the actual computing work and not used for mining, so that the waste of computing power existing in the consensus mechanism in the current blockchain can be solved. , Low consensus efficiency and overly concentrated power. The invention can be applied to related products or services of the blockchain, including public chain products or products of the alliance chain.
对应于上述图1和图2所示的方法实施例,如图3所示,本发明实施例还提供一种基于有效算力贡献的共识装置,包括:Corresponding to the method embodiments shown in FIG. 1 and FIG. 2 described above, as shown in FIG. 3, an embodiment of the present invention further provides a consensus device based on effective computing power contributions, including:
计算任务及需求接收单元31,用于接收计算发布方发布的计算任务以及所述计算任务对应的计算需求。The computing task and requirement receiving unit 31 is configured to receive a computing task issued by a computing issuer and a computing requirement corresponding to the computing task.
计算任务配置单元32,用于根据所述计算需求进行计算任务的相应配置。The computing task configuration unit 32 is configured to perform a corresponding configuration of a computing task according to the computing requirements.
布尔电路编译单元33,用于获取所述计算任务所需的数据,并将所述计算任务编译成为布尔电路。The Boolean circuit compiling unit 33 is configured to acquire data required for the computing task and compile the computing task into a Boolean circuit.
并行计算任务分发单元34,用于根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点处进行计算。A parallel computing task distribution unit 34 is configured to form a plurality of parallel computing tasks according to the Boolean circuits, corresponding configurations of the computing tasks, and data required by the computing tasks, and distribute the plurality of parallel computing tasks to multiple computing nodes. Calculations.
计算结果及证明接收单元35,用于接收所述计算节点对所述并行计算任务进行计算的计算结果和计算证明,并根据所述计算证明确定所述计算结果是否有效。The calculation result and certificate receiving unit 35 is configured to receive a calculation result and a calculation certificate performed by the computing node on the parallel computing task, and determine whether the calculation result is valid according to the calculation certificate.
奖励分配单元36,用于在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励。The reward distribution unit 36 is configured to determine a cumulative calculation contribution value of a computing node corresponding to the calculation result after determining that the calculation result is valid, and allocate a preset reward to each computing node according to the cumulative calculation contribution value.
投票单元37,用于接收各计算节点以累计计算贡献值作为的投票数据,并对备选节点进行投票。The voting unit 37 is configured to receive voting data of each computing node as a cumulative calculation contribution value, and vote on candidate nodes.
共识节点确定单元38,用于将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的。The consensus node determining unit 38 is configured to use the preset N candidate nodes that have received the most votes as the N consensus nodes. Among the N consensus nodes, a practical Byzantine fault tolerance algorithm is used to complete the consensus on the block data.
具体的,所述计算任务及需求接收单元31中的计算任务对应的计算需求,包括可验证计算算法。Specifically, the computing task corresponding to the computing task in the computing task and the demand receiving unit 31 includes a verifiable computing algorithm.
另外,所述计算任务配置单元32,具体用于:In addition, the computing task configuration unit 32 is specifically configured to:
根据所述计算需求中包括的可验证计算算法,配置可验证计算算法的相应参数。According to the verifiable computing algorithm included in the computing requirement, corresponding parameters of the verifiable computing algorithm are configured.
另外,所述布尔电路编译单元33,具体用于:In addition, the Boolean circuit compiling unit 33 is specifically configured to:
获取所述计算任务所需的数据,并根据预先设置的编译器将所述计算任务编译成为布尔电路;所述布尔电路包括多个门电路,各个门电路具有相应的消耗权重。The data required for the calculation task is obtained, and the calculation task is compiled into a Boolean circuit according to a preset compiler; the Boolean circuit includes a plurality of gate circuits, and each gate circuit has a corresponding consumption weight.
另外,所述并行计算任务分发单元34,具体用于:In addition, the parallel computing task distribution unit 34 is specifically configured to:
将所述布尔电路拆分为多个布尔子电路,每个布尔子电路包括一至多个门电路。The Boolean circuit is divided into a plurality of Boolean sub-circuits, and each Boolean sub-circuit includes one or more gate circuits.
将可验证计算算法的相应参数、布尔子电路和计算任务所需的数据整合成多个并行计算任务。Integrate the corresponding parameters of verifiable computing algorithms, Boolean subcircuits, and data required for computing tasks into multiple parallel computing tasks.
将所述多个并行计算任务通过计算通道分发到多个计算节点处进行计算;其中,同一并行计算任务被同时分发到多个计算节点处,并保留预先设置的计算冗余度。Distributing the multiple parallel computing tasks to multiple computing nodes for calculation through a computing channel; wherein the same parallel computing task is distributed to multiple computing nodes simultaneously, and a preset computing redundancy is retained.
此外,所述计算结果及证明接收单元35,具体用于:In addition, the calculation result and certification receiving unit 35 is specifically configured to:
接收所述计算节点对所述并行计算任务进行计算的计算结果和根据可验证计算算法的相应参数进行可验证计算得到的计算证明。Receiving a calculation result obtained by the computing node performing calculation on the parallel computing task and a calculation certificate obtained by performing verifiable calculation according to a corresponding parameter of the verifiable calculation algorithm.
根据所述计算证明确定计算节点进行计算的实际工作量,以及验证所述计算结果是否正确;所述计算节点进行计算的实际工作量包括实际正确计算的门电路个数。The actual workload of the calculation performed by the calculation node is determined according to the calculation certificate, and the calculation result is verified to be correct; the actual workload of the calculation performed by the calculation node includes the number of gate circuits that are actually correctly calculated.
此外,所述奖励分配单元36,具体用于:In addition, the reward distribution unit 36 is specifically configured to:
在确定计算节点进行计算的实际工作量,以及验证所述计算结果正确后,根据实际正确计算的门电路个数和各门电路的消耗权重,确定所述计算结果对应的计算节点的累计计算贡献值。After determining the actual workload of the calculation performed by the calculation node and verifying that the calculation result is correct, the cumulative calculation contribution of the calculation node corresponding to the calculation result is determined according to the number of gate circuits that are actually calculated correctly and the consumption weight of each gate circuit. value.
根据所述累计计算贡献值为各计算节点分配预设奖励;其中所述预设奖励和所述累计计算贡献值成正比。Allocating a preset reward to each computing node according to the cumulative calculated contribution value; wherein the preset reward is directly proportional to the cumulative calculated contribution value.
此外,所述投票单元37,具体用于:In addition, the voting unit 37 is specifically configured to:
接收各计算节点的投票信息,并根据所述投票信息确定投票是否成功;所述投票信息包括所投票的备选节点和所投票的累计计算贡献值信息。Receive voting information of each computing node, and determine whether the voting is successful or not according to the voting information; the voting information includes the candidate node that was voted on and the cumulative calculation contribution value information that was voted on.
在计算节点所拥有的累计计算贡献值满足所述累计计算贡献值信息时,确定投票成功,并在共识周期结束后,将投票成功对应的计算贡献值从所述计算节点处扣除。When the cumulative computing contribution value owned by the computing node satisfies the cumulative computing contribution value information, the voting is determined to be successful, and after the end of the consensus period, the computing contribution value corresponding to the successful voting is deducted from the computing node.
在计算节点所拥有的累计计算贡献值未满足所述累计计算贡献值信息时,确定投票失败。When the cumulative computing contribution value owned by the computing node does not satisfy the cumulative computing contribution value information, it is determined that the voting has failed.
此外,所述共识节点确定单元38,具体用于:In addition, the consensus node determining unit 38 is specifically configured to:
将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法轮流出块,并对区块数据完成共识的;该N个共识节点被用于将正确的计算结果和对应的累计计算贡献值写入到区块链网络的区块中。The N preset candidate nodes that get the most votes are taken as N consensus nodes; among them, the N consensus nodes use a practical Byzantine fault tolerance algorithm to rotate out of the block and complete consensus on the block data; the N Consensus nodes are used to write the correct calculation results and corresponding cumulative calculation contribution values into the blocks of the blockchain network.
本发明实施例提供的一种基于有效算力贡献的共识装置,是基于有效工作量证明算法,将共识与计算分离,算力只用来执行实际的计算工作,不用来挖矿,从而可以解决目前区块链中的共识机制存在的算力浪费、共识效率低和权力过于集中的问题。An embodiment of the present invention provides a consensus device based on the contribution of effective computing power, which is based on an effective proof-of-work algorithm to separate consensus from calculation. The computing power is only used to perform the actual computing work and not used for mining, which can solve the problem. The current consensus mechanisms in blockchains have problems such as wasted computing power, low consensus efficiency, and excessive power concentration.
另外,如图4所示,本发明实施例还提供一种基于有效算力贡献的共识系统,包括:计算发布方41、基于有效算力贡献的共识装置42和多个计算节点43。In addition, as shown in FIG. 4, an embodiment of the present invention further provides a consensus system based on effective computing power contributions, including: a calculation issuer 41, a consensus device 42 based on effective computing power contributions, and a plurality of computing nodes 43.
该计算发布方41用于向基于有效算力贡献的共识装置42发布计算任务以及所述计算任务对应的计算需求。The calculation issuer 41 is configured to issue a calculation task and a calculation request corresponding to the calculation task to a consensus device 42 based on an effective calculation power contribution.
该基于有效算力贡献的共识装置42用于根据所述计算需求进行计算任务的相应配置;获取所述计算任务所需的数据(可从第三方系统、区块链上或者区块链外得到所需的数据),并将所述计算任务编译成为布尔电路;根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点43处。The consensus device 42 based on the effective computing power contribution is used to perform the corresponding configuration of the computing task according to the computing demand; obtain the data required for the computing task (available from a third-party system, on or off the blockchain) Required data), and compile the computing task into a Boolean circuit; according to the Boolean circuit, the corresponding configuration of the computing task, and the data required for the computing task, form a plurality of parallel computing tasks, and Computing tasks are distributed to multiple computing nodes 43.
该计算节点43用于对所述并行计算任务进行计算,形成计算结果和计算证明,并发送至所述基于有效算力贡献的共识装置42。The computing node 43 is configured to perform calculation on the parallel computing task, form a calculation result and a calculation certificate, and send the calculation result and the consensus device 42 based on the effective computing power contribution.
该基于有效算力贡献的共识装置42还用于根据所述计算证明确定所述计算结果是否有效;在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励;接收各计算节点43以累计计算贡献值作为的投票数据,并对备选节点进行投票;将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的。The consensus device 42 based on the effective computing power contribution is further configured to determine whether the calculation result is valid according to the calculation certificate; after determining that the calculation result is valid, determine a cumulative calculation contribution value of a computing node corresponding to the calculation result, And assign preset rewards to each computing node according to the cumulative calculated contribution value; receive voting data of each computing node 43 using the cumulative calculated contribution value, and vote on alternative nodes; the preset N number of most votes will be obtained The candidate nodes serve as N consensus nodes; among these N consensus nodes, a practical Byzantine fault tolerance algorithm is used to complete consensus on the block data.
本发明实施例提供的一种基于有效算力贡献的共识系统,是基于有效工作量证明算法,将共识与计算分离,算力只用来执行实际的计算工作,不用来挖矿,从而可以解决目前区块链中的共识机制存在的算力浪费、共识效率低和权力过于集中的问题。An embodiment of the present invention provides a consensus system based on effective computing power contribution, which is based on an effective proof-of-work algorithm that separates consensus from calculation. The computing power is only used to perform the actual computing work and not used for mining, so it can be solved. The current consensus mechanisms in blockchains have problems such as wasted computing power, low consensus efficiency, and excessive power concentration.
本申请的实施例还提供能够实现上述实施例中的基于有效算力贡献的共识方法中全部步骤的一种电子设备的具体实施方式,所述电子设备具体包括如下内容:An embodiment of the present application further provides a specific implementation of an electronic device capable of implementing all the steps in the consensus method based on the effective computing power contribution in the foregoing embodiment. The electronic device specifically includes the following content:
处理器(processor)、存储器(memory)、通信接口(Communications Interface)和总线;其中,所述处理器、存储器、通信接口通过所述总线完成相互间的通信;所述通信接口用于实现相关设备之间的信息传输;该电子设备可以是台式计算机、平板电脑及移动终端等,本实施例不限于此。在本实施例中,该电子设备可以参照实施例用于基于有效算力贡献的共识方法的实施例及用于基于有效算力贡献的共识装置的实施例进行实施,其内容被合并于此,重复之处不再赘述。A processor, a memory, a communication interface, and a bus; wherein the processor, the memory, and the communication interface communicate with each other through the bus; the communication interface is used to implement related equipment Information transmission between them; the electronic device may be a desktop computer, a tablet computer, a mobile terminal, etc., and this embodiment is not limited thereto. In this embodiment, the electronic device may be implemented by referring to the embodiment of the embodiment for the consensus method based on effective computing power contribution and the embodiment of the consensus device based on effective computing power contribution, the contents of which are incorporated herein, The duplicates will not be repeated.
图5为本申请实施例的电子设备600的系统构成的示意框图。如图5所示,该电子设备600可以包括中央处理器100和存储器140;存储器140耦合到中央处理器100。值得注意的是,该图是示例性的;还可以使用其他类型的结构,来补充或代替该结构,以实现电信功能或其他功能。FIG. 5 is a schematic block diagram of a system configuration of an electronic device 600 according to an embodiment of the present application. As shown in FIG. 5, the electronic device 600 may include a central processing unit 100 and a memory 140; the memory 140 is coupled to the central processing unit 100. It is worth noting that this figure is exemplary; other types of structures can also be used to supplement or replace the structure to implement telecommunication functions or other functions.
一实施例中,基于有效算力贡献的共识功能可以被集成到中央处理器100中。其中,中央处理器100可以被配置为进行如下控制:In one embodiment, a consensus function based on effective computing power contributions may be integrated into the central processing unit 100. The central processing unit 100 may be configured to perform the following control:
接收计算发布方发布的计算任务以及所述计算任务对应的计算需求;Receiving a computing task issued by a computing publisher and a computing requirement corresponding to the computing task;
根据所述计算需求进行计算任务的相应配置;Performing a corresponding configuration of a computing task according to the computing requirements;
获取所述计算任务所需的数据,并将所述计算任务编译成为布尔电路;Acquiring data required for the computing task, and compiling the computing task into a Boolean circuit;
根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点处进行计算;Forming a plurality of parallel computing tasks according to the Boolean circuit, a corresponding configuration of the computing task, and data required for the computing task, and distributing the multiple parallel computing tasks to multiple computing nodes for calculation;
接收所述计算节点对所述并行计算任务进行计算的计算结果和计算证明,并根据所述计算证明确定所述计算结果是否有效;Receiving a calculation result and a calculation certificate performed by the calculation node on the parallel computing task, and determining whether the calculation result is valid according to the calculation certificate;
在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励;After determining that the calculation result is valid, determining a cumulative calculation contribution value of a calculation node corresponding to the calculation result, and assigning a preset reward to each calculation node according to the accumulated calculation contribution value;
接收各计算节点以累计计算贡献值作为的投票数据,并对备选节点进行投票;Receiving voting data of each computing node using the cumulative calculation contribution value, and voting on alternative nodes;
将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的。The N preset candidate nodes that get the most votes are taken as the N consensus nodes; among these N consensus nodes, a practical Byzantine fault tolerance algorithm is used to complete the consensus on the block data.
从上述描述可知,本申请的实施例提供一种电子设备,基于有效工作量证明算法,将共识与计算分离,算力只用来执行实际的计算工作,不用来挖矿,从而可以解决目前区块链中的共识机制存在的算力浪费、共识效率低和权力过于集中的问题。As can be seen from the above description, the embodiment of the present application provides an electronic device that separates consensus from calculation based on an effective proof-of-work algorithm. The computing power is only used to perform the actual calculation work and not used for mining, thereby solving the current area. The consensus mechanism in the blockchain has the problems of wasted computing power, low consensus efficiency, and excessive power concentration.
在另一个实施方式中,基于有效算力贡献的共识装置可以与中央处理器100分开配置,例如可以将基于有效算力贡献的共识装置配置为与中央处理器100连接的芯片,通过中央处理器的控制来实现基于有效算力贡献的共识功能。In another embodiment, the consensus device based on the effective computing power contribution may be configured separately from the central processing unit 100. For example, the consensus device based on the effective computing power contribution may be configured as a chip connected to the central processing unit 100. Control to achieve a consensus function based on effective computing power contributions.
如图5所示,该电子设备600还可以包括:通信模块110、输入单元120、音频处理器130、显示器160、电源170。值得注意的是,电子设备600也并不是必须要包括图5中所示的所有部件;此外,电子设备600还可以包括图5中没有示出的部件,可以参考现有技术。As shown in FIG. 5, the electronic device 600 may further include a communication module 110, an input unit 120, an audio processor 130, a display 160, and a power source 170. It is worth noting that the electronic device 600 does not necessarily include all the components shown in FIG. 5; in addition, the electronic device 600 may further include components not shown in FIG. 5, and reference may be made to the prior art.
如图5所示,中央处理器100有时也称为控制器或操作控件,可以包括微处理器或其他处理器装置和/或逻辑装置,该中央处理器100接收输入并控制电子设备600的各个部件的操作。As shown in FIG. 5, the central processing unit 100 is sometimes referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices. The central processing unit 100 receives input and controls each of the electronic devices 600. Operation of parts.
其中,存储器140,例如可以是缓存器、闪存、硬驱、可移动介质、易失性存储器、非易失性存储器或其它合适装置中的一种或更多种。可储存上述与失败有关的信息,此外还可存储执行有关信息的程序。并且中央处理器100可执行该存储器140存储的该程序,以实现信息存储或处理等。The memory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices. The above-mentioned failure-related information can be stored, and in addition, a program for executing the related information can be stored. In addition, the central processing unit 100 may execute the program stored in the memory 140 to implement information storage or processing.
输入单元120向中央处理器100提供输入。该输入单元120例如为按键或触摸输入装置。电源170用于向电子设备600提供电力。显示器160用于进行图像和文字等显示对象的显示。该显示器例如可为LCD显示器,但并不限于此。The input unit 120 provides input to the central processing unit 100. The input unit 120 is, for example, a key input or a touch input device. The power source 170 is used to provide power to the electronic device 600. The display 160 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
该存储器140可以是固态存储器,例如,只读存储器(ROM)、随机存取存储器(RAM)、SIM卡等。还可以是这样的存储器,其即使在断电时也保存信息,可被选择性地擦除且设有更多数据,该存储器的示例有时被称为EPROM等。存储器140还可以是某种其它类型的装置。存储器140包括缓冲存储器141(有时被称为缓冲器)。存储器140可以包括应用/功能存储部142,该应用/功能存储部142用于存储应用程序和功能 程序或用于通过中央处理器100执行电子设备600的操作的流程。The memory 140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, and the like. It may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data. An example of this memory is sometimes called EPROM or the like. The memory 140 may also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage section 142 for storing application programs and function programs or a flow for performing operations of the electronic device 600 through the central processing unit 100.
存储器140还可以包括数据存储部143,该数据存储部143用于存储数据。存储器140的驱动程序存储部144可以包括电子设备的用于通信功能和/或用于执行电子设备的其他功能(如消息传送应用、通讯录应用等)的各种驱动程序。The memory 140 may further include a data storage section 143 for storing data. The driver storage section 144 of the memory 140 may include various driver programs for the communication function of the electronic device and / or for performing other functions of the electronic device (such as a messaging application, an address book application, etc.).
通信模块110即为经由天线111发送和接收信号的发送机/接收机110。通信模块(发送机/接收机)110耦合到中央处理器100,以提供输入信号和接收输出信号,这可以和常规移动通信终端的情况相同。The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via the antenna 111. A communication module (transmitter / receiver) 110 is coupled to the central processing unit 100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
基于不同的通信技术,在同一电子设备中,可以设置有多个通信模块110,如蜂窝网络模块、蓝牙模块和/或无线局域网模块等。通信模块(发送机/接收机)110还经由音频处理器130耦合到扬声器131和麦克风132,以经由扬声器131提供音频输出,并接收来自麦克风132的音频输入,从而实现通常的电信功能。音频处理器130可以包括任何合适的缓冲器、解码器、放大器等。另外,音频处理器还耦合到中央处理器100,从而使得可以通过麦克风132能够在本机上录音,且使得可以通过扬声器131来播放本机上存储的声音。Based on different communication technologies, multiple communication modules 110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module. The communication module (transmitter / receiver) 110 is also coupled to the speaker 131 and the microphone 132 via the audio processor 130 to provide audio output via the speaker 131 and to receive audio input from the microphone 132, thereby realizing general telecommunication functions. The audio processor 130 may include any suitable buffers, decoders, amplifiers, and the like. In addition, the audio processor is also coupled to the central processing unit 100, thereby enabling recording on the unit through the microphone 132, and enabling sounds stored on the unit to be played through the speaker 131.
本申请的实施例还提供能够实现上述实施例中的基于有效算力贡献的共识方法中全部步骤的一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述实施例中的基于有效算力贡献的共识方法的全部步骤,例如,所述处理器执行所述计算机程序时实现下述步骤:An embodiment of the present application further provides a computer-readable storage medium capable of realizing all the steps in the consensus method based on effective computing power contribution in the foregoing embodiment. The computer-readable storage medium stores a computer program, the computer program When executed by a processor, all steps of the consensus method based on effective computing power contributions in the above embodiments are implemented. For example, when the processor executes the computer program, the following steps are implemented:
接收计算发布方发布的计算任务以及所述计算任务对应的计算需求;Receiving a computing task issued by a computing publisher and a computing requirement corresponding to the computing task;
根据所述计算需求进行计算任务的相应配置;Performing a corresponding configuration of a computing task according to the computing requirements;
获取所述计算任务所需的数据,并将所述计算任务编译成为布尔电路;Acquiring data required for the computing task, and compiling the computing task into a Boolean circuit;
根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点处进行计算;Forming a plurality of parallel computing tasks according to the Boolean circuit, a corresponding configuration of the computing task, and data required for the computing task, and distributing the multiple parallel computing tasks to multiple computing nodes for calculation;
接收所述计算节点对所述并行计算任务进行计算的计算结果和计算证明,并根据所述计算证明确定所述计算结果是否有效;Receiving a calculation result and a calculation certificate performed by the calculation node on the parallel computing task, and determining whether the calculation result is valid according to the calculation certificate;
在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励;After determining that the calculation result is valid, determining a cumulative calculation contribution value of a calculation node corresponding to the calculation result, and assigning a preset reward to each calculation node according to the accumulated calculation contribution value;
接收各计算节点以累计计算贡献值作为的投票数据,并对备选节点进行投票;Receiving voting data of each computing node using the cumulative calculation contribution value, and voting on alternative nodes;
将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的。The N preset candidate nodes that get the most votes are taken as the N consensus nodes; among these N consensus nodes, a practical Byzantine fault tolerance algorithm is used to complete the consensus on the block data.
从上述描述可知,本申请的实施例提供一种计算机可读存储介质,基于有效工作量证明算法,将共识与计算分离,算力只用来执行实际的计算工作,不用来挖矿,从而可以解决目前区块链中的共识机制存在的算力浪费、共识效率低和权力过于集中的问题。As can be seen from the above description, the embodiment of the present application provides a computer-readable storage medium that separates consensus from calculation based on an effective proof-of-work algorithm. The computing power is only used to perform the actual calculation work, not used for mining, so that Solve the problems of waste of computing power, low consensus efficiency, and excessive power concentration in the current consensus mechanism of the blockchain.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as a method, a system, or a computer program product. Therefore, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and combinations of processes and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, so that the instructions generated by the processor of the computer or other programmable data processing device are used to generate instructions Means for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a specific manner such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, the instructions The device implements the functions specified in one or more flowcharts and / or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of steps can be performed on the computer or other programmable device to produce a computer-implemented process, which can be executed on the computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
本发明中应用了具体实施例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The principle and implementation of the present invention are explained by applying specific embodiments in the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas; meanwhile, for a person of ordinary skill in the art, The idea of the invention will change in both the specific implementation and the scope of application. In summary, the content of this description should not be construed as a limitation on the present invention.

Claims (21)

  1. 一种基于有效算力贡献的共识方法,其特征在于,包括:A consensus method based on effective computing power contributions is characterized by:
    接收计算发布方发布的计算任务以及所述计算任务对应的计算需求;Receiving a computing task issued by a computing publisher and a computing requirement corresponding to the computing task;
    根据所述计算需求进行计算任务的相应配置;Performing a corresponding configuration of a computing task according to the computing requirements;
    获取所述计算任务所需的数据,并将所述计算任务编译成为布尔电路;Acquiring data required for the computing task, and compiling the computing task into a Boolean circuit;
    根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点处进行计算;Forming a plurality of parallel computing tasks according to the Boolean circuit, a corresponding configuration of the computing task, and data required for the computing task, and distributing the multiple parallel computing tasks to multiple computing nodes for calculation;
    接收所述计算节点对所述并行计算任务进行计算的计算结果和计算证明,并根据所述计算证明确定所述计算结果是否有效;Receiving a calculation result and a calculation certificate performed by the calculation node on the parallel computing task, and determining whether the calculation result is valid according to the calculation certificate;
    在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励;After determining that the calculation result is valid, determining a cumulative calculation contribution value of a calculation node corresponding to the calculation result, and assigning a preset reward to each calculation node according to the accumulated calculation contribution value;
    接收各计算节点以累计计算贡献值作为的投票数据,并对备选节点进行投票;Receiving voting data of each computing node using the cumulative calculation contribution value, and voting on alternative nodes;
    将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的。The N preset candidate nodes that get the most votes are taken as the N consensus nodes; among these N consensus nodes, a practical Byzantine fault tolerance algorithm is used to complete the consensus on the block data.
  2. 根据权利要求1所述的基于有效算力贡献的共识方法,其特征在于,所述计算任务对应的计算需求,包括可验证计算算法。The consensus method based on effective computing power contribution according to claim 1, wherein the computing requirements corresponding to the computing tasks include a verifiable computing algorithm.
  3. 根据权利要求2所述的基于有效算力贡献的共识方法,其特征在于,根据所述计算需求进行计算任务的相应配置,包括:The consensus method based on effective computing power contribution according to claim 2, characterized in that performing a corresponding configuration of a computing task according to the computing demand comprises:
    根据所述计算需求中包括的可验证计算算法,配置可验证计算算法的相应参数。According to the verifiable computing algorithm included in the computing requirement, corresponding parameters of the verifiable computing algorithm are configured.
  4. 根据权利要求3所述的基于有效算力贡献的共识方法,其特征在于,获取所述计算任务所需的数据,并将所述计算任务编译成为布尔电路,包括:The consensus method based on effective computing power contribution according to claim 3, wherein acquiring data required for the computing task and compiling the computing task into a Boolean circuit comprises:
    获取所述计算任务所需的数据,并根据预先设置的编译器将所述计算任务编译成为布尔电路;所述布尔电路包括多个门电路,各个门电路具有相应的消耗权重。The data required for the calculation task is obtained, and the calculation task is compiled into a Boolean circuit according to a preset compiler; the Boolean circuit includes a plurality of gate circuits, and each gate circuit has a corresponding consumption weight.
  5. 根据权利要求4所述的基于有效算力贡献的共识方法,其特征在于,根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点处进行计算,包括:The consensus method based on effective computing power contribution according to claim 4, characterized in that a plurality of parallel computing tasks are formed according to the Boolean circuit, a corresponding configuration of the computing task, and data required for the computing task, and the Multiple parallel computing tasks are distributed to multiple computing nodes for computing, including:
    将所述布尔电路拆分为多个布尔子电路,每个布尔子电路包括一至多个门电路;Dividing the Boolean circuit into a plurality of Boolean sub-circuits, each of which includes one or more gate circuits;
    将可验证计算算法的相应参数、布尔子电路和计算任务所需的数据整合成多个并行计算任务;Integrate corresponding parameters of verifiable computing algorithms, Boolean subcircuits, and data required for computing tasks into multiple parallel computing tasks;
    将所述多个并行计算任务通过计算通道分发到多个计算节点处进行计算;其中,同一并行计算任务被同时分发到多个计算节点处,并保留预先设置的计算冗余度。Distributing the multiple parallel computing tasks to multiple computing nodes for calculation through a computing channel; wherein the same parallel computing task is distributed to multiple computing nodes simultaneously, and a preset computing redundancy is retained.
  6. 根据权利要求5所述的基于有效算力贡献的共识方法,其特征在于,接收所述计算节点对所述并行计算任务进行计算的计算结果和计算证明,并根据所述计算证明确定所述计算结果是否有效,包括:The consensus method based on effective computing power contribution according to claim 5, characterized in that: receiving a calculation result and a calculation certificate by the computing node for the parallel computing task, and determining the calculation according to the calculation certificate Whether the results are valid, including:
    接收所述计算节点对所述并行计算任务进行计算的计算结果和根据可验证计算算法的相应参数进行可验证计算得到的计算证明;Receiving a calculation result obtained by the calculation node for the parallel calculation task and a calculation certificate obtained by performing a verifiable calculation according to a corresponding parameter of the verifiable calculation algorithm;
    根据所述计算证明确定计算节点进行计算的实际工作量,以及验证所述计算结果是否正确;所述计算节点进行计算的实际工作量包括实际正确计算的门电路个数。The actual workload of the calculation performed by the calculation node is determined according to the calculation certificate, and the calculation result is verified to be correct; the actual workload of the calculation performed by the calculation node includes the number of gate circuits that are actually correctly calculated.
  7. 根据权利要求6所述的基于有效算力贡献的共识方法,其特征在于,在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励,包括:The consensus method based on effective computing power contributions according to claim 6, characterized in that after determining that the calculation result is valid, determining a cumulative calculation contribution value of a computing node corresponding to the calculation result, and according to the accumulated calculation The contribution value is assigned to each computing node, including:
    在确定计算节点进行计算的实际工作量,以及验证所述计算结果正确后,根据实际正确计算的门电路个数和各门电路的消耗权重,确定所述计算结果对应的计算节点的累计计算贡献值;After determining the actual workload of the calculation performed by the calculation node and verifying that the calculation result is correct, the cumulative calculation contribution of the calculation node corresponding to the calculation result is determined according to the number of gate circuits that are actually calculated correctly and the consumption weight of each gate circuit. value;
    根据所述累计计算贡献值为各计算节点分配预设奖励;其中所述预设奖励和所述累计计算贡献值成正比。Allocating a preset reward to each computing node according to the cumulative calculated contribution value; wherein the preset reward is directly proportional to the cumulative calculated contribution value.
  8. 根据权利要求7所述的基于有效算力贡献的共识方法,其特征在于,接收各计算节点以累计计算贡献值作为的投票数据,并对备选节点进行投票,包括:The consensus method based on effective computing power contributions according to claim 7, characterized in that receiving voting data of each computing node as a cumulative calculation contribution value and voting on candidate nodes comprises:
    接收各计算节点的投票信息,并根据所述投票信息确定投票是否成功;所述投票信息包括所投票的备选节点和所投票的累计计算贡献值信息;Receiving voting information of each computing node, and determining whether the voting is successful or not according to the voting information; the voting information includes the candidate node that was voted and the cumulative calculation contribution value information that was voted;
    在计算节点所拥有的累计计算贡献值满足所述累计计算贡献值信息时,确定投票成功,并在共识周期结束后,将投票成功对应的计算贡献值从所述计算节点处扣除;When the accumulated calculation contribution value owned by the calculation node satisfies the accumulated calculation contribution value information, determining that the voting is successful, and deducting the calculation contribution value corresponding to the successful voting from the calculation node after the end of the consensus period;
    在计算节点所拥有的累计计算贡献值未满足所述累计计算贡献值信息时,确定投票失败。When the cumulative computing contribution value owned by the computing node does not satisfy the cumulative computing contribution value information, it is determined that the voting has failed.
  9. 根据权利要求8所述的基于有效算力贡献的共识方法,其特征在于,将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的,包括:The consensus method based on effective computing power contribution according to claim 8, characterized in that the preset N candidate nodes that get the most votes are used as the N consensus nodes; wherein the N consensus nodes adopt Practical Byzantine fault-tolerant algorithms for consensus on block data include:
    将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法轮流出块,并对区块数据完成共识的;该N个共识节点被用于将正确的计算结果和对应的累计计算贡献值写入到区块链网络的区块中。The N preset candidate nodes that get the most votes are taken as N consensus nodes; among them, the N consensus nodes use a practical Byzantine fault tolerance algorithm to rotate out of the block and complete consensus on the block data; the N Consensus nodes are used to write the correct calculation results and corresponding cumulative calculation contribution values into the blocks of the blockchain network.
  10. 一种基于有效算力贡献的共识装置,其特征在于,包括:A consensus device based on effective computing power contributions, which includes:
    计算任务及需求接收单元,用于接收计算发布方发布的计算任务以及所述计算任务对应的计算需求;A computing task and a demand receiving unit, configured to receive a computing task issued by a computing publisher and a computing requirement corresponding to the computing task;
    计算任务配置单元,用于根据所述计算需求进行计算任务的相应配置;A computing task configuration unit, configured to perform a corresponding configuration of a computing task according to the computing demand;
    布尔电路编译单元,用于获取所述计算任务所需的数据,并将所述计算任务编译成为布尔电路;A Boolean circuit compiling unit, configured to obtain data required for the computing task and compile the computing task into a Boolean circuit;
    并行计算任务分发单元,用于根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点处进行计算;A parallel computing task distribution unit, configured to form multiple parallel computing tasks according to the Boolean circuit, the corresponding configuration of the computing task, and data required by the computing task, and distribute the multiple parallel computing tasks to multiple computing nodes Calculation;
    计算结果及证明接收单元,用于接收所述计算节点对所述并行计算任务进行计算的计算结果和计算证明,并根据所述计算证明确定所述计算结果是否有效;A calculation result and certificate receiving unit, configured to receive a calculation result and a calculation certificate performed by the computing node on the parallel computing task, and determine whether the calculation result is valid according to the calculation certificate;
    奖励分配单元,用于在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励;A reward distribution unit, configured to determine a cumulative calculation contribution value of a computing node corresponding to the calculation result after determining that the calculation result is valid, and allocate a preset reward to each computing node according to the cumulative calculation contribution value;
    投票单元,用于接收各计算节点以累计计算贡献值作为的投票数据,并对备选节点进行投票;A voting unit, configured to receive voting data of each computing node as a cumulative calculation contribution value, and vote on candidate nodes;
    共识节点确定单元,用于将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的。The consensus node determining unit is configured to use the preset N candidate nodes that have received the most votes as N consensus nodes. Among the N consensus nodes, a practical Byzantine fault tolerance algorithm is used to complete the consensus on the block data.
  11. 根据权利要求10所述的基于有效算力贡献的共识装置,其特征在于,所述计算任务及需求接收单元中的计算任务对应的计算需求,包括可验证计算算法。The consensus device based on effective computing power contribution according to claim 10, wherein the computing task corresponding to the computing task and the computing task in the demand receiving unit includes a verifiable computing algorithm.
  12. 根据权利要求11所述的基于有效算力贡献的共识装置,其特征在于,所述计算任务配置单元,具体用于:The consensus device based on effective computing power contribution according to claim 11, wherein the computing task configuration unit is specifically configured to:
    根据所述计算需求中包括的可验证计算算法,配置可验证计算算法的相应参数。According to the verifiable computing algorithm included in the computing requirement, corresponding parameters of the verifiable computing algorithm are configured.
  13. 根据权利要求12所述的基于有效算力贡献的共识装置,其特征在于,所述布尔电路编译单元,具体用于:The consensus device based on effective computing power contribution according to claim 12, wherein the Boolean circuit coding unit is specifically configured to:
    获取所述计算任务所需的数据,并根据预先设置的编译器将所述计算任务编译成为布尔电路;所述布尔电路包括多个门电路,各个门电路具有相应的消耗权重。The data required for the calculation task is obtained, and the calculation task is compiled into a Boolean circuit according to a preset compiler; the Boolean circuit includes a plurality of gate circuits, and each gate circuit has a corresponding consumption weight.
  14. 根据权利要求13所述的基于有效算力贡献的共识装置,其特征在于,所述并行计算任务分发单元,具体用于:The consensus device based on effective computing power contribution according to claim 13, wherein the parallel computing task distribution unit is specifically configured to:
    将所述布尔电路拆分为多个布尔子电路,每个布尔子电路包括一至多个门电路;Dividing the Boolean circuit into a plurality of Boolean sub-circuits, each of which includes one or more gate circuits;
    将可验证计算算法的相应参数、布尔子电路和计算任务所需的数据整合成多个并行计算任务;Integrate corresponding parameters of verifiable computing algorithms, Boolean subcircuits, and data required for computing tasks into multiple parallel computing tasks;
    将所述多个并行计算任务通过计算通道分发到多个计算节点处进行计算;其中,同一并行计算任务被同时分发到多个计算节点处,并保留预先设置的计算冗余度。Distributing the multiple parallel computing tasks to multiple computing nodes for calculation through a computing channel; wherein the same parallel computing task is distributed to multiple computing nodes simultaneously, and a preset computing redundancy is retained.
  15. 根据权利要求14所述的基于有效算力贡献的共识装置,其特征在于,所述计算结果及证明接收单元,具体用于:The consensus device based on the effective computing power contribution according to claim 14, wherein the calculation result and the certificate receiving unit are specifically configured to:
    接收所述计算节点对所述并行计算任务进行计算的计算结果和根据可验证计算算法的相应参数进行可验证计算得到的计算证明;Receiving a calculation result obtained by the calculation node for the parallel calculation task and a calculation certificate obtained by performing a verifiable calculation according to a corresponding parameter of the verifiable calculation algorithm;
    根据所述计算证明确定计算节点进行计算的实际工作量,以及验证所述计算结果是否正确;所述计算节点进行计算的实际工作量包括实际正确计算的门电路个数。The actual workload of the calculation performed by the calculation node is determined according to the calculation certificate, and the calculation result is verified to be correct; the actual workload of the calculation performed by the calculation node includes the number of gate circuits that are actually correctly calculated.
  16. 根据权利要求15所述的基于有效算力贡献的共识装置,其特征在于,所述奖励分配单元,具体用于:The consensus device based on effective computing power contribution according to claim 15, wherein the reward distribution unit is specifically configured to:
    在确定计算节点进行计算的实际工作量,以及验证所述计算结果正确后,根据实际正确计算的门电路个数和各门电路的消耗权重,确定所述计算结果对应的计算节点的累计计算贡献值;After determining the actual workload of the calculation performed by the calculation node and verifying that the calculation result is correct, the cumulative calculation contribution of the calculation node corresponding to the calculation result is determined according to the number of gate circuits that are actually calculated correctly and the consumption weight of each gate circuit. value;
    根据所述累计计算贡献值为各计算节点分配预设奖励;其中所述预设奖励和所述累计计算贡献值成正比。Allocating a preset reward to each computing node according to the cumulative calculated contribution value; wherein the preset reward is directly proportional to the cumulative calculated contribution value.
  17. 根据权利要求16所述的基于有效算力贡献的共识装置,其特征在于,所述投票单元,具体用于:The consensus device based on effective computing power contribution according to claim 16, wherein the voting unit is specifically configured to:
    接收各计算节点的投票信息,并根据所述投票信息确定投票是否成功;所述投票信息包括所投票的备选节点和所投票的累计计算贡献值信息;Receiving voting information of each computing node, and determining whether the voting is successful or not according to the voting information; the voting information includes the candidate node that was voted and the cumulative calculation contribution value information that was voted;
    在计算节点所拥有的累计计算贡献值满足所述累计计算贡献值信息时,确定投票成功,并在共识周期结束后,将投票成功对应的计算贡献值从所述计算节点处扣除;When the accumulated calculation contribution value owned by the calculation node satisfies the accumulated calculation contribution value information, determining that the voting is successful, and deducting the calculation contribution value corresponding to the successful voting from the calculation node after the end of the consensus period;
    在计算节点所拥有的累计计算贡献值未满足所述累计计算贡献值信息时,确定投票失败。When the cumulative computing contribution value owned by the computing node does not satisfy the cumulative computing contribution value information, it is determined that the voting has failed.
  18. 根据权利要求17所述的基于有效算力贡献的共识装置,其特征在于,所述共识节点确定单元,具体用于:The consensus device based on effective computing power contribution according to claim 17, wherein the consensus node determining unit is specifically configured to:
    将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法轮流出块,并对区块数据完成共识的;该N个共识节点被用于将正确的计算结果和对应的累计计算贡献值写入到区块链网络的区块中。The N preset candidate nodes that get the most votes are taken as N consensus nodes; among them, the N consensus nodes use a practical Byzantine fault tolerance algorithm to rotate out of the block and complete consensus on the block data; the N Consensus nodes are used to write the correct calculation results and corresponding cumulative calculation contribution values into the blocks of the blockchain network.
  19. 一种基于有效算力贡献的共识系统,其特征在于,包括:计算发布方、基于有效算力贡献的共识装置和多个计算节点;A consensus system based on effective computing power contributions, which is characterized by comprising: a calculation issuer, a consensus device based on effective computing power contributions, and multiple computing nodes;
    所述计算发布方用于向基于有效算力贡献的共识装置发布计算任务以及所述计算任务对应的计算需求;The calculation issuer is configured to issue a calculation task and a calculation request corresponding to the calculation task to a consensus device based on an effective calculation power contribution;
    所述基于有效算力贡献的共识装置用于根据所述计算需求进行计算任务的相应配置;获取所述计算任务所需的数据,并将所述计算任务编译成为布尔电路;根据所述布尔电路、计算任务的相应配置和计算任务所需的数据,形成多个并行计算任务,并将所述多个并行计算任务分发到多个计算节点处;The consensus device based on the contribution of effective computing power is configured to perform a corresponding configuration of a computing task according to the computing demand; acquire data required for the computing task, and compile the computing task into a Boolean circuit; according to the Boolean circuit The corresponding configuration of the computing task and the data required for the computing task form multiple parallel computing tasks, and distribute the multiple parallel computing tasks to multiple computing nodes;
    所述计算节点用于对所述并行计算任务进行计算,形成计算结果和计算证明,并发送至所述基于有效算力贡献的共识装置;The computing node is configured to calculate the parallel computing task, form a calculation result and a calculation certificate, and send the calculation result and the consensus device based on the effective computing power contribution;
    所述基于有效算力贡献的共识装置还用于根据所述计算证明确定所述计算结果是否有效;在确定所述计算结果有效后,确定所述计算结果对应的计算节点的累计计算贡献值,并根据所述累计计算贡献值为各计算节点分配预设奖励;接收各计算节点以累计计算贡献值作为的投票数据,并对备选节点进行投票;将得到投票最多的预先设置的N个备选节点作为N个共识节点;其中,该N个共识节点之间是采用实用拜占庭容错算法对区块数据完成共识的。The consensus device based on the effective computing power contribution is further configured to determine whether the calculation result is valid according to the calculation certificate; and after determining that the calculation result is valid, determine a cumulative calculation contribution value of a computing node corresponding to the calculation result, And assign preset rewards to each computing node according to the cumulative calculated contribution value; receive voting data of the cumulative computing contribution value of each computing node, and vote on alternative nodes; the preset N backups with the most votes will be obtained The nodes are selected as N consensus nodes; among them, the N consensus nodes adopt a practical Byzantine fault tolerance algorithm to complete consensus on the block data.
  20. 一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至9任一项所述的基于有效算力贡献的共识方法的步骤。An electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the computer program according to any one of claims 1 to 9 when executing the computer program. The steps of the consensus method based on the contribution of effective computing power are described.
  21. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至9任一项所述的基于有效算力贡献的共识方法的步骤。A computer-readable storage medium having stored thereon a computer program, characterized in that when the computer program is executed by a processor, the steps of implementing the consensus method based on the effective computing power contribution according to any one of claims 1 to 9 .
PCT/CN2019/095368 2018-07-10 2019-07-10 Consensus method, device and system based on effective computation power contribution WO2020011182A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810750036.XA CN109165092B (en) 2018-07-10 2018-07-10 Consensus method, device and system based on effective computing power contribution
CN201810750036.X 2018-07-10

Publications (1)

Publication Number Publication Date
WO2020011182A1 true WO2020011182A1 (en) 2020-01-16

Family

ID=64897543

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/095368 WO2020011182A1 (en) 2018-07-10 2019-07-10 Consensus method, device and system based on effective computation power contribution

Country Status (2)

Country Link
CN (1) CN109165092B (en)
WO (1) WO2020011182A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113612618A (en) * 2021-08-18 2021-11-05 东北大学 Alliance chain consensus method and device
CN117560161A (en) * 2024-01-11 2024-02-13 中移信息系统集成有限公司 Method and device for rotating consensus nodes of block chain and readable storage medium

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109165092B (en) * 2018-07-10 2021-07-20 矩阵元技术(深圳)有限公司 Consensus method, device and system based on effective computing power contribution
CN109872152B (en) * 2019-01-11 2022-07-15 平安科技(深圳)有限公司 Block chain consensus method based on share authorization certification mechanism and related equipment
CN109981281B (en) * 2019-01-14 2021-11-26 北京领主科技有限公司 Method and device for determining candidate elements based on block chain proposal random consensus
CN109949157B (en) * 2019-03-08 2022-03-18 矩阵元技术(深圳)有限公司 Business data uplink method, device and system
CN110011981B (en) * 2019-03-15 2021-06-29 湖北工程学院 Trusted cloud storage method and system based on block chain
CN110049109B (en) * 2019-03-26 2022-04-01 湖南天河国云科技有限公司 Accounting method, system and computer readable storage medium for block chain shared storage
CN110119315A (en) * 2019-05-14 2019-08-13 思力科(深圳)电子科技有限公司 Rendering method, relevant device and system based on block chain
CN110166295B (en) * 2019-05-23 2021-07-30 杭州趣链科技有限公司 Method for judging whether network topology supports Byzantine fault tolerance or not
CN110458540B (en) * 2019-07-25 2022-08-23 南京邮电大学 Contribution-based random signature consensus mechanism algorithm
CN110855443B (en) * 2019-10-29 2022-07-01 上海唯链信息科技有限公司 Voting method and device based on block chain and zero knowledge proof
CN110855432B (en) * 2019-10-31 2023-03-14 广东工业大学 Asynchronous BFT & DPOS consensus mechanism for assigning verifier rewards based on verifiable random functions
CN111383111A (en) * 2020-03-03 2020-07-07 李斌 Consensus algorithm based on computing resource computing power certification
CN111432014B (en) * 2020-03-30 2023-05-05 上海玳鸽信息技术有限公司 Method and device for selecting main node in block chain consensus algorithm
CN111539016B (en) * 2020-04-14 2023-04-07 浙江浙燃能源有限公司 Distributed computing method, system, block chain node and computer medium
CN113765956A (en) * 2020-06-03 2021-12-07 华为技术有限公司 Message processing method, device, system and storage medium
CN111951363A (en) * 2020-07-16 2020-11-17 广州玖的数码科技有限公司 Cloud computing chain-based rendering method and system and storage medium
CN112330450B (en) * 2020-11-04 2022-07-19 天津大学 Calculation power transaction processing method and device, node of block chain and storage medium
CN113283892A (en) * 2021-05-26 2021-08-20 北京航空航天大学 PoSearch and PBFT fusion consensus algorithm based on voting mechanism
CN113590282A (en) * 2021-07-19 2021-11-02 海宁奕斯伟集成电路设计有限公司 Calculation force scheduling method, system, electronic equipment and computer readable storage medium
CN113726758A (en) * 2021-08-25 2021-11-30 百保(上海)科技有限公司 Data privacy calculation method and system based on block chain

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106097006A (en) * 2016-06-09 2016-11-09 杭州复杂美科技有限公司 Block chain charge mode
US20170103472A1 (en) * 2013-09-12 2017-04-13 Netspective Communications Llc Distributed electronic document review in a blockchain system and computerized scoring based on textual and visual feedback
CN107678865A (en) * 2017-09-20 2018-02-09 中国银行股份有限公司 The verification method and system of block chain based on transaction packet
CN107992356A (en) * 2017-12-13 2018-05-04 上海壹账通金融科技有限公司 Block chain affairs block processes method, electronic device and readable storage medium storing program for executing
CN108182636A (en) * 2018-01-30 2018-06-19 杨显波 Block chain common recognition mechanism based on contribution
CN109165092A (en) * 2018-07-10 2019-01-08 矩阵元技术(深圳)有限公司 A kind of common recognition method, apparatus and system based on effective calculation power contribution

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107103009B (en) * 2016-02-23 2020-04-10 杭州海康威视数字技术股份有限公司 Data processing method and device
CN107786339A (en) * 2016-08-31 2018-03-09 陈新 It is layered controllable alliance's block catenary system
CN106452884B (en) * 2016-10-21 2019-06-25 北京云图科瑞科技有限公司 Data distributing method and device in block catenary system
US10438170B2 (en) * 2017-01-05 2019-10-08 International Business Machines Corporation Blockchain for program code credit and programmer contribution in a collective
CN107181599B (en) * 2017-07-18 2020-01-21 天津理工大学 Routing position data secret storage and sharing method based on block chain
CN107590738A (en) * 2017-08-24 2018-01-16 阿里巴巴集团控股有限公司 Processing method, device and the server of selection common recognition node
CN108122165B (en) * 2017-12-15 2020-10-30 北京中电普华信息技术有限公司 Block chain consensus method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170103472A1 (en) * 2013-09-12 2017-04-13 Netspective Communications Llc Distributed electronic document review in a blockchain system and computerized scoring based on textual and visual feedback
CN106097006A (en) * 2016-06-09 2016-11-09 杭州复杂美科技有限公司 Block chain charge mode
CN107678865A (en) * 2017-09-20 2018-02-09 中国银行股份有限公司 The verification method and system of block chain based on transaction packet
CN107992356A (en) * 2017-12-13 2018-05-04 上海壹账通金融科技有限公司 Block chain affairs block processes method, electronic device and readable storage medium storing program for executing
CN108182636A (en) * 2018-01-30 2018-06-19 杨显波 Block chain common recognition mechanism based on contribution
CN109165092A (en) * 2018-07-10 2019-01-08 矩阵元技术(深圳)有限公司 A kind of common recognition method, apparatus and system based on effective calculation power contribution

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113612618A (en) * 2021-08-18 2021-11-05 东北大学 Alliance chain consensus method and device
CN117560161A (en) * 2024-01-11 2024-02-13 中移信息系统集成有限公司 Method and device for rotating consensus nodes of block chain and readable storage medium
CN117560161B (en) * 2024-01-11 2024-04-09 中移信息系统集成有限公司 Method and device for rotating consensus nodes of block chain and readable storage medium

Also Published As

Publication number Publication date
CN109165092B (en) 2021-07-20
CN109165092A (en) 2019-01-08

Similar Documents

Publication Publication Date Title
WO2020011182A1 (en) Consensus method, device and system based on effective computation power contribution
CN108959621B (en) Method, device, equipment and storage medium for realizing block chain network
WO2020015633A1 (en) Method and apparatus for realizing smart contract of blockchain
CN105573828B (en) A kind of operation processing method and device
JP6940182B2 (en) Blockchain management device, blockchain management method and program
Buterin A next-generation smart contract and decentralized application platform
CN110147990B (en) Payment withholding subscription method and device based on block chain and electronic equipment
WO2019232789A1 (en) Voting-based consensus method
TW201822033A (en) Resource processing method and apparatus
JP2019160316A (en) System, method and computer program for resource equity for blockchain
CN111324446A (en) Multi-access edge computing node and method for deploying distributed accounting application
JP2020512714A (en) Digital certificate management method, device, and system
EP3779760B1 (en) Blockchain-based data processing method and apparatus, and electronic device
CN109003185B (en) Intelligent contract establishing method and device, computing equipment and storage medium
US20190114707A1 (en) Distribution of Blockchain Tokens
CN111309745B (en) Virtual resource processing method and device, electronic equipment and storage medium
CN110597916B (en) Data processing method and device based on block chain, storage medium and terminal
TW201828215A (en) Smart contract version control system and method thereof based on blockchain
CN111199481A (en) Distributed transaction network based on asynchronous directed acyclic graph
CN110263580B (en) Data processing method and device based on block chain and block chain link points
CN111754226A (en) Tourism card data processing system based on alliance chain
CN109859031A (en) A kind of information processing method, node and the storage medium of block chain network
CN111047327A (en) Intelligent contract execution method, device and equipment
WO2020239044A1 (en) Blockchain-based energy transaction method and apparatus, and terminal device
WO2020011010A1 (en) Computing power transaction method and computing channel

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19833902

Country of ref document: EP

Kind code of ref document: A1