CN110912994B - Block chain consensus method and device - Google Patents

Block chain consensus method and device Download PDF

Info

Publication number
CN110912994B
CN110912994B CN201911159691.9A CN201911159691A CN110912994B CN 110912994 B CN110912994 B CN 110912994B CN 201911159691 A CN201911159691 A CN 201911159691A CN 110912994 B CN110912994 B CN 110912994B
Authority
CN
China
Prior art keywords
consensus
block chain
node
information
indication information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911159691.9A
Other languages
Chinese (zh)
Other versions
CN110912994A (en
Inventor
邢宇龙
贾雪琴
史可
程奥林
胡云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN201911159691.9A priority Critical patent/CN110912994B/en
Publication of CN110912994A publication Critical patent/CN110912994A/en
Application granted granted Critical
Publication of CN110912994B publication Critical patent/CN110912994B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The application discloses a block chain consensus method and a block chain consensus device, relates to the field of consensus, and is used for solving the problems that due to the fact that the number of block chain link points is large due to rapid expansion of the block chain nodes, the block chain link points cannot achieve consensus rapidly, and accordingly the block chain link point consensus efficiency is low and the result is inaccurate. The method comprises the following steps: and the block chain platform receives N pieces of node information sent by the N block chain nodes, and then groups the N block chain nodes according to the N pieces of node information to obtain M common node groups. M representative block chain nodes in the M consensus node groups send M indication information, and voting is carried out on the target decision according to the M indication information. The embodiment of the application is applied to rapidly achieving consensus of the block chain nodes.

Description

Block chain consensus method and device
Technical Field
The present invention relates to the field of consensus, and in particular, to a block chain consensus method and apparatus.
Background
The blockchain technology is a brand new distributed infrastructure and computing paradigm that utilizes blockchain data structures to verify and store data, utilizes distributed node consensus methods to generate and update data, cryptographically secures data transmission and access, and utilizes intelligent contracts composed of automated script code to program and manipulate data. In the block chain system, every time, transaction data generated by each participating main body is packed into a data block, the data blocks are sequentially arranged according to a time sequence to form a chain of the data blocks, each participating main body has the same data chain and cannot be tampered unilaterally, any information can be modified only by a main body agreeing party in an appointed proportion, new information can only be added, and old information cannot be deleted or modified, so that information sharing and consistent decision among multiple main bodies are realized, and the identity of each main body and the transaction information among the main bodies are guaranteed to be not tampered and are transparent. Due to the rapid expansion of the block chain nodes, the number of the block chain link points becomes very large, so that the block chain link points cannot be rapidly identified, the efficiency of identifying the block chain link points is low, and the result is inaccurate.
Disclosure of Invention
The embodiment of the application provides a block chain consensus method and device, which are used for solving the problems that due to the rapid expansion of block chain nodes, the number of block chain link points becomes very large, so that the block chain link points cannot rapidly achieve consensus, and the block chain link point consensus efficiency is low and the result is inaccurate.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
in a first aspect, a method for block chain consensus is provided, which is applied to a block chain platform, and the method includes: receiving N node information sent by N block chain nodes, wherein one node information comprises an identifier of one block chain node and a calculation force P corresponding to one block chain node, N is a positive integer, and P is a constant. And grouping the N block chain link points according to the N node information to obtain M consensus node groups, wherein M is an odd number smaller than N. And sending grouping information to the N block nodes, wherein the grouping information is used for indicating the information of the M consensus node groups. Receiving M pieces of indication information sent by M representative block chain nodes, wherein one representative block chain node is a block chain node in a common node group, and one piece of indication information is used for indicating a voting result of the representative block chain node on a target decision. And determining whether the N block link points achieve consensus or not according to first information and the M pieces of indication information, wherein the first information comprises M calculation forces corresponding to the M representative block link points and the M pieces of indication information. One of the M calculated forces is the sum of the calculated forces P of all the block chain nodes in the consensus node group corresponding to the representative block chain node point.
In a second aspect, a block chain consensus method is provided, which is applied to a block chain node, and the method includes: and sending N pieces of node information to the block chain platform, wherein one piece of node information comprises an identifier of one block chain node and a calculation force P corresponding to the one block chain node, N is a positive integer, and P is a constant. And receiving grouping information sent by the block chain platform, wherein the grouping information is used for indicating the information of the M common node groups. And sending M pieces of indication information to the block chain platform, wherein the M pieces of indication information represent the indication information sent by the block chain nodes. One representative block chain node is a block chain node in one common node group, and one piece of indication information is used for indicating a voting result of the representative block chain node on the target decision.
In a third aspect, a device for block chain consensus is provided, which is applied to a block chain platform and includes a receiving unit, a processing unit, and a transmitting unit. The receiving unit is used for receiving N pieces of node information sent by N block chain nodes, wherein one piece of node information comprises an identifier of one block chain node and a calculation force P corresponding to the one block chain node, N is a positive integer, and P is a constant. And the processing unit is used for grouping the N block chain link points according to the N node information received by the receiving unit so as to obtain M common node groups, wherein M is an odd number smaller than N. And the sending unit is used for sending grouping information to the N block link points, wherein the grouping information is used for indicating the information of the M consensus node groups. The receiving unit is further configured to receive M pieces of indication information sent by the M representative block link points, where one representative block link point is a block link point in a common node group, and one piece of indication information is used to indicate a voting result of the representative block link point for the target decision. And the processing unit is further used for determining whether the N block link points achieve consensus or not according to the M indication information of the first information, wherein the first information comprises M calculation forces corresponding to the M representative block link points and M indication information. One of the M calculated forces is the sum of the calculated forces P of all the block chain nodes in the consensus node group corresponding to the representative block chain node point.
In a fourth aspect, an apparatus for block chain consensus is provided, which is applied to a block chain node and includes a sending unit and a receiving unit. The sending unit is used for sending N pieces of node information to the block chain platform, wherein one piece of node information comprises an identifier of one block chain node and a calculation force P corresponding to the one block chain node, N is a positive integer, and P is a constant. And the receiving unit is used for receiving grouping information sent by the block chain platform, wherein the grouping information is used for indicating the information of the M consensus node groups. And the sending unit is further configured to send M pieces of indication information to the blockchain platform, where the M pieces of indication information are indication information sent by M representative blockchain nodes. One representative block chain node is a block chain node in one common node group, and one piece of indication information is used for indicating a voting result of the representative block chain node on the target decision.
In a fifth aspect, there is provided a computer readable storage medium corresponding to a blockchain consensus device, the computer readable storage medium storing one or more programs, the one or more programs including instructions, which when executed by a computer, cause the computer to perform the blockchain consensus method according to the first aspect.
In a sixth aspect, there is provided a computer readable storage medium corresponding to a blockchain consensus apparatus, the computer readable storage medium storing one or more programs, the one or more programs including instructions, which when executed by a computer, cause the computer to perform the blockchain consensus method according to the second aspect.
In a seventh aspect, an apparatus for block chain consensus is provided, which is applied to a block chain platform and includes: a processor, a memory, a communication interface, and a bus; wherein, the communication interface is used for the block chain platform to communicate with other devices or networks; the memory is configured to store one or more programs, where the one or more programs include computer executable instructions, and when the blockchain consensus device runs, the processor executes the computer executable instructions stored in the memory, so as to enable the blockchain consensus device to perform the blockchain consensus method according to the first aspect.
In an eighth aspect, there is provided a block chain consensus device applied to a block chain node, including: a processor, a memory, a communication interface, and a bus; wherein, the communication interface is used for the block chain node to communicate with other devices or networks; the memory is configured to store one or more programs, where the one or more programs include computer executable instructions, and when the blockchain consensus device runs, the processor executes the computer executable instructions stored in the memory, so as to enable the blockchain consensus device to perform the blockchain consensus method according to the second aspect.
The embodiment of the application provides a block chain consensus method and device, by grouping block chain link points, to obtain a plurality of consensus node groups, and voting the objective decision based on the consensus node groups, preliminarily determining whether the N block chain link points are in consensus or not according to the voting result of the vote and a plurality of calculation forces corresponding to a plurality of consensus node groups, then, according to the voting result of voting, it is determined again whether the N block chain link points are agreed, thereby finally determining whether the N block chain link points are agreed according to the two consensus judgment results, therefore, the common identification is carried out in a possible mode, the condition that the nodes cannot achieve common identification quickly or the result of achieving common identification is not credible due to quick expansion or quick downtime of the block link points is effectively avoided, and the efficiency and the accuracy of the common identification of the block link points can be improved.
Drawings
Fig. 1 is a schematic diagram of a block link point structure provided in an embodiment of the present application;
fig. 2 is a schematic flow chart of a block chain consensus method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a consensus node group according to an embodiment of the present application;
fig. 4 is a first schematic structural diagram of a block chain consensus device according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a block chain consensus device according to an embodiment of the present application;
fig. 6 is a third schematic structural diagram of a block chain consensus device according to an embodiment of the present application;
fig. 7 is a fourth schematic structural diagram of a block chain consensus device according to an embodiment of the present disclosure.
Detailed Description
The following briefly introduces some concepts related to embodiments of the present application.
The blockchain technology is a brand new distributed infrastructure and computing paradigm that utilizes blockchain data structures to verify and store data, utilizes distributed node consensus algorithms to generate and update data, cryptographically secures data transmission and access, and utilizes intelligent contracts composed of automated script code to program and manipulate data. In the block chain system, every time, transaction data generated by each participating main body is packed into a data block, the data blocks are sequentially arranged according to a time sequence to form a chain of the data blocks, each participating main body has the same data chain and cannot be tampered unilaterally, any information can be modified only by a main body agreeing party in an appointed proportion, new information can only be added, and old information cannot be deleted or modified, so that information sharing and consistent decision among multiple main bodies are realized, and the identity of each main body and the transaction information among the main bodies are guaranteed to be not tampered and are transparent.
The block chain technology is decentralized, does not depend on an additional third-party management mechanism or hardware facilities, is not subjected to central control, and except for the self-integrated block chain, each node realizes self-verification, transmission and management of information through distributed accounting and storage. Decentralization is the most prominent and essential feature of the blockchain.
The open, blockchain technology foundation is open source, except that the private information of each party of the transaction is encrypted, the data of the blockchain is open to all people, and anyone can inquire the blockchain data and develop related applications through a public interface, so that the information of the whole system is highly transparent.
And on the basis of the agreed specifications and protocols (various mathematical algorithms such as a Hash algorithm adopted by bitcoins) the whole blockchain system does not depend on other third parties, and all nodes can automatically and safely verify and exchange data in the system without any human intervention.
Safety, as long as 51% of all data nodes cannot be mastered, network data cannot be arbitrarily manipulated and modified, so that a block chain per se becomes relatively safe, and subjective and artificial data change is avoided.
Anonymity, unless required by legal regulations, the identity information of each block node does not need to be disclosed or verified technically, and information transfer can be performed anonymously.
The distributed account book refers to that transaction accounting is completed by a plurality of nodes distributed in different places together, and each node records a complete account, so that the nodes can participate in monitoring transaction validity and simultaneously make a proof for the node together.
Asymmetric encryption, transaction information stored on the blockchain is public, but account identity information is highly encrypted and can only be accessed under the authorization of the data owner, so that the security of the data and the privacy of individuals are guaranteed.
The consensus mechanism, the blockchain, is a distributed (decentralized) system with traceable history and no tampering, which solves the multi-party mutual trust problem. Distributed systems necessarily face consistency problems, and the process of solving consistency problems we call consensus.
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
In the description of this application, "/" means "or" unless otherwise stated, for example, A/B may mean A or B. "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. Further, "at least one" means one or more, "a plurality" means two or more. The terms "first", "second", and the like do not necessarily limit the number and execution order, and the terms "first", "second", and the like do not necessarily limit the difference.
At present, fixed path selection is mostly adopted for reporting block chain data, and no dynamic optimization algorithm combining block chain data reporting, the communication environment where a terminal is located, the state of a consensus node and the distance from the consensus node to the terminal is seen yet. The invention dynamically selects the data uploading path by periodically monitoring the communication environment of the cellular terminal, the state of the consensus node and the distance from the consensus node to the cellular terminal.
Fig. 1 is a schematic diagram of a block link point structure according to an embodiment of the present disclosure. The chain block comprises N block chain links, wherein the N block chain links are positioned on the same block chain platform. When the N block links perform the consensus process, the process flow shown in fig. 2 is performed. Fig. 2 is a schematic flow chart of a block chain consensus method according to an embodiment of the present disclosure, including:
s201, the block chain platform receives N pieces of node information sent by N block chain nodes.
The node information comprises an identification of a blockchain node and a calculation force P corresponding to the blockchain node, wherein N is a positive integer, and P is a constant.
The block chain platform comprises N block chain nodes, and the identifications of the N block chain nodes are as follows: n1, N2 and N3 … … Nn, wherein the calculated force P of each block chain node is as follows: p1, P2, P3 … … Pn. As shown in table 1:
TABLE 1
Node identification Computing power of node
N1 P1
N2 P2
N3 P3
…… ……
Nn Pn
S202, the block chain platform groups the N block chain link points according to the N node information to obtain M consensus node groups.
And the block chain platform randomly divides the N block chain link points into M consensus node groups according to the identifiers of the N block chain nodes to obtain M consensus node groups, wherein M is an odd number smaller than N. Wherein, the number of the block chain nodes contained in at least M-1 consensus node groups is the same.
As shown in fig. 3, the block chain platform randomly divides the N block chain link points into M groups according to the identifiers of the N block chain link points in the N node information, so as to obtain M consensus node groups. The names of the M consensus node groups are respectively as follows: the consensus node group K1, the consensus node group K2 and the consensus node group K3 … … are the consensus node group Km. The computational power of the M consensus node groups is respectively as follows: r1, R2 and R3 … … Rm. In M common node groups, M-1 common node groups include A ═ N/M blockchain nodes, and 1 common node group includes B ═ N-A (M-1) blockchain nodes, where N/M is rounded up to obtain A, and B may be equal to A. As shown in table 2:
TABLE 2
Figure BDA0002285721620000071
For example: the block chain platform comprises 30 block chain link points, and the block chain platform divides 34 block chain link points into 5 common node groups. Then, there are 4 common node groups including 7 blockchain nodes, and there are 1 common node group including 6 blockchain nodes.
S203, the block chain platform sends grouping information to the N block chain nodes.
The grouping information is information indicating the M common node groups. The grouping information includes how many block chain link points each of the consensus node groups includes, and the identification of the block chain node included in each of the consensus node groups.
S204, the block chain platform receives M pieces of indication information sent by the M representative block chain nodes.
One representative block chain node is a block chain node in one common node group, and one piece of indication information is used for indicating a voting result of the representative block chain node on the target decision.
When the goal decision is voted, each consensus node group sends indication information to the blockchain platform through the representative blockchain nodes in the consensus node group. The indication information represents the opinion of the consensus node group where the block link point is located on the target decision, namely agreement or disagreement.
S205, the blockchain platform determines whether the N blockchain link points agree with each other according to the first information and the M indication information.
The first information includes: m representative block chain link points correspond to M calculated forces and M indicating information. One of the M calculated forces is the sum of the calculated forces P of all the block chain nodes in the consensus node group corresponding to the representative block chain node point.
And S2051, determining a first consensus result according to the first information.
If the first calculated power sum is larger than the second calculated power sum, determining that the first consensus result is: a consensus is achieved among the N block link points. And the first calculation power sum is the sum of K calculation powers corresponding to the K first voting results. The second calculation power sum is the sum of M-K calculation powers corresponding to the M-K second voting results. The K first voting results are results indicated by K pieces of indication information among the M pieces of indication information. The M-K second voting results are results indicated by the M-K indication information in the M indication information.
If the first calculated power sum is less than or equal to the second calculated power sum, determining that the first consensus result is: there is no consensus among the N block link points.
For example: after the block chain platform receives the M pieces of indication information, the block chain platform counts that the M pieces of indication information contain: the K pieces of indication information represent that the opinions of the K pieces of consensus node groups on the target decision are agreed, and the M-K pieces of indication information represent that the opinions of the M-K pieces of consensus node groups on the target decision are not agreed. And the computation power sums corresponding to the K consensus node groups for agreeing to the opinions are respectively as follows: q1, Q2, Q3 … … QK; the calculation power sum corresponding to M-K consensus node groups which cast disagreement respectively is as follows: r1, R2 and R3 … … RM-K. Then, the first calculated force sum is Q1+ Q2+ Q3+ … … + QK; the second force sum, R1+ R2+ R3+ … … + RM-K. When the first calculated force sum is larger than the second calculated force sum, determining that consensus is achieved among the N block link points; and when the first calculated force sum is less than or equal to the second calculated force sum, determining that the N block link points do not reach consensus.
And S2052, determining a second consensus result according to the M pieces of indication information.
If the number of the K first voting results is larger than the number of the M-K second voting results, determining that the second consensus result is: a consensus is achieved among the N block link points. The M-K second voting results are results indicated by the M-K indication information in the M indication information.
And if the number of the K first voting results is less than or equal to the number of the M-K second voting results, determining that the N block link points do not reach consensus.
For example: after the block chain platform receives the M pieces of indication information, the block chain platform counts that the M pieces of indication information contain: the K pieces of indication information represent that the opinions of the K pieces of consensus node groups on the target decision are agreed, and the M-K pieces of indication information represent that the opinions of the M-K pieces of consensus node groups on the target decision are not agreed. When K is greater than M-K, determining that consensus among the N block link points is achieved; and when K is less than or equal to M-K, determining that the N block link points do not reach consensus.
S2053, determining whether the N block link points achieve consensus according to the first consensus result and the second consensus result.
If the first consensus result is that consensus is achieved among the N block link points and the second consensus result is that consensus is achieved among the N block link points, then it is determined that consensus is achieved among the N block link points.
If the first consensus result is that the N block link points do not agree and/or the second consensus result is that the N block link points do not agree, then it is determined that the N block link points do not agree.
The embodiment of the application provides a block chain consensus method and device, by grouping block chain link points, to obtain a plurality of consensus node groups, and voting the objective decision based on the consensus node groups, preliminarily determining whether the N block chain link points are in consensus or not according to the voting result of the vote and a plurality of calculation forces corresponding to a plurality of consensus node groups, then, according to the voting result of voting, it is determined again whether the N block chain link points are agreed, thereby finally determining whether the N block chain link points are agreed according to the two consensus judgment results, therefore, the common identification is carried out in a possible mode, the condition that the nodes cannot achieve common identification quickly or the result of achieving common identification is not credible due to quick expansion or quick downtime of the block link points is effectively avoided, and the efficiency and the accuracy of the common identification of the block link points can be improved.
The embodiment of the present application further provides a block chain consensus device, which is applied to a block chain platform, and is used to implement the related functions of the block chain platform in the block chain consensus method provided in the foregoing embodiment, specifically, as shown in fig. 4, a schematic structural diagram of the block chain consensus device provided in the embodiment of the present application is shown. The block chain consensus device applied to the block chain platform comprises: receiving section 401, processing section 402, and transmitting section 403. Wherein:
the receiving unit 401 is configured to receive N pieces of node information sent by N block link nodes, where a piece of node information includes an identifier of a block link node and a computation force P corresponding to a block link node, where N is a positive integer and P is a constant.
A processing unit 402, configured to group the N block link points according to the N node information received by the receiving unit to obtain M common node groups, where M is an odd number smaller than N.
A sending unit 403, configured to send the grouping information obtained by the processing unit to the N block nodes, where the grouping information is used to indicate information of the M consensus node groups.
The receiving unit 401 is further configured to receive M pieces of indication information sent by M representative block link points, where one representative block link node is a block link point in a common node group, and one piece of indication information is used to indicate a voting result of a representative block link point for a target decision.
The processing unit 402 is further configured to determine whether the N block link points achieve consensus according to first information and M indication information, where the first information includes M computation forces and M indication information corresponding to the M representative block link points. One of the M calculated forces is the sum of the calculated forces P of all the block chain nodes in the consensus node group corresponding to the representative block chain node point.
In one implementation, the processing unit 402 randomly divides the N block link nodes into M common node groups according to the identities of the N block link nodes. Wherein, the number of the block chain nodes contained in at least M-1 consensus node groups is the same.
The processing unit 402 further determines a first consensus result according to the first information. If the first calculated power sum is larger than the second calculated power sum, determining that the first consensus result is: a consensus is achieved among the N block link points. And the first calculation power sum is the sum of K calculation powers corresponding to the K first voting results. The second calculation power sum is the sum of M-K calculation powers corresponding to the M-K second voting results. The K first voting results are results indicated by K pieces of indication information among the M pieces of indication information. The M-K second voting results are results indicated by the M-K indication information in the M indication information.
If the first calculated power sum is less than or equal to the second calculated power sum, determining that the first consensus result is: there is no consensus among the N block link points.
The processing unit 402 further determines a second consensus result according to the M indication information. If the number of the K first voting results is larger than the number of the M-K second voting results, determining that the second consensus result is: a consensus is achieved among the N block link points. The M-K second voting results are results indicated by the M-K indication information in the M indication information.
If the number of the K first voting results is less than or equal to the number of the M-K second voting results, determining that the second consensus result is: there is no consensus among the N block link points.
Finally, the processing unit 402 determines whether the N block link points achieve the consensus according to the first consensus result and the second consensus result. If the first consensus result is that consensus is achieved among the N block link points and the second consensus result is that consensus is achieved among the N block link points, then it is determined that consensus is achieved among the N block link points. If the first consensus result is that the N block link points do not agree and/or the second consensus result is that the N block link points do not agree, then it is determined that the N block link points do not agree.
It is clear to those skilled in the art from the foregoing description of the embodiments that, for convenience and simplicity of description, the foregoing division of the functional units is merely used as an example, and in practical applications, the above function distribution may be performed by different functional units according to needs, that is, the internal structure of the device may be divided into different functional units to perform all or part of the above described functions. For the specific working processes of the above-described method, apparatus and unit, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In another embodiment, as shown in fig. 5, a second schematic structural diagram of another block chain consensus device provided in the embodiment of the present application is applied to a block chain platform for implementing functions related to the block chain platform in the block chain consensus method provided in the embodiment. The block chain consensus device applied to the block chain platform comprises: a processor 502, a memory 501, a communication interface 503, and a bus 504; wherein, the communication interface 503 is used for the blockchain platform to communicate with other devices or networks; the memory 501 is used for storing one or more programs, the one or more programs include computer executable instructions, and when the blockchain consensus device runs, the processor 502 executes the computer executable instructions stored in the memory 501, so as to enable the blockchain consensus device to execute the blockchain consensus method in the above-described embodiments.
The processor 502 described above may implement or execute various exemplary logical blocks, units and circuits described in connection with the present disclosure. The processor 502 may be a central processing unit, general purpose processor, digital signal processor, application specific integrated circuit, field programmable gate array or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, units, and circuits described in connection with the disclosure. The processor 502 may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and microprocessors, among others.
The memory 501 may include a volatile memory, such as a random access memory. The memory 501 may also include non-volatile memory, such as read-only memory, flash memory, a hard disk, or a solid state disk. The memory comprises a combination of the above kinds of memories.
The bus 504 may be an Extended Industry Standard Architecture (EISA) bus or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. Fig. 5 is shown with only one thick line for ease of illustration, but does not show only one bus or one type of bus.
It is clear to those skilled in the art from the foregoing description of the embodiments that, for convenience and simplicity of description, the foregoing division of the functional units is merely used as an example, and in practical applications, the above function distribution may be performed by different functional units according to needs, that is, the internal structure of the device may be divided into different functional units to perform all or part of the above described functions. For the specific working processes of the above-described method, apparatus and unit, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In another embodiment, the present application further provides a computer-readable storage medium storing one or more programs corresponding to the block chain consensus apparatus, where the one or more programs include instructions, which when executed by a computer, cause the computer to perform the steps performed by the block chain platform in the block chain consensus method as described in the above method embodiment.
The computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, and a hard disk. Random Access Memory (RAM), Read-Only Memory (ROM), Erasable Programmable Read-Only Memory (EPROM), registers, a hard disk, an optical fiber, a portable Compact disk Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any other form of computer-readable storage medium, in any suitable combination, or as appropriate in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuit (ASIC). In embodiments of the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
In another embodiment, the present application further provides a computer program product that, when executed on a blockchain consensus device, causes the blockchain consensus device to perform the steps performed by the blockchain platform in the blockchain consensus method.
The embodiment of the present application further provides a block chain consensus device, which is applied to a block chain node, and is used to implement the function related to the block chain node in the block chain consensus method provided in the foregoing embodiment. Specifically, as shown in fig. 6, a third schematic structural diagram of a block chain consensus device according to an embodiment of the present application is provided. Wherein, the block chain consensus device comprises: transmitting section 601 and receiving section 602. Wherein:
a sending unit 601, configured to send N pieces of node information to a blockchain platform, where a piece of node information includes an identifier of a blockchain node and a computation power P corresponding to the blockchain node, where N is a positive integer and P is a constant.
A receiving unit 602, configured to receive packet information sent by a blockchain platform, where the packet information is used to indicate information of M consensus node groups.
The sending unit 601 is further configured to send M pieces of indication information to the blockchain platform, where the M pieces of indication information are indication information sent by M representative blockchain nodes. One representative block chain node is a block chain node in one common node group, and one piece of indication information is used for indicating a voting result of the representative block chain node on the target decision.
It is clear to those skilled in the art from the foregoing description of the embodiments that, for convenience and simplicity of description, the foregoing division of the functional units is merely used as an example, and in practical applications, the above function distribution may be performed by different functional units according to needs, that is, the internal structure of the device may be divided into different functional units to perform all or part of the above described functions. For the specific working processes of the above-described method, apparatus and unit, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In another embodiment, as shown in fig. 7, a structural schematic diagram of another block chain consensus device provided in the embodiment of the present application is shown in a fourth embodiment. Wherein, the block chain consensus device comprises: a processor 702, a memory 701, a communication interface 703, and a bus 704; wherein the communication interface 704 is used for the blockchain node to communicate with other devices or networks; the memory 701 is configured to store one or more programs, where the one or more programs include computer executable instructions, and when the blockchain consensus device runs, the processor 702 executes the computer executable instructions stored in the memory 701, so as to enable the blockchain consensus device to perform the blockchain consensus method in the foregoing embodiments.
The processor 702 may implement or execute various illustrative logical blocks, units and circuits described in connection with the disclosure herein. The processor 702 may be a central processing unit, general purpose processor, digital signal processor, application specific integrated circuit, field programmable gate array or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, units, and circuits described in connection with the disclosure. The processor 702 may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and microprocessors, among others.
Memory 701 may include volatile memory, such as random access memory. The memory 701 may also include non-volatile memory, such as read-only memory, flash memory, a hard disk, or a solid state disk. The memory 701 comprises a combination of memories of the kind described above.
The bus 704 may be an Extended Industry Standard Architecture (EISA) bus or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. Fig. 7 is shown with only one thick line for ease of illustration, but does not show only one bus or one type of bus.
It is clear to those skilled in the art from the foregoing description of the embodiments that, for convenience and simplicity of description, the foregoing division of the functional units is merely used as an example, and in practical applications, the above function distribution may be performed by different functional units according to needs, that is, the internal structure of the device may be divided into different functional units to perform all or part of the above described functions. For the specific working processes of the above-described method, apparatus and unit, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In another embodiment, the present application further provides a computer-readable storage medium storing one or more programs corresponding to the block chain consensus device, where the one or more programs include instructions, which when executed by a computer, cause the computer to perform the steps performed by the block chain nodes in the block chain consensus method as described in the above method embodiment.
The computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, and a hard disk. Random Access Memory (RAM), Read-Only Memory (ROM), Erasable Programmable Read-Only Memory (EPROM), registers, a hard disk, an optical fiber, a portable Compact disk Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any other form of computer-readable storage medium, in any suitable combination, or as appropriate in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuit (ASIC). In embodiments of the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
In another embodiment, the present application further provides a computer program product which, when run on a blockchain consensus apparatus, causes the blockchain consensus apparatus to perform the steps performed by the blockchain nodes in the blockchain consensus method.
Since the block chain consensus method and apparatus, the computer-readable storage medium, and the computer program product in the embodiments of the present invention may be applied to the above methods, the technical effects obtained by the method may also refer to the above method embodiments, and the details of the embodiments of the present invention are not repeated herein.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented using a software program, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions described in accordance with the embodiments of the present application are all or partially generated upon loading and execution of computer program instructions on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or can comprise one or more data storage devices, such as a server, a data center, etc., that can be integrated with the medium. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (6)

1. A block chain consensus method applied to a block chain platform is provided, wherein the block chain consensus method comprises:
receiving N pieces of node information sent by N block chain nodes, wherein one piece of node information comprises an identifier of one block chain node and a calculation force P corresponding to the one block chain node, N is a positive integer, and P is a constant;
grouping the N block chain link points according to the N node information to obtain M common node groups, wherein M is an odd number smaller than N;
sending grouping information to the N block nodes, wherein the grouping information is used for indicating the information of the M consensus node groups;
receiving M pieces of indication information sent by M representative block chain nodes, wherein one representative block chain node is a block chain node in a common node group, and one piece of indication information is used for indicating a voting result of the representative block chain node on a target decision;
determining whether consensus among the N block link points is achieved according to first information and the M pieces of indication information, wherein the first information comprises M calculation forces corresponding to the M representative block link points and the M pieces of indication information; one of the M calculation forces is the sum of the calculation forces P of all the block chain nodes in a consensus node group corresponding to a representative block chain node point;
determining whether a consensus among the N block link points is achieved according to the first information and the M indication information includes:
determining a first consensus result according to the first information;
determining a second consensus result according to the M pieces of indication information;
determining whether consensus is achieved among the N block link points according to the first consensus result and the second consensus result;
the determining a first consensus result according to the first information specifically includes:
if the first calculated power sum is larger than the second calculated power sum, determining that the first consensus result is: a consensus is achieved among the N block link points; wherein the first computation power sum is the sum of K computation powers corresponding to the K first voting results; the second calculation power sum is the sum of M-K calculation powers corresponding to the M-K second voting results; the K first voting results are results indicated by K pieces of indication information in the M pieces of indication information; the M-K second voting results are results indicated by M-K indication information in the M indication information;
if the first calculated power sum is less than or equal to the second calculated power sum, determining that the first consensus result is: the N block link points are not in common agreement.
2. The method according to claim 1, wherein grouping the N block link nodes according to the N node information comprises:
randomly dividing the N block chain link points into M common node groups according to the identifiers of the N block chain nodes; wherein, the number of the block chain nodes contained in at least M-1 consensus node groups is the same.
3. The method of claim 1, wherein determining a second consensus result according to the M indicator messages comprises:
if the number of the K first voting results is larger than the number of the M-K second voting results, determining that the second consensus result is: a consensus is achieved among the N block link points; the K first voting results are results indicated by K pieces of indication information in the M pieces of indication information, and the M-K second voting results are results indicated by M-K pieces of indication information in the M pieces of indication information;
if the number of the K first voting results is less than or equal to the number of the M-K second voting results, determining that the second consensus result is: the N block link points are not in common agreement.
4. The method according to claim 3, wherein said determining whether consensus among the N block link points is achieved according to the first consensus result and the second consensus result comprises:
determining that consensus is achieved between the N block link points if the first consensus result is that consensus is achieved between the N block link points and the second consensus result is that consensus is achieved between the N block link points;
determining that the N block link points are not in common if the first common finding is that the N block link points are not in common and/or the second common finding is that the N block link points are not in common.
5. A block chain consensus device applied to a block chain platform is provided, wherein the block chain consensus device comprises: a receiving unit, a processing unit and a transmitting unit;
the receiving unit is configured to receive N pieces of node information sent by N block link nodes, where a piece of node information includes an identifier of a block link node and a computation power P corresponding to the block link node, where N is a positive integer and P is a constant;
the processing unit is configured to group the N block link points according to the N node information received by the receiving unit to obtain M common node groups, where M is an odd number smaller than N;
the sending unit is configured to send the grouping information obtained by the processing unit to the N block link points, where the grouping information is used to indicate information of the M common node groups;
the receiving unit is further configured to receive M pieces of indication information sent by the M representative block link points, where one representative block link node is a block link point in a common node group, and one piece of indication information is used to indicate a voting result of a representative block link point for a target decision;
the processing unit is further configured to determine whether consensus among the N block link points is achieved according to first information and the M pieces of indication information, where the first information includes M computation forces corresponding to the M representative block link points and the M pieces of indication information; one of the M calculation forces is the sum of the calculation forces P of all the block chain nodes in a consensus node group corresponding to a representative block chain node point;
the processing unit is further configured to determine a first consensus result according to the first information; determining a second consensus result according to the M pieces of indication information; and determining whether consensus is achieved between the N block link points according to the first consensus result and the second consensus result;
the processing unit is further configured to determine that the first consensus result is: a consensus is achieved among the N block link points; wherein the first computation power sum is the sum of K computation powers corresponding to the K first voting results; the second calculation power sum is the sum of M-K calculation powers corresponding to the M-K second voting results; the K first voting results are results indicated by K pieces of indication information in the M pieces of indication information; the M-K second voting results are results indicated by M-K indication information in the M indication information;
the processing unit is further configured to determine that the first consensus result is: the N block link points are not in common agreement.
6. A blockchain consensus apparatus, comprising: a processor, a memory, a communication interface, and a bus; wherein, the communication interface is used for the block chain platform to communicate with other devices or networks; the memory is used for storing one or more programs, and the one or more programs comprise computer-executable instructions which, when the blockchain consensus device is running, are executed by the processor, and the computer-executable instructions stored by the memory are used for causing the blockchain consensus device to execute the blockchain consensus method as claimed in any one of claims 1 to 4.
CN201911159691.9A 2019-11-22 2019-11-22 Block chain consensus method and device Active CN110912994B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911159691.9A CN110912994B (en) 2019-11-22 2019-11-22 Block chain consensus method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911159691.9A CN110912994B (en) 2019-11-22 2019-11-22 Block chain consensus method and device

Publications (2)

Publication Number Publication Date
CN110912994A CN110912994A (en) 2020-03-24
CN110912994B true CN110912994B (en) 2022-02-11

Family

ID=69819144

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911159691.9A Active CN110912994B (en) 2019-11-22 2019-11-22 Block chain consensus method and device

Country Status (1)

Country Link
CN (1) CN110912994B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111368343B (en) * 2020-03-31 2022-11-01 北京俩撇科技有限公司 Block chain system, data storage method and device
CN111464631B (en) * 2020-03-31 2023-03-28 成都质数斯达克科技有限公司 Service consensus method and device in alliance block chain
CN111698094B (en) * 2020-06-12 2023-06-09 深圳前海微众银行股份有限公司 Common identification method based on block chain system and block chain system
CN111786818B (en) * 2020-06-16 2023-04-18 杭州溪塔科技有限公司 Block chain consensus node state monitoring method and device
CN111769986B (en) * 2020-06-29 2023-03-28 卓尔智联(武汉)研究院有限公司 Man-machine cooperation method and device based on block chain and electronic equipment
CN112583798B (en) * 2020-11-30 2022-11-08 北京八分量信息科技有限公司 Method, device and related product for screening common identification nodes from block chain system
CN113037863B (en) * 2021-03-31 2022-07-12 杭州云象网络技术有限公司 Block chain multi-party collaborative cross consensus verification method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107239940A (en) * 2017-05-11 2017-10-10 北京博晨技术有限公司 Network trading method and device based on block catenary system
CN107360206A (en) * 2017-03-29 2017-11-17 阿里巴巴集团控股有限公司 A kind of block chain common recognition method, equipment and system
CN108650291A (en) * 2018-03-26 2018-10-12 南京思利华信息科技有限公司 A kind of GPU task common recognition method and device based on calculation power
CN108810077A (en) * 2018-04-19 2018-11-13 深圳市网心科技有限公司 Block chain common recognition processing method, electronic device and computer readable storage medium
CN109818993A (en) * 2017-11-20 2019-05-28 西南交通大学 A kind of efficient block chain common recognition and exchange system
CN110113388A (en) * 2019-04-17 2019-08-09 四川大学 A kind of method and apparatus of the block catenary system common recognition based on improved clustering algorithm
CN110119987A (en) * 2019-04-03 2019-08-13 成都波霎科技有限公司 A kind of block chain mixing common recognition method
CN110474986A (en) * 2019-08-20 2019-11-19 深圳前海微众银行股份有限公司 A kind of common recognition method, apparatus and system based on block catenary system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10142312B2 (en) * 2016-02-22 2018-11-27 Bank Of America Corporation System for establishing secure access for users in a process data network
US20170330159A1 (en) * 2016-05-13 2017-11-16 Bank Of America Corporation Resource allocation and transfer in a distributed network
US10630463B2 (en) * 2018-02-26 2020-04-21 Ca, Inc. Meta block chain

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107360206A (en) * 2017-03-29 2017-11-17 阿里巴巴集团控股有限公司 A kind of block chain common recognition method, equipment and system
CN107239940A (en) * 2017-05-11 2017-10-10 北京博晨技术有限公司 Network trading method and device based on block catenary system
CN109818993A (en) * 2017-11-20 2019-05-28 西南交通大学 A kind of efficient block chain common recognition and exchange system
CN108650291A (en) * 2018-03-26 2018-10-12 南京思利华信息科技有限公司 A kind of GPU task common recognition method and device based on calculation power
CN108810077A (en) * 2018-04-19 2018-11-13 深圳市网心科技有限公司 Block chain common recognition processing method, electronic device and computer readable storage medium
CN110119987A (en) * 2019-04-03 2019-08-13 成都波霎科技有限公司 A kind of block chain mixing common recognition method
CN110113388A (en) * 2019-04-17 2019-08-09 四川大学 A kind of method and apparatus of the block catenary system common recognition based on improved clustering algorithm
CN110474986A (en) * 2019-08-20 2019-11-19 深圳前海微众银行股份有限公司 A kind of common recognition method, apparatus and system based on block catenary system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Leila Ismail ; Huned Materwala ; Sherali Zeadally.Lightweight Blockchain for Healthcare.《IEEE Access》.2019,第7卷 *
基于K-medoids的改进PBFT共识机制;陈子豪; ***;《计算机科学》;20191231;第46卷(第12期) *
基于区块链的环境监测数据安全传输方案;周万锴; 龙敏;《计算机科学》;20200131;第47卷(第1期);315-320页 *

Also Published As

Publication number Publication date
CN110912994A (en) 2020-03-24

Similar Documents

Publication Publication Date Title
CN110912994B (en) Block chain consensus method and device
US11095451B2 (en) Optimal data storage configuration in a blockchain
US10445965B2 (en) Blockchain-based cryptologic ballot organization
Shukla et al. Online voting application using ethereum blockchain
CN108848148B (en) Transaction information confirmation method and device based on block chain
CN111612600B (en) Block chain auction method, equipment, storage medium and block chain system
CN111523890A (en) Data processing method and device based on block chain, storage medium and equipment
CN111522874B (en) Block chain consensus method, apparatus, computer device and storage medium
US10693886B2 (en) Computation system, computation device, method thereof, and program to perform information processing
CN112597240B (en) Federal learning data processing method and system based on alliance chain
CN113328997A (en) Alliance chain cross-chain system and method
CN110958107A (en) Electronic voting method, device and storage medium based on block chain
CN111241586B (en) Anonymous processing method and system for block link address, terminal and storage medium
CN111010282B (en) Block chain-based information processing method, related device and storage medium
WO2022105518A1 (en) Electronic voting method and device
CN109242676A (en) Block dissemination method and device, electronic equipment
CN112598132A (en) Model training method and device, storage medium and electronic device
CN112039893B (en) Private transaction processing method and device, electronic equipment and readable storage medium
CN110602251B (en) Data processing method, device, apparatus and medium based on inter-node data sharing
CN113392412A (en) Data receiving method, data sending method and electronic equipment
Zhang et al. Distributed kNN query authentication
CN111932375A (en) Block chain design method
CN114363363B (en) Data storage method, device, equipment and medium based on multiple chains
Tauhidi et al. ABAFOR: a blockchain-based privacy-preserving architecture for efficient contact tracing and GIS analysis
CN110597466A (en) Control method and device of block chain node, storage medium and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant