CN111507694A - Block chain cross-chain interaction method and system - Google Patents
Block chain cross-chain interaction method and system Download PDFInfo
- Publication number
- CN111507694A CN111507694A CN202010305381.XA CN202010305381A CN111507694A CN 111507694 A CN111507694 A CN 111507694A CN 202010305381 A CN202010305381 A CN 202010305381A CN 111507694 A CN111507694 A CN 111507694A
- Authority
- CN
- China
- Prior art keywords
- chain
- data
- block
- main chain
- cross
- 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.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 61
- 230000003993 interaction Effects 0.000 title claims abstract description 38
- 238000012545 processing Methods 0.000 claims description 47
- 230000001360 synchronised effect Effects 0.000 claims description 23
- 238000012544 monitoring process Methods 0.000 claims description 8
- 230000008569 process Effects 0.000 claims description 8
- 230000000977 initiatory effect Effects 0.000 claims description 7
- 239000000284 extract Substances 0.000 claims description 6
- 238000012795 verification Methods 0.000 claims description 6
- 230000002085 persistent effect Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 238000004590 computer program Methods 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 4
- 238000013461 design Methods 0.000 description 3
- 230000000644 propagated effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000003999 initiator Substances 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Payment architectures, schemes or protocols
- G06Q20/02—Payment architectures, schemes or protocols involving a neutral party, e.g. certification authority, notary or trusted third party [TTP]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F16/275—Synchronous replication
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- Strategic Management (AREA)
- Accounting & Taxation (AREA)
- Computing Systems (AREA)
- Computer Security & Cryptography (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The embodiment of the invention provides a block chain cross-chain interaction method and system, and belongs to the technical field of block chains. The method comprises the following steps: the client registers each timing task of each application and transmits a registration result to the main chain; the method comprises the steps that after a main chain monitors a target timing task to be linked up, a task uplink notification is initiated, wherein the task uplink notification is used for indicating the transaction state of the target timing task on the main chain and uplink; the side chain acquires and executes a target timing task from the main chain in a mode of transmitting cross-chain data; the side chain modifies the state of the target timing task into a stop state, and synchronously updates the stop state of the target timing task after the execution is finished to the main chain in a mode of transmitting cross-chain data; the target timing task ends at the main chain and the side chains. By the scheme, the aim of uniformly managing and concurrently controlling the timing tasks of the main chain system to the plurality of applications and the overall transaction performance of the main chain node are improved, so that the user-oriented performance is more optimized.
Description
Technical Field
The invention relates to the technical field of block chains, in particular to a block chain cross-chain interaction method and system.
Background
The blockchain is a novel decentralized protocol, digital currency transactions or other data can be safely stored, information cannot be forged and tampered, transaction confirmation on the blockchain is completed by all nodes on the blockchain together, consistency of the blockchain is guaranteed by a consensus algorithm, a public account book is maintained on the blockchain, and any node on the public account book located on a storage block is visible, so that the blockchain is guaranteed to be incapable of being forged and tampered.
The interaction between the chains of the blockchain is an important part of cross-chain design, the current design scheme of blockchain expansibility mainly serves a single-chain transaction process, the capacity expansion of the cross-chain transaction is mostly based on a heterogeneous chain model, the scheme design is too complex for serving the heterogeneous chain, and the efficiency cannot be guaranteed on the premise of ensuring the function.
In the existing block chain technology, on one hand, the existing block chain platform has relatively low transaction performance and relatively low transaction processing speed, so that the requirements of frequent transaction and transaction timeliness of users cannot be met; on the other hand, different service contracts are used among the blockchain platforms, and a large amount of high-frequency transactions cannot be executed on one blockchain platform.
It can be seen that there is a need in the art for a data processing scheme that can shift the timing tasks of the main chain to side chain execution.
Disclosure of Invention
In view of the above, embodiments of the present invention provide a method and system for block chain cross-chain interaction, which at least partially solve the problems in the prior art.
In a first aspect, an embodiment of the present invention provides a block chain cross-chain interaction method, which is applied to a block chain cross-chain interaction system, where the block chain cross-chain interaction system includes a main chain, a side chain, and a client; the method comprises the following steps:
the client registers each timing task of each application and transmits a registration result to the main chain;
initiating a task uplink notification after monitoring that the target timed task is uplink on the main chain, wherein the task uplink notification is used for indicating the transaction state of the target timed task on the main chain and uplink, and the target timed task is any one of all timed tasks registered by the client;
the side chain acquires and executes the target timing task from the main chain in a mode of transmitting cross-chain data;
the side chain modifies the state of the target timing task into a stop state, and synchronously updates the stop state of the target timing task after the execution is finished to the main chain in a mode of transmitting cross-chain data;
ending the target timing task at the main chain and the side chain.
According to a specific implementation manner of the embodiment of the present invention, after the step of acquiring and executing the target timing task from the main chain by the side chain in a manner of transmitting cross-chain data, the method further includes:
the side chain synchronizes the original user state data of the main chain in a mode of transmitting cross-chain data;
persisting the user state data; and the number of the first and second groups,
after the step of synchronously updating the stop state of the target timing task after the completion of the execution to the main chain by means of transmitting cross-chain data, the method further comprises:
the side chain synchronously updates the user state data to the main chain by transmitting cross-chain data.
According to a specific implementation manner of the embodiment of the present invention, before the step of registering, by the client, each timing task of each application, the method further includes:
initializing the first block chain and the second block chain so that the first block chain becomes a main chain of the second block chain and the second block chain becomes a side chain of the first block chain;
selecting operation nodes on the main chain, wherein the number of the operation nodes is at least two;
defining a mode of transmitting cross-link data from the main chain to the side chain as that the operation node performs main chain block synchronous processing on the main chain and performs main chain data synchronous processing on the main chain;
defining a mode of transmitting chain-crossing data from the side chain to the main chain as that the operation node performs side chain block synchronous processing on the side chain and performs side chain data synchronous processing on the side chain.
According to a specific implementation manner of the embodiment of the present invention, the step of performing the main chain data synchronization processing on the main chain includes:
the operation node performs data synchronization processing on the main chain in a data signature mode; and/or the presence of a gas in the gas,
the step of performing side chain data synchronization processing on the side chain comprises:
and the operation node performs data synchronization processing on the side chain in a data signature mode.
According to a specific implementation manner of the embodiment of the present invention, the initializing a first blockchain and a second blockchain so that the first blockchain becomes a main chain of the second blockchain and the second blockchain becomes a side chain of the first blockchain includes:
generating a created block by the second block chain, and sending a block header of the created block to the first block chain;
the second block chain acquires and stores the block head of the block returned after the first block chain performs the common identification switching based on the block head of the created block;
the second block chain sends request information of cross-chain interaction to the first block chain;
the first blockchain authorizes the second blockchain based on the request information such that the first blockchain becomes a main chain of the second blockchain, and the second blockchain becomes a side chain of the first blockchain.
According to a specific implementation manner of the embodiment of the present invention, the step of performing the main chain block synchronization processing on the main chain by the operation node includes:
the backbone generates a backbone block;
the operational node transmitting a block header of the main chain block to the side chain through a first processor of the main chain;
and after judging that the block head is legal, the first processor stores the public key of the common node in the block head of the main chain block into the second processor of the side chain.
According to a specific implementation manner of the embodiment of the present invention, the step of performing the main chain data synchronization processing on the main chain includes:
the operation node extracts cross-chain data of x common recognition nodes in the main chain, wherein x is a natural number greater than 0, and the cross-chain data comprises main chain transaction data and signatures of the main chain transaction data;
the operation node judges whether at least y main chain transaction data in the x main chain transaction data are the same or not, wherein y is a natural number larger than 0, and is smaller than or equal to x;
the operation node transmits the cross-chain data with the same main chain transaction data to the side chain through the first processor under the condition that at least y main chain transaction data are determined to be the same;
the second processor receives the cross-chain data and verifies the signature of the cross-chain data according to the public key in the second processor;
and if the signatures of at least y pieces of the cross-chain data pass verification, the main chain data synchronization processing is completed.
According to a specific implementation manner of the embodiment of the present invention, the step of performing the side chain block synchronization processing on the side chain by the operation node includes:
the side chains generate side chain blocks;
the operational node transmitting, by the second processor, a block header of the sidechain block to the sidechain;
and after judging that the block head is legal, the second processor stores the public key of the common node in the block head of the side chain block into the first processor.
According to a specific implementation manner of the embodiment of the present invention, the step of performing side chain data synchronization processing on the side chain includes:
the operation node extracts cross-chain data of x common recognition nodes in the side chain, wherein x is a natural number greater than 0, and the cross-chain data comprises side chain transaction data and signatures of the side chain transaction data;
judging whether at least y side chain transaction data in the x side chain transaction data are the same or not, wherein y is a natural number larger than 0;
the operating node transmits the cross-chain data with the same side-chain transaction data to the main chain through the second processor under the condition that at least y side-chain transaction data are determined to be the same;
the first processor receives the cross-chain data and verifies the signature of the cross-chain data according to the public key in the first processor;
and if the signatures of at least y pieces of the cross-chain data pass the verification, finishing the synchronous processing of the side-chain data.
In a second aspect, an embodiment of the present invention provides a block chain cross-chain interaction method and system, where the system includes: a main chain, a side chain and a client; the client is used for registering each timing task of each application and transmitting a registration result to the main chain;
the main chain is used for initiating a task uplink notification after monitoring that the target timed task is on the main chain, wherein the task uplink notification is used for indicating the transaction state of the target timed task on the main chain and uplink, and the target timed task is any one of all timed tasks registered by the client;
the side chain is used for acquiring and executing the target timing task from the main chain in a mode of transmitting cross-chain data;
the side chain is used for modifying the state of the target timing task into a stop state and synchronously updating the stop state of the target timing task after the execution is finished to the main chain in a mode of transmitting cross-chain data;
ending the target timing task at the main chain and the side chain.
The block chain cross-chain interaction method in the embodiment of the invention mainly comprises the following interaction processes: the client registers each timing task of each application and transmits a registration result to the main chain; initiating a task uplink notification after monitoring that the target timed task is uplink on the main chain, wherein the task uplink notification is used for indicating the transaction state of the target timed task on the main chain and uplink, and the target timed task is any one of all timed tasks registered by the client; the side chain acquires and executes the target timing task from the main chain in a mode of transmitting cross-chain data; the side chain modifies the state of the target timing task into a stop state, and synchronously updates the stop state of the target timing task after the execution is finished to the main chain in a mode of transmitting cross-chain data; ending the target timing task at the main chain and the side chain. According to the scheme of the invention, each timing task of each application is registered in the main chain registration center, the registration result is transmitted to each node of the block chain, the side chain monitors and executes the timing task of the main node, and the timing task state data and the user state data are returned to the main chain node after the execution is finished, so that the aims of unified management and concurrent control of the main chain system on the timing tasks of a plurality of applications are improved, the overall transaction performance of the main chain node is improved, and the operation performance facing to a client user is optimized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a block chain cross-chain interaction method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a block chain inter-chain system according to an embodiment of the present invention;
fig. 3 is a partial flowchart of another block chain inter-chain interaction method according to an embodiment of the present invention;
fig. 4 is an interaction diagram of another block chain cross-chain interaction method according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It is noted that various aspects of the embodiments are described below within the scope of the appended claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the disclosure, one skilled in the art should appreciate that one aspect described herein may be implemented independently of any other aspects and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. Additionally, such an apparatus may be implemented and/or such a method may be practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the drawings only show the components related to the present invention rather than the number, shape and size of the components in practical implementation, and the type, quantity and proportion of the components in practical implementation can be changed freely, and the layout of the components can be more complicated.
In addition, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects may be practiced without these specific details.
The embodiment of the invention provides a block chain cross-chain interaction method. The blockchain cross-chain interaction method provided by the embodiment may be executed by a computing device, where the computing device may be implemented as software, or implemented as a combination of software and hardware, and the computing device may be integrally disposed in a server, a terminal device, or the like.
Referring to fig. 1, an embodiment of the present invention provides a method for a blockchain cross-chain interaction, which is applied to a blockchain cross-chain interaction system shown in fig. 2, where the blockchain cross-chain interaction system includes a main chain 210, a side chain 220, and a client 230. As shown in fig. 1, the method mainly comprises the following steps:
s101, the client registers each timing task of each application and transmits a registration result to the main chain;
the block chain cross-chain interaction method provided by the embodiment is used for realizing cross-chain data transmission between different block chains. As shown in fig. 2, the applied blockchain cross-chain interaction system includes a main chain 210, a side chain 220 and a client 230, where the main chain and the side chain are different blockchains, such as a first blockchain and a second blockchain, and the first blockchain becomes the main chain of the second blockchain and the second blockchain becomes the side chain of the first blockchain through a pre-initialization operation, and in a subsequent interaction process, cross-chain data can be transmitted between the main chain and the side chain.
And the client registers each timing task of each application and sends a registration result to the main chain.
S102, initiating a task uplink notification after monitoring that the target timed task is in the main chain uplink, where the task uplink notification is used to indicate a transaction state of the target timed task in the main chain and uplink, and the target timed task is any one of all timed tasks registered by the ue;
after registering each timing task on the main chain, if the timing task is monitored to be on the main chain, the client initiates the transaction and the chain-linking of the timing task on the main chain, and the timing task which is monitored and processed currently is defined as the target timing task.
Optionally, the main chain timing task registration information includes: task name, task execution class, function, parameter, trigger time, task guarantee fund, task initiator, etc.
S103, the side chain acquires and executes the target timing task from the main chain in a mode of transmitting chain-crossing data;
the block chain cross-chain interactive system predefines a mode for transmitting cross-chain data, and the mode comprises a mode for transmitting the cross-chain data from a main chain to a side chain and a mode for transmitting the cross-chain data from the side chain to the main chain. After monitoring that the target timing task is linked on the main chain, the target timing task can be obtained from the main chain in a predefined mode of transmitting cross-chain data, and the target timing task is executed.
Optionally, after the step of acquiring and executing the target timing task from the main chain by the side chain by means of transmitting cross-chain data, the method further includes:
the side chain synchronizes the original user state data of the main chain in a mode of transmitting cross-chain data;
persisting the user state data.
S104, the side chain modifies the state of the target timing task into a stop state, and synchronously updates the stop state of the target timing task after the execution is finished to the main chain in a mode of transmitting cross-chain data;
s105, ending the target timing task at the main chain and the side chain.
After the side chain finishes executing the current target timing task, the state of the target timing task is modified into a stop state, and the target timing task is synchronously updated to the main chain so as to mark and indicate that the target customizing task is finished and finished.
In addition, after the step of synchronously updating the stop state of the target timing task after the completion of the execution to the main chain by means of transmitting cross-chain data, the method may further include:
the side chain synchronously updates the user state data to the main chain by transmitting cross-chain data.
According to the block chain cross-chain interaction scheme in the embodiment of the invention, each timing task of each application is registered in the main chain registration center, the registration result is transmitted to each node of the block chain, the side chain monitors and executes the timing task of the main node, and the timing task state data and the user state data are returned to the main chain node after the execution is finished, so that the aims of unified management and concurrent control of the main chain system on the timing tasks of multiple applications are improved on the premise that the main chain data and the side chain data are synchronous and consistent, the overall transaction performance of the main chain node is improved, and the operation performance facing to a client user is optimized.
In addition, the embodiment of the invention further limits the initialization process before cross-chain interaction. According to a specific implementation manner of the embodiment of the present invention, as shown in fig. 3 and 4, before the step of registering, by the client, each timing task of each application, the method may further include:
s301, initializing the first block chain and the second block chain, so that the first block chain becomes a main chain of the second block chain, and the second block chain becomes a side chain of the first block chain;
the specific initialization process mainly comprises the following steps:
generating a created block by the second block chain, and sending a block header of the created block to the first block chain;
the second block chain acquires and stores the block head of the block returned after the first block chain performs the common identification switching based on the block head of the created block;
the second block chain sends request information of cross-chain interaction to the first block chain;
the first blockchain authorizes the second blockchain based on the request information such that the first blockchain becomes a main chain of the second blockchain, and the second blockchain becomes a side chain of the first blockchain.
S302, selecting operation nodes on the main chain, wherein the number of the operation nodes is at least two;
after initializing the main chain and the side chain, selecting nodes on the first block chain as operation nodes, wherein the number of the operation nodes is m, and m is a natural number greater than 1. By adopting at least two operation nodes, the problem that the consistency of cross-chain data is influenced by errors of a single operation node can be effectively avoided.
S303, defining a mode that the main chain transmits cross-chain data to the side chain to be that the operation node performs main chain block synchronous processing on the main chain and performs main chain data synchronous processing on the main chain;
and defining the mode of transmitting the cross-chain data from the main chain to the side chain and the mode of transmitting the cross-chain data from the side chain to the main chain. The step of the operation node performing the main chain block synchronous processing on the main chain comprises the following steps:
the backbone generates a backbone block;
the operational node transmitting a block header of the main chain block to the side chain through a first processor of the main chain;
and after judging that the block head is legal, the first processor stores the public key of the common node in the block head of the main chain block into the second processor of the side chain.
The step of performing main chain data synchronous processing on the main chain comprises the following steps:
and the operation node performs data synchronization processing on the main chain in a data signature mode.
According to a specific implementation manner of the embodiment of the present invention, the step of performing the main chain data synchronization processing on the main chain includes:
the operation node extracts cross-chain data of x common recognition nodes in the main chain, wherein x is a natural number greater than 0, and the cross-chain data comprises main chain transaction data and signatures of the main chain transaction data;
the operation node judges whether at least y main chain transaction data in the x main chain transaction data are the same or not, wherein y is a natural number larger than 0, and is smaller than or equal to x;
the operation node transmits the cross-chain data with the same main chain transaction data to the side chain through the first processor under the condition that at least y main chain transaction data are determined to be the same;
the second processor receives the cross-chain data and verifies the signature of the cross-chain data according to the public key in the second processor;
and if the signatures of at least y pieces of the cross-chain data pass verification, the main chain data synchronization processing is completed.
And repeatedly executing the receiving and checking operations until the cross-chain data is not increased any more.
And S304, defining a mode of transmitting chain-crossing data from the side chain to the main chain as that the operation node performs side chain block synchronous processing on the side chain and performs side chain data synchronous processing on the side chain.
Accordingly, the way of transmitting the cross-chain data from the side chain to the main chain is defined to include performing the side chain block synchronization processing on the side chain and performing the side chain data synchronization processing on the side chain. Wherein the step of the operation node performing the side chain block synchronization process on the side chain comprises:
the side chains generate side chain blocks;
the operational node transmitting, by the second processor, a block header of the sidechain block to the sidechain;
and after judging that the block head is legal, the second processor stores the public key of the common node in the block head of the side chain block into the first processor.
Further, the step of performing side chain data synchronization processing on the side chain includes:
the operation node performs data synchronization processing on the side chain in a data signature mode
In a specific implementation, the step of performing side chain data synchronization processing on the side chain includes:
the operation node extracts cross-chain data of x common recognition nodes in the side chain, wherein x is a natural number greater than 0, and the cross-chain data comprises side chain transaction data and signatures of the side chain transaction data;
judging whether at least y side chain transaction data in the x side chain transaction data are the same or not, wherein y is a natural number larger than 0;
the operating node transmits the cross-chain data with the same side-chain transaction data to the main chain through the second processor under the condition that at least y side-chain transaction data are determined to be the same;
the first processor receives the cross-chain data and verifies the signature of the cross-chain data according to the public key in the first processor;
and if the signatures of at least y pieces of the cross-chain data pass the verification, finishing the synchronous processing of the side-chain data.
And repeatedly executing the receiving and checking operations until the cross-chain data is not increased any more.
According to the block chain cross-chain interaction method provided by the embodiment of the invention, the main chain block synchronous processing or the side chain block synchronous processing is firstly carried out, and then the main chain data synchronous processing or the side chain data synchronous processing is carried out, so that the consistency of cross-chain data interaction is ensured.
Corresponding to the above method embodiment, referring to fig. 2, an embodiment of the present invention further provides a block chain cross-chain interaction method system, where the system includes: a main chain 210, a side chain 220, and a client 230; wherein,
the client is used for registering each timing task of each application and transmitting a registration result to the main chain;
the main chain is used for initiating a task uplink notification after monitoring that the target timed task is on the main chain, wherein the task uplink notification is used for indicating the transaction state of the target timed task on the main chain and uplink, and the target timed task is any one of all timed tasks registered by the client;
the side chain is used for acquiring and executing the target timing task from the main chain in a mode of transmitting cross-chain data;
the side chain is used for modifying the state of the target timing task into a stop state and synchronously updating the stop state of the target timing task after the execution is finished to the main chain in a mode of transmitting cross-chain data;
ending the target timing task at the main chain and the side chain.
In summary, according to the block chain cross-chain interaction scheme provided in the embodiment of the present invention, each timing task of each application is registered in the main chain registration center, and the registration result is transmitted to each node of the block chain, the side chain monitors and executes the timing task of the main node, and after the execution is completed, the timing task state data and the user state data are returned to the main chain node, so that on the premise that the main chain and the side chain data are synchronized and consistent, the purpose of unified management and concurrent control of the timing tasks of multiple applications by the main chain system is improved, the overall transaction performance of the main chain node is improved, and the user-oriented method is more friendly.
The system shown in fig. 2 can correspondingly execute the content in the above method embodiment, and details of the part not described in detail in this embodiment refer to the content described in the above method embodiment, which is not described again here.
Embodiments of the present invention also provide a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the block chain cross-chain interaction method in the foregoing method embodiments.
Embodiments of the present invention also provide a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the block chain cross-chain interaction method in the aforementioned method embodiments.
It should be noted that the computer readable medium of the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. 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 of the computer readable storage medium may include, but are not limited to: 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 present invention, 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. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either 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: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, enable the electronic device to implement the schemes provided by the method embodiments.
Alternatively, the computer readable medium carries one or more programs, which when executed by the electronic device, enable the electronic device to implement the schemes provided by the method embodiments.
Computer program code for carrying out operations for aspects 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 + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A block chain cross-chain interaction method is applied to a block chain cross-chain interaction system, and the block chain cross-chain interaction system comprises a main chain, a side chain and a client; the method comprises the following steps:
the client registers each timing task of each application and transmits a registration result to the main chain;
initiating a task uplink notification after monitoring that the target timed task is uplink on the main chain, wherein the task uplink notification is used for indicating the transaction state of the target timed task on the main chain and uplink, and the target timed task is any one of all timed tasks registered by the client;
the side chain acquires and executes the target timing task from the main chain in a mode of transmitting cross-chain data;
the side chain modifies the state of the target timing task into a stop state, and synchronously updates the stop state of the target timing task after the execution is finished to the main chain in a mode of transmitting cross-chain data;
ending the target timing task at the main chain and the side chain.
2. The method of claim 1, wherein after the step of the sidechain obtaining and executing the target timing task from the main chain by means of transmitting cross-chain data, the method further comprises:
the side chain synchronizes the original user state data of the main chain in a mode of transmitting cross-chain data;
persisting the user state data; and the number of the first and second groups,
after the step of synchronously updating the stop state of the target timing task after the completion of the execution to the main chain by means of transmitting cross-chain data, the method further comprises:
the side chain synchronously updates the user state data to the main chain by transmitting cross-chain data.
3. The method of claim 2, wherein the step of the client registering the respective timing task for each application is preceded by the method further comprising:
initializing the first block chain and the second block chain so that the first block chain becomes a main chain of the second block chain and the second block chain becomes a side chain of the first block chain;
selecting operation nodes on the main chain, wherein the number of the operation nodes is at least two;
defining a mode of transmitting cross-link data from the main chain to the side chain as that the operation node performs main chain block synchronous processing on the main chain and performs main chain data synchronous processing on the main chain;
defining a mode of transmitting chain-crossing data from the side chain to the main chain as that the operation node performs side chain block synchronous processing on the side chain and performs side chain data synchronous processing on the side chain.
4. The method of claim 3, wherein the step of performing backbone data synchronization processing on the backbone comprises:
the operation node performs data synchronization processing on the main chain in a data signature mode; and/or the presence of a gas in the gas,
the step of performing side chain data synchronization processing on the side chain comprises:
and the operation node performs data synchronization processing on the side chain in a data signature mode.
5. The method of claim 4, wherein the step of initializing a first blockchain and a second blockchain such that the first blockchain becomes a main chain of the second blockchain and the second blockchain becomes a side chain of the first blockchain comprises:
generating a created block by the second block chain, and sending a block header of the created block to the first block chain;
the second block chain acquires and stores the block head of the block returned after the first block chain performs the common identification switching based on the block head of the created block;
the second block chain sends request information of cross-chain interaction to the first block chain;
the first blockchain authorizes the second blockchain based on the request information such that the first blockchain becomes a main chain of the second blockchain, and the second blockchain becomes a side chain of the first blockchain.
6. The method of claim 5, wherein the step of the operation node performing the backbone block synchronization process on the backbone comprises:
the backbone generates a backbone block;
the operational node transmitting a block header of the main chain block to the side chain through a first processor of the main chain;
and after judging that the block head is legal, the first processor stores the public key of the common node in the block head of the main chain block into the second processor of the side chain.
7. The method of claim 6, wherein the step of performing backbone data synchronization processing on the backbone comprises:
the operation node extracts cross-chain data of x common recognition nodes in the main chain, wherein x is a natural number greater than 0, and the cross-chain data comprises main chain transaction data and signatures of the main chain transaction data;
the operation node judges whether at least y main chain transaction data in the x main chain transaction data are the same or not, wherein y is a natural number larger than 0, and is smaller than or equal to x;
the operation node transmits the cross-chain data with the same main chain transaction data to the side chain through the first processor under the condition that at least y main chain transaction data are determined to be the same;
the second processor receives the cross-chain data and verifies the signature of the cross-chain data according to the public key in the second processor;
and if the signatures of at least y pieces of the cross-chain data pass verification, the main chain data synchronization processing is completed.
8. The method of claim 7, wherein the step of the operation node performing the side chain block synchronization process on the side chain comprises:
the side chains generate side chain blocks;
the operational node transmitting, by the second processor, a block header of the sidechain block to the sidechain;
and after judging that the block head is legal, the second processor stores the public key of the common node in the block head of the side chain block into the first processor.
9. The method of claim 8, wherein the step of performing side chain data synchronization processing on the side chains comprises:
the operation node extracts cross-chain data of x common recognition nodes in the side chain, wherein x is a natural number greater than 0, and the cross-chain data comprises side chain transaction data and signatures of the side chain transaction data;
judging whether at least y side chain transaction data in the x side chain transaction data are the same or not, wherein y is a natural number larger than 0;
the operating node transmits the cross-chain data with the same side-chain transaction data to the main chain through the second processor under the condition that at least y side-chain transaction data are determined to be the same;
the first processor receives the cross-chain data and verifies the signature of the cross-chain data according to the public key in the first processor;
and if the signatures of at least y pieces of the cross-chain data pass the verification, finishing the synchronous processing of the side-chain data.
10. A blockchain inter-chain system, the system comprising: a main chain, a side chain and a client; wherein,
the client is used for registering each timing task of each application and transmitting a registration result to the main chain;
the main chain is used for initiating a task uplink notification after monitoring that the target timed task is on the main chain, wherein the task uplink notification is used for indicating the transaction state of the target timed task on the main chain and uplink, and the target timed task is any one of all timed tasks registered by the client;
the side chain is used for acquiring and executing the target timing task from the main chain in a mode of transmitting cross-chain data;
the side chain is used for modifying the state of the target timing task into a stop state and synchronously updating the stop state of the target timing task after the execution is finished to the main chain in a mode of transmitting cross-chain data;
ending the target timing task at the main chain and the side chain.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010305381.XA CN111507694A (en) | 2020-04-17 | 2020-04-17 | Block chain cross-chain interaction method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010305381.XA CN111507694A (en) | 2020-04-17 | 2020-04-17 | Block chain cross-chain interaction method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111507694A true CN111507694A (en) | 2020-08-07 |
Family
ID=71877641
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010305381.XA Withdrawn CN111507694A (en) | 2020-04-17 | 2020-04-17 | Block chain cross-chain interaction method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111507694A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112256792A (en) * | 2020-09-17 | 2021-01-22 | 南京数字星球科技有限公司 | Block chain cross-chain data interaction and verification method, block chain system and storage medium |
CN112801795A (en) * | 2021-03-08 | 2021-05-14 | 中国工商银行股份有限公司 | Block chain multi-chain management method and device, electronic equipment and readable storage medium |
CN113052697A (en) * | 2021-03-10 | 2021-06-29 | 从法信息科技有限公司 | Reliability-based cross-chain task execution method and device and electronic equipment |
-
2020
- 2020-04-17 CN CN202010305381.XA patent/CN111507694A/en not_active Withdrawn
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112256792A (en) * | 2020-09-17 | 2021-01-22 | 南京数字星球科技有限公司 | Block chain cross-chain data interaction and verification method, block chain system and storage medium |
CN112801795A (en) * | 2021-03-08 | 2021-05-14 | 中国工商银行股份有限公司 | Block chain multi-chain management method and device, electronic equipment and readable storage medium |
CN112801795B (en) * | 2021-03-08 | 2024-04-02 | 中国工商银行股份有限公司 | Block chain multi-chain management method, device, electronic equipment and readable storage medium |
CN113052697A (en) * | 2021-03-10 | 2021-06-29 | 从法信息科技有限公司 | Reliability-based cross-chain task execution method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107577427B (en) | data migration method, device and storage medium for blockchain system | |
CN108037946B (en) | Method, system and server for hot updating of application program | |
US11336451B2 (en) | Cross-blockchain resource transmission | |
WO2019144761A1 (en) | Data synchronization method, distributed system and device | |
CN109951547B (en) | Transaction request parallel processing method, device, equipment and medium | |
CN109492380B (en) | Equipment authentication method and device and block link point | |
CN111507694A (en) | Block chain cross-chain interaction method and system | |
CN108984645B (en) | Block chain processing method, device, equipment and storage medium | |
CN110766408A (en) | Cross-chain transaction verification method, engine, equipment and storage medium for heterogeneous block chain | |
KR102288521B1 (en) | Apparatus and method for storing data based on blockchain | |
US20200366485A1 (en) | Method and apparatus for inter-blockchain transmission of authenticable message | |
CN110391938B (en) | Method and apparatus for deploying services | |
KR101422563B1 (en) | Method and system for efficient download of data package | |
CN111163182A (en) | Block chain-based device registration method and apparatus, electronic device, and storage medium | |
CN112714158B (en) | Transaction processing method, relay network, cross-link gateway, system, medium and equipment | |
CN113505520A (en) | Method, device and system for supporting heterogeneous federated learning | |
CN112182113B (en) | Block chain consensus method, system, electronic equipment and storage medium | |
CN111818194A (en) | Domain name based access system and method | |
CN109088914B (en) | Block generation method, block chain ecosystem and computer readable storage medium | |
CN111597567A (en) | Data processing method, data processing device, node equipment and storage medium | |
CN113610527B (en) | Alliance chain transaction method, device, system, terminal equipment and storage medium | |
CN111310242B (en) | Method and device for generating device fingerprint, storage medium and electronic device | |
CN112988738B (en) | Data slicing method and device for block chain | |
CN113779004A (en) | Data verification method and device | |
CN114221971B (en) | Data synchronization method, device, server, storage medium and product |
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 | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20201014 Address after: No.1700 Gangyan Road, Gangyan Town, Chongming District, Shanghai 202150 Applicant after: Shanghai Youlian Technology Co.,Ltd. Address before: Room 3001, 30 / F, block T1, Changning Raffles office building, 1139 Changning Road, Changning District, Shanghai 200050 Applicant before: Shanghai Hashi Technology Co.,Ltd. |
|
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20200807 |