CN114037531A - Fragment account adjusting method of block chain fragment system and related device thereof - Google Patents

Fragment account adjusting method of block chain fragment system and related device thereof Download PDF

Info

Publication number
CN114037531A
CN114037531A CN202111315947.8A CN202111315947A CN114037531A CN 114037531 A CN114037531 A CN 114037531A CN 202111315947 A CN202111315947 A CN 202111315947A CN 114037531 A CN114037531 A CN 114037531A
Authority
CN
China
Prior art keywords
fragment
account
work
coordination
accounts
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
CN202111315947.8A
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.)
Sun Yat Sen University
Original Assignee
Sun Yat Sen University
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 Sun Yat Sen University filed Critical Sun Yat Sen University
Priority to CN202111315947.8A priority Critical patent/CN114037531A/en
Publication of CN114037531A publication Critical patent/CN114037531A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Computing Systems (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The block chain fragmentation system comprises work fragments and coordination fragments, the coordination fragments collect transaction information generated by transactions between current work fragment processing accounts, and an account transaction network is constructed according to the transaction information; the coordination fragments calculate the sum of the weights of the edges among the account sets through the account transaction network, and the accounts of all the work fragments are divided again by taking the minimum sum of the weights of the edges among different account sets as an optimization target to obtain a division result; the coordination fragment sends the division result to the work fragment, so that the work fragment updates the account information of the work fragment according to the division result, and the technical problems that the existing block chain fragment system has too many cross-fragment transactions, the throughput of the fragment system is reduced, and the confirmation delay of the transactions is increased are solved.

Description

Fragment account adjusting method of block chain fragment system and related device thereof
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method for adjusting a segment account of a blockchain segment system and a related device thereof.
Background
The scalability of blockchain is still a big limitation to the development of blockchain technology. Throughput is always its bottleneck for blockchain networks. To improve the scalability and throughput of blockchain systems, fragmentation techniques are introduced into blockchain networks. In a traditional blockchain network, all nodes in the network maintain the same ledger and process all transactions. With the fragmentation technique, the nodes on the network are divided into different groups, each group being referred to as a fragment. Transactions arriving in the network are also divided into different segments according to certain rules. Therefore, in the fragmentation network, the fragmentation node only needs to process the transaction belonging to the fragmentation, and the plurality of fragmentation processes different transactions in parallel, thereby greatly improving the throughput of the system. However, the blockchain fragmentation system still has many defects, and as the number of fragments increases, almost all transactions are cross-fragment transactions in the existing fragmentation system, which increases the overhead of the fragmentation system, reduces the throughput of the fragmentation system, and increases the confirmation delay of the transactions.
Disclosure of Invention
The application provides a fragment account adjusting method of a blockchain fragment system and a related device thereof, which are used for solving the technical problems that the existing blockchain fragment system has too many cross-fragment transactions, the throughput of the fragment system is reduced, and the confirmation delay of the transactions is increased.
In view of this, a first aspect of the present application provides a method for adjusting a segment account of a blockchain segment system, where the blockchain segment system includes a work segment and a coordination segment, and the method includes:
the coordination fragments collect transaction information generated by the transaction between the current work fragment processing accounts, and an account transaction network G (V, E) is constructed according to the transaction information, wherein V is an account set of all the work fragments, E is an edge set of two accounts, and the weight of an edge is the number of transactions between the two accounts;
the coordination fragment calculates the sum of the weights of the edges among the account sets through the account transaction network G (V, E), and the accounts of all the work fragments are divided again by taking the minimum sum of the weights of the edges among different account sets as an optimization target to obtain a division result;
and the coordination fragment sends the division result to the working fragment, so that the working fragment updates the account information of the working fragment according to the division result.
Optionally, the optimization objective further includes: the weights of the edges associated with each account set are as close as possible;
correspondingly, the coordination fragment calculates the sum of the weights of the edges between the account sets through the account transaction network G (V, E), and reclassifies the accounts of all the work fragments with the minimum sum of the weights of the edges between different account sets as an optimization goal to obtain a partition result, which specifically includes:
and the coordination fragment calculates the sum of the weights of the edges among the account sets through the account transaction network G (V, E), and reclassifies all the accounts of the work fragment by taking the minimum sum of the weights of the edges among different account sets and the weight of the edge related to each account set as close as possible as an optimization target to obtain a partitioning result.
Optionally, the method further includes:
and the coordination fragment generates a corresponding state block according to the division result and performs consensus confirmation on the state block.
Optionally, the work fragment updates its own account information according to the division result, and before, the method further includes:
and the work fragment verifies the division result according to the state block and executes the subsequent steps after the verification is passed.
Optionally, the work fragment updates its own account information according to the division result, and then further includes:
the work fragments generate reference blocks;
the working fragment acquires new fragment information, and acquires new nodes added into the working fragment through the new fragment information, wherein the new fragment information is node information obtained by disordering and recombining the nodes in the coordination fragment and the working fragment;
and for the new node added into the working fragment, synchronizing the state information of the working fragment through the reference block.
Optionally, the method further includes:
the coordination fragment acquires the new fragment information, and acquires a new node added into the coordination fragment through the new fragment information;
and synchronizing the state information of the coordination fragment through the state block for the new node added into the coordination fragment.
A second aspect of the present application provides a device for adjusting a segment account of a blockchain segment system, where the blockchain segment system includes a work segment and a coordination segment, and the device includes:
the collecting and constructing unit is used for collecting transaction information generated by transactions between all current work fragment processing accounts and constructing an account transaction network G (V, E) according to the transaction information, wherein V is an account set of all the work fragments, E is an edge set of two accounts, and the weight of an edge is the number of transactions between the two accounts;
the dividing unit is used for calculating the sum of the weights of the edges among the account sets through the account transaction network G (V, E), and reclassifying all the accounts of the work slices by taking the minimum sum of the weights of the edges among different account sets as an optimization target to obtain a dividing result;
and the sending unit is used for sending the division result to the work fragment so that the work fragment updates the account information of the work fragment according to the division result.
Optionally, the optimization objective further includes: the weights of the edges associated with each account set are as close as possible;
correspondingly, the dividing unit is specifically configured to:
and calculating the sum of the weights of the edges among the account sets through the account transaction network G (V, E), and reclassifying the accounts of all the work slices by taking the minimum sum of the weights of the edges among different account sets and the weight of the edge related to each account set as close as possible as an optimization target to obtain a division result.
A third aspect of the present application provides a device for adjusting a fragmentation account of a blockchain fragmentation system, where the device includes a processor and a memory;
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the fragmentation account adjustment method of the blockchain fragmentation system according to any one of the first aspect according to instructions in the program code.
A fourth aspect of the present application provides a computer-readable storage medium for storing program code, where the program code when executed by a processor implements the slice account adjustment method of the blockchain slicing system according to any one of the first aspects.
According to the technical scheme, the method has the following advantages:
the application provides a fragment account adjustment method of a blockchain fragment system, wherein the blockchain fragment system comprises a work fragment and a coordination fragment, and the method comprises the following steps: the coordination fragments collect transaction information generated by transactions between current work fragment processing accounts, and an account transaction network G (V, E) is constructed according to the transaction information, wherein V is an account set of all work fragments, E is an edge set of two accounts, and the weight of an edge is the number of transactions between the two accounts; the coordination fragments calculate the sum of the weights of the edges among the account sets through an account transaction network G (V, E), and the accounts of all the work fragments are divided again by taking the minimum sum of the weights of the edges among different account sets as an optimization target to obtain a division result; the coordination fragment sends the division result to the work fragment, so that the work fragment updates the account information of the work fragment according to the division result.
According to the method and the device, transaction information generated when the work fragments process the transaction is collected through the coordination fragments, an account transaction network is built based on the transaction information, after the sum of the weights of the edges among the account sets is obtained through the account transaction network calculation, all the accounts are divided again by taking the minimum sum of the weights of the edges among the account sets as an optimization target to obtain a division result, cross-fragment transaction is reduced, and finally the account information in the work fragments is updated through the division result, so that cross-fragment transaction can be reduced when the work fragments perform the next transaction processing, and the technical problems that the existing block chain fragment system is excessive in cross-fragment transaction, the throughput of the fragment system is reduced, and the confirmation delay of the transaction is increased are solved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a method for adjusting a segment account of a blockchain segment system according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a block chain fragmentation system according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a method for adjusting a segment account of a blockchain segment system according to an embodiment of the present disclosure;
fig. 4 is a schematic flow chart illustrating stages in a block chain fragmentation system according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a status block in a coordination slice according to an embodiment of the present disclosure.
Detailed Description
The application provides a fragment account adjusting method of a blockchain fragment system and a related device thereof, which are used for solving the technical problems that the existing blockchain fragment system has too many cross-fragment transactions, the throughput of the fragment system is reduced, and the confirmation delay of the transactions is increased.
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
For convenience of understanding, please refer to fig. 1, an embodiment of the present application provides a method for adjusting a segment account of a blockchain segment system, including:
step 101, the coordination fragment collects transaction information generated by transactions between current work fragment processing accounts, and an account transaction network G (V, E) is constructed according to the transaction information, wherein V is an account set of all work fragments, E is an edge set of two accounts, and the weight of an edge is the number of transactions between the two accounts.
The block chain fragmentation system is used for dividing an original large account book into a plurality of small account books, then different nodes (namely fragments) are enabled to maintain different small account books, the small account books can be simultaneously booked, and therefore system throughput is improved. The nodes in the blockchain sharding system of the embodiment of the application are divided into different shards according to the distribution mechanism, and meanwhile, the transaction in the sharding system is also sent to the responsible shard.
Only working fragments exist in a traditional fragment system, and the blockchain fragment system in the embodiment of the present application is shown in fig. 2, and the blockchain fragment system has two types of fragments: work shards and coordination shards. The block chain fragmentation network is divided into a plurality of working fragments, each working fragment maintains a fragment chain of the own fragment, and the working fragments are used for processing transactions. When a transaction is sent to the corresponding work fragment, the node receiving the transaction can verify the transaction, if the transaction is legal, the node can be added into a local transaction pool and broadcast to other nodes of the same work fragment, and if the transaction is illegal, the node can be rejected by the work fragment. According to the established consensus protocol, each working segment selects part of the ul acknowledgements from the transaction pool, and these transactions are then removed from the transaction pool. The coordination fragment monitors and collects transaction information generated when the work fragment processes transaction, and nodes in the coordination fragment can store the transaction information in all the work fragments.
After each work fragment processes a certain number of transactions, the fragment system finishes the current stage and prepares for state reorganization. The coordination fragment constructs an account transaction network G (V, E) without sideband weight according to the transaction information of all the working fragments in the current stage, wherein V is an account set of all the working fragments, E is an edge set of two accounts, and the weight of the edge is the number of transactions between the two accounts.
And 102, calculating the sum of the weights of the edges among the account sets by the coordination segment through an account transaction network G (V, E), and re-dividing the accounts of all the working segments by taking the minimum sum of the weights of the edges among different account sets as an optimization target to obtain a division result.
In the prior art, when there are K work slices in a slicing system, for an account M, an account prefix mapping or a suffix mapping is generally adopted to determine the work slice in which the account M is located, and for example, the suffix mapping is taken as an example, the account M is allocated to the M% K +1 th slice and remains unchanged once determined. This static allocation does not take into account the interactivity between accounts, resulting in a large number of cross-sharded transactions. Taking the account model as an example, the balance information of the account a is managed by the work segment 1, and the balance information of the account B is managed by the work segment 2. When account a transfers T tokens to account B, the transaction cannot be completed directly because the two accounts belong to different segments. When the cross-segment transaction under the account model is processed based on a relay transaction mechanism, under the mechanism, the transaction is firstly confirmed in a work segment 1, a deduction operation (A: balance-T of A) is performed on an account A, a verifiable relay transaction (B: balance + T of B) is generated and sent to a work segment 2 where the account B is located, and after the work segment 2 verifies that the relay transaction is correct, the relay transaction is linked up and a money adding operation (B: balance + T of B) is performed. It can be seen that a cross-slice transaction needs to be confirmed twice, which additionally increases the burden on the system and increases the confirmation delay of the transaction. The account model is a model adopted by an ether house, and the balance and other states of each account are directly recorded in the block chain account book.
In order to improve the above problem, in the embodiments of the present application, the accounts are subdivided by coordinating the shards, so that cross-sharding transactions are reduced as much as possible, when there are K work shards in the sharding system, there are K account sets correspondingly, and the accounts of all the work shards are subdivided with the minimum sum of the weights of the edges between different account sets as an optimization target, so as to obtain a partitioning result.
It should be noted that the method for adjusting a fragmented account provided in the embodiment of the present application is applicable to an account model and is not applicable to an unspent transaction output (UTXO) model.
And 103, the coordination fragment sends the division result to the work fragment, so that the work fragment updates the account information of the work fragment according to the division result.
After receiving the division result, the work fragment updates the account information of the work fragment according to the division result, the work fragment sends the relevant state of the moved account to the corresponding work fragment, and simultaneously requests the state information of the newly added account from other work fragments, and the account state and the certification thereof are provided by the work fragment where the work fragment is located before the work fragment. The fragmentation system in the embodiment of the application can adjust the fragmentation account in a decentralization and self-adaptive manner by coordinating the fragmentation without introducing a third party mechanism.
In the embodiment of the application, the transaction information generated when the work fragments process the transaction is collected through the coordination fragments, the account transaction network is constructed based on the transaction information, after the sum of the weights of the edges among the account sets is obtained through the account transaction network calculation, all the accounts are divided again by taking the minimum sum of the weights of the edges among the account sets as an optimization target to obtain a division result, so that cross-fragment transaction is reduced, and finally, the account information in the work fragments is updated through the division result, so that cross-fragment transaction can be reduced when each work fragment performs the next transaction processing, and the technical problems that the existing block chain fragment system has too many cross-fragment transactions, the throughput of the fragment system is reduced, and the confirmation delay of the transaction is increased are solved.
The above is an embodiment of a method for adjusting a segment account of a blockchain segment system provided by the present application, and the following is another embodiment of a method for adjusting a segment account of a blockchain segment system provided by the present application.
Referring to fig. 3 and fig. 4, a method for adjusting a segment account of a blockchain segment system according to an embodiment of the present application includes:
step 201, the coordination fragment collects transaction information generated by transactions between the current work fragment processing accounts, and an account transaction network G (V, E) is constructed according to the transaction information, wherein V is an account set of all work fragments, E is an edge set of two accounts, and the weight of an edge is the number of transactions between the two accounts.
Step 201 is consistent with the specific content of step 101, and is not described herein again.
Step 202, the coordination fragment calculates the sum of the weights of the edges among the account sets through the account transaction network G (V, E), and the accounts of all the work fragments are re-divided by taking the minimum sum of the weights of the edges among different account sets and the weight of the edge related to each account set as close as possible as an optimization target, so as to obtain a division result.
In the prior art, when there are K work slices in a slicing system, for an account M, an account prefix mapping or a suffix mapping is generally adopted to determine the work slice in which the account M is located, and for example, the suffix mapping is taken as an example, the account M is allocated to the M% K +1 th slice and remains unchanged once determined. This static allocation method does not take into account the interactivity between accounts, resulting in a large number of cross-sharded transactions. Taking the account model as an example, the balance information of the account a is managed by the work segment 1, and the balance information of the account B is managed by the work segment 2. When account a transfers T tokens to account B, the transaction cannot be completed directly because the two accounts belong to different segments. When the cross-segment transaction under the account model is processed based on a relay transaction mechanism, under the mechanism, the transaction is firstly confirmed in a work segment 1, a deduction operation (A: balance-T of A) is performed on an account A, a verifiable relay transaction (B: balance + T of B) is generated and sent to a work segment 2 where the account B is located, and after the work segment 2 verifies that the relay transaction is correct, the relay transaction is linked up and a money adding operation (B: balance + T of B) is performed. It can be seen that a cross-slice transaction needs to be confirmed twice, which additionally increases the burden on the system and increases the confirmation delay of the transaction.
In order to improve the above problem, in the embodiments of the present application, the accounts are subdivided by coordinating the shards, so that cross-sharding transactions are reduced as much as possible, when there are K work shards in the sharding system, there are K account sets correspondingly, and the accounts of all the work shards are subdivided with the minimum sum of the weights of the edges between different account sets as an optimization target, so as to obtain a partitioning result.
Further, the embodiment of the present application also finds that, in the prior art, transaction liveness of an account is not considered, fragmentation loads are unbalanced, some work fragments need to process excessive transactions, and some work fragments do not have transaction processing capability, which easily causes overheating of single/multiple fragments, reduces throughput of a fragmentation system, and increases confirmation delay of transactions. Therefore, when the account is re-divided, the accounts of all the working segments are re-divided with the goal that the sum of the weights of the edges among different account sets is minimum and the weight of the edge related to each account set is as close as possible to the optimization goal, and the cross-segment transaction is reduced and the load balancing problem is also considered.
The account division process in the embodiment of the present application may be:
s1, after an account transaction network G (V, E) is constructed, setting the maximum iteration times tau and the larger updating times p;
s2, traversing nodes in the working segment, initializing l (i), where l (i) is the segment id where the node i is currently located, and the update time c (i) is 0;
s3, initializing the weight of each work slice, traversing K from 1 to K, calculating the sum of the weights of edges related to the account in the work slice K, and recording the sum as WkInitializing the output result Vk(account set) is an empty set;
s4, traversing the iteration number from 1 to tau:
node number i traverses from 1 to | V |:
if the update times of the node i are less than p, i.e. c (i) < p, calculating the new fragment id of the node i according to an objective function, wherein the objective function is as follows:
Figure BDA0003343651190000091
wherein δ (l (j), k) is a display function, if l (j) is k, δ (l (j), k) is 1, otherwise, δ (l (j), k) is 0, ei,jAs the weight of the edges of node i and node j, [ N ]]Set {1, 2., N }, nb (i) is a set of neighbor nodes of node i, k (i) is a set of slice ids of neighbor nodes of node i, i.e., k (i) { l (j), j ∈ nb (i) }, β ∈ [0,1 ∈ N }]The method is a preset parameter and is used for balancing the number of cross-fragment transactions and load;
if node k! If so, updating W according to the updated resultkWeight W corresponding to work slice l (i)l(i),c(i)=c(i)+1,l(i)=k;
S5, obtaining the mapping l (i) of each node i to the fragment id through the iteration, adding the nodes into the corresponding account set, and returning the division result, namely the account set V of the K work fragments1、V2、...、 VK
Step 203, the coordination fragmentation generates a corresponding state block according to the division result, and performs consensus confirmation on the state block.
And when the division result is obtained, the coordination fragment generates a corresponding state block, and the related information is recorded on the fragment chain of the coordination fragment for verification by other nodes. The coordination slice performs consensus verification on the status blocks to ensure the correctness and non-tamper of the status blocks.
Structure of status tiles referring to fig. 5, in addition to the necessary hash of the previous tile and the number of current stages, the status tile records the hash of the account transaction network constructed from the transaction information in the current stage. The node may request a phase of the account transaction network from the coordination slice and verify with the hash without synchronizing all transactions. In addition, according to the obtained division result, the accounts belonging to each work slice form a merkel tree, and the root hash of the merkel tree is recorded on the block. For K work slices, K corresponding hashes will be recorded, which field can be used for fast verification of the partitioning result. Finally, the coordination fragment also maintains the mapping state from each account to the fragment id, the mapping states from all accounts to the fragment id form a merkel prefix tree, and the root hash of the merkel prefix tree is recorded on the block. A node may request the coordination shard for a shard id of an account and verify the correctness of the state by the provided state, the mercker path, and the root hash.
After the coordination fragment generates the state block, the nodes in the coordination fragment can discard the transaction record at this stage, so that the storage space is saved. The state block provides other nodes with the function of query verification, and can help other nodes to quickly synchronize the state of the current fragmentation system.
And step 204, the coordination fragment sends the division result to the work fragment, so that the work fragment verifies the division result according to the state block, and updates the account information of the work fragment according to the division result after the verification is passed, thereby generating a corresponding reference block.
The coordination block sends the division result to the work fragment, the nodes in the work fragment can perform corresponding hash transformation on the received division result to obtain hash, and the hash is compared with the information in the corresponding state block to judge the correctness of the received information, so that the uncommittability and traceability of the division result are fully ensured, and malicious nodes are prevented from doing bad work.
The working fragment verifies the division result according to the state block, updates the account information of the working fragment according to the division result after the verification is passed, and generates a corresponding reference block. The work fragment sends the related state of the moved account to the corresponding work fragment, and simultaneously requests state information of the newly added account from other work fragments, the account state and the proof thereof are provided by the work fragment where the work fragment is located before, and the validity of the work fragment can be verified through a Mercker path. After the updating is finished, each working fragment generates a reference block, the reference block records the latest adjusted fragment account book information, and the reference block is used as an initial block for starting the next stage. Meanwhile, the work fragment can update the mapping from the account maintained by the work fragment to the fragment id so as to facilitate the forwarding of cross-fragment transaction.
Further, in order to prevent nodes in the coordination fragment and the working fragment from mutually colluding and dislocating, a fragment protocol is set to perform disorganization and recombination on the nodes in the coordination fragment and the working fragments, then the fragment system enters the next stage, and the coordination fragment collects transaction information generated when the working fragments in the next stage process transactions. In the recombination stage, the coordination fragment acquires new fragment information, wherein the new fragment information is node information obtained by disorganizing and recombining nodes in the coordination fragment and the working fragment; and acquiring a new node added into the coordination fragment through the new fragment information, and synchronizing the state information of the coordination fragment for the new node added into the coordination fragment through the state block. And the working fragment acquires a new node added into the working fragment through new fragment information, and synchronizes the state information of the working fragment through the reference block for the new node added into the working fragment.
In the embodiment of the application, the transaction information generated when the work fragments process the transaction is collected through the coordination fragments, the account transaction network is constructed based on the transaction information, after the sum of the weights of the edges among the account sets is obtained through the account transaction network calculation, all the accounts are divided again by taking the minimum sum of the weights of the edges among the account sets as an optimization target to obtain a division result, so that cross-fragment transaction is reduced, and finally, the account information in the work fragments is updated through the division result, so that cross-fragment transaction can be reduced when each work fragment performs the next transaction processing, and the technical problems that the existing block chain fragment system has too many cross-fragment transactions, the throughput of the fragment system is reduced, and the confirmation delay of the transaction is increased are solved.
Further, in the embodiment of the application, considering that the fragmentation system has fragment load imbalance, some work fragments need to process excessive transactions, and some work fragments do not have transactions to be processed, which causes the situation of single/multiple fragments overheating, when the account is re-partitioned, the accounts of all the work fragments are re-partitioned by taking the minimum sum of the weights of the edges among different account sets and the weight of the edge related to each account set as close as possible as optimization targets, and considering load balancing while reducing cross-fragment transactions, the throughput of the fragmentation system is further improved; and, the fragments are shuffled and recombined to prevent nodes in the fragments from being mutually hooked.
In the above description, another embodiment of the adjustment method for a segment account of a blockchain segment system provided by the present application is described below with reference to the present application.
In an embodiment of the present application, a device for adjusting a segment account of a blockchain segment system includes:
the collecting and constructing unit is used for collecting transaction information generated by transactions between current work fragment processing accounts and constructing an account transaction network G (V, E) according to the transaction information, wherein V is an account set of all work fragments, E is an edge set of two accounts, and the weight of an edge is the number of transactions between the two accounts;
the dividing unit is used for calculating the sum of the weights of the edges among the account sets through the account transaction network G (V, E), and reclassifying the accounts of all the work slices by taking the minimum sum of the weights of the edges among the different account sets as an optimization target to obtain a dividing result;
and the sending unit is used for sending the division result to the work fragment so that the work fragment updates the account information of the work fragment according to the division result.
As a further improvement, the optimization objectives further include: the weights of the edges associated with each account set are as close as possible;
correspondingly, the dividing unit is specifically configured to:
and calculating the sum of the weights of the edges among the account sets through an account transaction network G (V, E), and reclassifying the accounts of all the work slices by taking the minimum sum of the weights of the edges among different account sets and the weight of the edge related to each account set as close as possible as an optimization target to obtain a division result.
As a further improvement, the apparatus further comprises:
and the state block generating unit is used for generating a corresponding state block according to the division result and carrying out consensus confirmation on the state block.
As a further improvement, the method further comprises the following steps: an acquisition unit configured to:
acquiring new fragment information, and acquiring new nodes added into the coordination fragments through the new fragment information;
and for the new node added into the coordination fragment, synchronizing the state information of the coordination fragment through the state block.
In the embodiment of the application, the transaction information generated when the work fragments process the transaction is collected through the coordination fragments, the account transaction network is constructed based on the transaction information, after the sum of the weights of the edges among the account sets is obtained through the account transaction network calculation, all the accounts are divided again by taking the minimum sum of the weights of the edges among the account sets as an optimization target to obtain a division result, so that cross-fragment transaction is reduced, and finally, the account information in the work fragments is updated through the division result, so that cross-fragment transaction can be reduced when each work fragment performs the next transaction processing, and the technical problems that the existing block chain fragment system has too many cross-fragment transactions, the throughput of the fragment system is reduced, and the confirmation delay of the transaction is increased are solved.
Further, in the embodiment of the application, considering that the fragmentation system has fragment load imbalance, some work fragments need to process excessive transactions, and some work fragments do not have transactions to be processed, which causes the situation of single/multiple fragments overheating, when the account is re-partitioned, the accounts of all the work fragments are re-partitioned by taking the minimum sum of the weights of the edges among different account sets and the weight of the edge related to each account set as close as possible as optimization targets, and considering load balancing while reducing cross-fragment transactions, the throughput of the fragmentation system is further improved; and, the fragments are shuffled and recombined to prevent nodes in the fragments from being mutually hooked.
The embodiment of the application also provides a piece account adjusting device of the block chain piece system, which comprises a processor and a memory;
the memory is used for storing the program codes and transmitting the program codes to the processor;
the processor is configured to execute the fragment account adjustment method of the blockchain fragment system in the foregoing method embodiments according to instructions in the program code.
An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium is used to store program codes, and when executed by a processor, the program codes implement the fragmentation account adjustment method of the blockchain fragmentation system in the foregoing method embodiments.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The terms "first," "second," "third," "fourth," and the like in the description of the application and the above-described figures, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for executing all or part of the steps of the method described in the embodiments of the present application through a computer device (which may be a personal computer, a server, or a network device). And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A method for adjusting a segment account of a blockchain segment system is characterized in that the blockchain segment system comprises a working segment and a coordination segment, and the method comprises the following steps:
the coordination fragments collect transaction information generated by the transaction between the current work fragment processing accounts, and an account transaction network G (V, E) is constructed according to the transaction information, wherein V is an account set of all the work fragments, E is an edge set of two accounts, and the weight of an edge is the number of transactions between the two accounts;
the coordination fragment calculates the sum of the weights of the edges among the account sets through the account transaction network G (V, E), and the accounts of all the work fragments are divided again by taking the minimum sum of the weights of the edges among different account sets as an optimization target to obtain a division result;
and the coordination fragment sends the division result to the working fragment, so that the working fragment updates the account information of the working fragment according to the division result.
2. The method for adjusting sharded accounts of a blockchain sharding system according to claim 1, wherein the optimization objective further comprises: the weights of the edges associated with each account set are as close as possible;
correspondingly, the coordination fragment calculates the sum of the weights of the edges between the account sets through the account transaction network G (V, E), and reclassifies the accounts of all the work fragments with the minimum sum of the weights of the edges between different account sets as an optimization goal to obtain a partition result, which specifically includes:
and the coordination fragment calculates the sum of the weights of the edges among the account sets through the account transaction network G (V, E), and reclassifies all the accounts of the work fragment by taking the minimum sum of the weights of the edges among different account sets and the weight of the edge related to each account set as close as possible as an optimization target to obtain a partitioning result.
3. The method for adjusting sharded accounts of a blockchain sharding system according to claim 1, wherein the method further comprises:
and the coordination fragment generates a corresponding state block according to the division result and performs consensus confirmation on the state block.
4. The method for adjusting a shard account of a blockchain sharding system according to claim 3, wherein the working shard updates its own account information according to the partitioning result, and before that, the method further comprises:
and the work fragment verifies the division result according to the state block and executes the subsequent steps after the verification is passed.
5. The method for adjusting a shard account of a blockchain sharding system according to claim 3, wherein the working shard updates its own account information according to the partitioning result, and thereafter further comprises:
the work fragments generate reference blocks;
the working fragment acquires new fragment information, and acquires new nodes added into the working fragment through the new fragment information, wherein the new fragment information is node information obtained by disordering and recombining the nodes in the coordination fragment and the working fragment;
and for the new node added into the working fragment, synchronizing the state information of the working fragment through the reference block.
6. The method for adjusting sharded accounts of a blockchain sharding system according to claim 5, wherein the method further comprises:
the coordination fragment acquires the new fragment information, and acquires a new node added into the coordination fragment through the new fragment information;
and synchronizing the state information of the coordination fragment through the state block for the new node added into the coordination fragment.
7. A slice account adjusting device of a blockchain slice system is characterized in that the blockchain slice system comprises a working slice and a coordination slice, and the device comprises:
the collecting and constructing unit is used for collecting transaction information generated by transactions between all current work fragment processing accounts and constructing an account transaction network G (V, E) according to the transaction information, wherein V is an account set of all the work fragments, E is an edge set of two accounts, and the weight of an edge is the number of transactions between the two accounts;
the dividing unit is used for calculating the sum of the weights of the edges among the account sets through the account transaction network G (V, E), and reclassifying all the accounts of the work slices by taking the minimum sum of the weights of the edges among different account sets as an optimization target to obtain a dividing result;
and the sending unit is used for sending the division result to the work fragment so that the work fragment updates the account information of the work fragment according to the division result.
8. The device for adjusting sharded accounts of a blockchain sharding system according to claim 7, wherein the optimization objective further comprises: the weights of the edges associated with each account set are as close as possible;
correspondingly, the dividing unit is specifically configured to:
and calculating the sum of the weights of the edges among the account sets through the account transaction network G (V, E), and reclassifying the accounts of all the work slices by taking the minimum sum of the weights of the edges among different account sets and the weight of the edge related to each account set as close as possible as an optimization target to obtain a division result.
9. A piece account adjusting device of a block chain piece system is characterized by comprising a processor and a memory;
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the slice account adjustment method of the blockchain slicing system according to any one of claims 1 to 6 according to instructions in the program code.
10. A computer-readable storage medium for storing program code, which when executed by a processor implements the method for adjusting sharded accounts of a blockchain sharding system according to any one of claims 1 to 6.
CN202111315947.8A 2021-11-08 2021-11-08 Fragment account adjusting method of block chain fragment system and related device thereof Pending CN114037531A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111315947.8A CN114037531A (en) 2021-11-08 2021-11-08 Fragment account adjusting method of block chain fragment system and related device thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111315947.8A CN114037531A (en) 2021-11-08 2021-11-08 Fragment account adjusting method of block chain fragment system and related device thereof

Publications (1)

Publication Number Publication Date
CN114037531A true CN114037531A (en) 2022-02-11

Family

ID=80136672

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111315947.8A Pending CN114037531A (en) 2021-11-08 2021-11-08 Fragment account adjusting method of block chain fragment system and related device thereof

Country Status (1)

Country Link
CN (1) CN114037531A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116012164A (en) * 2023-03-17 2023-04-25 安徽中科晶格技术有限公司 Block chain cross-fragment transaction method based on virtual account
CN116248725A (en) * 2023-05-10 2023-06-09 南京信息工程大学 Block chain node slicing method oriented to node collaborative storage in Internet of vehicles environment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116012164A (en) * 2023-03-17 2023-04-25 安徽中科晶格技术有限公司 Block chain cross-fragment transaction method based on virtual account
CN116248725A (en) * 2023-05-10 2023-06-09 南京信息工程大学 Block chain node slicing method oriented to node collaborative storage in Internet of vehicles environment

Similar Documents

Publication Publication Date Title
CN114037531A (en) Fragment account adjusting method of block chain fragment system and related device thereof
CN106991607B (en) Disordered transaction control method based on block chain account model
CN110060064B (en) Transaction information verification method and related device
US20200167366A1 (en) Data processing method and device
CN106878000B (en) Alliance chain consensus method and system
EP3399434B1 (en) Short link processing method, device and server
US9705894B2 (en) Method and system for network validation of information
CN110851537A (en) Consensus method based on block chain fragmentation technology
KR20190067581A (en) Apparatus and method for distributed processing of blockchain transactions
CN104008028B (en) Intelligent mobile terminal data backup memory method and system based on many cloud storages
US20170255950A1 (en) Systems and methods for providing block chain state proofs for prediction market resolution
CN104205089B (en) Stream identification and filtering
CN109241087A (en) A kind of data processing method and terminal of alliance&#39;s chain
EP4231167A1 (en) Data storage method and apparatus based on blockchain network
CN108260015B (en) Voting data processing method and device and electronic equipment
CN106649637B (en) Method and system for processing red packet
CN110597922B (en) Data processing method, device, terminal and storage medium
WO2017071337A1 (en) Database table data management method, apparatus and system
CN110213290A (en) Data capture method, API gateway and storage medium
CN115022326A (en) Block chain Byzantine fault-tolerant consensus method based on collaborative filtering recommendation
CN114202422A (en) Block chain fragmentation method, block chain system and cross-fragmentation transaction processing method
CN114338673A (en) Transaction data processing method, device, equipment, system and storage medium
CN113807851A (en) Block chain expandability realization method and system based on fragmentation
US20220383304A1 (en) Distributed network with consensus mechanism
JP7073240B2 (en) Blockchain management system, blockchain management method and blockchain management program

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