Main-sub chain cross-chain communication system and method based on secondary nodes

By introducing a cross-chain communication system based on secondary nodes between the main sub-chain, the problem of transaction limitations between the main sub-chain is solved, more efficient data sharing and interoperability is achieved, system performance and security are improved, and a wider range of business needs are supported.

CN119996423APending Publication Date: 2025-05-13BEIJING MICROCHIP EDGE COMPUTING RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510236780.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The transactions between the master chains of the existing technology have limitations, and have failed to effectively solve the key problems in the complex and dynamic activities of actual industry and commerce, and it is difficult to meet the requirements of system performance and security.

Method used

A master sub-chain cross-chain communication system based on secondary nodes is adopted, including the main chain, sub-chain, secondary node cluster module, main chain management module, SPV node and data interaction protocol. The secondary node has a three-layer structure, providing basic services, business process components and business control. The main chain management module is responsible for sub-chain registration and status monitoring. The data interaction protocol specifies cross-chain transaction interaction.

Benefits of technology

It realizes data sharing and interoperability between different sub-chains, improves data utilization efficiency and value circulation, enhances system flexibility and scalability, supports different business needs and application scenarios, reduces development and operation and maintenance costs, and improves system security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119996423A_ABST
    Figure CN119996423A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a main-sub chain cross-chain communication system and method based on a secondary node, a more flexible and compatible framework is built by introducing the secondary node, a cross-chain protocol and a forward and reverse contract technology, and a safe and recoverable transaction environment is provided. According to the method, data sharing and interoperability among different sub-chains are promoted, the utilization efficiency and value circulation of data are improved, and different service requirements and application scenes are supported. Besides, the system can reduce the development and operation and maintenance cost, enhances the security of the whole system by designing a secure cross-chain mechanism, supports large-scale application scenes such as finance and supply chain management, can promote technical innovation and standardization, enhances the trust of a user to the block chain technology, promotes cooperation among different industries, and improves the user experience. And the system is ensured to run in a law and policy framework, so that a solid foundation is laid for constructing more open, interconnected and secure digital economic ecology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of blockchain technology, and specifically to a master-subchain cross-chain communication system and method based on secondary nodes. Background Art

[0002] The master-subchain mechanism is a blockchain architecture design that aims to solve the problem of information islands on existing blockchains through the collaborative work of the master chain and subchains. It achieves data sharing and interaction between different subchains by building a network structure consisting of a master chain and multiple subchains.

[0003] In the current fields of finance, industry, trade, medical services, etc., the master-subchain is rapidly emerging as an innovative blockchain model. Through a layered architecture, the master-subchain has its own emphasis on performance and security, which effectively improves the ternary balance problem of blockchain in terms of performance, security and scalability, and solves the problem of data application islands to a certain extent. However, although the master-subchain mechanism provides an ideal framework in theory, the existing technology still faces some challenges, especially in the cross-chain mechanism of heterogeneous sub-chains, which limits the formation and development of large-scale master-subchain networks. Each sub-chain may adopt different consensus mechanisms, smart contract languages, data structures and security models. This diversity and complexity brings technical difficulties in cross-chain communication and data exchange:

[0004] The current method of deploying cross-chain nodes is more suitable for the interaction of homogeneous blockchains, but its support for heterogeneous chains is slightly insufficient. There is still a big gap between system performance and security and production needs. It fails to solve the problem of atomicity of digital trusted transactions and transactions between master and sub-chains, and lacks coverage of other types of transactions and data circulation transactions besides asset transactions. Summary of the invention

[0005] To this end, the embodiments of the present invention provide a master-subchain cross-chain communication system and method based on secondary nodes to solve the technical problems that the prior art has limitations in transactions between master and subchains, fails to effectively solve key problems in complex and dynamic activities in actual industry and commerce, is difficult to meet the requirements for system performance, and has insufficient security.

[0006] In order to achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0007] According to a first aspect of an embodiment of the present invention, a main-subchain cross-chain communication system based on a secondary node is provided, the system comprising a main chain and multiple subchains, a secondary node cluster module, a main chain management module, an SPV node, and a data interaction protocol;

[0008] The secondary node cluster module is composed of secondary nodes responsible for the main chain and sub-chain. Each secondary node has a three-layer structure: basic layer, component layer and business layer. The basic layer is used to provide basic services for various components of the assembly point. The basic services include logs, databases and network processing. The component layer is used to provide components called by business processes, including channels, routers, listeners, provers and adapters. The business layer is used to control business processes, including event processors and transaction processors.

[0009] The main chain management module is used to allow new subchains to register, identify and manage subchains on the main chain, and is also used to monitor the status of each subchain;

[0010] The SPV node is used to synchronize the latest transaction information on the corresponding main chain or sub-chain in real time and provide a transaction verification interface;

[0011] The data interaction protocol includes cross-chain transaction interaction protocol, transaction contract and business contract (forward and reverse smart contract).

[0012] Furthermore, monitoring the status of each subchain includes:

[0013] Determine whether each subchain is active, and detect the consensus status and node health status of the subchain;

[0014] When a sub-chain is abnormal or down, the main chain management module records the status and takes corresponding countermeasures.

[0015] Furthermore, the cross-chain transaction interaction protocol is used to regulate the data interaction between secondary nodes, specifically including the structures of four types of data: cross-chain events, transaction events, cross-chain event responses, and transaction event responses:

[0016] Cross-chain events describe data objects that users send to secondary nodes through the cross-chain SDK;

[0017] The transaction event describes the message transmission between two secondary node services;

[0018] The cross-chain event response describes the response result of the secondary node to the client after completing the interaction;

[0019] The transaction event response describes the response result to the transaction event.

[0020] Furthermore, the data object of the cross-chain event includes a cross-chain ID, a protocol version number, a timestamp, an execution phase content carrier, a submission phase content carrier, and a rollback phase content carrier;

[0021] The data objects of the transaction event include the cross-chain ID, operation method, sub-chain ID, specific content carrier and submitted transaction proof;

[0022] The data object of the cross-chain event response includes the cross-chain ID, the final result of this cross-chain operation, and the information returned by this cross-chain operation;

[0023] The data object of the transaction event response includes the cross-chain ID, operation method, result of this cross-chain, returned information, sub-chain ID of the specific operation, transaction identification and contract information carrier.

[0024] Furthermore, the transaction contract is used to manage and coordinate cross-chain transactions, track the status of cross-chain transactions, confirm transactions, and trigger a rollback mechanism;

[0025] The transaction contract is deployed on each participating chain, and the integrity and atomicity of cross-chain operations are guaranteed by controlling the execution process of the business contract.

[0026] Furthermore, the business contract includes two smart contracts that cooperate with each other, one of which performs a forward operation on a source chain (execution chain) and the other performs a reverse operation on a target chain (rollback chain);

[0027] The forward contract is deployed on the source chain and is used to lock assets, transfer data, and call services, including three functions: lock, confirm, and rollback.

[0028] The reverse contract is deployed on the target chain and is used to perform rollback and cancellation operations when cross-chain transactions fail, ensuring the atomicity of transactions.

[0029] Furthermore, the system also includes a cross-chain SDK, which is used to provide a standardized API interface for connecting the business system with the secondary node, so that the business system can call blockchain functions and convert the data format in the business system into a format that can be processed by the secondary node.

[0030] According to a second aspect of an embodiment of the present invention, a master-subchain cross-chain communication method based on a secondary node is provided, the method comprising master-subchain cross-chain communication and sub-subchain cross-chain communication:

[0031] The main-subchain cross-chain communication methods include:

[0032] The subchain business system calls the cross-chain SDK to send cross-chain transactions to the subchain secondary node;

[0033] The secondary node of the subchain parses and obtains the corresponding subchain execution transaction, and sends the transaction instruction to the first subchain;

[0034] The first subchain executes the transaction. After the transaction is completed, the first SPV node synchronizes the latest transaction information of the first subchain in real time;

[0035] Return the execution result of the current transaction to the subchain secondary node;

[0036] The subchain secondary node converts the response into a subchain transaction proof, and forwards the transaction and transaction proof to the mainchain secondary node;

[0037] The secondary node of the main chain calls the transaction verification interface of the first SPV node;

[0038] The first SPV node verifies the transaction. If the verification is successful, it returns the verification response result. At the same time, the secondary node of the main chain sends the sub-chain transaction certificate to the main chain;

[0039] The main chain calls the transaction contract to store the sub-chain transaction proof and returns the execution result of the sub-chain transaction proof storage to the secondary node;

[0040] The secondary node of the main chain parses and obtains the corresponding transaction in the main chain, and sends the transaction request to the main chain. The main chain executes the transaction. After the transaction is executed, the main SPV node synchronizes the latest transaction information on the main chain in real time;

[0041] The main chain returns the transaction response to the main chain secondary node, which converts the response into a main chain transaction certificate and sends the transaction certificate to the sub-chain secondary node;

[0042] After receiving the main chain transaction proof, the secondary node of the subchain calls the transaction verification interface of the main SPV node to verify the transaction and returns the verification response result;

[0043] If the verification is successful, the main chain transaction proof is sent to the first sub-chain, and the first sub-chain executes and stores the main chain transaction proof and returns the execution result stored in the sub-chain secondary node;

[0044] The secondary node of the subchain submits the first Commit transaction, completes the Commit scheduling, and notifies the secondary node of the mainchain to perform the Commit operation;

[0045] The secondary node of the main chain parses and receives the Commit message, submits the Commit transaction of the main chain, and updates the transaction contract status of the main chain;

[0046] The secondary node of the subchain summarizes the execution status of the transaction, generates cross-chain transaction feedback, and returns it to the business system.

[0047] Furthermore, the sub-sub-chain cross-chain communication method includes:

[0048] The second subchain business system calls the cross-chain SDK to send the cross-chain transaction to the second subchain’s secondary node. The second subchain’s secondary node parses and obtains the corresponding subchain execution transaction, and sends the transaction instruction to the second subchain;

[0049] The second subchain executes the transaction. After the transaction is completed, the second SPV node will synchronize the latest transaction information of the second subchain in real time;

[0050] Return the execution result of the current transaction to the secondary node of the second subchain;

[0051] The second subchain secondary node converts the response into a subchain transaction proof, and forwards the transaction and the transaction proof to the third subchain secondary node. The third subchain secondary node calls the transaction verification interface of the second SPV node to verify the transaction and returns the verification response result;

[0052] If the verification is successful, the secondary node of the third subchain sends the subchain transaction proof to the third subchain, and the third subchain calls the transaction contract to store the subchain transaction proof, and returns the execution result of the transaction proof storage to the secondary node subchain;

[0053] The secondary node of the third subchain parses and obtains the corresponding transaction in the third subchain, and sends a transaction request to the third subchain. The third subchain executes the transaction. After the corresponding transaction is completed: the third SPV node will synchronize the latest transaction information on the third subchain in real time;

[0054] The third subchain returns the transaction response to the third subchain secondary node. The third subchain secondary node converts the response into a third subchain transaction certificate and sends the transaction certificate to the second subchain secondary node. After receiving the third subchain transaction certificate, the second subchain secondary node calls the transaction verification interface of the third SPV node to verify the transaction and returns the verification response result.

[0055] If the verification is successful, the second subchain secondary node will send the third subchain transaction certificate to the second subchain. The second subchain will execute and store the third subchain transaction certificate and return the execution result to the second subchain secondary node.

[0056] The second subchain secondary node performs Commit scheduling, submits the Commit transaction of the second subchain and notifies the third subchain secondary node to perform the Commit operation;

[0057] The secondary node of the third subchain parses and receives the Commit message, and submits the Commit transaction of the third subchain;

[0058] The secondary node of the second subchain summarizes the execution status of the transaction, generates cross-chain transaction feedback, and returns it to the business system;

[0059] The second subchain secondary node forwards the transaction execution status and transaction proof to the main chain secondary node. The main chain secondary node calls the transaction verification interface of the second SPV interface to verify the transaction and returns the verification response result;

[0060] If the verification is successful, the secondary node of the main chain sends the transaction execution status and transaction proof to the main chain, and the main chain calls the transaction contract to store the transaction execution status and transaction proof.

[0061] Furthermore, the execution steps of the business contract are as follows:

[0062] The user locks the asset by calling the lock function of the forward contract;

[0063] Perform transaction operations on the target chain through a pre-defined bridging mechanism and determine whether the transaction is successful;

[0064] When the transaction on the target chain is successful, the forward contract on the source chain calls the confirmation function to complete the transaction;

[0065] If the transaction fails or times out, the forward contract on the source chain calls the rollback function, triggering the reverse contract on the target chain to perform a rollback operation.

[0066] The embodiments of the present invention have the following advantages:

[0067] The embodiments of the present invention build a more flexible and compatible framework and provide a secure and recoverable transaction environment by introducing secondary nodes, cross-chain protocols and forward and reverse contract technologies. The construction of the present invention helps to promote data sharing and interoperability between different sub-chains, improve data utilization efficiency and value circulation, and can also improve the flexibility and scalability of the system to support different business needs and application scenarios. In addition, this system can reduce development and operation and maintenance costs, enhance the security of the overall system by designing a secure cross-chain mechanism, support large-scale application scenarios such as finance and supply chain management, and promote technological innovation and standardization, enhance user trust in blockchain technology, promote cooperation between different industries, and ensure that the system operates within the legal and policy framework, thereby laying a solid foundation for building a more open, interconnected and secure digital economic ecosystem. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.

[0069] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.

[0070] Figure 1A schematic diagram of the logical structure of a master-subchain cross-chain communication system based on secondary nodes provided in an embodiment of the present invention;

[0071] Figure 2 A schematic diagram of a secondary node module in a primary-subchain cross-chain communication system based on a secondary node provided in an embodiment of the present invention;

[0072] Figure 3 A schematic diagram of a general cross-chain process between a master and a sub-chain in a master-sub-chain cross-chain communication method based on a secondary node provided in an embodiment of the present invention;

[0073] Figure 4 A schematic diagram of a general sub-sub-chain cross-chain process in a main-sub-chain cross-chain communication method based on secondary nodes provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0074] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0075] In order to solve the technical problem that the above-mentioned method of avoiding radar interference through passive resistance cannot ensure the effectiveness of avoiding interference.

[0076] refer to Figure 1 , an embodiment of the present invention discloses a main-subchain cross-chain communication system based on secondary nodes, the system includes a main chain and multiple subchains, a secondary node cluster module, a main chain management module, an SPV node, and a data interaction protocol;

[0077] The secondary node cluster module is composed of secondary nodes responsible for the main chain and sub-chains. Figure 2 Each secondary node has a three-layer structure: a basic layer, a component layer, and a business layer. The basic layer is used to provide basic services for each component of the assembly point, including logs, databases, and network processing. The component layer is used to provide components called by business processes, including channels, routers, listeners, certifiers, and adapters. The business layer is used to control business processes, including event processors and transaction processors.

[0078] Secondary node cluster: The secondary node cluster is composed of secondary nodes responsible for the main chain and sub-chain. Each secondary node adopts a layered design and is mainly divided into three layers: basic layer, component layer and business layer. Basic layer: provides basic services for each component of the secondary node, mainly including logs, databases and network processing; component layer: provides various components for business process calls, including but not limited to channels, routes, listeners, certifiers, adapters, etc.; business layer: the main business process control, including a variety of event processors Handler and transaction managers.

[0079] The main chain management module is used to allow new sub-chains to register, identify and manage sub-chains on the main chain, and is also used to monitor the status of each sub-chain; the SPV node is used to synchronize the latest transaction information on the corresponding main chain or sub-chain in real time, and provide a transaction verification interface; the data interaction protocol includes a cross-chain transaction interaction protocol, a transaction contract and a business contract (forward and reverse smart contracts).

[0080] During the registration process, the subchain provides its basic information (such as chain ID, validator set, consensus mechanism, etc.), and the main chain management module records this information to identify and manage the subchain. In addition, it will monitor the status of each subchain, including whether it is active, consensus status, node health status, etc.

[0081] Furthermore, monitoring the status of each sub-chain includes: determining whether each sub-chain is active, detecting the consensus status and node health status of the sub-chain; when a sub-chain is abnormal or shut down, the main chain management module records the status and executes corresponding countermeasures.

[0082] The cross-chain transaction interaction protocol is a set of protocols that regulate data interaction between secondary nodes. It is only a description of the main cross-chain data structure and does not limit the transmission method used between different main and sub-chains. The cross-chain protocol describes the structure of four major types of data: cross-chain events, transaction events, cross-chain event responses, and transaction event responses. Among them, cross-chain events describe the data objects sent by users to secondary nodes through the cross-chain SDK; transaction events describe the message transmission between two secondary node services; cross-chain event responses are the response results of the secondary node to the client after completing the interaction; and transaction event responses are the response results of transaction events.

[0083] Furthermore, the cross-chain transaction interaction protocol is used to regulate the data interaction between secondary nodes, specifically including the structures of four types of data: cross-chain events, transaction events, cross-chain event responses, and transaction event responses: cross-chain events describe the data objects sent by users to secondary nodes through the cross-chain SDK; transaction events describe the message transmission between two secondary node services; cross-chain event responses describe the response results of the secondary nodes to the client after completing the interaction; and transaction event responses describe the response results to transaction events.

[0084] Furthermore, the data objects of the cross-chain event include the cross-chain ID, protocol version number, timestamp, execution phase content carrier, submission phase content carrier and rollback phase content carrier; the data objects of the transaction event include the cross-chain ID, operation method (i.e., execution, confirmation, rollback), sub-chain ID, specific content carrier and submitted transaction proof;

[0085] The data object of the cross-chain event response includes the cross-chain ID, the final result of this cross-chain (0: success; 1: failure; 2: unknown) and the information returned by this cross-chain operation;

[0086] The data object of the transaction event response includes the cross-chain ID, operation method, result of this cross-chain, returned information, sub-chain ID of the specific operation, transaction identification and contract information carrier.

[0087] Furthermore, the transaction contract is used to manage and coordinate cross-chain transactions, track the status of cross-chain transactions, confirm transactions and trigger rollback mechanisms; the transaction contract is deployed on each participating chain, and the integrity and atomicity of cross-chain operations are guaranteed by controlling the execution process of the business contract.

[0088] The contract layer is divided into transaction contracts and business contracts. Transaction contracts are used to manage and coordinate cross-chain transactions and are responsible for ensuring the atomicity of cross-chain transactions. The main functions include cross-chain transaction status tracking, transaction confirmation, and triggering of rollback mechanisms. Transaction contracts are deployed on each participating chain to ensure the integrity of cross-chain operations by controlling the execution process of business contracts.

[0089] Furthermore, the business contract includes two smart contracts that cooperate with each other, one of which performs a forward operation on a source chain (execution chain) and the other performs a reverse operation on a target chain (rollback chain);

[0090] The forward contract is deployed on the source chain and is used to lock assets, transfer data, and call services, including three functions: lock, confirm, and rollback.

[0091] The reverse contract is deployed on the target chain and is used to perform rollback and cancellation operations when cross-chain transactions fail, ensuring the atomicity of transactions.

[0092] Main-child chain transactions involve the transfer of assets or data between different blockchains. In order to ensure the security and atomicity of cross-chain transactions, the business contract design uses a set of forward and reverse smart contracts, including two cooperating smart contracts, one performs forward operations on the source chain (execution chain), and the other performs reverse operations on the target chain (rollback chain).

[0093] The forward contract is deployed on the source chain (such as a child chain) and is responsible for executing the forward operations of cross-chain transactions, such as locking assets, transferring data, or calling a service; waiting for the agreed conditions on the target chain to be met or an event to occur (such as successful receipt of assets), and then completing the transaction. The forward contract includes three functions: locking, confirming, and rolling back.

[0094] The reverse contract is deployed on the target chain (such as the main chain) and is responsible for performing rollback and cancellation operations when cross-chain transactions fail. If the transaction on the target chain is not successfully completed or a problem occurs, the reverse smart contract will trigger a rollback to ensure the atomicity of the transaction.

[0095] Furthermore, the system also includes a cross-chain SDK, which is a tool set for connecting the business system with the blockchain secondary node. The cross-chain SDK is used to provide a standardized API interface for connecting the business system with the secondary node, enabling the business system to call blockchain functions and converting the data format in the business system into a format that can be processed by the secondary node.

[0096] Corresponding to the above-disclosed primary-subchain cross-chain communication system based on secondary nodes, the embodiment of the present invention also discloses a primary-subchain cross-chain communication method based on secondary nodes. The following describes in detail a primary-subchain cross-chain communication method based on secondary nodes disclosed in the embodiment of the present invention in combination with the above-described primary-subchain cross-chain communication system based on secondary nodes.

[0097] The present invention discloses a main-subchain cross-chain communication method based on secondary nodes, which includes main-subchain cross-chain communication and sub-subchain cross-chain communication.

[0098] Usually the main and sub-chains are isomorphic blockchains, and cross-chain services are relatively simple. To cope with heterogeneous situations, a general cross-chain process is designed by taking the sub-chain sending transaction as an example. Figure 3As shown in the figure, take the example of subchain 1 sending a transaction to the main chain: 1) The subchain business system calls the cross-chain SDK to send the cross-chain transaction to the subchain secondary node; 2) The subchain secondary node parses and obtains the corresponding subchain execution transaction, and sends the transaction instruction to subchain 1; 3) Subchain 1 executes the transaction (divided into two steps: the transaction contract calls the business contract); 4) After the execution of the transaction on the subchain is completed; the SPV1 (subchain 1) node will synchronize the latest transaction information of subchain 1 in real time; 5) Return the execution result of the current transaction to the subchain secondary node; 6) The subchain secondary node converts the response into a subchain transaction certificate, and forwards the transaction and transaction certificate to the main chain secondary node point; 7) The secondary node of the main chain calls the transaction verification interface of SPV1 (child); 8) SPV1 (child) verifies the transaction and returns the verification response result; 9) If the verification is successful, the secondary node of the main chain sends the subchain transaction certificate to the main chain; 10) The main chain calls the transaction contract to store the subchain transaction certificate (calling the transaction contract, the transaction calls the business contract); 11) The main chain returns the execution result of the subchain transaction certificate storage to the secondary node; 12) The secondary node of the main chain parses and obtains the corresponding transaction in the main chain, and sends the transaction request to the main chain; 13) The main chain executes the transaction (calling the transaction contract, the transaction contract calls the business contract); 1 4) After the corresponding transaction on the main chain is executed: the SPV0 (main) node will synchronize the latest transaction information on the main chain in real time; 15) The main chain returns the transaction response to the main chain secondary node; 16) The main chain secondary node converts the response into a main chain transaction certificate and sends the transaction certificate to the sub-chain secondary node; 17) After receiving the main chain transaction certificate, the sub-chain secondary node calls the transaction verification interface of SPV0 (main); 18) SPV0 (main) verifies the transaction and returns the verification response result; 19) After the verification is successful, the sub-chain secondary node sends the main chain transaction certificate to sub-chain 1; 20) Sub-chain 1 executes the storage of the main chain transaction certificate (call 1) The subchain returns the execution result stored in the subchain secondary node; 2) The subchain secondary node performs Commit scheduling: the subchain secondary node submits the Commit transaction of subchain 1 (updates the transaction contract status on the subchain); 23) The subchain secondary node simultaneously notifies the main chain secondary node to perform the Commit operation; 24) The main chain secondary node parses the received Commit message and submits the main chain's Commit transaction (the main chain updates the transaction contract status); 25) The subchain secondary node summarizes the execution status of the transaction, generates cross-chain transaction feedback, and returns it to the business system.

[0099] Further, refer to Figure 4 , take subchain 1 sending a transaction to subchain 2 as an example:

[0100] 1) The business system of subchain 1 calls the cross-chain SDK to send the cross-chain transaction to the secondary node of subchain 1; 2) The secondary node of subchain 1 parses and obtains the corresponding subchain execution transaction, and sends the transaction instruction to subchain 1; 3) Subchain 1 executes the transaction (divided into two steps: the transaction contract calls the business contract); 4) After the execution of the transaction on subchain 1 is completed; the SPV1 (subchain 1) node will synchronize the latest transaction information of subchain 1 in real time; 5) Return the execution result of the current transaction to the secondary node of subchain 1; 6) The secondary node of subchain 1 converts the response into a subchain transaction certificate, and forwards the transaction and transaction certificate to the secondary node of subchain 2; 7) The secondary node of subchain 2 calls S PV1 (child) transaction verification interface; 8) SPV1 (child) verifies the transaction and returns the verification response result; 9) If the verification is successful, the secondary node of subchain 2 sends the subchain transaction certificate to subchain 2; 10) Subchain 2 calls the transaction contract to store the subchain transaction certificate (calling the transaction contract, the transaction calls the business contract); 11) Subchain 2 returns the execution result of the subchain transaction certificate storage to the secondary node; 12) Subchain 2 secondary node parses and obtains the corresponding transaction in subchain 2, and sends the transaction request to subchain 2; 13) Subchain 2 executes the transaction (calling the transaction contract, the transaction contract calls the business contract); 14) The corresponding transaction on subchain 2 After the execution is completed: the SPV2 (child) node will synchronize the latest transaction information on subchain 2 in real time; 15) Subchain 2 returns the transaction response to the subchain 2 secondary node; 16) The subchain 2 secondary node converts the response into a subchain 2 transaction certificate and sends the transaction certificate to the subchain 1 secondary node; 17) After receiving the subchain 2 transaction certificate, the subchain 1 secondary node calls the SPV2 (child) transaction verification interface; 18) SPV2 (child) verifies the transaction and returns the verification response result; 19) After the verification is successful, the subchain 1 secondary node sends the subchain 2 transaction certificate to subchain 1; 20) Subchain 1 executes the storage of subchain 2 transaction proof (calling transaction verification 1) Subchain 1 returns the execution result stored in the secondary node of subchain 1; 2) Subchain 1 secondary node performs Commit scheduling: the secondary node of subchain submits the Commit transaction of subchain 1 (updates the transaction contract status on the subchain); 23) The secondary node of subchain 1 simultaneously notifies the secondary node of subchain 2 to perform the Commit operation; 24) The secondary node of subchain 2 parses the received Commit message and submits the Commit transaction of subchain 2 (subchain 2 updates the transaction contract status); 25) The secondary node of subchain 1 summarizes the execution status of the transaction, generates cross-chain transaction feedback, and returns it to the business system.26) The secondary node of subchain 1 forwards the transaction execution status and transaction proof to the secondary node of mainchain 0; 27) The secondary node of mainchain 0 calls the transaction verification interface of SPV1 (sub); 28) SPV1 (sub) verifies the transaction and returns the verification response result; 29) If the verification is successful, the secondary node of mainchain 0 sends the transaction execution status and transaction proof to mainchain 0; 30) Mainchain 0 calls the transaction contract to store the transaction execution status and transaction proof (calling the transaction contract, the transaction calls the business contract).

[0101] Furthermore, the execution steps of the business contract are as follows: the user locks the asset by calling the lock function of the forward contract; the transaction operation on the target chain is performed through a pre-defined bridging mechanism to determine whether the transaction is successful; when the transaction on the target chain is successful, the forward contract on the source chain calls the confirmation function to complete the transaction; if the transaction fails or times out, the forward contract on the source chain calls the rollback function, triggering the reverse contract on the target chain to perform a rollback operation.

[0102] The embodiment of the present invention includes a main sub-chain, a cross-chain SDK, a secondary node module, and a cross-chain interaction protocol. The secondary node is the core agent for transactions between the main sub-chain and the sub-sub-chain. The main chain and each sub-chain have their own secondary nodes to form a secondary node cluster. The secondary node adopts a layered design, which is mainly divided into three layers: the basic layer, the component layer, and the business layer. The protocol for data exchange between secondary nodes includes four major data structure specifications. The protocol is only a description of the format of the main event data, and does not restrict the developer to use any transmission method, thereby ensuring scalability and compatibility.

[0103] The embodiments of the present invention have the following advantages:

[0104] (1) Main-subchain cross-chain method based on secondary nodes: The present invention designs a general cross-chain architecture of the main-subchain system, which mainly includes the main chain, subchain, secondary node, SPV node and main chain management module. The secondary node is the core agent for transactions between the main-subchain and sub-subchain. The main chain and each subchain have their own secondary nodes to form a secondary node cluster. The data communication between the secondary nodes is managed by the cross-chain interaction protocol, which standardizes the general structure of cross-chain data; the corresponding forward and reverse contracts are deployed on the main-subchain according to the business process, and rollback operations can be performed to ensure the atomicity of transactions;

[0105] (2) Cross-chain interaction protocol: In response to the general cross-chain requirements of heterogeneous blockchains, the present invention establishes a set of protocols to regulate data interaction between secondary nodes. It is only a description of the main cross-chain event data structure, and does not limit the transmission method used between the main chain and the sub-chain, thereby improving compatibility;

[0106] (3) Forward and reverse contracts: The design of forward and reverse contracts can ensure the atomicity of cross-chain transactions, reduce the risk of asset or data loss due to cross-chain transaction failure, and thus improve the security of cross-chain operations. In addition, they have good compatibility and are compatible with existing or future cross-chain standards, and can support operations between chains with different consensus mechanisms. The interaction logic between the main chain and sub-chains can be achieved by extending the forward and reverse contracts. This scalability makes the integration of new sub-chains easier without requiring major modifications to the existing main-sub-chain architecture.

[0107] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention can be implemented using a combination of hardware and software. When software is used, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media can be any available media that can be accessed by general or special-purpose computers.

[0108] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.

Claims

1. A main-subchain cross-chain communication system based on secondary nodes, characterized in that: The system includes a main chain and multiple sub-chains, a secondary node cluster module, a main chain management module, an SPV node, and a data interaction protocol; The secondary node cluster module is composed of secondary nodes responsible for the main chain and sub-chain. Each secondary node has a three-layer structure: a basic layer, a component layer, and a business layer. The basic layer is used to provide basic services for each component of the secondary node. The basic services include logs, databases, and network processing. The component layer is used to provide components called by business processes, including channels, routers, listeners, certifiers, and adapters. The business layer is used to control business processes, including event processors and transaction processors. The main chain management module is used to allow new subchains to register, identify and manage subchains on the main chain, and is also used to monitor the status of each subchain; The SPV node is used to synchronize the latest transaction information on the corresponding main chain or sub-chain in real time and provide a transaction verification interface; The data interaction protocol includes cross-chain transaction interaction protocol, transaction contract and business contract (forward and reverse smart contract).

2. A main-subchain cross-chain communication system based on secondary nodes as claimed in claim 1, characterized in that: Monitoring the status of each subchain includes: Determine whether each subchain is active, and detect the consensus status and node health status of the subchain; When a sub-chain is abnormal or down, the main chain management module records the status and takes corresponding countermeasures.

3. A main-subchain cross-chain communication system based on secondary nodes as claimed in claim 2, characterized in that: The cross-chain transaction interaction protocol is used to regulate the data interaction between secondary nodes, specifically including the structures of four types of data: cross-chain events, transaction events, cross-chain event responses, and transaction event responses: Cross-chain events describe data objects that users send to secondary nodes through the cross-chain SDK; The transaction event describes the message transmission between two secondary node services; The cross-chain event response describes the response result of the secondary node to the client after completing the interaction; The transaction event response describes the response result to the transaction event.

4. A main-subchain cross-chain communication system based on secondary nodes as claimed in claim 3, characterized in that: The data objects of the cross-chain event include the cross-chain ID, protocol version number, timestamp, execution phase content carrier, submission phase content carrier and rollback phase content carrier; The data objects of the transaction event include the cross-chain ID, operation method, sub-chain ID, specific content carrier and submitted transaction proof; The data object of the cross-chain event response includes the cross-chain ID, the final result of this cross-chain operation, and the information returned by this cross-chain operation; The data object of the transaction event response includes the cross-chain ID, operation method, result of this cross-chain, returned information, sub-chain ID of the specific operation, transaction identification and contract information carrier.

5. A main-subchain cross-chain communication system based on secondary nodes as claimed in claim 4, characterized in that: The transaction contract is used to manage and coordinate cross-chain transactions, track the status of cross-chain transactions, confirm transactions, and trigger rollback mechanisms; The transaction contract is deployed on each participating chain, and the integrity and atomicity of cross-chain operations are guaranteed by controlling the execution process of the business contract.

6. A main-subchain cross-chain communication system based on secondary nodes as claimed in claim 5, characterized in that: The business contract includes two smart contracts that cooperate with each other, one of which performs forward operations on the source chain (execution chain) and the other performs reverse operations on the target chain (rollback chain); The forward contract is deployed on the source chain and is used to lock assets, transfer data, and call services, including three functions: lock, confirm, and rollback. The reverse contract is deployed on the target chain and is used to perform rollback and cancellation operations when cross-chain transactions fail, ensuring the atomicity of transactions.

7. A master-subchain cross-chain communication system based on secondary nodes as claimed in claim 3, characterized in that: The system also includes a cross-chain SDK, which is used to provide a standardized API interface for connecting the business system with the secondary node, so that the business system can call blockchain functions and convert the data format in the business system into a format that can be processed by the secondary node.

8. A main-subchain cross-chain communication method based on secondary nodes, characterized in that: The method includes master-subchain cross-chain communication and sub-subchain cross-chain communication: The main-subchain cross-chain communication methods include: The subchain business system calls the cross-chain SDK to send cross-chain transactions to the subchain secondary node; The secondary node of the subchain parses and obtains the corresponding subchain execution transaction, and sends the transaction instruction to the first subchain; The first subchain executes the transaction. After the transaction is completed, the first SPV node synchronizes the latest transaction information of the first subchain in real time; Return the execution result of the current transaction to the subchain secondary node; The subchain secondary node converts the response into a subchain transaction proof, and forwards the transaction and transaction proof to the mainchain secondary node; The secondary node of the main chain calls the transaction verification interface of the first SPV node; The first SPV node verifies the transaction. If the verification is successful, it returns the verification response result. At the same time, the secondary node of the main chain sends the sub-chain transaction certificate to the main chain; The main chain calls the transaction contract to store the sub-chain transaction proof and returns the execution result of the sub-chain transaction proof storage to the secondary node; The secondary node of the main chain parses and obtains the corresponding transaction in the main chain, and sends the transaction request to the main chain. The main chain executes the transaction. After the transaction is executed, the main SPV node synchronizes the latest transaction information on the main chain in real time; The main chain returns the transaction response to the main chain secondary node, which converts the response into a main chain transaction certificate and sends the transaction certificate to the sub-chain secondary node; After receiving the main chain transaction proof, the secondary node of the subchain calls the transaction verification interface of the main SPV node to verify the transaction and returns the verification response result; If the verification is successful, the main chain transaction proof is sent to the first sub-chain, and the first sub-chain executes and stores the main chain transaction proof and returns the execution result stored in the sub-chain secondary node; The secondary node of the subchain submits the first Commit transaction, completes the Commit scheduling, and notifies the secondary node of the mainchain to perform the Commit operation; The secondary node of the main chain parses and receives the Commit message, submits the Commit transaction of the main chain, and updates the transaction contract status of the main chain; The secondary node of the subchain summarizes the execution status of the transaction, generates cross-chain transaction feedback, and returns it to the business system.

9. A main-subchain cross-chain communication method based on secondary nodes as claimed in claim 8, characterized in that: Sub-sub-chain cross-chain communication methods include: The second subchain business system calls the cross-chain SDK to send the cross-chain transaction to the second subchain’s secondary node. The second subchain’s secondary node parses and obtains the corresponding subchain execution transaction, and sends the transaction instruction to the second subchain; The second subchain executes the transaction. After the transaction is completed, the second SPV node will synchronize the latest transaction information of the second subchain in real time; Return the execution result of the current transaction to the secondary node of the second subchain; The second subchain secondary node converts the response into a subchain transaction proof, and forwards the transaction and the transaction proof to the third subchain secondary node. The third subchain secondary node calls the transaction verification interface of the second SPV node to verify the transaction and returns the verification response result; If the verification is successful, the secondary node of the third subchain sends the subchain transaction proof to the third subchain, and the third subchain calls the transaction contract to store the subchain transaction proof, and returns the execution result of the transaction proof storage to the secondary node subchain; The secondary node of the third subchain parses and obtains the corresponding transaction in the third subchain, and sends a transaction request to the third subchain. The third subchain executes the transaction. After the corresponding transaction is completed: the third SPV node will synchronize the latest transaction information on the third subchain in real time; The third subchain returns the transaction response to the third subchain secondary node. The third subchain secondary node converts the response into a third subchain transaction certificate and sends the transaction certificate to the second subchain secondary node. After receiving the third subchain transaction certificate, the second subchain secondary node calls the transaction verification interface of the third SPV node to verify the transaction and returns the verification response result. If the verification is successful, the second subchain secondary node will send the third subchain transaction proof to the second subchain. The second subchain will execute and store the third subchain transaction proof and return the execution result to the second subchain secondary node. The second subchain secondary node performs Commit scheduling, submits the Commit transaction of the second subchain and notifies the third subchain secondary node to perform the Commit operation; The secondary node of the third subchain parses and receives the Commit message, and submits the Commit transaction of the third subchain; The secondary node of the second subchain summarizes the execution status of the transaction, generates cross-chain transaction feedback, and returns it to the business system; The second subchain secondary node forwards the transaction execution status and transaction proof to the main chain secondary node. The main chain secondary node calls the transaction verification interface of the second SPV interface to verify the transaction and returns the verification response result; If the verification is successful, the secondary node of the main chain sends the transaction execution status and transaction proof to the main chain, and the main chain calls the transaction contract to store the transaction execution status and transaction proof.

10. A main-subchain cross-chain communication method based on secondary nodes as claimed in claim 9, characterized in that: The execution steps of a business contract are as follows: The user locks the asset by calling the lock function of the forward contract; Perform transaction operations on the target chain through a pre-defined bridging mechanism and determine whether the transaction is successful; When the transaction on the target chain is successful, the forward contract on the source chain calls the confirmation function to complete the transaction; If the transaction fails or times out, the forward contract on the source chain calls the rollback function, triggering the reverse contract on the target chain to perform a rollback operation.