CN109949160A - A kind of sharding method and device of block chain - Google Patents

A kind of sharding method and device of block chain Download PDF

Info

Publication number
CN109949160A
CN109949160A CN201910239329.6A CN201910239329A CN109949160A CN 109949160 A CN109949160 A CN 109949160A CN 201910239329 A CN201910239329 A CN 201910239329A CN 109949160 A CN109949160 A CN 109949160A
Authority
CN
China
Prior art keywords
network
subregion
node
partition
block chain
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
Application number
CN201910239329.6A
Other languages
Chinese (zh)
Inventor
金思惠子
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Du Xiaoman Technology Beijing Co Ltd
Original Assignee
SHANGHAI YOUYANG XINMEI INFORMATION TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHANGHAI YOUYANG XINMEI INFORMATION TECHNOLOGY Co Ltd filed Critical SHANGHAI YOUYANG XINMEI INFORMATION TECHNOLOGY Co Ltd
Priority to CN201910239329.6A priority Critical patent/CN109949160A/en
Publication of CN109949160A publication Critical patent/CN109949160A/en
Pending legal-status Critical Current

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

This application discloses the sharding methods and device of a kind of block chain using k nearest neighbor sorting algorithm, to determine target network subregion belonging to new node, so that new node is added in the target network subregion by informing response according to the received K subregion of new node.Since k nearest neighbor sorting algorithm can inform that response filters out the most network partition of the neighboring node including new node according to subregion, new node can be thus divided to using k nearest neighbor sorting algorithm including in the most network partition of its neighboring node, the node being closer is enabled to be divided to the same network partition, the communication efficiency in network partition between different nodes is improved, and then improves transaction processing efficiency in network partition.In addition, each network partition can handle alone transaction, the transaction for enabling each fragment parallel processing different to improve the concurrency of trading processing and confirmation, and then improves the handling capacity of entire block chain network.

Description

A kind of sharding method and device of block chain
Technical field
This application involves block chain technical field more particularly to a kind of sharding methods and device of block chain.
Background technique
Traditional block chain is single-stranded structure, and all nodes in block chain network are needed when some node is traded It is all participated in, and only when all nodes are reached common understanding, which really can be identified.However, with The increase of block chain network interior joint quantity, time needed for reaching global common recognition are also being continuously increased, so that entire block chain The handling capacity of network receives extreme influence.
To solve the above-mentioned problems, dilatation can be carried out to block chain network, and allocation methods are a kind of common expansions Appearance method.However, the fragment for how carrying out being accurately realized block chain is a urgent problem to be solved.
Summary of the invention
In order to solve the above technical problem existing in the prior art, the application provide a kind of block chain sharding method and Device can be realized the fragment purpose of block chain network, the transaction for enabling each fragment parallel processing different, to improve The concurrency of trading processing and confirmation, and then improve the handling capacity of entire block chain network.
To achieve the goals above, technical solution provided by the present application is as follows:
The application provides a kind of sharding method of block chain, comprising:
When block chain network is added in new node, existing node of the new node into the block chain network, which is sent, to be divided Area's acquisition request, so that the existing node informs response to new node feedback subregion according to the subregion acquisition request; Wherein, the block chain network includes at least one network partition;The network partition includes at least one described existing node; The subregion informs that response includes network partition belonging to existing node;
The new node informs the arrival time of response according to the subregion, receives the K subregion reached at first and informs and rings It answers;
K subregion informs response to the new node based on the received, using k nearest neighbor sorting algorithm, determines target network point Area, so that the new node is added in the target network subregion.
Optionally, after the target network subregion is added in the new node, further includes:
Judge whether the number of nodes of the target network subregion reaches the first preset threshold;
When the number of nodes of the target network subregion reaches the first preset threshold, the target network subregion is split into One network partition and the second network partition.
Optionally, the target network subregion is split into first network subregion and the second network partition, specifically includes:
The management node that the target network subregion is elected using default election algorithm, as the first management node;
According to the distance of existing nodes all in the target network subregion to first management node, get described The farthest existing node of first management node distance, as the second management node;
Using first management node as the management node of first network subregion, and using second management node as The management node of second network partition;
Compare all existing nodes in the target network subregion to first management node distance and the target All existing nodes, and will be closer apart from first management node to the distance of second management node in network partition Existing node is added to first network subregion, will be added to the second network apart from the closer existing node of second management node Subregion.
Optionally, further includes:
After old node is exited from third network partition, third management node is into the block chain network except described Other network partitions other than third network partition send heartbeat signal, so that other described network partitions are believed according to the heartbeat Number generate feedback signal;Wherein, the third management node is the management node of the third network partition;The heartbeat signal Carry the number of nodes of the third network partition;The feedback signal carries whether closed with the third network partition And information;
When the feedback signal carries the information merged with the third network partition, then the third management Node determines network partition to be combined according to the corresponding network partition of the feedback signal, and by the third network partition and institute Network partition to be combined is stated to merge.
Optionally, other described network partitions generate feedback signal according to the heartbeat signal, specifically include:
The number of nodes of the number of nodes of third network partition and current network subregion entrained by the heartbeat signal is carried out Adduction, obtains number of nodes summation;
When determining the number of nodes summation less than the second preset threshold, then generates and carry and the third network partition The feedback signal of the information merged;Wherein, second preset threshold is less than first preset threshold.
Optionally, when the third management node receives carrying and the third at least one network partition transmission When the feedback signal for the information that network partition merges, then the third management node is according to the corresponding net of the feedback signal Network subregion determines network partition to be combined, specifically includes:
The third management node is carried and is merged with the third network partition described in being initially received The corresponding network partition of the feedback signal of information is as network partition to be combined.
Optionally, other into the block chain network in addition to the third network partition of the third management node Network partition sends heartbeat signal, specifically includes:
The third management node sends heartbeat signal to the network partition of preset quantity, wherein the preset quantity Network partition is the distance chosen from other network partitions in the block chain network in addition to the third network partition The nearest network partition of the third network partition.
Present invention also provides a kind of slicing apparatus of block chain, comprising:
Subregion acquisition request transmission unit, for when block chain network is added in new node, the new node to be to the area Existing node in block chain network sends subregion acquisition request, so as to the existing node according to the subregion acquisition request to institute It states new node feedback subregion and informs response;Wherein, the block chain network includes at least one network partition;The network partition Including existing node described at least one;The subregion informs that response includes network partition belonging to existing node;
Subregion informs response receiving unit, informs the arrival time of response according to the subregion for the new node, connects It receives the K subregion reached at first and informs response;
Subregion determination unit, for the new node, K subregion informs response based on the received, is classified using k nearest neighbor and is calculated Method determines target network subregion, so that the new node is added in the target network subregion.
Optionally, further includes:
Judging unit, for judging the target network point after the target network subregion is added in the new node Whether the number of nodes in area reaches the first preset threshold;
Divide unit, for when the number of nodes of the target network subregion reaches the first preset threshold, the target network Network subregion is split into first network subregion and the second network partition.
Optionally, further includes:
Heartbeat signal transmission unit, for after old node is exited from third network partition, third management node to Other network partitions in the block chain network in addition to the third network partition send heartbeat signal;Wherein, described Three management nodes are the management node of the third network partition;The heartbeat signal carries the section of the third network partition Points;
Feedback signal generating unit generates feedback signal according to the heartbeat signal for other described network partitions;Its In, the feedback signal carries the information whether merged with the third network partition;
Subregion combining unit, for carrying the information merged with the third network partition when the feedback signal When, then the third management node determines network partition to be combined according to the corresponding network partition of the feedback signal, and by institute Third network partition is stated to merge with the network partition to be combined.
Compared with prior art, the application has at least the following advantages:
The sharding method of block chain provided by the present application is utilized by informing response according to the received K subregion of new node K nearest neighbor sorting algorithm determines target network subregion belonging to new node, so that new node is added in the target network subregion.By Inform that response is sent by K nearest apart from new node in block chain network existing nodes in the received K subregion of new node , and k nearest neighbor sorting algorithm can filter out the most network partition of the neighboring node including new node, thus it is close using K New node can be divided to including in the most network partition of its neighboring node by adjacent sorting algorithm, so that the node being closer It can be divided to the same network partition, so can be improved the communication efficiency in network partition between different nodes, into And improve transaction processing efficiency in network partition.In addition, block chain network includes multiple network partitions, so that each network point Area can handle transaction by oneself, the transaction for enabling each fragment parallel processing different, thus improve trading processing and really The concurrency recognized, and then improve the handling capacity of entire block chain network.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The some embodiments recorded in application, for those of ordinary skill in the art, without creative efforts, It can also be obtained according to these attached drawings other attached drawings.
Fig. 1 is the sharding method flow chart for the block chain that the application embodiment of the method one provides;
Fig. 2 is a kind of schematic diagram of embodiment of S103 provided by the embodiments of the present application;
Fig. 3 is the flow chart of the sharding method for the block chain that the application embodiment of the method two provides;
Fig. 4 is the schematic diagram of Paxos-like algorithm provided by the embodiments of the present application;
Fig. 5 is that target network subregion provided by the embodiments of the present application divides schematic diagram;
Fig. 6 is the flow chart of the sharding method for the block chain that the application embodiment of the method three provides;
Fig. 7 is the flow chart of the sharding method for the block chain that the application embodiment of the method four provides;
Fig. 8 is the structural schematic diagram of the slicing apparatus for the block chain that the application Installation practice one provides.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only this Invention a part of the embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art exist Every other embodiment obtained under the premise of creative work is not made, shall fall within the protection scope of the present invention.
Embodiment of the method one
Referring to Fig. 1, which is the sharding method flow chart for the block chain that the application embodiment of the method one provides.
The sharding method of block chain provided by the embodiments of the present application, comprising:
S101: when block chain network is added in new node, existing node of the new node into the block chain network Subregion acquisition request is sent, so that the existing node is informed according to the subregion acquisition request to new node feedback subregion Response.
S102: the new node informs the arrival time of response according to the subregion, receives the K subregion reached at first and accuses Know response.
S103: subregion informs response to the new node based on the received, using k nearest neighbor sorting algorithm, determines target network Subregion.
S104: the new node is added in the target network subregion.
The above are the application embodiment of the method one provide block chain sharding method specific execution step, for the ease of The specific embodiment of the sharding method for the block chain that explanation and understanding the application embodiment of the method one provides, will successively be situated between below Continue S101, S102 and S103.
The specific embodiment of S101 is introduced first.
In S101, block chain network includes at least one network partition, moreover, each network partition includes at least one Existing node;Wherein, existing node refers to included node in current time, block chain network.
For the ease of explanation and understanding S101, below will in one embodiment for be introduced.
As an implementation, S101 is specifically as follows:
S1011: when block chain network is added in new node, existing node of the new node into the block chain network Subregion acquisition request is sent respectively.
Subregion acquisition request is the request that the existing node from new node to be added into block chain network is sent, and And subregion acquisition request is used to that the existing node in block chain network to be requested to inform the network partition belonging to it.
New node can all have node into block chain network and send subregion acquisition request, to obtain block link network Network partition belonging to all existing nodes in network.Thus, as an implementation, when in block chain network include it is N number of When having node, S1011 is specifically as follows: when block chain network is added in new node, the new node is to the block chain network In N number of existing node send subregion acquisition request respectively.
The above are a kind of embodiments of S1011, and in this embodiment, new node can be into block chain network all Existing node sends subregion acquisition request, can so obtain network partition belonging to all existing nodes in block chain network, Be conducive to improve the accuracy of network partition belonging to determining new node.
In addition, new node, which can also have node to the part in block chain network, sends subregion acquisition request, to obtain Know partially have network partition belonging to node in block chain network.Wherein, the part in block chain network has node and refers to For determining that network partition belonging to new node is highly important node, and the existing node in the part can be according to default choosing Algorithm acquisition is selected, and default selection algorithm can be any selection algorithm.
Thus, as another embodiment, when in block chain network including N number of existing node, S1011 specifically can be with Are as follows: when block chain network is added in new node, selected from N number of existing node in block chain network according to default selection algorithm M existing nodes out, and subregion acquisition request is sent respectively from new node to the M existing nodes;Wherein, M≤N, M are positive whole Number.
The above are the another embodiments of S1011, in this embodiment, can select first with default selection algorithm Important part has node out, then has node to the part from new node and send subregion acquisition request, so can The efficiency for determining network partition belonging to new node is improved, to improve the sharding method execution efficiency of block chain.
S1012: when the existing node in block chain network receives subregion acquisition request, then the existing node is according to this Subregion acquisition request generates subregion and informs response, and the subregion is informed that response feeds back to new node.
Subregion informs that response is to be generated according to subregion acquisition request by the existing node in block chain network and fed back to newly The response of node, moreover, subregion inform response for by network partition belonging to the existing node in block chain network inform to New node.In this way, subregion informs that response may include network partition belonging to the existing node.
As an example, the first existing node in block chain network receives subregion acquisition request, and first has section When point belongs to first network subregion, then S1012 is specifically as follows: subregion acquisition request generates the first existing node based on the received Subregion informs response, so that the subregion informs that response includes first network subregion;Moreover, the first existing node will include the first net The subregion of network subregion informs that response feeds back to new node.
The above are the specific embodiments of S101, in this embodiment, described when block chain network is added in new node Existing node of the new node into the block chain network sends subregion acquisition request, so that the existing node is according to described point Area's acquisition request informs response to new node feedback subregion.
The specific embodiment of S102 is described below.
In block chain network, the distance between different nodes can be determined according to the call duration time between different nodes, Specifically: if the call duration time between two nodes is shorter, and the distance between two nodes are closer.Thus, in this application, The subregion that existing node is sent can be received according to new node informs the time point of response to determine new node and existing node Distance, specifically: if new node receives the subregion that existing node is sent and informs that the time of response is more early, it is determined that new node Has the distance between node relatively closely with this;If new node receive the subregion that existing node is sent inform time of response compared with Evening, it is determined that the distance between new node and the existing node are farther out.
It, can basis based on above content it is found that in order to enable the node being closer can belong to the same subregion Network partition belonging to the existing node being closer with new node determines network partition belonging to the new node, thus, in order to The efficiency of network partition belonging to determining new node is further increased, can only be obtained in this application closer apart from new node Network partition belonging to existing node, it is, new node only needs point for receiving to send apart from its closer existing node Inform response in area.
In addition, subregion informs that the arrival time of response refers to that new node receives the subregion and informs response in S102 Time point.
K is positive integer, and K can be preset, for example, K can be determined according to application scenarios.
As an example it is supposed that then S102 is specifically as follows when K is 10: when the M existing nodes in block chain network to New node sends subregion and informs that then new node informs the arrival time of response according to the subregion that the M node is sent when responding, and connects It receives 10 subregions reached at first and informs response;Wherein, M >=10.
The above are the specific embodiments of S102, and in this embodiment, new node informs response according to the subregion Arrival time receives the K subregion reached at first and informs response.It is rung in this way, new node can be informed with K subregion based on the received Answer, can know network partition belonging to the K nearest apart from the new node existing nodes, in order to it is subsequent can be according to the K Network partition belonging to a existing node determines network partition belonging to new node, can be realized the node that will be closer and draws Divide to the purpose of the same subregion.
The specific embodiment of S103 is described below.
In S103, target network subregion is for indicating network partition belonging to new node.
The process of k nearest neighbor sorting algorithm can be with are as follows: according to network point belonging to the K nearest apart from new node existing nodes The network partition most including neighboring node is selected in area, so as to using the network partition being selected as new node institute The network partition of category.
In addition, k nearest neighbor sorting algorithm can be any category that can determine target object according to the attribute of neighbour's object The algorithm of property.
It for the ease of explanation and understanding S103, is illustrated below in conjunction with Fig. 2, wherein Fig. 2 mentions for the embodiment of the present application A kind of schematic diagram of embodiment of the S103 of confession.
It include three network partitions in block chain network shown in Fig. 2: first network partition, 201, second networks point Area 202 and third network partition 203, wherein first network partition 201 includes 9 existing nodes, second network partition 202 include 7 existing nodes and third network partition 203 includes 7 existing nodes.
Assuming that can then determine when K is 5 apart from new node Pnew5 nearest existing nodes are as follows: the first existing node P1, the second existing node P2, third have node P3, the 4th existing node P4With the 5th existing node P5.At this point, S103 specifically may be used With are as follows: due to the first existing node P1, the second existing node P2Has node P with third3First network partition 201 is belonged to, And the 4th existing node P4Belong to second network partition 202, and the 5th existing node P5Belong to third network partition 203, because This, it is known that is in new node Pnew5 neighboring nodes in, 3 nodes belong to 201,1 node of first network subregion and belong to second 202,1 node of network partition belongs to third network partition 203, it follows that k nearest neighbor sorting algorithm will select to include neighbour The most first network subregion 203 of node is used as new node PnewAffiliated network partition, that is, target network subregion.
The above are the specific embodiments of S103, in this embodiment, can K subregion is accused based on the received with new node Know response, using k nearest neighbor sorting algorithm, determines target network subregion.Since k nearest neighbor sorting algorithm can be according to K neighbour There is network area belonging to node, select the network partition most including neighboring node, to divide the network being selected Area is as network partition belonging to new node, in this way, ensure that new node can be added to the net most including its neighboring node Network subregion, realize the purpose that the node that will be closer is divided to the same subregion.
The above are the specific embodiments of the sharding method of the block chain of the offer of embodiment of the method one, preferably In, it is responded by being informed according to the received K subregion of new node, using k nearest neighbor sorting algorithm, determines target network subregion, with Just new node is added in the target network subregion.Since the received K subregion of new node informs that response is by block chain network What the K existing nodes nearest apart from new node were sent, and k nearest neighbor sorting algorithm can will include that its neighboring node is most New node can be divided to using k nearest neighbor sorting algorithm and be saved including its neighbour as target network subregion by network partition In the most network partition of point, the node being closer is enabled to be divided to the same network partition, improves network point Communication efficiency in area between different nodes, and then improve transaction processing efficiency in network partition.In addition, block chain network packet Include multiple network partitions, each network partition enabled to handle transaction by oneself, enable each fragment parallel processing not Same transaction to improve the concurrency of trading processing and confirmation, and then improves the handling capacity of entire block chain network.
It should be noted that new node just becomes target network point after new node is added to target network subregion Existing node in area.
Sharding method based on the block chain that embodiment of the method one provides, in order to avoid included in heterogeneous networks subregion The number of existing node is excessive, and present invention also provides the sharding methods of another block chain, are solved below in conjunction with attached drawing It releases and illustrates.
Embodiment of the method two
Embodiment of the method is second is that the improvement carried out on the basis of embodiment of the method one, for the sake of brevity, method are implemented The part identical with content in embodiment of the method one of example two, details are not described herein.
Referring to Fig. 3, which is the flow chart of the sharding method for the block chain that the application embodiment of the method two provides.
The sharding method of block chain provided by the embodiments of the present application, comprising:
S301: when block chain network is added in new node, existing node of the new node into the block chain network Subregion acquisition request is sent, so that the existing node is informed according to the subregion acquisition request to new node feedback subregion Response.
S302: the new node informs the arrival time of response according to the subregion, receives the K subregion reached at first and accuses Know response.
S303: subregion informs response to the new node based on the received, using k nearest neighbor sorting algorithm, determines target network Subregion.
S304: the new node is added in the target network subregion.
The specific embodiment of S301 to S304 is identical as the specific embodiment of S101 to S104 respectively, in order to briefly rise See, details are not described herein.
S305: judging whether the number of nodes of the target network subregion reaches the first preset threshold, if so, executing S306;If it is not, then executing S307.
S306: the target network subregion is split into first network subregion and the second network partition.
S307: terminate the process that block chain network is added in the new node currently carried out.
The above are the application embodiment of the method two provide block chain sharding method specific execution step, for the ease of The specific embodiment of the sharding method for the block chain that explanation and understanding the application embodiment of the method two provides, will successively be situated between below Continue S305 and S306.
The specific embodiment of S305 is introduced first.
In S305, the first preset threshold can be preset, for example, the first preset threshold can be true according to application scenarios It is fixed.
As an example, then S305 is specifically as follows: judging the target network subregion when the first preset threshold is 15 Whether number of nodes reaches 15, if so, executing S306;If it is not, then executing S307.
The above are the specific embodiments of S305.
The specific embodiment of S306 is described below.
As an implementation, S306 is specifically as follows:
S3061: electing the management node (referred to as, leader) of the target network subregion using default election algorithm, As the first management node.
Management node is for being managed network area fission process or merging process belonging to the management node.
Default election algorithm can be it is any for electing the algorithm of management node, for example, default election algorithm can be with It is Paxos-like algorithm.
For the ease of explanation and understanding Paxos-like algorithm, it is introduced below in conjunction with Fig. 4.
The voting rule of Paxos-like algorithm is specifically as follows:
(1) timestamp of target network subregion is added as the mark id of the node in each node.
(2) in every wheel voting process, each node elects a leader, and will include node election The vote information of the id ballot round corresponding with the current ballot process of the node of leader, the node is broadcasted, also It is that vote information is sent to other nodes other than the node in target network subregion by the node.
(3) each node is when carrying out the first round of voting, it will usually elect oneself as leader.
(4) each node will vote, moreover, the throwing in the non-first round of voting according to its received vote information Ticket process specifically: when first node receives the first vote information, first have to see included ballot in the first vote information Round, if ballot round included by the first vote information is greater than the current ballot round of first node, by the first ballot Newest ballot round of the ballot round included by information as first node, and it is small to empty all ballot rounds on first node In the polled data of newest ballot round;Further according to the corresponding polled data election of current ballot round existing on first node Leader, and the voting results of first node are updated using the leader of the election, so that first node is by current ballot round Corresponding vote information is broadcasted.Wherein, the voting results of first node are according to the id of voter (it is, other nodes Id) determine, voter id is big to win, and voter id is consistent determines according to the id of the leader of vote by ballot, The id of leader is big to win.
It should be noted that above-mentioned voting process is illustrated so that first node receives the first vote information as an example , in this application, each node in target network region can be carried out using above-mentioned voting process, in order to briefly rise See, details are not described herein.
(4) if some node has had collected the poll of all nodes in a certain wheel ballot, or a certain There are the voting results of half to be directed toward the same leader in wheel ballot, then the node can select directly to receive the ballot knot Fruit, and the state of oneself is become no longer to receive new voting results, the node receives any ballot later, only can will really Fixed voting results are broadcasted.
(5) when some node has determined voting results and no longer receives new voting results, even if there is id very little Node attempts to elect oneself to be leader, other nodes can only return to determining voting results, which can only abandon The election of leader.
The above are the related contents of Paxos-like algorithm.
S3062: it according to the distance of existing nodes all in the target network subregion to first management node, obtains The existing node farthest to the first management node distance, as the second management node.
For the ease of explanation and understanding S3062, will be introduced by taking target network subregion shown in fig. 5 as an example below, In, Fig. 5 is that target network subregion provided by the embodiments of the present application divides schematic diagram.
Target network subregion 50 shown in fig. 5 includes 15 nodes, wherein PM1It is exactly the first management node, at this point, S3062 is specifically as follows: calculating and compares in target network subregion 50 in addition to the first management node PM1Other 14 sections in addition O'clock to the first management node PM1Distance, obtain node PM2It is to the first management node PM1The farthest existing node of distance, and will Node PM2As the second management node.
S3063: using first management node as the management node of first network subregion, and second management is saved Management node of the point as the second network partition.
As an example, as shown in figure 5, S3063 is specifically as follows: by the first management node PM1As first network point The management node in area 501, and by the second management node PM2Management node as the second network partition 502.
S3064: distance and institute of all existing nodes to first management node in the target network subregion All existing nodes in target network subregion are stated to the distance of second management node, and it will be apart from first management node Closer existing node is added to first network subregion, and will be added to apart from the closer existing node of second management node Two network partitions.
As an example, as shown in figure 5, S3064 is specifically as follows: all distances first in target network subregion 50 are managed Manage node PM1Closer existing node is added in first network subregion 501, and by all distances in target network subregion 50 Second management node PM2Closer existing node is added in the second network partition 502.
The above are 306 specific embodiments, in this embodiment, target network subregion can be divided into two points Area.
The above are the specific embodiments of the sharding method of the block chain of the offer of embodiment of the method two, preferably In, after the target network subregion is added in the new node, it is also necessary to which judging the number of nodes of the target network subregion is It is no to reach the first preset threshold;When the number of nodes of the target network subregion reaches the first preset threshold, the target network Subregion is split into first network subregion and the second network partition.It so, it is possible to guarantee each network partition in block chain network Number of nodes be no more than the first preset threshold, the network partition more including node is avoided the occurrence of, to advantageously ensure that every The ability of a network partition processing transaction keeps powerful and stablizes, and then improves the handling capacity of entire block chain network.
It should be noted that the process of block chain network and the target network point of an old wheel are added when the new node of a new round When area's fission process occurs simultaneously, the new node that node included by the target network subregion of an old wheel is not involved in a new round is added The process of block chain network.
Sharding method based on the block chain that above method embodiment one and embodiment of the method two provide, the embodiment of the present application The sharding method of another block chain is additionally provided, is explained and illustrated below in conjunction with attached drawing.
Embodiment of the method three
Embodiment of the method third is that the improvement carried out on the basis of embodiment of the method two or embodiment of the method one, for the ease of Explanation and illustration will be illustrated by taking the improvement carried out on the basis of embodiment of the method two as an example below, moreover, method is implemented The part identical with two content of embodiment of the method for example three, for the sake of brevity, details are not described herein.
Referring to Fig. 6, which is the flow chart of the sharding method for the block chain that the application embodiment of the method three provides.
The sharding method of block chain provided by the embodiments of the present application, comprising:
S601: when block chain network is added in new node, existing node of the new node into the block chain network Subregion acquisition request is sent, so that the existing node is informed according to the subregion acquisition request to new node feedback subregion Response.
S602: the new node informs the arrival time of response according to the subregion, receives the K subregion reached at first and accuses Know response.
S603: subregion informs response to the new node based on the received, using k nearest neighbor sorting algorithm, determines target network Subregion.
S604: the new node is added in the target network subregion.
S605: judging whether the number of nodes of the target network subregion reaches the first preset threshold, if so, executing S606;If it is not, then executing S607.
S606: the target network subregion is split into first network subregion and the second network partition.
S607: terminate the process that block chain network is added in the new node currently carried out.
The specific embodiment of S601 to S607 is identical as the specific embodiment of S301 to S307 respectively, in order to briefly rise See, details are not described herein.
S608: after old node is exited from third network partition, third management node is into the block chain network Other network partitions in addition to the third network partition send heartbeat signal.
S609: other network partitions in block chain network in addition to the third network partition are according to the heartbeat signal Generate feedback signal.
S610: whether third management node judges that the feedback signal is carried and merges with the third network partition Information, if so, execute S611;If it is not, then executing S613.
S611: the third management node determines network to be combined point according to the corresponding network partition of the feedback signal Area.
S612: the third network partition and the network partition to be combined are merged.
S613: the current state of third network partition is kept.
It should be noted that the execution sequence of S601 to S607 and S608 to S613 is not fixed, S608 can be first carried out extremely S613, then S601 is executed to S607;S601 to S607 can also be first carried out, then executes S608 to S613;It can also only carry out S601 to S607 does not execute S608 to S613;S608 to S613 can also be executed, does not execute S601 to S607, the application is to this It is not specifically limited.
The above are the application embodiment of the method three provide block chain sharding method specific execution step, for the ease of The specific embodiment of the sharding method for the block chain that explanation and understanding the application embodiment of the method three provides, will successively be situated between below Continue S608, S609 and S611.
The specific embodiment of S608 is introduced first.
In S608, third management node is the management node of the third network partition, moreover, for managing third net The division of network subregion merges related matters.
Heartbeat signal is used for other networks of third network partition into block chain network other than third network partition Subregion informs number of nodes included by third network partition, thus, heartbeat signal carries the node of the third network partition Number.
Third management node can into block chain network in addition to the third network partition all-network subregion hair Heartbeat signal is sent, thus, as an implementation, when block chain network includes N number of network partition, then S608 specifically can be with Are as follows: after old node is exited from third network partition, third management node removes the third network into block chain network N-1 network partition other than subregion sends heartbeat signal.
In order to further increase the division efficiency of network partition, and it is same to guarantee that the node being closer can be divided into In network partition, heartbeat signal only can be sent apart from the closer network partition of third network partition into block chain network, because And present invention also provides the another embodiments of S608, in this embodiment, S608 is specifically as follows:
The third management node sends heartbeat signal to the network partition of preset quantity, wherein the preset quantity Network partition is the distance chosen from other network partitions in the block chain network in addition to the third network partition The nearest network partition of the third network partition.
In addition, preset quantity can be preset, determined for example, preset quantity can be according to application scenarios.
The distance between two network partitions can be according to the flat of the distance between the node for belonging to heterogeneous networks subregion Mean value or adduction.
For example, it is assumed that first network subregion includes first node and second node, the second network partition includes third node And fourth node, then can by the distance between the distance between first node and third node, first node and fourth node, The distance between second node and third node and the distance between second node and fourth node sum up, and according to adduction Resulting result determines the distance between first network subregion and the second network partition.
The above are the specific embodiments of S608, in this embodiment, when old node is exited from third network partition Later, other network partitions of third management node into the block chain network in addition to the third network partition send the heart Jump signal.
The specific embodiment of S609 is described below.
In S609, feedback signal carries the information whether merged with the third network partition.
It should be noted that the network partition for each receiving heartbeat signal is performed both by S609's in block chain network All specific embodiments.
As an implementation, S609 is specifically as follows (for each network partition for receiving heartbeat signal To execute S6091-S6094):
S6091: by the node of the number of nodes of third network partition and current network subregion entrained by the heartbeat signal Number sums up, and obtains number of nodes summation.
S6092: number of nodes summation is judged whether less than the second preset threshold, if so, executing S6093;If it is not, then executing S6094。
Wherein, second preset threshold is less than first preset threshold, moreover, the second preset threshold can be set in advance It is fixed.For example, the second preset threshold can be 0.75 times of the first preset threshold.
S6093: the feedback signal for carrying the information merged with the third network partition is generated.
S6094: the feedback signal for not carrying the information merged with the third network partition is generated.
It should be noted that in order to avoid a network partition to other multiple network partitions while including pooling information The network partition can also be set as preparing to close by feedback signal while " generating the feedback signal including pooling information " And state, at this point, the heartbeat message of other no longer corresponding network partitions so can be avoided network point by the network partition Area and multiple network partitions merge generation, ensure that accuracy and unicity that subregion merges.
The above are the specific embodiments of S609, in this embodiment, except the third network point in block chain network Other network partitions other than area generate feedback signal according to the heartbeat signal, wherein include whether in feedback signal and the The information that three network partitions merge.
The specific embodiment of S611 is described below.
As an implementation, when the third management node receives carrying at least one network partition transmission When the feedback signal of the information merged with the third network partition, S611 is specifically as follows: the third management node Using the corresponding network partition of the feedback signal being initially received as network partition to be combined.
As an example it is supposed that third management node is sequentially received first network subregion, the second network partition and the 4th net The feedback signal for carrying the information merged with the third network partition that network subregion is sent, then S611 specifically can be with Are as follows: it is closed since third management node is initially received carrying for first network subregion transmission with the third network partition And information feedback signal, thus, third management node determine first network subregion be network partition to be combined.
It, can be with it should be noted that in order to avoid multiple network partitions wait third network partition and merge simultaneously It after network partition to be combined has been determined, sets third network partition to prepare merging phase, at this point, when in addition to be combined Other network partitions other than network partition are carried to the transmission of third network partition to be merged with the third network partition Information feedback signal when, third network partition will to other network partitions send carry merge failure information feedback Signal, to set general state for other network partitions other than network partition to be combined, at this point, other networks Subregion can continue to receive the heartbeat signal of other network partitions transmission.
The above are the specific embodiments of S611, and in this embodiment, third management node can be according to the feedback The corresponding network partition of signal determines network partition to be combined.
The above are the specific embodiments of the sharding method of the block chain of the offer of embodiment of the method three, preferably In, after old node is exited from third network partition, third management node removes the third into the block chain network Other network partitions other than network partition send heartbeat signal, so that other described network partitions are raw according to the heartbeat signal It is at feedback signal, and when the feedback signal carries the information merged with the third network partition, then described Third management node determines network partition to be combined according to the corresponding network partition of the feedback signal, and by the third network Subregion is merged with the network partition to be combined.It so, it is possible to guarantee that each network partition in block chain network is wrapped The number of nodes included is not less than the second preset threshold, the appearance of smaller network partition is avoided, to ensure that heterogeneous networks subregion The capacity variance for handling transaction is smaller, ensure that and has advantageously ensured that the ability of each network partition processing transaction keeps powerful And stablize, and then improve the handling capacity of entire block chain network.
It should be noted that in this application, if the process of block chain network is added in new node, network partition divides At least two implementation procedures during process and network partition merge occur simultaneously, then each process is independent progress , moreover, each network partition is only capable of participating in an implementation procedure, two implementation procedures cannot be simultaneously participated in.It can so keep away Exempt from the interference between different implementation procedures, ensure that going on smoothly for different implementation procedures.
Sharding method based on the block chain that above method embodiment one to embodiment of the method two provides, the embodiment of the present application A kind of specific embodiment of sharding method of block chain is additionally provided, is explained and illustrated below in conjunction with attached drawing.
Embodiment of the method four
Embodiment of the method is fourth is that carry out on the basis of embodiment of the method three, embodiment of the method two or embodiment of the method one It improves, for the ease of explanation and illustration, will be illustrated by taking the improvement carried out on the basis of embodiment of the method three as an example below, Moreover, the part identical with three content of embodiment of the method for embodiment of the method four, for the sake of brevity, details are not described herein.
Referring to Fig. 7, which is the flow chart of the sharding method for the block chain that the application embodiment of the method four provides.
The sharding method of block chain provided by the embodiments of the present application, comprising:
S701: when new node be added block chain network when, judge new node whether be block chain network first node, If so, executing S702;If it is not, then executing S703.
S702: new node is added in the first network subregion of block chain network, and is carried out to block chain network initial Change.
S703: existing node of the new node into the block chain network sends subregion acquisition request, so as to described Existing node informs response to new node feedback subregion according to the subregion acquisition request.
S704: the new node informs the arrival time of response according to the subregion, receives the K subregion reached at first and accuses Know response.
S705: subregion informs response to the new node based on the received, using k nearest neighbor sorting algorithm, determines target network Subregion.
S706: the new node is added in the target network subregion.
S707: judging whether the number of nodes of the target network subregion reaches the first preset threshold, if so, executing S708;If it is not, then executing S709.
S708: the target network subregion is split into first network subregion and the second network partition.
S709: terminate the process that block chain network is added in the new node currently carried out.
S710: after old node is exited from third network partition, third management node is into the block chain network Other network partitions in addition to the third network partition send heartbeat signal.
S711: other network partitions in block chain network in addition to the third network partition are according to the heartbeat signal Generate feedback signal.
S712: whether third management node judges that the feedback signal is carried and merges with the third network partition Information, if so, execute S713;If it is not, then executing S715.
S713: the third management node determines network to be combined point according to the corresponding network partition of the feedback signal Area.
S714: the third network partition and the network partition to be combined are merged.
S715: the current state of third network partition is kept.
The specific embodiment of S703 to S715 is identical as the specific embodiment of S601 to S613 respectively, in order to briefly rise See, details are not described herein.
The above are the application embodiment of the method four provide block chain sharding method specific execution step, for the ease of The specific embodiment of the sharding method for the block chain that explanation and understanding the application embodiment of the method four provides, will successively be situated between below Continue S701 and S702.
The specific embodiment of S701 is introduced first.
In S701, when new node is first node of block chain network, then it represents that the block chain network starts to create It builds, at this point, any node is not present in block chain network, therefore, it is possible to new node is added directly into the block chain network, And the new node is divided into first network subregion, so that the node of subsequent addition can be according to first of block chain network Node determines the network partition belonging to it.
When new node is not first node of block chain network, then it represents that had at least one in the block chain network A node, at this point, the new node it can be determined according to node existing in block chain network belonging to network partition.
The above are the specific embodiments of S701.
The specific embodiment of S702 is described below.
In S702, since new node is first node in block chain network, therefore, it is possible to be divided to first In network partition, but also can be using the new node as the management node of first network subregion.
Moreover, first node as block chain network, new node are also responsible for the initial work of block chain network, and And the initial work specifically includes (A) to (D):
(A) primary account is created, transaction is initiated by account.
(B) creation wound generation block.The starting of one new block chain needs to create first block, that is, wound generation block, wound Some basic setups are needed to configure in generation block: (a) independent block chain network id, network id meeting when connecting other nodes It uses, the node of different id networks can not be connected with each other;(b) mine complexity is dug, the efficiency that mine disaster degree determines out block is dug, it can It is configured according to business demand;(c) primary account remaining sum.Initial phase, the remaining sum of primary account;(d) each block Generate the upper limit for needing the resource consumed.The generation of each block needs to consume a certain number of token.
(C) block chain is initialized, the local directory that block chain related data saves is formulated.
(D) account and miner are bound, and starts to dig mine.
The above are the specific embodiments of S702, in this embodiment, will be as first node in block chain network New node be added in the first network subregion of block chain network, and block chain network is initialized.
In addition, each network in each network partition occurs for common recognition mechanism in block chain network provided by the present application Subregion carries out the related content of common recognition mechanism are as follows: (1) initiation traded every time initiates subregion belonging to node by transaction to execute Common recognition;(2) existing common common recognition agreement, such as PBFT, PoW etc. can be used in the common recognition in subregion.PBFT is in fragment scale It is smaller, and in the lesser situation of network overhead, higher efficiency can be reached, therefore in the lesser situation of fragment scale, this hair It is bright to be recommended to use PBFT common recognition agreement to make full use of the advantage of fragment mechanism.(3) it after each subregion obtains common recognition, can will obtain The transaction of common recognition is submitted to block chain, and is responsible for whether submitted transaction conflicts with transaction existing on block chain, once it hands over It easily is submitted to block chain, is final state, it will not forked situation.
It should be noted that in this application, existing common recognition mechanism can be used in common recognition mechanism, it should be noted that each The leader of a network partition is merely responsible for the related work that processing subregion merges and divides, and common recognition mechanism is not influenced, i.e., Node as leader does not have high priority in common recognition mechanism.
The above are the specific embodiments of the sharding method of the block chain of the offer of embodiment of the method four, preferably In, when block chain network is added in new node, and new node is first node of block chain network, then new node is added to In the first network subregion of block chain network, and block chain network is initialized.So realize the first of block chain network Beginningization is conducive to subsequent to carry out embodiment of the method one using the block chain network of initialization and provide to embodiment of the method three The sharding method of block chain.
Sharding method based on the block chain that above method embodiment one to embodiment of the method four provides, the embodiment of the present application The slicing apparatus of block chain is additionally provided, is explained and illustrated below in conjunction with attached drawing.
Installation practice one
Referring to Fig. 8, which is the structural schematic diagram of the slicing apparatus for the block chain that the application Installation practice one provides.
The slicing apparatus of block chain provided by the embodiments of the present application, comprising:
Subregion acquisition request transmission unit 801, for when block chain network is added in new node, the new node to be to described Existing node in block chain network sends subregion acquisition request, so as to the existing node according to the subregion acquisition request to The new node feedback subregion informs response;Wherein, the block chain network includes at least one network partition;The network point Area includes at least one described existing node;The subregion informs that response includes network partition belonging to the existing node;
Subregion informs response receiving unit 802, informs the arrival time of response according to the subregion for the new node, It receives the K subregion reached at first and informs response;
Subregion determination unit 803, for the new node, K subregion informs response based on the received, is classified using k nearest neighbor Algorithm determines target network subregion, so that the new node is added in the target network subregion.
It as an implementation, should in order to further increase the trading processing ability and handling capacity of block chain network The slicing apparatus of block chain further include:
Judging unit, for judging the target network point after the target network subregion is added in the new node Whether the number of nodes in area reaches the first preset threshold;
Divide unit, for when the number of nodes of the target network subregion reaches the first preset threshold, the target network Network subregion is split into first network subregion and the second network partition.
As an implementation, in order to further increase the trading processing ability and handling capacity of block chain network, institute Division unit is stated to specifically include:
Subelement is elected, for electing the management node of the target network subregion using default election algorithm, as First management node;
Subelement is obtained, for according to existing nodes all in the target network subregion to first management node Distance gets the farthest existing node of the first management node distance, as the second management node;
Subelement is set, for using first management node as the management node of first network subregion, and will described in Management node of second management node as the second network partition;
Subelement is divided, for all existing nodes in the target network subregion to first management node Distance, and will be apart from described first at a distance from all existing nodes to second management node in the target network subregion The closer existing node of management node is added to first network subregion, will be apart from the closer existing node of second management node It is added to the second network partition.
It as an implementation, should in order to further increase the trading processing ability and handling capacity of block chain network The slicing apparatus of block chain further include:
Heartbeat signal transmission unit, for after old node is exited from third network partition, third management node to Other network partitions in the block chain network in addition to the third network partition send heartbeat signal;Wherein, described Three management nodes are the management node of the third network partition;The heartbeat signal carries the section of the third network partition Points;
Feedback signal generating unit generates feedback signal according to the heartbeat signal for other described network partitions;Its In, the feedback signal carries the information whether merged with the third network partition;
Subregion combining unit, for carrying the information merged with the third network partition when the feedback signal When, then the third management node determines network partition to be combined according to the corresponding network partition of the feedback signal, and by institute Third network partition is stated to merge with the network partition to be combined.
As an implementation, in order to further increase the trading processing ability and handling capacity of block chain network, institute Feedback signal generating unit is stated, is specifically included:
Subelement is summed it up, for dividing the number of nodes of third network partition entrained by the heartbeat signal and current network The number of nodes in area sums up, and obtains number of nodes summation;
Generate subelement, for when determining the number of nodes summation less than the second preset threshold, then generate carry with The feedback signal for the information that the third network partition merges;Wherein, it is pre- to be less than described first for second preset threshold If threshold value.
As an implementation, in order to further increase the trading processing ability and handling capacity of block chain network, institute Combining unit is stated, is specifically included:
When the third management node receives carrying and the third network point at least one network partition transmission When the feedback signal for the information that area merges, the third management node will be initially received described in carry and described The corresponding network partition of the feedback signal for the information that three network partitions merge is as network partition to be combined, and by described Three network partitions are merged with the network partition to be combined.
As an implementation, in order to further increase the trading processing ability and handling capacity of block chain network, institute Heartbeat signal transmission unit is stated, is specifically included:
The third management node sends heartbeat signal to the network partition of preset quantity, wherein the preset quantity Network partition is the distance chosen from other network partitions in the block chain network in addition to the third network partition The nearest network partition of the third network partition.
The above are the specific embodiments of the slicing apparatus of the block chain of the offer of Installation practice one, preferably In, it is responded by being informed according to the received K subregion of new node, using k nearest neighbor sorting algorithm, determines target network subregion, with Just new node is added in the target network subregion.Since the received K subregion of new node informs that response is by block chain network What the K existing nodes nearest apart from new node were sent, and k nearest neighbor sorting algorithm can will include that its neighboring node is most New node can be divided to using k nearest neighbor sorting algorithm and be saved including its neighbour as target network subregion by network partition In the most network partition of point, the node being closer is enabled to be divided to the same network partition, improves network point Communication efficiency in area between different nodes, and then improve transaction processing efficiency in network partition.In addition, block chain network packet Include multiple network partitions, each network partition enabled to handle transaction by oneself, enable each fragment parallel processing not Same transaction to improve the concurrency of trading processing and confirmation, and then improves the handling capacity of entire block chain network.
It should be appreciated that in this application, " at least one (item) " refers to one or more, and " multiple " refer to two or two More than a."and/or" indicates may exist three kinds of relationships, for example, " A and/or B " for describing the incidence relation of affiliated partner It can indicate: only exist A, only exist B and exist simultaneously tri- kinds of situations of A and B, wherein A, B can be odd number or plural number.Word Symbol "/" typicallys represent the relationship that forward-backward correlation object is a kind of "or"." at least one of following (a) " or its similar expression, refers to Any combination in these, any combination including individual event (a) or complex item (a).At least one of for example, in a, b or c (a) can indicate: a, b, c, " a and b ", " a and c ", " b and c ", or " a and b and c ", and wherein a, b, c can be individually, can also To be multiple.
The above described is only a preferred embodiment of the present invention, being not intended to limit the present invention in any form.Though So the present invention has been disclosed as a preferred embodiment, and however, it is not intended to limit the invention.It is any to be familiar with those skilled in the art Member, without departing from the scope of the technical proposal of the invention, all using the methods and technical content of the disclosure above to the present invention Technical solution makes many possible changes and modifications or equivalent example modified to equivalent change.Therefore, it is all without departing from The content of technical solution of the present invention, according to the technical essence of the invention any simple modification made to the above embodiment, equivalent Variation and modification, all of which are still within the scope of protection of the technical scheme of the invention.

Claims (10)

1. a kind of sharding method of block chain characterized by comprising
When block chain network is added in new node, existing node of the new node into the block chain network sends subregion and obtains Request is taken, so that the existing node informs response to new node feedback subregion according to the subregion acquisition request;Wherein, The block chain network includes at least one network partition;The network partition includes at least one described existing node;It is described Subregion informs that response includes network partition belonging to existing node;
The new node informs the arrival time of response according to the subregion, receives the K subregion reached at first and informs response;
K subregion informs response to the new node based on the received, using k nearest neighbor sorting algorithm, determines target network subregion, with Toilet is stated new node and is added in the target network subregion.
2. the method according to claim 1, wherein when the new node be added the target network subregion it Afterwards, further includes:
Judge whether the number of nodes of the target network subregion reaches the first preset threshold;
When the number of nodes of the target network subregion reaches the first preset threshold, the target network subregion is split into the first net Network subregion and the second network partition.
3. the method according to claim 1, wherein the target network subregion be split into first network subregion and Second network partition, specifically includes:
The management node that the target network subregion is elected using default election algorithm, as the first management node;
According to existing nodes all in the target network subregion to the distance of first management node, described first is got The farthest existing node of management node distance, as the second management node;
Using first management node as the management node of first network subregion, and using second management node as second The management node of network partition;
Compare distance and the target network of all existing nodes to first management node in the target network subregion All existing nodes, and will be closer existing apart from first management node to the distance of second management node in subregion Node is added to first network subregion, and the second network point will be added to apart from the closer existing node of second management node Area.
4. the method according to claim 1, wherein further include:
After old node is exited from third network partition, third management node removes the third into the block chain network Other network partitions other than network partition send heartbeat signal, so that other described network partitions are raw according to the heartbeat signal At feedback signal;Wherein, the third management node is the management node of the third network partition;The heartbeat signal carries There is the number of nodes of the third network partition;The feedback signal carries whether merge with the third network partition Information;
When the feedback signal carries the information merged with the third network partition, then the third management node Determine network partition to be combined according to the corresponding network partition of the feedback signal, and by the third network partition and it is described to Merge network partition to merge.
5. according to the method described in claim 4, it is characterized in that, other described network partitions are generated according to the heartbeat signal Feedback signal specifically includes:
The number of nodes of the number of nodes of third network partition and current network subregion entrained by the heartbeat signal is summed up, Obtain number of nodes summation;
When determining the number of nodes summation less than the second preset threshold, then generates and carry and third network partition progress The feedback signal of combined information;Wherein, second preset threshold is less than first preset threshold.
6. according to the method described in claim 4, it is characterized in that, when the third management node receives at least one network When the feedback signal for carrying the information merged with the third network partition that subregion is sent, then the third management section Point determines network partition to be combined according to the corresponding network partition of the feedback signal, specifically includes:
The third management node carries the information merged with the third network partition described in being initially received The corresponding network partition of feedback signal as network partition to be combined.
7. according to the method described in claim 4, it is characterized in that, the third management node is removed into the block chain network Other network partitions other than the third network partition send heartbeat signal, specifically include:
The third management node sends heartbeat signal to the network partition of preset quantity, wherein the network of the preset quantity Subregion is described in the distance chosen from other network partitions in the block chain network in addition to the third network partition The nearest network partition of third network partition.
8. a kind of slicing apparatus of block chain characterized by comprising
Subregion acquisition request transmission unit, for when block chain network is added in new node, the new node to be to the block chain Existing node in network sends subregion acquisition request, so as to the existing node according to the subregion acquisition request to described new Node feeding back subregion informs response;Wherein, the block chain network includes at least one network partition;The network partition includes At least one described existing node;The subregion informs that response includes network partition belonging to existing node;
Subregion informs response receiving unit, informs the arrival time of response according to the subregion for the new node, receives most The K subregion first reached informs response;
Subregion determination unit, for the new node, K subregion informs response based on the received, using k nearest neighbor sorting algorithm, really Set the goal network partition, so that the new node is added in the target network subregion.
9. device according to claim 8, which is characterized in that further include:
Judging unit, for judging the target network subregion after target network subregion is added in the new node Whether number of nodes reaches the first preset threshold;
Unit is divided, for when the number of nodes of the target network subregion reaches the first preset threshold, the target network to divide Area is split into first network subregion and the second network partition.
10. device according to claim 8, which is characterized in that further include:
Heartbeat signal transmission unit, for after old node is exited from third network partition, third management node is to described Other network partitions in block chain network in addition to the third network partition send heartbeat signal;Wherein, the third pipe Manage the management node that node is the third network partition;The heartbeat signal carries the node of the third network partition Number;
Feedback signal generating unit generates feedback signal according to the heartbeat signal for other described network partitions;Wherein, institute It states feedback signal and carries the information whether merged with the third network partition;
Subregion combining unit, for when the feedback signal carries the information merged with the third network partition, Then the third management node determines network partition to be combined according to the corresponding network partition of the feedback signal, and by described Three network partitions are merged with the network partition to be combined.
CN201910239329.6A 2019-03-27 2019-03-27 A kind of sharding method and device of block chain Pending CN109949160A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910239329.6A CN109949160A (en) 2019-03-27 2019-03-27 A kind of sharding method and device of block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910239329.6A CN109949160A (en) 2019-03-27 2019-03-27 A kind of sharding method and device of block chain

Publications (1)

Publication Number Publication Date
CN109949160A true CN109949160A (en) 2019-06-28

Family

ID=67011902

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910239329.6A Pending CN109949160A (en) 2019-03-27 2019-03-27 A kind of sharding method and device of block chain

Country Status (1)

Country Link
CN (1) CN109949160A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110619020A (en) * 2019-09-02 2019-12-27 杭州趣链科技有限公司 Block chain fragmentation method based on machine learning
CN110808838A (en) * 2019-10-24 2020-02-18 华东师范大学 Alliance chain-oriented fragmentation method
CN110958324A (en) * 2019-12-12 2020-04-03 上海优扬新媒信息技术有限公司 Data processing method and device of block chain network
CN111125593A (en) * 2019-11-14 2020-05-08 深圳源中瑞科技有限公司 Block chain-based family tree information processing method and device and storage medium
CN111510309A (en) * 2020-04-08 2020-08-07 深圳大学 Block chain data transmission method, device, equipment and computer readable storage medium
CN111614709A (en) * 2019-02-26 2020-09-01 傲为信息技术(江苏)有限公司 Partition transaction method and system based on block chain
CN111736963A (en) * 2020-06-08 2020-10-02 中国科学院计算技术研究所 Transaction processing system and method for backbone-free multi-partition blockchain
CN112260836A (en) * 2020-09-28 2021-01-22 电子科技大学 Method for improving block chain throughput based on fragmentation technology
CN113395357A (en) * 2021-08-16 2021-09-14 支付宝(杭州)信息技术有限公司 Method and device for fragmenting block chain system
WO2021254029A1 (en) * 2020-01-17 2021-12-23 厦门潭宏信息科技有限公司 Consensus and resource transmission methods, device, and storage medium
CN114710486A (en) * 2022-03-09 2022-07-05 合肥工业大学 Method and system for monitoring fragment single-point overheating in block chain system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106355449A (en) * 2016-08-31 2017-01-25 腾讯科技(深圳)有限公司 User selecting method and device
CN106610977A (en) * 2015-10-22 2017-05-03 阿里巴巴集团控股有限公司 Data clustering method and device
CN106886795A (en) * 2017-02-17 2017-06-23 北京维弦科技有限责任公司 Object identification method based on the obvious object in image
CN107079059A (en) * 2016-12-21 2017-08-18 深圳前海达闼云端智能科技有限公司 Block chain storage method and device and node equipment
CN107766542A (en) * 2017-10-30 2018-03-06 上海分布信息科技有限公司 A kind of block chain network of subregion and its method for realizing subregion inquiry
CN108197474A (en) * 2017-12-29 2018-06-22 北京交通大学 The classification of mobile terminal application and detection method
CN108768665A (en) * 2018-07-02 2018-11-06 上海达家迎信息科技有限公司 Block chain generation method, device, computer equipment and storage medium
CN108900321A (en) * 2018-06-06 2018-11-27 广州链块科技有限公司 The method that a kind of block chain by stages carries out real-time atom transaction
CN109413175A (en) * 2018-10-19 2019-03-01 北京奇艺世纪科技有限公司 A kind of information processing method, device and electronic equipment
CN109510876A (en) * 2018-12-20 2019-03-22 弗洛格(武汉)信息科技有限公司 A kind of alliance's chain sharding method and corresponding alliance's chain based on PBFT

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106610977A (en) * 2015-10-22 2017-05-03 阿里巴巴集团控股有限公司 Data clustering method and device
CN106355449A (en) * 2016-08-31 2017-01-25 腾讯科技(深圳)有限公司 User selecting method and device
CN107079059A (en) * 2016-12-21 2017-08-18 深圳前海达闼云端智能科技有限公司 Block chain storage method and device and node equipment
CN106886795A (en) * 2017-02-17 2017-06-23 北京维弦科技有限责任公司 Object identification method based on the obvious object in image
CN107766542A (en) * 2017-10-30 2018-03-06 上海分布信息科技有限公司 A kind of block chain network of subregion and its method for realizing subregion inquiry
CN108197474A (en) * 2017-12-29 2018-06-22 北京交通大学 The classification of mobile terminal application and detection method
CN108900321A (en) * 2018-06-06 2018-11-27 广州链块科技有限公司 The method that a kind of block chain by stages carries out real-time atom transaction
CN108768665A (en) * 2018-07-02 2018-11-06 上海达家迎信息科技有限公司 Block chain generation method, device, computer equipment and storage medium
CN109413175A (en) * 2018-10-19 2019-03-01 北京奇艺世纪科技有限公司 A kind of information processing method, device and electronic equipment
CN109510876A (en) * 2018-12-20 2019-03-22 弗洛格(武汉)信息科技有限公司 A kind of alliance's chain sharding method and corresponding alliance's chain based on PBFT

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
朱明: "《数据挖掘导论》", 30 January 2012 *

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111614709A (en) * 2019-02-26 2020-09-01 傲为信息技术(江苏)有限公司 Partition transaction method and system based on block chain
CN110619020A (en) * 2019-09-02 2019-12-27 杭州趣链科技有限公司 Block chain fragmentation method based on machine learning
CN110619020B (en) * 2019-09-02 2022-04-01 杭州趣链科技有限公司 Block chain fragmentation method based on machine learning
CN110808838A (en) * 2019-10-24 2020-02-18 华东师范大学 Alliance chain-oriented fragmentation method
CN111125593A (en) * 2019-11-14 2020-05-08 深圳源中瑞科技有限公司 Block chain-based family tree information processing method and device and storage medium
CN111125593B (en) * 2019-11-14 2024-01-26 深圳源中瑞科技有限公司 Family tree information processing method, equipment and storage medium based on block chain
CN110958324A (en) * 2019-12-12 2020-04-03 上海优扬新媒信息技术有限公司 Data processing method and device of block chain network
CN110958324B (en) * 2019-12-12 2023-12-19 度小满科技(北京)有限公司 Data processing method and device of block chain network
WO2021254029A1 (en) * 2020-01-17 2021-12-23 厦门潭宏信息科技有限公司 Consensus and resource transmission methods, device, and storage medium
CN111510309B (en) * 2020-04-08 2022-05-10 深圳大学 Block chain data transmission method, device, equipment and computer readable storage medium
CN111510309A (en) * 2020-04-08 2020-08-07 深圳大学 Block chain data transmission method, device, equipment and computer readable storage medium
CN111736963A (en) * 2020-06-08 2020-10-02 中国科学院计算技术研究所 Transaction processing system and method for backbone-free multi-partition blockchain
CN111736963B (en) * 2020-06-08 2022-10-11 中国科学院计算技术研究所 Transaction processing system and method for backbone-free multi-partition block chain
CN112260836A (en) * 2020-09-28 2021-01-22 电子科技大学 Method for improving block chain throughput based on fragmentation technology
CN113395357A (en) * 2021-08-16 2021-09-14 支付宝(杭州)信息技术有限公司 Method and device for fragmenting block chain system
CN114710486B (en) * 2022-03-09 2023-09-08 合肥工业大学 Method and system for monitoring fragmented single-point overheating in block chain system
CN114710486A (en) * 2022-03-09 2022-07-05 合肥工业大学 Method and system for monitoring fragment single-point overheating in block chain system

Similar Documents

Publication Publication Date Title
CN109949160A (en) A kind of sharding method and device of block chain
CN104995870B (en) Multiple target server arrangement determines method and apparatus
CN103309738B (en) User job dispatching method and device
CN103686865B (en) The decision making device and method of Internet usage
Pei et al. Blockchain-enabled dynamic spectrum access: cooperative spectrum sensing, access and mining
CN109218348A (en) The determination method and node device of block in a kind of block chain
WO2023019604A1 (en) Minimum network energy consumption optimization method and system based on traffic grooming
CN110855737B (en) Consistency level controllable self-adaptive data synchronization method and system
CN106878382A (en) Dynamically change the method and device of cluster scale in a kind of distributed arbitration program cluster
CN104182283B (en) A kind of task synchronization method
CN114091610A (en) Intelligent decision method and device
Lopez-Pajares et al. The disjoint multipath challenge: Multiple disjoint paths guaranteeing scalability
Baek et al. Cost effective mobile agent planning for distributed information retrieval
CN108173899B (en) Information processing method and device of block chain
Wang et al. Cluster maintenance in mobile ad-hoc networks
CN103164745A (en) Maintenance supply chain integration mechanism based on ant colony algorithm and multi-agent technology
CN108055321B (en) High-reliability cluster construction method based on localization platform
JP6427697B1 (en) INFORMATION PROCESSING APPARATUS, INFORMATION PROCESSING METHOD, PROGRAM, AND INFORMATION PROCESSING SYSTEM
CN103970860B (en) Method, device and system for processing data
Barreto et al. An efficient and fault-tolerant update commitment protocol for weakly connected replicas
Devanarayana et al. Proactive channel access in cognitive radio networks using statistical radio environment maps
CN117687800B (en) Cross-domain distributed computing method, system, storage medium and electronic equipment
Lakhlef et al. Efficient broadcast protocol for the internet of things
Montresor et al. Decentralized ranking in large-scale overlay networks
Han et al. Design and analysis of connected dominating set formation for topology control in wireless ad hoc networks

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

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

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

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

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

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

Effective date of registration: 20211213

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

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

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

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

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190628