CN111061735A - Capacity expansion method and device based on single-chain block chain - Google Patents

Capacity expansion method and device based on single-chain block chain Download PDF

Info

Publication number
CN111061735A
CN111061735A CN201911284239.5A CN201911284239A CN111061735A CN 111061735 A CN111061735 A CN 111061735A CN 201911284239 A CN201911284239 A CN 201911284239A CN 111061735 A CN111061735 A CN 111061735A
Authority
CN
China
Prior art keywords
block
chain
target
block chain
blocks
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.)
Granted
Application number
CN201911284239.5A
Other languages
Chinese (zh)
Other versions
CN111061735B (en
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 New Media 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 New Media Information Technology Co ltd filed Critical Shanghai Youyang New Media Information Technology Co ltd
Priority to CN201911284239.5A priority Critical patent/CN111061735B/en
Publication of CN111061735A publication Critical patent/CN111061735A/en
Application granted granted Critical
Publication of CN111061735B publication Critical patent/CN111061735B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The application provides a capacity expansion method and device for a single-chain block chain, when the transaction amount of a block chain network reaches a first threshold value, selected blocks which are packed by a plurality of target super nodes and meet the conditions are connected to a terminal block of the single-chain block chain, the single-chain block chain is branched into a tree-shaped block chain comprising a plurality of sub chains, and after the tree-shaped block chain is obtained, the blocks which are packed by each target super node and successfully verified are connected to the sub chains in the tree-shaped block chain corresponding to the target super nodes. Therefore, according to the technical scheme provided by the application, the single-chain block chain is branched into the tree-shaped block chain comprising the plurality of sub-chains, so that the entrance of the block chain is increased, the purpose of expanding the capacity of the single-chain block chain is achieved, and the problems of transaction overstock and network congestion under the condition that the block chain network transaction amount is large are solved.

Description

Capacity expansion method and device based on single-chain block chain
Technical Field
The invention relates to the technical field of block chains, in particular to a capacity expansion method and device based on a single-chain block chain.
Background
The block chain is formed by sequentially connecting a plurality of blocks, a data storage chain of transaction data of the block chain network is stored in each block, and the block chain technology is widely applied to a plurality of fields of the internet as the block chain technology is used as a data storage technology due to the characteristics of decentralization, data non-falsification and the like.
In the existing block chain technology, there is only one single-chain block chain in one block chain network, and the single-chain block chain only allows one block chain in a unit time, that is, only one block of transaction data can be stored in the block chain in the unit time, and the amount of the transaction data included in one block is limited.
Disclosure of Invention
The application provides a capacity expansion method and device based on a single-chain block chain, and aims to solve the problem of how to backlog the transaction in a block chain network under the condition of trading data volume in the block chain network.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
a capacity expansion method for a single-chain block chain comprises the following steps:
when the transaction amount of a block chain network reaches a first threshold value, connecting the selected blocks which are packed by a plurality of target super nodes and meet the conditions to a terminal block of the single-chain block chain, so that the single-chain block chain is branched into a tree-shaped block chain comprising a plurality of sub chains, wherein the sub chains of the tree-shaped block chain correspond to the target super nodes one to one;
and connecting the qualified blocks packed by each target super node to the sub-chain corresponding to the target super node in the tree-shaped block chain.
Optionally, the method includes the following steps:
broadcasting an expansion request, so that a plurality of super nodes feed back the corresponding agreed expansion information corresponding to the expansion request according to the expansion request;
and selecting a plurality of target super nodes from the plurality of super nodes according to the agreed capacity expansion information fed back by the plurality of super nodes.
In the foregoing method, optionally, the blocks packed by the target super nodes and meeting the condition are: the target super node packed block and any other target super node packed block do not have world state transaction using the same account, and the block is a block with workload proving success.
The above method, optionally, further includes: and judging whether the world state transaction using the same account exists in any two blocks packed by the target super nodes according to a pre-constructed directed graph.
The above method, optionally, may be a process of constructing the directed graph, including:
copying and storing the current block chain in the block chain network;
acquiring a timestamp of a block in the block chain, and reading transactions among transaction accounts included in the block;
matching the corresponding target blocks for the blocks according to the transaction between the transaction accounts;
connecting a directed edge from the target block to the block, connecting the block with its target block;
and obtaining the directed graph according to the connection relation between each block and the target block.
Optionally, the method for determining whether there is a world-state transaction using the same account in any two blocks packed by target super nodes according to the pre-constructed directed graph includes:
after receiving a plurality of blocks packed by the target super nodes, connecting the blocks into the directed graph;
judging whether a plurality of blocks connected to the same target block exist in the blocks connected to the directed graph, wherein the target block is a pre-existing block in the directed graph;
if there are no multiple blocks connected to the same target block, then it is determined that there are no world-wide transactions using the same account in any two blocks packed by the target super node.
The above method, optionally, further includes: accepting only one of the plurality of packed blocks connected to the same target block if there are a plurality of the packed blocks simultaneously connected to the same target block.
The above method, optionally, further includes: and when the transaction amount on the block chain network reaches a second threshold value, selecting a target sub-chain from the sub-chains of the tree-shaped block chain, and expanding the target sub-chain to enable the target sub-chain to branch into a plurality of second sub-chains.
A capacity expansion device for a single-chain blockchain, comprising:
the first connecting unit is used for connecting the selected blocks packed by the target super nodes to the terminal block of the single-chain block chain after the transaction amount of the block chain network reaches a first threshold value, so that the single-chain block chain is branched into a tree-shaped block chain comprising a plurality of sub-chains, and the sub-chains of the tree-shaped block chain are in one-to-one correspondence with the target super nodes;
and the second connecting unit is used for connecting the block which is packed and verified successfully by each target super node to the sub-chain corresponding to the target super node in the tree-shaped block chain.
An apparatus, comprising: a processor and a memory for storing a program; the processor is used for running the program to realize the capacity expansion method for the single-chain block chain.
According to the method and the device, after the transaction amount of the block chain network reaches a first threshold value, the selected blocks meeting the conditions and packed by the target super nodes are connected to the tail end block of the single chain block chain, the single chain block chain is branched into the tree-shaped block chain comprising the sub chains, and after the tree-shaped block chain is obtained, the blocks packed by the target super nodes and meeting the conditions are connected to the sub chains corresponding to the target super nodes in the tree-shaped block chain. Therefore, according to the technical scheme provided by the application, the single-chain block chain is branched into the tree-shaped block chain comprising the plurality of sub-chains, so that the entrance of the block chain is increased, the purpose of expanding the capacity of the block chain is achieved, and the problems of transaction overstock and network congestion under the condition that the block chain network transaction amount is large are solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a capacity expansion method for a single-chain block chain according to an embodiment of the present application;
fig. 2 is a flowchart of a method for selecting a plurality of target super nodes according to an embodiment of the present disclosure;
FIG. 3 is a flow chart of a method for constructing a directed graph as disclosed in an embodiment of the present application;
FIG. 4 is a flowchart of a method for determining whether there is a world-wide transaction using the same account in any two blocks packed by target super nodes using a directed graph according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a tree block chain according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a directed graph disclosed in an embodiment of the present application;
FIG. 7 is a schematic diagram of another directed graph disclosed in embodiments of the present application;
fig. 8 is a flowchart of another capacity expansion method for a single-chain block chain according to the disclosure in the embodiment of the present application;
FIG. 9 is a schematic diagram of another tree blockchain disclosed in embodiments of the present application;
fig. 10 is a schematic structural diagram of a capacity expansion device for a single-chain block chain according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of another expansion device for a single-chain block chain according to the embodiment of the present application;
fig. 12 is a schematic structural diagram of an apparatus disclosed in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
To facilitate understanding of the methods provided by the embodiments of the present application, a brief description of the block chain technology involved in the present application will be provided.
The block chain network is a distributed system and consists of a plurality of nodes. The nodes can be devices such as fixed computers, portable computers or smart phones and the like which can access the internet, and users can access the blockchain network through a web end or an app end by using the devices. Because the hardware configuration resources of each node in the blockchain network are different, the nodes in the blockchain network can be divided into super nodes and working nodes according to the hardware configuration resources of the nodes, wherein the super nodes are nodes with larger bandwidth and high-speed computing capability, and the working nodes are nodes with smaller bandwidth and slower computing speed.
Fig. 1 is a method for expanding a single-chain block chain disclosed in an embodiment of the present application, which may specifically include the following steps:
and S101, connecting the block with the successful workload proof to the current single-chain block chain before the transaction amount on the block chain network does not reach the first threshold value.
The first threshold is a preset value, and before the transaction amount on the blockchain network does not reach the first threshold, the situation that the current transaction amount is less and the transaction backlog cannot be generated in the current blockchain network is shown. The nodes (working nodes or super nodes) in the blockchain network pack the transactions on the blockchain network into blocks, then carry out workload certification, and connect the blocks with successful workload certification to the current single-chain blockchain. The specific process of workload certification by the node can refer to the prior art.
It should be noted that, before the transaction amount on the blockchain network does not reach the first threshold, the current blockchain is a single chain, the first blockchain of the single-chain blockchain is a created blockchain, the created blockchain is constructed by an initialization method when the blockchain network is established, and after the blockchain network is established, the first blockchain is packaged by the blockchain link points and connected to the blockchain blocks. The second block with the successful workload proved is connected with the founding block, and so on, a single-chain block chain formed by connecting a plurality of blocks arranged in time sequence is formed.
S102, after the transaction amount reaches a first threshold value, connecting the selected qualified blocks packed by the target super nodes to the tail end block of the single-chain block chain, and enabling the single-chain block chain to branch into a tree-shaped block chain comprising a plurality of sub-chains.
After the transaction amount on the blockchain network reaches a first threshold value, which may cause transaction backlog, a plurality of target super nodes are selected from the super nodes of the network. The process of selecting a plurality of target super nodes may refer to the flow illustrated in fig. 2.
After the target super node packs the network transaction to obtain a block, verifying whether the block packed by the target super node meets a preset condition, wherein the preset condition is as follows: there is no transaction of world state using the same account in any two target super node packed blocks, and the target super node packed blocks are blocks whose workload proves successful. The process of constructing the directed graph can refer to fig. 3, the process of judging whether the block packed by any two target super nodes has the transaction of the world state using the same account by using the directed graph can refer to fig. 4, and the process of performing the workload certification on the block can refer to the prior art.
After obtaining the eligible blocks packed by the plurality of target super nodes, for example, if the eligible blocks are six blocks, the six blocks are connected to the end block of the current single-chain block chain, so that six sub-chains are branched from the end block, and the current single-chain block chain is branched into a tree block chain including six sub-chains.
It should be noted that a plurality of child chains of the tree-shaped block chain correspond to a plurality of target super nodes one to one, and a super node corresponding to any child chain is a qualified block packed by the super node as a head-end block of the child chain.
S103, after the tree-shaped block chain is generated, according to the corresponding relation between the sub chain and the target super node, the blocks which are packed by each target super node and meet the conditions are connected to the sub chain corresponding to the target super node in the tree-shaped block chain.
After the tree-shaped block chain is generated, the blocks packed by the target super nodes corresponding to the sub chains need to be connected to the sub chains corresponding to the super nodes after the verification that the blocks are in accordance with the conditions. It should be noted that all target super nodes may package transactions on the blockchain network, or any one or several of the target super nodes may package transactions on the blockchain network.
Fig. 5 is a schematic diagram of a tree blockchain obtained according to the method provided in this embodiment. The number in each block in fig. 5 is a custom block number, and the set in each block is a set of transactions between the respective transaction account numbers.
In the method provided by this embodiment, after the transaction amount of the block chain network reaches the first threshold, the eligible blocks packed by the selected target super nodes are connected to the end block of the single-chain block chain, so that the single-chain block chain is branched into a tree-shaped block chain including a plurality of sub-chains, and after the tree-shaped block chain is obtained, the block packed and successfully verified by each target super node is connected to the sub-chain corresponding to the target super node in the tree-shaped block chain. It can be seen that, according to the technical scheme provided by the application, the single-chain block chain is branched into the tree-shaped block chain comprising the plurality of sub-chains, so that the entrance of the block chain is increased, a plurality of blocks are allowed to be connected to the block chain at the same time in unit time, the purpose of capacity expansion of the block chain is achieved, and the problems of transaction overstock and network congestion under the condition that the network traffic of the block chain is large are solved.
It should be noted that, in the above embodiment, after a plurality of target super nodes are selected, each super node may broadcast a capacity expansion transaction message, so that nodes in the whole network all know the message to be subjected to capacity expansion. The capacity expansion transaction message specifies a branch point of the single-link block chain, that is, an end block of the chain block chain. The predetermined content may be that, after the transaction amount of the blockchain network reaches the first threshold and the total number of blocks connected to the single-chain blockchain reaches the blockchain threshold, the block corresponding to the reached blockchain threshold is taken as the branch point of the single-chain blockchain. And when the single-chain block chain develops to a branch point, packaging the selected multiple target super nodes for the total network transaction.
Fig. 2 is an implementation manner of selecting a plurality of super nodes in the foregoing embodiment, including the following steps:
s201, broadcasting a capacity expansion request.
After the transaction amount on the block chain network reaches a first threshold value, the node initiates an expansion request, wherein the expansion request comprises the expansion branch number (namely the number of the sub-chains), the ID code of the expansion request and the lowest payment cost of the super node which agrees to expand. It should be noted that, after the node initiates the capacity expansion request, the capacity expansion request is added to the current single-chain blockchain in the blockchain network in the form of transaction.
S202, receiving the information which agrees to capacity expansion and is fed back by each super node.
After each super node on the block chain network receives the capacity expansion request, the super node which agrees to the capacity expansion feeds back the information agreeing to the capacity expansion, the information agreeing to the capacity expansion comprises data such as an ID code of the capacity expansion request and the cost paid for agreement, and the information agreeing to the capacity expansion is added into the current single-chain block chain in a transaction mode.
S203, selecting a plurality of target super nodes from the super nodes which agree with capacity expansion.
Since the capacity expansion request specifies the number of the capacity expansion branches, it is necessary to select the target super nodes whose number is the same as the number of the capacity expansion branches from the plurality of super nodes that agree with the capacity expansion. The method comprises the steps that a target super node is selected from a plurality of super nodes which agree to capacity expansion and is stored in an intelligent contract in advance, the intelligent contract can stipulate that the super nodes with payment fee ranked in the front are selected according to the sequence from high to low of the payment fee of each super node which agree to capacity expansion.
According to the method provided by the embodiment, a plurality of target super nodes are selected in an election mode according to the capacity expansion request, and the target super nodes have large bandwidth and high-speed computing capacity, so that the super nodes can quickly pack the blocks, and the uplink speed of the blocks can be improved.
Fig. 3 is an implementation manner of constructing a directed graph in the foregoing embodiment, and may include the following steps:
s301, copying and storing the block chain in the current block chain network.
When the block chain in the block chain network is updated, each node copies the current block chain and stores the current block chain in the node.
S302, obtaining the time stamp of the block in the current block chain, and reading the transaction data among the transaction accounts included in the block.
Each tile has a timestamp, which may be the time when the tile is connected to the chain of tiles or the time when the broadcast is done after the workload certification is completed. Since the transaction data of each tile contains transactions between multiple different transaction accounts, the transactions between all transaction accounts included in the tile need to be read.
S303, matching the corresponding target blocks for the blocks according to the transaction between the transaction accounts.
For any transaction account in the blocks, if the transaction account exists in a plurality of blocks to be matched, the block to be matched with the timestamp closest to the block is selected as a target block of the block, and if the transaction account exists in only one block to be matched, the block to be matched is directly used as the target block.
For example, for transaction account a for block a, which is included in block B, block C, and block D, the block with the timestamp closest to block a is selected from block B, block C, and block D as the target block for block a.
S304, connecting the directed edge to the block from the target block, so as to connect the block with the target block.
After the target block of the block is determined, the directed edge is connected to the block from the target block, so that the connection relation between the block and the target block is determined.
S305, obtaining a directed graph according to the connection relation between each block and the target block.
And finally obtaining a directed graph representing the connection relation between the blocks according to the connection relation between each block in the block chain and the target block.
In this embodiment, if the tree block chain is as shown in fig. 5, the corresponding directed graph may refer to fig. 6. Each time a new block is connected to a block chain, the directed graph will synchronously add the new block, i.e. the node in the above embodiment copies and stores the block chain in the current block chain network.
Taking the block chain shown in fig. 5 to construct the directed graph shown in fig. 6 as an example, the process of constructing the directed graph is specifically described as follows: when a foundational block appears in fig. 5, the first block in the directed graph (fig. 6) is the foundational block. When a second block (block numbered 2) is connected to the block chain, the corresponding directed graph also adds the second block, and in the current directed graph, a directed edge is connected from the created block to the second block because the created block is the original block. When a block is connected with a third block, the third block is correspondingly added to the directed graph, in the current directed graph, the blocks containing the transaction account number B with the third block are the second block and the created block, but the second block is newer (the timestamp is later than the created block), so that a directed edge is connected to the third block from the second block, and only the created block containing the transaction account number C with the third block is connected to the created block from the created block. In the same way, when the block is connected to the seventh block, the seventh block is also added to the corresponding directed graph, in the current directed graph, the blocks containing the transaction account B with the seventh block are the second block and the third block, but the third block is closer to the seventh block in the timestamp, so that a directed edge is connected to the seventh block from the third block, and according to the method, the directed graph 6 corresponding to the graph 5 is finally obtained.
In the method provided by this embodiment, the complete state change process of any one transaction account can be recorded through the directed graph, for example, in fig. 6, according to the directed edge, the complete state change process of the account number C is as follows: founding block-third block-fifth block-seventh block.
Fig. 4 is an embodiment of determining whether there is a world-state transaction using the same account in any two blocks packed by target super nodes using a directed graph in the above implementation, and may include the following steps:
s401, after receiving the blocks packed by the plurality of super nodes, connecting the blocks to a directed graph.
The method for connecting any block to the directed graph may refer to the flowchart shown in fig. 3, and is not described herein again.
S402, judging whether a plurality of blocks in the plurality of packed blocks connected to the directed graph are connected to the same target block.
After the blocks packed by the super nodes are all connected to the directed graph, whether the blocks packed by the super nodes are connected to the same target block is judged, wherein the target block is a pre-existing block in the directed graph.
And S403, if a plurality of super node packaged blocks are not connected to the same target block, determining that no world state transaction using the same account exists in any two target super node packaged blocks.
If there are no blocks of multiple super node packages connected to the same block at the same time, it indicates that there are no blocks of world-state transactions using the same account in the multiple blocks.
S404, if a plurality of super node packed blocks are connected to the same target block, only one block in the plurality of packed blocks connected to the same target block is accepted.
In this embodiment, if there are multiple super node-packaged blocks connected to the same target block, it indicates that the world state of a transaction account of the same block generates multiple transactions at the same time, and this situation is a typical "double-flower problem" in the blockchain technology, which is not allowed in the blockchain network. One of the blocks connected to the same target block may be accepted, wherein the block with the largest transaction account included in the plurality of blocks may be selected as the accepted block, or one of the blocks may be randomly selected as the accepted block.
In this embodiment, for example, before a plurality of super node packed blocks are not connected to the directed graph, the directed graph is as in fig. 6 described in the foregoing implementation, assuming that the plurality of super node packed blocks are respectively: the tiles including transaction accounts E and H and the tiles including transaction accounts E and Q, which are connected to fig. 6, result in a directed graph as shown in fig. 7. It can be seen that in fig. 7, the tile containing transaction accounts E and H and the tile containing transaction accounts E and Q are connected to the fourth tile containing transaction accounts D and E at the same time, i.e. two directed edges with the same transaction account (transaction account E) appear from the fourth tile, indicating that the tile containing transaction accounts E and H and the tile containing transaction accounts E and Q use the world state of transaction account E at the same time, which is the "double flower problem" that is not allowed in the blockchain network.
It should be noted that the blocks packed by the target super nodes are only temporarily connected to the directed graph, and after the verification is completed, that is, after it is determined whether the world-state transaction using the same account is completed in any two blocks packed by the target super nodes, the blocks packed by the target super nodes are not connected.
According to the method provided by the embodiment of the invention, whether the block packed by the target super node is a transaction block in a world state using the same account is judged by combining the directed graph, so that the problem of double flowers is avoided, and the reliability of a block chain is ensured.
In this application, after the tree-shaped block chain is generated, if the transaction amount on the block chain network reaches the second threshold, which is a numerical value far greater than the first threshold, which indicates that the transaction amount increase speed on the current block chain network exceeds the speed of the current tree-shaped block chain for storing transaction data, then the block chain of the current tree-shaped structure needs to be expanded, with reference to fig. 8 in combination with fig. 1, another block chain expansion method provided in this application embodiment is shown, and on the basis of fig. 1, the following steps may also be included:
and S104, selecting the target sub-chain after the transaction amount on the network reaches a second transaction amount threshold value.
The target subchain is one of a plurality of subchains of the current tree-shaped block chain, and one way of selecting the target subchain may be: and initiating a capacity expansion request to each target super node, and selecting a second target super node from a plurality of target super nodes which agree to capacity expansion after the target super nodes receive the capacity expansion request and agree to the capacity expansion request, wherein the method for selecting the first target super node can be to select the target super node which is willing to pay the highest cost. And after the second target super node is determined, taking the sub chain corresponding to the second target super node as a target sub chain to be expanded.
And S105, expanding the target sub-chain to enable the target sub-chain to branch into a plurality of second sub-chains.
After the target sub-chain is determined, m third target super nodes (m is larger than or equal to 2) are selected, and the capacity of the target sub-chain is expanded according to the m third target super nodes. The manner of selecting the third target super node may refer to the flow illustrated in fig. 2.
According to the third target super node, the capacity expansion manner of the target sub-chain may be: and connecting all the eligible blocks packed by the m third target super nodes and the second target super nodes to the terminal block of the target sub-chain, so that m +1 second sub-chains are branched from the terminal block of the target sub-chain, and the target sub-chain is branched into a plurality of second sub-chains, wherein each second sub-chain has a corresponding super node. The above embodiments can be referred to for the process of determining whether the block meets the condition, and details are not repeated here.
And S106, according to the corresponding relation between the sub chain and the super node, connecting the blocks which are packed by the super nodes and meet the conditions to the sub chain corresponding to the super node.
After the target subchain of the tree-shaped block chain is expanded, the newly added third target super node and the packed and qualified blocks of the original target super node are connected to the subchain corresponding to the third target super node and the original target super node. Fig. 9 is a schematic diagram of a tree-shaped block chain obtained according to the block chain capacity expansion method provided in this embodiment.
In the method provided by this embodiment, after the transaction amount on the blockchain network reaches the second threshold, the capacity of the target sub-chain of the current tree structure is expanded, so that the target sub-chain is branched into a plurality of second sub-chains, and thus more uplink ports are provided for the block, and more blocks are allowed to be simultaneously connected to the blockchain within a unit time, thereby solving the problems of transaction backlog and network congestion.
Corresponding to the above method for expanding a single-chain block chain provided in the embodiment of the present application, referring to fig. 10, a schematic structural diagram of an expansion device for a single-chain block chain provided in the embodiment of the present application is shown, where the method includes:
a first connection unit 1001, configured to connect a eligible block packed by a plurality of target super nodes selected from the selected blocks to an end block of a single-chain block chain when a transaction amount of the block chain network reaches a first threshold, so that the single-chain block chain is branched into a tree-shaped block chain including a plurality of sub-chains, and the plurality of sub-chains of the tree-shaped block chain are in one-to-one correspondence with the plurality of target super nodes;
a second connecting unit 1002, configured to connect the eligible blocks packed by each target super node to a child chain corresponding to the target super node in the tree-shaped block chain.
With reference to fig. 10, fig. 11 is a schematic structural diagram of another capacity expansion device for a single-chain block chain according to an embodiment of the present application, where the positioning device further includes:
the selecting unit 1003 is further configured to select a plurality of target super nodes, and a specific implementation manner of the plurality of target super nodes selected by the selecting unit 1103 is as follows: broadcasting the expansion request, enabling the plurality of super nodes to feed back the expansion agreement information corresponding to the expansion request according to the expansion request, and selecting the plurality of target super nodes from the plurality of super nodes according to the expansion agreement information fed back by the plurality of super nodes.
Wherein, the blocks which are packed by a plurality of target super nodes and meet the conditions are as follows: and the target super node packed block and any other target super node packed block do not have world state transaction using the same account, and the target super node packed block is a block with the workload proving success.
The judging unit 1004 is configured to judge whether there is a transaction of the world state using the same account in any two blocks packed by the target super node according to the pre-constructed directed graph.
The specific implementation manner of the determining unit 1004 determining whether there is a world-state transaction using the same account in any two blocks packed by target super nodes according to the pre-constructed directed graph is as follows: after receiving a plurality of blocks packed by target super nodes, connecting the blocks into a directed graph; judging whether a plurality of blocks connected to the directed graph exist and are connected to the same target block or not, wherein the target block is a pre-existing block in the directed graph; determining that there is no world-state transaction using the same account in any two target super node packed blocks if there are no multiple blocks connected to the same target block, and accepting only one of the multiple packed blocks connected to the same target block if there are multiple packed blocks connected to the same target block at the same time.
The constructing unit 1005 is configured to construct a directed graph, and a specific implementation manner of the constructing unit for constructing the directed graph is as follows: copying and storing the block chain in the block chain network at present; acquiring a timestamp of a block in a block chain, and reading transactions among transaction accounts included in the block; and matching the corresponding target blocks for the blocks according to the transaction between the transaction accounts, connecting directed edges to the blocks from the target blocks to connect the blocks with the target blocks, and obtaining a directed graph according to the connection relation between each block and the target block.
The third connecting unit 1006 is configured to, after the transaction amount on the blockchain network reaches a second threshold, select a target sub-chain from the sub-chains of the tree-shaped blockchain, and expand the target sub-chain, so that the target sub-chain is branched into a plurality of second sub-chains.
According to the device provided by the application, after the transaction amount of the block chain network reaches a first threshold value, the blocks which are packed by the selected target super nodes and meet the conditions are connected to the tail end block of the single chain block chain, the single chain block chain is branched into the tree-shaped block chain comprising the sub chains, and after the tree-shaped block chain is obtained, the blocks which are packed by each target super node and verified successfully are connected to the sub chains corresponding to the target super nodes in the tree-shaped block chain. Therefore, according to the technical scheme provided by the application, the single-chain block chain is branched into the tree-shaped block chain comprising the plurality of sub-chains, so that the entrance of the block chain is increased, the purpose of expanding the capacity of the block chain is achieved, and the problems of transaction overstock and network congestion under the condition that the block chain network transaction amount is large are solved.
The present application further provides an apparatus, a schematic structural diagram of which is shown in fig. 12, including: the processor 1201 and the memory 1202, the memory 1202 is used for storing programs, and the processor 1201 is used for running the programs to implement the above capacity expansion method for the single-chain block chain.
The present application further provides a computer-readable storage medium having stored therein instructions, which when run on a computer, cause the computer to execute the above mentioned capacity expansion method for a single-chain blockchain.
The functions described in the method of the embodiment of the present application, if implemented in the form of software functional units and sold or used as independent products, may be stored in a storage medium readable by a computing device. Based on such understanding, part of the contribution to the prior art of the embodiments of the present application or part of the technical solution may be embodied in the form of a software product stored in a storage medium and including several instructions for causing a computing device (which may be a personal computer, a server, a mobile computing device or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. 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.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A capacity expansion method for a single-chain block chain is characterized by comprising the following steps:
when the transaction amount of a block chain network reaches a first threshold value, connecting the selected blocks which are packed by a plurality of target super nodes and meet the conditions to a terminal block of the single-chain block chain, so that the single-chain block chain is branched into a tree-shaped block chain comprising a plurality of sub chains, wherein the sub chains of the tree-shaped block chain correspond to the target super nodes one to one;
and connecting the qualified blocks packed by each target super node to the sub-chain corresponding to the target super node in the tree-shaped block chain.
2. The method of claim 1, wherein selecting the plurality of target supernodes comprises:
broadcasting an expansion request, so that a plurality of super nodes feed back the corresponding agreed expansion information corresponding to the expansion request according to the expansion request;
and selecting a plurality of target super nodes from the plurality of super nodes according to the agreed capacity expansion information fed back by the plurality of super nodes.
3. The method of claim 1, wherein the plurality of target super nodes packed eligible blocks are: the target super node packed block and any other target super node packed block do not have world state transaction using the same account, and the block is a block with workload proving success.
4. The method of claim 3, further comprising: and judging whether the world state transaction using the same account exists in any two blocks packed by the target super nodes according to a pre-constructed directed graph.
5. The method of claim 4, wherein the process of constructing the directed graph comprises:
copying and storing the current block chain in the block chain network;
acquiring a timestamp of a block in the block chain, and reading transactions among transaction accounts included in the block;
matching the corresponding target blocks for the blocks according to the transaction between the transaction accounts;
connecting a directed edge from the target block to the block, connecting the block with its target block;
and obtaining the directed graph according to the connection relation between each block and the target block.
6. The method of claim 4, wherein the determining whether there are transactions of world states using the same account in any two blocks packed by target super nodes according to the pre-constructed directed graph comprises:
after receiving a plurality of blocks packed by the target super nodes, connecting the blocks into the directed graph;
judging whether a plurality of blocks connected to the same target block exist in the blocks connected to the directed graph, wherein the target block is a pre-existing block in the directed graph;
if there are no multiple blocks connected to the same target block, then it is determined that there are no world-wide transactions using the same account in any two blocks packed by the target super node.
7. The method of claim 6, further comprising: accepting only one of the plurality of packed blocks connected to the same target block if there are a plurality of the packed blocks simultaneously connected to the same target block.
8. The method of claim 1, further comprising: and when the transaction amount on the block chain network reaches a second threshold value, selecting a target sub-chain from the sub-chains of the tree-shaped block chain, and expanding the target sub-chain to enable the target sub-chain to branch into a plurality of second sub-chains.
9. A flash device for a single-chain blockchain, comprising:
the first connecting unit is used for connecting the selected blocks packed by the target super nodes to the terminal block of the single-chain block chain after the transaction amount of the block chain network reaches a first threshold value, so that the single-chain block chain is branched into a tree-shaped block chain comprising a plurality of sub-chains, and the sub-chains of the tree-shaped block chain are in one-to-one correspondence with the target super nodes;
and the second connecting unit is used for connecting the block which is packed and verified successfully by each target super node to the sub-chain corresponding to the target super node in the tree-shaped block chain.
10. An apparatus, comprising: a processor and a memory for storing a program; the processor is configured to execute the program to implement the capacity expansion method for the single-chain block chain according to any one of claims 1 to 8.
CN201911284239.5A 2019-12-13 2019-12-13 Capacity expansion method and device based on single-chain blockchain Active CN111061735B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911284239.5A CN111061735B (en) 2019-12-13 2019-12-13 Capacity expansion method and device based on single-chain blockchain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911284239.5A CN111061735B (en) 2019-12-13 2019-12-13 Capacity expansion method and device based on single-chain blockchain

Publications (2)

Publication Number Publication Date
CN111061735A true CN111061735A (en) 2020-04-24
CN111061735B CN111061735B (en) 2023-07-25

Family

ID=70301576

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911284239.5A Active CN111061735B (en) 2019-12-13 2019-12-13 Capacity expansion method and device based on single-chain blockchain

Country Status (1)

Country Link
CN (1) CN111061735B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737361A (en) * 2020-07-22 2020-10-02 百度在线网络技术(北京)有限公司 Block chain processing method, device, equipment and storage medium
CN111769946A (en) * 2020-05-08 2020-10-13 贵阳信息技术研究院(中科院软件所贵阳分部) Large-scale node capacity expansion method for alliance chain
CN113342888A (en) * 2021-05-19 2021-09-03 中国科学院计算技术研究所 Method and system for vertical extension of hyper account book Fabric
CN113468200A (en) * 2021-09-01 2021-10-01 支付宝(杭州)信息技术有限公司 Method and device for expanding fragments in block chain system

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105809420A (en) * 2016-03-08 2016-07-27 杭州复杂美科技有限公司 Liquidation method of multi-layer block chain
CN107733855A (en) * 2017-08-31 2018-02-23 中国科学院信息工程研究所 A kind of block catenary system and application process that can support publicly-owned chain, alliance's chain and privately owned chain simultaneously
CN109039646A (en) * 2018-07-12 2018-12-18 北京链享未来科技有限公司 A kind of packing of block chain block and verification method and system based on node capacity
CN109194485A (en) * 2018-08-21 2019-01-11 甲骨文科技时代(深圳)有限公司 A kind of network-building method of multi-type network node
CN109691064A (en) * 2018-08-23 2019-04-26 区链通网络有限公司 Can anti-quantum block chain Accounting system expansion method, device and system
CN109885264A (en) * 2019-04-16 2019-06-14 北京艾摩瑞策科技有限公司 A kind of the logic sharding method and its system of block chain node
CN110235162A (en) * 2019-04-30 2019-09-13 厦门特华荣商贸有限公司 The generation method of block catenary system data processing method and block
WO2019184775A1 (en) * 2018-03-30 2019-10-03 华为技术有限公司 Management data storage method and device, and storage medium
CN110362633A (en) * 2019-07-23 2019-10-22 腾讯科技(深圳)有限公司 Block data storage method, device, computer equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105809420A (en) * 2016-03-08 2016-07-27 杭州复杂美科技有限公司 Liquidation method of multi-layer block chain
CN107733855A (en) * 2017-08-31 2018-02-23 中国科学院信息工程研究所 A kind of block catenary system and application process that can support publicly-owned chain, alliance's chain and privately owned chain simultaneously
WO2019184775A1 (en) * 2018-03-30 2019-10-03 华为技术有限公司 Management data storage method and device, and storage medium
CN109039646A (en) * 2018-07-12 2018-12-18 北京链享未来科技有限公司 A kind of packing of block chain block and verification method and system based on node capacity
CN109194485A (en) * 2018-08-21 2019-01-11 甲骨文科技时代(深圳)有限公司 A kind of network-building method of multi-type network node
CN109691064A (en) * 2018-08-23 2019-04-26 区链通网络有限公司 Can anti-quantum block chain Accounting system expansion method, device and system
CN109885264A (en) * 2019-04-16 2019-06-14 北京艾摩瑞策科技有限公司 A kind of the logic sharding method and its system of block chain node
CN110235162A (en) * 2019-04-30 2019-09-13 厦门特华荣商贸有限公司 The generation method of block catenary system data processing method and block
CN110362633A (en) * 2019-07-23 2019-10-22 腾讯科技(深圳)有限公司 Block data storage method, device, computer equipment and storage medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111769946A (en) * 2020-05-08 2020-10-13 贵阳信息技术研究院(中科院软件所贵阳分部) Large-scale node capacity expansion method for alliance chain
CN111769946B (en) * 2020-05-08 2022-08-19 贵阳信息技术研究院(中科院软件所贵阳分部) Large-scale node capacity expansion method for alliance chain
CN111737361A (en) * 2020-07-22 2020-10-02 百度在线网络技术(北京)有限公司 Block chain processing method, device, equipment and storage medium
CN111737361B (en) * 2020-07-22 2021-01-15 百度在线网络技术(北京)有限公司 Block chain processing method, device, equipment and storage medium
CN113342888A (en) * 2021-05-19 2021-09-03 中国科学院计算技术研究所 Method and system for vertical extension of hyper account book Fabric
CN113342888B (en) * 2021-05-19 2022-12-06 中国科学院计算技术研究所 Method and system for longitudinally expanding super account book Fabric
CN113468200A (en) * 2021-09-01 2021-10-01 支付宝(杭州)信息技术有限公司 Method and device for expanding fragments in block chain system

Also Published As

Publication number Publication date
CN111061735B (en) 2023-07-25

Similar Documents

Publication Publication Date Title
CN111061735A (en) Capacity expansion method and device based on single-chain block chain
CN111629039B (en) Block chain consensus method, client, endorsement node and sequencing node
US11018979B2 (en) System and method for network slicing for service-oriented networks
CN108596623B (en) Block chain consensus achieving method
CN109218352B (en) Consensus confirmation method and device for transaction information in blockchain network
CN110599177A (en) Transaction verification method and related equipment
CN111104460B (en) Block chain consensus method, system, electronic equipment and storage medium
CN113409047B (en) Data processing method, device and equipment based on block chain and readable storage medium
US20230283527A1 (en) Method for scheduling mobile edge computing-oriented distributed dedicated protection services
CN110784521B (en) Block chain consensus method, electronic device and storage medium
CN108665363B (en) Block chain consensus achieving device
CN110555079B (en) Data processing method, device, equipment and storage medium
CN109254854A (en) Asynchronous invoking method, computer installation and storage medium
CN109189572B (en) Resource estimation method and system, electronic equipment and storage medium
CN110659905B (en) Transaction verification method, device, terminal equipment and storage medium
CN111541756B (en) Block generation method, block generation device, node equipment and storage medium
CN111507717A (en) Data processing method, device, block node and computer readable storage medium
CN105159728A (en) Method and device for obtaining NTP time information based on android system
CN111932257A (en) Block chain parallelization processing method and device
CN110958666B (en) Network slice resource mapping method based on reinforcement learning
CN109670800A (en) Transaction processing method and system, storage medium and terminal based on ether mill
CN108062235A (en) Data processing method and device
CN111522876B (en) Block chain consensus method, device, computer equipment and block chain link point
CN115665251A (en) Edge cloud resource allocation method and system
CN113706146B (en) Processing method, device and system for executing batch transactions based on blockchain

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

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.

CB02 Change of applicant information
TA01 Transfer of patent application right

Effective date of registration: 20211220

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.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant