CN108984645B - Block chain processing method, device, equipment and storage medium - Google Patents

Block chain processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN108984645B
CN108984645B CN201810660382.9A CN201810660382A CN108984645B CN 108984645 B CN108984645 B CN 108984645B CN 201810660382 A CN201810660382 A CN 201810660382A CN 108984645 B CN108984645 B CN 108984645B
Authority
CN
China
Prior art keywords
side chain
block
chain
request
node
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
CN201810660382.9A
Other languages
Chinese (zh)
Other versions
CN108984645A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810660382.9A priority Critical patent/CN108984645B/en
Publication of CN108984645A publication Critical patent/CN108984645A/en
Application granted granted Critical
Publication of CN108984645B publication Critical patent/CN108984645B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The embodiment of the invention discloses a block chain processing method, a block chain processing device, block chain processing equipment and a storage medium. Wherein the method is performed by a node in a blockchain system, the method comprising: responding a side chain creation request initiated by a side chain initiator in a block chain system to generate a side chain processing instruction, and transmitting the side chain processing instruction in the block chain system, wherein the side chain processing instruction is used for instructing a side chain block generation node to write a side chain transaction request into a block side chain; and responding to a side chain merging request transmitted by the side chain block generation node, and writing the transaction data of the tail block in the block side chain into the main chain of the block. The technical scheme provided by the embodiment of the invention can independently process irrelevant and batched transaction requests to form the block main chain and the block side chain, and the block side chain finally returns to the block main chain, thereby simplifying the processing complexity of the transaction requests of different batches and improving the efficiency of the whole block chain system for processing the transaction requests.

Description

Block chain processing method, device, equipment and storage medium
Technical Field
Embodiments of the present invention relate to the field of block chain technologies, and in particular, to a block chain processing method, apparatus, device, and storage medium.
Background
Transaction requests generated in the blockchain network are generally processed by the block generation nodes in a unified manner and are packaged to form blocks. The block generation nodes are not differentiated when processing the transaction requests, but all process and add to the blocks.
For the prior art that proposes the side chain concept, a possible way is to establish another block chain, for example, different currencies, different transaction systems, etc., for a subsequent completely unrelated transaction request, but this is equivalent to a certain block of the original block chain as a starting point, and another block chain is established, which is two parallel block chains with the original block chain and is not merged together again. It is a concept of a pseudo side chain.
The existing block chain technology does not provide a real side chain mode and a scheme that short-term batch transaction requests can be processed independently under the same transaction processing system.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a device, and a storage medium for processing a blockchain, which simplify processing complexity of transaction requests in different batches and improve efficiency of processing transaction requests in a whole blockchain system.
In a first aspect, an embodiment of the present invention provides a method for processing a blockchain, where the method is performed by a node in a blockchain system, and the method includes:
responding a side chain creation request initiated by a side chain initiator in a block chain system to generate a side chain processing instruction, and transmitting the side chain processing instruction in the block chain system, wherein the side chain processing instruction is used for instructing a side chain block generation node to write a side chain transaction request into a block side chain;
and responding to a side chain merging request transmitted by the side chain block generation node, and writing the transaction data of the tail block in the block side chain into the main chain of the block.
In a second aspect, an embodiment of the present invention further provides a method for processing a blockchain, where the method is performed by a node in a blockchain system, and the method includes:
writing processing data of a side chain transaction request into a side chain of a block according to a side chain processing instruction transmitted by a main chain block generation node in the block chain system, wherein the side chain processing instruction is generated according to a side chain creation request initiated by a side chain initiator in the block chain system;
if the end of the side chain event is detected, transmitting a block side chain merging request to the main chain block generating node, wherein the block side chain merging request is used for instructing the main chain block generating node to write the transaction data of the tail block in the block side chain into the main chain of the block.
In a third aspect, an embodiment of the present invention further provides a method for processing a blockchain, where the method is performed by a node in a blockchain system, and the method includes:
initiating a side chain creation request;
transmitting the side chain creation request in the blockchain system, so that a main chain block generation node in the blockchain system performs the following operations: responding to a side chain creation request initiated by the side chain initiator to generate a side chain processing instruction, and transmitting the side chain processing instruction in a block chain system, wherein the side chain processing instruction is used for instructing a side chain block generation node to write a side chain transaction request into a block side chain; and responding to a side chain merging request transmitted by the side chain block generation node, and writing the transaction data of the tail block in the block side chain into the main chain of the block.
In a fourth aspect, an embodiment of the present invention further provides a device for processing a blockchain, where the device is configured in a node in a blockchain system, and the device includes:
the processing instruction generating module is used for responding to a side chain creating request initiated by a side chain initiator in the block chain system to generate a side chain processing instruction, wherein the side chain processing instruction is used for instructing a side chain block generating node to write a side chain transaction request into a block side chain;
the processing instruction sending module is used for transmitting the side chain processing instruction in the block chain system;
and the tail data writing module is used for responding to a side chain merging request transmitted by the side chain block generation node and writing the transaction data of the tail block in the block side chain into the block main chain.
In a fifth aspect, an embodiment of the present invention further provides a device for processing a blockchain, where the device is configured in a node in a blockchain system, and the device includes:
a processing data writing module, configured to write processing data of the side-chain transaction request into a side chain of a block according to a side-chain processing instruction transmitted by a main-chain block generation node in a block chain system, where the side-chain processing instruction is generated according to a side-chain creation request initiated by a side-chain initiator in the block chain system;
a merge request sending module, configured to transmit a block side chain merge request to the main chain block generation node if a side chain event is detected to end, where the block side chain merge request is used to instruct the main chain block generation node to write the transaction data of the tail block in the block side chain into the block main chain.
In a sixth aspect, an embodiment of the present invention further provides a device for processing a blockchain, where the device is configured in a node in a blockchain system, and the device includes:
a creation request initiating module for initiating a side chain creation request;
a creation request transmission module, configured to transmit the side chain creation request in the blockchain system, so that a main-chain blockgeneration node in the blockchain system performs the following operations: responding to a side chain creation request initiated by the side chain initiator to generate a side chain processing instruction, and transmitting the side chain processing instruction in a block chain system, wherein the side chain processing instruction is used for instructing a side chain block generation node to write a side chain transaction request into a block side chain; and responding to a side chain merging request transmitted by the side chain block generation node, and writing the transaction data of the tail block in the block side chain into the main chain of the block.
In a seventh aspect, an embodiment of the present invention further provides an apparatus, where the apparatus includes:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement any of the blockchain processing methods of the first aspect, implement any of the blockchain processing methods of the second aspect, or implement any of the blockchain processing methods of the third aspect.
In an eighth aspect, an embodiment of the present invention further provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the block chain processing method described in any of the first aspects, implements the block chain processing method described in any of the second aspects, or implements the block chain processing method described in any of the third aspects.
According to the technical scheme provided by the embodiment of the invention, the main chain block generation node can respond and generate a side chain processing instruction when a side chain initiator initiates a side chain creation request, and transmits the side chain processing instruction in a block chain system to indicate the side chain block generation node to write a side chain transaction request into a block side chain; and when a side chain merging request transmitted by a side chain block generation node is received, the transaction data of the tail block in the block side chain is written into the block main chain. The method can process irrelevant and batched transaction requests independently to form the block main chain and the block side chain, and the block side chain can return to the block main chain finally, so that the processing complexity of the transaction requests in different batches is simplified, and the efficiency of the whole block chain system for processing the transaction requests is improved.
Drawings
Fig. 1A is a flowchart of a block chain processing method according to an embodiment of the present invention;
FIG. 1B is a block chain structure according to an embodiment of the present invention;
fig. 2 is a flowchart of a block chain processing method according to a second embodiment of the present invention;
fig. 3 is a flowchart of a block chain processing method according to a third embodiment of the present invention;
fig. 4 is a flowchart of a block chain processing method according to a fourth embodiment of the present invention;
fig. 5 is a block diagram of a block chain processing apparatus according to a fifth embodiment of the present invention;
fig. 6 is a block diagram of a block chain processing apparatus according to a sixth embodiment of the present invention;
fig. 7 is a block diagram of a block chain processing apparatus according to a seventh embodiment of the present invention;
fig. 8 is a schematic structural diagram of an apparatus provided in the eighth embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the embodiments of the invention and that no limitation of the invention is intended. It should be further noted that, for convenience of description, only some structures, not all structures, relating to the embodiments of the present invention are shown in the drawings.
Example one
Fig. 1A is a flowchart of a block chain processing method according to an embodiment of the present invention, which provides a real side chain mode based on a block chain technique for solving the problems that the processing complexity of the transaction requests of the existing block chain system is high and the provided pseudo side chain mode cannot independently process short-term batch transaction requests in the same transaction processing system. The applicable blockchain may be a public chain, a federation chain, or a private chain.
The whole set of block chain processing method is executed by the interaction and cooperation of the main chain block generation node, the side chain block generation node and the node to which the side chain initiator belongs, and independently participates in the operation process of the block chain system to form a block chain consisting of a block main chain and at least one block side chain. For example, referring to fig. 1B, the block chain is composed of a block main chain composed of one block link and two block side chains composed of circle links, and the block side chains can eventually return to the block main chain. It should be noted that the transaction request processing procedure of the block side chain and the transaction request processing procedure of the block main chain are independent from each other, and the side chain block generation node may be a node in the block chain system independent of the main chain block generation node, or may be a main chain block generation node.
The method can be executed by the blockchain processing device provided by the embodiment of the invention, and the device can be realized in a software and/or hardware mode and can be integrated in a computing device bearing the blockchain system nodes. Referring to fig. 1A, the method specifically includes:
and S110, responding to a side chain creation request initiated by a side chain initiator in the block chain system to generate a side chain processing instruction, and transmitting the side chain processing instruction in the block chain system, wherein the side chain processing instruction is used for instructing a side chain block generation node to write a side chain transaction request into a block side chain.
Wherein, the side chain initiator is a party with independent event creation side chain requirement, such as a common platform; independent events refer to batch transaction requests that are unrelated or not related to the transaction requests processed by the main chain under the same transaction processing system. Correspondingly, a side chain corresponds to a processing dataset that is processed independently by multiple transaction requests attributed to independent events. For example, in a blockchain of a platform website, a transaction request occurs for users on the platform to transfer money to each other for transaction, and a transaction request also occurs for the platform to send a reward money to the users. If the platform plans to send the large amount of bonus to the user according to a certain strategy, a transaction request of a large amount of bonus is generated, and the transaction request of the bonus has no necessary relation with the normal transaction request of the user, so the transaction request of the bonus can be used as an independent event. The platform is used as a side chain initiator, and a side chain creation request is sent to the block chain system through the node to which the platform belongs.
The side chain creation request is a request sent to the main chain block generation node by the node to which the side chain initiator belongs when a plurality of transaction requests belonging to independent events need to be processed by the side chain initiator. Optionally, the side chain creation request corresponds to an intelligent contract, which may include: the side chain transaction request processing method comprises the following steps of identifying a node to which a side chain initiator belongs, marking a side chain transaction request, ending conditions of the side chain, a rule algorithm which is merged into a main chain when the side chain is ended, a consensus mechanism for selecting block generation nodes in the side chain, the income amount which needs to be paid to the block generation nodes for executing the side chain transaction request processing and the like. The node identification of the side chain initiator can be an ID, a public key or a private key of the node; the identifier of the side chain transaction request refers to an identifier for uniquely determining a type of transaction request to be processed by the side chain, and may be an identifier of the side chain, or an identifier of a node to which the side chain initiator belongs. Specifically, the side-chain transaction request in the block side-chain can be determined according to the identifier of the side-chain transaction request.
The side chain processing instruction is generated by the main chain block generation node according to a side chain creation request initiated by a side chain initiator and used for instructing the side chain block generation node to write a side chain transaction request into a block side chain.
The side-chain transaction request is a transaction request independent from the main-chain transaction request, and optionally, the side-chain transaction request may be a transaction request initiated by a side-chain initiator; or a transaction request with a sidechain attribute included in the sidechain creation request; the attribute of the side chain is used to indicate the transaction to be processed by the side chain, and may be a flag of the side chain, such as ID or name. Illustratively, different sidechain attributes correspond to different sidechain transaction requests; the transaction requests handled by different sidechains differ.
It should be noted that, in this embodiment, the interaction between the side chain initiator and the main chain block generation node is realized by the interaction between the node to which the side chain initiator belongs and the main chain block generation node, and the nodes to which different side chain initiators belong are different. The creation of the sidechain can be performed at any time, and therefore the creation of the sidechain can be initiated by any node having the requirement of creating the sidechain; and a plurality of side chains can be established at the same time in the block chain system, namely, a plurality of nodes can initiate the establishment of different side chains at the same time.
Optionally, in order to ensure that each side chain can be performed in order to improve the efficiency of the whole block chain system, before each side chain block generation node writes a side chain transaction request into a block side chain, it is first determined whether the received transaction request is a transaction request with a side chain attribute included in a corresponding side chain creation request, or a transaction request sent by a node to which a side chain initiator included in the side chain creation request belongs; if any one of the conditions is satisfied, the transaction request is determined to be the side-chain transaction request, and the side-chain transaction request is written into the block side chain.
Specifically, after a main chain block generation node receives a side chain creation request sent by a side chain initiator in a block chain system through a node to which the side chain initiator belongs, the side chain creation request is verified according to a side chain creation consensus stored in the block chain system; if the side chain creation rule is met, generating a side chain processing instruction according to a side chain creation request initiated by a side chain initiator, and transmitting the side chain processing instruction to a block chain system so that a side chain block generation node executes creation of a side chain according to the side chain creation rule; and meanwhile, the side chain processing instruction is used as a transaction request to be processed and written into the current block, so that the position of the side chain can be quickly found in the subsequent query.
S120, in response to the side chain merging request transmitted by the side chain block generation node, writing the transaction data of the tail block in the side chain block into the main chain block.
The side chain merging request is a merging request sent by the side chain block generation node to the main chain block generation node when the side chain transaction request processing is completed, and is used for indicating the main chain block generation node to merge the side chain to the main chain according to the merging rule of the side chain and the main chain. Optionally, the side-chain merge request may include: side chain identification and side chain tail block data, etc.
For example, writing the transaction data of the tail block in the side chain of the block into the main chain of the block may include: and writing the transaction data of the tail block in the block side chain into the main chain of the block by adopting a side chain merging algorithm included in the side chain creating request. The side chain merging algorithm is a rule that a side chain is merged into a main chain in advance. Specifically, after the main chain block generation node receives the merge request sent by the side chain block generation node, the transaction data in the side chain end block included in the merge request is processed as the transaction request, and new transaction data is formed and written into the main chain of the block.
If the side-chain block generation node is the main-chain block generation node, the processed side-chain tail block data can be directly written into the main-chain block, and the side-chain tail block data does not need to be processed, so that the processing efficiency can be improved.
In addition, if there is only one block in the side chain of the block, the side chain corresponds to a processing data set in which a plurality of transaction requests belonging to independent events are subjected to secondary processing, and the processing efficiency is not different. Thus, illustratively, at least two blocks should be included in the block side chain.
It is emphasized that since the processing of the side chain blocks is parallel to the processing of the main chain blocks, the side chain blocks are merged to the main chain from the beginning to the end, and the number of the generated side chain blocks is the same as the number of the blocks of the main chain in the whole time period, for example, as shown in fig. 1B.
According to the technical scheme provided by the embodiment of the invention, the main chain block generation node can respond and generate a side chain processing instruction when a side chain initiator initiates a side chain creation request, and transmits the side chain processing instruction in a block chain system to indicate the side chain block generation node to write a side chain transaction request into a block side chain; and when a side chain merging request transmitted by a side chain block generation node is received, the transaction data of the tail block in the block side chain is written into the block main chain. The method can process irrelevant and batched transaction requests independently to form the block main chain and the block side chain, and the block side chain can return to the block main chain finally, so that the processing complexity of the transaction requests in different batches is simplified, and the efficiency of the whole block chain system for processing the transaction requests is improved.
For example, generating a sidechain processing instruction in response to a sidechain creation request initiated by a sidechain initiator in the blockchain system may include: responding to a side chain creation request initiated by any party in the block chain system, deducting the freezing proof of the party, writing a deducting result into a block main chain, taking the party as a side chain initiator, and generating a side chain processing instruction initiated by the side chain initiator.
The freeze proof may be a digital currency or Token, which may be used to circulate through the blockchain system, and a means for awarding or penalizing nodes in the blockchain system.
Specifically, after the main chain block generation node receives a side chain creation request initiated by any initiator in the block chain system, the corresponding freezing proof of the side chain initiator is deducted according to the income amount which is provided in the side chain creation request and needs to be paid to the block generation node executing the side chain transaction request processing, and the deduction result is written into the main chain block as the transaction request to be used as the basis for subsequent inquiry or proof. Meanwhile, the main chain block generation node takes the side chain creation request as a side chain initiator, and generates a corresponding side chain processing instruction according to the side chain creation request transmitted by the side chain initiator.
To facilitate the side chain initiator to query the deduction result, the example that the main chain block generating node writes the deduction result of the side chain initiator into the main chain of the block may further include: the block address at which the deduction result is stored in the block main chain is fed back to the side chain initiator.
For example, after the main chain block generation node writes the deduction result of the side chain initiator into the main chain of the block, the method may further include: if the freezing proof provided by the side chain initiator is not deducted, the main chain block generation node feeds back the residual freezing proof and deduction result to the side chain initiator.
Example two
Fig. 2 is a flowchart of a block chain processing method according to a second embodiment of the present invention, in which a main chain block generating node, a side chain block generating node, and a side chain initiator belong to nodes that are executed in an interactive manner. The scheme of the embodiment of the present invention is applied to a side-chain block generation node in a block chain system, and the method may be executed by the block chain processing apparatus provided in the embodiment of the present invention, and the apparatus may be implemented in a software and/or hardware manner, and may be integrated in a computing device carrying the block chain system node. Referring to fig. 2, the method specifically includes:
s210, writing the processing data of the side-chain transaction request into the side chain of the block according to the side-chain processing command transmitted from the main-chain block generating node in the block chain system.
The side chain processing instruction is generated according to a side chain creation request initiated by a side chain initiator in the block chain system.
Specifically, after the side-chain block generating node receives the side-chain processing instruction transmitted by the main-chain block generating node, the side-chain transaction request is determined and acquired according to the side-chain processing instruction, the side-chain transaction request is subjected to processing such as information conversion, format adjustment or code running, and the processed data is stored in the block side chain.
Because a plurality of side chains can be established at the same time, in order to ensure that each side chain can be performed in order to improve the efficiency of the whole block chain system, before each side chain block generation node writes a side chain transaction request into a block side chain, it is necessary to determine whether the transaction request received by itself is a transaction to be processed by the side chain.
Before writing the processing data of the side-chain transaction request into the block side chain, the exemplary method may further include: determining a transaction request initiated by a side chain initiator as a side chain transaction request; alternatively, a transaction request having a sidechain attribute included in the sidechain creation request is determined as a sidechain transaction request.
Specifically, the side-chain block generating node may determine, according to a side-chain attribute included in the received side-chain creation request, a transaction request that satisfies the side-chain attribute in the received transaction requests as a side-chain transaction request, and discard the side-chain transaction request unsatisfied with the side-chain attribute; or screening and determining the side chain transaction request from the received transaction requests according to the identification of the node to which the side chain initiator initiating the side chain creation request belongs.
For example, before writing the processing data of the side-chain transaction request into the side-chain of the block, the side-chain block generating node may further include: the side chain block generation right is obtained from a node responding to the side chain creation request in the block chain system based on a side chain consensus mechanism included in the side chain creation request.
The consensus mechanism is an important component of the blockchain technology, and functions to enable a plurality of nodes in the blockchain system to achieve consensus on a certain target, for example, the nodes with block generation rights can be determined based on the consensus mechanism, and an intelligent contract can be achieved.
Illustratively, the side chains may employ a different consensus mechanism than the backbone. Because the side chain benefit is constructed and the self comprehensive factors of each node are caused, the nodes responding to the side chain processing instruction are not fixed and the number of the nodes is not fixed, if only one node responding to the side chain establishing request is provided, the node is determined as the side chain block generating node; if the number of the nodes responding to the side chain creation request is multiple, the side chain block generation node can be selected according to comprehensive scores of computing power, hardware capability, false probability, stability, economic strength and the like of each node.
Specifically, after receiving a side chain processing instruction transmitted by a main chain block generation node, a node in the block chain system gives a response according to the actual situation of the node and transmits the response to other nodes, and the nodes giving the response compete with each other for side chain block generation right according to a side chain consensus mechanism included in a side chain request; and the node for obtaining the side chain block generation right is used as the side chain block generation node to process the side chain transaction request to obtain corresponding transaction data, and the data is written into the block side chain.
It should be noted that creating a side chain is equivalent to providing a service for a certain node, so that a node to which a side chain initiator initiating a side chain creation request belongs needs to pay a certain service fee for a side chain block generation node, so as to stimulate other nodes to willfully provide the service, thereby forming a better virtuous circle.
For example, after writing the processing data of the side-chain transaction request into the block side chain, the method may further include: and obtaining block generation income paid by the side chain initiator according to a settlement algorithm included in the side chain creation request.
The settlement algorithm is an algorithm for the side chain initiator to pay the profit amount of the side chain block generation node to create the side chain, and can be determined according to the difficulty degree and the quantity of the side chain transaction requests, the number of blocks included in the side chain and the like. Specifically, after the side chain block generation node writes the processing data of the side chain transaction request into the block side chain, the block generation benefit paid by the side chain initiator can be obtained according to the settlement algorithm included in the side chain creation request.
S220, if the end of the side chain event is detected, a node-transport block side chain merge request is generated to the main chain block.
Wherein the block side chain merge request is used for instructing the main chain block generation node to write the transaction data of the tail block in the block side chain into the block main chain. A sidechain event refers to an event that processes a sidechain transaction request to create a sidechain. And the end of the side chain event is the completion of the side chain transaction request processing.
Specifically, in order to avoid discarding the side chain as a branch chain in the block chain system, the side chain block generation node may detect whether the current state of the side chain reaches an end condition in real time according to the side chain end condition included in the side chain creation request, and if so, generate a block side chain merge request according to the side chain identifier, the side chain tail block data, and the like, and send the block side chain merge request to the main chain block generation node, so that the main chain block generation node processes the transaction data in the side chain tail block included in the merge request as a transaction request according to a merge rule of the side chain and the main chain, so as to form new transaction data to be written into the main chain of the block, that is, the final processing result of the side chain. And the creation process of the side chain is independent from the main chain, so that the interference of the transaction request repeatedly processed in the middle on the main chain transaction request processing is avoided.
Illustratively, detecting whether the side chain event is over may include: if the height of the tail block in the block side chain is detected to be the height of the end block included in the side chain creation request, or if the transaction data of the tail block is detected to meet the end condition included in the side chain creation request, determining that the side chain event is ended.
The block height is a flag of the block, and may be an id or a number of the block. The ending condition is a condition for determining that the transaction request processing in the side chain is completed, and for example, whether the ending condition is reached may be determined according to the number of bytes of the tail block data, a flag of a last transaction request in the tail block data, or an offset amount in a block.
Specifically, if the number of the tail block in the block side chain is equal to the number of the end block included in the side chain creation request, it is determined that the side chain time is ended; or if the byte number or the mark of the transaction data of the tail block is the same as the byte number or the mark of the end block included in the side chain creation request, determining that the side chain time is ended. The end of the side chain event may be determined by checking whether the flag of the last transaction request in the tail block data is the same as the flag of the last transaction request in the end block included in the side chain creation request, or by checking whether the position of the last transaction request in the tail block data is the same as the position of the last transaction request in the end block included in the side chain creation request.
And after determining that the side chain event is finished, the side chain block generation node sends a side chain merging request to the main chain block generation node so that the main chain block generation node merges the side chain to the main chain according to the merging rule of the side chain and the main chain.
According to the technical scheme provided by the embodiment of the invention, the side chain block generation node writes the processing data of the side chain transaction request into the side chain of the block according to the side chain processing instruction sent by the main chain block generation node, and transmits the block side chain merging request to the main chain block generation node when the end of the side chain event is detected, so that the main chain block generation node writes the transaction data of the tail block in the block side chain into the main chain of the block. The method can process irrelevant and batched transaction requests independently to form the block main chain and the block side chain, and the block side chain can return to the block main chain finally, so that the processing complexity of the transaction requests in different batches is simplified, and the efficiency of the whole block chain system for processing the transaction requests is improved.
EXAMPLE III
Fig. 3 is a flowchart of a block chain processing method according to a third embodiment of the present invention, in which a main chain block generating node, a side chain block generating node, and a side chain initiator belong to nodes that are executed in an interactive manner. The method can be executed by the block chain processing device provided by the embodiment of the invention, and the device can be realized in a software and/or hardware mode and can be integrated in a computing device bearing the block chain system node. Referring to fig. 3, the method specifically includes:
s310, initiate a side chain creation request.
The side chain creation request refers to a request sent to the main chain block generation node by a node to which the side chain initiator belongs when a plurality of transaction requests belonging to independent events need to be processed by the side chain initiator. Optionally, the side chain creation request corresponds to an intelligent contract, which may include: the side chain transaction request processing method comprises the following steps of identifying a node to which a side chain initiator belongs, marking a side chain transaction request, ending conditions of the side chain, a rule algorithm which is merged into a main chain when the side chain is ended, a consensus mechanism for selecting block generation nodes in the side chain, the income amount which needs to be paid to the block generation nodes for executing the side chain transaction request processing and the like.
Thus, optionally, initiating the sidechain creation request may comprise:
(1) and determining the side chain attribute to enable the side chain block generation node to determine the transaction request with the side chain attribute as the side chain transaction request.
The attribute of the side chain is used to indicate the transaction to be processed by the side chain, and may be a flag of the side chain, such as ID or name. Illustratively, different sidechain attributes correspond to different sidechain transaction requests; the transaction requests handled by different sidechains differ.
Specifically, since the blockchain system can have multiple side chains established at the same time, in order to ensure that each side chain can be performed in order to improve the efficiency of the whole blockchain system, the side chain initiator needs to explicitly specify the transaction request to be processed by the established side chain in initiating the side chain establishment request.
(2) And determining a side chain consensus mechanism, so that the side chain block generation node obtains the side chain block generation right from the node responding to the side chain creation request in the block chain system based on the side chain consensus mechanism.
It should be noted that the side chain consensus mechanism may adopt a different consensus mechanism from the main chain, and different side chains may adopt different consensus mechanisms, or the same consensus mechanism may be adopted. Since creating a side chain is equivalent to providing a service for a certain node, a node to which a side chain initiator initiating a side chain creation request belongs needs to pay a certain service fee for a side chain block generation node. For example, based on the reasons for constructing the side chain profit and the self comprehensive factors of each node, if only one node responds to the side chain creation request, the node which intentionally generates the side chain may be determined as the block generation node; if the number of the nodes responding to the side chain creation request is multiple, the side chain block can be selected to generate the node according to comprehensive grading competition of computing power, hardware capability, false probability, stability, economic strength and the like of each node.
Specifically, because the construction of the side chain involves the problem of revenue, the side chain initiator needs to specify how to select a side chain block generation node, i.e., a consensus mechanism, from nodes responding to the side chain creation request in the block chain system in the side chain creation request, so that each responding node competes for the side chain block generation right based on the pre-agreed consensus mechanism.
(3) And determining a settlement algorithm, so that the side chain block generation node obtains the block generation income paid by the side chain initiator according to the settlement algorithm included in the side chain creation request.
The settlement algorithm is an algorithm for the side chain initiator to pay the profit amount of the side chain block generation node to create the side chain, and can be determined according to the difficulty degree and the quantity of the side chain transaction requests, the number of blocks included in the side chain and the like.
In order to encourage a node in the block chain system to be willing to serve as a side chain block generation node to create a side chain and ensure the benefit of the side chain block generation node, a side chain initiator needs to write a settlement algorithm paying for the side chain block generation node benefit in the side chain initiation request, so that after the side chain block generation node writes the processing data of the side chain transaction request into the block side chain, the block generation benefit paid by the side chain initiator can be obtained according to the settlement algorithm included in the side chain initiation request.
(4) Determining the end block height or the end condition, and enabling the side chain block generation node to execute the following operations: and if the height of the tail block in the block side chain is detected to be the height of the ending block or if the transaction data of the tail block is detected to meet the ending condition, determining that the side chain event is ended.
The block height is a flag of the block, and may be an id or a number of the block. The ending condition is a condition for determining that the transaction request processing in the side chain is completed, and for example, whether the ending condition is reached may be determined according to the number of bytes of the tail block data, a flag of a last transaction request in the tail block data, or an offset amount in a block.
(5) Determining a side chain merging algorithm, and writing the transaction data of the tail block in the block side chain into the block main chain by using the side chain merging algorithm for the main chain block generating node.
The side chain merging algorithm is a rule for merging a side chain into a main chain, which is agreed in advance, and is used for indicating a main chain block generation node to process transaction data in a side chain tail block included in a merging request as a transaction request by adopting the side chain merging algorithm when receiving a side chain merging request sent by the side chain block generation node, so as to form new transaction data to be written into the main chain of the block.
(6) And providing a freezing proof, enabling the main chain block to generate a node deduction freezing proof, and writing a deduction result into the main chain of the block.
The freeze proof may be a digital currency or Token, which may be used to circulate through the blockchain system, and a means for awarding or penalizing nodes in the blockchain system.
Exemplary, can also include: the block address at which the subtraction result fed back by the main chain block generation node is stored in the block main chain is received.
S320, transmitting a side chain creation request in the blockchain system, so that the main-chain blockgeneration node in the blockchain system performs a corresponding operation.
Wherein the operation may include: responding to a side chain creation request initiated by a side chain initiator to generate a side chain processing instruction, and transmitting the side chain processing instruction in a block chain system, wherein the side chain processing instruction is used for instructing a side chain block generation node to write a side chain transaction request into a block side chain; and in response to a side chain merging request transmitted by the side chain block generation node, writing the transaction data of the tail block in the side chain of the block into the main chain of the block.
According to the technical scheme provided by the embodiment of the invention, the side chain initiator has written side chain attributes, a consensus mechanism, a settlement algorithm, a side chain merging algorithm, side chain ending conditions and the like in the side chain creating request, so that the main chain block generating node and the side chain block generating node execute corresponding operations according to the side chain creating request to form the block main chain and the block side chain, and the block side chain can finally return to the block main chain, thereby simplifying the processing complexity of transaction requests in different batches, improving the efficiency of the whole block chain system for processing the transaction requests and ensuring the ordered operation of the whole block chain system.
Example four
Fig. 4 is a flowchart of a block chain processing method according to a fourth embodiment of the present invention, and the present embodiment provides a preferred example of an interworking execution of a main chain block generation node, a side chain block generation node, and a node to which a side chain initiator belongs in a block chain system based on the foregoing embodiments. Referring to fig. 4, the method specifically includes:
and S410, the side chain initiator initiates a side chain creation request and transmits the side chain creation request in the block chain system.
S420, the main chain block generating node generates a side chain processing instruction in response to a side chain creation request initiated by a side chain initiator in the blockchain system, and transmits the side chain processing instruction in the blockchain system.
S430, the side-chain block generating node writes the processing data of the side-chain transaction request into the side-chain of the block according to the side-chain processing command transmitted by the main-chain block generating node in the block chain system.
S440, if the side-chain block generating node detects that the side-chain event is finished, the side-chain block merging request is transmitted to the main-chain block generating node.
S450, the main chain block generating node writes the transaction data of the tail block in the block side chain into the main chain block in response to the side chain merging request transmitted by the side chain block generating node.
According to the technical scheme provided by the embodiment of the invention, the main chain block generation node can respond and generate a side chain processing instruction when a side chain initiator initiates a side chain creation request, and transmits the side chain processing instruction in a block chain system to indicate the side chain block generation node to write a side chain transaction request into a block side chain; and when a side chain merging request transmitted by a side chain block generation node is received, the transaction data of the tail block in the block side chain is written into the block main chain. The method can process irrelevant and batched transaction requests independently to form the block main chain and the block side chain, and the block side chain can return to the block main chain finally, so that the processing complexity of the transaction requests in different batches is simplified, and the efficiency of the whole block chain system for processing the transaction requests is improved.
EXAMPLE five
Fig. 5 is a block diagram of a block chain processing apparatus according to a fifth embodiment of the present invention, which is configured in a node in a block chain system, and is capable of executing the block chain processing method according to the first embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 5, the apparatus may include:
a processing instruction generating module 510, configured to generate a side chain processing instruction in response to a side chain creation request initiated by a side chain initiator in the blockchain system, where the side chain processing instruction is used to instruct a side chain block generating node to write a side chain transaction request into a blockchain;
a processing instruction sending module 520, configured to transmit a side chain processing instruction in the blockchain system;
the tail data writing module 530 is configured to write the transaction data of the tail block in the block side chain into the block main chain in response to the side chain merging request transmitted by the side chain block generation node.
According to the technical scheme provided by the embodiment of the invention, the main chain block generation node can respond and generate a side chain processing instruction when a side chain initiator initiates a side chain creation request, and transmits the side chain processing instruction in a block chain system to indicate the side chain block generation node to write a side chain transaction request into a block side chain; and when a side chain merging request transmitted by a side chain block generation node is received, the transaction data of the tail block in the block side chain is written into the block main chain. Independent and batch transaction requests can be processed independently to form a block main chain and a block side chain, and the block side chain can be finally returned to the block main chain, so that the processing complexity of the transaction requests in different batches is simplified, and the efficiency of the whole block chain system for processing the transaction requests is improved.
Illustratively, the sideline transaction request is a transaction request initiated by a sideline initiator; or a transaction request with a sidechain attribute included in the sidechain creation request.
Illustratively, the tail data write module 530 is specifically configured to: and writing the transaction data of the tail block in the block side chain into the main chain of the block by adopting a side chain merging algorithm included in the side chain creating request.
Illustratively, the processing instruction generation module 510 is specifically configured to: responding to a side chain creation request initiated by any party in the block chain system, deducting the freezing proof of the party, writing a deducting result into a block main chain, taking the party as a side chain initiator, and generating a side chain processing instruction initiated by the side chain initiator.
It should be noted that the side chain of the block in this embodiment includes at least two blocks.
EXAMPLE six
Fig. 6 is a block diagram of a block chain processing apparatus according to a sixth embodiment of the present invention, which is configured in a node in a block chain system, and is capable of executing the block chain processing method according to a second embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 6, the apparatus may include:
a processing data writing module 610, configured to write processing data of a side chain transaction request into a side chain of a block according to a side chain processing instruction transmitted by a main chain block generation node in the block chain system, where the side chain processing instruction is generated according to a side chain creation request initiated by a side chain initiator in the block chain system;
the merge request sending module 620 is configured to transmit a block side chain merge request to the main chain block generation node if the side chain event is detected to end, where the block side chain merge request is used to instruct the main chain block generation node to write the transaction data of the tail block in the block side chain into the block main chain.
According to the technical scheme provided by the embodiment of the invention, the side chain block generation node writes the processing data of the side chain transaction request into the side chain of the block according to the side chain processing instruction sent by the main chain block generation node, and transmits the block side chain merging request to the main chain block generation node when the end of the side chain event is detected, so that the main chain block generation node writes the transaction data of the tail block in the block side chain into the main chain of the block. Independent and batch transaction requests can be processed independently to form a block main chain and a block side chain, and the block side chain can be finally returned to the block main chain, so that the processing complexity of the transaction requests in different batches is simplified, and the efficiency of the whole block chain system for processing the transaction requests is improved.
Illustratively, the apparatus may further include:
a side chain transaction request determining module, configured to determine, before writing processing data of a side chain transaction request into a block side chain, a transaction request initiated by a side chain initiator as a side chain transaction request; alternatively, a transaction request having a sidechain attribute included in the sidechain creation request is determined as a sidechain transaction request.
Illustratively, the apparatus may further include:
the generation right obtaining module is used for obtaining the side chain block generation right from a node responding to the side chain creation request in the block chain system based on a side chain consensus mechanism included in the side chain creation request before the processing data of the side chain transaction request is written into the block side chain.
Illustratively, the apparatus may further include:
and the generation profit obtaining module is used for obtaining the block generation profit paid by the side chain initiator according to the settlement algorithm included in the side chain establishing request after the processing data of the side chain transaction request is written into the block side chain.
Illustratively, the apparatus may further include: and the side chain event detection module is used for detecting whether the side chain event is finished or not.
Optionally, the side chain event detection module is specifically configured to: if the height of the tail block in the block side chain is detected to be the height of the end block included in the side chain creation request, or if the transaction data of the tail block is detected to meet the end condition included in the side chain creation request, determining that the side chain event is ended.
EXAMPLE seven
Fig. 7 is a block diagram of a block chain processing apparatus according to a seventh embodiment of the present invention, which is configured in a node in a block chain system, and is capable of executing a block chain processing method according to a third embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 7, the apparatus may include:
a creation request initiating module 710 for initiating a side chain creation request;
a creation request transmission module 720, configured to transmit a side chain creation request in the blockchain system, so that a main-chain block generation node in the blockchain system performs the following operations: responding to a side chain creation request initiated by a side chain initiator to generate a side chain processing instruction, and transmitting the side chain processing instruction in a block chain system, wherein the side chain processing instruction is used for instructing a side chain block generation node to write a side chain transaction request into a block side chain; and in response to a side chain merging request transmitted by the side chain block generation node, writing the transaction data of the tail block in the side chain of the block into the main chain of the block.
According to the technical scheme provided by the embodiment of the invention, the side chain initiator has written side chain attributes, a consensus mechanism, a settlement algorithm, a side chain merging algorithm, side chain ending conditions and the like in the side chain creating request, so that the main chain block generating node and the side chain block generating node execute corresponding operations according to the side chain creating request to form the block main chain and the block side chain, and the block side chain can finally return to the block main chain, thereby simplifying the processing complexity of transaction requests in different batches, improving the efficiency of the whole block chain system for processing the transaction requests and ensuring the ordered operation of the whole block chain system.
Illustratively, the creation request initiation module 710 may include:
and the side chain attribute determining unit is used for determining the side chain attribute so that the side chain block generating node determines the transaction request with the side chain attribute as the side chain transaction request.
Illustratively, the creation request initiation module 710 may further include:
a side chain consensus mechanism determining unit, configured to determine a side chain consensus mechanism, so that the side chain block generation node obtains a side chain block generation right from a node in the block chain system responding to the side chain creation request based on the side chain consensus mechanism.
Illustratively, the creation request initiation module 710 may further include:
and the settlement algorithm determining unit is used for determining a settlement algorithm so that the side chain block generating node obtains the block generation income paid by the side chain initiator according to the settlement algorithm contained in the side chain creating request.
Illustratively, the creation request initiation module 710 may further include:
an end determining unit, configured to determine an end block height or an end condition, so that the side-chain block generating node performs the following operations: if the height of the tail block in the block side chain is detected to be the end block height, or,
and if the transaction data of the tail block is detected to meet the end condition, determining that the side chain event is ended.
Illustratively, the creation request initiation module 710 may further include:
and the merging algorithm determining unit is used for determining a side chain merging algorithm, so that the main chain block generating node adopts the side chain merging algorithm to write the transaction data of the tail block in the block side chain into the block main chain.
Illustratively, the creation request initiation module 710 may further include:
and the freezing proof providing unit is used for providing freezing proof, enabling the main chain block to generate node deduction freezing proof and writing deduction results into the main chain of the block.
Example eight
Fig. 8 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention, and fig. 8 shows a block diagram of an exemplary apparatus suitable for implementing the embodiment of the present invention. The device shown in fig. 8 is only an example and should not bring any limitation to the function and the scope of use of the embodiments of the present invention.
As shown in FIG. 8, device 12 is in the form of a general purpose computing device. The components of device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16. Device 12 is typically a computing device that assumes the functionality of a node of a blockchain system.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 8, and commonly referred to as a "hard drive"). Although not shown in FIG. 8, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of embodiments described herein.
Device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with device 12, and/or with any devices (e.g., network card, modem, etc.) that enable device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, to implement the block chain processing method provided by the embodiment of the present invention.
Example nine
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program (or referred to as computer-executable instructions) is stored, where the computer program, when executed by a processor, can implement the block chain processing method described in any of the above embodiments. The computer readable storage medium may be configured in a computing device that carries a node of a blockchain system.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the embodiments of the present invention have been described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and many other equivalent embodiments may be included without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (22)

1. A method of blockchain processing, performed by a node in a blockchain system, the method comprising:
responding a side chain creation request initiated by a side chain initiator in a block chain system to generate a side chain processing instruction, and transmitting the side chain processing instruction in the block chain system, wherein the side chain processing instruction is used for instructing a side chain block generation node to write a side chain transaction request into a block side chain;
responding to a side chain merging request transmitted by the side chain block generation node, and writing the transaction data of a tail block in the block side chain into a block main chain; wherein the side chain merge request is a merge request sent at the end of a side chain event.
2. The method of claim 1, wherein the sidelink transaction request is a transaction request initiated by the sidelink initiator; or a transaction request with a sidechain attribute included in the sidechain creation request.
3. The method of claim 1, wherein writing the transaction data of the tail block in the block side chain into a block main chain comprises:
and writing the transaction data of the tail block in the block side chain into the main chain of the block by adopting a side chain merging algorithm included in the side chain creating request.
4. The method of claim 1, wherein generating a sidechain processing instruction in response to a sidechain creation request initiated by a sidechain initiator in a blockchain system comprises:
responding a side chain creation request initiated by any party in the block chain system, deducting the freezing proof of the party, writing a deducting result into a block main chain, taking the party as a side chain initiator, and generating a side chain processing instruction initiated by the side chain initiator.
5. The method of claim 1, wherein the tile side chain comprises at least two tiles.
6. A method of blockchain processing, performed by a node in a blockchain system, the method comprising:
writing processing data of a side chain transaction request into a side chain of a block according to a side chain processing instruction transmitted by a main chain block generation node in the block chain system, wherein the side chain processing instruction is generated according to a side chain creation request initiated by a side chain initiator in the block chain system;
if the end of the side chain event is detected, transmitting a block side chain merging request to the main chain block generating node, wherein the block side chain merging request is used for instructing the main chain block generating node to write the transaction data of the tail block in the block side chain into the main chain of the block.
7. The method of claim 6, wherein prior to writing the processed data of the side-chain transaction request into a bank side-chain, further comprising:
determining the transaction request initiated by the side chain initiator as a side chain transaction request; alternatively, the first and second electrodes may be,
a transaction request having a sidechain attribute included in the sidechain creation request is determined to be a sidechain transaction request.
8. The method of claim 6, wherein prior to writing the processed data of the side-chain transaction request into a bank side-chain, further comprising:
and acquiring side chain block generation weights from nodes responding to the side chain creation request in the block chain system based on a side chain consensus mechanism included in the side chain creation request.
9. The method of claim 6, wherein after writing the processed data of the side-chain transaction request into a bank side-chain, further comprising:
and obtaining block generation income paid by the side chain initiator according to a settlement algorithm included in the side chain creation request.
10. The method of claim 6, wherein detecting whether a side chain event is over comprises:
if the height of the tail block in the block side chain is detected to be the height of the end block included in the side chain creation request, or if the transaction data of the tail block is detected to meet the end condition included in the side chain creation request, determining that the side chain event is ended.
11. A method of blockchain processing, performed by a node in a blockchain system, the method comprising:
initiating a side chain creation request;
transmitting the side chain creation request in the blockchain system, so that a main chain block generation node in the blockchain system performs the following operations: responding to a side chain creation request initiated by a side chain initiator to generate a side chain processing instruction, and transmitting the side chain processing instruction in a block chain system, wherein the side chain processing instruction is used for instructing a side chain block generation node to write a side chain transaction request into a block side chain; responding to a side chain merging request transmitted by the side chain block generation node, and writing the transaction data of a tail block in the block side chain into a block main chain; wherein the side chain merge request is a merge request sent at the end of a side chain event.
12. The method of claim 11, wherein initiating a sidechain creation request comprises:
determining a side chain attribute, and enabling the side chain block generation node to determine the transaction request with the side chain attribute as a side chain transaction request.
13. The method of claim 11, wherein initiating a sidechain creation request comprises:
and determining a side chain consensus mechanism, so that a side chain block generation node obtains a side chain block generation right from a node responding to the side chain creation request in the block chain system based on the side chain consensus mechanism.
14. The method of claim 11, wherein initiating a sidechain creation request comprises:
and determining a settlement algorithm, so that the side chain block generation node obtains the block generation income paid by the side chain initiator according to the settlement algorithm included in the side chain creation request.
15. The method of claim 11, wherein initiating a sidechain creation request comprises:
determining an end block height or an end condition, and enabling the side chain block generation node to execute the following operations: and if the height of the tail block in the block side chain is detected, or if the transaction data of the tail block is detected to meet the end condition, determining that the side chain event is ended.
16. The method of claim 11, wherein initiating a sidechain creation request comprises:
determining a side chain merging algorithm, and writing the transaction data of the tail block in the block side chain into the block main chain by using the side chain merging algorithm by the main chain block generating node.
17. The method of claim 11, wherein initiating a sidechain creation request comprises:
and providing a frozen certificate, deducting the frozen certificate from the generation node of the main chain block, and writing the deduction result into the main chain of the block.
18. A block chain processing apparatus configured in a node in a block chain system, the apparatus comprising:
the processing instruction generating module is used for responding to a side chain creating request initiated by a side chain initiator in the block chain system to generate a side chain processing instruction, wherein the side chain processing instruction is used for instructing a side chain block generating node to write a side chain transaction request into a block side chain;
the processing instruction sending module is used for transmitting the side chain processing instruction in the block chain system;
a tail data writing module, configured to respond to a side chain merge request transmitted by the side chain block generation node, and write transaction data of a tail block in the side chain of the block into a block main chain; wherein the side chain merge request is a merge request sent at the end of a side chain event.
19. A block chain processing apparatus configured in a node in a block chain system, the apparatus comprising:
the processing data writing module is used for writing the processing data of the side chain transaction request into a side chain of the block according to a side chain processing instruction transmitted by a main chain block generation node in the block chain system, wherein the side chain processing instruction is generated according to a side chain creation request initiated by a side chain initiator in the block chain system;
a merge request sending module, configured to transmit a block side chain merge request to the main chain block generation node if a side chain event is detected to end, where the block side chain merge request is used to instruct the main chain block generation node to write the transaction data of the tail block in the block side chain into the block main chain.
20. A block chain processing apparatus configured in a node in a block chain system, the apparatus comprising:
a creation request initiating module for initiating a side chain creation request;
a creation request transmission module, configured to transmit the side chain creation request in the blockchain system, so that a main-chain blockgeneration node in the blockchain system performs the following operations: responding to a side chain creation request initiated by a side chain initiator to generate a side chain processing instruction, and transmitting the side chain processing instruction in a block chain system, wherein the side chain processing instruction is used for instructing a side chain block generation node to write a side chain transaction request into a block side chain; responding to a side chain merging request transmitted by the side chain block generation node, and writing the transaction data of a tail block in the block side chain into a block main chain; wherein the side chain merge request is a merge request sent at the end of a side chain event.
21. An electronic device, characterized in that the device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the blockchain processing method of any one of claims 1-5, implement the blockchain processing method of any one of claims 6-10, or implement the blockchain processing method of any one of claims 11-17.
22. A storage medium having stored thereon a computer program, characterized in that the program, when executed by a processor, implements the blockchain processing method according to any one of claims 1 to 5, implements the blockchain processing method according to any one of claims 6 to 10, or implements the blockchain processing method according to any one of claims 11 to 17.
CN201810660382.9A 2018-06-25 2018-06-25 Block chain processing method, device, equipment and storage medium Active CN108984645B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810660382.9A CN108984645B (en) 2018-06-25 2018-06-25 Block chain processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810660382.9A CN108984645B (en) 2018-06-25 2018-06-25 Block chain processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108984645A CN108984645A (en) 2018-12-11
CN108984645B true CN108984645B (en) 2021-02-02

Family

ID=64538693

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810660382.9A Active CN108984645B (en) 2018-06-25 2018-06-25 Block chain processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108984645B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109767216B (en) * 2018-12-29 2020-10-02 莆田市烛火信息技术有限公司 Account book accounting system of block chain network with regularly converged parallel chains
CN109711842B (en) * 2018-12-29 2021-04-09 西安纸贵互联网科技有限公司 Account book accounting method of block chain network with regularly converged parallel chains
CN110033243B (en) * 2019-03-06 2023-01-10 华南师范大学 Main chain evidence storing method, system and storage medium based on block chain intelligent contract
CN110311958B (en) * 2019-06-14 2021-01-01 柳州市蓝海数链科技有限公司 Block chain network system
CN110474968B (en) * 2019-07-25 2022-03-11 南京邮电大学 Self-adaptive sensing type block chain mixed consensus mechanism structure and method thereof
CN110505223B (en) * 2019-08-15 2021-09-14 腾讯科技(深圳)有限公司 Block chain multi-chain management method, block chain multi-chain management device and computer readable storage medium
CN110557394B (en) * 2019-09-06 2021-11-02 杭州复杂美科技有限公司 Parallel chain management method, equipment and storage medium
CN111488398A (en) * 2020-05-01 2020-08-04 北京俩撇科技有限公司 Block chain creation method and device based on block chain
CN111555890A (en) * 2020-05-06 2020-08-18 昆明大棒客科技有限公司 Method, device and equipment for preventing malicious bifurcation
CN112039987B (en) * 2020-08-28 2022-05-20 平安科技(深圳)有限公司 Method and device for processing blocks in block chain, node equipment and storage medium
CN113965570A (en) * 2021-10-25 2022-01-21 网络通信与安全紫金山实验室 Block chain structure and block chain transaction execution method, device, equipment and medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050144516A1 (en) * 2003-12-30 2005-06-30 Gonzalez Carlos J. Adaptive deterministic grouping of blocks into multi-block units
US20090193280A1 (en) * 2008-01-30 2009-07-30 Michael David Brooks Method and System for In-doubt Resolution in Transaction Processing
CN106780032A (en) * 2016-12-16 2017-05-31 杭州云象网络技术有限公司 A kind of block chain interchain assets transfer method under multichain scene
CN107038639B (en) * 2017-03-07 2020-08-04 杭州云象网络技术有限公司 Alliance chain construction method compatible with multi-asset type rapid transaction
CN107239479B (en) * 2017-03-28 2020-03-13 创新先进技术有限公司 Block chain based data storage and query method and device
CN107368259B (en) * 2017-05-25 2020-07-10 创新先进技术有限公司 Method and device for writing service data into block chain system
CN107464106B (en) * 2017-07-25 2021-01-26 北京果仁宝科技有限公司 Method and system for transaction between main chain and side chain of block chain

Also Published As

Publication number Publication date
CN108984645A (en) 2018-12-11

Similar Documents

Publication Publication Date Title
CN108984645B (en) Block chain processing method, device, equipment and storage medium
US20210165686A1 (en) Task processing method, system, device, and storage medium
US11830001B2 (en) Blockchain consensus method, accounting node and node
CN109951547B (en) Transaction request parallel processing method, device, equipment and medium
CN108647963A (en) Determination method, apparatus, server and the storage medium of block chain main chain
CN112637127B (en) Cross-block chain communication method and device
CN109710695B (en) Transaction request validity identification and initiation method, device, equipment and medium
CN108804706A (en) A kind of block chain data processing method, device, equipment and storage medium
CN108960797B (en) Block generation and verification method, device, equipment and storage medium
KR102567342B1 (en) Block chain-based asset processing method, device, apparatus and storage medium
KR20230023019A (en) Blockchain-based data storage method, system and device
CN108665272A (en) Block chain data processing method, device, equipment and storage medium
CN109670802A (en) A kind of chain currency conversion method, apparatus, equipment and medium based on block chain
CN111429122A (en) DAG block chain-based data verification method and device and computer equipment
CN110175833B (en) Computer device, method, system and medium for binding bank card information
CN112396427B (en) Cross-chain interchange operation method for general scenes
CN111310242B (en) Method and device for generating device fingerprint, storage medium and electronic device
CN111210345B (en) Signature method and device based on block chain network transaction and terminal equipment
CN113935069B (en) Data verification method, device and equipment based on block chain and storage medium
CN114327802B (en) Method, apparatus, device and medium for block chain access to data outside chain
US11875357B2 (en) Method and system of using miner commitment to reward proofs
CN110688677B (en) Method and device for executing intelligent contracts
CN115222390A (en) Security check method, device, equipment and storage medium
CN109509090A (en) It is a kind of to convert the method and device for taking virtual digit currencies
WO2024055740A1 (en) Data processing method, computer device, and readable 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