A blockchain reliability proof consensus method, system, device and medium
By evaluating and grouping performance of sub-station nodes and executing consensus consensus in combination with consensus node types, the problems of poor node tolerance and high complexity of consensus mechanism in the existing technology are solved, and the efficiency and security of the blockchain consensus process are improved.
Patent Information
- Application Number
- CN202411586174.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-11-08
AI Technical Summary
In the prior art, nodes have poor fault tolerance, high consensus mechanism complexity, and critical nodes are highly destructive to the system after being hijacked, resulting in low efficiency and insufficient security of consensus methods for proof of blockchain reliability.
By evaluating performance and optimizing grouping of sub-station nodes based on blockchain network structure information, forming a packet information matrix, calculating initial reliability, and performing consensus generation blocks through consensus node types, and broadcast verification is performed to complete protection fixed-value data storage.
It improves the efficiency of the blockchain consensus process, enhances the stability of block generation, avoids the concentration of block generation nodes, increases the degree of decentralization of the system, and ensures the reliability and security of fixed-value information when issuing and executing remotely.
Smart Images

Figure CN119203242B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of power technology and blockchain consensus technology, and in particular to a blockchain reliability proof consensus method, system, device and medium. Background Art
[0002] In recent years, with the expansion of the power grid and the massive access to new energy sources, the system operation mode has changed frequently. In order to make the protection meet the needs of new scenarios, the relay protection setting values also need to be frequently changed. The traditional relay protection setting value setting adopts the method of "setting value sheet combined with manual setting". In the face of the above situation, its inefficiency and cumbersomeness are particularly prominent.
[0003] How to achieve rapid setting of protection settings through remote operation of protection settings, thereby improving the adaptability of protection to the operation mode of the power system, has become the focus of research.
[0004] The key nodes in the remote operation process are the relay protection system master station at the dispatching end, the substation and protection device in the substation. Ensuring the safe transmission of the set value between the control center and the substation is the key to remote operation. The traditional remote operation mode is a centralized solution. Once the key node fails, the set value cannot be correctly issued, resulting in serious consequences. The characteristics of blockchain decentralization, traceability, and tamper-proof meet the requirements of remote operation for information security.
[0005] The role of the consensus mechanism is to ensure the consistency of data stored in each node in a decentralized system. The Proof of Work (PoW) mechanism ensures the normal operation of the distributed network by relying on the computing power of each node. Nodes compete for the right to generate blocks and obtain rewards by constantly adjusting the value of random numbers. Although the PoW consensus algorithm is relatively safe, its shortcomings are also obvious: it consumes a lot of power resources and is inefficient, and nodes that control 51% of the computing power of the entire network may forge data. Compared with the Proof of Work mechanism, the Proof of Stake (PoS) mechanism relies on node rights to determine the probability of node generating blocks, which increases the efficiency of consensus and reduces energy consumption. The problem with the Proof of Stake mechanism is that it is easy to form equity accumulation and polarization.
[0006] Therefore, how to provide a blockchain reliability proof consensus method, system, device and medium is a problem that needs to be solved urgently. Summary of the invention
[0007] The embodiments of the present invention provide a blockchain reliability proof consensus method, system, device and medium to solve the problems in the prior art of poor node fault tolerance, high complexity of the consensus mechanism, and great destructiveness to the system after the key nodes are hijacked.
[0008] In order to have a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not a general review, nor is it intended to identify key / important components or to describe the scope of protection of these embodiments. Its only purpose is to present some concepts in a simple form as a prelude to the detailed description that follows.
[0009] According to a first aspect of an embodiment of the present invention, a blockchain reliability proof consensus method is provided.
[0010] In one embodiment, the blockchain reliability proof consensus method includes:
[0011] Based on the pre-acquired blockchain network structure information, the substation nodes are evaluated for performance and optimally grouped in turn to form a grouping information matrix of the substation nodes;
[0012] Calculate the initial reliability of the substation node in the blockchain network, and broadcast the predefined protection setting data to each substation node for temporary storage;
[0013] Determine the node type of each substation based on the group information matrix, generate blocks after consensus is performed based on the node type of each substation, and broadcast and verify the blocks, and complete the protection of fixed value data storage based on the block verification results;
[0014] After the consensus is completed, the initial reliability of the substation node in the blockchain network is updated to obtain the new reliability, and a new block is generated based on the new reliability to update the blockchain network.
[0015] In one embodiment, the substation nodes are sequentially evaluated for performance and optimally grouped based on the pre-acquired blockchain network structure information to form a grouping information matrix of the substation nodes, including:
[0016] Determine the substation node type, the substation node type includes consensus node, verification storage node and supervision node;
[0017] Set the node score matrix and weight matrix of the substation node under different performance indicators, and calculate the score vector of the substation node under each performance indicator;
[0018] The optimization objective function is calculated and solved to obtain the optimal grouping result of the substation nodes, which is added to the block header;
[0019] Form a grouping information matrix of substation nodes.
[0020] In one embodiment, the setting of the node score matrix and the weight matrix of the substation node under different performance indicators of the performance indicator evaluation and the calculation of the score vector of the substation node under each performance indicator includes:
[0021] Obtain the node index score of the substation node under the predefined performance index, and set the upper and lower boundaries of the node index score to highlight the gap between the substation node in the high score interval and the low score interval;
[0022] According to the relationship between the performance index and the corresponding node index score, the performance index is divided into positive index and negative index, and the score function of the substation node under different index types is set;
[0023] Based on the score function, the score matrix of the substation node under different performance indicators is obtained, and weights are assigned to different indicator types to obtain a weight matrix;
[0024] The score matrix is combined with the weight matrix to calculate the score vector of the substation node under each performance indicator.
[0025] In one embodiment, the initial reliability of the computing substation node in the blockchain network includes:
[0026] The weighted adjacency matrix is used to establish a blockchain network topology model, and the average distance between any two groups of substation nodes in the blockchain network is calculated through the blockchain network topology model;
[0027] The network cohesion of the blockchain network is analyzed based on the average distance between any two groups of substation nodes, and the node shrinkage technology is used to shrink the substation nodes to obtain the network cohesion after shrinkage;
[0028] The changes in network cohesion before and after contraction are analyzed and the proportion is calculated to obtain the initial reliability of the substation node in the blockchain network.
[0029] In one embodiment, the shrinking of the substation nodes by using the node shrinking technology to obtain the shrunken network cohesion includes:
[0030] Calculate the ratio of the network cohesion before and after the substation node is shrunk and compare the difference with the preset value;
[0031] The changes in network cohesion before and after contraction are analyzed to obtain the initial reliability of the substation nodes, and the reliability ratio of each substation node is calculated based on the initial reliability.
[0032] In one embodiment, the steps of generating a block after consensus is performed in combination with each substation node type and broadcasting and verifying the block, and completing the storage of the protection fixed value data based on the block verification result include:
[0033] The consensus nodes compete for proof of work to generate block headers and broadcast them for verification. Each block header is allocated to each substation node for temporary storage, and the data in the block header shall prevail during the consensus process.
[0034] Compete to package blocks based on the reliability and difficulty value of the corresponding substation node in the block header, and broadcast verification after the block is generated;
[0035] The blocks are verified by verifying the storage nodes, and after the blocks are verified, they are connected to the local blockchain network to complete the protection of fixed-value data storage.
[0036] In one embodiment, the calculation formula of the average distance between the two groups of substation nodes is:
[0037] In the formula, represents the average distance between two groups of substation nodes; Indicates the number of substation nodes; Indicates a substation node and substation nodes The number of edges contained in the minimum distance between them.
[0038] According to a second aspect of an embodiment of the present invention, a blockchain reliability proof consensus system is provided.
[0039] In one embodiment, the blockchain reliability proof consensus system includes:
[0040] A grouping information generation module is used to evaluate the performance and optimally group the substation nodes in turn based on the pre-acquired blockchain network structure information to form a grouping information matrix of the substation nodes;
[0041] The node reliability calculation module is used to calculate the initial reliability of the substation node in the blockchain network and broadcast the predefined protection setting data to each substation node for temporary storage;
[0042] The blockchain network consensus module is used to determine the node type of each substation based on the group information matrix, generate blocks after consensus is performed based on the node type of each substation, broadcast and verify the blocks, and complete the storage of protection fixed value data based on the block verification results;
[0043] The blockchain network update module is used to update the initial reliability of the substation node in the blockchain network to obtain a new reliability after the consensus is completed, and generate a new block based on the new reliability to update the blockchain network.
[0044] In one embodiment, the grouping information generation module includes a substation type determination module, a performance score calculation module, an optimal grouping generation module and a grouping matrix determination module, wherein:
[0045] The substation type determination module is used to determine the substation node type, and the substation node type includes a consensus node, a verification storage node, and a supervision node;
[0046] The performance score calculation module is used to set the node score matrix and weight matrix of the performance index evaluation substation node under different performance indicators, and calculate the score vector of the substation node under each performance indicator;
[0047] The optimal grouping generation module is used to form an optimization objective function and solve the optimal grouping result of the substation nodes, and add it to the block header;
[0048] The grouping matrix determination module is used to form a grouping information matrix of the substation nodes.
[0049] In one embodiment, the performance score calculation module includes a node index scoring module, an index partitioning module, a matrix generation module and a score vector calculation module, wherein:
[0050] The node index scoring module is used to obtain the node index scores of the substation nodes under the predefined performance indicators, and set the upper and lower boundaries of the node index scores to highlight the difference between the substation nodes in the high score interval and the low score interval;
[0051] The indicator classification module is used to classify the performance indicators into positive indicators and negative indicators according to the relationship between the performance indicators and the corresponding node indicator scores, and set the score functions of the substation nodes under different indicator types;
[0052] The matrix generation module is used to obtain a score matrix of the substation node under different performance indicators based on the score function, and to assign weights to different indicator types to obtain a weight matrix;
[0053] The score vector calculation module is used to calculate the score vector of the substation node under each performance indicator by combining the score matrix with the weight matrix.
[0054] In one embodiment, the node reliability calculation module includes an average distance calculation module, a network cohesion analysis module and a reliability generation module, wherein:
[0055] The average distance calculation module is used to calculate the average distance between any two groups of substation nodes in the blockchain network;
[0056] The network cohesion analysis module is used to analyze the network cohesion of the blockchain network based on the average distance between any two groups of substation nodes, and to shrink the substation nodes using the node shrinkage technology to obtain the shrunken network cohesion;
[0057] The reliability generation module is used to analyze the change in network cohesion before and after contraction and perform percentage calculation to obtain the initial reliability of the substation node in the blockchain network.
[0058] In one embodiment, the network cohesion analysis module includes a cohesion comparison module and a reliability ratio calculation module, wherein:
[0059] The cohesion comparison module is used to calculate the ratio of the network cohesion before and after the substation node is shrunk and compare the difference with the preset value;
[0060] The reliability ratio calculation module is used to analyze the change of network cohesion before and after contraction to obtain the initial reliability of the substation node, and calculate the reliability ratio of each substation node based on the initial reliability.
[0061] In one embodiment, the blockchain network consensus module includes a block header generation module, a block generation module and a block verification module, wherein:
[0062] The block header generation module is used to generate block headers through proof-of-work competition by consensus nodes and broadcast verification, and distribute each block header to each substation node for temporary storage, and the data in the block header shall prevail during the consensus process;
[0063] The block generation module is used to compete for packaging blocks according to the reliability and difficulty value of the corresponding substation node in the block header, and perform broadcast verification after the block is generated;
[0064] The block verification module is used to verify the block by verifying the storage node, and after the block verification is completed, the block is connected to the local blockchain network to complete the protection of the fixed value data storage.
[0065] In one embodiment, the calculation formula of the average distance between the two groups of substation nodes is:
[0066] In the formula, represents the average distance between two groups of substation nodes; Indicates the number of substation nodes; Indicates a substation node and substation nodes The number of edges contained in the minimum distance between them.
[0067] According to a third aspect of an embodiment of the present invention, a computer device is provided.
[0068] In one embodiment, the computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0069] According to a fourth aspect of embodiments of the present invention, a computer-readable storage medium is provided.
[0070] In one embodiment, the computer-readable storage medium stores a computer program, and the computer program implements the steps of the above method when executed by a processor.
[0071] The technical solution provided by the embodiment of the present invention may have the following beneficial effects:
[0072] (1) The present invention uses the control center and the substation relay protection system substation as nodes in the blockchain, introduces blockchain technology into the remote operation process of relay protection setting, gives full play to the characteristics of blockchain such as decentralization, tamper-proof, and traceability, and ensures the information security of relay protection setting during remote operation.
[0073] (2) The present invention fully utilizes the node performance through the blockchain node classification and grouping and reliability evaluation mechanism, and influences the consensus process through node reliability, thereby ensuring that legitimate nodes package and generate correct and reliable blocks containing fixed value information, while preventing malicious nodes from tampering with or attacking the fixed value information during the consensus process.
[0074] (3) The present invention reduces the delay of the blockchain consensus process through the consensus mechanism and consensus process of blockchain reliability proof, improves efficiency and increases the stability of block generation. Furthermore, through the consensus mechanism, the probability of honest nodes generating blocks is made more even, avoiding the concentration of "rights and interests" and increasing the degree of decentralization of the system.
[0075] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0077] Figure 1 It is a flowchart of a blockchain reliability proof consensus method according to an exemplary embodiment;
[0078] Figure 2 It is a principle block diagram of a blockchain reliability proof consensus system according to an exemplary embodiment;
[0079] Figure 3 is a structural schematic diagram of a computer device according to an exemplary embodiment;
[0080] Figure 4 It is a schematic diagram of a blockchain data structure suitable for protecting remote operation and storage of fixed values in a blockchain reliability proof consensus method according to an exemplary embodiment;
[0081] Figure 5It is a schematic diagram showing a comparison of block generation by consensus nodes in a blockchain reliability proof consensus method according to an exemplary embodiment;
[0082] Figure 6 It is a schematic diagram showing how the reliability of a substation node changes with the number of consensus rounds in a blockchain reliability proof consensus method according to an exemplary embodiment. DETAILED DESCRIPTION
[0083] As used herein, the term "plurality" means two or more than two, unless otherwise specified.
[0084] In this document, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B means: A or B.
[0085] In this article, the term "and / or" is a description of the association relationship between objects, indicating that three relationships may exist. For example, A and / or B means: A or B, or, A and B.
[0086] It should be understood that, although the various steps in the flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0087] Each module in the device or system of the present application can be implemented in whole or in part by software, hardware, or a combination thereof. The above modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to the above modules.
[0088] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0089] Figure 1 An embodiment of the blockchain reliability proof consensus method of the present invention is shown.
[0090] In this optional embodiment, the blockchain reliability proof consensus method includes:
[0091] Step S101: Based on the pre-acquired blockchain network structure information, the substation nodes are sequentially evaluated for performance and optimally grouped to form a grouping information matrix of the substation nodes;
[0092] Step S103, calculating the initial reliability of the substation node in the blockchain network, and broadcasting the predefined protection setting value data to each substation node for temporary storage;
[0093] Step S105: Determine the node type of each substation based on the grouping information matrix, generate a block after consensus is performed based on the node type of each substation, broadcast and verify the block, and complete the storage of the protection fixed value data based on the block verification result;
[0094] Step S107: After consensus is reached, the initial reliability of the substation node in the blockchain network is updated to obtain a new reliability, and a new block is generated based on the new reliability to update the blockchain network.
[0095] In this optional embodiment, the substation nodes are sequentially evaluated for performance and optimally grouped based on the pre-acquired blockchain network structure information to form a grouping information matrix of the substation nodes, including:
[0096] Determine the substation node type, which includes consensus node, verification storage node and supervision node; set performance indicators to evaluate the node score matrix and weight matrix of the substation node under different performance indicators, and calculate the score vector of the substation node under each performance indicator; form an optimization objective function and solve it to obtain the optimal grouping result of the substation node, and add it to the block header; form a grouping information matrix of the substation node.
[0097] In this optional embodiment, the setting of the node score matrix and the weight matrix of the performance indicator evaluation substation node under different performance indicators, and calculating the score vector of the substation node under each performance indicator includes:
[0098] Obtain the node indicator score of the substation node under the predefined performance indicator, and set the upper and lower boundaries of the node indicator score to highlight the gap between the substation node in the high score interval and the low score interval; divide the performance indicator into positive indicators and negative indicators according to the relationship between the performance indicator and the corresponding node indicator score, and set the score function of the substation node under different indicator types; obtain the score matrix of the substation node under different performance indicators based on the score function, and assign weights to different indicator types to obtain the weight matrix; combine the score matrix with the weight matrix to calculate the score vector of the substation node under each performance indicator.
[0099] In this optional embodiment, the steps of achieving optimal grouping of substation nodes include:
[0100] First, determine the number of nodes under each node type, requiring all nodes to be allocated and each node to belong to only one node type. In order to give full play to the node performance, set corresponding weights for the performance scores, calculate the node scores under different node types, and form an optimization objective function. The objective function is the score of all nodes The sum of takes the maximum value. Solve the corresponding 0-1 integer programming problem to obtain the optimal grouping result of the substation nodes. The optimal grouping result is added to the block header in the form of a matrix for the whole network to obtain in order to execute the subsequent consensus process.
[0101] In this optional embodiment, the initial reliability of the computing substation node in the blockchain network includes:
[0102] The weighted adjacency matrix is used to establish a blockchain network topology model, and the average distance between any two groups of substation nodes in the blockchain network is calculated through the blockchain network topology model; the network cohesion of the blockchain network is analyzed based on the average distance between any two groups of substation nodes, and the node shrinkage technology is used to shrink the substation nodes to obtain the network cohesion after shrinkage; the change of network cohesion before and after shrinkage is analyzed and the proportion is calculated to obtain the initial reliability of the substation nodes in the blockchain network.
[0103] In this optional embodiment, the shrinking of the substation nodes by using the node shrinking technology to obtain the shrunken network cohesion includes:
[0104] The ratio of the network cohesion before and after the substation node is contracted is calculated and compared with the preset value; the change of network cohesion before and after the contraction is analyzed to obtain the initial reliability of the substation node, and the reliability ratio of each substation node is calculated based on the initial reliability.
[0105] In this optional embodiment, the steps of generating a block after consensus is performed in combination with each substation node type and broadcasting and verifying the block, and completing the storage of the protection fixed value data based on the block verification result include:
[0106] The consensus nodes compete for proof of work to generate block headers and broadcast verification, and distribute each block header to each substation node for temporary storage. During the consensus process, the data in the block header shall prevail. The blocks are packaged according to the reliability and difficulty value of the corresponding substation node in the block header, and broadcast verification is performed after the block is generated. The blocks are verified by the verification storage node, and after the block verification is completed, the blocks are connected to the local blockchain network to complete the protection of fixed value data storage.
[0107] In this optional embodiment, the node reliability is calculated The steps include: comprehensively considering the reliability of the substation node in the communication network topology and its contribution to the blockchain network, and proposing a node reliability evaluation that combines the two. The initial reliability is positively correlated with the reliability of the communication network topology. The subsequent reliability changes with the performance of the node in the blockchain network within a grouping cycle based on the initial reliability. The consensus node increases the probability of packaging blocks by improving the node reliability. After the supervisory node updates and calculates the reliability of the substation node, it generates a node reliability matrix and adds it to the block header for the entire network to obtain. The consensus node collects the substation relay protection setting data based on the reliability of the node in the block header, and then competes to package the block.
[0108] In this optional embodiment, the substation nodes are divided into three categories according to the differences in computing power, data storage capacity, network status, etc. of each node. Each type of node (all nodes are substation nodes) plays a different role in maintaining the normal operation of the blockchain network. The substation node types include:
[0109] 1) Consensus node: The consensus node is an important participant in the system (referring to the block network system composed of the control center and the substation nodes of the substation relay protection system), responsible for verifying the fixed value information in the network, competing to generate blocks, verifying blocks, broadcasting blocks to other nodes, etc.
[0110] 2) Verification storage nodes: Verification storage nodes do not participate in block generation, but are responsible for forwarding information in the network, verifying blocks generated by consensus nodes, storing complete fixed-value data of the blockchain for query, etc.
[0111] 3) Supervisory nodes: Supervisory nodes are responsible for supervising the execution process of the consensus and ensuring the stability and fairness of the system. They are mainly responsible for network monitoring, recording node behavior, and updating node reliability.
[0112] The number of nodes of each type can be set according to the system situation, and the number of consensus nodes and verification storage nodes should not be too small.
[0113] The capabilities of nodes are evaluated using hardware performance, storage performance, and network performance, and multiple non-repetitive indicators are set under each performance. When scoring node indicators, the upper and lower boundaries of the score are set. Within the upper and lower boundaries of the score, the scoring function uses a concave function, so that the score gap between multiple nodes is narrowed when the scores are all low, and the score gap is widened when the scores are all high, which is convenient for screening out nodes with strong performance during subsequent node grouping optimization. The hierarchical analysis method is used to set the weights of each indicator under the three performances to obtain the scoring vectors of the nodes under the three performances.
[0114] In this optional embodiment, the node reliability is calculated Includes: Calculate the reliability of substation nodes in the communication network topology , using the weighted adjacency matrix Describe the blockchain substation node network topology model, where the edge weight is the inverse of the link communication capacity. First, calculate the average distance between any two nodes in the network, using the weighted average shortest path length To represent; then calculate the tightness of the entire network, using cohesion To represent, it is related to the number of nodes , weighted average shortest path length Inversely proportional to the reliability to be calculated After the nodes are shrunk, a new network is obtained. The change in the cohesion of the new network is the reliability of the node. , which is also the initial reliability before consensus execution.
[0115] In this optional embodiment, the calculation reliability include:
[0116] Node shrinkage merges the node and all directly connected nodes into a new node. Whether the new node is connected to the remaining nodes depends on the connection relationship between the merged node and the remaining nodes. The corresponding edge weight is expressed by the weighted average of the edge weights of the merged node and the remaining nodes.
[0117] The calculation process of network cohesion is as follows: first calculate the ratio of network cohesion before contraction to network cohesion after contraction, and then subtract the ratio from 1 to ensure node reliability. Take values within a certain range.
[0118] Calculated Then the reliability ratio of each node is calculated, so that the node reliability distribution is in the range of [0, 1]. Updates are performed at intervals of one packet period.
[0119] In this optional embodiment, the computing node reliability Including: computing the reliability of nodes in the blockchain network , mainly judged by its behavior in four aspects, so as to quantify its ability to maintain the normal operation of the blockchain network.
[0120] The four aspects of behavior are: whether the consensus node successfully generates a valid block within a grouping cycle; whether the node successfully verifies the block, and passing a valid block and discarding an invalid block are both considered successful verification of the block; whether the node has malicious behavior, including generating an invalid block, not participating in block verification, and failing to verify a block; whether the node does not participate in generating a block. As the consensus progresses, the probability of nodes that have not generated malicious behavior and blocks packaging blocks continues to increase, improving the degree of decentralization of the system.
[0121] The reliability of nodes that successfully generate blocks and successfully verify blocks Difference, node initial reliability The maximum difference between Quantify the weights of the four node behaviors to eliminate the initial reliability of the nodes Impact on node block generation.
[0122] In this optional embodiment, the blockchain data structure suitable for protecting the remote operation and storage of fixed values includes:
[0123] The block body that stores the relay protection device setting data and the block header of the system's key operating information.
[0124] The relay protection device setting data is stored in the block body in the form of setting files or other forms, which can be regarded as "transactions" to establish a Merkle tree structure. The key setting information of a substation node to be operated remotely is encrypted with the public key of the node. Only with the private key of the node can the data be decrypted to prevent attackers from easily obtaining all key setting information data. The block header contains the basic information of the blockchain and the key information of the system operation. The basic information includes the hash value of the previous block, the block number, the timestamp, the Merkle tree root hash, the random number, and the unified difficulty value of the whole network. .
[0125] Key information of system operation includes: substation node that generates the block header ; The protection device number matrix corresponding to the setting information stored in this block ; Matrix of number of nodes of three types ; After completing the optimal grouping and the matrix Corresponding, the substation number matrix arranged in order ; Node reliability matrix arranged in order The consensus nodes use the information in the block header to compete to complete the block packaging work, verify that the storage nodes fully save the blockchain data, and the supervision nodes update the block header information in a timely manner.
[0126] In this optional embodiment, the consensus process based on reliability proof also includes:
[0127] In the consensus process without executing grouping, the control center only needs to broadcast fixed value information data, matrix , Difficulty value That's it. When other substation nodes broadcast the fixed value information data, the same consensus operation is performed. When performing a fixed value remote operation, the control center broadcasts the number of the fixed value protection device to be modified, and the protection device of the corresponding substation broadcasts the fixed value template file, and the system performs a consensus; the control center fills in the fixed value template file and broadcasts the information, and the system performs a consensus. After completion, the relay protection fixed value data and remote operation records will be stored in the blockchain to prevent data tampering and facilitate query.
[0128] In this optional embodiment, the calculation formula for the average distance between the two groups of substation nodes is:
[0129] In the formula, represents the average distance between two groups of substation nodes; Indicates the number of substation nodes; Indicates a substation node and substation nodes The number of edges contained in the minimum distance between them.
[0130] Figure 2 An embodiment of the blockchain reliability proof consensus system of the present invention is shown.
[0131] In this optional embodiment, the blockchain reliability proof consensus system includes:
[0132] The grouping information generating module 201 is used to sequentially evaluate the performance and optimally group the substation nodes based on the pre-acquired blockchain network structure information to form a grouping information matrix of the substation nodes;
[0133] The node reliability calculation module 203 is used to calculate the initial reliability of the substation node in the blockchain network and broadcast the predefined protection setting value data to each substation node for temporary storage;
[0134] The blockchain network consensus module 205 is used to determine the node type of each substation based on the grouping information matrix, generate blocks after consensus is performed in combination with the node type of each substation, broadcast and verify the blocks, and complete the storage of protection fixed value data based on the block verification results;
[0135] The blockchain network update module 207 is used to update the initial reliability of the substation node in the blockchain network to obtain a new reliability after the consensus is completed, and generate a new block based on the new reliability to update the blockchain network.
[0136] In this optional embodiment, the grouping information generation module includes a substation type determination module, a performance score calculation module, an optimal grouping generation module and a grouping matrix determination module, wherein:
[0137] The substation type determination module is used to determine the substation node type, and the substation node types include consensus nodes, verification storage nodes and supervision nodes; the performance score calculation module is used to set the node score matrix and weight matrix of the performance index evaluation substation node under different performance indicators, and calculate the score vector of the substation node under each performance indicator; the optimal grouping generation module is used to form an optimization objective function and solve to obtain the optimal grouping result of the substation node, and add it to the block header; the grouping matrix determination module is used to form a grouping information matrix of the substation node.
[0138] In this optional embodiment, the performance score calculation module includes a node index scoring module, an index partitioning module, a matrix generation module and a score vector calculation module, wherein:
[0139] The node indicator scoring module is used to obtain the node indicator score of the substation node under the predefined performance indicator, and set the upper and lower boundaries of the node indicator score to highlight the difference between the substation node in the high score interval and the low score interval; the indicator classification module is used to divide the performance indicator into positive indicators and negative indicators according to the relationship between the performance indicator and the corresponding node indicator score, and set the score function of the substation node under different indicator types; the matrix generation module is used to obtain the score matrix of the substation node under different performance indicators based on the score function, and assign weights to different indicator types to obtain a weight matrix; the score vector calculation module is used to calculate the score vector of the substation node under each performance indicator by combining the score matrix with the weight matrix.
[0140] In this optional embodiment, the node reliability calculation module includes an average distance calculation module, a network cohesion analysis module and a reliability generation module, wherein:
[0141] The average distance calculation module is used to calculate the average distance between any two groups of substation nodes in the blockchain network; the network cohesion analysis module is used to analyze the network cohesion of the blockchain network based on the average distance between any two groups of substation nodes, and use the node shrinkage technology to shrink the substation nodes to obtain the network cohesion after shrinkage; the reliability generation module is used to analyze the change of network cohesion before and after shrinkage and perform proportion calculation to obtain the initial reliability of the substation nodes in the blockchain network.
[0142] In this optional embodiment, the network cohesion analysis module includes a cohesion comparison module and a reliability ratio calculation module, wherein:
[0143] The cohesion comparison module is used to calculate the ratio of the network cohesion before and after the substation node is contracted and then compare the difference with the preset value; the reliability ratio calculation module is used to analyze the change of network cohesion before and after the contraction to obtain the initial reliability of the substation node, and calculate the reliability ratio of each substation node based on the initial reliability.
[0144] In this optional embodiment, the blockchain network consensus module includes a block header generation module, a block generation module and a block verification module, wherein:
[0145] The block header generation module is used to generate block headers through proof of work competition by consensus nodes and broadcast verification, and distribute each block header to each substation node for temporary storage, and the data in the block header shall prevail during the consensus process; the block generation module is used to compete for packaging blocks according to the reliability and difficulty value of the corresponding substation node in the block header, and broadcast verification after the block is generated; the block verification module is used to verify the block by verifying the storage node, and after the block verification is completed, the block is connected to the local blockchain network to complete the protection of fixed value data storage.
[0146] In this optional embodiment, the calculation formula for the average distance between the two groups of substation nodes is:
[0147] In the formula, represents the average distance between two groups of substation nodes; Indicates the number of substation nodes; Indicates a substation node and substation nodes The number of edges contained in the minimum distance between them.
[0148] The present invention is further described in detail below in conjunction with specific implementation modes.
[0149] The substation of the substation relay protection system is used as the node of the blockchain. The control center determines the number of substation node types based on the current network structure and node status, and performs performance evaluation and optimal grouping of nodes (nodes are substation nodes) to form a grouping information matrix N and S G , calculate node reliability R (Node reliability R (initial reliability) and then broadcast the protection setting value and other information;
[0150] The nodes confirm their node type according to the grouping situation. The consensus nodes compete for simple proof of work to generate block headers and then determine the reliability of the block headers. R and difficulty value, compete to generate blocks with certain data structures and broadcast them;
[0151] In addition to the supervisory node, other nodes verify the block, the verification storage node connects the block to the local blockchain, and the supervisory node updates the node reliability based on the performance of other nodes. R And recalculate the random number, update the block and broadcast it;
[0152] After updating the blocks, the control center determines whether to regroup and calculate the reliability based on the system operation status, the number of blocks, etc.
[0153] The present invention reduces the delay of the blockchain consensus process, increases the stability of block generation, avoids the concentration of block generation nodes, and increases the degree of decentralization of the system. At the same time, under the proposed consensus mechanism, the probability of malicious nodes generating blocks is greatly reduced, ensuring the reliability and security of fixed value information when it is remotely sent and executed.
[0154] In this optional embodiment, determining the number of substation types and evaluating node performance includes:
[0155] Substation nodes are divided into three categories according to the differences in computing power, data storage capacity, network status, etc. Each type of node plays a different role in maintaining the normal operation of the blockchain network.
[0156] 1) Consensus nodes: Consensus nodes are important participants in the system, responsible for verifying fixed value information in the network, competing to generate blocks, verifying blocks, broadcasting blocks to other nodes, etc. Consensus nodes need to have high hardware performance and information processing capabilities.
[0157] 2) Verification storage nodes: Verification storage nodes do not participate in block generation, but are responsible for information forwarding in the network, verifying blocks generated by consensus nodes, storing complete fixed-value data of the blockchain for query, etc. Verification storage nodes do not require high hardware performance, but need to have strong storage capacity.
[0158] 3) Supervisory nodes: Supervisory nodes are responsible for supervising the execution process of the supervisory consensus and ensuring the stability and fairness of the system. They are mainly responsible for network monitoring, recording node behavior, updating node reliability, etc. Supervisory nodes need to have good network communication performance.
[0159] The number of nodes of each type can be set according to the system situation. The number of consensus nodes and verification storage nodes should not be too small. The ratio of the three can be set to 5:4:1.
[0160] The capabilities of the nodes are evaluated using hardware performance, storage performance, and network performance, and four non-repeated indicators are set under each performance. Finally, the optimal grouping is achieved based on the scores of the three performances of the nodes, so that the node capabilities match the node types. For the evaluation of the substation node capabilities of the substation relay protection system, the selection results of the indicators are shown in Table 1.
[0161] When scoring node indicators, set the upper and lower boundaries of the score. The full score of each indicator is 10 points, and the upper and lower boundaries of each indicator score are shown in Table 1.
[0162] Table 1: Upper and lower bounds of indicator scores
[0163] ,
[0164] In order to highlight the gap between nodes in the high-score interval and the low-score interval, the scoring function adopts a quadratic concave function, which reduces the score gap between multiple nodes when the scores are all low, and widens the score gap when the scores are all high, making it easier to screen out nodes with stronger performance during subsequent node grouping optimization.
[0165] According to indicator data The relationship between the size of the corresponding score is divided into positive indicators and negative indicators, and the scoring function is set under the two indicator types , whose expressions include:
[0166] ;
[0167] ;
[0168] In the formula, , They represent the set boundaries of the performance indicators, Represents the original data of the indicator (i.e., the measured data of the node in various indicators, such as the specific CPU usage, the node computing power, etc.), Indicates the node corresponding score, represents the score function under the positive indicator, Represents the score function under the positive indicator.
[0169] After the performance evaluation of the corresponding indicators of the node is completed, the score matrix of the node under different performance indicators is obtained P H , P S , P N After the scores are determined, the weights of each indicator corresponding to the performance requirements in different aspects should also be determined to obtain the final scores of the three aspects of performance.
[0170] By node score matrix and the weight matrix Compute the scoring vector of the node under three performance conditions Then, according to the performance requirements of different types of nodes, the optimal node grouping is achieved through 0-1 integer programming, where the score vector The expression is:
[0171] ;
[0172] In the formula, represents the rating vector, Respectively represent the scoring matrix of the node under hardware performance, storage performance, and network performance; Respectively represent the weight matrices of nodes under hardware performance, storage performance, and network performance; The matrix is The score matrix of each node under three performances is The matrix of The matrix is the weight of the importance of the four indicators when evaluating each performance of the node. The determination of this matrix needs to be determined using a more objective evaluation method such as the hierarchical analysis method. The weight matrix here is used to calculate the node performance score, which is different from the weight matrix used for the node grouping optimization problem later.
[0173] The indicator weight matrix under three performances is determined by using the indicator weight method such as hierarchical analysis method as shown below:
[0174] ;
[0175] In this optional embodiment, achieving optimal grouping of substation nodes includes:
[0176] The performance of relay protection substation nodes in different substations varies greatly. Allocating them to node types that are appropriate to their capabilities will help give full play to the performance of substation nodes and improve the operating efficiency of the entire system.
[0177] The constraints and objective function of this problem are described as follows: First, determine the number of nodes under each node type, requiring all nodes to be allocated and each node to belong to only one node type. In order to give full play to the node performance, the roles played by the three types of nodes in the blockchain network and the performance requirements are comprehensively considered, and the corresponding weights are set for the performance scores. The node scores under different node types are calculated to form an optimization objective function. The weight matrix expression of the performance score is:
[0178] ;
[0179] Taking the consensus node as an example, the score used to optimize the objective function of the problem is:
[0180] ; In the formula, The objective function is a 0-1 integer optimization. The node grouping when the score is the largest is the optimal grouping corresponding to the highest system operation efficiency. for The scores of the nodes under three performance conditions.
[0181] The objective function is the score of all nodes ZThe sum of takes the maximum value, and its expression is:
[0182] ; The above problem is established into a 0-1 integer programming model:
[0183] ;
[0184] In the formula, is the number of nodes; is the number of node types, and its value is 3, indicating three types of nodes; Represents a collection of nodes. ; Represents a collection of node types. ; Indicates the number of nodes of each type, ; represents decision variables, nodes Classified into type If yes, it is 1, otherwise it is 0. , ; Representation Node No. Performance ratings, , , representing hardware performance, storage performance, and network performance respectively; Indicates Class node The weight of each performance , .
[0185] Solve this 0-1 integer programming problem and get the optimal grouping result of the substation nodes. The grouping result is added to the block header in the form of a matrix for the whole network to obtain in order to execute the subsequent consensus process. Since the performance of the substation nodes of the substation relay protection system is relatively stable and changes little in a short period of time, the grouping cycle is specified, and the grouping operation is performed once every 10 rounds of consensus.
[0186] In this optional embodiment, the node reliability is calculated R include:
[0187] Taking into account the reliability of the substation node in the communication network topology and its contribution to the blockchain network, a node reliability evaluation combining the two is proposed. The initial reliability is positively correlated with the reliability of the communication network topology. The subsequent reliability changes with the performance of the node in the blockchain network within a grouping cycle based on the initial reliability. The consensus node increases the probability of packaging blocks by improving the node reliability, so that more reliable nodes generate blocks and realize the safe storage of fixed value data.
[0188] The expression for defining the reliability of the substation node is:
[0189] ;
[0190] In the formula, and Represents the reliability of the node in two aspects. The determination should be The calculation method is adapted to avoid the node being continuously affected by the initial reliability during the process of generating blocks.
[0191] After the supervisory node updates and calculates the reliability of the substation node, it generates a node reliability matrix and adds it to the block header for the entire network to obtain. The consensus node collects the substation relay protection setting data based on the reliability of the node in the block header, and then competes to package the block according to the following formula, where the difficulty value is Can be adjusted at any time according to the system status:
[0192] ;
[0193] In the formula, It is a hash digest algorithm that converts input information into a 256-bit hash value; is the random number in the block header data, That is, the remaining data information other than the random number in the block header.
[0194] First, the node that generates the block broadcasts it, and other nodes verify it. After passing the verification, the verification storage node connects the new block to the chain. The supervision node promptly updates the node's reliability matrix and updates the block, and this round of consensus is completed.
[0195] In this optional embodiment, the node reliability is calculated include:
[0196] The ability of a substation node to reliably maintain the normal operation of the blockchain network is closely related to its importance in the network topology. , and quantify its impact.
[0197] The blockchain peer-to-peer network is abstracted as a weighted network topology model, using a weighted adjacency matrix W describe:
[0198] ;
[0199] In the formula, Indicates the number of substation nodes, Represents a connected node and The edge weight is 0, which represents the node itself, and greater than 0 represents the edge weight. Infinity represents that the two nodes are not connected. The inverse of the link communication capacity is used as the edge weight.
[0200] The weighted average shortest path length is used to measure the average distance between any two nodes in the network. The calculation formula is:
[0201] ;
[0202] In the formula, represents the average distance between any two nodes in the network. Indicates the number of nodes, Substation Node and substation nodes The number of edges contained in the minimum distance between them.
[0203] The node shrinkage method is used to measure the reliability of nodes in the network. Node shrinkage means merging the node and all directly connected nodes into a new node. Whether the new node is connected to the remaining nodes depends on the connection relationship between the merged node and the remaining nodes. The corresponding edge weight is expressed by the weighted average of the edge weights of the merged node and the remaining nodes.
[0204] Before the nodes are shrunk, the density of the network is measured by cohesion. It is related to the number of nodes and the weighted average shortest path length, where the calculation formula for the density of the network is:
[0205] ;
[0206] After the node is contracted, the compactness of the network will be affected. Therefore, the change of network cohesion before and after contraction is used to measure the reliability of the substation node. After calculating the proportion, we get , reliability of substation nodes The calculation formula is:
[0207] ;
[0208] In the formula, The cohesion is used to express the closeness of the network. represents the average distance between any two nodes in the network. Indicates the number of nodes.
[0209] In this optional embodiment, the node reliability is calculated include:
[0210] The reliability of nodes in the blockchain network is mainly judged by their behaviors in four aspects, so as to quantify their ability to maintain the normal operation of the blockchain network. To ensure that the reliability measurement values of the two aspects are in the range of [0, 1], Calculate the reliability by proportion , reliability of substation nodes The calculation formula is:
[0211] ;
[0212] In the formula, Indicates the number of times a consensus node successfully generates valid blocks within a grouping cycle. It is set to 0 at the end of a grouping cycle to prevent the node from continuously generating blocks. Indicates the number of times the node successfully verifies a block. Passing a valid block and discarding an invalid block are both considered successful block verification. Indicates the number of times the node did not engage in malicious behavior, including generating invalid blocks, not participating in block verification, and failing to verify blocks. It indicates the number of times a node did not participate in generating blocks. As the consensus progresses, the probability of nodes that have not generated malicious behavior and blocks packaging blocks continues to increase, which improves the degree of decentralization of the system.
[0213] Since the substation nodes join the blockchain network anonymously and are less likely to be attacked, the probability of malicious behavior is low. Therefore, the node generation probability can be determined based on the node's performance in the blockchain network. The reliability of nodes that successfully generate blocks and successfully verify blocks is determined by the node's performance in the blockchain network. Difference, node initial reliability The maximum difference of and To reduce the initial reliability of the node The impact on node block generation is expressed as:
[0214] ;
[0215] In the formula, is the number of consensus nodes, are the initial highest and lowest reliability, They are the nodes with the highest and lowest initial reliability, respectively, and the reliability after successfully packaging and verifying the block.
[0216] In determining With each weight After that, you can adjust it as needed The value of , thereby adjusting the node's initial reliability and its performance in the blockchain network to the final reliability The degree of influence of the blockchain can be adjusted to adjust the concentration of the block nodes.
[0217] Blockchain data structures suitable for protecting remote operation and storage of fixed values such as Figure 4 shown.
[0218] The relay protection device setting data is stored in the block body in the form of setting files or other forms, which can be regarded as "transactions" to establish a Merkle tree structure. The key setting information of a substation node to be operated remotely is encrypted with the public key of the node. Only with the private key of the node can the data be decrypted to prevent attackers from easily obtaining all key setting information data. The block header contains the basic information of the blockchain and the key information of the system operation. The basic information includes the hash value of the previous block, the block number, the timestamp, the Merkle tree root hash, the random number, and the unified difficulty value of the whole network. . Key information of system operation includes: the substation node that generates the block header of this block ; The protection device number matrix corresponding to the setting information stored in this block ; Matrix of number of nodes of three types ; After completing the optimal grouping, and the matrix Corresponding, the substation number matrix arranged in order ; Node reliability matrix arranged in order The consensus nodes use the information in the block header to compete to complete the block packaging work, verify that the storage nodes fully save the blockchain data, and the supervision nodes update the block header information in a timely manner.
[0219] The blockchain consensus process based on reliability proof includes:
[0220] (1) The control center determines the number of substation node types based on the current network structure and node status. After node performance evaluation and optimal grouping, a grouping information matrix is formed. and .
[0221] (2) The control center evaluates the reliability of the substation nodes of the substation relay protection system based on the system structure information. Since there is no consensus, the reliability of the node in the blockchain network is 0, so the reliability matrix Contains only .
[0222] (3) The control center will send the relay protection setting data and the above And unified difficulty value After successful verification, each node will temporarily store the information and prepare to execute consensus.
[0223] (4) Nodes confirm their own node types according to the grouping situation. Consensus nodes compete to generate block headers and broadcast verification by performing simple proof of work. This difficulty can be uniformly stipulated to reduce the probability of branch chain generation. After each node obtains the block header, it is temporarily stored, and the subsequent consensus process is based on the data in the block header.
[0224] (5) Consensus nodes compete to package blocks based on the reliability of the node and the difficulty value in the block header. The more reliable the node, the greater the probability of generating a block. After the block is generated, it is broadcast for verification.
[0225] (6) Except for the supervisory node, other nodes verify the block. After the verification storage node successfully verifies the block, it connects the block to the local blockchain to complete the storage of fixed value information.
[0226] (7) After consensus is reached, the supervisory node promptly updates the node reliability matrix based on the performance of other nodes. R , and according to S H The random number is recalculated with the corresponding new reliability to satisfy the competitive packing block formula to generate the updated block. The supervisory node broadcasts the new block to the entire network. After the node verifies successfully, the last block on the chain is updated. B p Set to zero, and the control center will re-group and calculate the reliability.
[0227] (8) In the consensus process without executing grouping, the control center only needs to broadcast fixed value information data and matrix S P , Difficulty value d That's it.
[0228] The blockchain reliability proof consensus method of the present invention is described in detail below with reference to specific embodiments.
[0229] Establish the topological structure of 27 substation nodes in the blockchain network, calculate the index scores of the substation nodes, and then calculate the final scores of each node in three performance aspects to form a matrix .
[0230] The number of node types for substation nodes is divided into 5:4:1 ratio, and the number of nodes of three types is obtained by rounding to an integer, which is 14, 11, and 2 respectively. After the score calculation is completed, the 0-1 integer programming problem of the optimal grouping is solved, and the optimal node grouping is obtained as shown in Table 2.
[0231] Table 2: Optimal node grouping
[0232]
[0233] A 27-node blockchain model system was built to implement the simulation based on the PoRel consensus mechanism. The initial node grouping of the system is shown in Table 2. The program running environment is an i7 seventh-generation processor, 16GB memory, Windows 10 operating system, Python version 3.11.0 64-bit, and the digest algorithm uses the SHA-256 function. Ten rounds of consensus are set within a grouping cycle to verify the proposed method.
[0234] Calculated from the initial reliability of the consensus node Take 70, weight When , the difference influence of initial reliability can be eliminated.
[0235] Since the correct generation of blocks is the most critical link in the remote operation and safe storage of relay protection setting data, the main focus is on the block generation status, behavior and reliability changes of the consensus nodes responsible for competing for block generation.
[0236] By adjusting The value of , thereby changing the impact of initial reliability on node block generation, and then we can observe the impact of the correlation coefficient on the equity concentration of the proposed consensus algorithm, as well as the difference with the PoS algorithm. λ The distribution of nodes producing blocks during the 50-round consensus of the PoS algorithm is as follows: Figure 5 shown.
[0237] Compared with the PoS consensus algorithm, the block generation probability distribution of each node in the PoRel mechanism is relatively uniform. It is not like the PoS mechanism where nodes with greater "equity" pack more blocks more times and show a centralized trend, which verifies the fairness of the proposed mechanism. At this time, the initial reliability of the node and the behavior of the node in the blockchain network have the same influence on the node generating blocks. Therefore, it can be seen that the block generation is centralized to a certain extent at this time, and the nodes that pack blocks more times are all nodes with higher initial reliability.
[0238] As you can see, adjustment The value of can change the impact of initial reliability on block generation. The lower it is, the more the node is affected by the initial reliability and the more concentrated the block generation is; conversely, the more uniform the block generation is, the higher the degree of decentralization is.
[0239] The design of the PoRel consensus mechanism avoids the concentration of "rights and interests", improves the degree of decentralization, and ensures the security of the relay protection setting data chain process, thereby providing security for remote setting operations.
[0240] Take 70, select substation nodes S4, S6, S8, S11, S12, S17, S20, S21, S22, S24, and their reliability changes with the number of consensus rounds as follows Figure 6 As shown in the figure, the arrows represent the substation nodes responsible for packaging blocks in each round of consensus process.
[0241] After a block is successfully generated, the node reliability will decrease. As the consensus continues, the block generation nodes continue to change, avoiding the risk of tampering caused by the continuous generation of blocks by the nodes. Substation nodes S6 and S11 maintained good behavior throughout the consensus process, successfully generating valid blocks and verification blocks, thus gaining more opportunities to package blocks.
[0242] Substation node S12 failed to successfully verify the block in the 2nd and 4th rounds, and substation node S24 failed to successfully verify the block in the 4th and 5th rounds, indicating malicious behavior. Due to the low tolerance for malicious behavior of nodes in the simulation, it can be seen that the reliability of the two nodes has dropped significantly, and has remained at a low level since then. Blocks failed to be packaged during the consensus process. It can be seen that the consensus mechanism can reduce the impact of risk nodes on the system, thereby ensuring the accuracy and reliability of relay protection setting data during remote operation.
[0243] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store static information and dynamic information data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in the above method embodiment are implemented.
[0244] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0245] In addition, the present invention also provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiment when executing the computer program.
[0246] In addition, the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiment are implemented.
[0247] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0248] The present invention is not limited to the structures which have been described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A blockchain reliability proof consensus method, characterized in that: include: Determine the substation node type, the substation node type includes consensus node, verification storage node and supervision node; Set the node score matrix and weight matrix of the substation node under different performance indicators for performance index evaluation, and calculate the score vector of the substation node under each performance indicator; Setting the node score matrix and weight matrix of the substation node under different performance indicators to evaluate the performance indicators, and calculating the score vector of the substation node under each performance indicator includes: Obtain the node index score of the substation node under the predefined performance index, and set the upper and lower boundaries of the node index score to highlight the gap between the substation node in the high score interval and the low score interval; According to the relationship between the performance index and the corresponding node index score, the performance index is divided into positive index and negative index, and the score function of the substation node under different index types is set; The expression of the score function includes: ; ; In the formula, , They represent the set boundaries of the performance indicators respectively; Indicates the original data of the indicator; represents the score function under the positive indicator; Represents the score function under negative indicators; Based on the scoring function, the score matrix of the substation node under different performance indicators is obtained, and weights are assigned to different indicator types to obtain a weight matrix; wherein the score matrix includes the score matrix of the node under hardware performance, storage performance, and network performance, and the weight matrix represents the weight of the importance of the indicator when evaluating each performance of the node, including the weight matrix of the node under hardware performance, storage performance, and network performance; The score matrix is combined with the weight matrix to calculate the score vector of the substation node under each performance indicator; The expression of the score vector is: ; In the formula, represents the rating vector; Respectively represent the scoring matrix of the node under hardware performance, storage performance, and network performance; Respectively represent the weight matrices of nodes under hardware performance, storage performance, and network performance; Form an optimization objective function and solve it to obtain the optimal grouping result of the substation nodes, and add it to the block header; The optimization objective function is formed and solved to obtain the optimal grouping results of substation nodes, including: Determine the number of nodes under each node type, and each node belongs to only one node type; Calculate the node scores under different node types to form the optimization objective function, where the weight matrix expression of the performance score is: ; The performance score-based weight matrix calculation node is used to optimize the score of the objective function of the problem: ; In the formula, represents the objective function of integer optimization; express The scores of the nodes under three performance conditions; Calculate the scores of all nodes and take the maximum value of the sum of all node scores Z as the objective function. The expression is: ; Establish an integer programming model based on the objective function: ; In the formula, Represents a collection of nodes; Represents a collection of node types; Indicates the number of nodes under each type; represents the decision variable; Representation Node No. performance rating; Indicates Class node The weight of each performance; Solve the integer programming model to obtain the optimal grouping result of substation nodes; Forming a grouping information matrix of substation nodes; The forming of the grouping information matrix of the substation nodes includes: according to the number of nodes under each current node type, after node performance evaluation and optimal grouping result generation, corresponding to the node number matrix, forming a grouping information matrix arranged in sequence, and using the grouping information matrix as a substation number matrix; The weighted adjacency matrix is used to establish a blockchain network topology model, and the average distance between any two groups of substation nodes in the blockchain network is calculated through the blockchain network topology model; The calculation formula for the average distance between two groups of substation nodes is: ; In the formula, represents the average distance between two groups of substation nodes; Indicates the number of substation nodes; Indicates a substation node and substation nodes The number of edges contained in the minimum distance between them; The network cohesion of the blockchain network is analyzed based on the average distance between any two groups of substation nodes, and the node shrinkage technology is used to shrink the substation nodes to obtain the network cohesion after shrinkage; Among them, the network cohesion indicates the compactness of the network before the nodes shrink. The calculation formula of the network compactness is: ; In the formula, represents the network cohesion; Represents the average distance between any two nodes in the network; Indicates the number of nodes; After using the node shrinking technology to shrink the substation nodes, the network cohesion after shrinking includes: Calculate the ratio of the network cohesion before and after the substation node is shrunk and compare the difference with the preset value; The changes in network cohesion before and after contraction are analyzed to obtain the initial reliability of the substation nodes, and the reliability ratio of each substation node is calculated based on the initial reliability; Analyze the changes in network cohesion before and after contraction and calculate the proportion to obtain the initial reliability of the substation node in the blockchain network, and broadcast the predefined protection setting data to each substation node for temporary storage; By analyzing the changes in network cohesion before and after contraction and calculating the proportion, the initial reliability of the substation node in the blockchain network is obtained, including: The reliability of the substation nodes is measured by the change in network cohesion before and after contraction After calculating the proportion, we get , where the reliability of the substation node is The calculation formula is: ; In the formula, represents the network cohesion, Indicates the reliability of the substation node; Measuring the reliability of substation nodes And calculate the proportion to get the reliability , where the reliability of the substation node is The calculation formula is: ; In the formula, Indicates the number of times a consensus node successfully generates valid blocks within a grouping cycle; Indicates the number of times the node successfully verifies the block; Indicates the number of times the node did not exhibit malicious behavior; Indicates the number of times the node did not participate in generating blocks; Represents the weight value; Determine the node type of each substation based on the group information matrix, generate block headers through proof-of-work competition by consensus nodes and broadcast verification, and distribute each block header to each substation node for temporary storage. During the consensus process, the data in the block header shall prevail. Compete to package blocks based on the reliability and difficulty value of the corresponding substation node in the block header, and broadcast verification after the block is generated; Verify the block by verifying the storage node, and after the block verification is completed, connect the block to the local blockchain network to complete the protection of fixed value data storage; After consensus is reached, the initial reliability of the substation node in the blockchain network is updated to obtain a new reliability, and a new block is generated based on the new reliability to update the blockchain network; After consensus is reached, the initial reliability of the substation node in the blockchain network is updated to obtain a new reliability, and a new block is generated based on the new reliability to update the blockchain network, including: The supervisory node updates the node reliability matrix according to the performance of other nodes, and recalculates the random number according to the substation node of the block header and the corresponding new reliability, so that it satisfies the competitive packaging block formula to generate an updated block, and updates the blockchain network according to the generated new block.
2. A blockchain reliability proof consensus system, used to implement the blockchain reliability proof consensus method in claim 1, characterized in that: include: A grouping information generation module is used to evaluate the performance and optimally group the substation nodes in turn based on the pre-acquired blockchain network structure information to form a grouping information matrix of the substation nodes; The node reliability calculation module is used to calculate the initial reliability of the substation node in the blockchain network and broadcast the predefined protection setting data to each substation node for temporary storage; The blockchain network consensus module is used to determine the node type of each substation based on the group information matrix, generate blocks after consensus is performed based on the node type of each substation, broadcast and verify the blocks, and complete the storage of protection fixed value data based on the block verification results; The blockchain network update module is used to update the initial reliability of the substation node in the blockchain network to obtain a new reliability after the consensus is completed, and generate a new block based on the new reliability to update the blockchain network.
3. The blockchain reliability proof consensus system according to claim 2 is characterized in that: The grouping information generation module includes a substation type determination module, a performance score calculation module, an optimal grouping generation module and a grouping matrix determination module, wherein: The substation type determination module is used to determine the substation node type, and the substation node type includes a consensus node, a verification storage node, and a supervision node; The performance score calculation module is used to set the node score matrix and weight matrix of the performance index evaluation substation node under different performance indicators, and calculate the score vector of the substation node under each performance indicator; The optimal grouping generation module is used to form an optimization objective function and solve the optimal grouping result of the substation nodes, and add it to the block header; The grouping matrix determination module is used to form a grouping information matrix of the substation nodes.
4. The blockchain reliability proof consensus system according to claim 3 is characterized in that: The performance score calculation module includes a node index scoring module, an index division module, a matrix generation module and a score vector calculation module, wherein: The node index scoring module is used to obtain the node index scores of the substation nodes under the predefined performance indicators, and set the upper and lower boundaries of the node index scores to highlight the difference between the substation nodes in the high score interval and the low score interval; The indicator classification module is used to classify the performance indicators into positive indicators and negative indicators according to the relationship between the performance indicators and the corresponding node indicator scores, and set the score functions of the substation nodes under different indicator types; The matrix generation module is used to obtain a score matrix of the substation node under different performance indicators based on the score function, and to assign weights to different indicator types to obtain a weight matrix; The score vector calculation module is used to calculate the score vector of the substation node under each performance indicator by combining the score matrix with the weight matrix.
5. The blockchain reliability proof consensus system according to claim 4 is characterized in that: The node reliability calculation module includes an average distance calculation module, a network cohesion analysis module and a reliability generation module, wherein: The average distance calculation module is used to calculate the average distance between any two groups of substation nodes in the blockchain network; The network cohesion analysis module is used to analyze the network cohesion of the blockchain network based on the average distance between any two groups of substation nodes, and to shrink the substation nodes using the node shrinkage technology to obtain the shrunken network cohesion; The reliability generation module is used to analyze the change in network cohesion before and after contraction and perform percentage calculation to obtain the initial reliability of the substation node in the blockchain network.
6. The blockchain reliability proof consensus system according to claim 5, characterized in that: The network cohesion analysis module includes a cohesion comparison module and a reliability ratio calculation module, wherein: The cohesion comparison module is used to calculate the ratio of the network cohesion before and after the substation node is shrunk and compare the difference with the preset value; The reliability ratio calculation module is used to analyze the change of network cohesion before and after contraction to obtain the initial reliability of the substation node, and calculate the reliability ratio of each substation node based on the initial reliability.
7. The blockchain reliability proof consensus system according to claim 6, characterized in that: The blockchain network consensus module includes a block header generation module, a block generation module and a block verification module, wherein: The block header generation module is used to generate block headers through proof-of-work competition by consensus nodes and broadcast verification, and distribute each block header to each substation node for temporary storage, and the data in the block header shall prevail during the consensus process; The block generation module is used to compete for packaging blocks according to the reliability and difficulty value of the corresponding substation node in the block header, and perform broadcast verification after the block is generated; The block verification module is used to verify the block by verifying the storage node, and after the block verification is completed, the block is connected to the local blockchain network to complete the protection of the fixed value data storage.
8. The blockchain reliability proof consensus system according to claim 7, characterized in that: The calculation formula of the average distance between the two groups of substation nodes is: ; In the formula, represents the average distance between two groups of substation nodes; Indicates the number of substation nodes; Indicates a substation node and substation nodes The number of edges contained in the minimum distance between them.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to claim 1 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to claim 1 are implemented.
Citation Information
Patent Citations
Element security proof method, device, apparatus and medium based on block chain
CN108985100A
Block chain consensus method, related device and system
CN110298657A