CN111061735B - Capacity expansion method and device based on single-chain blockchain - Google Patents

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

Info

Publication number
CN111061735B
CN111061735B CN201911284239.5A CN201911284239A CN111061735B CN 111061735 B CN111061735 B CN 111061735B CN 201911284239 A CN201911284239 A CN 201911284239A CN 111061735 B CN111061735 B CN 111061735B
Authority
CN
China
Prior art keywords
target
block
blockchain
blocks
chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911284239.5A
Other languages
Chinese (zh)
Other versions
CN111061735A (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
Du Xiaoman Technology Beijing 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 Du Xiaoman Technology Beijing Co Ltd filed Critical Du Xiaoman Technology Beijing 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

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

Abstract

The application provides a capacity expansion method and device for a single-chain blockchain, wherein after the transaction amount of a blockchain network reaches a first threshold value, a plurality of selected target supernodes are packed and matched with a conditional block to be connected to the tail end block of the single-chain blockchain, so that the single-chain blockchain is branched into a tree-shaped blockchain comprising a plurality of sub-chains, and after the tree-shaped blockchain is obtained, each target supernode is packed and verified to be successful, and the block is connected to the sub-chain corresponding to the target supernode in the tree-shaped blockchain. Therefore, according to the technical scheme, the single-chain blockchain is branched into the tree-shaped blockchain comprising a plurality of sub-chains, so that the entrance of the blockchain is increased, the purpose of expanding the capacity of the single-chain blockchain is achieved, and the problems of transaction backlog and network congestion under the condition of large blockchain network transaction amount are solved.

Description

Capacity expansion method and device based on single-chain blockchain
Technical Field
The invention relates to the technical field of blockchains, in particular to a single-chain blockchain-based capacity expansion method and device.
Background
The blockchain is formed by sequentially connecting a plurality of blocks, and each block stores a data storage chain of transaction data of a blockchain network.
Existing blockchain technology has only one single-chain blockchain in a blockchain network, and the single-chain blockchain only allows one blockchain to be uplink in unit time, namely, only transaction data of one block can be stored in the blockchain in unit time, and the transaction data amount included in one block is limited, in this case, if the transaction data amount in the blockchain network is increased, most transaction data cannot be stored in the blockchain in time, so that transaction backlog and network congestion in the blockchain network are caused.
Disclosure of Invention
The application provides a single-chain blockchain-based capacity expansion method and device, and aims to solve the problem of backlog of transactions in a blockchain network under the condition that transaction data volume in the blockchain network is taken.
In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
a method of expanding capacity for a single chain blockchain, comprising:
when the transaction amount of the blockchain network reaches a first threshold, connecting the selected eligible blocks packaged by a plurality of target supernodes to the tail end blocks of the single-chain blockchain, so that the single-chain blockchain is branched into tree-shaped blockchains comprising a plurality of subchains, wherein the subchains of the tree-shaped blockchain are in one-to-one correspondence with the target supernodes;
and connecting each packaged eligible block of the target super node to a sub-chain corresponding to the target super node in the tree-shaped block chain.
In the above method, optionally, the process of selecting a plurality of target super nodes includes:
broadcasting a capacity expansion request, and enabling a plurality of super nodes to feed back consent capacity expansion information corresponding to the capacity expansion request according to the capacity expansion request;
and selecting a plurality of target super nodes from the plurality of super nodes according to the consent expansion information fed back by the plurality of super nodes.
In the above method, optionally, the blocks packaged by the target super nodes and meeting the condition are: and the block packed by the target super node and any other block packed by the target super node do not have transactions using the world state of the same account, and the block is a block with successful workload proving.
The method, optionally, further comprises: judging whether world state transactions using the same account exist in any two blocks packed by the target super node according to a pre-constructed directed graph.
The method, optionally, the process of constructing the directed graph, includes:
copying and storing a blockchain in the blockchain network;
acquiring a time stamp of a block in the block chain, and reading transactions among transaction accounts included in the block;
matching corresponding target blocks for the blocks according to transactions among the transaction accounts;
connecting a directed edge from the target block to the block, and connecting the block with the target block;
and obtaining the directed graph according to the connection relation between each block and the target block.
In the above method, optionally, the determining, according to the pre-constructed directed graph, whether the world state transaction using the same account exists in the blocks packaged by any two target supernodes includes:
after receiving a plurality of blocks packaged by the target super node, connecting the blocks into the directed graph;
judging whether a plurality of blocks connected to the directed graph are connected to the same target block or not, wherein the target block is a pre-existing block in the directed graph;
if there are no more than one of the blocks connected to the same target block, it is determined that there are no transactions using the world state of the same account in any two of the target supernode packaged blocks.
The method, optionally, further comprises: if there are multiple of the packed blocks connected to the same target block at the same time, only one of the multiple of the packed blocks connected to the same target block is accepted.
The method, optionally, further comprises: and when the transaction amount on the blockchain network reaches a second threshold, selecting a target subchain from the subchains of the tree-shaped blockchain, and expanding the target subchain to branch the target subchain into a plurality of second subchains.
A capacity expansion device for a single chain blockchain, comprising:
the first connection unit is used for connecting the blocks packed by the selected target super nodes to the tail end blocks of the single-chain blockchain after the transaction amount of the blockchain network reaches a first threshold value, so that the single-chain blockchain is branched into tree blockchains comprising a plurality of subchains, and the subchains of the tree blockchains are in one-to-one correspondence with the target super nodes;
and the second connection unit is used for connecting each target super node packaged and verified block to a 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 blockchain network reaches a first threshold, the selected blocks which are packaged by a plurality of target supernodes and meet the conditions are connected to the tail end blocks of the single-chain blockchain, so that the single-chain blockchain is branched into tree-shaped blockchains comprising a plurality of sub-chains, and after the tree-shaped blockchain is obtained, each target supernode is packaged and the blocks which meet the conditions are connected to the sub-chains corresponding to the target supernodes in the tree-shaped blockchain. Therefore, according to the technical scheme, the single-chain blockchain is branched into the tree-shaped blockchain comprising a plurality of sub-chains, so that the entrance of the blockchain is increased, the purpose of expanding the blockchain is achieved, and the problems of transaction backlog and network congestion under the condition of large blockchain network transaction amount 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 that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method of expanding capacity for a single chain blockchain in accordance with embodiments of the present application;
FIG. 2 is a flow chart of a method of selecting a plurality of target supernodes according to embodiments of the present application;
FIG. 3 is a flow chart of a method of constructing a directed graph as disclosed in an embodiment of the present application;
FIG. 4 is a flow chart of a method for determining whether there is a transaction using the world state of the same account in any two target supernode packaged blocks using a directed graph according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a tree blockchain as disclosed in the embodiments of the present application;
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 an embodiment of the present application;
FIG. 8 is a flow chart of another method of expanding capacity for single chain blockchains disclosed in embodiments 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 diagram of a capacity expansion device for single chain blockchain according to an embodiment of the present disclosure;
FIG. 11 is a schematic diagram of another embodiment of a single chain block chain expansion device according to the present disclosure;
fig. 12 is a schematic structural diagram of an apparatus according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
To facilitate an understanding of the methods provided by embodiments of the present application, a brief description of the blockchain technique involved in the present application will be first provided.
A blockchain network is a distributed system consisting of a plurality of nodes. The nodes can be fixed computers, portable computers or intelligent mobile phones and other devices which can access the Internet, and users can access the blockchain network through the web end or the app end by utilizing 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 capacity, and the working nodes are nodes with smaller bandwidth and slower computing speed.
Fig. 1 is a schematic diagram of a method for expanding a single chain blockchain according to an embodiment of the present application, which specifically includes the following steps:
s101, connecting the block with the successful workload proven to the current single chain blockchain before the transaction amount on the blockchain network does not reach the first threshold.
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 small and the current blockchain network does not generate transaction backlog is indicated. At this time, nodes (working nodes or super nodes) in the blockchain network pack transactions on the blockchain network into blocks, then perform workload certification, and connect the blocks with successful workload certification to the current single-chain blockchain. The specific process of the 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 block of the single chain is an originating block, the originating block is constructed by an initialization method when the blockchain network is established, and after the blockchain network is established, the first block is packed by the blockchain nodes and connected to the blocks in the blockchain. The second block, whose workload proves successful, is connected to the creation block, and so on, to form a single chain blockchain of a plurality of blocks connected in time sequence.
And S102, after the transaction amount reaches a first threshold, connecting the selected qualified blocks packed by the target super nodes to the tail end blocks of the single-chain blockchain, so that the single-chain blockchain is branched into a tree-shaped blockchain comprising a plurality of sub-chains.
After the transaction amount on the blockchain network reaches a first threshold, transaction backlog may be caused, and then a plurality of target super nodes are selected from the super nodes of the network. The process of selecting a plurality of target supernodes may refer to the flow shown in fig. 2.
After the target super node packages the transaction of the network to obtain the block, verifying whether the block packaged by the target super node meets the preset conditions, wherein the preset conditions are as follows: the world state transaction using the same account does not exist in any two target supernode packaged blocks, and the target supernode packaged blocks are blocks with successful workload proving. The process of determining whether the world state transaction using the same account exists in the blocks packaged by any two target supernodes by using the directed graph may refer to fig. 3, the process of determining whether the world state transaction using the same account exists in the blocks packaged by any two target supernodes by using the directed graph may refer to fig. 4, and the process of performing workload certification on the blocks may refer to the prior art.
After obtaining the qualified blocks packed by the plurality of target supernodes, for example, obtaining six qualified blocks, the six blocks are connected to the end blocks of the current single-chain blockchain, so that six sub-chains are branched from the end blocks, and the current single-chain blockchain is branched into a tree-shaped blockchain comprising six sub-chains.
It should be noted that, a plurality of sub-chains of the tree-shaped block chain are in one-to-one correspondence with a plurality of target super nodes, and the super node corresponding to any sub-chain is the head end block of the sub-chain, which is the block packaged by the super node and meets the condition.
And S103, after the tree-shaped block chain is generated, connecting the blocks packaged by each target super node and meeting the conditions to the sub-chain corresponding to the target super node in the tree-shaped block chain according to the corresponding relation between the sub-chain and the target super node.
After the tree-shaped block chain is generated, the block packed by the target super node corresponding to the sub-chain is verified to be in accordance with the condition and then is connected to the sub-chain corresponding to the super node. It should be noted that, all the target supernodes may package the transactions on the blockchain network, or any one or several of the target supernodes may package the transactions on the blockchain network.
According to the method provided in this embodiment, reference may be made to fig. 5 for a schematic diagram of the tree-shaped blockchain. The number in each block in fig. 5 is a custom block number, and the set in each block is the set of transactions between the transaction accounts.
According to the method provided by the embodiment, after the transaction amount of the blockchain network reaches the first threshold, the selected blocks which are packaged by the target supernodes and meet the conditions are connected to the tail end blocks of the single-chain blockchain, so that the single-chain blockchain is branched into tree-shaped blockchains comprising a plurality of sub-chains, and after the tree-shaped blockchains are obtained, each target supernode is packaged and the blocks which are successfully verified are connected to the sub-chains corresponding to the target supernodes in the tree-shaped blockchain. Therefore, according to the technical scheme, the single-chain blockchain is branched into the tree-shaped blockchain comprising a plurality of subchains, so that the entrance of the blockchain is increased, a plurality of blocks are allowed to be connected into the blockchain in unit time at the same time, the purpose of expanding the blockchain is achieved, and the problems of transaction backlog and network congestion under the condition of large blockchain network transaction amount are solved.
It should be noted that in the above embodiment, after selecting a plurality of target super nodes, each super node may broadcast a capacity expansion transaction message, so that nodes in the whole network all learn about to expand the capacity message. Wherein, the branch point of the single chain blockchain, namely the end block of the chain blockchain, is specified in the capacity expansion transaction message. The predetermined content may be that, after the transaction amount of the blockchain network reaches a first threshold and the total number of blocks connected to the single-chain blockchain reaches a block threshold, a block corresponding to the block threshold is regarded as a branching point of the single-chain blockchain. And after the single-chain blockchain is developed to the branch point, packaging the network total transaction by the selected plurality of target super nodes.
Fig. 2 is a schematic diagram of an embodiment of selecting a plurality of super nodes according to the above embodiment, including the following steps:
s201, broadcasting a capacity expansion request.
After the transaction amount on the blockchain network reaches a first threshold, the node initiates a capacity expansion request, wherein the capacity expansion request comprises the capacity expansion branch number (namely the number of sub-chains), an ID code of the capacity expansion request and the minimum payment cost of the super node agreeing 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 a transaction.
S202, receiving the information of agreeing to expand fed back by each super node.
After each super node on the blockchain network receives the expansion request, the super node agreeing to expand the expansion information fed back by the super node agreeing to expand the expansion information, wherein the expansion agreeing information comprises the ID code of the expansion request, the payment for agreeing to pay and other data, and the expansion agreeing information is added into the current single-chain blockchain in a transaction mode.
S203, selecting a plurality of target super nodes from all super nodes which agree to expand capacity.
Since the number of expansion branches is specified in the expansion request, it is necessary to select the same number of target supernodes as the number of expansion branches from the plurality of supernodes agreeing to expand. The method comprises the steps of selecting a target super node from a plurality of super nodes agreeing to expand, storing the target super node in an intelligent contract in advance, wherein the intelligent contract can provide that the super nodes with the payment fees ordered in the front are selected according to the order of the fees paid by the super nodes agreeing to expand from high to low.
According to the method provided by the embodiment, a plurality of target super nodes are selected in an competitive mode according to the capacity expansion request, and the super nodes can pack the blocks rapidly due to the fact that the target super nodes have large bandwidth and high-speed computing capacity, so that the uplink speed of the blocks can be improved.
Fig. 3 is a diagram of a directional diagram constructed in the above embodiment, and may include the following steps:
s301, copying and storing the blockchain in the current blockchain network.
When a blockchain in the blockchain network is updated, each node replicates the current blockchain and stores it in the node.
S302, acquiring a time stamp of a block in the current block chain, and reading transaction data among transaction accounts included in the block.
Each block has a time stamp, which may be the time when the block is connected to the blockchain, or the time when the broadcast is performed after the completion of the workload certification. Since transaction data of each block contains transactions between a plurality of different transaction accounts, transactions between all transaction accounts included in the block need to be read.
S303, matching corresponding target blocks for the blocks according to transactions among the transaction accounts.
For any transaction account in the blocks, if the transaction account is still in a plurality of blocks to be matched, selecting the block to be matched with the nearest timestamp to the block as a target block of the block, and if the transaction account is only in one block to be matched, directly taking the block to be matched as the target block.
For example, for the transaction account a of the block a, the transaction account a is included in the block B, the block C and the block D at the same time, and then the block with the closest timestamp to the block a is selected from the block B, the block C and the block D as the target block of the block a.
S304, connecting the target block with the directed edge to the block, so that the block is connected with the target block.
After the target block of the block is determined, the directed edge is connected from the target block to the 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 each block according to the connection relation between each block in the block chain and the target block.
In this embodiment, if the tree-shaped blockchain is as shown in fig. 5, the corresponding obtained directed graph may refer to fig. 6. Every time a new block is attached to a blockchain, the directed graph synchronously adds the new block, i.e., the nodes described in the above embodiments copy and store the blockchain in the current blockchain network.
The following takes the block chain to build shown in fig. 5 to obtain the directed graph shown in fig. 6 as an example, and the specific description of the process of building the directed graph is as follows: when the creation block appears in fig. 5, the first block in the directed graph (fig. 6) is the creation block. When the blockchain is connected to a second block (block numbered 2), the corresponding directed graph also adds the second block, and in the current directed graph, since the created block is the initial block, a directed edge is connected from the created block to the second block. When the block is connected to the third block, the corresponding directed graph is added with the third block, and in the current directed graph, the block containing the transaction account number B with the third block is the second block and the generated block, but the second block is newer (the timestamp is later than the generated block), so that the directed edge is connected from the second block to the third block, and the directed edge is connected from the generated block to the third block because the directed edge is connected with the only generated block containing the transaction account number C. Similarly, when the block is connected to the seventh block, the corresponding directed graph will also add the seventh block, in the current directed graph, the block containing the transaction account B with the seventh block is the second block and the third block, but in the time stamp, the third block is closer to the seventh block, so that a directed edge is connected from the third block to the seventh block, and according to the above method, the directed graph corresponding to fig. 5 is finally obtained.
In the method provided in this embodiment, the complete state change process of any transaction account may be recorded through the directed graph, for example, in fig. 6, according to the directed edge, the complete state change process of the account C is: the creation block, the third block, the fifth block and the seventh block.
FIG. 4 is a diagram showing an embodiment of determining whether there is a world-state transaction using the same account in any two target supernode packaged blocks according to the above implementation, which may include the following steps:
s401, after receiving the blocks packaged by the super nodes, connecting the blocks to the directed graph.
The method for connecting any one block to the directed graph may refer to the flowchart shown in fig. 3, and will not be described herein.
S402, judging whether a plurality of blocks connected to the same target block exist in the plurality of packaged blocks connected to the directed graph.
After all the blocks packed by the plurality of super nodes are connected to the directed graph, judging whether a plurality of blocks obtained by packing the plurality of super nodes are connected to the same target block, wherein the target block is a pre-existing block in the directed graph.
S403, if there are no blocks packed by a plurality of super nodes connected to the same target block, determining that there are no world-state transactions using the same account in any two target super node packed blocks.
If there are no blocks packed by multiple supernodes connected to the same block at the same time, it is stated that there are no blocks of transactions using the world state of 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 of the plurality of packed blocks connected to the same target block is accepted.
In this embodiment, if there are multiple supernode packed blocks connected to the same target block, it is explained that the world state of a transaction account of the same block generates multiple transactions at the same time, and this is a typical "double-flower problem" in the blockchain technology, which is not allowed in the blockchain network. Therefore, one of the blocks connected to the same target block can be accepted, wherein the block with the largest transaction account included in the plurality of blocks can be selected as the accepted block, or one of the blocks can be randomly selected as the accepted block.
In this embodiment, for example, before connecting the blocks packed by the plurality of supernodes to the directed graph, the directed graph implements the above-mentioned fig. 6, and it is assumed that the blocks packed by the plurality of supernodes are respectively: the block comprising transaction accounts E and H and the block comprising transaction accounts E and Q, which two blocks are connected to fig. 6, result in a directed graph as shown in fig. 7. It can be seen that in fig. 7, the blocks comprising transaction accounts E and H and the blocks comprising transaction accounts E and Q are simultaneously connected to the fourth block comprising transaction accounts D and E, i.e. two directed edges with the same transaction account (transaction account E) appear from the fourth block, illustrating the world state in which the blocks comprising transaction accounts E and H and the blocks comprising transaction accounts E and Q are simultaneously using transaction account E, which is a "double-flower problem" that is not allowed to appear in the blockchain network.
It should be noted that, the target supernode packaged block is only temporarily connected to the directed graph, and after verification is completed, it is determined whether any two target supernode packaged blocks have world state transactions using the same account, and then the target supernode packaged block is not connected.
According to the method provided by the embodiment of the invention, through combining the directed graph, whether the block packed by the target super node is the block of the world state transaction using the same account is judged, so that the double-flower problem is avoided, and the reliability of the block chain is ensured.
In the present application, after the tree-shaped blockchain is generated, if the transaction amount on the blockchain network reaches a second threshold, where the second threshold is a value far equal to the first threshold, which indicates that the transaction amount growth speed on the current blockchain network exceeds the speed of storing transaction data by the current tree-shaped blockchain, the blockchain of the current tree-shaped structure needs to be expanded, and referring to fig. 8 in conjunction with fig. 1, another blockchain expansion method provided by the embodiment of the present application is shown, and on the basis of fig. 1, the method may further include the following steps:
s104, after the transaction amount on the network reaches a second transaction amount threshold, selecting a target sub-chain.
The target sub-chain is one of a plurality of sub-chains of the current tree-shaped block chain, and one way of selecting the target sub-chain 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 with capacity expansion after the target super nodes receive the capacity expansion request and agree with the capacity expansion request, wherein the method for selecting the first target super node can be to select the target super node with the highest cost which is willing to pay. 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.
S105, expanding the target sub-chain to enable the target sub-chain to be branched into a plurality of second sub-chains.
After the target sub-chain is determined, m third target super nodes (m is more than or equal to 2) are selected, and the target sub-chain is expanded according to the m third target super nodes. The manner in which the third target supernode is selected may be referred to as the flow described in fig. 2.
According to the third target super node, the target sub-chain can be expanded in the following manner: and all the blocks which are packaged by the m third target super nodes and the second target super nodes and meet the conditions are connected to the tail end blocks of the target sub-chain, so that m+1 second sub-chains are branched from the tail end blocks of the target sub-chain, the target sub-chain is branched into a plurality of second sub-chains, and each second sub-chain is provided with a corresponding super node. The process of determining whether the block meets the condition may refer to the above embodiment, and will not be described herein.
S106, according to the corresponding relation between the sub-chains and the super nodes, each super node is packed, and the blocks which meet the conditions are connected to the sub-chains corresponding to the super nodes.
And after the target sub-chain of the tree-shaped block chain is expanded, connecting the newly added third target super node and the packaged and conditional block of the original target super node to the sub-chain corresponding to the tree-shaped block chain. According to the blockchain expanding method provided in this embodiment, fig. 9 may be referred to as a schematic diagram of the tree-shaped blockchain.
According to the method provided by the embodiment, after the transaction amount on the blockchain network reaches the second threshold, 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, more uplink ports are provided for the blocks, more blocks are allowed to be connected to the blockchain in unit time, and the problems of transaction backlog and network congestion are solved.
Corresponding to the capacity expansion method for single-chain blockchain provided in the embodiment of the present application, referring to fig. 10, a schematic structural diagram of a capacity expansion device for single-chain blockchain provided in the embodiment of the present application is shown, including:
a first connection unit 1001, configured to connect, after the transaction amount of the blockchain network reaches a first threshold, a selected eligible block packaged by a plurality of target supernodes to an end block of a single-chain blockchain, so that the single-chain blockchain branches into a tree-shaped blockchain including a plurality of subchains, where the plurality of subchains of the tree-shaped blockchain correspond to the plurality of target supernodes one by one;
and a second connection unit 1002, configured to connect the eligible blocks packaged by each target supernode to the sub-chain corresponding to the target supernode in the tree-shaped blockchain.
Referring to fig. 10, fig. 11 is a schematic structural diagram of another capacity expansion device for single chain blockchain 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 supernodes, where a specific implementation manner of the plurality of target supernodes selected by the selecting unit 1103 is: broadcasting a capacity expansion request, enabling a plurality of super nodes to feed back the consent capacity expansion information corresponding to the capacity expansion request according to the capacity expansion request, and selecting a plurality of target super nodes from the plurality of super nodes according to the consent capacity expansion information fed back by the plurality of super nodes.
The blocks packaged by the target super nodes and meeting the conditions are as follows: there is no world-state transaction using the same account between the target supernode packed block and any of the remaining target supernode packed blocks, and the target supernode packed block is a block whose workload proves success.
The judging unit 1004 is configured to judge whether there is a transaction using the world state of the same account in the blocks packaged by any two target supernodes according to the pre-constructed directed graph.
The specific implementation manner of the judging unit 1004 in judging whether the world state transaction using the same account exists in the blocks packed by any two target supernodes according to the pre-constructed directed graph is as follows: after receiving the blocks packed by the target super nodes, connecting the blocks into a directed graph; judging whether a plurality of blocks connected to a directed graph are connected to the same target block or not, wherein the target block is a pre-existing block in the directed graph; if a plurality of blocks are not connected to the same target block, determining that no world state transaction using the same account exists in any two target supernode packaged blocks, and if a plurality of the packaged blocks are connected to the same target block at the same time, only one block of the plurality of the packaged blocks connected to the same target block is accepted.
A building unit 1005, configured to build a directed graph, where a specific implementation manner of the building unit to build the directed graph is: copying and storing a blockchain in the blockchain network; acquiring a time stamp of a block in a block chain, and reading transactions among transaction accounts included in the block; according to the transaction between each transaction account, the corresponding target blocks are matched for the blocks, the target blocks are connected with directed edges to the blocks, the blocks are connected with the target blocks, and the directed graph is obtained according to the connection relation between each block and the target blocks.
And a third connection unit 1006, configured to select a target sub-chain from the sub-chains of the tree-shaped blockchain after the transaction amount on the blockchain network reaches the second threshold, and expand the target sub-chain to branch the target sub-chain into a plurality of second sub-chains.
According to the device provided by the implementation of the application, after the transaction amount of the blockchain network reaches the first threshold, the selected blocks which are packaged by the target supernodes and meet the condition are connected to the tail end blocks of the single-chain blockchain, so that the single-chain blockchain is branched into tree-shaped blockchains comprising a plurality of sub-chains, and after the tree-shaped blockchain is obtained, each block which is packaged by the target supernodes and is successfully verified is connected to the sub-chain corresponding to the target supernodes in the tree-shaped blockchain. Therefore, according to the technical scheme, the single-chain blockchain is branched into the tree-shaped blockchain comprising a plurality of sub-chains, so that the entrance of the blockchain is increased, the purpose of expanding the blockchain is achieved, and the problems of transaction backlog and network congestion under the condition of large blockchain network transaction amount are solved.
The application also provides a device, the structure of which is shown in fig. 12, comprising: a processor 1201 and a memory 1202, the memory 1202 being used for storing a program, the processor 1201 being used for running the program to implement the above-described capacity expansion method for single chain blockchains.
The present application also provides a computer readable storage medium having instructions stored therein that, when executed on a computer, cause the computer to perform the above-described method of expanding a single chain blockchain.
The functions described in the methods of the present application, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computing device readable storage medium. Based on such understanding, a portion of the embodiments of the present application that contributes to the prior art or a portion of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computing device (which may be a personal computer, a server, a mobile computing device or a network device, etc.) to perform all or part of the steps of the methods 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, random Access Memory), a magnetic disk, or an optical disk, or 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 one … …" does not exclude the presence of other like 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 (8)

1. A method of expanding capacity for a single chain blockchain, comprising:
when the transaction amount of the blockchain network reaches a first threshold, connecting the selected eligible blocks packaged by a plurality of target supernodes to the tail end blocks of the single-chain blockchain, so that the single-chain blockchain is branched into tree-shaped blockchains comprising a plurality of subchains, wherein the subchains of the tree-shaped blockchain are in one-to-one correspondence with the target supernodes;
connecting each packaged eligible block of the target super node to a sub-chain corresponding to the target super node in the tree-shaped block chain;
the blocks packaged by the target super nodes and meeting the conditions are as follows: the target supernode packaged block and any other target supernode packaged block do not have transactions using the world state of the same account, and the block is a block with successful workload proving;
judging whether world state transactions using the same account exist in any two blocks packed by the target super node according to a pre-constructed directed graph.
2. The method of claim 1, wherein the process of selecting a plurality of target supernodes comprises:
broadcasting a capacity expansion request, and enabling a plurality of super nodes to feed back consent capacity expansion information corresponding to the capacity expansion request according to the capacity expansion request;
and selecting a plurality of target super nodes from the plurality of super nodes according to the consent expansion information fed back by the plurality of super nodes.
3. The method of claim 1, wherein the process of constructing the directed graph comprises:
copying and storing a blockchain in the blockchain network;
acquiring a time stamp of a block in the block chain, and reading transactions among transaction accounts included in the block;
matching corresponding target blocks for the blocks according to transactions among the transaction accounts;
connecting a directed edge from the target block to the block, and connecting the block with the target block;
and obtaining the directed graph according to the connection relation between each block and the target block.
4. The method according to claim 1, wherein determining whether there is a transaction using the world state of the same account in any two target supernode packaged blocks according to the pre-constructed directed graph comprises:
after receiving a plurality of blocks packaged by the target super node, connecting the blocks into the directed graph;
judging whether a plurality of blocks connected to the directed graph are connected to the same target block or not, wherein the target block is a pre-existing block in the directed graph;
if there are no more than one of the blocks connected to the same target block, it is determined that there are no transactions using the world state of the same account in any two of the target supernode packaged blocks.
5. The method as recited in claim 4, further comprising: if there are multiple of the packed blocks connected to the same target block at the same time, only one of the multiple of the packed blocks connected to the same target block is accepted.
6. The method as recited in claim 1, further comprising: and when the transaction amount on the blockchain network reaches a second threshold, selecting a target subchain from the subchains of the tree-shaped blockchain, and expanding the target subchain to branch the target subchain into a plurality of second subchains.
7. A capacity expanding device for a single chain blockchain, comprising:
the first connection unit is used for connecting the selected blocks packaged by the target super nodes and meeting the conditions to the tail end blocks of the single-chain blockchain after the transaction amount of the blockchain network reaches a first threshold value, so that the single-chain blockchain is branched into tree blockchains comprising a plurality of subchains, and the subchains of the tree blockchain are in one-to-one correspondence with the target super nodes;
the blocks packaged by the target super nodes and meeting the conditions are as follows: the target supernode packaged block and any other target supernode packaged block do not have transactions using the world state of the same account, and the block is a block with successful workload proving;
the second connecting unit is used for connecting each target super node to a sub-chain corresponding to the target super node in the tree-shaped block chain, wherein the sub-chain corresponds to the target super node;
and the judging unit is used for judging whether the world state transaction using the same account exists in any two blocks packed by the target super node according to the pre-constructed directed graph.
8. An electronic device, comprising: a processor and a memory for storing a program; the processor is configured to run the program to implement the method of expanding a capacity for a single chain blockchain of any of claims 1-6.
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 CN111061735A (en) 2020-04-24
CN111061735B true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111769946B (en) * 2020-05-08 2022-08-19 贵阳信息技术研究院(中科院软件所贵阳分部) Large-scale node capacity expansion method for alliance chain
CN111737361B (en) * 2020-07-22 2021-01-15 百度在线网络技术(北京)有限公司 Block chain processing method, device, equipment and storage medium
CN113342888B (en) * 2021-05-19 2022-12-06 中国科学院计算技术研究所 Method and system for longitudinally expanding super account book Fabric
CN113468200B (en) * 2021-09-01 2021-12-21 支付宝(杭州)信息技术有限公司 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

Also Published As

Publication number Publication date
CN111061735A (en) 2020-04-24

Similar Documents

Publication Publication Date Title
CN111061735B (en) Capacity expansion method and device based on single-chain blockchain
CN111259078B (en) Block chain consensus method, apparatus, computer device and storage medium
JP7422856B2 (en) Node data synchronization method and device, system, electronic equipment, storage medium and computer program
CN111629039B (en) Block chain consensus method, client, endorsement node and sequencing node
CN110058873A (en) Application page update method, device, equipment and storage medium
CN109218352B (en) Consensus confirmation method and device for transaction information in blockchain network
CN111612614A (en) Public link-based sub-chain service system
US9383978B2 (en) Apparatus and method for on-demand optimization of applications
CN112508573B (en) Transaction data processing method and device and computer equipment
CN112907369B (en) Block chain-based data consensus method and device, electronic equipment and storage medium
WO2023016428A1 (en) Byzantine fault tolerance method and apparatus, and electronic device and storage medium
CN110597916B (en) Data processing method and device based on block chain, storage medium and terminal
CN110995589B (en) Block transfer method, device and equipment for block chain network block output
WO2023016426A1 (en) Asynchronous binary agreement method and apparatus, and electronic device and storage medium
CN110555079B (en) Data processing method, device, equipment and storage medium
CN109254854A (en) Asynchronous invoking method, computer installation and storage medium
CN112037061A (en) Processing method and device for transactions in block chain, electronic equipment and storage medium
CN111541756B (en) Block generation method, block generation device, node equipment and storage medium
CN108062235A (en) Data processing method and device
CN114138468B (en) Self-adaptive distribution method and device for packaging task amount and storage medium
CN106549827A (en) The detection method and device of network state
CN113885797A (en) Data storage method, device, equipment and storage medium
CN112488835A (en) Service processing method, electronic device and readable storage medium
CN113034137A (en) Data processing method and device based on block chain and related equipment
CN109389271B (en) Application performance management method and system

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