Disclosure of Invention
One of the objectives of the present invention is to provide a block chain consensus method applied to internal transactions of a regional energy internet microgrid, which solves the problem of excessive centralization of consensus nodes caused by fixed consensus nodes by dynamically selecting the consensus nodes; meanwhile, the method of the invention adopts the consensus group nodes with local quantification and high reputation value to participate in the consensus, thereby avoiding the problem of reduced consensus efficiency caused by the increase of the number of the consensus group nodes in the PBFT consensus algorithm.
In order to achieve the purpose, the invention adopts the following technical scheme:
a block chain consensus method applied to internal transaction of a regional energy Internet microgrid comprises the following steps:
I.1. dynamically selecting n nodes from the inside of the microgrid as common identification group nodes, wherein the selection process is as follows:
I.1.1. selecting all nodes with standard credit values except transaction nodes in the microgrid; the node with the qualified reputation value is the node with the reputation value exceeding a set reputation value threshold T0, and T0 is more than or equal to 70 and less than 100;
I.1.2. distributing a random numerical value X to each selected node with the qualified reputation value by using a random algorithm;
wherein, the value range of the random number X is as follows: x is more than or equal to T0 and less than or equal to 100;
I.1.3. adding the credit value of each selected node with the standard credit value with a random numerical value distributed to the node with the standard credit value, and sequencing the added results according to the sequence from large to small;
I.1.4. selecting the first n nodes from the added results according to the descending order, and taking the n nodes with the qualified reputation values corresponding to the n results as consensus group nodes participating in the internal trading consensus process of the microgrid;
I.2. the transaction initiating node signs the energy transaction record by the private key and broadcasts the energy transaction record to all the common identification group nodes;
I.3. all the consensus group nodes carry out Byzantine consensus verification aiming at the energy transaction records;
I.4. each consensus group node broadcasts a consensus result message which is generated after the Byzantine consensus verification and corresponds to the energy transaction record to other nodes except the node per se in the regional energy Internet;
the other nodes except the local nodes in the regional energy Internet comprise a transaction initiating node, other consensus group nodes, other microgrid internal nodes except the transaction initiating node and the consensus group nodes and microgrid external nodes;
I.5. and all the nodes in the regional energy Internet judge and store the consensus result according to the received consensus result message, and modify the credit values of all the consensus group nodes in the local credit value list.
Preferably, the reputation value refers to the integrity degree obtained according to the history data of the node participating in consensus;
the credit value is modified according to whether the node endorsement result is the same as the consensus result or not, the energy transaction consensus endorsement credit value +1 is normally completed, the endorsement is mistaken once, and the credit value is-10;
wherein the initial value of the reputation value is 100, and the reputation value does not increase after reaching 100.
Preferably, the regional energy internet is constructed by a plurality of independent micro-grids;
each micro-grid internally comprises:
the system comprises a plurality of energy power generation and power sale access main bodies, power sale nodes which are in one-to-one correspondence with the energy power generation and power sale access main bodies, and a plurality of energy power purchase access main bodies and power purchase nodes which are in one-to-one correspondence with the energy power purchase access main bodies;
in step I.2, the transaction initiating node refers to an electricity purchasing node inside the microgrid.
Preferably, in step i.2, the energy transaction record includes a transaction record ID, an electricity purchasing user ID, an electricity selling user ID, an electricity purchasing user private key signature, an electricity selling user private key signature, a transaction unit price, a transaction amount and a transaction amount;
step I.3, the Byzantine consensus verification comprises a pre-preparation stage and a preparation stage; wherein:
the pre-preparation phase process is as follows:
the transaction initiating node sends the energy transaction record to the consensus group node, the consensus group node verifies the private key signature and the transaction amount in the energy transaction record, and after the verification is passed, endorsement is carried out on the energy transaction record;
the preparation phase process is as follows:
each consensus group node sends the energy transaction records after endorsement to other consensus group nodes except the consensus group node;
the consensus group node verifies the received endorsed energy transaction records, and if the number of the received records is more than 2f +1, a consensus result message corresponding to the energy transaction records is generated;
wherein, the consensus result message refers to a confirmation message containing the energy transaction record, and 3f +1 is more than or equal to n.
Preferably, in step i.5, the determining and storing of the consensus result means that if the number of the consensus result messages collected by the node is greater than n/2, the node determines that the consensus result message is a correct message, and stores the energy transaction record into the local block chain;
in step i.5, the reputation value list refers to a list of reputation values of all block link points in the corresponding regional energy internet.
The invention also aims to provide a block chain consensus method applied to regional energy Internet microgrid external transactions, which solves the problem of excessive centralization of consensus nodes caused by fixed consensus nodes by dynamically selecting the consensus nodes; meanwhile, the method of the invention adopts the local quantification and high credit value consensus group node to participate in the consensus, thereby avoiding the problem of reduced consensus efficiency caused by the increase of the number of the consensus group nodes in the PBFT consensus algorithm.
In order to achieve the purpose, the invention adopts the following technical scheme:
a block chain consensus method applied to regional energy Internet microgrid external transactions comprises the following steps:
II.1, dynamically selecting n nodes from a plurality of micro-grids participating in transaction as a consensus group node, wherein the selection process is as follows:
II.1.1, averagely or relatively averagely distributing the denominations of the n consensus group nodes to each micro-grid participating in transaction, and then sequentially selecting a corresponding number of consensus group nodes from each micro-grid;
setting the number of micro grids participating in transaction as m, and the number of consensus group nodes distributed by the ith micro grid as ni,1≤i≤m;
The selection process of the consensus group node in the ith microgrid is shown in the following step ii.1.2 to step ii.1.5;
II.1.2, selecting all nodes with the standard credit values inside the ith microgrid except for the trading nodes; the node with the qualified reputation value is the node with the reputation value exceeding a set reputation value threshold T0, and T0 is more than or equal to 70 and less than 100;
II.1.3, distributing a random numerical value X to each selected node with the qualified reputation value by using a random algorithm;
wherein, the value range of the random number X is as follows: x is more than or equal to T0 and less than or equal to 100;
II.1.4, adding the credit value of each selected node with the standard credit value and the random numerical value distributed to the node with the standard credit value, and sequencing the added results according to the sequence from large to small;
II.1.5. selecting the first n from the summed results in descending orderiWill be in contact with niN corresponding to each resultiThe node with the qualified reputation value is used as a consensus group node selected from the inside of the ith microgrid;
II.1.6, after the internal common identification group nodes of each microgrid are selected, taking the selected common identification group nodes in all the microgrids participating in the transaction as the common identification group nodes participating in the external transaction common identification process of the microgrid;
II.2, a transaction initiating node signs the energy transaction record by the private key and broadcasts the energy transaction record to all the nodes of the consensus group;
II.3, carrying out Byzantine consensus verification on all the consensus group nodes aiming at the energy transaction records;
II.4, each consensus group node broadcasts a consensus result message of the corresponding energy transaction record generated after the Byzantine consensus verification to other nodes except the node per se in the regional energy Internet;
the other nodes except the local nodes in the regional energy Internet comprise a transaction initiating node, other consensus group nodes, other nodes except the transaction initiating node and the consensus group node in each micro-grid participating in transaction and micro-grid external nodes;
the external nodes of the micro-grid refer to nodes in other micro-grids which do not participate in energy transactions;
and II.5, all the nodes in the regional energy Internet judge and store the consensus result according to the received consensus result message, and modify the credit values of all the consensus group nodes in the local credit value list.
Preferably, the reputation value refers to the integrity degree obtained according to the history data of the node participating in consensus;
the credit value is modified according to whether the node endorsement result is the same as the consensus result or not, the energy transaction consensus endorsement credit value +1 is normally completed, the endorsement is mistaken once, and the credit value is-10;
wherein the initial value of the reputation value is 100, and the reputation value does not increase after reaching 100.
Preferably, the regional energy internet is constructed by a plurality of independent micro-grids; each microgrid comprises:
the system comprises a plurality of energy power generation and power sale access main bodies, power sale nodes which are in one-to-one correspondence with the energy power generation and power sale access main bodies, and a plurality of energy power purchase access main bodies and power purchase nodes which are in one-to-one correspondence with the energy power purchase access main bodies;
in step ii.2, the transaction initiation node is an electricity purchasing node in the microgrid participating in the energy transaction.
Preferably, in step ii.2, the energy transaction record includes a transaction record ID, an electricity purchasing user ID, an electricity selling user ID, an electricity purchasing user private key signature, an electricity selling user private key signature, a transaction unit price, a transaction amount and a transaction amount;
in step II.3, the Byzantine consensus verification comprises two processes, namely a preparation stage and a preparation stage; wherein:
the pre-preparation phase process is as follows:
the transaction initiating node sends the energy transaction record to the consensus group node, the consensus group node verifies the private key signature and the transaction amount in the energy transaction record, and after the verification is passed, endorsement is carried out on the energy transaction record;
the preparation phase process is as follows:
each consensus group node sends the energy transaction records after endorsement to other consensus group nodes except the consensus group node;
the consensus group node verifies the received endorsed energy transaction records, and if the number of the received records is more than 2f +1, a consensus result message corresponding to the energy transaction records is generated;
wherein, the consensus result message refers to a confirmation message containing the energy transaction record, and 3f +1 is more than or equal to n.
Preferably, in step ii.5, the determining and storing of the consensus result means that if the number of the consensus result messages collected by the node is greater than n/2, the node determines that the consensus result message is a correct message, and stores the energy transaction record into the local block chain;
in step ii.5, the reputation value list refers to a list of reputation values of all block link points in the corresponding regional energy internet.
The invention has the following advantages:
1. the method dynamically selects the common identification group node according to the node credit value and the random numerical value, thereby not only reducing the probability of the occurrence of Byzantine nodes in the common identification group node, but also avoiding the problem of excessive centralization of the common identification group node caused by fixing the common identification group node;
2. because the invention adopts the local quantification and the high credit value node (consensus node) to participate in the consensus, the problem of reduced consensus efficiency caused by the increase of the number of the consensus nodes in the PBFT consensus algorithm is effectively avoided;
3. due to autonomous consensus of internal trading of the microgrid, the expandability of the microgrid under the regional energy Internet scene is improved.
4. The invention dynamically selects the consensus nodes, and the multiple groups of consensus nodes can participate in consensus at the same time, thereby effectively relieving the consensus pressure when the fixed consensus nodes are adopted and greatly reducing the possibility of attacking the consensus nodes.
Detailed Description
The invention is described in further detail below with reference to the following figures and detailed description:
examples
As shown in fig. 1, the present embodiment describes a block chain consensus method applied to a local energy internet microgrid.
Before describing the method of the present invention, the regional energy internet structure constructed in the present embodiment will be described. As shown in fig. 2, the regional energy internet in this embodiment is constructed by a plurality of independent micro grids.
Each micro-grid internally comprises a plurality of energy power generation and power sale access main bodies and power sale nodes corresponding to the energy power generation and power sale access main bodies one by one, and a plurality of energy power purchase access main bodies and power purchase nodes corresponding to the energy power generation and power sale access main bodies one by one.
For convenience of explanation of the present embodiment, it is assumed that the regional energy internet is composed of four micro grids, namely, a micro grid 1, a micro grid 2, a micro grid 3, and a micro grid 4, as shown in fig. 2.
The structures of the micro-grids are independent from each other, and the micro-grid 1 is taken as an example to explain the composition structure of each micro-grid.
In the microgrid 1, an energy power generation and power selling access main body comprises wind power generation equipment and solar photovoltaic power generation equipment, wherein block chain link points corresponding to the wind power generation equipment and the solar photovoltaic power generation equipment are power selling nodes; the electricity purchasing access main body comprises an office building and a residential villa, wherein the block link points corresponding to the office building and the residential villa are electricity purchasing nodes.
Each block chain node is equal in status and can perform trusted communication, each block chain node has a credit value attribute, and the credit value is adjusted according to endorsement results of the nodes participating in the consensus process through intelligent contracts.
For example, if the microgrid 4 is a newly added microgrid, the reputation values of the block chain nodes corresponding to each access subject in the microgrid 4 are all initial values of 100, and the nodes are in equal and reliable communication with all nodes in the regional energy internet.
The reputation value refers to the integrity degree obtained according to the history data of the participation consensus of the nodes.
After the consensus is finished each time, updating the credit value according to the endorsement result of the node through the intelligent contract, namely if the node endorsement result is consistent with the final result, the credit value is +1, otherwise, the credit value is-10.
The initial value of the credit value of each newly added block link point is 100, and the credit value does not increase after reaching 100.
In the embodiment, the energy transaction scene comprises a microgrid internal transaction scene and an external transaction scene, and the microgrid internal transaction is commonly known by nodes inside a microgrid; the microgrid external transaction is completed by a plurality of microgrid internal nodes participating in the transaction.
Aiming at different energy transaction scenes, the block chain consensus method applied to the regional energy Internet microgrid in the embodiment of the invention comprises a microgrid internal transaction consensus method and a microgrid external transaction consensus method.
The consensus methods in the above two energy trading scenarios are described below.
Taking the microgrid 1 as an example, if the energy transaction is a transaction in a single microgrid, the consensus process is shown in fig. 3, and a block chain consensus method applied to the internal transaction of the microgrid in the regional energy internet comprises the following steps:
I.1. dynamically selecting n nodes from the interior of the microgrid 1 as nodes of a consensus group, wherein the selection process is as follows:
I.1.1. and selecting all nodes with the standard credit values except the trading nodes in the microgrid. The node with the qualified reputation value is the node with the reputation value exceeding a set reputation value threshold T0, and T0 is more than or equal to 70 and less than 100.
In the present embodiment, the reputation value threshold T0 may be set to 70.
I.1.2. And distributing a random numerical value X to each selected node with the qualified reputation value by using a random algorithm. The random algorithm in this embodiment may be a random algorithm commonly used in the prior art, and is not limited herein.
Wherein, the value range of the random number X is as follows: x is more than or equal to T0 and less than or equal to 100.
As can be seen from the value range of the random value X, the value range of the random value allocated to each node whose reputation value reaches the standard is equivalent to the reputation value range of the node whose reputation value reaches the standard, which is advantageous in that:
the random value and the reputation value are equivalent in magnitude, and the influence of the random value and the reputation value on the node election of the common consensus group is the same.
I.1.3. And adding the credit value of each selected node with the standard credit value with a random numerical value distributed to the node with the standard credit value, and sequencing the added results according to the sequence from large to small.
I.1.4. And selecting the first n nodes from the added results according to the descending order, and taking the n nodes with the qualified reputation values corresponding to the n results as consensus group nodes participating in the internal trading consensus process of the microgrid.
The method for dynamically selecting the consensus group node based on the reputation value and the random value has the advantages that:
the proportion of the credit value and the random value when the common identification group node is elected is balanced, all the nodes with the standard credit values have the chance of participating in the common identification group node, and the condition that the common identification group node is elected only by the credit value to generate the super node is avoided.
Through the process, the selected n common identification group nodes are all high reputation value nodes, wherein n is a natural number.
Because the embodiment adopts the local quantitative and high-credit-value nodes to participate in the internal transaction consensus of the microgrid, the problem of reduced consensus efficiency caused by the increase of the number of consensus group nodes in the PBET consensus algorithm is effectively solved.
I.2. And the transaction initiating node signs the energy transaction record by the private key and broadcasts the energy transaction record to all the nodes of the common identification group.
The transaction initiation node refers to an electricity purchasing node inside the microgrid where a transaction occurs, for example, if the energy transaction is an internal transaction of the microgrid 1, the electricity purchasing node is an electricity purchasing node inside the microgrid 1.
The energy transaction record specific information is shown in table 1.
TABLE 1 energy transaction records
As can be seen from table 1, the energy transaction record includes a transaction record ID, an electricity purchasing user ID, an electricity selling user ID, an electricity purchasing user private key signature, an electricity selling user private key signature, a transaction unit price, a transaction amount, and a transaction amount.
I.3. And all the consensus group nodes perform Byzantine consensus verification on the energy transaction records.
The Byzantine consensus verification comprises two processes, a pre-preparation phase and a preparation phase, as shown in FIG. 3.
Wherein, the process of the pre-preparation stage is as follows:
the transaction initiation node sends the energy transaction record to the consensus group node, e.g. the consensus group nodes 1, 2, 3 in fig. 3. And the consensus group node verifies the private key signature and the transaction amount in the energy transaction record, and endorses the energy transaction record after the verification is passed.
The preparation phase process is as follows:
and each consensus group node transmits the energy transaction records after endorsement to other consensus group nodes except the consensus group node.
For example, after endorsement of the energy transaction record by the consensus group node 1, the consensus group node sends the endorsement to the consensus group nodes 2 and 3; after the endorsement of the energy transaction record is carried out, the consensus group node 2 sends the endorsement to the consensus group nodes 1 and 3;
similarly, the consensus node 3 sends the endorsement of the energy transaction record to the consensus nodes 1 and 2.
And each consensus group node verifies the received endorsed energy transaction records, and if the number of the received records is more than 2f +1, generates a consensus result message corresponding to the energy transaction records.
Wherein, the consensus result message refers to a confirmation message containing the energy transaction record, wherein 3f +1 is more than or equal to n.
I.4. And each consensus group node broadcasts the consensus result message of the corresponding energy transaction record generated after the Byzantine consensus verification to other nodes except the node in the regional energy Internet.
The other nodes except the local nodes in the regional energy Internet comprise a transaction initiating node, other consensus group nodes, other microgrid internal nodes except the transaction initiating node and the consensus group nodes and microgrid external nodes.
The nodes outside the microgrid refer to all nodes in other microgrids except the microgrid 1.
I.5. And all the nodes in the regional energy Internet judge and store the consensus result according to the received consensus result message, and modify the credit values of all the consensus group nodes in the local credit value list.
The consensus result judgment and storage means that if the number of the consensus result messages collected by the nodes is larger than n/2, the messages are judged to be correct, and the energy transaction records are stored in a local block chain;
the credit value list refers to a list of credit values of all block link points in the corresponding regional energy Internet.
When the regional energy internet internal transaction is carried out, the local quantification and high-credit-value nodes are adopted to participate in consensus, and a small number of nodes participate in the consensus process, so that the consensus efficiency is favorably ensured, and meanwhile, the accuracy of the consensus result is ensured.
In this embodiment, if the energy transaction is an external transaction of the microgrid, for example, a certain electricity purchasing node in the microgrid 1 purchases electric energy of a certain electricity selling node in the microgrid 2, the process of the consensus is shown in fig. 4.
A block chain consensus method applied to regional energy Internet microgrid external transactions comprises the following steps:
II.1, dynamically selecting n nodes from a plurality of micro-grids participating in transaction as a consensus group node, wherein the selection process is as follows:
and II.1.1, averagely distributing the denominations of the n consensus group nodes or relatively averagely distributing the denominations of the n consensus group nodes to each micro-grid participating in the transaction, and then sequentially selecting a corresponding number of consensus group nodes from each micro-grid.
For example, assuming that the number of the consensus group nodes n is 8, and the number of the micro-grids participating in the transaction is two, each micro-grid is allocated with 4 consensus group node denominations; at this time, the common identification group node names are averagely distributed to the two micro-grids.
Assuming that the number of the nodes n of the consensus groups is 9, and two micro-grids participating in the transaction are provided, one micro-grid is allocated with 4 denominations, and the other micro-grid is allocated with 5 denominations; at this time, the denominations of the consensus group nodes are relatively evenly distributed to the two micro-grids.
In the embodiment, the denominations of the n consensus group nodes are distributed averagely or relatively averagely to each microgrid participating in the transaction, so that fairness in the election process is guaranteed.
Setting the number of micro grids participating in transaction as m, and the number of consensus group nodes distributed by the ith micro grid as ni,1≤i≤m。
The process of selecting the consensus group node in the ith microgrid is shown in steps ii.1.2 to ii.1.5 below.
II.1.2, selecting all nodes with the standard credit values inside the ith microgrid except for the trading nodes; the node with the qualified reputation value is the node with the reputation value exceeding a set reputation value threshold T0, and T0 is more than or equal to 70 and less than 100.
The reputation value threshold T0 is set to 70 in this embodiment.
II.1.3, distributing a random numerical value X to each selected node with the qualified reputation value by using a random algorithm; the random algorithm in this embodiment may be a random algorithm commonly used in the prior art, and is not limited herein.
Wherein, the value range of the random number X is as follows: x is more than or equal to T0 and less than or equal to 100.
As can be seen from the value range of the random value X, the value range of the random value allocated to each node whose reputation value reaches the standard is equivalent to the reputation value range of the node whose reputation value reaches the standard, which is advantageous in that:
the random value and the reputation value are equivalent in magnitude, and the influence of the random value and the reputation value on the node election of the common identification group is the same.
And II.1.4, adding the credit value of each selected node with the standard credit value with the random numerical value distributed to the node with the standard credit value, and sequencing the added results in a descending order.
II.1.5. selecting the first n from the summed results in descending orderiWill be in contact with niN corresponding to each resultiAnd taking the node with the qualified reputation value as a consensus group node selected from the inside of the ith microgrid.
And II.1.6, after the internal common-identification group nodes of each microgrid are selected, taking the total n common-identification group nodes selected from all the microgrid participating in the transaction as the common-identification group nodes participating in the external transaction common-identification process of the microgrid.
The method for dynamically selecting the consensus group node based on the reputation value and the random value has the advantages that:
the proportion of the credit value and the random value when the common identification group node is elected is balanced, all the nodes with the standard credit values have the chance of participating in the common identification group node, and the condition that the common identification group node is elected only by the credit value to generate the super node is avoided.
Through the process, the selected n consensus group nodes are all high reputation value nodes.
Because the embodiment adopts the local quantitative and high-credit-value nodes to participate in the internal transaction consensus of the microgrid, the problem of reduced consensus efficiency caused by the increase of the number of consensus group nodes in the PBET consensus algorithm is effectively solved.
And II.2, the transaction initiating node signs the energy transaction record by the private key and broadcasts the energy transaction record to all the nodes of the consensus group.
The transaction initiation node is an electricity purchasing node inside the microgrid participating in energy transaction, for example, if the microgrid 1 purchases electric energy of a certain node in the microgrid 2, the transaction initiation node is the electricity purchasing node in the microgrid 1.
The energy transaction record specific information is shown in table 2.
TABLE 2 energy transaction records
According to the process, the energy transaction record comprises a transaction record ID, an electricity purchasing user ID, an electricity selling user ID, an electricity purchasing user private key signature, an electricity selling user private key signature, a transaction unit price, a transaction amount and a transaction amount.
And II.3, carrying out Byzantine consensus verification on all the consensus group nodes aiming at the energy transaction records.
The Byzantine consensus verification comprises two processes, a pre-preparation phase and a preparation phase, as shown in FIG. 4.
Wherein, the process of the pre-preparation stage is as follows:
the transaction initiating node sends the energy transaction record to the consensus group nodes, such as the consensus group nodes 1, 2, and 3 in fig. 4, and the consensus group nodes verify the private key signature and the transaction amount in the energy transaction record, and endorse the energy transaction record after the verification is passed.
The preparation phase process is as follows:
and each consensus group node transmits the energy transaction records after endorsement to other consensus group nodes except the consensus group node.
For example, after endorsement of the energy transaction record by the consensus group node 1, the consensus group node sends the endorsement to the consensus group nodes 2 and 3; after the endorsement of the energy transaction record is carried out, the consensus group node 2 sends the endorsement to the consensus group nodes 1 and 3;
similarly, the consensus node 3 sends the endorsement of the energy transaction record to the consensus nodes 1 and 2.
The consensus group node verifies the received endorsed energy transaction record; if the number of the received records is more than 2f +1, generating a consensus result message corresponding to the energy transaction record;
wherein, the consensus result message refers to a confirmation message containing the energy transaction record, wherein 3f +1 is more than or equal to n.
And II.4, each consensus group node broadcasts the consensus result message of the corresponding energy transaction record generated after the Byzantine consensus verification to other nodes except the node in the regional energy Internet.
The other nodes except the local nodes in the regional energy Internet comprise a transaction initiating node, other consensus group nodes, other nodes except the transaction initiating node and the consensus group nodes in each micro-grid participating in transaction and micro-grid external nodes.
In the present embodiment, the other nodes except the transaction initiation node and the consensus group node in each microgrid participating in the transaction refer to, for example, other nodes except the transaction initiation node and the consensus group node in the microgrid 1 and the microgrid 2.
The nodes outside the microgrid refer to nodes inside the microgrid except for the microgrid 1 and the microgrid 2.
And II.5, all the nodes in the regional energy Internet judge and store the consensus result according to the received consensus result message, and modify the credit values of all the consensus group nodes in the local credit value list.
The consensus result judgment and storage means that if the number of the consensus result messages collected by the nodes is larger than n/2, the messages are judged to be correct, and the energy transaction records are stored in a local block chain;
the credit value list refers to a list of credit values of all block link points in the corresponding regional energy Internet.
When the regional energy Internet is transacted externally, the embodiment also adopts the local quantification and high-credit-value nodes to participate in consensus, and because a small number of nodes participate in the consensus process, the consensus efficiency is favorably ensured, and meanwhile, the accuracy of the consensus result is ensured.
Because the embodiment of the invention dynamically selects the consensus node and the multiple groups of consensus nodes can participate in consensus at the same time, the consensus pressure when the fixed consensus node is adopted is effectively relieved.
Wherein, the above mentioned multiple groups of consensus group nodes can participate in consensus concurrently, specifically: in the whole regional energy Internet at the same time, a plurality of groups of consensus nodes perform concurrent consensus on a plurality of energy transactions.
In addition, each group of the consensus group nodes only aim at a specific energy transaction, and the selection of each group of the consensus group nodes is random and not invariable, so that the possibility of attacking the consensus group nodes is greatly reduced.
Under the condition that the number of nodes is continuously increased, the consensus efficiency under a decentralized scene is ensured, the accuracy of the consensus result is ensured, and meanwhile, the expandability of the consensus mechanism also ensures the convenience of adding and quitting of the microgrid.
It should be understood, however, that the description herein of specific embodiments is not intended to limit the invention to the particular forms disclosed, but on the contrary, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the invention as defined by the appended claims.