CN111130875B - Block chain consensus method, device, equipment and storage medium - Google Patents

Block chain consensus method, device, equipment and storage medium Download PDF

Info

Publication number
CN111130875B
CN111130875B CN201911327077.9A CN201911327077A CN111130875B CN 111130875 B CN111130875 B CN 111130875B CN 201911327077 A CN201911327077 A CN 201911327077A CN 111130875 B CN111130875 B CN 111130875B
Authority
CN
China
Prior art keywords
election
nodes
block
random variable
value
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
CN201911327077.9A
Other languages
Chinese (zh)
Other versions
CN111130875A (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.)
Du Xiaoman Technology Beijing Co Ltd
Original Assignee
Du Xiaoman Technology Beijing 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 Du Xiaoman Technology Beijing Co Ltd filed Critical Du Xiaoman Technology Beijing Co Ltd
Priority to CN201911327077.9A priority Critical patent/CN111130875B/en
Publication of CN111130875A publication Critical patent/CN111130875A/en
Application granted granted Critical
Publication of CN111130875B publication Critical patent/CN111130875B/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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The consensus method, device, equipment and storage medium for the block chains obtain election requests of election nodes, wherein the election requests comprise values of external random variables, and the block nodes are selected from the election nodes at least according to the values of the external random variables and actual values of the external variables. Because the external random variable is a randomly generated variable, the fairness requirement of the consensus algorithm can be met. Because the external random variable is a random variable generated outside the blockchain and is not controlled by the internal change of the blockchain, the consensus algorithm of the external random variable is introduced, and the security is higher.

Description

Block chain consensus method, device, equipment and storage medium
Technical Field
The present application relates to the field of electronic information, and in particular, to a block chain consensus method, apparatus, device, and storage medium.
Background
The blockchain is a decentralized distributed ledger system, and due to network delay under a point-to-point network, the transaction sequences observed by all nodes cannot be completely consistent. The consensus mechanism of the block chain solves the problem of how to achieve consistency of the block chain in a distributed scene, and is also the key for guaranteeing the operation of a block chain system. The different block chain schemes employ different consensus mechanisms, and common consensus mechanisms include, for example, POW, POS, DPOS, BFT, and the like.
The consensus algorithm is crucial to the blockchain, and therefore, it is necessary to improve the security of the consensus algorithm.
Disclosure of Invention
In the research process, the applicant finds that the consensus algorithm used at present completely depends on the parameters inside the blockchain, and once the safety protection of the blockchain is broken, the consensus algorithm is likely to become the manipulated object.
The application provides a block chain consensus method, a block chain consensus device, block chain consensus equipment and a block chain storage medium, and aims to solve the problem of how to improve the security of a consensus algorithm.
In order to achieve the above object, the present application provides the following technical solutions:
a method for block chain consensus, comprising:
acquiring an election request of an election node, wherein the election request comprises a value of an external random variable, the external random variable is a random variable generated outside a block chain, and the value of the external random variable is determined by the election node;
and selecting a block node from the election nodes at least according to the value of the external random variable and the real value of the external variable.
Optionally, the obtaining an election request of an election node includes:
acquiring an election request sent by the election node before the generation of the N- (N/M) P-th blocks in the current election period, wherein N is the number of the blocks needing election in any election period, M is the number of the selected block-out nodes in any election period, and P is an integer in the range of [2, M).
Optionally, the selecting a block node from the election nodes according to at least the value of the external random variable and the real value of the external variable includes:
determining the ranking of the election nodes at least according to the value of the external random variable and the real value of the external random variable;
and selecting the block-out node from the election nodes based on the sorting.
Optionally, the election request further includes:
at least one of a quantity of digital currency for a pledge and a timestamp of sending the election request;
the determining the ranking of the election nodes at least according to the value of the external random variable and the real value of the external random variable includes:
sorting the election nodes according to the difference between the value of the external random variable in the election request and the real value;
determining the sequence of the election nodes with the same difference according to a first sequence basis;
and determining the sorting of the election nodes with the same gap and the same number of the digital currencies according to a second sorting basis, wherein the first sorting basis is the number of the digital currencies or the time stamps, and the second sorting basis is the time stamps or the number of the digital currencies.
Optionally, the method for obtaining the true value includes:
and when the N- (N/M) Q blocks in the current election period are generated, acquiring the true value, wherein N is the number of the blocks to be elected in any election period, M is the number of the selected block-out nodes in any election period, Q is an integer in the range of [1, P ], and P is an integer in the range of [2, M).
Optionally, the method further includes:
and if the true value is not obtained, prohibiting the election node from blocking.
Optionally, the process of determining the external random variable includes:
and voting the external random variable generated by the nodes in the block chain to serve as the external random variable of at least one election period.
Optionally, the external random variable satisfies a preset condition, where the preset condition includes at least one of:
before the block node is determined, the true value cannot be obtained;
the operation and control are not possible;
the frequency of the change is higher than the frequency of the out-of-block.
An apparatus for block chain consensus, comprising:
the device comprises a request acquisition unit, a selection unit and a selection unit, wherein the request acquisition unit is used for acquiring selection requests of selection nodes, the selection requests comprise values of external random variables, the external random variables are random variables generated outside a block chain, and the values of the external random variables are determined by the selection nodes;
and the block node selection unit is used for selecting a block node from the election nodes at least according to the value of the external random variable and the real value of the external variable.
An apparatus for block chain consensus, comprising: a memory and a processor;
the memory is used for storing programs;
the processor is configured to execute the program to implement the steps of the block chain consensus method.
A readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned block chain consensus method.
The consensus method, device, equipment and storage medium for the block chains obtain election requests of election nodes, wherein the election requests comprise values of external random variables, and the block nodes are selected from the election nodes at least according to the values of the external random variables and actual values of the external variables. Because the external random variable is a randomly generated variable, the fairness requirement of the consensus algorithm can be met. Because the external random variable is a random variable generated outside the blockchain and is not controlled by the internal change of the blockchain, the consensus algorithm of the external random variable is introduced, and the security is higher.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a block chain consensus method according to an embodiment of the present disclosure;
fig. 2 is a flowchart of another block chain consensus method disclosed in the embodiments of the present application;
fig. 3 is a flowchart of another block chain consensus method disclosed in the embodiments of the present application;
fig. 4 is a 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 disclosure.
Detailed Description
The purpose of the block chain consensus algorithm is at least to select a block node from the election nodes in the process that nodes in the block chain compete out blocks.
Generally, nodes in the block chain can all compete to become block-out nodes, and at least more than half of the nodes in the block chain participate in consensus to select the block node. Therefore, in the following embodiments, the execution subject of the process is any node in the block chain, and after at least half or more of the nodes execute the following consensus process, the block nodes are selected to achieve consensus.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a block chain consensus method disclosed in an embodiment of the present application, including the following steps:
s101: and acquiring an election request of an election node.
Wherein the election request includes a value of an external random variable. The external random variable is a random variable generated outside the blockchain, which is not affected by variations inside the blockchain.
Optionally, in this embodiment, the external random variable is a random variable that satisfies the following condition:
1. the true value is not known in advance. I.e. the value of the random variable is a numerical value related to the occurrence of a random event, it is not possible to know the actual value in advance before the occurrence of the random event. In conjunction with the flow shown in fig. 1, i.e., before the block nodes are determined, the true values are not known.
2. Is not operable. Inoperable means that it is theoretically inoperable or that the cost of manipulation is much greater than the profit of the block.
3. The frequency of the change is higher than the frequency of the out-of-block.
The above conditions can make the external random variable have objectivity and fairness, thereby ensuring fairness of the consensus algorithm.
Based on the above conditions, one example of an external random variable is the time that the last flight at an airport before the current time lands. Another example of an external random variable is the number of closing rounds or the index of the stock at a particular time (per hour, per half hour, per ten minutes, etc.).
Optionally, because the robustness of a single random variable is generally weaker than the robustness of multiple random variables, multiple external random variables may be used in order to increase the unpredictability of the external random variables, thereby further improving the fairness of the consensus algorithm.
Specifically, a set of uncorrelated external random variables may be combined, and generally, if the irrelevancy of n random variables can be guaranteed, the robustness and the attack difficulty of a random variable set composed of n elements are n times of those of a single random variable.
For example, the landing time of a flight is extended to the landing time of n unrelated flights, and for example, the landing time of a flight is extended to the landing time of a flight and the current day stock. As another example, the external random variable is "flight landing time, stock closing price, and 3 o' clock temperature …".
It should be noted that any node in the block chain that is to participate in the block election may send an election request, or may receive election requests sent by other election nodes. The value of the external random variable in the election request sent by any one election node is a value predicted for the election node, that is, the election node can use a preset algorithm to predict the value of the external random variable. Or may be a value obtained from another device or a value selected from values obtained from other devices. In summary, the value of the external random variable in the election request issued by any one election node is the value determined for that election node.
S102: and selecting block nodes from the election nodes at least according to the value of the external random variable and the real value of the external variable.
Optionally, the closer the value of the external random variable in any one election request is to the true value, the higher the probability that the election node becomes a block-out node is. Or, the larger the difference between the value of the external random variable in any one election request and the real value is, the higher the probability that the election node becomes a block-out node is. Alternatively, the block node may be selected by using another rule (for example, a ratio of the two) based on the value of the external random variable and the true value, which is not limited in this embodiment.
Alternatively, the real value may be provided by a third party.
It can be seen from the flow shown in fig. 1 that, in the election process of a block node, an external random variable is introduced, and firstly, the randomness of the external random variable can meet the fairness requirement of the consensus algorithm, and more importantly, even if the security protection of the block chain is breached, the difficulty in completely controlling the consensus method described in this embodiment is higher than that of the existing consensus algorithm because the external random variable is not affected by the change inside the block chain, so that the consensus mechanism has higher security.
The basis for selecting a block node may include other parameters in addition to the external random variable. Fig. 2 is a block chain consensus method according to another embodiment of the present disclosure, including the following steps:
s201: and acquiring an election request of an election node, wherein the election request comprises the value of an external random variable, the number of the pledged digital currency and a timestamp of the election request.
In order to ensure that the selected block-out node provides the block subsequently, in this embodiment, the nodes participating in the competitive selection of the block, i.e., the competitive selection nodes, are required to pledge the digital money, and the pledged digital money is not returned.
Optionally, the election request may include other parameters in addition to the above parameters. Specifically, as shown in table 1:
TABLE 1
Figure GDA0003763012180000061
Figure GDA0003763012180000071
In table 1, Round represents the Round of the participation competition, and the Round will be described in detail in the flow shown in fig. 3. Topic denotes the name of the external random variable and value denotes the value of the external random variable.
Table 2 is an example of an election request using a number of unrelated external random variables:
TABLE 2
Figure GDA0003763012180000072
S202: and sequencing the election nodes according to the sequence from small to large of the difference between the value of the external random variable and the real value in the election request.
In this step, the election nodes with the same gap are temporarily sorted and juxtaposed.
Alternatively, for the case of multiple external random variables, the difference between the value of the external variable and the true value may be calculated according to the following rule:
and taking the minimum value in the differences between the values of the n external random variables and the corresponding real values as the difference between the values of the external variables and the real values. For example, for the case shown in table 2, the difference between the value of the external variable and the true value is min (real _ flighti _ time) -sum (gu _ flighti _ time)), and i is 1, 2, … … n. n is the number of flights. The real _ flighti _ time is the real value of the ith external random variable, and the stress _ flighti _ time is the value of the ith external random variable.
S203: in the case of the same gap, the larger the number of digital currencies, the more advanced the ranking.
In this step, the election nodes with the same gap and the same number of digital currencies are temporarily sorted and juxtaposed.
S204: in the case where the gap and the number of digital currencies are the same, the earlier the time stamp, the earlier the ranking.
Optionally, after the out-blocking node successfully releases the block, remuneration may be distributed according to the amount of digital currency.
S205: and taking the top preset number of election nodes in the sequence as the block output nodes.
It can be seen from the flow shown in fig. 2 that the block nodes can be determined by using external random variables together with other parameters, which is beneficial to further improving the fairness and security of the consensus algorithm. And the digital currency pledge of the election request solves the problem of exhaustive attack by a malicious attacker.
It should be noted that, in fig. 2, the sorting is performed according to the rule that the difference is from small to large, the number of the digital currencies is from small to large, and the time stamp is from first to last, and besides, the sorting may be performed according to the rule, for example, the sorting is performed according to the difference, the number of the digital currencies is from large to small, and/or the sorting is performed according to the time stamp from last to first, and for example, the sorting is performed according to the time stamp and then the number of the digital currencies after the sorting is performed according to the difference. That is, in this embodiment, the sort rule is not limited.
Fig. 3 is a further block chain consensus method disclosed in this embodiment of the present application, where in this embodiment, a time sequence of the consensus step is defined, and it is assumed that election and block output of the block output nodes of N blocks are taken as a turn (i.e., an election period), that is, in an election period, processes of selecting the block output nodes of N blocks and providing N blocks by the block output nodes need to be completed.
Fig. 3 includes steps in any one election period (hereinafter, referred to as a current election period):
s301: and acquiring election requests sent by election nodes before the generation of the N- (N/M) P-th block in the current election period.
Wherein, N is the number of blocks to be selected in a preset selection period, M is the number of block output nodes selected in the selection period, and P is an integer in the range of [2, M). Therefore, the number of blocks to be subjected to election in the current election period and the next election period is N, and the number of the block-out nodes selected in the current election period and the next election period is M.
The step aims to ensure that in the current election period, after the election of each election node is finished, the election process of the next election period starts. That is to say, two adjacent front and back election cycles are overlapped, and before a certain time point in the block output process of the previous election cycle, the process of collecting the election request of the block output node of the next election cycle is completed, so that after the block output of the current election cycle is finished, the next election cycle is ensured to complete the selection of the block output node, and block output is started, so that the continuity of the block output is ensured, and the block output efficiency is improved.
Therefore, in the research process, according to the requirement for ensuring the continuity of the output blocks, the applicant obtains through experiments that the selection request of the next selection cycle is collected before the N- (N/M) × P blocks in the current selection cycle are generated, so that the output blocks of the next selection cycle can be started after the output blocks of the current selection cycle are finished, and the continuity of the output blocks is ensured. The specific value of P may be determined according to the actual duration of a block provided by the election node.
S302: and if the round in the election request is the next election period, determining that the election request is valid, and executing S303, otherwise, determining that the election request is invalid, and sending an invalid prompt. In the aforementioned table 1, with the Round of route participation in the election in table 2, since the current election period collects the requests participating in the next election period, the requests participating in the next Round of election are only valid election requests, and there is a possibility that a network failure of an election node causes a delay in transmission of the election request, and after other nodes receive the election request, the Round indicated in the election request has passed or a time interval of the Round collection request indicated in the election request has passed, in this case, it is determined that the election request is invalid.
S303: and when an N- (N/M) Q block in the current election period is generated, acquiring the real value of the external random variable, determining the sequencing of election nodes according to the difference between the value of the external random variable in the effective election request and the real value, the number of digital currencies and the timestamp of the election request, and taking the first M election nodes in the sequencing as the block outlet nodes.
Wherein Q is an integer in the range of [1, P). The purpose of the setting of N- (N/M) × Q is also to guarantee the continuity of the outgoing blocks. In the research process, the applicant finds that the subsequent processes for selecting the block-out node, such as sequencing, can be completed before the block-out in the current election period is completed only when the real value is obtained at the time point, so that the block-out in the next election period is started after the block-out in the current election period is completed.
It should be noted that, if the true value is not obtained, all election nodes in the next election period are prohibited from going out of the block, so as to ensure the safety of the block chain. Optionally, in order to improve the security, all election nodes in the current election period may be prohibited from getting out of the block.
S304: and in the next election period of the current election period, the block output nodes output blocks according to the sequence.
Optionally, if the block output node selected in the current election period does not output a block in the next election period, the block output node is prohibited from participating in election of the block output node in the preset time period. The preset time period may be one or more election cycles.
As can be seen from the flow shown in fig. 3, the continuity of the outbound block can be ensured by setting the collection timing of the election request and the selection timing of the outbound block node. And the collecting phase and the election phase of the election request are separated, so that the election request is submitted before the random variables are generated outside.
Alternatively, the external random variable used in the above process may be voted by each node in the block chain before the process starts. Specifically, a set of external random variables is provided by blocks such as creation blocks, the set includes names of the external random variables, each node votes, and the external random variables used in the consensus process are selected.
Optionally, the external random variable may be generated through voting in each round, or the external random variable generated through one voting may be used in multiple rounds of election cycles, which is not limited herein.
Fig. 4 is a block chain consensus apparatus according to an embodiment of the present disclosure, including:
a request obtaining unit 401, configured to obtain an election request of an election node, where the election request includes a value of an external random variable, where the external random variable is a random variable generated outside a block chain, and the value of the external random variable is determined by the election node;
a block node determining unit 402, configured to select a block node from the election nodes at least according to the value of the external random variable and the real value of the external variable.
Optionally, the specific implementation manner of the request obtaining unit 401 obtaining the election request of the election node is as follows: acquiring an election request sent by the election node before the generation of the N- (N/M) P-th blocks in the current election period, wherein N is the number of the blocks needing election in any election period, M is the number of the selected block-out nodes in any election period, and P is an integer in the range of [2, M).
The specific implementation manner of selecting a block node from the election nodes by the block node determining unit 402 according to at least the value of the external random variable and the real value of the external variable is as follows: determining the ranking of the election nodes at least according to the value of the external random variable and the real value of the external random variable; and selecting the block-out node from the election nodes based on the sorting.
Further, the election request further includes: at least one of a quantity of digital currency pledged and a timestamp of sending the election request. In this case, the specific implementation manner of selecting the block node from the election nodes by the block node determining unit 402 according to at least the value of the external random variable and the real value of the external variable is as follows: sorting the election nodes according to the difference between the value of the external random variable in the election request and the real value; determining the sequence of the election nodes with the same difference according to a first sequence basis; and determining the sequencing of the election nodes with the same gap and the same number of the digital currencies according to a second sequencing basis, wherein the first sequencing basis is the number of the digital currencies or the time stamps, and the second sequencing basis is the time stamps or the number of the digital currencies.
Further, the apparatus further comprises: and a real value obtaining module, configured to obtain the real value when an N- (N/M) × Q number of blocks in the current election cycle are generated, where N is the number of blocks to be elected in any election cycle, M is the number of block-out nodes selected in any election cycle, Q is an integer within a range of [1, P), and P is an integer within a range of [2, M). And if the true value is not obtained, prohibiting the election node from being blocked.
Further, the apparatus further comprises: and the external random variable determining module is used for taking the external random variable generated by voting the nodes in the block chain as the external random variable of at least one election period.
It should be noted that the consensus device of the block chain may be configured in a pluggable form. Under the condition of initially inserting a block chain, a plurality of nodes are possibly required to be matched and upgraded, and after more than half of the nodes are successfully upgraded, the consensus device can be started.
The embodiment of the present application further discloses a consensus device of a block chain, please refer to fig. 5, which shows a schematic structural diagram of the consensus device of the block chain, and the consensus device of the block chain may include: at least one processor 501, at least one communication interface 502, at least one memory 503, and at least one communication bus 504;
in this embodiment, the number of the processor 501, the communication interface 502, the memory 503 and the communication bus 504 is at least one, and the processor 501, the communication interface 502 and the memory 503 complete communication with each other through the communication bus 504;
the processor 501 may be a central processing unit CPU, or an application Specific Integrated circuit asic, or one or more Integrated circuits configured to implement embodiments of the present invention, etc.;
the memory 503 may include a high-speed RAM memory, and may further include a non-volatile memory (non-volatile memory) or the like, such as at least one disk memory;
wherein the memory stores a program, and the processor can call the program stored in the memory, and the program is used for realizing the consensus method of the block chain.
The functions described in the method of the embodiment of the present application, if implemented in the form of software functional units and sold or used as independent products, may be stored in a storage medium readable by a computing device. Based on such understanding, part of the contribution to the prior art of the embodiments of the present application or part of the technical solution may be embodied in the form of a software product stored in a storage medium and including several instructions for causing a computing device (which may be a personal computer, a server, a mobile computing device or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A method for block chain consensus, comprising:
acquiring an election request of an election node, wherein the election request comprises a value of an external random variable, the external random variable is a random variable generated outside a block chain, and the value of the external random variable is determined by the election node;
the external random variable meets a preset condition, and the preset condition comprises the following steps: the real value can not be obtained in advance before the random event occurs, the operation and control can not be carried out, and the changing frequency is higher than the block output frequency;
selecting a block node from the election nodes at least according to the value of the external random variable and the real value of the external random variable;
the method for acquiring the true value comprises the following steps: when the N- (N/M) Q blocks in the current election period are generated, acquiring the true value, wherein N is the number of the blocks needing to be elected in any election period, M is the number of selected block nodes in any election period, Q is an integer in a range of [1, P ], and P is an integer in a range of [2, M);
the obtaining of the election request of the election node includes:
obtaining an election request sent by the election node before the generation of the N- (N/M) × P blocks in the current election period, wherein N is the number of the blocks needing election in any election period, M is the number of the block outlet nodes selected in any election period, P is an integer in a range of [2, M ], the value of P is determined according to the actual time length of one block provided by the election node, and the election and the block outlet of the block outlet nodes of the N blocks are used as one election period.
2. The method of claim 1, wherein selecting a block node from the election nodes based at least on the value of the external random variable and the actual value of the external random variable comprises:
determining the ranking of the election nodes at least according to the value of the external random variable and the real value of the external random variable;
and selecting the block-out node from the election nodes based on the sorting.
3. The method of claim 2, wherein the election request further comprises:
at least one of a quantity of digital currency pledged and a timestamp of sending the election request;
determining the ranking of the election nodes at least according to the value of the external random variable and the real value of the external random variable, wherein the determining the ranking comprises the following steps:
sorting the election nodes according to the difference between the value of the external random variable in the election request and the real value;
determining the sequence of the election nodes with the same difference according to a first sequence basis;
and determining the sequencing of the election nodes with the same gap and the same number of the digital currencies according to a second sequencing basis, wherein the first sequencing basis is the number of the digital currencies or the time stamps, and the second sequencing basis is the time stamps.
4. The method of claim 1, further comprising:
and if the true value is not obtained, prohibiting the election node from being blocked.
5. The method of claim 1, wherein the determining of the external random variable comprises:
and voting the external random variable generated by the nodes in the block chain to serve as the external random variable of at least one election period.
6. An apparatus for block chain consensus, comprising:
the device comprises a request acquisition unit, a selection unit and a selection unit, wherein the request acquisition unit is used for acquiring selection requests of selection nodes, the selection requests comprise values of external random variables, the external random variables are random variables generated outside a block chain, and the values of the external random variables are determined by the selection nodes;
the external random variable meets a preset condition, and the preset condition comprises the following steps: before a random event occurs, the true value cannot be known in advance; is not operable; and, the frequency of the change is higher than the frequency of the out-blocking;
the request obtaining unit is specifically configured to: acquiring an election request sent by the election nodes before the generation of the N- (N/M) P blocks in the current election period, wherein N is the number of blocks to be elected in any election period, M is the number of block outlet nodes selected in any election period, and P is an integer in a range of [2, M), the value of P is determined according to the actual time length of one block provided by the election nodes, and the election and the block outlet of the block outlet nodes of the N blocks are used as one election period;
the method for acquiring the true value comprises the following steps: when the N- (N/M) Q blocks in the current election period are generated, acquiring the true value, wherein N is the number of the blocks needing election in any election period, M is the number of the block-out nodes selected in any election period, Q is an integer in the range of [1, P ], and P is an integer in the range of [2, M);
and the block node selection unit is used for selecting a block node from the election nodes at least according to the value of the external random variable and the real value of the external random variable.
7. A block chain consensus device, comprising: a memory and a processor;
the memory is used for storing programs;
the processor is used for executing the program to realize the steps of the block chain consensus method according to any one of claims 1-5.
8. A readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the block chain consensus method according to one of the claims 1 to 5.
CN201911327077.9A 2019-12-20 2019-12-20 Block chain consensus method, device, equipment and storage medium Active CN111130875B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911327077.9A CN111130875B (en) 2019-12-20 2019-12-20 Block chain consensus method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911327077.9A CN111130875B (en) 2019-12-20 2019-12-20 Block chain consensus method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111130875A CN111130875A (en) 2020-05-08
CN111130875B true CN111130875B (en) 2022-09-30

Family

ID=70500682

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911327077.9A Active CN111130875B (en) 2019-12-20 2019-12-20 Block chain consensus method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111130875B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112738196B (en) * 2020-12-25 2021-11-30 卓尔智联(武汉)研究院有限公司 Block chain representative node selection method and device, computer equipment and storage medium
CN112822239A (en) * 2020-12-30 2021-05-18 深圳市宝能投资集团有限公司 Block chain consensus method, block chain consensus device, electronic equipment and storage medium
CN114090306B (en) * 2022-01-21 2022-04-19 安徽中科晶格技术有限公司 Pluggable block chain layered consensus method, system, device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108596621A (en) * 2018-04-28 2018-09-28 深圳市优学链科技有限公司 Block chain accounting nodes generation method, device, computer equipment and storage medium
CN108810077A (en) * 2018-04-19 2018-11-13 深圳市网心科技有限公司 Block chain common recognition processing method, electronic device and computer readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107450981B (en) * 2017-05-31 2020-04-24 创新先进技术有限公司 Block chain consensus method and equipment
CN109146146A (en) * 2018-07-27 2019-01-04 阿里巴巴集团控股有限公司 Event prediction method and device, electronic equipment
CN109949157B (en) * 2019-03-08 2022-03-18 矩阵元技术(深圳)有限公司 Business data uplink method, device and system
CN110060159A (en) * 2019-03-12 2019-07-26 蔡少龙 Data processing method and device based on super node

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108810077A (en) * 2018-04-19 2018-11-13 深圳市网心科技有限公司 Block chain common recognition processing method, electronic device and computer readable storage medium
CN108596621A (en) * 2018-04-28 2018-09-28 深圳市优学链科技有限公司 Block chain accounting nodes generation method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111130875A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN111130875B (en) Block chain consensus method, device, equipment and storage medium
Yu et al. Repucoin: Your reputation is your power
CN110049029B (en) Consensus node determination method, device, computer equipment and storage medium
CN109165945B (en) Representative node device election method and device, computer device and storage medium
CN113794675B (en) Distributed Internet of things intrusion detection method and system based on block chain and federal learning
CN107220130B (en) Method, device and system for realizing information consensus at nodes of block chain
KR102240939B1 (en) Blockchain system with consensus algorithm based on proof-of -transaction and method there of
CN110011974B (en) Accounting method and device of block chain, terminal and computer-readable storage medium
CN109981281B (en) Method and device for determining candidate elements based on block chain proposal random consensus
CN111445333A (en) Block generation method and device, computer equipment and storage medium
KR20220091560A (en) Blockchain-based data detection method and device, and computer-readable storage medium
CN108366113B (en) High fault-tolerant consensus mechanism of grouping based on DPOS
CN112118138B (en) System and method for realizing block chain consensus mechanism
CN115242420B (en) Block chain contribution proof consensus method and system based on intelligent contract
Islam et al. A comparative analysis of proof-of-authority consensus algorithms: Aura vs Clique
Masood et al. Consensus algorithms in distributed ledger technology for open environment
CN111082990B (en) Block chain consensus method, device, equipment and storage medium
Xiao et al. Proof of importance: A consensus algorithm for importance based on dynamic authorization
CN112511312A (en) Assembled consensus method and system
CN112417052A (en) Data synchronization method, device, equipment and storage medium in block chain network
CN115720227A (en) Election method and device for consensus nodes of block chain and electronic equipment
CN111124672A (en) Data distribution method based on Redis cluster and related equipment
CN112258326B (en) Random block output method and system
CN112911011B (en) Block generation control method applied to block chain and related device
JP7311794B2 (en) Information processing device and program

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 401121 b7-7-2, Yuxing Plaza, No.5 Huangyang Road, Yubei District, Chongqing

Applicant after: Chongqing duxiaoman Youyang Technology Co.,Ltd.

Address before: 201800 room j1328, 3 / F, building 8, 55 Huiyuan Road, Jiading District, Shanghai

Applicant before: SHANGHAI YOUYANG NEW MEDIA INFORMATION TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20211215

Address after: 100193 Room 606, 6 / F, building 4, West District, courtyard 10, northwest Wangdong Road, Haidian District, Beijing

Applicant after: Du Xiaoman Technology (Beijing) Co.,Ltd.

Address before: 401121 b7-7-2, Yuxing Plaza, No.5 Huangyang Road, Yubei District, Chongqing

Applicant before: Chongqing duxiaoman Youyang Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant