A dynamically expanded accounting method and device based on alliance chain

By establishing sub-chains for nodes that require private transactions in the alliance chain system, the problem of information leakage in the alliance chain system is solved, and the security and data correlation of private transactions are achieved.

CN113691569BActive Publication Date: 2024-09-27SF TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010418741.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-18
Publication Date
2024-09-27
Estimated Expiration
2040-05-18

Smart Images

  • Figure CN113691569B
    Figure CN113691569B
Patent Text Reader

Abstract

The embodiment of the present application discloses a dynamically extended accounting method and device based on the alliance chain. The accounting method is applied to the alliance chain system. The alliance chain system includes at least two nodes, one of the at least two nodes is the execution subject, and the accounting method includes: establishing a basic chain on the first channel based on the at least two nodes; when obtaining an accounting request of the node set, establishing a sub-chain on the second channel based on the node set, wherein the node set is composed of some nodes of at least two nodes; jointly monitoring the first accounting block information newly added in the basic chain with the nodes in the node set; if the first accounting block information is monitored, then based on the first accounting block information, jointly accounting with the nodes in the node set on the sub-chain. The accounting method of the present application avoids the problem of information leakage that is easy to occur when some nodes of the alliance chain system perform accounting; at the same time, it can ensure that the data of the basic chain and the sub-chain are interrelated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and specifically to a dynamically expanded accounting method and device based on a consortium chain. Background Art

[0002] Blockchain technology has gradually become popular for its decentralization, immutability, security, reliability and strong scalability. The development of blockchain technology can be summarized into the following stages, from cryptocurrency to smart contracts, and then to the future of all things interconnected, people from all walks of life are beginning to look forward to the actual application scenarios of blockchain.

[0003] Blockchain technology can be divided into public chain and consortium chain. Public chain is usually a single chain, and consortium chain can be a single chain or multiple chains. Consortium chain is a private chain, and the data is more private than that of public chain. Multiple nodes jointly maintain a ledger as a consortium organization and share the data of the same channel ledger. However, if the data between some members within the consortium needs privacy protection, a single channel will be at risk of data leakage. When a new block is generated in a channel, all members in the organization will synchronize the new block information. If some information such as transaction or block generation time needs to be kept confidential, the data generated by the channel needs to be isolated.

[0004] That is, in the prior art, information leakage is prone to occur when some nodes of the alliance chain system perform accounting. Summary of the invention

[0005] The embodiments of the present application provide a dynamically expanded accounting method and device based on a consortium chain, aiming to solve the problem of how to avoid information leakage that is prone to occur when some nodes of the consortium chain system perform accounting.

[0006] In a first aspect, the present application provides a dynamically expanded accounting method based on a consortium chain, the accounting method is applied to a consortium chain system, the consortium chain system includes at least two nodes, one of the at least two nodes is an execution subject, and the accounting method includes:

[0007] Establishing a basic chain on the first channel based on the at least two nodes, wherein the basic chain is used to store accounting block information of the at least two nodes;

[0008] When an accounting request of a node set is obtained, a sub-chain is established on the second channel based on the node set, wherein the node set is composed of some nodes of the at least two nodes;

[0009] Monitor the first accounting block information newly added in the basic chain together with the nodes in the node set;

[0010] If the first accounting block information is monitored, accounting is performed on the sub-chain together with the nodes in the node set based on the first accounting block information.

[0011] If the first accounting block information is monitored, accounting is performed on the sub-chain together with the nodes in the node set based on the first accounting block information, including:

[0012] If the first accounting block information is monitored, it is determined whether the first accounting block information meets the preset conditions,

[0013] If the first accounting block information meets the preset condition, generating the second accounting block information based on the first accounting block information and the nodes in the node set;

[0014] The second accounting block information is stored in the branch chain.

[0015] Wherein, when the accounting request of the node set is obtained, a sub-chain is established in the second channel based on the node set, before that, it includes:

[0016] Establishing an integrated chain on a third channel based on the at least two nodes, wherein the integrated chain is used to provide services to the outside of the alliance chain system;

[0017] Performing hash value calculation on the first accounting block information on the basic chain to obtain hash value information of the basic chain;

[0018] The hash value information of the basic chain is sent to the nodes on the integrated chain.

[0019] The second accounting block information is stored in the branch chain, and then includes:

[0020] Performing hash value calculation on the second accounting block information on the sub-chain to obtain hash value information of the sub-chain;

[0021] The hash value information of the sub-chain is sent to the node on the integrated chain.

[0022] The step of sending the hash value information of the sub-chain to the node on the integrated chain includes:

[0023] Sending the hash value information of the sub-chain to the nodes on the integrated chain according to a preset period;

[0024] Alternatively, when the number of newly added blocks on the sub-chain is greater than a preset number, the hash value information of the sub-chain is sent to the node on the integrated chain.

[0025] The step of establishing a basic chain on the first channel based on the at least two nodes includes:

[0026] Determine whether it is an endorsement node;

[0027] If it is an endorsing node, a basic chain is established on the first channel based on the at least two nodes.

[0028] The hash value information is a Merkle root.

[0029] In a second aspect, the present application provides a blockchain node, the blockchain node comprising:

[0030] A first blockchain establishing unit, configured to establish a basic chain on a first channel based on the at least two nodes, wherein the basic chain is used to store accounting block information of the at least two nodes;

[0031] A second blockchain establishing unit is configured to establish a sub-chain in a second channel based on the node set when an accounting request of the node set is obtained, wherein the node set is composed of some nodes of the at least two nodes;

[0032] A monitoring unit, configured to monitor the first accounting block information newly added in the basic chain together with the nodes in the node set;

[0033] A recording unit is configured to, if the first accounting block information is monitored, perform accounting on the sub-chain together with the nodes in the node set based on the first accounting block information.

[0034] The recording unit is further configured to determine whether the first accounting block information satisfies a preset condition if the first accounting block information is monitored.

[0035] If the first accounting block information meets the preset condition, generating the second accounting block information based on the first accounting block information and the nodes in the node set;

[0036] The second accounting block information is stored in the branch chain.

[0037] The first blockchain establishment unit is further used to establish an integrated chain on a third channel based on the at least two nodes, and the integrated chain is used to provide services to the outside of the alliance chain system;

[0038] Performing hash value calculation on the first accounting block information on the basic chain to obtain hash value information of the basic chain;

[0039] The hash value information of the basic chain is sent to the nodes on the integrated chain.

[0040] The second blockchain establishing unit is further used to perform hash value calculation on the second accounting block information on the sub-chain to obtain the hash value information of the sub-chain;

[0041] The hash value information of the sub-chain is sent to the node on the integrated chain.

[0042] The second blockchain establishing unit is further configured to send the hash value information of the sub-chain to the nodes on the integrated chain according to a preset period;

[0043] Alternatively, when the number of newly added blocks on the sub-chain is greater than a preset number, the hash value information of the sub-chain is sent to the node on the integrated chain.

[0044] Wherein, the first blockchain establishment unit is further used to determine whether it is an endorsement node;

[0045] If it is an endorsing node, a basic chain is established on the first channel based on the at least two nodes.

[0046] The hash value information is a Merkle root.

[0047] In a third aspect, the present application provides a blockchain node, the blockchain node comprising:

[0048] one or more processors;

[0049] Memory; and

[0050] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the dynamically scalable accounting method based on the alliance chain as described in any one of the first aspects.

[0051] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is loaded by a processor to execute the steps in the dynamically expanded accounting method based on the alliance chain as described in any one of the first aspects.

[0052] The present application provides a dynamically expanded accounting method based on an alliance chain, the accounting method is applied to an alliance chain system, the alliance chain system includes at least two nodes, one of the at least two nodes is an execution subject, and the accounting method includes: establishing a basic chain on a first channel based on the at least two nodes, wherein the basic chain is used to store accounting block information of the at least two nodes; when an accounting request of a node set is obtained, establishing a sub-chain on a second channel based on the node set, wherein the node set is composed of some nodes of the at least two nodes; jointly monitoring the first accounting block information newly added in the basic chain with the nodes in the node set; if the first accounting block information is monitored, then jointly performing accounting on the sub-chain with the nodes in the node set based on the first accounting block information. The accounting method of the present application first establishes a basic chain in the first channel in which all nodes in the alliance chain system participate, which is used for accounting of the entire alliance chain system. When some nodes need to conduct private transactions, sub-chains are established for the nodes that need to participate in private transactions. When the nodes participating in private transactions perform accounting on the sub-chains, they will not be obtained by the nodes on the basic chain, thereby avoiding the problem of information leakage that is easy to occur when some nodes of the alliance chain system perform accounting; at the same time, when the nodes participating in private transactions perform accounting on the sub-chains, they are based on the first transaction information, which can ensure that the data of the basic chain and the sub-chain are related to each other. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0054] Figure 1 It is a schematic diagram of a scenario of the alliance chain system provided in an embodiment of the present application;

[0055] Figure 2 It is a schematic diagram of establishing a comprehensive chain, a basic chain and a sub-chain in the alliance chain system provided in the embodiment of the present application;

[0056] Figure 3 This is a flowchart of an embodiment of a dynamically extended accounting method based on a consortium chain provided in an embodiment of the present application;

[0057] Figure 4 This is a schematic diagram of an embodiment of S34 in the embodiment of the present application;

[0058] Figure 5 This is a schematic diagram of the structure of an embodiment of a blockchain node provided in an embodiment of the present application;

[0059] Figure 6This is a schematic diagram of the structure of another embodiment of the blockchain node provided in the embodiments of the present application. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0061] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first" and "second" are used only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0062] In this application, the word "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.

[0063] The following first introduces some basic concepts involved in the embodiments of the present application:

[0064] Endorsing nodes: are institutions with a certain degree of trust or authority, are nodes that deploy and run smart contracts, and are responsible for verifying and signing transactions. Ordinary nodes are network nodes that maintain ledgers.

[0065] Channel: A channel is a communication mechanism provided by the consensus service, similar to the topic in the publish-subscribe relationship in the messaging system. Based on this publish-subscribe relationship, endorsement nodes and ordinary nodes are connected together to form confidential communication links, thus achieving the requirements of business isolation.

[0066] Block: A data unit in a blockchain. Each block records one or more endorsed transaction records. Multiple blocks are connected in series in the order in which they occurred to form a blockchain.

[0067] Node: A peer node that participates in maintaining the blockchain. Each node stores all transaction records of the blockchain.

[0068] Smart contract: A set of digitally defined promises, including protocols on which the parties can execute these promises.

[0069] Transaction: refers to any activity or event that can be recorded, such as medical events, identity management, document certification, food source tracking, transfer payment, voting, etc. In this application, when each transaction occurs, a transaction record corresponding to the transaction will be generated.

[0070] Ledger: The ledger is used to save transaction records confirmed by nodes.

[0071] Chain: Basically, a chain consists of 1 channel + 1 ledger + multiple nodes. Non-chain nodes cannot access transactions on the chain. Chain nodes can be dynamically specified by the application.

[0072] The embodiments of the present application provide a dynamically extended accounting method, device and storage medium based on the alliance chain, which are described in detail below.

[0073] First, an accounting method based on dynamic expansion of an alliance chain is provided in an embodiment of the present application. The accounting method is applied to an alliance chain system, and the alliance chain system includes at least two nodes, one of the at least two nodes is an execution subject, and the accounting method includes: establishing a basic chain on a first channel based on at least two nodes, wherein the basic chain is used to store accounting block information of at least two nodes; when an accounting request of a node set is obtained, establishing a sub-chain on a second channel based on the node set, wherein the node set is composed of some nodes of at least two nodes; jointly monitoring the first accounting block information newly added in the basic chain with the nodes in the node set; if the first accounting block information is monitored, then based on the first accounting block information, jointly performing accounting on the sub-chain with the nodes in the node set.

[0074] See also Figure 1 , Figure 1 It is a scenario diagram of the alliance chain system provided in an embodiment of the present application.

[0075] In the embodiment of the present application, the alliance chain system 10 includes at least two nodes ( Figure 1 In the example, the alliance chain system 10 includes 5 nodes. The at least two nodes are connected through a network, and the connection method can be a wireless connection or a wired connection. Specifically, the at least two nodes are dynamically networked through a peer-to-peer network to form a "decentralized" system, and the at least two nodes are peer nodes to each other, that is, each node is the same for the entire alliance chain system 10. It can be understood that the number of nodes in the alliance chain system 10 can be N, where N is a positive integer and N is not less than 2 (for example, N=3), that is, it only needs to satisfy that the alliance chain system 10 includes at least two nodes connected to each other, and this application does not limit this.

[0076] The above-mentioned node can be a general-purpose computer device or a special-purpose computer device. In a specific implementation, the node can be a desktop computer, a portable computer, a network server, a PDA (Personal Digital Assistant), a mobile phone, a tablet computer, a wireless terminal device, a communication device, an embedded device, etc. This embodiment does not limit the type of the node.

[0077] In the embodiment of the present application, the alliance chain system 10 includes a first node 11, a second node 12, a third node 13, a fourth node 14 and a fifth node 15. It should be noted that the first node 11, the second node 12, the third node 13, the fourth node 14 and the fifth node 15 have equal status, and the numbering and naming of the first node 11, the second node 12, the third node 13, the fourth node 14 and the fifth node 15 do not limit them.

[0078] It should be noted that Figure 1 The scenario diagram of the alliance chain system 10 shown is only an example. The alliance chain system 10 and the scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of the alliance chain system 10 and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.

[0079] In the embodiments of the present application, the description will be made from the perspective of the third node 13. From the perspective of other nodes in the alliance chain system 10, the accounting method of the alliance chain system 10 of the present application can also be executed.

[0080] See also Figure 2 and Figure 3 , Figure 2 It is a schematic diagram of establishing a comprehensive chain, a basic chain and a sub-chain in the alliance chain system provided in the embodiment of the present application; Figure 3It is a flow chart of an embodiment of a dynamically expanded accounting method based on alliance chain provided in an embodiment of the present application.

[0081] Combination Figure 1-Figure 3 , the accounting method includes:

[0082] S31. Establish a basic chain on the first channel based on at least two nodes, wherein the basic chain is used to store accounting block information of at least two nodes.

[0083] In the embodiment of the present application, a basic chain can be established on the first channel 21 based on at least two nodes through Fabric or the like. Specifically, the first channel 21 is established, and the channel identifier of the first channel 21 is sent to the node in the alliance chain system 10, so that the node in the alliance chain system 10 joins the first channel 21. The nodes in the alliance chain system 10 maintain the same account book to form a basic chain.

[0084] Fabric is a blockchain framework developed by IBM and DAH, and is a member of the Hyperledger project. It is a distributed smart contract platform. It has been a framework from the beginning, not a public chain, and has no built-in tokens. Fabric is an open source project initiated by the Linux Foundation in 2015 to promote blockchain technology and standards. Members include more than a dozen different interest groups such as ABN AMRO and Accenture. The goal is to allow members to work together to build an open platform to meet various user cases from multiple different industries and simplify business processes. As a blockchain framework, Fabric adopts a loosely coupled design, modularizing components such as consensus mechanisms and identity authentication, so that it is easy to select the corresponding modules according to the application scenario during the application process.

[0085] In the embodiment of the present application, the basic chain is used to store the accounting block information of at least two nodes. For example, the nodes in the alliance chain system 10 are the first node 11, the second node 12, the third node 13, the fourth node 14 and the fifth node 15. Each node can represent an enterprise, a department, etc. For example, the first node 11, the second node 12, the third node 13, the fourth node 14 and the fifth node 15 represent enterprise A, enterprise B, enterprise C, enterprise D and enterprise E respectively. The accounting block information of at least two nodes is the transaction record generated by the transaction between at least two nodes.

[0086] In a specific embodiment, it is determined whether it is an endorsement node. If it is an endorsement node, a basic chain is established in the first channel 21 based on at least two nodes. The endorsement node can be generated by voting by at least two nodes in the alliance chain system 10, or it can be designated, which is not limited here. For example, the endorsement node in the alliance chain system 10 is the third node 13. Specifically, it is determined whether it is an endorsement node according to a predetermined frequency. The preset frequency can be 1hz, 0.5hz, etc., which is set according to the specific situation. The endorsement node is an authoritative node. The endorsement node establishes the basic chain, which can improve the credibility of the basic chain and improve the security of the alliance chain system 10.

[0087] At least two nodes in the alliance chain system 10 have equal status. When one of the nodes determines that it is an endorsement node, the node can complete the endorsement processing of the transaction proposal on behalf of the alliance chain system 10, mainly signature. The endorsement node can establish a basic chain on the first channel 21 based on at least two nodes. Obviously, if the first node 11 is voted or designated as an endorsement node, the first node 11 will execute the accounting method of the alliance chain system 10.

[0088] S32. When an accounting request of a node set is obtained, a sub-chain is established on the second channel based on the node set, wherein the node set is composed of some nodes of at least two nodes.

[0089] In the embodiment of the present application, the node set is composed of some nodes in at least two nodes. That is, the nodes in the node set are composed of nodes in at least two nodes in the alliance chain system 10, but the number is less than the number of at least two nodes in the alliance chain system 10. For example, at least two nodes in the alliance chain system 10 are the first node 11, the second node 12, the third node 13, the fourth node 14 and the fifth node 15, then the nodes in the node set can be 2, 3, 4, and the nodes in the node set are the first node 11, the second node 12, the third node 13, the fourth node 14 and the fifth node 15. For example, the nodes in the node set are the first node 11, the second node 12 and the third node 13, and the third node 13 is an endorsement node. The endorsement nodes in the node set can be endorsement nodes that have been agreed upon or designated on the basic chain, or they can be generated by voting or designated election by the nodes in the node set, and this application does not limit this. For example, if the endorsement node on the base chain is the third node 13, the first node 11, the second node 12, and the third node 13 directly reach a consensus that the third node 13 is the endorsement node.

[0090] For example, enterprise A, enterprise B and enterprise C want to do accounting privately, but do not want enterprise D and enterprise E to know. Then the first node 11, the second node 12 and the third node 13 jointly initiate an accounting request for separate accounting. The third node 13 establishes a sub-chain in the second channel 22 based on the node set.

[0091] Furthermore, the third node 13, the fourth node 14 and the fifth node 15 may also jointly initiate an accounting request for separate accounting. The third node 13 establishes a sub-chain on the fourth channel 24 based on the third node 13, the fourth node 14 and the fifth node 15, thereby realizing separate accounting of the third node 13, the fourth node 14 and the fifth node 15.

[0092] Specifically, the third node 13 establishes the second channel 22, and sends the channel identifier of the second channel 22 to the nodes in the node set, so that the nodes in the node set join the second channel 22. The nodes in the node set maintain the same account book to form a branch chain.

[0093] In a specific embodiment, when an accounting request of a node set is obtained, before a sub-chain is established in the second channel 22 based on the node set, the following steps may also be included:

[0094] (1) An integrated chain is established on the third channel 23 based on at least two nodes, and the integrated chain is used to provide services to the outside of the alliance chain system 10.

[0095] In the embodiment of the present application, the integrated chain can provide accounting block information query, verification and other services to the outside of the alliance chain system 10. The user initiates a query request to the node in the alliance chain system 10 through the client, and the node in the alliance chain system 10 responds to the query request according to the smart contract of the alliance chain system 10.

[0096] (2) Calculate the hash value of the first accounting block information on the basic chain to obtain the hash value information of the basic chain.

[0097] Hash value can be called hash hash, hash algorithm. It is a classic technology in cryptography. It is calculated by computer based on file size, type, time, creator, etc. It is easy to change. For example, the data stored in a block will change even if only one letter is changed. Because it is easy to change, no one can catch the hash value of the next block, and no one has changed its software, so the security of hash value is very high, and it is very difficult to forge hash value. The main function of hash value is to check whether the information in the block is valid. The most prominent function of hash value is that it can be used to query transaction details, and it can also be used as evidence of transaction occurrence for traceability verification. The logic in blockchain is like this. Every time a transaction occurs on the chain, the transaction information will generate a hash value through the hash algorithm, and the user will query the transaction information on the chain through the hash value. Because the hash value cannot be changed and can be traced, when there is a problem with the transaction, we can directly find the source to solve it.

[0098] In an embodiment of the present application, by performing a hash value calculation on the first accounting block information on the base chain to obtain the hash value information of the base chain, the first accounting block information on the base chain can be encrypted, and services can be provided to the outside in the form of hash value information, which can avoid the leakage of the first accounting block information on the base chain while allowing the first accounting block information on the base chain to be verified.

[0099] In a preferred embodiment, the hash value information is a Merkle root. The first accounting block information on the base chain is hashed using the Merkle tree algorithm to obtain the Merkle root of the base chain. The Merkle tree algorithm does not directly calculate the hash value of the entire string, but calculates a hash value for each transaction, and then connects two transactions to calculate the hash value again until the top Merkle root. The biggest advantage of the Merkle tree algorithm is that each transaction can be deleted directly and only the hash value of the transaction is retained. In this way, for the entire block, its cryptographic security and integrity are not changed, but the amount of data can be greatly reduced.

[0100] Therefore, the integrated chain stores the Merkle root of the first accounting block information, which can reduce the storage capacity of the integrated chain and improve the external service efficiency of the integrated chain.

[0101] (3) Send the hash value information of the basic chain to the nodes on the integrated chain.

[0102] In a specific embodiment, the hash value information of the sub-chain is sent to the nodes on the integrated chain according to a preset period. The preset period can be once every 10 minutes, once every 60 minutes, etc., which can be set according to the specific situation, and this application does not limit this.

[0103] In another specific embodiment, when the number of newly added blocks on the sub-chain is greater than the preset number, the hash value information of the sub-chain is sent to the node on the integrated chain. The preset number can be 10, 15, etc., which can be set according to the specific situation, and this application does not limit this.

[0104] Furthermore, the nodes on the integrated chain verify the hash value information of the basic chain, and store it on the integrated chain after successful verification to provide services to the outside world.

[0105] S33. Monitor the first accounting block information newly added in the basic chain together with the nodes in the node set.

[0106] In the embodiment of the present application, when a new transaction is generated in the first channel 21, the node on the basic chain records the new transaction record, obtains the newly added first accounting block information, and stores it on the node on the basic chain. At the same time, the node on the basic chain broadcasts the newly added first accounting block information to other nodes, and the node on the basic chain can monitor the newly added first accounting block information by monitoring the broadcast of other nodes.

[0107] S34. If the first accounting block information is monitored, accounting is performed on the sub-chain together with the nodes in the node set based on the first accounting block information.

[0108] In an embodiment of the present application, if the first accounting block information is monitored, accounting is performed on the sub-chain together with the nodes in the node set based on the first accounting block information.

[0109] See also Figure 4 , Figure 4 It is a flowchart of an embodiment of S34 in the embodiment of the present application.

[0110] like Figure 4 As shown, in some embodiments of the present application, if the first accounting block information is monitored in step S34, accounting is performed on the sub-chain together with the nodes in the node set based on the first accounting block information, which may further include:

[0111] S341. If the first accounting block information is monitored, determine whether the first accounting block information meets a preset condition.

[0112] Specifically, the sub-chain stores the sub-chain smart contract, and determines whether the first accounting block information meets the preset condition according to the sub-chain smart contract. For example, the smart contract may stipulate that when the first node 11 and the fifth node 15 have a transaction, it can be determined that the preset condition is met.

[0113] S342. If the first accounting block information meets the preset conditions, the second accounting block information is generated based on the first accounting block information and the nodes in the node set.

[0114] In an embodiment of the present application, when the first accounting block information meets the preset conditions, the second accounting block information is jointly generated based on the first accounting block information and the nodes in the node set. Specifically, according to the smart contract of the sub-chain, the second accounting block information is jointly generated based on the first accounting block information and the nodes in the node set. The first accounting block information is a transaction record performed by the nodes in the basic chain, and the second accounting block information is a transaction record performed by the nodes on the node set. For example, the transaction record in the first accounting block information is: the first node 11 transfers to the third node 13. The second accounting block information is jointly generated based on the first accounting block information and the nodes in the node set. Among them, the second accounting block information is the block information signed by the third node 13 and the nodes in the node set. For example, the second accounting block information is: the third node 13 transfers to the second node 12. Since the nodes in the node set record accounts in the second channel 22, the data of the second channel 22 and the first channel 21 are isolated, and the information of the second accounting block cannot be known by the nodes that enter the first channel 21 but do not join the second channel 22, thereby achieving the privacy of some node transfers and avoiding the leakage of transfer information.

[0115] S343. Store the second accounting block information in the branch chain.

[0116] In a specific embodiment, consensus is reached on the second accounting block information together with the nodes in the node set, and when consensus is reached on the second accounting block information, the second accounting block information is stored in the sub-chain.

[0117] Furthermore, after the second accounting block information is stored in the sub-chain, the second accounting block information on the sub-chain is hashed to obtain the hash value information of the sub-chain; the hash value information of the sub-chain is sent to the node on the comprehensive chain. Specifically, the hash value information is the Merkle root.

[0118] Furthermore, the nodes on the integrated chain verify the hash value information of the sub-chain and store it on the integrated chain after successful verification to provide services to the outside world.

[0119] The present application provides a dynamically expanded accounting method based on an alliance chain. The alliance chain system includes at least two nodes, one of the at least two nodes is an execution subject, and the accounting method includes: establishing a basic chain on a first channel based on the at least two nodes, wherein the basic chain is used to store accounting block information of the at least two nodes; when an accounting request of a node set is obtained, establishing a sub-chain on a second channel based on the node set, wherein the node set is composed of some nodes of the at least two nodes; jointly monitoring the first accounting block information newly added in the basic chain with the nodes in the node set; if the first accounting block information is monitored, then jointly performing accounting on the sub-chain with the nodes in the node set based on the first accounting block information. The accounting method of the present application first establishes a basic chain in the first channel in which all nodes in the alliance chain system participate, which is used for accounting of the entire alliance chain system. When some nodes need to conduct private transactions, sub-chains are established for the nodes that need to participate in private transactions. When the nodes participating in private transactions perform accounting on the sub-chains, they will not be obtained by the nodes on the basic chain, thereby avoiding the problem of information leakage that is easy to occur when some nodes of the alliance chain system perform accounting; at the same time, when the nodes participating in private transactions perform accounting on the sub-chains, they are based on the first transaction information, which can ensure that the data of the basic chain and the sub-chain are related to each other.

[0120] In order to better implement the accounting method based on the dynamic expansion of the alliance chain in the embodiment of the present application, on the basis of the accounting method based on the dynamic expansion of the alliance chain, a blockchain node is also provided in the embodiment of the present application. A blockchain node is a terminal that can participate in accounting, such as a computer, a mobile phone and other devices. A blockchain node can participate in data consensus, or store and record data, or supervise malicious networks. A blockchain node is a part of a distributed network. Figure 5 As shown, Figure 5 401 is a schematic diagram of the structure of an embodiment of a blockchain node provided in an embodiment of the present application. The blockchain node includes a first blockchain establishment unit 401, a second blockchain establishment unit 402, a monitoring unit 403, and a recording unit 404:

[0121] A first blockchain establishing unit 401 is configured to establish a basic chain in a first channel based on at least two nodes, wherein the basic chain is configured to store accounting block information of at least two nodes;

[0122] A second blockchain establishing unit 402 is configured to establish a sub-chain in a second channel based on the node set when an accounting request of the node set is obtained, wherein the node set is composed of some nodes of at least two nodes;

[0123] A monitoring unit 403 is used to monitor the first accounting block information newly added in the basic chain together with the nodes in the node set;

[0124] The recording unit 404 is used to perform accounting on the sub-chain together with the nodes in the node set based on the first accounting block information if the first accounting block information is monitored.

[0125] The recording unit 404 is further configured to determine whether the first accounting block information satisfies a preset condition if the first accounting block information is monitored.

[0126] If the first accounting block information meets the preset conditions, the second accounting block information is generated based on the first accounting block information and the nodes in the node set;

[0127] The second accounting block information is stored in the sub-chain.

[0128] The first blockchain establishing unit 401 is further used to establish an integrated chain on the third channel based on at least two nodes, and the integrated chain is used to provide services to the outside of the alliance chain system;

[0129] Calculate the hash value of the first accounting block information on the basic chain to obtain the hash value information of the basic chain;

[0130] Send the hash value information of the basic chain to the nodes on the integrated chain.

[0131] The second blockchain establishing unit 402 is further used to perform hash value calculation on the second accounting block information on the sub-chain to obtain hash value information of the sub-chain;

[0132] Send the hash value information of the sub-chain to the nodes on the comprehensive chain.

[0133] The second blockchain establishing unit 402 is further used to send the hash value information of the sub-chain to the nodes on the comprehensive chain according to a preset period;

[0134] Alternatively, when the number of new blocks on the sub-chain is greater than a preset number, the hash value information of the sub-chain is sent to the node on the integrated chain.

[0135] The first blockchain establishing unit 401 is also used to determine whether it is an endorsement node;

[0136] If it is an endorsing node, it will establish a basic chain on the first channel based on at least two nodes.

[0137] Among them, the hash value information is the Merkle root.

[0138] The present application also provides a blockchain node. Figure 6 As shown, Figure 6 This is another schematic diagram of the structure of a blockchain node provided in the embodiments of the present application. Specifically:

[0139] The blockchain node may include one or more processing core processors 501, one or more computer-readable computer-readable storage media memories 502, a power supply 503, an input unit 504 and other components. Those skilled in the art will appreciate that the blockchain node structure shown in the figure does not constitute a limitation on the blockchain node, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently. Among them:

[0140] The processor 501 is the control center of the blockchain node. It uses various interfaces and lines to connect various parts of the entire blockchain node. By running or executing software programs and / or modules stored in the memory 502, and calling data stored in the memory 502, it executes various functions of the blockchain node and processes data, thereby monitoring the blockchain node as a whole. Optionally, the processor 501 may include one or more processing cores; preferably, the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 501.

[0141] The memory 502 can be used to store software programs and modules. The processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the blockchain node, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.

[0142] The blockchain node also includes a power supply 503 for supplying power to various components. Preferably, the power supply 503 can be logically connected to the processor 501 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 503 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0143] The blockchain node may also include an input unit 504, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0144] Although not shown, the blockchain node may also include a display unit, etc., which will not be described in detail here. Specifically in this embodiment, the processor 501 in the blockchain node will load the executable files corresponding to the processes of one or more applications into the memory 502 according to the following instructions, and the processor 501 will run the application stored in the memory 502 to achieve various functions, as follows:

[0145] Establishing a basic chain on the first channel based on at least two nodes, wherein the basic chain is used to store accounting block information of at least two nodes;

[0146] When an accounting request of a node set is obtained, a sub-chain is established on the second channel based on the node set, wherein the node set is composed of some nodes of at least two nodes;

[0147] Together with the nodes in the node set, monitor the first newly added accounting block information in the basic chain;

[0148] If the first accounting block information is monitored, accounting is performed on the sub-chain together with the nodes in the node set based on the first accounting block information.

[0149] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0150] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0151] To this end, the embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any of the accounting methods based on the dynamic expansion of the alliance chain provided in the embodiment of the present application. For example, the computer program loaded by the processor can execute the following steps:

[0152] Establishing a basic chain on the first channel based on at least two nodes, wherein the basic chain is used to store accounting block information of at least two nodes;

[0153] When an accounting request of a node set is obtained, a sub-chain is established on the second channel based on the node set, wherein the node set is composed of some nodes of at least two nodes;

[0154] Together with the nodes in the node set, monitor the first newly added accounting block information in the basic chain;

[0155] If the first accounting block information is monitored, accounting is performed on the sub-chain together with the nodes in the node set based on the first accounting block information.

[0156] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.

[0157] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.

[0158] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0159] The above is a detailed introduction to a dynamically expanded accounting method, device and storage medium based on a consortium chain provided in an embodiment of the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A dynamically expanded accounting method based on alliance chain, characterized in that: The accounting method is applied to a consortium chain system, the consortium chain system includes at least two nodes, one of the at least two nodes is an execution subject, and the accounting method includes: Establishing a basic chain on the first channel based on the at least two nodes, wherein the basic chain is used to store accounting block information of the at least two nodes; When an accounting request of a node set is obtained, a sub-chain is established on the second channel based on the node set, wherein the node set is composed of some nodes of the at least two nodes; monitoring together with the nodes in the node set the first accounting block information newly added in the basic chain, where the first accounting block information is a transaction record performed by the nodes in the basic chain; If the first accounting block information is monitored, the second accounting block information is generated based on the first accounting block information and the nodes in the node set according to the smart contract of the sub-chain, and the second accounting block information is stored in the sub-chain. The second accounting block information is a transaction record performed by the nodes in the node set.

2. The bookkeeping method according to claim 1, characterized in that: If the first accounting block information is monitored, generating second accounting block information based on the first accounting block information and the nodes in the node set according to the smart contract of the sub-chain, and storing the second accounting block information in the sub-chain includes: If the first accounting block information is monitored, it is determined whether the first accounting block information meets the preset conditions, If the first accounting block information meets the preset conditions, then according to the smart contract of the sub-chain, the second accounting block information is jointly generated based on the first accounting block information and the nodes in the node set; The second accounting block information is stored in the branch chain.

3. The bookkeeping method according to claim 2, characterized in that: When the accounting request of the node set is obtained, a sub-chain is established on the second channel based on the node set, before that, the process includes: Establishing an integrated chain on a third channel based on the at least two nodes, wherein the integrated chain is used to provide services to the outside of the alliance chain system; Performing hash value calculation on the first accounting block information on the basic chain to obtain hash value information of the basic chain; The hash value information of the basic chain is sent to the nodes on the integrated chain.

4. The bookkeeping method according to claim 3, characterized in that: The second accounting block information is stored in the branch chain, and then includes: Performing hash value calculation on the second accounting block information on the sub-chain to obtain hash value information of the sub-chain; The hash value information of the sub-chain is sent to the node on the integrated chain.

5. The bookkeeping method according to claim 4, characterized in that: The step of sending the hash value information of the sub-chain to the node on the integrated chain includes: Sending the hash value information of the sub-chain to the nodes on the integrated chain according to a preset period; Alternatively, when the number of newly added blocks on the sub-chain is greater than a preset number, the hash value information of the sub-chain is sent to the node on the integrated chain.

6. The bookkeeping method according to claim 1, characterized in that: The establishing of a basic chain on the first channel based on the at least two nodes comprises: Determine whether it is an endorsing node; If it is an endorsing node, a basic chain is established on the first channel based on the at least two nodes.

7. The bookkeeping method according to any one of claims 3 to 5, characterized in that: The hash value information is a Merkle root.

8. A blockchain node, characterized in that: The blockchain node includes: A first blockchain establishing unit, configured to establish a basic chain on a first channel based on at least two nodes, wherein the basic chain is used to store accounting block information of the at least two nodes; A second blockchain establishing unit is configured to establish a sub-chain in a second channel based on the node set when an accounting request of the node set is obtained, wherein the node set is composed of some nodes of the at least two nodes; A monitoring unit, configured to monitor together with the nodes in the node set the first accounting block information newly added in the basic chain, where the first accounting block information is a transaction record performed by the nodes in the basic chain; A recording unit is configured to generate second accounting block information based on the first accounting block information and the nodes in the node set according to the smart contract of the sub-chain if the first accounting block information is monitored, and store the second accounting block information in the sub-chain, where the second accounting block information is a transaction record performed by the nodes in the node set.

9. A blockchain node, characterized in that: The blockchain node includes: one or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the dynamically scalable accounting method based on the alliance chain as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the dynamically expanded accounting method based on the alliance chain as described in any one of claims 1 to 7.