Disclosure of Invention
In order to solve the problems in the prior art, the embodiment of the invention provides a block link point cluster building method and a block link point cluster building device. The technical scheme is as follows:
in one aspect, a block link point cluster building method is provided, and the method includes: building a plurality of node clusters in a block chain network; setting a verification node cluster used for verifying data information in the plurality of node clusters; and setting an internal verification rule of the verification node cluster.
Preferably, building a plurality of node clusters in the blockchain network includes: and building a plurality of node clusters in the block chain network according to preset building classification rules, wherein the preset building classification rules at least comprise rules for node classification building according to regions, industries, roles or interest body categories.
Preferably, the rule for performing node classification building according to the interest body category includes: and respectively building nodes belonging to the same interest body category in different node clusters.
Preferably, building a plurality of node clusters in the blockchain network includes: deploying the nodes; carrying out cluster grouping on the nodes; maintaining synchronous information of all nodes; and selecting a middleware gateway route and providing an external interface.
Preferably, building a plurality of node clusters in the blockchain network includes: and classifying the existing nodes in the block chain network, and building a plurality of node clusters.
Preferably, the setting of a verification node cluster for verifying data information in the plurality of node clusters includes: and determining part of the node clusters which meet the screening conditions of the preset screening rules as the verification node clusters for verifying the data information according to the verification trust or the verification confidence of the node clusters and the preset screening rules.
Preferably, the setting of a verification node cluster for verifying data information in the plurality of node clusters further includes: and calculating the verification trust degrees or the verification confidence degrees of the plurality of node clusters by using a preset rule.
Preferably, the setting of the internal verification rule of the verification node cluster includes: determining a verification node quantity percentage condition for the cluster of verification nodes.
Preferably, the method further includes a step of adding a new node into the node cluster, and specifically includes: acquiring a source code of a chain; compiling the source code into binary code; configuring a P2P network through seeds parameters; selecting a node cluster to be added; finding an existing node of the node cluster; signing through an existing node private key and an added node public key; and upgrading the node into a node with verification authority through the authorization interface.
In another aspect, there is provided a block link point cluster building apparatus, the apparatus comprising:
the building module is used for building a plurality of node clusters in the block chain network; the first setting module is used for setting a verification node cluster used for verifying data information in the plurality of node clusters; and the second setting module is used for setting the internal verification rule of the verification node cluster.
Preferably, the building module is configured to: and building a plurality of node clusters in the block chain network according to preset building classification rules, wherein the preset building classification rules at least comprise rules for node classification building according to regions, industries, roles or interest body categories.
Preferably, the rule for performing node classification building according to the interest body category includes: and respectively building nodes belonging to the same interest body category in different node clusters.
Preferably, the building module is configured to: deploying the nodes; carrying out cluster grouping on the nodes; maintaining synchronous information of all nodes; and selecting a middleware gateway route and providing an external interface.
Preferably, the building module is configured to: and classifying the existing nodes in the block chain network, and building a plurality of node clusters.
Preferably, the first setting module is configured to: and determining part of the node clusters which meet the screening conditions of the preset screening rules as the verification node clusters for verifying the data information according to the verification trust or the verification confidence of the node clusters and the preset screening rules.
Preferably, the first setting module is further configured to: and calculating the verification trust degrees or the verification confidence degrees of the plurality of node clusters by using a preset rule.
Preferably, the second setting module is configured to: determining a verification node quantity percentage condition for the cluster of verification nodes.
Preferably, the building module is further configured to: acquiring a source code of a chain; compiling the source code into binary code; configuring a P2P network through seeds parameters; selecting a node cluster to be added; finding an existing node of the node cluster; signing through an existing node private key and an added node public key; and upgrading the node into a node with verification authority through the authorization interface.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
by the mode of building a plurality of node clusters from a plurality of nodes of a block chain, and setting the verification node clusters used for verifying data information and the internal verification rules of the verification node clusters, when node verification is carried out, proper or representative nodes and node clusters formed by the nodes are selected for verification without whole network verification, even if the number of nodes in the block chain network is continuously increased, the performance of the block chain network is improved under the condition of ensuring the relatively reliable and robust block chain network, and therefore, the block chain link point cluster building method has a good application prospect.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
According to the block chain link point cluster building method and device provided by the embodiment of the invention, a plurality of node clusters are built in a plurality of nodes of a block chain, and a verification node cluster for verifying data information and an internal verification rule of the verification node cluster are set, so that when node verification is carried out, a proper or representative node and a node cluster formed by the nodes are selected for verification without whole network verification, and even if the number of nodes in the block chain network is increased continuously, the performance of the block chain network is improved under the condition that the block chain network is relatively reliable and robust, therefore, the block chain link point cluster building method has a good application prospect and can be applied to various related fields relating to block chain network construction.
The following describes the block link point cluster building method and apparatus provided by the embodiments of the present invention in detail with reference to specific embodiments.
Example 1
Fig. 1 is a flowchart of a block link point cluster building method provided in embodiment 1 of the present invention. As shown in fig. 1, the block link point cluster building method provided by the embodiment of the present invention includes the following steps:
101. and building a plurality of node clusters in the block chain network.
Specifically, a plurality of node clusters are built in the block chain network according to preset building classification rules, wherein the preset building classification rules at least comprise rules for node classification building according to regions, industries, roles or interest body categories. The set classification rule can be customized, and the node number range of the node cluster can also be customized, for example, 20-30 nodes can be determined to form a cluster, and when the set node number exceeds a certain number range, the exceeding part is added into a new node cluster, so that the high performance of the network is continuously and effectively maintained. Preferably, the preset building classification rule is a rule for node classification building according to the interest body category, and specifically, nodes belonging to the same interest body category are built in different node clusters respectively. Because the node cluster is composed of different benefits bodies, the nodes can be effectively prevented from being controlled by the unified benefits bodies, the nodes are added into the node cluster which is composed of a plurality of small nodes and has no good common benefit, for example, a land node, a music node, a red wine node and a real estate node are suggested, the nodes which have little relevance and are difficult to generate common benefits can be placed in the same node cluster, otherwise, the nodes are selected to be placed in different node clusters, and the benefit-consistent group can be effectively prevented from negotiating and being verified.
In addition, the node cluster building process relates to two application scenes, and specific implementation modes are different under different application scenes.
1. In the case that the blockchain network is not built, the implementation process is as follows:
1) deploying the nodes according to the achieved rule, specifically comprising: acquiring a chain source code; compiling the source code into binary code; configuring a P2P network through seeds parameters; after the node deployment is finished, adding the node into a link network;
2) carrying out cluster grouping on the nodes according to a preset built classification rule, wherein a plurality of nodes can form a node cluster, which is equivalent to the nodes forming a group;
3) and all nodes maintain synchronous information, select a middleware gateway route and provide an external interface.
2. In the case that the blockchain network already exists, the implementation process of node cluster building is as follows:
and classifying the existing nodes in the block chain network, and building a plurality of node clusters. The existing node classification setting principle can be classified according to the preset classification rules to form a plurality of node clusters.
102. And setting a verification node cluster used for verifying the data information in the plurality of node clusters.
Specifically, according to the verification trust degrees or the verification confidence degrees of the plurality of node clusters and according to a preset screening rule, determining a part of the node clusters which meet the screening condition of the preset screening rule as verification node clusters for verifying the data information. Preferably, the step comprises: and calculating the verification trust degrees or the verification confidence degrees of the plurality of node clusters by using a preset rule.
The purpose of forming the node clusters by the plurality of nodes in the block chain network is to select part of the node clusters to verify, and other node clusters can be free from verification, so that the whole block chain network does not need full-network verification, the node verification efficiency can be improved under the condition that the block chain network is relatively safe and reliable by the operation, and the overall performance of the block chain network is improved.
In order to achieve the above purpose, in a blockchain network, a verification node cluster for verifying data information needs to be determined, where the verification confidence or the verification confidence of the node cluster refers to a self-defined selectable verification confidence value of a constructed node cluster, or a verification confidence value of the confidence value generated through statistics, and after the parameter value is determined, a part of node clusters meeting a preset screening rule screening condition is screened according to a preset screening rule and determined as the verification node cluster for verifying data information. The preset filtering condition may be to filter the verification confidence level or the optimal value of the verification confidence level, or to satisfy a certain predetermined range. For example, in a plurality of node clusters including nodes with relatively representative nodes or low common interest group concentration rate, the node clusters are selected to determine a verification node cluster when node cluster screening is performed according to a defined rule with high verification trust or verification confidence.
Through the operation, the block chain network is relatively reliable even if partial verification is carried out, and the efficiency of verifying the block chain network nodes is improved most importantly. For example, the efficiency of verifying the nodes of the whole network is slow, the verification time is long, and the verification of selecting a part of nodes is fast, for example, the efficiency agreed by all 100 nodes is certainly slower than the efficiency agreed by all 20 nodes, the consensus rules of node verification (the verification trust or the verification confidence of a node cluster can be determined according to the consensus rules of multiple nodes) can be set by user, the default whole network verification of all node verification of cluster nodes can be set, the default whole network approval verification of cluster node percentage node verification can be set, and meanwhile, the default whole network approval verification of several node cluster verification defaults can also be set. The verification of the blockchain nodes is that the more verification nodes are, the safer and the more democratic, but the slower the efficiency is.
An application example for implementing the verification node cluster setting process is as follows:
assuming that there are 5 multi-node clusters A, B, C, D, E in the blockchain network, a middleware a is developed to provide an API interface externally, which serves as a gateway and a link route, for determining which cluster the information data is verified in when submitted to the blockchain network, and the specific implementation process is as follows:
1) identifying the information X needing verification (such as marking that the cluster B needs verification);
2) the middleware a (namely gateway link route) carries out judgment;
3) the middleware a identifies that the information X needs B verification through the mark;
4) middleware a assigns information X to B for verification;
5) verifying the cluster B;
6) after the verification of the cluster B is completed, other clusters CDE synchronize the data of the cluster B;
7) other clusters verify the same.
103. And setting an internal verification rule of the verification node cluster.
Specifically, the verification node number percentage condition of the verification node cluster is determined, so that when the verification node cluster performs verification, verification is performed according to the verification node number percentage condition.
The percentage condition of the number of verification nodes herein may be defined and set according to an actual situation, for example, may be 50% or 100%, or other percentages, and after the percentage condition is determined, the internal verification rule of the verification node cluster is set as: the percentage number of the nodes in the verification node cluster are selected for verification, and because the sizes of the verification authorities are basically the same according to the nodes in the node cluster which is built according to the preset built classification rule (for example, the nodes with different benefit bodies are distributed in one node cluster), when the internal verification rule of the verification node cluster is set, only the percentage of the number of the verification nodes needs to be determined, and the nodes in the node cluster can be randomly selected according to the percentage of the number. Of course, in other cases, other conditions besides the percentage of the verification quantity may be set for the internal node verification rule of the node cluster, and the rule of which node is selected proportionally may also be set, which is not limited in the embodiment of the present invention.
Example 2
Fig. 2 is a flowchart of a block link point cluster building method provided in embodiment 2 of the present invention. As shown in fig. 2, the block link point cluster building method provided by the embodiment of the present invention includes the following steps:
201. deploying the nodes; carrying out cluster grouping on the nodes; maintaining synchronous information of all nodes; and selecting a middleware gateway route and providing an external interface.
1) Deploying the nodes according to the achieved rule, specifically comprising: acquiring a chain source code; compiling the source code into binary code; configuring a P2P network through seeds parameters; after the node deployment is finished, adding the node into a link network;
2) carrying out cluster grouping on the nodes according to a preset built classification rule, wherein a plurality of nodes can form a node cluster, which is equivalent to the nodes forming a group;
3) and all nodes maintain synchronous information, select a middleware gateway route and provide an external interface.
202. And determining part of the node clusters which meet the screening conditions of the preset screening rules as the verification node clusters for verifying the data information according to the verification trust or the verification confidence of the node clusters and the preset screening rules.
The purpose of forming the node clusters by the plurality of nodes in the block chain network is to select part of the node clusters to verify, and other node clusters can be free from verification, so that the whole block chain network does not need full-network verification, the node verification efficiency can be improved under the condition that the block chain network is relatively safe and reliable by the operation, and the overall performance of the block chain network is improved.
In order to achieve the above purpose, in a blockchain network, a verification node cluster for verifying data information needs to be determined, where the verification confidence or the verification confidence of the node cluster refers to a self-defined selectable verification confidence value of a constructed node cluster, or a verification confidence value of the confidence value generated through statistics, and after the parameter value is determined, a part of node clusters meeting a preset screening rule screening condition is screened according to a preset screening rule and determined as the verification node cluster for verifying data information. The preset filtering condition may be to filter the verification confidence level or the optimal value of the verification confidence level, or to satisfy a certain predetermined range. For example, in a plurality of node clusters including nodes with relatively representative nodes or low common interest group concentration rate, the node clusters are selected to determine a verification node cluster when node cluster screening is performed according to a defined rule with high verification trust or verification confidence.
Through the operation, the block chain network is relatively reliable even if partial verification is carried out, and the efficiency of verifying the block chain network nodes is improved most importantly. For example, the efficiency of verifying the nodes of the whole network is slow, the verification time is long, and the verification of selecting a part of nodes is fast, for example, the efficiency agreed by all 100 nodes is certainly slower than the efficiency agreed by all 20 nodes, the consensus rules of node verification (the verification trust or the verification confidence of a node cluster can be determined according to the consensus rules of multiple nodes) can be set by user, the default whole network verification of all node verification of cluster nodes can be set, the default whole network approval verification of cluster node percentage node verification can be set, and meanwhile, the default whole network approval verification of several node cluster verification defaults can also be set. The verification of the blockchain nodes is that the more verification nodes are, the safer and the more democratic, but the slower the efficiency is.
An application example for implementing the verification node cluster setting process is as follows:
assuming that there are 5 multi-node clusters A, B, C, D, E in the blockchain network, a middleware a is developed to provide an API interface externally, which serves as a gateway and a link route, for determining which cluster the information data is verified in when submitted to the blockchain network, and the specific implementation process is as follows:
1) identifying the information X needing verification (such as marking that the cluster B needs verification);
2) the middleware a (namely gateway link route) carries out judgment;
3) the middleware a identifies that the information X needs B verification through the mark;
4) middleware a assigns information X to B for verification;
5) verifying the cluster B;
6) after the verification of the cluster B is completed, other clusters CDE synchronize the data of the cluster B;
7) other clusters verify the same.
It should be noted that, the implementation process of step 202 may be implemented in other ways besides the above-mentioned ways, and the embodiment of the present invention does not limit the specific ways.
203. A percentage of verification node number condition for the cluster of verification nodes is determined.
The percentage condition of the number of verification nodes herein may be defined and set according to an actual situation, for example, may be 50% or 100%, or other percentages, and after the percentage condition is determined, the internal verification rule of the verification node cluster is set as: the percentage number of the nodes in the verification node cluster are selected for verification, and because the sizes of the verification authorities are basically the same according to the nodes in the node cluster which is built according to the preset built classification rule (for example, the nodes with different benefit bodies are distributed in one node cluster), when the internal verification rule of the verification node cluster is set, only the percentage of the number of the verification nodes needs to be determined, and the nodes in the node cluster can be randomly selected according to the percentage of the number. Of course, in other cases, other conditions besides the percentage of the verification quantity may be set for the internal node verification rule of the node cluster, and the rule of which node is selected proportionally may also be set, which is not limited in the embodiment of the present invention.
It should be noted that, the implementation process of step 203 may be implemented in other ways besides the above-mentioned ways, and the specific way is not limited in the embodiment of the present invention.
Example 3
Fig. 3 is a flowchart of a block link point cluster building method provided in embodiment 3 of the present invention, and as shown in fig. 3, the block link point cluster building method provided in the embodiment of the present invention includes the following steps:
301. and classifying the existing nodes in the block chain network, and building a plurality of node clusters.
Specifically, the existing node classification setting principle is classified according to the preset classification rule, so that a plurality of node clusters are formed.
It should be noted that, the implementation process of step 301 may be implemented in other ways besides the above-mentioned ways, and the specific way is not limited in the embodiment of the present invention.
302. And determining part of the node clusters which meet the screening conditions of the preset screening rules as the verification node clusters for verifying the data information according to the verification trust or the verification confidence of the node clusters and the preset screening rules.
The implementation process of this step is the same as the implementation process of this step in embodiment 2, and for details, see the corresponding description in the embodiment, and will not be described herein again.
It should be noted that, the implementation process of step 302 may be implemented in other ways besides the above-mentioned ways, and the specific way is not limited by the embodiment of the present invention.
303. A percentage of verification node number condition for the cluster of verification nodes is determined.
The implementation process of this step is the same as the implementation process of this step in embodiment 2, and for details, see the corresponding description in the embodiment, and will not be described herein again.
It should be noted that, the implementation process of step 303 may be implemented in other ways besides the above-mentioned ways, and the specific way is not limited in the embodiment of the present invention.
Example 4
Fig. 4 is a flowchart of a block link point cluster building method provided in embodiment 4 of the present invention, and as shown in fig. 4, the block link point cluster building method provided in the embodiment of the present invention includes the following steps:
401. and building a plurality of node clusters in the block chain network.
The implementation process of this step is the same as the implementation process of this step in embodiment 1, and for details, reference is made to the corresponding description in the embodiment, and details are not repeated here.
It should be noted that, the implementation process of step 401 may be implemented in other ways besides the above-mentioned ways, and the specific way is not limited in the embodiment of the present invention.
402. And setting a verification node cluster used for verifying the data information in the plurality of node clusters.
The implementation process of this step is the same as the implementation process of this step in embodiment 1, and for details, reference is made to the corresponding description in the embodiment, and details are not repeated here.
It should be noted that, the implementation process of step 402 may be implemented in other ways besides the above-mentioned ways, and the specific way is not limited in the embodiment of the present invention.
403. And setting an internal verification rule of the verification node cluster.
The implementation process of this step is the same as the implementation process of this step in embodiment 1, and for details, reference is made to the corresponding description in the embodiment, and details are not repeated here.
It should be noted that, the implementation process of step 403 may be implemented in other ways besides the above-mentioned ways, and the specific way is not limited in the embodiment of the present invention.
404. And adding the new node into the node cluster.
Specifically, a source code of the chain is obtained; compiling the source code into binary code; configuring a P2P network through seeds parameters; selecting a node cluster to be added; finding an existing node of the node cluster; signing through an existing node private key and an added node public key; and upgrading the node into a node with verification authority through the authorization interface.
The above implementation is preferably performed according to the following steps:
1) selecting a node cluster to be added;
2) signing the newly added node through a standard CA;
3) upgrading the newly added node into a verification node through a middleware privilege escalation interface;
4) acquiring a source code of a chain;
5) compiling the source code into binary code;
6) configuring a P2P network through seeds parameters;
7) finding an existing node of the node cluster;
8) signing through an existing node private key and an added node public key;
9) and upgrading the node into a verification node through the authorization interface.
It should be noted that, the implementation process of step 404 may be implemented in other ways besides the implementation steps and ways described above, and the specific ways are not limited in the embodiment of the present invention.
Example 5
Fig. 5 is a schematic structural diagram of a block link point cluster building device provided in embodiment 5 of the present invention, and as shown in fig. 5, the block link point cluster building device provided in embodiment of the present invention includes a building module 51, a first setting module 52, and a second setting module 53.
A building module 51 for building a plurality of node clusters in the blockchain network. Specifically, the building module 51 is used for: and building a plurality of node clusters in the block chain network according to preset building classification rules, wherein the preset building classification rules at least comprise rules for node classification building according to regions, industries, roles or interest body categories. The rule for carrying out node classification and establishment according to the interest body category comprises the following steps: and respectively building nodes belonging to the same interest body category in different node clusters.
Specifically, the building module 51 is used for: deploying the nodes; carrying out cluster grouping on the nodes; maintaining synchronous information of all nodes; and selecting a middleware gateway route and providing an external interface.
In addition, the building module 51 is configured to classify existing nodes in the block chain network, and build a plurality of node clusters.
In addition, the building module 51 is also used for: acquiring a source code of a chain; compiling the source code into binary code; configuring a P2P network through seeds parameters; selecting a node cluster to be added; finding an existing node of the node cluster; signing through an existing node private key and an added node public key; and upgrading the node into a node with verification authority through the authorization interface.
The first setting module 52 is configured to set a verification node cluster for verifying the data information among the plurality of node clusters. Specifically, the first setting module 52 is configured to: and determining part of the node clusters which meet the screening conditions of the preset screening rules as the verification node clusters for verifying the data information according to the verification trust or the verification confidence of the node clusters and the preset screening rules. The first setup module 52 is further configured to: and calculating the verification confidence degrees or the verification confidence degrees of the plurality of node clusters by using a preset rule.
And a second setting module 53, configured to set an internal verification rule of the verification node cluster. Specifically, a verification node number percentage condition of the verification node cluster is determined.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
In summary, the block link point cluster building method and device provided by the embodiment of the invention have the following beneficial effects compared with the prior art:
by the mode of building a plurality of node clusters from a plurality of nodes of a block chain, and setting the verification node clusters used for verifying data information and the internal verification rules of the verification node clusters, when node verification is carried out, proper or representative nodes and node clusters formed by the nodes are selected for verification without whole network verification, even if the number of nodes in the block chain network is continuously increased, the performance of the block chain network is improved under the condition of ensuring the relatively reliable and robust block chain network, and therefore, the block chain link point cluster building method has a good application prospect.
It should be noted that: when the block chain node cluster building device provided by the above embodiment triggers a block chain node cluster building service, only the division of the above functional modules is used for illustration, and in practical application, the above function distribution can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the above described functions. In addition, the block chain link point cluster building device provided by the above embodiment and the block chain link point cluster building method embodiment belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.