CN117132279B - Block chain double-chain accounting method, system, equipment and medium - Google Patents

Block chain double-chain accounting method, system, equipment and medium Download PDF

Info

Publication number
CN117132279B
CN117132279B CN202311393500.1A CN202311393500A CN117132279B CN 117132279 B CN117132279 B CN 117132279B CN 202311393500 A CN202311393500 A CN 202311393500A CN 117132279 B CN117132279 B CN 117132279B
Authority
CN
China
Prior art keywords
node
real
transaction
time
hash value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311393500.1A
Other languages
Chinese (zh)
Other versions
CN117132279A (en
Inventor
王光臣
宋海瑢
赵祥蓉
陈云泽
高梦雪
宗迷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong University
Original Assignee
Shandong University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong University filed Critical Shandong University
Priority to CN202311393500.1A priority Critical patent/CN117132279B/en
Publication of CN117132279A publication Critical patent/CN117132279A/en
Application granted granted Critical
Publication of CN117132279B publication Critical patent/CN117132279B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing

Abstract

The invention discloses a block chain double-chain billing method, a system, equipment and a medium, which relate to the technical field of block chains and comprise the following steps: the transaction packaging block is broadcasted layer by layer from the accounting node interacted with the light node to the root accounting node, and a fork-shaped chain structure is formed by the links of the lower accounting node blocks pointed to by the timing hash pointers of the transaction packaging block; the accounting node interacting with the light node broadcasts the transaction real-time data, the root accounting node takes each account as a unit, the real-time hash values of all the transaction real-time data are connected in series through the real-time hash pointers in a block form to form a linear blockchain, and the linear blockchain of all the accounts is stored in the root accounting node in a parallel linear blockchain structure. Ensuring the convenience and the high efficiency of the transaction process.

Description

Block chain double-chain accounting method, system, equipment and medium
Technical Field
The invention relates to the technical field of blockchain, in particular to a blockchain double-chain billing method, a system, equipment and a medium.
Background
Blockchain is a distributed ledger technique that records and stores transaction data in blocks and ensures the security and integrity of the data by cryptographic methods. The main features of blockchains include consensus mechanisms, non-tampering, and transparency.
In the conventional blockchain technology, a blockchain network with complete nodes needs to store transaction data on each node, thus occupying a large amount of memory, the complete nodes store copies of the entire transaction history, although all transactions can be verified and processed, this results in a large amount of storage requirements, especially for large-scale blockchain networks, the cost and processing time are greatly increased, and while transaction data is stored using encryption technology, the complete node operators can access the original transaction data that is not encrypted, which may lead to privacy leakage and security risks.
In addition, the common centralized accounting method in the traditional financial field is to independently carry out accounting by banks or other centralized institutions, so that transactions can be rapidly processed, and consistency and safety are ensured; however, centralized accounting presents a single point of failure and potential risk of data tampering, as the central authority plays a critical role, once failed or attacked, the entire system will be impacted.
Disclosure of Invention
In order to solve the above problems, the present invention provides a blockchain double-chain billing method, system, device and medium for constructing a double-chain structure combining a fork-type chain structure and a parallel-type blockchain structure. In the fork-type chain structure, each upper-level billing node supervises the lower-level billing node through a timing hash pointer, and the timing hash value stored on the root billing node supervises each fork-type chain structure, and when data changes, the timing hash pointer deviates; in the parallel linear block chain structure, at the root accounting node, the real-time hash value of the real-time data of the previous transaction of each account and the generated corresponding real-time hash pointer are stored in the subsequent block and point to the previous block, so that the safety of the transaction data of each account is ensured, and the root accounting node is convenient to monitor each account; through the safety characteristic of the fork-shaped chain structure and the characteristic of the parallel chain of the root accounting node, when the account is transacted at different light nodes, the root accounting node provides the latest real-time hash value of the account to the light nodes in real time, so that the light nodes perform back-source comparison, and the convenience and safety of the transaction are ensured.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
in a first aspect, the present invention provides a blockchain double-chain billing method, comprising:
receiving and storing transaction real-time data sent by a light node by an accounting node used for interacting with the light node in a blockchain network, packaging the transaction real-time data received in a preset time period into transaction packaging data, and storing a timing hash value generated by the transaction packaging data as a transaction packaging block;
the transaction packaging block is broadcasted layer by layer from the accounting node interacted with the light node to the root accounting node, the timing hash value of the transaction packaging block broadcasted by the lower accounting node is calculated and stored in each level of accounting node, a corresponding timing hash pointer is generated, and the link of the lower accounting node block pointed by the timing hash pointer forms a fork-type chain structure;
and after each level of accounting node successfully receives the transaction real-time data, calculating and storing the real-time hash value of the transaction real-time data in the root accounting node and generating a corresponding real-time hash pointer, wherein the real-time hash value of all the transaction real-time data of each account is connected in series in a block form through the real-time hash pointer to form a linear blockchain, and the linear blockchain of all the accounts is stored in the root accounting node in a parallel linear blockchain structure.
As an alternative implementation manner, in the layer-by-layer broadcasting process, after each time the upper accounting node receives the transaction packaging block broadcasted by the lower accounting node, the upper accounting node calculates the timing hash value of the transaction packaging block and sends the timing hash value to the lower accounting node so that the lower accounting node compares the received timing hash value with the timing hash value of the transmitted transaction packaging block calculated by the upper accounting node, and if the comparison is consistent, the upper accounting node successfully receives the transaction packaging block broadcasted by the lower accounting node; if the comparison is inconsistent, the lower-level billing node rebroadcasts and uploads.
As an alternative embodiment, the accounting node interacting with the light node broadcasts the transaction real-time data to the accounting nodes with more than two levels, the accounting node interacting with the light node calculates the real-time hash value of the transaction real-time data and waits for the transaction real-time data to be sent to the light node, the calculated real-time hash value is sent to the light node only after the accounting node interacting with the light node determines that the accounting nodes with more than two levels all successfully receive the transaction real-time data, the light node compares the received real-time hash value with the real-time hash value of the transaction real-time data sent by the light node, if the comparison is consistent, the transaction real-time data is successfully written into the blockchain, and if the comparison is inconsistent, the light node rebroadcasts.
As an alternative implementation manner, the accounting node interacted with the light node broadcasts the transaction real-time data to the accounting nodes with more than two levels, the accounting nodes with more than two levels send the real-time hash value of the received broadcast content to the accounting node interacted with the light node after receiving the broadcast, and the accounting nodes interacted with the light node compare the received real-time hash value, if the comparison is consistent, the accounting nodes with more than two levels are proved to be successfully broadcast, if the comparison is inconsistent, the accounting nodes interacted with the light node rebroadcast.
As an alternative embodiment, the corresponding timing hash pointers generated by the timing hash values stored at the upper level accounting node supervise the fork chain by pointing to its lower level accounting node blocks, the timing hash values stored at the root accounting node supervise all blocks of the fork chain structure, and when the data in the different accounting node blocks change, the timing hash values at the root accounting node change, resulting in a deviation of the timing hash pointers.
As an alternative embodiment, in the parallel linear blockchain structure of the root accounting node, each block of the linear blockchain includes a real-time hash value of the current transaction real-time data and a real-time hash value of a previous transaction real-time block and a corresponding real-time hash pointer, and the real-time hash pointer points to the previous block, thereby forming the linear blockchain.
Alternatively, when the light node performs a transaction, the root accounting node sends the real-time hash value of the nearest block of the corresponding account to the light node, so that the light node performs comparison, and when the comparison is consistent, the transaction is performed.
In a second aspect, the present invention provides a blockchain double-chain billing system comprising:
the system comprises a receiving module, a transaction packing block and a timing hash value generation module, wherein the receiving module is configured to receive and store transaction real-time data sent by a light node by an accounting node used for interacting with the light node in a blockchain network, pack the transaction real-time data received in a preset time period into transaction packing data, and store the timing hash value generated by the transaction packing data into the transaction packing block;
the fork chain construction module is configured to report the transaction packaging block layer by layer from the accounting node interacted with the light node to the root accounting node, calculate and store the timing hash value of the transaction packaging block broadcasted by the lower accounting node in each level of accounting node and generate a corresponding timing hash pointer, and form a fork chain structure by the links of the lower accounting node blocks pointed to by the timing hash pointer;
the parallel linear blockchain construction module is configured to broadcast transaction real-time data by the accounting nodes interacted with the light nodes, calculates and stores real-time hash values of the transaction real-time data in the root accounting node and generates corresponding real-time hash pointers after each level of accounting nodes successfully receive the transaction real-time data, and uses each account as a unit, and connects the real-time hash values of all the transaction real-time data of each account in series in a block form through the real-time hash pointers to form a linear blockchain, and stores the linear blockchains of all the accounts in the root accounting node in a parallel linear blockchain structure.
In a third aspect, the invention provides an electronic device comprising a memory and a processor and computer instructions stored on the memory and running on the processor, which when executed by the processor, perform the method of the first aspect.
In a fourth aspect, the present invention provides a computer readable storage medium storing computer instructions which, when executed by a processor, perform the method of the first aspect.
Compared with the prior art, the invention has the beneficial effects that:
the invention provides a block chain double-chain billing method, a system, equipment and a medium, wherein when a timing hash value of a transaction packing block is broadcast upwards, a fork chain structure is constructed according to a timing hash pointer generated by the timing hash value of the transaction packing block, each fork chain is conveniently supervised by the timing hash value stored on a root billing node, and when different blocks of different billing nodes are changed, timing hash pointers at an upper-level billing node and the root billing node deviate, so that the hash pointers deviate, and the function of supervising the whole fork chain is achieved.
The invention provides a blockchain double-chain accounting method, a system, equipment and a medium, wherein an accounting node interacted with a light node broadcasts transaction real-time data, a linear blockchain is formed at a root accounting node by taking each account as a unit according to a real-time hash value, and the real-time hash value after each transaction of all accounts is stored in a parallel linear blockchain structure, so that when the accounts are transacted at different light nodes, the root accounting node provides the latest real-time hash value in real time for back-source comparison, and convenience and safety of the transaction are ensured.
The present invention provides a double-chain structure combining a fork-type chain structure and a parallel-type block chain structure. Firstly, the fork chain structure ensures the safety and reliability of data on the chain by using a blockchain technology, each upper-level billing node monitors the lower-level billing node through a hash pointer, a timing hash value stored on a root billing node monitors each fork chain, and when the data in a block changes, the timing hash pointer of the upper-level block deviates. And then, at the root accounting node, a real-time hash pointer generated by a real-time hash value of the real-time data of the previous transaction of each account is stored in the latter block and points to the former block, so that the safety of the transaction data of each account is ensured, and the root accounting node is convenient to monitor each account. Finally, the fork chain and the parallel line type blockchain are unified through a waiting verification process, the consistency of data on the two chains is guaranteed, and when an account is transacted at different light nodes, the root accounting node can provide the nearest real-time hash value of the account to the light nodes in real time through the unchangeable characteristic of the fork chain structure and the characteristic that the parallel line type blockchain of the root accounting node is concise and clear, so that the light nodes can carry out source return comparison, and the convenience and safety of the transaction are guaranteed.
The invention constructs a double-chain structure combining a fork-type chain structure and a parallel line type block chain structure through the block chain point technology and the hash value characteristic, realizes that the account is compared through the nearest hash value of the account when different light nodes conduct digital RMB transactions, ensures that the hash value of transaction data is compared in the account transaction process by utilizing the characteristics of safe, reliable and unchangeable block chain point technology, does not expose specific transaction data of the account, ensures the security of the transaction process, is beneficial to the supervision of the upper-level accounting node to the lower-level accounting node, ensures the security, convenience and high efficiency of the transaction process and is beneficial to supervision.
Additional aspects of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention.
FIG. 1 is a flowchart of a block chain double-chain billing method according to embodiment 1 of the present invention;
FIG. 2 is a schematic diagram of a fork chain structure according to embodiment 1 of the present invention;
FIG. 3 is a block chain structure of a parallel line type according to embodiment 1 of the present invention.
Detailed Description
The invention is further described below with reference to the drawings and examples.
It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the invention. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular forms also are intended to include the plural forms, and furthermore, it is to be understood that the terms "comprises" and "comprising" and any variations thereof are intended to cover non-exclusive inclusions, e.g., processes, methods, systems, products or devices that comprise a series of steps or units, are not necessarily limited to those steps or units that are expressly listed, but may include other steps or units that are not expressly listed or inherent to such processes, methods, products or devices.
Embodiments of the invention and features of the embodiments may be combined with each other without conflict.
Example 1
The present embodiment provides a blockchain double-chain billing method, as shown in fig. 1, including:
receiving and storing transaction real-time data sent by a light node by an accounting node used for interacting with the light node in a blockchain network, packaging the transaction real-time data received in a preset time period into transaction packaging data, and storing a timing hash value generated by the transaction packaging data as a transaction packaging block;
the transaction packaging block is broadcasted layer by layer from the accounting node interacted with the light node to the root accounting node, the timing hash value of the transaction packaging block broadcasted by the lower accounting node is calculated and stored in each level of accounting node, a corresponding timing hash pointer is generated, and the link of the lower accounting node block pointed by the timing hash pointer forms a fork-type chain structure;
and after each level of accounting node successfully receives the transaction real-time data, calculating and storing the real-time hash value of the transaction real-time data in the root accounting node and generating a corresponding real-time hash pointer, wherein the real-time hash value of all the transaction real-time data of each account is connected in series in a block form through the real-time hash pointer to form a linear blockchain, and the linear blockchain of all the accounts is stored in the root accounting node in a parallel linear blockchain structure.
In the embodiment, the transaction can be quickly and safely converted between the digital RMB and the paper money, and particularly when the digital RMB is converted into the paper RMB for carrying out the extraction at present, the digital RMB is stored in a card and then converted into paper money from the card through the conversion of a personal bank account, so that the complete transaction can be realized; furthermore, the digital RMB cannot be directly used in a third party transaction platform, and the personal bank card must be bound first, and the transaction can be realized through a bank account.
Therefore, the transaction of the embodiment can be used for taking out the digital RMB from cash through the bank terminal equipment, the purpose of directly paying with the digital RMB when the third party transaction platform consumes can be achieved, the storage burden is lightened, the risk that the centralized accounting has single-point faults is avoided, and the convenience and safety experience of people on the digital RMB in life is improved.
In this embodiment, the blockchain double-chain billing method specifically includes:
step S100: the user authorizes the accounting system, and the rules of the bank and the third party transaction platform are the preconditions for transaction;
specifically, if a user makes a transaction at a terminal device, preconditions for the transaction to be followed by the user include:
step S101: when a user carries out transactions on a third party transaction platform such as a bank terminal device or a mobile terminal device through various effective credit vouchers issued by the mobile terminal device or the bank, the user must obey the transaction rules of the bank and the third party transaction platform;
step S102: when the user exchanges cash through the mobile terminal device and carries out transaction on the third party transaction platform, the user must obey the transaction rules of the bank and the third party transaction platform and obtain effective identity security certificates.
Step S200: at the location of the light nodes in the blockchain network are terminal devices (such as mobile terminal devices or bank terminal devices, etc.), each light node represents a terminal device, and the light nodes use the network protocol (TCP/IP) to communicate with an upper billing node (also referred to as a secondary billing node);
the upper-level billing node is a billing node which interacts with the light node, the transaction real-time data is data after the transaction of each account is completed once, and the transaction package data is transaction real-time data of all accounts in a certain time interval at the light node;
the upper-level billing node interacting with the light node calculates and stores a real-time hash value of the transaction real-time data and generates a corresponding real-time hash pointer, packages the transaction real-time data in a preset time period into transaction package data, calculates and stores a timing hash value of the transaction package data and generates a corresponding timing hash pointer, and stores the timing hash value generated by the transaction package data as a transaction package block.
Step S300: the accounting node (secondary accounting node) interacted with by the light node starts to broadcast the transaction real-time data to all the upper accounting nodes on the same chain, and whether all the upper accounting nodes above the secondary accounting node successfully receive the broadcast content must be confirmed by the secondary accounting node.
Specifically:
step S301: after each time the secondary accounting node receives the transaction real-time data sent by the light node, calculating a real-time hash value of the transaction real-time data, and waiting for sending the real-time hash value to the light node; and only after the secondary accounting node confirms that the accounting nodes above the secondary account nodes all successfully receive the broadcast, the secondary accounting node immediately sends the real-time hash value of the broadcast content of the light node to the light node, and the waiting verification is completed.
The waiting verification process includes:
(1) The secondary accounting node broadcasts the transaction real-time data sent by the light node to all the upper accounting nodes which can receive the broadcast;
(2) The upper billing node which receives the broadcast returns the real-time hash value of the received transaction real-time data to the secondary billing node, compares the real-time hash value with the real-time hash value calculated by the secondary billing node according to the transaction real-time data, and if the real-time hash values sent back by all the upper billing nodes are consistent with the real-time hash value comparison at the secondary billing node, the fact that the broadcast content is successfully received by more than the secondary billing node is proved;
(3) If the comparison is inconsistent, the secondary billing node is always in the waiting process, the secondary billing node does not send the real-time hash value of the broadcast content of the received light node to the light node, and the secondary billing node broadcasts to more than two billing nodes on the chain again;
(4) If the comparison is inconsistent, the transaction cannot be completed, such as broadcasting is not performed when the network is disconnected.
Step S302: after the secondary accounting node confirms that more than two accounting nodes successfully receive the broadcast, the secondary accounting node immediately sends a real-time hash value of the broadcast content of the received light node to the light node;
the light node compares the received real-time hash value of the secondary billing node with the real-time hash value of the transaction real-time data sent by the light node;
if the comparison is consistent, the fact that all the upper-level accounting nodes successfully receive the transaction real-time data sent by the upper-level accounting nodes is confirmed by the light nodes, the transaction real-time data sent by the light nodes are successfully written into the fork chain, meanwhile, the real-time hash value of the account of the latest transaction is recorded at the root accounting node, and the consistency of the real-time hash value at the root accounting node and the transaction real-time data at the light nodes is ensured;
if the comparison is inconsistent, the light node needs to broadcast upwards again.
In this embodiment, the secondary accounting node broadcasts the transaction real-time data to the upper accounting node on the same chain in a broadcast manner, considering that the primary layer-by-layer propagation may transmit incorrect real-time data, and if the secondary accounting node does not succeed in the upward broadcasting, the transaction real-time data may have already been written into the blockchain; the waiting process is designed to ensure that the most original real-time data sent by the light node is transmitted in the whole transmission process, and that all transmissions are written into the blockchain after being accurate.
Therefore, the transaction real-time data is successfully written into the light node and the secondary accounting node of the blockchain, so that the two blockchains are simultaneously constructed by the real-time transaction data, and the characteristics of safety, reliability and convenience of the transaction are ensured, and the blockchains are specifically divided into fork-type chains and parallel linear blockchains.
Step S400: the construction process of the fork chain structure comprises the following steps:
the construction data of the fork chain is derived from transaction real-time data generated in the interaction of the light node and the upper-level accounting node of the light node, the transaction real-time data is stored in the light node and the upper-level accounting node of the light node, and the construction of the fork chain is started at the upper-level accounting node (second-level accounting node) of the light node;
starting from an accounting node interacted with the light node, broadcasting the transaction packaging block layer by layer until the accounting node is a root; the upper billing node only stores the timing hash value of the transaction packaging block broadcasted by the lower billing node and the timing hash pointer correspondingly generated, and points to the lower billing node block through the timing hash pointer, so that a fork chain structure is formed.
Specifically:
when broadcasting and reporting layer by layer, after each time the upper-level billing node receives the transaction packaging blocks of all the lower-level billing nodes, the upper-level billing node calculates and stores the corresponding timing hash value again and sends the timing hash value to the lower-level billing node, and the lower-level billing node compares the received timing hash value with the timing hash value of the transmitted transaction packaging block calculated by the lower-level billing node and judges whether the upper-level billing node accurately receives the message broadcasted by the lower-level billing node;
if the compared hash values are consistent, judging that the upper-level billing node successfully receives the transaction packaging block, and meanwhile, the corresponding data is successfully written into the block chain, and continuing broadcasting by the upper-level billing node;
if the compared hash values are inconsistent, judging that the upper-level billing node does not successfully receive the transaction packaging block broadcasted by the lower-level billing node, and re-broadcasting and uploading by the lower-level billing node until the upper-level billing node successfully receives the message broadcasted by the lower-level billing node;
the superordinate accounting nodes are pointed to their subordinate accounting nodes with timing hash pointers generated by timing hash values, and data transferred between each superordinate accounting node is successfully counted into the blockchain in this way.
Step S500: the timing hash value stored in the upper-level billing node is generated according to the transaction packaging block content sent by the lower-level billing node, a corresponding timing hash pointer is generated to point to the transaction packaging block of the lower-level billing node, the fork-type chain is supervised through the pointing of the timing hash pointer, all blocks of the fork-type chain are supervised through the timing hash value stored in the root billing node, and when data in different billing node blocks are tampered, the timing hash value at the root billing node is changed, so that the timing hash pointer is deviated.
Specifically, the timing hash values are stored as a string of strings like grapes in a link formed by time periods, and once a certain grape in a certain string is mildewed, the timing hash pointer at a certain position in the time period is deviated, so that the situation that the data is tampered can be found; and after the data is tampered, the hash value of the data cannot be corresponding, is not counted into the blockchain and is invalid, so that the fork chain structure can effectively supervise the whole data chain through the timing hash value generated by trading the packed data.
As shown in fig. 2; the A-H are all light nodes, the light nodes comprise automatic teller machines, mobile phone banking terminal equipment, banking counter terminal equipment and the like, the secondary accounting nodes take banking outlets, county branches, territory branches and the like as examples, the tertiary accounting nodes take various major branches as examples, and the root accounting nodes take the central branch as examples.
The above is a procedure for constructing the fork chain structure, and the following describes a procedure for constructing the parallel line type block chain structure. The parallel linear blockchain structure construction data is also derived from transaction real-time data generated in the interaction of the light node with its upper level billing node, the transaction real-time data being stored in the light node and its upper level billing node, the parallel linear blockchain construction data being derived from the transaction real-time data.
Step S600: dividing the real-time hash value of the transaction real-time data into account numbers after the transaction real-time data are received by the root accounting node, taking each account as a unit after the root accounting node receives the transaction real-time data, connecting the real-time hash values of all the transaction real-time data of each account in series in a block form through real-time hash pointers to form a linear blockchain, and storing a plurality of accounts in the root accounting node in a parallel linear blockchain structure;
that is, each account generates a block once every transaction, each block contains the account real-time hash value of the current transaction, the real-time hash value of the block of the previous real-time transaction of each account and the generated corresponding real-time hash pointer, and the block is pointed to the previous block through the real-time hash pointer, so that a linear block chain is formed;
then, when the light node makes a transaction, the root accounting node sends the real-time hash value of the account nearest to the corresponding account to the light node, so that the light node performs hash value comparison, and the transaction is performed when the comparison is consistent.
Specifically: as shown in fig. 3, the first, second and third accounts are accounts, each account is taken as a unit, from the initial creation century block, the linear blockchain data of each account stores the corresponding real-time hash pointer generated by the real-time hash value of the real-time block of the previous transaction of each account in the latter block, and points to the former block to form a linear blockchain, the initial real-time block is the creation century block, the latest real-time block is the nearest block, the parallel linear blockchain structure stores the real-time hash value of each transaction of all accounts, and when the account is transacted again, the light node asks for the nearest real-time hash value of the account to the root node, compares the nearest real-time hash value with the real-time hash value calculated by the light node according to the information data provided by the customer, and if the comparison is consistent, the account information is safe and trustable, and the transaction can be carried out; if the information of the user is inconsistent, the information is unsafe and untrustworthy, the transaction is terminated, and the supervision of the account transaction is realized in real time.
For example, when a user goes to a G place to conduct a transaction across rows, the G place can send a hash value verification request to an upper-level billing node, a root billing node (central row) can send the last hash value of the account to the G place, the G place calculates the hash value of the account and then compares the hash value with the hash value sent by the central row, and if the comparison results are consistent, the account can conduct the next transaction procedure; if the comparison is inconsistent, the transaction is terminated.
In this embodiment, the fork chain is written with transaction real-time data at the light node, the secondary accounting node is written with real-time transaction data (for backup) and a timing hash value of the transaction package data (the secondary accounting node does not write in the fork chain and does not write in the linear blockchain although the secondary accounting node contains the real-time hash value of the transaction real-time data), the tertiary and higher accounting nodes calculate and store the corresponding real-time hash value of the secondary accounting node although the tertiary and higher accounting nodes receive the transaction real-time data, and the data is only one element in the parallel linear blockchain at the root accounting node but does not belong to the parallel linear blockchain of the fork chain and the root node, and has no relation to the system), but the transaction real-time data and the corresponding real-time hash value of the transaction package data are not written in the fork chain, and the tertiary and higher accounting nodes are written with the timing hash value of the lower accounting node block and the corresponding timing hash pointer.
In this embodiment, except for the light node and the accounting node interacting with the light node, each of the remaining accounting nodes only calculates and stores the real-time hash value of the transaction real-time data and the timing hash value of the transaction packing block of the accounting node below the real-time hash value, and all the accounting nodes store the real-time hash value of the transaction real-time data and the timing hash value of the transaction packing block.
Specifically, the light node block content is transaction real-time data of the digital RMB, the second node block content not only comprises transaction real-time data and transaction package data sent by the light node and back up, but also comprises a real-time hash value corresponding to the transaction real-time data sent by the light node, the third node block content comprises a real-time hash value of the transaction real-time data sent by the second node and a timing hash value of the transaction package block sent by the second node, and the fourth node block content comprises a real-time hash value of the transaction real-time data sent by the second node and a timing hash value of the transaction package block sent by the third node, and the like until the root accounting node is obtained.
It should be noted that, the transaction real-time data and the timing hash value of the transaction package block are broadcast separately, although the real-time hash value of the transaction real-time data is stored in each node, the cross-type chain does not include the hash value of the transaction real-time data, the transaction real-time data does not exist in the form of the cross-type chain, only the timing hash values of the transaction package block and the transaction package block are reflected in the cross-type chain, and the real-time hash value of the transaction real-time data is stored into a linear blockchain in account unit only until the root accounting node.
It should be noted that, all the above data are obtained based on compliance with laws and regulations and user consent, and the data are legally applied.
Example 2
The present embodiment provides a blockchain double-chain billing system, comprising:
the system comprises a receiving module, a transaction packing block and a timing hash value generation module, wherein the receiving module is configured to receive and store transaction real-time data sent by a light node by an accounting node used for interacting with the light node in a blockchain network, pack the transaction real-time data received in a preset time period into transaction packing data, and store the timing hash value generated by the transaction packing data into the transaction packing block;
the fork chain construction module is configured to report the transaction packaging block layer by layer from the accounting node interacted with the light node to the root accounting node, calculate and store the timing hash value of the transaction packaging block broadcasted by the lower accounting node in each level of accounting node and generate a corresponding timing hash pointer, and form a fork chain structure by the links of the lower accounting node blocks pointed to by the timing hash pointer;
the parallel linear blockchain construction module is configured to broadcast transaction real-time data by the accounting nodes interacted with the light nodes, calculates and stores real-time hash values of the transaction real-time data in the root accounting node and generates corresponding real-time hash pointers after each level of accounting nodes successfully receive the transaction real-time data, and uses each account as a unit, and connects the real-time hash values of all the transaction real-time data of each account in series in a block form through the real-time hash pointers to form a linear blockchain, and stores the linear blockchains of all the accounts in the root accounting node in a parallel linear blockchain structure.
It should be noted that the above modules correspond to the steps described in embodiment 1, and the above modules are the same as examples and application scenarios implemented by the corresponding steps, but are not limited to those disclosed in embodiment 1. It should be noted that the modules described above may be implemented as part of a system in a computer system, such as a set of computer-executable instructions.
In further embodiments, there is also provided:
an electronic device comprising a memory and a processor and computer instructions stored on the memory and running on the processor, which when executed by the processor, perform the method described in embodiment 1. For brevity, the description is omitted here.
It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general purpose processors, digital signal processors DSP, application specific integrated circuits ASIC, off-the-shelf programmable gate array FPGA or other programmable logic device, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may include read only memory and random access memory and provide instructions and data to the processor, and a portion of the memory may also include non-volatile random access memory. For example, the memory may also store information of the device type.
A computer readable storage medium storing computer instructions which, when executed by a processor, perform the method described in embodiment 1.
The method in embodiment 1 may be directly embodied as a hardware processor executing or executed with a combination of hardware and software modules in the processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method. To avoid repetition, a detailed description is not provided herein.
Those of ordinary skill in the art will appreciate that the elements of the various examples described in connection with the present embodiments, i.e., the algorithm steps, can be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
While the foregoing description of the embodiments of the present invention has been presented in conjunction with the drawings, it should be understood that it is not intended to limit the scope of the invention, but rather, it is intended to cover all modifications or variations within the scope of the invention as defined by the claims of the present invention.

Claims (6)

1. A blockchain double-chain billing method, comprising:
receiving and storing transaction real-time data sent by a light node by an accounting node used for interacting with the light node in a blockchain network, packaging the transaction real-time data received in a preset time period into transaction packaging data, and storing a timing hash value generated by the transaction packaging data as a transaction packaging block;
the transaction packaging block is broadcasted layer by layer from the accounting node interacted with the light node to the root accounting node, the timing hash value of the transaction packaging block broadcasted by the lower accounting node is calculated and stored in each level of accounting node, a corresponding timing hash pointer is generated, and the link of the lower accounting node block pointed by the timing hash pointer forms a fork-type chain structure;
in the layer-by-layer broadcasting process, after each time the upper billing node receives the transaction packaging block broadcasted by the lower billing node, the upper billing node calculates the timing hash value of the transaction packaging block and sends the timing hash value to the lower billing node so that the lower billing node compares the received timing hash value with the timing hash value of the transmitted transaction packaging block calculated by the upper billing node, and if the comparison is consistent, the upper billing node successfully receives the transaction packaging block broadcasted by the lower billing node; if the comparison is inconsistent, the lower-level billing node rebroadcasts and uploads;
in the fork chain structure, the corresponding timing hash pointer generated by the timing hash value stored in the upper-level billing node monitors the fork chain by pointing to the lower-level billing node block, the timing hash value stored in the root billing node monitors all blocks of the fork chain structure, and when the data in different billing node blocks are changed, the timing hash value at the root billing node is changed, so that the timing hash pointer is deviated;
the accounting node interacted with the light node broadcasts the transaction real-time data, and after each level of accounting node successfully receives the transaction real-time data, calculates and stores the real-time hash value of the transaction real-time data in the root accounting node and generates a corresponding real-time hash pointer;
each block of the linear block chain comprises a real-time hash value of the real-time data of the current transaction, a real-time hash value of a real-time block of the previous transaction and a corresponding real-time hash pointer, and the real-time hash pointer points to the previous block, so that the linear block chain is formed;
the verification mode that the accounting node successfully receives the transaction real-time data is as follows: the accounting node interacted with the light node calculates a real-time hash value of the transaction real-time data, the accounting node interacted with the light node broadcasts the transaction real-time data to more than two levels of accounting nodes, the more than two levels of accounting nodes send the real-time hash value of the received broadcast content to the accounting node interacted with the light node after receiving the broadcast, the accounting node interacted with the light node compares the real-time hash value with the real-time hash value calculated by the accounting node after receiving the real-time hash value, if the comparison is consistent, the more than two levels of accounting nodes are proved to be successfully broadcast, if the comparison is inconsistent, the accounting node interacted with the light node rebroadcasts.
2. The blockchain double-chain billing method of claim 1 wherein the billing node interacting with the light node broadcasts the transaction real-time data to the more than two-level billing node, the billing node interacting with the light node calculates a real-time hash value of the transaction real-time data and waits for the transaction real-time data to be transmitted to the light node, the calculated real-time hash value is transmitted to the light node only after the billing node interacting with the light node determines that the more than two-level billing node has successfully received the transaction real-time data, the light node compares the received real-time hash value with the real-time hash value of the transaction real-time data transmitted by the light node, if the comparison is consistent, the transaction real-time data is successfully written into the blockchain, and if the comparison is inconsistent, the light node rebroadcasts.
3. The blockchain double-chain billing method of claim 1 wherein the root billing node transmits a real-time hash value of the nearest block of the corresponding account to the light node when the light node is transacting, so that the light node performs the comparison and the transaction is performed when the comparison is consistent.
4. A blockchain double-chain billing system for performing the blockchain double-chain billing method of any of claims 1-3, comprising:
the system comprises a receiving module, a transaction packing block and a timing hash value generation module, wherein the receiving module is configured to receive and store transaction real-time data sent by a light node by an accounting node used for interacting with the light node in a blockchain network, pack the transaction real-time data received in a preset time period into transaction packing data, and store the timing hash value generated by the transaction packing data into the transaction packing block;
the fork chain construction module is configured to report the transaction packaging block layer by layer from the accounting node interacted with the light node to the root accounting node, calculate and store the timing hash value of the transaction packaging block broadcasted by the lower accounting node in each level of accounting node and generate a corresponding timing hash pointer, and form a fork chain structure by the links of the lower accounting node blocks pointed to by the timing hash pointer;
the parallel linear blockchain construction module is configured to broadcast transaction real-time data by the accounting nodes interacted with the light nodes, calculates and stores real-time hash values of the transaction real-time data in the root accounting node and generates corresponding real-time hash pointers after each level of accounting nodes successfully receive the transaction real-time data, and uses each account as a unit, and connects the real-time hash values of all the transaction real-time data of each account in series in a block form through the real-time hash pointers to form a linear blockchain, and stores the linear blockchains of all the accounts in the root accounting node in a parallel linear blockchain structure.
5. An electronic device comprising a memory and a processor and computer instructions stored on the memory and running on the processor, which when executed by the processor, perform the method of any one of claims 1-3.
6. A computer readable storage medium storing computer instructions which, when executed by a processor, perform the method of any of claims 1-3.
CN202311393500.1A 2023-10-26 2023-10-26 Block chain double-chain accounting method, system, equipment and medium Active CN117132279B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311393500.1A CN117132279B (en) 2023-10-26 2023-10-26 Block chain double-chain accounting method, system, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311393500.1A CN117132279B (en) 2023-10-26 2023-10-26 Block chain double-chain accounting method, system, equipment and medium

Publications (2)

Publication Number Publication Date
CN117132279A CN117132279A (en) 2023-11-28
CN117132279B true CN117132279B (en) 2024-01-23

Family

ID=88863125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311393500.1A Active CN117132279B (en) 2023-10-26 2023-10-26 Block chain double-chain accounting method, system, equipment and medium

Country Status (1)

Country Link
CN (1) CN117132279B (en)

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109493221A (en) * 2018-10-26 2019-03-19 全链通有限公司 Transaction record time slot scrambling, equipment, network and storage medium in block chain
CN109658099A (en) * 2018-12-20 2019-04-19 莆田市烛火信息技术有限公司 A kind of account book bookkeeping methods based on block chain
CN110223174A (en) * 2019-05-23 2019-09-10 北京清红微谷技术开发有限责任公司 Block transaction bookkeeping methods and system, data processing terminal, block catenary system
CN111858751A (en) * 2020-06-29 2020-10-30 深圳壹账通智能科技有限公司 Data storage method and device based on block chain
WO2020258848A1 (en) * 2019-06-28 2020-12-30 创新先进技术有限公司 Method and apparatus for cross-chain transmission of resources
CN112380149A (en) * 2021-01-18 2021-02-19 腾讯科技(深圳)有限公司 Data processing method, device, equipment and medium based on node memory
CN113114759A (en) * 2021-04-09 2021-07-13 杭州链网科技有限公司 Chain-crossing method and system for realizing multi-chain intercommunication
CN113420083A (en) * 2021-06-02 2021-09-21 湖南大学 Heterogeneous parallel block chain structure with expandable distributed account book
CN113704353A (en) * 2021-08-30 2021-11-26 西安交通大学 Block chain credit investigation method integrating information chain and privacy chain
CN113962808A (en) * 2021-10-25 2022-01-21 杭州世平信息科技有限公司 Data security management method and system
CN114240433A (en) * 2021-12-06 2022-03-25 中国工商银行股份有限公司 Data processing method and system based on block chain
CN115292311A (en) * 2022-07-13 2022-11-04 国网山东省电力公司德州供电公司 Energy data management-oriented block chain data storage consensus method and system
CN115358856A (en) * 2022-08-24 2022-11-18 国网山东省电力公司营销服务中心(计量中心) Block chain-based power transaction data storage and tracing method and system
CN115760422A (en) * 2022-12-01 2023-03-07 中国电力科学研究院有限公司 Electric power market transaction system and method based on block chain technology
CN116938523A (en) * 2023-05-25 2023-10-24 深圳市树轮科技有限公司 Blockchain system, operating method, electronic device and storage medium

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109493221A (en) * 2018-10-26 2019-03-19 全链通有限公司 Transaction record time slot scrambling, equipment, network and storage medium in block chain
CN109658099A (en) * 2018-12-20 2019-04-19 莆田市烛火信息技术有限公司 A kind of account book bookkeeping methods based on block chain
CN110223174A (en) * 2019-05-23 2019-09-10 北京清红微谷技术开发有限责任公司 Block transaction bookkeeping methods and system, data processing terminal, block catenary system
WO2020258848A1 (en) * 2019-06-28 2020-12-30 创新先进技术有限公司 Method and apparatus for cross-chain transmission of resources
CN111858751A (en) * 2020-06-29 2020-10-30 深圳壹账通智能科技有限公司 Data storage method and device based on block chain
CN112380149A (en) * 2021-01-18 2021-02-19 腾讯科技(深圳)有限公司 Data processing method, device, equipment and medium based on node memory
CN113114759A (en) * 2021-04-09 2021-07-13 杭州链网科技有限公司 Chain-crossing method and system for realizing multi-chain intercommunication
CN113420083A (en) * 2021-06-02 2021-09-21 湖南大学 Heterogeneous parallel block chain structure with expandable distributed account book
CN113704353A (en) * 2021-08-30 2021-11-26 西安交通大学 Block chain credit investigation method integrating information chain and privacy chain
CN113962808A (en) * 2021-10-25 2022-01-21 杭州世平信息科技有限公司 Data security management method and system
CN114240433A (en) * 2021-12-06 2022-03-25 中国工商银行股份有限公司 Data processing method and system based on block chain
CN115292311A (en) * 2022-07-13 2022-11-04 国网山东省电力公司德州供电公司 Energy data management-oriented block chain data storage consensus method and system
CN115358856A (en) * 2022-08-24 2022-11-18 国网山东省电力公司营销服务中心(计量中心) Block chain-based power transaction data storage and tracing method and system
CN115760422A (en) * 2022-12-01 2023-03-07 中国电力科学研究院有限公司 Electric power market transaction system and method based on block chain technology
CN116938523A (en) * 2023-05-25 2023-10-24 深圳市树轮科技有限公司 Blockchain system, operating method, electronic device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
蔡维德 ; 郁莲 ; 袁波 ; 邓佑权 ; 李琪 ; 郭斌 ; .面向大数据的区块链在清算系统中的应用.大数据.2018,(01),第22-35页. *

Also Published As

Publication number Publication date
CN117132279A (en) 2023-11-28

Similar Documents

Publication Publication Date Title
CN111681003B (en) Resource cross-chain transfer method and device, computer equipment and storage medium
US20210314397A1 (en) Fund conversion between blockchains
US20190295049A1 (en) System and method for secure transaction verification in a distributed ledger system
CN108256859B (en) Financial product transaction consensus method, node and system based on block chain
US10521861B1 (en) Decentralized asset custody and clearing platform system
CN109472588A (en) A kind of offline electronic payment method, apparatus, equipment and storage medium based on block chain
CN110599177A (en) Transaction verification method and related equipment
CN110458709B (en) Resource transfer information transmission method and device, storage medium and electronic device
Zhu et al. Hybrid blockchain design for privacy preserving crowdsourcing platform
CN111585767B (en) Data exchange method and device for main chain and side chain
CN109816361B (en) Block chain signature transfer method without mineral expense
CN111861477A (en) Block chain-based post-transaction data processing method and device and computer equipment
JPWO2019235198A1 (en) Payment system, payment method, user device, payment program
CN109658099B (en) Account book accounting method based on block chain
CN111738724B (en) Cross-border resource transfer authenticity auditing method and device, and electronic equipment
CN111414434B (en) Block chain-based data transaction management network, transaction device and storage medium
CN111507851A (en) Block chain-based medical insurance claim settlement processing method, device and system and storage medium
CN111127011A (en) Transaction method, system and computer-readable storage medium for checking account based on block chain
CN114006920A (en) Geological disaster emergency command system based on alliance chain
CN117132279B (en) Block chain double-chain accounting method, system, equipment and medium
WO2020199703A1 (en) Method, device and system for blockchain transaction
CN113128998B (en) Service processing method, device and system of block chain system
CN114329550A (en) Block chain down-link transaction method, device, equipment and storage medium
CN114140118A (en) Distributed accounting method and device and computer readable medium
CN113628050A (en) Digital RMB delivery method, system, program product and storage medium

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
GR01 Patent grant
GR01 Patent grant