CN113691569A - Dynamic extended billing method and device based on alliance chain - Google Patents

Dynamic extended billing method and device based on alliance chain Download PDF

Info

Publication number
CN113691569A
CN113691569A CN202010418741.7A CN202010418741A CN113691569A CN 113691569 A CN113691569 A CN 113691569A CN 202010418741 A CN202010418741 A CN 202010418741A CN 113691569 A CN113691569 A CN 113691569A
Authority
CN
China
Prior art keywords
chain
nodes
accounting
node
block information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010418741.7A
Other languages
Chinese (zh)
Inventor
钟绍柏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SF Technology Co Ltd
SF Tech Co Ltd
Original Assignee
SF Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SF Technology Co Ltd filed Critical SF Technology Co Ltd
Priority to CN202010418741.7A priority Critical patent/CN113691569A/en
Publication of CN113691569A publication Critical patent/CN113691569A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0407Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the identity of one or more communicating identities is hidden
    • H04L63/0414Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the identity of one or more communicating identities is hidden during transmission, i.e. party's identity is protected against eavesdropping, e.g. by using temporary identifiers, but is known to the other party or parties involved in the communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Abstract

The embodiment of the application discloses a dynamic extension accounting method and device based on a alliance chain, the accounting method is applied to an alliance chain system, the alliance chain system comprises at least two nodes, one of the at least two nodes is an execution main body, and the accounting method comprises the following steps: establishing a basic chain in a first channel based on at least two nodes; when an accounting request of a node set is obtained, establishing a branch chain in a second channel based on the node set, wherein the node set is composed of partial nodes in at least two nodes; monitoring newly added first accounting block information in a basic chain together with nodes in the node set; and if the first accounting block information is monitored, accounting is carried out on the branch chain together with the nodes in the node set on the basis of the first accounting block information. The billing method of the application avoids the problem that information leakage is easy to occur when partial nodes of the alliance chain system are subjected to billing; meanwhile, the data of the basic chain and the branch chain can be ensured to be correlated.

Description

Dynamic extended billing method and device based on alliance chain
Technical Field
The application relates to the technical field of block chains, in particular to a dynamic extended billing method and device based on a alliance chain.
Background
The block chain technology is gradually popular due to the characteristics of decentralization, no tampering, safety, reliability, strong expansibility and the like. The development of the block chain technology can be summarized into the following stages, namely, from the encryption of currency to an intelligent contract and then to the mutual chain of everything in the future, and people in various industries begin to look at the actual application scene of the block chain.
The block chain technique can be divided into a public chain and a federation chain. The public strand is typically single-stranded, and the alliance strand may be single-stranded or multi-stranded. The alliance chain belongs to the private chain, and data is more private than the public chain. A plurality of nodes serve as an alliance organization to jointly maintain an account book and share data of the same channel account book. But a single channel risks data leakage if privacy protection is required for the data between certain members within the federation. When a new tile is generated in a channel, all members of the organization synchronize the new tile information. If some information such as transaction or block generation time needs to be kept secret, the data generated by the channel needs to be isolated.
That is, information leakage easily occurs when some nodes of the federation chain system in the prior art perform accounting.
Disclosure of Invention
The embodiment of the application provides a dynamic extended billing method and device based on a alliance chain, and aims to solve the problem that information leakage is easy to occur when partial nodes of a alliance chain system are subjected to billing.
In a first aspect, the present application provides a billing method based on dynamic extension of a federation chain, where the billing method is applied to a federation chain system, where the federation chain system includes at least two nodes, and one of the at least two nodes is an execution subject, and the billing method includes:
establishing a basic chain in a first channel based on the at least two nodes, wherein the basic chain is used for storing accounting block information of the at least two nodes;
when an accounting request of a node set is obtained, establishing a branch chain in a second channel based on the node set, wherein the node set is composed of part of nodes in the at least two nodes;
monitoring first accounting block information newly added in the basic chain together with the nodes in the node set;
and if the first accounting block information is monitored, accounting is carried out on the branch chain together with the nodes in the node set based on the first accounting block information.
Wherein, if the first accounting block information is monitored, accounting is performed on the branch chain together with the nodes in the node set based on the first accounting block information, including:
if the first accounting block information is monitored, judging whether the first accounting block information meets a preset condition or not,
if the first accounting block information meets the preset condition, generating second accounting block information together with the nodes in the node set based on the first accounting block information;
and storing the second accounting block information to the branch chain.
When the accounting request of the node set is obtained, establishing a branch chain in a second channel based on the node set, wherein the method comprises the following steps:
establishing a comprehensive chain in a third channel based on the at least two nodes, the comprehensive chain being used for providing services to the outside of the federation 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;
and sending the hash value information of the basic chain to the node on the comprehensive chain.
Wherein storing the second accounting block information to the branch chain, thereafter, comprises:
performing hash value calculation on the second accounting block information on the branch chain to obtain hash value information of the branch chain;
and sending the hash value information of the branch chain to the node on the comprehensive chain.
Wherein, the sending the hash value information of the branch chain to the node on the comprehensive chain comprises:
sending the hash value information of the branch chain to a node on the comprehensive chain according to a preset period;
or when the number of the newly added blocks on the branch chain is larger than the preset number, sending the hash value information of the branch chain to the node on the comprehensive chain.
Wherein the establishing a base chain in a first channel based on the at least two nodes comprises:
judging whether the self is an endorsement node;
and if the node is the endorsement node, establishing a basic chain in the first channel based on the at least two nodes.
Wherein the hash value information is a Mercker root.
In a second aspect, the present application provides a block link point comprising:
a first blockchain establishing unit, configured to establish a basic chain in a first channel based on the at least two nodes, where the basic chain is used to store accounting block information of the at least two nodes;
the second block chain establishing unit is used for establishing a branch 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 part of nodes in the at least two nodes;
the monitoring unit is used for monitoring first accounting block information newly added in the basic chain together with the nodes in the node set;
and the recording unit is used for carrying out accounting on the branch chain together with the nodes in the node set based on the first accounting block information if the first accounting block information is monitored.
Wherein, 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,
if the first accounting block information meets the preset condition, generating second accounting block information together with the nodes in the node set based on the first accounting block information;
and storing the second accounting block information to the branch chain.
The first blockchain establishing unit is further configured to establish a comprehensive chain in a third channel based on the at least two nodes, where the comprehensive chain is used to provide a service outside 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;
and sending the hash value information of the basic chain to the node on the comprehensive chain.
The second block chain establishing unit is further configured to perform hash value calculation on second accounting block information on the branch chain to obtain hash value information of the branch chain;
and sending the hash value information of the branch chain to the node on the comprehensive chain.
The second block chain establishing unit is further configured to send the hash value information of the branch chain to a node on the integrated chain according to a preset period;
or when the number of the newly added blocks on the branch chain is larger than the preset number, sending the hash value information of the branch chain to the node on the comprehensive chain.
The first block chain establishing unit is further configured to determine whether the first block chain establishing unit is an endorsement node;
and if the node is the endorsement node, establishing a basic chain in the first channel based on the at least two nodes.
Wherein the hash value information is a Mercker root.
In a third aspect, the present application provides a block link point comprising:
one or more processors;
a 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 federation chain based dynamic extension billing method of any one of the first aspects.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, the computer program being loaded by a processor to perform the steps in the federation chain-based dynamic extension accounting method according to any one of the first aspect.
The application provides a billing method based on dynamic extension of a alliance chain, which is applied to an alliance chain system, wherein the alliance chain system comprises at least two nodes, one of the at least two nodes is an execution subject, and the billing method comprises the following steps: establishing a basic chain in a first channel based on at least two nodes, wherein the basic chain is used for storing accounting block information of the at least two nodes; when an accounting request of a node set is obtained, establishing a branch chain in a second channel based on the node set, wherein the node set is composed of partial nodes in at least two nodes; monitoring newly added first accounting block information in a basic chain together with nodes in the node set; and if the first accounting block information is monitored, accounting is carried out on the branch chain together with the nodes in the node set on the basis of the first accounting block information. According to the accounting method, firstly, a basic chain in which all nodes participate in the alliance chain system is established in a first channel and used for accounting the whole alliance chain system, a branch chain is established for the nodes needing to participate in the privacy transaction when part of the nodes need to perform the privacy transaction, and the nodes needing to participate in the privacy transaction cannot be acquired by the nodes on the basic chain when accounting is performed on the branch chain, so that the problem that information leakage easily occurs when part of the nodes of the alliance chain system perform accounting is solved; meanwhile, when the nodes participating in the privacy transaction are booked on the branch chain, the nodes are booked based on the first transaction information, and the data correlation between the basic chain and the branch chain can be ensured.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a scenario of a federation chain system provided by an embodiment of the present application;
FIG. 2 is a schematic diagram of establishing a comprehensive chain, a basic chain and a branch chain in a federation chain system provided by an embodiment of the present application;
FIG. 3 is a flowchart illustrating an embodiment of an accounting method based on dynamic extension of a federation chain according to the present application;
FIG. 4 is a schematic flow chart of an embodiment of S34 in the embodiment of the present application;
FIG. 5 is a block link point diagram of an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of another embodiment of a block link point provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the present application, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like indicate orientations or positional relationships based on those shown in the drawings, and are used merely for convenience of description and for simplicity of description, and do not indicate or imply that the referenced device or element must have a particular orientation, be constructed in a particular orientation, and be operated, and thus should not be considered as limiting the present application. Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of the present application, "a plurality" means two or more unless specifically limited otherwise.
In this application, the word "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for the purpose of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known structures and processes are not set forth in detail in order to avoid obscuring the description of the present application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
Some basic concepts involved in the embodiments of the present application are first described below:
an endorsement node: the intelligent contract is an organization with certain trust or authority, is a node for deploying and operating an intelligent contract and is responsible for checking and signing transactions. The common node is a network node for maintaining the account book.
A channel: a channel is a communication mechanism provided by a consensus service, similar to a topic in publish-subscribe in a messaging system; based on the publish-subscribe relationship, the endorsement node and the common node are connected together to form a communication link with confidentiality, and the requirement of service isolation is met.
Block: and each block records one or more transaction records subjected to endorsement. And connecting a plurality of blocks in series according to the occurrence sequence to obtain a block chain.
And (3) node: and peer nodes participating in maintaining the blockchain, wherein all transaction records of the blockchain are stored on each node.
Intelligent contract: is a set of commitments defined in digital form, including agreements on which contractual participants may execute such commitments.
Trading: refers to any activity or event that can be recorded, such as a medical event, identity management, documentation, food source tracking, account transfer payments, voting, and the like. In the present application, when each transaction occurs, a transaction record corresponding to the transaction is generated.
Account book: the ledger is used for saving transaction records confirmed by the nodes.
Chain: basically, a chain consists of 1 channel +1 ledger + multiple nodes. Nodes that are not linked cannot access transactions on the chain. The nodes of the chain may be dynamically specified by the application.
The embodiment of the application provides a dynamic extension accounting method and device based on a alliance chain and a storage medium. The following are detailed below.
First, an embodiment of the present application provides a billing method based on dynamic extension of a federation chain, where the billing method is applied to a federation chain system, the federation chain system includes at least two nodes, one of the at least two nodes is an execution subject, and the billing method includes: establishing a basic chain in a first channel based on at least two nodes, wherein the basic chain is used for storing accounting block information of the at least two nodes; when an accounting request of a node set is obtained, establishing a branch chain in a second channel based on the node set, wherein the node set is composed of partial nodes in at least two nodes; monitoring newly added first accounting block information in a basic chain together with nodes in the node set; and if the first accounting block information is monitored, accounting is carried out on the branch chain together with the nodes in the node set on the basis of the first accounting block information.
Referring to fig. 1, fig. 1 is a schematic view of a scenario of a federation chain system according to an embodiment of the present application.
In the embodiment of the present application, the federation chain system 10 includes at least two nodes (the federation chain system 10 includes 5 nodes is illustrated in fig. 1 as an example). The at least two nodes are connected through a network, and the connection mode can be wireless connection or 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-to-peer nodes, i.e., each node is the same for the entire federation chain system 10. It is to be understood that the number of nodes in the federation chain system 10 may be N, where N is a positive integer and N is not less than 2 (e.g., N ═ 3), that is, it only needs to be satisfied that the federation chain system 10 includes at least two nodes connected to each other, and this is not limited in this application.
The node may be a general purpose computer device or a special purpose computer device. In a specific implementation, the node may be a desktop computer, a laptop computer, a network server, a Personal Digital Assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, an embedded device, and the like, and the type of the node is not limited in this embodiment.
In the present embodiment, the federation 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 are peer-to-peer, and the numbering designations of the first node 11, the second node 12, the third node 13, the fourth node 14, and the fifth node 15 are not limited thereto.
It should be noted that the scenario diagram of the federation chain system 10 shown in fig. 1 is only an example, and the federation chain system 10 and the scenario described in the embodiment of the present application are for more clearly illustrating the technical solution of the embodiment of the present application, and do not form a limitation to the technical solution provided in the embodiment of the present application, and as can be known by those skilled in the art, with the evolution of the federation chain system 10 and the occurrence of a new service scenario, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
In the embodiment of the present application, the description will be made from the perspective of the third node 13, and the accounting method of the federation chain system 10 of the present application can also be performed from the perspective of other nodes in the federation chain system 10.
Referring to fig. 2 and fig. 3, fig. 2 is a schematic diagram illustrating establishment of a comprehensive chain, a basic chain, and a branch chain in a federation chain system according to an embodiment of the present application; fig. 3 is a flowchart illustrating an embodiment of an accounting method based on dynamic extension of a federation chain according to an embodiment of the present application.
With reference to fig. 1 to fig. 3, the accounting method includes:
and S31, establishing a basic chain in the first channel based on the at least two nodes, wherein the basic chain is used for storing the accounting block information of the at least two nodes.
In the embodiment of the present application, a basic chain may be established in the first channel 21 based on at least two nodes through an ethernet, 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 federation chain system 10, so that the node in the federation chain system 10 joins the first channel 21. Nodes in the federation chain system 10 maintain the same ledger, forming a base chain.
Fabric is a blockchain framework developed by IBM and DAH as the leading members of the project for the super book. Its function is similar to that of an Ethern, and it is also a distributed intelligent contract platform. But unlike etherhouses and bitcoins, it is a framework from the beginning, rather than a public chain, and has no built-in tokens. Fabric is an open source item of push blockchain technology and standards launched by the Linux foundation in 2015, and joining members includes: the objective of dozens of different interest bodies such as Dutch banks, Essen philosophy and the like is to enable members to cooperate together to build an open platform, meet various user cases from multiple different industries and simplify business processes. As a block chain framework, the Fabric adopts a loose coupling design, and components such as a consensus mechanism, identity authentication and the like are modularized, so that corresponding modules can be conveniently selected according to application scenes in the application process.
In the embodiment of the application, the basic chain is used for storing accounting block information of at least two nodes. For example, the nodes in the federation chain system 10 are a first node 11, a second node 12, a third node 13, a fourth node 14, and a fifth node 15, respectively. Each node may represent an enterprise, a department, etc., e.g., first node 11, second node 12, third node 13, fourth node 14, and fifth node 15 represent enterprise A, enterprise B, enterprise C, enterprise D, and enterprise E, respectively. The accounting block information of the at least two nodes is a transaction record generated by the transaction of the at least two nodes.
In a specific embodiment, it is determined whether the node itself is an endorsement node, and if the node itself is an endorsement node, a basic chain is established in the first channel 21 based on at least two nodes. Endorsement nodes can be generated by voting by at least two nodes in the federation chain system 10, or can be specified, and are not limited herein. For example, the endorsement node in federation chain system 10 is the third node 13. Specifically, whether the self is an endorsement node is judged according to a preset frequency, wherein the preset frequency can be 1hz, 0.5hz and the like, and is set according to specific conditions. The endorsement nodes are authoritative nodes, and the endorsement nodes establish the basic chain, so that the reliability of the basic chain can be improved, and the safety of the alliance chain system 10 is improved.
At least two nodes in the federation chain system 10 are in equal status, and when one of the nodes judges itself to be an endorsement node, the node can represent the federation chain system 10 to complete endorsement processing, mainly signature, of a transaction proposal. The endorsement node may establish a base chain at 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 performs the accounting method of the federation chain system 10.
S32, when the accounting request of the node set is obtained, establishing a branch chain in the second channel based on the node set, wherein the node set is composed of part of nodes in at least two nodes.
In the embodiment of the present application, a node set is composed of some nodes of at least two nodes. That is, the nodes in the node set are composed of nodes of at least two nodes in the federation chain system 10, but the number is less than the number of at least two nodes of the federation chain system 10. For example, if the at least two nodes of the federation 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 set of nodes may be 2, 3, 4, and the nodes in the set of nodes are the nodes in 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, respectively, and the third node 13 is an endorsement node. The endorsement nodes in the node set may be identified or designated endorsement nodes on the basic chain, or may be generated by voting or designated election through the nodes in the node set, which is not limited in the present application. For example, if the endorsement node on the basic chain is the third node 13, the first node 11, the second node 12, and the third node 13 directly agree that the third node 13 is the endorsement node.
For example, enterprise a, enterprise B, and enterprise C want to keep accounts private, but not to let enterprise D and enterprise E know. The first node 11, the second node 12 and the third node 13 together initiate accounting requests for individual accounting. The third node 13 establishes a split chain at the second channel 22 based on the node set.
Further, the third node 13, the fourth node 14 and the fifth node 15 may also jointly initiate accounting requests for individual accounting. The third node 13 establishes a sublink in the fourth channel 24 based on the third node 13, the fourth node 14 and the fifth node 15, thereby realizing separate accounting for the third node 13, the fourth node 14 and the fifth node 15.
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. And maintaining the same account book by the nodes of the node set to form a branch chain.
In a specific embodiment, when the accounting request of the node set is obtained, before the sublink is established in the second channel 22 based on the node set, the method may further include the following steps:
(1) an integrated chain is established on the third channel 23 based on the at least two nodes, the integrated chain for providing services external to the federation chain system 10.
In the embodiment of the present application, the integrated chain may provide services such as billing block information query and verification to the outside of the federation chain system 10. The user initiates a query request to a node in the federation chain system 10 through the client, and the node in the federation chain system 10 responds to the query request according to the intelligent contract of the federation chain system 10.
(2) And carrying out hash value calculation on the first accounting block information on the basic chain to obtain the hash value information of the basic chain.
The hash value may be referred to as a hash, a hash algorithm. The technology is a classical technology in cryptography, and is calculated by a computer according to file size, type, time, an author and the like, and changes easily occur, for example, a hash value of data stored in a block changes even if only one letter is changed. Since the hash value is easy to change, no one can catch the hash value of the next block, and the software of the next block is not changed, so that the security of the hash value is very high, and the difficulty of forging the hash value is very high. The primary role of the hash value is to verify whether the information in the block is valid. The most prominent function of the hash value is to inquire the transaction details, and also to trace the source for the evidence of the transaction. The logic in the block chain is that every time a transaction occurs on the chain, the transaction information is processed by the hash algorithm to generate a hash value, and the user queries the transaction information on the chain through the hash value. Due to the fact that the hash value is not changeable and traceable, when a problem occurs in the transaction, a source can be directly found to solve the problem.
In the embodiment of the application, the hash value calculation is performed on the first accounting block information on the basic chain to obtain the hash value information of the basic chain, the first accounting block information on the basic chain can be encrypted, the service is provided to the outside in a hash value information mode, and the first accounting block information on the basic chain can be verified while the first accounting block information on the basic chain is prevented from being leaked.
In a preferred embodiment, the hash value information is a merkel root. And performing hash value calculation on the first accounting block information on the basic chain by using a Merckel tree algorithm to obtain a Merckel root of the basic chain. The mercker tree algorithm does not directly calculate the hash value of the whole string, but calculates one hash value for each transaction, and then calculates the hash value again by connecting two by two until the top-most mercker root. The maximum benefit of the merkel tree algorithm is that each transaction can be deleted independently and directly, and only the hash value of the transaction is reserved. Thus, for the entire block, his cryptographic security and integrity is not changed, but the amount of data can be greatly reduced.
Therefore, the comprehensive chain stores the Mercker root of the first accounting block information, the storage capacity of the comprehensive chain can be reduced, and the external service efficiency of the comprehensive chain is improved.
(3) And sending the hash value information of the basic chain to the nodes on the comprehensive chain.
In a specific embodiment, the hash value information of the branch chain is sent to the nodes on the comprehensive chain according to a preset period. The preset period may be 10 minutes once, 60 minutes once, or the like, and may be set according to specific situations, which is not limited in the present application.
In another embodiment, when the number of the newly added blocks on the branch chain is greater than the preset number, the hash value information of the branch chain is sent to the node on the integrated chain. The preset number may be 10, 15, etc., and may be set according to specific situations, which is not limited in the present application.
Furthermore, the node on the integrated chain verifies the hash value information of the basic chain, and stores the hash value information to the integrated chain after verification is successful so as to provide service to the outside.
And S33, monitoring the first accounting block information newly added in the basic chain together with the nodes in the node set.
In the embodiment of the present application, when a new transaction is generated in the first channel 21, the node in the basic chain accounts the new transaction record to obtain the new first accounting block information, and stores the new accounting block information in the node in the basic chain. Meanwhile, the nodes in the basic chain broadcast the newly added first accounting block information to other nodes, and the nodes in the basic chain can monitor the newly added first accounting block information by monitoring the broadcast of other nodes.
And S34, if the first accounting block information is monitored, accounting is carried out on the branch chain together with the nodes in the node set based on the first accounting block information.
In the embodiment of the application, if the first accounting block information is monitored, accounting is performed on the branch chain together with the nodes in the node set based on the first accounting block information.
Referring to fig. 4, fig. 4 is a schematic flow chart of S34 according to an embodiment of the present disclosure.
As shown in fig. 4, in some embodiments of the present application, if the first accounting block information is monitored in step S34, performing accounting on the branch chain together with the nodes in the node set based on the first accounting block information, may further include:
s341, if the first accounting block information is monitored, determining whether the first accounting block information satisfies a predetermined condition.
Specifically, the branch chain stores an intelligent contract of the branch chain, and whether the first accounting block information meets a preset condition is judged according to the intelligent contract of the branch chain. For example, the intelligent contract may agree that the predetermined condition is satisfied when the first node 11 and the fifth node 15 transact.
And S342, if the first accounting block information meets the preset condition, generating second accounting block information together with the nodes in the node set based on the first accounting block information.
In the embodiment of the application, when the first accounting block information meets the preset condition, the second accounting block information is generated together with the nodes in the node set based on the first accounting block information. Specifically, according to the intelligent contract of the branch chain, second accounting block information is generated together with the nodes in the node set on the basis of the first accounting block information. The first accounting block information is a record of transactions conducted by nodes in the basic chain, and the second accounting block information is a record of transactions conducted by nodes on the node set. For example, the transaction record in the first accounting block information is: the first node 11 transfers money to the third node 13. Generating second accounting block information based on the first accounting block information together with the nodes in the node set. The second accounting block information is the block information which is 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 money to the second node 12. Because the nodes in the node set are accounted in the second channel 22, the data of the second channel 22 is isolated from the data of the first channel 21, and the second accounting block information cannot be known by the nodes entering the first channel 21 but not joining the second channel 22, the privacy of account transfer of part of nodes is realized, and the leakage of the account transfer information is avoided.
And S343, storing the second accounting block information into the branch chain.
In one embodiment, the second accounting block information is agreed with nodes in the node set, and when the second accounting block information is agreed, the second accounting block information is stored in the branch chain.
Further, after the second accounting block information is stored in the branch chain, performing hash value calculation on the second accounting block information on the branch chain to obtain hash value information of the branch chain; and sending the hash value information of the branch chain to the node on the comprehensive chain. Specifically, the hash value information is a merkel root.
Furthermore, the node on the integrated chain verifies the hash value information of the branch chain, and stores the hash value information to the integrated chain after the verification is successful so as to provide service to the outside.
The application provides a billing method based on dynamic extension of a federation chain, wherein a federation chain system comprises at least two nodes, one of the at least two nodes is an execution subject, and the billing method comprises the following steps: establishing a basic chain in a first channel based on at least two nodes, wherein the basic chain is used for storing accounting block information of the at least two nodes; when an accounting request of a node set is obtained, establishing a branch chain in a second channel based on the node set, wherein the node set is composed of partial nodes in at least two nodes; monitoring newly added first accounting block information in a basic chain together with nodes in the node set; and if the first accounting block information is monitored, accounting is carried out on the branch chain together with the nodes in the node set on the basis of the first accounting block information. According to the accounting method, firstly, a basic chain in which all nodes participate in the alliance chain system is established in a first channel and used for accounting the whole alliance chain system, a branch chain is established for the nodes needing to participate in the privacy transaction when part of the nodes need to perform the privacy transaction, and the nodes needing to participate in the privacy transaction cannot be acquired by the nodes on the basic chain when accounting is performed on the branch chain, so that the problem that information leakage easily occurs when part of the nodes of the alliance chain system perform accounting is solved; meanwhile, when the nodes participating in the privacy transaction are booked on the branch chain, the nodes are booked based on the first transaction information, and the data correlation between the basic chain and the branch chain can be ensured.
In order to better implement the accounting method based on dynamic extension of a federation chain in the embodiment of the present application, on the basis of the accounting method based on dynamic extension of a federation chain, the embodiment of the present application further provides a block link node, where one block link node is a terminal that can participate in accounting, such as a computer, a mobile phone, an ore machine, and other devices. One blockchain node can participate in data consensus, or store and record data, or supervise a malicious network. A blockchain node is a member of a distributed network. As shown in fig. 5, fig. 5 is a schematic structural diagram of an embodiment of a block link point provided in this embodiment, where the block link point includes a first block chain establishing unit 401, a second block chain establishing unit 402, a listening unit 403, and a recording unit 404:
a first blockchain establishing unit 401, configured to establish a basic chain in the first channel based on the at least two nodes, where the basic chain is used to store accounting blockchain information of the at least two nodes;
a second block chain establishing unit 402, configured to establish a branch chain in a second channel based on a node set when an accounting request of the node set is obtained, where the node set is composed of some nodes in at least two nodes;
a monitoring unit 403, configured to monitor, with a node in the node set, first accounting block information newly added in the basic chain;
a recording unit 404, configured to perform accounting on the branch chain together with the nodes in the node set based on the first accounting block information if the first accounting block information is monitored.
Wherein, 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,
if the first accounting block information meets the preset condition, generating second accounting block information together with the nodes in the node set based on the first accounting block information;
and storing the second accounting block information to the branch chain.
The first blockchain establishing unit 401 is further configured to establish a comprehensive chain in the third channel based on at least two nodes, where the comprehensive chain is used to provide a service 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;
and sending the hash value information of the basic chain to the nodes on the comprehensive chain.
The second block chain establishing unit 402 is further configured to perform hash value calculation on the second accounting block information on the branch chain to obtain hash value information of the branch chain;
and sending the hash value information of the branch chain to the node on the comprehensive chain.
The second block chain establishing unit 402 is further configured to send the hash value information of the branch chain to a node on the integrated chain according to a preset period;
or when the number of the newly added blocks on the branch chain is larger than the preset number, the hash value information of the branch chain is sent to the node on the comprehensive chain.
The first block chain establishing unit 401 is further configured to determine whether the first block chain is an endorsement node;
and if the node is the endorsement node, establishing a basic chain in the first channel based on at least two nodes.
Wherein, the hash value information is the Mercker root.
The embodiment of the application also provides a block chain node. As shown in fig. 6, fig. 6 is a schematic structural diagram of another embodiment of the block link point provided in the embodiment of the present application, specifically:
the block link point may include components such as a processor 501 of one or more processing cores, memory 502 of one or more computer-readable storage media, a power source 503, and an input unit 504. Those skilled in the art will appreciate that the block link point configurations shown in the figures do not constitute a definition of a block chain node and may include more or fewer components than shown, or some components in combination, or a different arrangement of components. Wherein:
the processor 501 is a control center of the block link point, connects each part of the whole block link node by using various interfaces and lines, and executes various functions of the block link node and processes data by running or executing software programs and/or modules stored in the memory 502 and calling data stored in the memory 502, thereby performing overall monitoring of the block link point. Optionally, processor 501 may include one or more processing cores; preferably, the processor 501 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 501.
The memory 502 may be used to store software programs and modules, and the processor 501 executes various functional applications and data processing by operating 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 program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to the use of the blockchain node, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
The blockchain node further includes a power supply 503 for supplying power to each component, and preferably, the power supply 503 may be logically connected to the processor 501 through a power management system, so as to implement functions of managing charging, discharging, power consumption management, and the like through the power management system. The power supply 503 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The tile link points may also include an input unit 504, where the input unit 504 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the block link points may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 501 in the blockchain node loads the executable file corresponding to the process of one or more application programs into the memory 502 according to the following instructions, and the processor 501 runs the application program stored in the memory 502, thereby implementing various functions as follows:
establishing a basic chain in a first channel based on at least two nodes, wherein the basic chain is used for storing accounting block information of the at least two nodes;
when an accounting request of a node set is obtained, establishing a branch chain in a second channel based on the node set, wherein the node set is composed of partial nodes in at least two nodes;
monitoring newly added first accounting block information in a basic chain together with nodes in the node set;
and if the first accounting block information is monitored, accounting is carried out on the branch chain together with the nodes in the node set on the basis of the first accounting block information.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like. The computer program is loaded by a processor to execute the steps in any one of the federation chain-based dynamic extension billing methods provided by the embodiments of the present application. For example, the computer program may be loaded by a processor to perform the steps of:
establishing a basic chain in a first channel based on at least two nodes, wherein the basic chain is used for storing accounting block information of the at least two nodes;
when an accounting request of a node set is obtained, establishing a branch chain in a second channel based on the node set, wherein the node set is composed of partial nodes in at least two nodes;
monitoring newly added first accounting block information in a basic chain together with nodes in the node set;
and if the first accounting block information is monitored, accounting is carried out on the branch chain together with the nodes in the node set on the basis of the first accounting block information.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed descriptions of other embodiments, and are not described herein again.
In a specific implementation, each unit or structure may be implemented as an independent entity, or may be combined arbitrarily to be implemented as one or several entities, and the specific implementation of each unit or structure may refer to the foregoing method embodiment, which is not described herein again.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
The method, the device and the storage medium for billing based on dynamic extension of a federation chain provided by the embodiment of the present application are introduced in detail above, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiment is only used to help understanding the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. An accounting method based on dynamic extension of a federation chain is applied to a federation chain system, wherein the federation chain system comprises at least two nodes, one of the at least two nodes is an execution subject, and the accounting method comprises the following steps:
establishing a basic chain in a first channel based on the at least two nodes, wherein the basic chain is used for storing accounting block information of the at least two nodes;
when an accounting request of a node set is obtained, establishing a branch chain in a second channel based on the node set, wherein the node set is composed of part of nodes in the at least two nodes;
monitoring first accounting block information newly added in the basic chain together with the nodes in the node set;
and if the first accounting block information is monitored, accounting is carried out on the branch chain together with the nodes in the node set based on the first accounting block information.
2. The accounting method according to claim 1, wherein the accounting on the branch chain based on the first accounting block information and the nodes in the node set if the first accounting block information is monitored comprises:
if the first accounting block information is monitored, judging whether the first accounting block information meets a preset condition or not,
if the first accounting block information meets the preset condition, generating second accounting block information together with the nodes in the node set based on the first accounting block information;
and storing the second accounting block information to the branch chain.
3. The accounting method according to claim 2, wherein when the accounting request of the node set is obtained, establishing a branch chain in the second channel based on the node set, before the establishing, comprises:
establishing a comprehensive chain in a third channel based on the at least two nodes, the comprehensive chain being used for providing services to the outside of the federation 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;
and sending the hash value information of the basic chain to the node on the comprehensive chain.
4. A billing method according to claim 3, wherein storing the second billing block information to the subcohain, thereafter, comprises:
performing hash value calculation on the second accounting block information on the branch chain to obtain hash value information of the branch chain;
and sending the hash value information of the branch chain to the node on the comprehensive chain.
5. The accounting method according to claim 4, wherein the sending the hash value information of the branch chain to the node on the integrated chain comprises:
sending the hash value information of the branch chain to a node on the comprehensive chain according to a preset period;
or when the number of the newly added blocks on the branch chain is larger than the preset number, sending the hash value information of the branch chain to the node on the comprehensive chain.
6. The billing method of claim 1, wherein said establishing a base chain in a first channel based on said at least two nodes comprises:
judging whether the self is an endorsement node;
and if the node is the endorsement node, establishing a basic chain in the first channel based on the at least two nodes.
7. A billing method according to any one of claims 3 to 6, characterized in that the hash value information is mercker root.
8. A block link node, comprising:
a first blockchain establishing unit, configured to establish a basic chain in a first channel based on the at least two nodes, where the basic chain is used to store accounting block information of the at least two nodes;
the second block chain establishing unit is used for establishing a branch 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 part of nodes in the at least two nodes;
the monitoring unit is used for monitoring first accounting block information newly added in the basic chain together with the nodes in the node set;
and the recording unit is used for carrying out accounting on the branch chain together with the nodes in the node set based on the first accounting block information if the first accounting block information is monitored.
9. A block link node, comprising:
one or more processors;
a 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 federation chain-based dynamic extension billing method of any one of claims 1-8.
10. A computer-readable storage medium, having stored thereon a computer program which is loaded by a processor to perform the steps of the federation chain-based dynamic extension billing method of any one of claims 1 to 8.
CN202010418741.7A 2020-05-18 2020-05-18 Dynamic extended billing method and device based on alliance chain Pending CN113691569A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010418741.7A CN113691569A (en) 2020-05-18 2020-05-18 Dynamic extended billing method and device based on alliance chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010418741.7A CN113691569A (en) 2020-05-18 2020-05-18 Dynamic extended billing method and device based on alliance chain

Publications (1)

Publication Number Publication Date
CN113691569A true CN113691569A (en) 2021-11-23

Family

ID=78575408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010418741.7A Pending CN113691569A (en) 2020-05-18 2020-05-18 Dynamic extended billing method and device based on alliance chain

Country Status (1)

Country Link
CN (1) CN113691569A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107360248A (en) * 2017-07-31 2017-11-17 众安信息技术服务有限公司 For configuring the method and apparatus locally known together and computer-readable recording medium
US20190132350A1 (en) * 2017-10-30 2019-05-02 Pricewaterhousecoopers Llp System and method for validation of distributed data storage systems
CN109783572A (en) * 2018-12-14 2019-05-21 平安科技(深圳)有限公司 Block chain multichain creation method, device, equipment and storage medium
CN110213737A (en) * 2019-05-23 2019-09-06 广西大学 The method for establishing body area network Information Security Mechanism based on alliance's chain
CN110502927A (en) * 2019-08-27 2019-11-26 腾讯科技(深圳)有限公司 A kind of information processing method and relevant apparatus
CN110544095A (en) * 2019-09-03 2019-12-06 腾讯科技(深圳)有限公司 Transaction processing method of block chain network and block chain network
CN110555682A (en) * 2019-09-10 2019-12-10 苏州阿尔山数字科技有限公司 multi-channel implementation method based on alliance chain
CN110780979A (en) * 2019-10-28 2020-02-11 北京海益同展信息科技有限公司 Control method and device for configuration under micro-service framework, medium and electronic equipment
CN111163129A (en) * 2019-12-05 2020-05-15 深圳前海微众银行股份有限公司 Resource processing method and device based on cross-link network

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107360248A (en) * 2017-07-31 2017-11-17 众安信息技术服务有限公司 For configuring the method and apparatus locally known together and computer-readable recording medium
US20190132350A1 (en) * 2017-10-30 2019-05-02 Pricewaterhousecoopers Llp System and method for validation of distributed data storage systems
US20190130114A1 (en) * 2017-10-30 2019-05-02 Pricewaterhousecoopers Llp Implementation of continuous real-time validation of distributed data storage systems
CN109783572A (en) * 2018-12-14 2019-05-21 平安科技(深圳)有限公司 Block chain multichain creation method, device, equipment and storage medium
CN110213737A (en) * 2019-05-23 2019-09-06 广西大学 The method for establishing body area network Information Security Mechanism based on alliance's chain
CN110502927A (en) * 2019-08-27 2019-11-26 腾讯科技(深圳)有限公司 A kind of information processing method and relevant apparatus
CN110544095A (en) * 2019-09-03 2019-12-06 腾讯科技(深圳)有限公司 Transaction processing method of block chain network and block chain network
CN110555682A (en) * 2019-09-10 2019-12-10 苏州阿尔山数字科技有限公司 multi-channel implementation method based on alliance chain
CN110780979A (en) * 2019-10-28 2020-02-11 北京海益同展信息科技有限公司 Control method and device for configuration under micro-service framework, medium and electronic equipment
CN111163129A (en) * 2019-12-05 2020-05-15 深圳前海微众银行股份有限公司 Resource processing method and device based on cross-link network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HAN, HR (HAN, HUIRUI): "An Architecture of Secure Health Information Storage System Based on Blockchain Technology", LECTURE NOTES IN COMPUTER SCIENCE *
刘宇;陈哲;李孟恒;覃团发;: "基于联盟区块链的体域网信息安全方案", 计算机工程与应用, no. 04 *

Similar Documents

Publication Publication Date Title
Chalaemwongwan et al. Notice of Violation of IEEE Publication Principles: State of the art and challenges facing consensus protocols on blockchain
Mingxiao et al. A review on consensus algorithm of blockchain
KR101827373B1 (en) Block window module having agreement algorithm for limiting mining, managing server and virtual money exchange system and method
CN112907252B (en) Block chain transaction method and system based on multi-person chain lower channel
CN109246179A (en) Safeguard method and apparatus, server and the computer readable storage medium of block chain
EP3586493A1 (en) Method for mining a block in a decentralized blockchain consensus network
CN108282334A (en) It is a kind of based on the multi-party key agreement device of block chain, method and system
CN110149304A (en) A kind of traceable efficient anonymous authentication method of support identity suitable for alliance's chain and system
CN112187866B (en) Novel block chain consensus method based on shared storage
WO2020134631A1 (en) Block chain-based data processing method and apparatus
CN113067707A (en) Data processing method, device and equipment based on block chain and readable storage medium
CN110334484B (en) Copyright verification method and device, computer equipment and storage medium
He et al. A novel cryptocurrency wallet management scheme based on decentralized multi-constrained derangement
Anupama et al. Analysis of the consensus protocols used in blockchain networks–an overview
Lamriji et al. A comparative study of consensus algorithms for blockchain
Ng et al. LDSP: shopping with cryptocurrency privately and quickly under leadership
CN113177092A (en) Ship manufacturing inspection data sharing method, alliance chain and system
KR20190086301A (en) System and method for distributed database using block chain
CN113691569A (en) Dynamic extended billing method and device based on alliance chain
CN112527898B (en) Security calculation method, device, computer and storage medium
KR102332814B1 (en) The block chain system including a block chain structure for data self-sovereign identity
Luo et al. MPC-DPOS: An efficient consensus algorithm based on secure multi-party computation
KR102366638B1 (en) Game client Proof of Attendance-based blockchain system and the block compensation consensus method using thereof
CN114465714A (en) Node configuration method and system in alliance chain
KR20210150810A (en) Method providing transaction integrity and confidentiality in heterogeneous blockchain platforms

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