CN108717460A - A kind of method and device reached common understanding in block chain - Google Patents
A kind of method and device reached common understanding in block chain Download PDFInfo
- Publication number
- CN108717460A CN108717460A CN201810512702.6A CN201810512702A CN108717460A CN 108717460 A CN108717460 A CN 108717460A CN 201810512702 A CN201810512702 A CN 201810512702A CN 108717460 A CN108717460 A CN 108717460A
- Authority
- CN
- China
- Prior art keywords
- node
- clustered
- cluster cell
- characteristic value
- cluster
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
- G06F18/232—Non-hierarchical techniques
- G06F18/2321—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Probability & Statistics with Applications (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention provides a kind of method and device reached common understanding in block chain, this method, including:Multiple nodes to be clustered are determined from each node of block chain;Determine the characteristic value of each node to be clustered;According to the characteristic value of each node to be clustered, clustering processing is carried out to the multiple node to be clustered, determines destination node;The node that the destination node is reached common understanding as the block chain.The present invention provides a kind of method and devices reached common understanding in block chain, can reduce required resource of reaching common understanding.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method and device reached common understanding in block chain.
Background technology
Block chain is that one kind storing data by safeguarding jointly in many ways, with blocky chain structure, ensures to transmit using cryptography
And access safety, it can realize and store always, can not distort.All Activity is broadcasted in block chain, by altogether between node
Knowledge mechanism is built consensus.
In the prior art, the node in block chain is weighed by calculating the numerical solution contention book keeping operation of random Harsh hash, is asked
Correct numerical solution with the ability for generating block be node calculate power specific manifestation.Each node in block chain is all gone at random
The numerical solution of Hash hash, the node for most obtaining numerical solution soon is the node reached common understanding in block chain, typically, it is referring to note
Account node.
It is required for each node largely to be calculated as can be seen from the above description, reaching common understanding every time, needs consumption big
Measure resource.
Invention content
An embodiment of the present invention provides a kind of method and devices reached common understanding in block chain, can reduce and reach common understanding
Required resource.
On the one hand, an embodiment of the present invention provides a kind of methods reached common understanding in block chain, including:
Multiple nodes to be clustered are determined from each node of block chain;
Determine the characteristic value of each node to be clustered;
According to the characteristic value of each node to be clustered, clustering processing is carried out to the multiple node to be clustered, is determined
Go out destination node;
The node that the destination node is reached common understanding as the block chain.
Further,
This method further comprises:Raw performance is pre-set, cluster termination condition is pre-set;
The characteristic value of each node to be clustered of the basis carries out clustering processing to the multiple node to be clustered,
Determine destination node, including:
S1:Using the Raw performance as current criteria, by each node to be clustered as cluster cell;
S2:According to the characteristic value of each node to be clustered in each cluster cell, any two cluster cell is determined
The distance between, two nearest cluster cells of distance are merged, as a cluster cell;
S3:Dummy node is built according to current criteria, according to the spy of each node to be clustered in each cluster cell
Value indicative determines the central point of each cluster cell, determines the distance between each central point and the dummy node, determining and institute
State the nearest target's center's point of the distance between dummy node;
S4:Judge whether to meet cluster termination condition, if it is, executing S5, otherwise, executes S6;
S5:Determine each the distance between the node to be clustered and target's center's point, it will be with the target's center
The nearest node to be clustered of the distance between point is as the destination node;
S6:It determines the corresponding target cluster cell of target's center's point, the dummy node is added to target cluster
In unit, the central point of new target cluster cell is calculated, according to the corresponding each spy of the central point of new target cluster cell
Value indicative updates current criteria, returns to S2.
Further,
The characteristic value of each node to be clustered, determines any two cluster cell in each cluster cell of basis
The distance between, including:
The distance between any two cluster cell is determined according to formula one, wherein the formula one is:
Wherein, D is the distance between the first cluster cell and the second cluster cell, and n is institute in first cluster cell
The quantity of node to be clustered is stated, m is the quantity of node to be clustered described in second cluster cell, and t waits gathering to be each described
The quantity of the characteristic value of class node, xikFor k-th of characteristic value in i-th of node to be clustered in first cluster cell, yjkFor
K-th of characteristic value, n, m, t, k are positive integer in j-th of node to be clustered in second cluster cell.
Further,
The characteristic value of each node to be clustered, determines in each cluster cell in each cluster cell of basis
Heart point, including:
For each cluster cell, execute:
Determine that each characteristic value of the central point of current cluster cell, the formula two are according to formula two:
Wherein, zkFor k-th of characteristic value of the central point of current cluster cell, qikIt is waited for for i-th in current cluster cell
K-th of characteristic value of cluster node, h are the quantity of node to be clustered in current cluster cell, and h, k are positive integer;
According to each characteristic value of the central point of current cluster cell, the central point of current cluster cell is determined;
The distance between each central point of determination and the dummy node, including:
The distance between each central point and the dummy node are calculated according to formula three, wherein the formula three is:
Wherein, d is the distance between any central point and the dummy node, zkCentered on k-th of characteristic value putting, pk
For k-th of characteristic value of the dummy node.
Further,
The cluster termination condition includes:The number of cluster reaches the first preset value, the quantity of cluster cell is less than or equal to
Second preset value.
Further,
This method further comprises:
Multiple nodes to be clustered are determined in each node from block chain, including:
Determine the accumulative billing amounts of each node;
According to the accumulative billing amounts of each node, the multiple node to be clustered is determined.
Further,
The node that the destination node is reached common understanding as the block chain, including:
Using the destination node as the accounting nodes of the block chain.
Further,
The characteristic value, including:Node response time, node turn-on time execute intelligent contract time, accumulative book keeping operation number
One or more of amount.
On the other hand, an embodiment of the present invention provides a kind of devices reached common understanding in block chain, including:
Node determination unit, for determining multiple nodes to be clustered from each node of block chain;
Characteristic value determination unit, the characteristic value for determining each node to be clustered;
Unit of knowing together carries out the multiple node to be clustered for the characteristic value according to each node to be clustered
Clustering processing determines destination node, the node that the destination node is reached common understanding as the block chain.
Further,
The device further comprises:
Setting unit, for Raw performance, setting cluster termination condition to be arranged;
The common recognition unit waits gathering in the characteristic value for executing each node to be clustered of the basis to the multiple
Class node carries out clustering processing, when determining destination node, is specifically used for executing:
S1:Using the Raw performance as current criteria, by each node to be clustered as cluster cell;
S2:According to the characteristic value of each node to be clustered in each cluster cell, any two cluster cell is determined
The distance between, two nearest cluster cells of distance are merged, as a cluster cell;
S3:Dummy node is built according to current criteria, according to the spy of each node to be clustered in each cluster cell
Value indicative determines the central point of each cluster cell, determines the distance between each central point and the dummy node, determining and institute
State the nearest target's center's point of the distance between dummy node;
S4:Judge whether to meet cluster termination condition, if it is, executing S5, otherwise, executes S6;
S5:Determine each the distance between the node to be clustered and target's center's point, it will be with the target's center
The nearest node to be clustered of the distance between point is as the destination node;
S6:It determines the corresponding target cluster cell of target's center's point, the dummy node is added to target cluster
In unit, the central point of new target cluster cell is calculated, according to the corresponding each spy of the central point of new target cluster cell
Value indicative updates current criteria, returns to S2.
Further,
The common recognition unit, the characteristic value of each node to be clustered in executing each cluster cell of basis,
When determining the distance between any two cluster cell, it is specifically used for:
The distance between any two cluster cell is determined according to formula one, wherein the formula one is:
Wherein, D is the distance between the first cluster cell and the second cluster cell, and n is institute in first cluster cell
The quantity of node to be clustered is stated, m is the quantity of node to be clustered described in second cluster cell, and t waits gathering to be each described
The quantity of the characteristic value of class node, xikFor k-th of characteristic value in i-th of node to be clustered in first cluster cell, yjkFor
K-th of characteristic value, n, m, t, k are positive integer in j-th of node to be clustered in second cluster cell.
Further,
The common recognition unit, the characteristic value of each node to be clustered in executing each cluster cell of basis,
When determining the central point of each cluster cell, it is specifically used for:
For each cluster cell, execute:
Determine that each characteristic value of the central point of current cluster cell, the formula two are according to formula two:
Wherein, zkFor k-th of characteristic value of the central point of current cluster cell, qikIt is waited for for i-th in current cluster cell
K-th of characteristic value of cluster node, h are the quantity of node to be clustered in current cluster cell, and h, k are positive integer;
According to each characteristic value of the central point of current cluster cell, the central point of current cluster cell is determined;
The common recognition unit, when at a distance from the execution each central point of determination is between the dummy node, specifically
For:
The distance between each central point and the dummy node are calculated according to formula three, wherein the formula three is:
Wherein, d is the distance between any central point and the dummy node, zkCentered on k-th of characteristic value putting, pk
For k-th of characteristic value of the dummy node.
Further,
The cluster termination condition includes:The number of cluster reaches the first preset value, the quantity of cluster cell is less than or equal to
Second preset value.
Further,
The node determination unit, the accumulative billing amounts for determining each node, according to the accumulative note of each node
Account quantity determines the multiple node to be clustered.
Further,
The common recognition unit is executing the node that the destination node is reached common understanding as the block chain
When, it is specifically used for:
Using the destination node as the accounting nodes of the block chain.
Further,
The characteristic value, including:Node response time, node turn-on time execute intelligent contract time, accumulative book keeping operation number
One or more of amount.
In embodiments of the present invention, the characteristic value based on each node to be clustered in block chain carries out clustering processing, really
Destination node is made, the node that destination node is reached common understanding as block chain, without in block chain during the realization
All nodes all handled, greatly reduce required resource of reaching common understanding.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is the present invention
Some embodiments for those of ordinary skill in the art without creative efforts, can also basis
These attached drawings obtain other attached drawings.
Fig. 1 is a kind of flow chart for method reached common understanding in block chain that one embodiment of the invention provides;
Fig. 2 is the flow chart for the method that the another kind that one embodiment of the invention provides is reached common understanding in block chain;
Fig. 3 is a kind of schematic diagram for device reached common understanding in block chain that one embodiment of the invention provides;
Fig. 4 is the schematic diagram for the device that the another kind that one embodiment of the invention provides is reached common understanding in block chain.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments, based on the embodiments of the present invention, those of ordinary skill in the art
The every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
As shown in Figure 1, an embodiment of the present invention provides a kind of method reached common understanding in block chain, this method can wrap
Include following steps:
Step 101:Multiple nodes to be clustered are determined from each node of block chain;
Step 102:Determine the characteristic value of each node to be clustered;
Step 103:According to the characteristic value of each node to be clustered, the multiple node to be clustered is carried out at cluster
Reason, determines destination node;
Step 104:The node that the destination node is reached common understanding as the block chain.
In embodiments of the present invention, the characteristic value based on each node to be clustered in block chain carries out clustering processing, really
Destination node is made, the node that destination node is reached common understanding as block chain, without in block chain during the realization
All nodes all handled, greatly reduce required resource of reaching common understanding.
In an embodiment of the present invention, this method further comprises:Raw performance is pre-set, cluster is pre-set and terminates
Condition;
The characteristic value of each node to be clustered of the basis carries out clustering processing to the multiple node to be clustered,
Determine destination node, including:
S1:Using the Raw performance as current criteria, by each node to be clustered as cluster cell;
S2:According to the characteristic value of each node to be clustered in each cluster cell, any two cluster cell is determined
The distance between, two nearest cluster cells of distance are merged, as a cluster cell;
S3:Dummy node is built according to current criteria, according to the spy of each node to be clustered in each cluster cell
Value indicative determines the central point of each cluster cell, determines the distance between each central point and the dummy node, determining and institute
State the nearest target's center's point of the distance between dummy node;
S4:Judge whether to meet cluster termination condition, if it is, executing S5, otherwise, executes S6;
S5:Determine each the distance between the node to be clustered and target's center's point, it will be with the target's center
The nearest node to be clustered of the distance between point is as the destination node;
S6:It determines the corresponding target cluster cell of target's center's point, the dummy node is added to target cluster
In unit, the central point of new target cluster cell is calculated, according to the corresponding each spy of the central point of new target cluster cell
Value indicative updates current criteria, returns to S2.
In embodiments of the present invention, the reflection by the distance between cluster cell as the similarity between cluster cell,
Distance is closer, and similarity is higher, in cluster, two nearest cluster cells of distance is merged, the same cluster of success
Unit completes primary cluster after primary merging.Dummy node is the target for the node that setting is reached common understanding, nearest with dummy node
Target's center's point and the target it is most like, nearest node to be clustered is and most like to be clustered of target with target's center point
Node, when meeting cluster termination condition, most like node to be clustered is as destination node with target.It is being unsatisfactory for cluster knot
When beam condition, dummy node is added to the corresponding target cluster cell of target's center's point, forms new target cluster cell, counted
The central point for calculating new target cluster cell has been achieved pair using each characteristic value of the central point as current criteria
The adjust automatically of current criteria is realized in the update of current criteria so that current criteria can be more in line with the reality of these block chains
Border situation, obtained destination node are more in line with the requirement of block chain.
In an embodiment of the present invention, in each cluster cell of the basis each node to be clustered characteristic value,
Determine the distance between any two cluster cell, including:
The distance between any two cluster cell is determined according to formula one, wherein the formula one is:
Wherein, D is the distance between the first cluster cell and the second cluster cell, and n is institute in first cluster cell
The quantity of node to be clustered is stated, m is the quantity of node to be clustered described in second cluster cell, and t waits gathering to be each described
The quantity of the characteristic value of class node, xikFor k-th of characteristic value in i-th of node to be clustered in first cluster cell, yjkFor
K-th of characteristic value, n, m, t, k are positive integer in j-th of node to be clustered in second cluster cell.
In embodiments of the present invention, the distance between any two cluster cell is determined using formula one, in formula one
The information of each characteristic value of each of each cluster cell node to be clustered is utilized, can more comprehensively react two
Similarity between cluster cell.First cluster cell is one in any two cluster cell, and the second cluster cell is to appoint
Anticipate two cluster cells in another.
In an embodiment of the present invention, in each cluster cell of the basis each node to be clustered characteristic value,
Determine the central point of each cluster cell, including:
For each cluster cell, execute:
Determine that each characteristic value of the central point of current cluster cell, the formula two are according to formula two:
Wherein, zkFor k-th of characteristic value of the central point of current cluster cell, qikIt is waited for for i-th in current cluster cell
K-th of characteristic value of cluster node, h are the quantity of node to be clustered in current cluster cell, and h, k are positive integer;
According to each characteristic value of the central point of current cluster cell, the central point of current cluster cell is determined;
The distance between each central point of determination and the dummy node, including:
The distance between each central point and the dummy node are calculated according to formula three, wherein the formula three is:
Wherein, d is the distance between any central point and the dummy node, zkCentered on k-th of characteristic value putting, pk
For k-th of characteristic value of the dummy node.
In embodiments of the present invention, each characteristic value that central point can be determined according to formula two, determines central point
Each characteristic value can be obtained central point.
In the central point of the new target cluster cell of determination, can also be determined using formula two, at this moment, qikIt is new
K-th of characteristic value of i-th of node in target cluster cell, node here can be node to be clustered, can also be virtual
Node.
In embodiments of the present invention, the distance between each central point and dummy node can be determined according to formula three.
When determining at a distance between each node to be clustered and target's center point, can also be determined using formula three,
At this moment, d is the distance between node to be clustered and target's center's point, zkFor k-th of characteristic value of node to be clustered, pkFor target
K-th of characteristic value of central point.
In an embodiment of the present invention, the cluster termination condition includes:The number of cluster reaches the first preset value, cluster
The quantity of unit is less than or equal to the second preset value.
In embodiments of the present invention, cluster termination condition can be it is therein any one.Such as:Clustering termination condition can
To be that cluster number reaches 2 times, cluster condition can be that the quantity of cluster cell is less than or equal to 3.Here the first preset value
It can be determined according to the quantity of node to be clustered, such as:The quantity of node to be clustered is more, what the first preset value can be arranged
It is bigger.Here the second preset value can also be determined according to the quantity of node to be clustered.
In an embodiment of the present invention, this method further comprises:
Multiple nodes to be clustered are determined in each node from block chain, including:
Determine the accumulative billing amounts of each node;
According to the accumulative billing amounts of each node, the multiple node to be clustered is determined.
In embodiments of the present invention, it not instead of using node all in block chain all as node to be clustered, therefrom selects
Part of nodes is selected out as node to be clustered.The required resource for determining destination node can be reduced in this way.
Here node to be clustered is determined as standard using accumulative billing amounts.It specifically, can be according to accumulative book keeping operation number
Amount from being more to ranked up less, and third preset value node is as node to be clustered before coming.That is, the accumulative note of selection
The a fairly large number of node of account is as node to be clustered.
In an embodiment of the present invention, the section that the destination node is reached common understanding as the block chain
Point, including:
Using the destination node as the accounting nodes of the block chain.
The determination of the accounting nodes to block chain may be implemented through the embodiment of the present invention.That is, this can be sent out
Common recognition algorithm of the bright embodiment as block chain.
In an embodiment of the present invention, the characteristic value, including:The node response time, executes intelligence at node turn-on time
One or more of contract time, accumulative billing amounts.
For example, characteristic value includes node response time, node turn-on time and execution intelligent contract time.So,
When determining the characteristic value of each node to be clustered, node response time, the node turn-on time of each node to be clustered are determined
With the execution intelligent contract time.Node to be clustered is represented by these three characteristic values.
It is arranged when determining current criteria, and for the characteristic value of node to be clustered.Such as:Characteristic value includes section
Point response time, node turn-on time and execution intelligent contract time, then, current criteria includes:The node response time
Index value, the index value of node turn-on time and the index value for executing the intelligent contract time.
As shown in Fig. 2, an embodiment of the present invention provides a kind of method reached common understanding in block chain, this method can wrap
Include following steps:
Step 201:Raw performance is pre-set, cluster termination condition is pre-set.
Specifically, Raw performance can be arranged according to the operating condition of block chain,.
Step 202:Multiple nodes to be clustered are determined from each node of block chain.
With the continuous operation of block chain, the number of nodes in block chain increases, and the treatment effeciency in block chain can decline.
To ensure the efficiency of block chain, during reaching common understanding, a part of node is selected to be clustered, it is, selection one
Partial node is as node to be clustered, other nodes are not in the range of choice of accounting nodes.
The screening of node to be clustered can determine according to preset screening strategy,
Step 203:Determine the characteristic value of each node to be clustered.
Specifically, characteristic value, including:Node response time, node turn-on time execute intelligent contract time, accumulative note
One or more of account quantity.
Specifically, each node to be clustered can be represented by the characteristic value of each node to be clustered, such as:Characteristic value
Including:Node response time, node turn-on time and execution intelligent contract time.For node A to be clustered, node response
Time is a1, and node turn-on time is a2, the execution intelligent contract time is a3, then, node A to be clustered can pass through vector
(a1, a2, a3) is indicated.Node A to be clustered is represented when subsequent processing also by the vector.
Step 204:Using Raw performance as current criteria, by each node to be clustered as cluster cell.
Specifically, current criteria is arranged also for the characteristic value of each node to be clustered.Such as:Characteristic value includes:Section
Point response time, node turn-on time and execution intelligent contract time, current criteria include:The index value of node response time,
The index value of node turn-on time and the index value for executing the intelligent contract time.If the index value of node response time is b1,
The index value of node turn-on time be b2, row intelligence the contract time index value be b3, then, current criteria by vector (b1,
B2, b3) it indicates.
Step 205:According to the characteristic value of each node to be clustered in each cluster cell, any two cluster cell is determined
The distance between, two nearest cluster cells of distance are merged, as a cluster cell.
Specifically, the distance between any two cluster cell is determined according to formula one, wherein formula one is:
Wherein, D is the distance between the first cluster cell and the second cluster cell, and n is institute in first cluster cell
The quantity of node to be clustered is stated, m is the quantity of node to be clustered described in second cluster cell, and t waits gathering to be each described
The quantity of the characteristic value of class node, xikFor k-th of characteristic value in i-th of node to be clustered in first cluster cell, yjkFor
K-th of characteristic value, n, m, t, k are positive integer in j-th of node to be clustered in second cluster cell.
For example, a cluster cell includes node A to be clustered, another cluster cell includes node to be clustered
B, distance between the two is nearest, then, the two is merged into a cluster cell, and the cluster cell after merging includes to be clustered
Node A and node B to be clustered.
For example, a cluster cell includes node A to be clustered and node B to be clustered, in another cluster cell
Including node C to be clustered and node D to be clustered, distance between the two is nearest, then, the two is merged into a cluster cell,
Cluster cell after merging includes node A, node B to be clustered, node C to be clustered and node D to be clustered to be clustered.
Step 206:Dummy node is built according to current criteria, according to the spy of each node to be clustered in each cluster cell
Value indicative determines the central point of each cluster cell, determines the distance between each central point and dummy node, determines and virtual section
The nearest target's center's point of the distance between point.
Specifically, it for each cluster cell, executes:
Determine that each characteristic value of the central point of current cluster cell, the formula two are according to formula two:
Wherein, zkFor k-th of characteristic value of the central point of current cluster cell, qikIt is waited for for i-th in current cluster cell
K-th of characteristic value of cluster node, h are the quantity of node to be clustered in current cluster cell, and h, k are positive integer;
According to each characteristic value of the central point of current cluster cell, the central point of current cluster cell is determined.
For example, if the index value of node response time is b1, the index value of node turn-on time is b2, row intelligence
The index value of contract time is b3, then, dummy node is vectorial (b1, b2, b3).
Step 207:Judge whether to meet cluster termination condition, if so, thening follow the steps 208, otherwise, executes step
209。
Specifically, cluster termination condition includes:The number of cluster reaches the first preset value, the quantity of cluster cell is less than etc.
In the second preset value.
Step 208:Determine each the distance between node to be clustered and target's center's point, it will be between target's center's point
The nearest node to be clustered of distance executes step 210 as destination node.
Step 209:It determines the corresponding target cluster cell of target's center's point, dummy node is added to target cluster cell
In, the central point of new target cluster cell is calculated, according to the corresponding each characteristic value of the central point of new target cluster cell,
Update current criteria, return to step 205.
Specifically, the extension needs of block chain are met by adjusting current criteria, the adjustment of index is not to original number
According to impacting.
Step 210:Using destination node as the accounting nodes of block chain.
It can be added to the embodiment of the present invention as the common recognition algorithm of block chain in block chain.
In embodiments of the present invention, according to the characteristic value of each node to be clustered, multiple nodes to be clustered are clustered
Processing, determines destination node, including:
According to the characteristic value of each node to be clustered, hierarchical clustering study is carried out to multiple nodes to be clustered, is determined
Destination node.
Hierarchical clustering study is unsupervised learning method, especially meets block chain node decentralization feature, the level
The time of election accounting nodes can be saved by changing clustering learning, improve the treatment effeciency of block chain.Learnt based on hierarchical clustering
Block chain design method, can also according to the operating condition of block chain, adjust stratification clustering learning criterion, to adapt to
The following application demand of block chain.
It can be built by hyperledger in the block chain in building the embodiment of the present invention, the present invention implemented
Common recognition algorithm of the method for example as block chain.
According to the handling capacity of block chain and node operating condition, new machine learning is carried out, according to sample, selection properly refers to
Mark.It is adjusted to the index that hierarchical clustering learns suitably to learn index, meets the extension needs of block chain, the adjustment of index
Original data are not impacted.
In embodiments of the present invention, clustering processing is the relationship found in data between data object, and data are carried out
It is grouped, the similitude in group is bigger, and the difference between group is bigger, then Clustering Effect is better, and the sample in data set is divided by it
Several are typically disjoint subset, and each subset is known as a cluster cell.It is to be clustered in cluster cell by calculating
The distance between node and the distance between cluster cell assess cluster result, to be clustered in cluster cell
The distance between node is similar to the similarity in cluster cell, and the distance between cluster cell is similar between cluster cell
Similarity can build the Measure Indexes to suit the requirements by calculating and combining the value of these distances.Referred to according to measurement
Mark is clustered by recycling, selects destination node.It can be using Measure Indexes as current criteria.
As shown in Figure 3, Figure 4, an embodiment of the present invention provides a kind of devices reached common understanding in block chain.Device is implemented
Example can also be realized by software realization by way of hardware or software and hardware combining.For hardware view, such as scheme
It is a kind of hardware configuration of equipment where a kind of device reached common understanding in block chain provided in an embodiment of the present invention shown in 3
Figure, other than processor shown in Fig. 3, memory, network interface and nonvolatile memory, in embodiment where device
Equipment usually can also include other hardware, such as be responsible for handle message forwarding chip.For implemented in software, such as scheme
Shown in 4, as the device on a logical meaning, being will be corresponding in nonvolatile memory by the CPU of equipment where it
Computer program instructions read what operation in memory was formed.A kind of dress reached common understanding in block chain provided in this embodiment
It sets, including:
Node determination unit 401, for determining multiple nodes to be clustered from each node of block chain;
Characteristic value determination unit 402, the characteristic value for determining each node to be clustered;
Know together unit 403, for the characteristic value according to each node to be clustered, to the multiple node to be clustered into
Row clustering processing, determines destination node, the node that the destination node is reached common understanding as the block chain.
In an embodiment of the present invention, which further comprises:
Setting unit, for Raw performance, setting cluster termination condition to be arranged;
The common recognition unit waits gathering in the characteristic value for executing each node to be clustered of the basis to the multiple
Class node carries out clustering processing, when determining destination node, is specifically used for executing:
S1:Using the Raw performance as current criteria, by each node to be clustered as cluster cell;
S2:According to the characteristic value of each node to be clustered in each cluster cell, any two cluster cell is determined
The distance between, two nearest cluster cells of distance are merged, as a cluster cell;
S3:Dummy node is built according to current criteria, according to the spy of each node to be clustered in each cluster cell
Value indicative determines the central point of each cluster cell, determines the distance between each central point and the dummy node, determining and institute
State the nearest target's center's point of the distance between dummy node;
S4:Judge whether to meet cluster termination condition, if it is, executing S5, otherwise, executes S6;
S5:Determine each the distance between the node to be clustered and target's center's point, it will be with the target's center
The nearest node to be clustered of the distance between point is as the destination node;
S6:It determines the corresponding target cluster cell of target's center's point, the dummy node is added to target cluster
In unit, the central point of new target cluster cell is calculated, according to the corresponding each spy of the central point of new target cluster cell
Value indicative updates current criteria, returns to S2.
In an embodiment of the present invention, the common recognition unit, it is each described in executing each cluster cell of basis
The characteristic value of node to be clustered is specifically used for when determining the distance between any two cluster cell:
The distance between any two cluster cell is determined according to formula one, wherein the formula one is:
Wherein, D is the distance between the first cluster cell and the second cluster cell, and n is institute in first cluster cell
The quantity of node to be clustered is stated, m is the quantity of node to be clustered described in second cluster cell, and t waits gathering to be each described
The quantity of the characteristic value of class node, xikFor k-th of characteristic value in i-th of node to be clustered in first cluster cell, yjkFor
K-th of characteristic value, n, m, t, k are positive integer in j-th of node to be clustered in second cluster cell.
In an embodiment of the present invention, the common recognition unit, it is each described in executing each cluster cell of basis
The characteristic value of node to be clustered is specifically used for when determining the central point of each cluster cell:
For each cluster cell, execute:
Determine that each characteristic value of the central point of current cluster cell, the formula two are according to formula two:
Wherein, zkFor k-th of characteristic value of the central point of current cluster cell, qikIt is waited for for i-th in current cluster cell
K-th of characteristic value of cluster node, h are the quantity of node to be clustered in current cluster cell, and h, k are positive integer;
According to each characteristic value of the central point of current cluster cell, the central point of current cluster cell is determined;
The common recognition unit, when at a distance from the execution each central point of determination is between the dummy node, specifically
For:
The distance between each central point and the dummy node are calculated according to formula three, wherein the formula three is:
Wherein, d is the distance between any central point and the dummy node, zkCentered on k-th of characteristic value putting, pk
For k-th of characteristic value of the dummy node.
In an embodiment of the present invention, the cluster termination condition includes:The number of cluster reaches the first preset value, cluster
The quantity of unit is less than or equal to the second preset value.
In an embodiment of the present invention, the node determination unit, the accumulative billing amounts for determining each node, root
According to the accumulative billing amounts of each node, the multiple node to be clustered is determined.
In an embodiment of the present invention, the common recognition unit, it is described using the destination node as the block executing
When the node that chain is reached common understanding, it is specifically used for:
Using the destination node as the accounting nodes of the block chain.
In an embodiment of the present invention, the characteristic value, including:The node response time, executes intelligence at node turn-on time
One or more of contract time, accumulative billing amounts.
The contents such as the information exchange between each unit, implementation procedure in above-mentioned apparatus, due to implementing with the method for the present invention
Example is based on same design, and particular content can be found in the narration in the method for the present invention embodiment, and details are not described herein again.
An embodiment of the present invention provides a kind of readable mediums, including execute instruction, when the processor of storage control executes
It is described when executing instruction, the storage control execute it is provided in an embodiment of the present invention any one reach common understanding in block chain
Method.
An embodiment of the present invention provides a kind of storage controls, including:Processor, memory and bus;
The memory is executed instruction for storing, and the processor is connect with the memory by the bus, when
When the storage control operation, the processor executes executing instruction for the memory storage, so that the storage controls
Device executes any one method for reaching common understanding in block chain provided in an embodiment of the present invention.
The each embodiment of the present invention at least has the advantages that:
1, in embodiments of the present invention, the characteristic value based on each node to be clustered in block chain carries out clustering processing,
Determine destination node, the node that destination node is reached common understanding as block chain is not necessarily to block chain during the realization
In all nodes all handled, greatly reduce required resource of reaching common understanding.
2, in embodiments of the present invention, by clustering processing by multiple node aggregations to be clustered at several classifications, according to every
The characteristic value of each node to be clustered, determines destination node, reaches common understanding destination node as block chain in a classification
The node arrived can save the time that block chain is reached common understanding in this way, improve the efficiency that block chain is reached common understanding.
It should be noted that herein, such as first and second etc relational terms are used merely to an entity
Or operation is distinguished with another entity or operation, is existed without necessarily requiring or implying between these entities or operation
Any actual relationship or order.Moreover, the terms "include", "comprise" or its any other variant be intended to it is non-
It is exclusive to include, so that the process, method, article or equipment including a series of elements includes not only those elements,
But also include other elements that are not explicitly listed, or further include solid by this process, method, article or equipment
Some elements.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including
There is also other identical factors in the process, method, article or equipment of the element.
One of ordinary skill in the art will appreciate that:Realize that all or part of step of above method embodiment can pass through
The relevant hardware of program instruction is completed, and program above-mentioned can be stored in computer-readable storage medium, the program
When being executed, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes:ROM, RAM, magnetic disc or light
In the various media that can store program code such as disk.
Finally, it should be noted that:The foregoing is merely presently preferred embodiments of the present invention, is merely to illustrate the skill of the present invention
Art scheme, is not intended to limit the scope of the present invention.Any modification for being made all within the spirits and principles of the present invention,
Equivalent replacement, improvement etc., are included within the scope of protection of the present invention.
Claims (10)
1. a kind of method reached common understanding in block chain, which is characterized in that including:
Multiple nodes to be clustered are determined from each node of block chain;
Determine the characteristic value of each node to be clustered;
According to the characteristic value of each node to be clustered, clustering processing is carried out to the multiple node to be clustered, determines mesh
Mark node;
The node that the destination node is reached common understanding as the block chain.
2. according to the method described in claim 1, it is characterized in that,
Further comprise:Raw performance is pre-set, cluster termination condition is pre-set;
The characteristic value of each node to be clustered of the basis carries out clustering processing to the multiple node to be clustered, determines
Go out destination node, including:
S1:Using the Raw performance as current criteria, by each node to be clustered as cluster cell;
S2:According to the characteristic value of each node to be clustered in each cluster cell, determine between any two cluster cell
Distance, two nearest cluster cells of distance are merged, as a cluster cell;
S3:Dummy node is built according to current criteria, according to the characteristic value of each node to be clustered in each cluster cell,
The central point for determining each cluster cell determines the distance between each central point and the dummy node, determines and the void
The nearest target's center's point of the distance between quasi- node;
S4:Judge whether to meet cluster termination condition, if it is, executing S5, otherwise, executes S6;
S5:Determine each the distance between the node to be clustered and target's center's point, will with target's center's point it
Between the nearest node to be clustered of distance as the destination node;
S6:It determines the corresponding target cluster cell of target's center's point, the dummy node is added to target cluster cell
In, the central point of new target cluster cell is calculated, according to the corresponding each characteristic value of the central point of new target cluster cell,
Current criteria is updated, S2 is returned.
3. according to the method described in claim 2, it is characterized in that,
The characteristic value of each node to be clustered in each cluster cell of basis determines between any two cluster cell
Distance, including:
The distance between any two cluster cell is determined according to formula one, wherein the formula one is:
Wherein, D is the distance between the first cluster cell and the second cluster cell, and n is to be waited for described in first cluster cell
The quantity of cluster node, m are the quantity of node to be clustered described in second cluster cell, and t is each section to be clustered
The quantity of the characteristic value of point, xikFor k-th of characteristic value in i-th of node to be clustered in first cluster cell, yjkIt is described
K-th of characteristic value, n, m, t, k are positive integer in j-th of node to be clustered in second cluster cell.
4. according to the method described in claim 2, it is characterized in that,
The characteristic value of each node to be clustered, determines the center of each cluster cell in each cluster cell of basis
Point, including:
For each cluster cell, execute:
Determine that each characteristic value of the central point of current cluster cell, the formula two are according to formula two:
Wherein, zkFor k-th of characteristic value of the central point of current cluster cell, qikIt is to be clustered for i-th in current cluster cell
K-th of characteristic value of node, h are the quantity of node to be clustered in current cluster cell, and h, k are positive integer;
According to each characteristic value of the central point of current cluster cell, the central point of current cluster cell is determined;
The distance between each central point of determination and the dummy node, including:
The distance between each central point and the dummy node are calculated according to formula three, wherein the formula three is:
Wherein, d is the distance between any central point and the dummy node, zkCentered on k-th of characteristic value putting, pkFor institute
State k-th of characteristic value of dummy node;
And/or
The cluster termination condition includes:The number of cluster reaches the first preset value, the quantity of cluster cell is less than or equal to second
Preset value.
5. according to any method in claim 1-3, which is characterized in that
Further comprise:
Multiple nodes to be clustered are determined in each node from block chain, including:
Determine the accumulative billing amounts of each node;
According to the accumulative billing amounts of each node, the multiple node to be clustered is determined;
And/or
The node that the destination node is reached common understanding as the block chain, including:
Using the destination node as the accounting nodes of the block chain;
And/or
The characteristic value, including:Node response time, node turn-on time execute in intelligent contract time, accumulative billing amounts
One or more.
6. a kind of device reached common understanding in block chain, which is characterized in that including:
Node determination unit, for determining multiple nodes to be clustered from each node of block chain;
Characteristic value determination unit, the characteristic value for determining each node to be clustered;
Unit of knowing together clusters the multiple node to be clustered for the characteristic value according to each node to be clustered
Processing, determines destination node, the node that the destination node is reached common understanding as the block chain.
7. device according to claim 6, which is characterized in that
Further comprise:
Setting unit, for Raw performance, setting cluster termination condition to be arranged;
The common recognition unit, in the characteristic value for executing each node to be clustered of the basis, to the multiple section to be clustered
Point carries out clustering processing, when determining destination node, is specifically used for executing:
S1:Using the Raw performance as current criteria, by each node to be clustered as cluster cell;
S2:According to the characteristic value of each node to be clustered in each cluster cell, determine between any two cluster cell
Distance, two nearest cluster cells of distance are merged, as a cluster cell;
S3:Dummy node is built according to current criteria, according to the characteristic value of each node to be clustered in each cluster cell,
The central point for determining each cluster cell determines the distance between each central point and the dummy node, determines and the void
The nearest target's center's point of the distance between quasi- node;
S4:Judge whether to meet cluster termination condition, if it is, executing S5, otherwise, executes S6;
S5:Determine each the distance between the node to be clustered and target's center's point, will with target's center's point it
Between the nearest node to be clustered of distance as the destination node;
S6:It determines the corresponding target cluster cell of target's center's point, the dummy node is added to target cluster cell
In, the central point of new target cluster cell is calculated, according to the corresponding each characteristic value of the central point of new target cluster cell,
Current criteria is updated, S2 is returned.
8. device according to claim 7, which is characterized in that
The common recognition unit, the characteristic value of each node to be clustered, determines in executing each cluster cell of basis
When the distance between any two cluster cell, it is specifically used for:
The distance between any two cluster cell is determined according to formula one, wherein the formula one is:
Wherein, D is the distance between the first cluster cell and the second cluster cell, and n is to be waited for described in first cluster cell
The quantity of cluster node, m are the quantity of node to be clustered described in second cluster cell, and t is each section to be clustered
The quantity of the characteristic value of point, xikFor k-th of characteristic value in i-th of node to be clustered in first cluster cell, yjkIt is described
K-th of characteristic value, n, m, t, k are positive integer in j-th of node to be clustered in second cluster cell.
9. device according to claim 7, which is characterized in that
The common recognition unit, the characteristic value of each node to be clustered, determines in executing each cluster cell of basis
When the central point of each cluster cell, it is specifically used for:
For each cluster cell, execute:
Determine that each characteristic value of the central point of current cluster cell, the formula two are according to formula two:
Wherein, zkFor k-th of characteristic value of the central point of current cluster cell, qikIt is to be clustered for i-th in current cluster cell
K-th of characteristic value of node, h are the quantity of node to be clustered in current cluster cell, and h, k are positive integer;
According to each characteristic value of the central point of current cluster cell, the central point of current cluster cell is determined;
The common recognition unit is specifically used for when at a distance from the execution each central point of determination is between the dummy node:
The distance between each central point and the dummy node are calculated according to formula three, wherein the formula three is:
Wherein, d is the distance between any central point and the dummy node, zkCentered on k-th of characteristic value putting, pkFor institute
State k-th of characteristic value of dummy node;
And/or
The cluster termination condition includes:The number of cluster reaches the first preset value, the quantity of cluster cell is less than or equal to second
Preset value.
10. according to any device in claim 6-8, which is characterized in that
The node determination unit, the accumulative billing amounts for determining each node, according to the accumulative book keeping operation number of each node
Amount, determines the multiple node to be clustered;
And/or
The common recognition unit, when executing the node that the destination node is reached common understanding as the block chain,
It is specifically used for:
Using the destination node as the accounting nodes of the block chain;
And/or
The characteristic value, including:Node response time, node turn-on time execute in intelligent contract time, accumulative billing amounts
One or more.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810512702.6A CN108717460A (en) | 2018-05-25 | 2018-05-25 | A kind of method and device reached common understanding in block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810512702.6A CN108717460A (en) | 2018-05-25 | 2018-05-25 | A kind of method and device reached common understanding in block chain |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108717460A true CN108717460A (en) | 2018-10-30 |
Family
ID=63900286
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810512702.6A Pending CN108717460A (en) | 2018-05-25 | 2018-05-25 | A kind of method and device reached common understanding in block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108717460A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110113388A (en) * | 2019-04-17 | 2019-08-09 | 四川大学 | A kind of method and apparatus of the block catenary system common recognition based on improved clustering algorithm |
CN110866546A (en) * | 2019-10-30 | 2020-03-06 | 深圳前海微众银行股份有限公司 | Method and device for evaluating consensus node |
JP2020510894A (en) * | 2017-05-31 | 2020-04-09 | アリババ・グループ・ホールディング・リミテッドAlibaba Group Holding Limited | Blockchain consensus method and device |
WO2020107350A1 (en) * | 2018-11-29 | 2020-06-04 | 区链通网络有限公司 | Node management method and apparatus for blockchain system, and storage device |
CN111835572A (en) * | 2020-07-23 | 2020-10-27 | 上海优扬新媒信息技术有限公司 | Communication method and device of block chain network |
CN116128489A (en) * | 2023-04-18 | 2023-05-16 | 河北中废通网络技术有限公司 | Article recycling transaction processing method, device, terminal and medium based on blockchain |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6049797A (en) * | 1998-04-07 | 2000-04-11 | Lucent Technologies, Inc. | Method, apparatus and programmed medium for clustering databases with categorical attributes |
CN106656974A (en) * | 2016-10-17 | 2017-05-10 | 江苏通付盾科技有限公司 | Block chain grouping consensus method and system |
CN106845521A (en) * | 2016-12-23 | 2017-06-13 | 杭州云象网络技术有限公司 | A kind of block chain node clustering method of Behavior-based control time series |
CN107360206A (en) * | 2017-03-29 | 2017-11-17 | 阿里巴巴集团控股有限公司 | A kind of block chain common recognition method, equipment and system |
CN107807984A (en) * | 2017-10-31 | 2018-03-16 | 上海分布信息科技有限公司 | A kind of block chain network of subregion and its method for realizing subregion common recognition |
-
2018
- 2018-05-25 CN CN201810512702.6A patent/CN108717460A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6049797A (en) * | 1998-04-07 | 2000-04-11 | Lucent Technologies, Inc. | Method, apparatus and programmed medium for clustering databases with categorical attributes |
CN106656974A (en) * | 2016-10-17 | 2017-05-10 | 江苏通付盾科技有限公司 | Block chain grouping consensus method and system |
CN106845521A (en) * | 2016-12-23 | 2017-06-13 | 杭州云象网络技术有限公司 | A kind of block chain node clustering method of Behavior-based control time series |
CN107360206A (en) * | 2017-03-29 | 2017-11-17 | 阿里巴巴集团控股有限公司 | A kind of block chain common recognition method, equipment and system |
CN107807984A (en) * | 2017-10-31 | 2018-03-16 | 上海分布信息科技有限公司 | A kind of block chain network of subregion and its method for realizing subregion common recognition |
Non-Patent Citations (2)
Title |
---|
曹阳,钱晓东: "基于局部关键节点的大数据聚类算法", 《计算机工程与科学》 * |
韩璇: "区块链技术中的共识机制研究", 《信息网络安全》 * |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2020510894A (en) * | 2017-05-31 | 2020-04-09 | アリババ・グループ・ホールディング・リミテッドAlibaba Group Holding Limited | Blockchain consensus method and device |
US10706023B2 (en) | 2017-05-31 | 2020-07-07 | Alibaba Group Holding Limited | Blockchain consensus method and device |
US11126596B2 (en) | 2017-05-31 | 2021-09-21 | Advanced New Technologies Co., Ltd. | Blockchain consensus method and device |
WO2020107350A1 (en) * | 2018-11-29 | 2020-06-04 | 区链通网络有限公司 | Node management method and apparatus for blockchain system, and storage device |
CN110113388A (en) * | 2019-04-17 | 2019-08-09 | 四川大学 | A kind of method and apparatus of the block catenary system common recognition based on improved clustering algorithm |
CN110866546A (en) * | 2019-10-30 | 2020-03-06 | 深圳前海微众银行股份有限公司 | Method and device for evaluating consensus node |
WO2021082863A1 (en) * | 2019-10-30 | 2021-05-06 | 深圳前海微众银行股份有限公司 | Method and device for evaluating consensus node |
CN110866546B (en) * | 2019-10-30 | 2024-02-09 | 深圳前海微众银行股份有限公司 | Method and device for evaluating consensus node |
CN111835572A (en) * | 2020-07-23 | 2020-10-27 | 上海优扬新媒信息技术有限公司 | Communication method and device of block chain network |
CN111835572B (en) * | 2020-07-23 | 2023-01-13 | 度小满科技(北京)有限公司 | Communication method and device of block chain network |
CN116128489A (en) * | 2023-04-18 | 2023-05-16 | 河北中废通网络技术有限公司 | Article recycling transaction processing method, device, terminal and medium based on blockchain |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108717460A (en) | A kind of method and device reached common understanding in block chain | |
Xu et al. | Classification by nonlinear integral projections | |
CN110473083B (en) | Tree risk account identification method, device, server and storage medium | |
CN106484512B (en) | The dispatching method of computing unit | |
EP3349152A1 (en) | Classifying data | |
CN111612125B (en) | Novel HTM time pool method and system for online learning | |
CN108710948A (en) | A kind of transfer learning method based on cluster equilibrium and weight matrix optimization | |
CN108076158A (en) | Minimum load route selection method and system based on Naive Bayes Classifier | |
CN110991518B (en) | Two-stage feature selection method and system based on evolutionary multitasking | |
Cao et al. | A PSO-based cost-sensitive neural network for imbalanced data classification | |
CN110163262A (en) | Model training method, method for processing business, device, terminal and storage medium | |
CN115037628A (en) | Self-adaptive service function chain mapping method based on deep reinforcement learning | |
CN109976901A (en) | A kind of resource regulating method, device, server and readable storage medium storing program for executing | |
CN108762923A (en) | Method using differential evolution algorithm as Docker Swarm scheduling strategies | |
WO2020024444A1 (en) | Group performance grade recognition method and apparatus, and storage medium and computer device | |
CN116186278A (en) | Knowledge graph completion method based on hyperplane projection and relational path neighborhood | |
CN108875961A (en) | A kind of online weighting extreme learning machine method based on pre- boundary's mechanism | |
WO2021258961A1 (en) | Network traffic classification method and system based on improved k-means algorithm | |
CN110244787A (en) | The adjusting method and device of revolution speed control system | |
CN104574368B (en) | A kind of adaptive kernel clustering image partition method | |
CN109308496A (en) | A kind of optimal case method of selecting based on fuzzy clustering iterative and projection pursuit | |
CN109039797A (en) | Big stream detection method based on intensified learning | |
CN110233763B (en) | Virtual network embedding algorithm based on time sequence difference learning | |
CN108901045A (en) | A kind of the adaptive flow dispatching method and system of non-cooperative game | |
CN116630718A (en) | Prototype-based low-disturbance image type incremental learning algorithm |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181030 |
|
RJ01 | Rejection of invention patent application after publication |