Resource Cross-chain Transfer Method and Device

By building the application layer, core application layer and management layer, and using relay units to determine cross-chain events and encapsulation and transmission of cross-chain packets, the problems of high barriers to inter-blockchain intercommunication between blockchains are solved, and a multi-chain collaboration system is formed, which improves the efficiency and security of cross-chain information sharing.

CN114926163BActive Publication Date: 2025-08-05SHANGHAI ENCRYPTION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210600646.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-30
Publication Date
2025-08-05
Estimated Expiration
2042-05-30

AI Technical Summary

Technical Problem

The lack of a unified interconnection mechanism among blockchains has led to the inability to cross-chain transactions in digital collections. The single-chain architecture has problems of poor performance and insufficient capacity, which cannot meet the needs of high transaction throughput and low latency application scenarios.

Method used

By building the application layer, core application layer and management layer, cross-chain event determination, cross-chain packet encapsulation and transmission, and cross-chain information sharing is achieved using relay units to ensure the security and flexibility of cross-chain transactions.

Benefits of technology

It realizes trusted interoperability of different blockchains, forms a multi-layer multi-chain architecture with multi-chain collaboration, solves the performance bottlenecks under the single-chain architecture, and improves the efficiency and security of cross-chain information sharing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114926163B_ABST
    Figure CN114926163B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for cross-chain resource transfer, wherein the cross-chain resource transfer method includes: determining a cross-chain event between a source chain and a target chain through a source chain application layer; encapsulating the cross-chain resources to be transferred in the source chain and associated with the cross-chain event into a target cross-chain package according to the source chain management layer; calling the cross-chain contract of the source chain core application layer based on the source chain management layer, and sending the target cross-chain package to a relay unit; calling the target contract of the target chain core application layer based on the target chain management layer, and obtaining the target cross-chain package in the relay unit, thereby realizing trusted interoperability of different blockchains, simply and effectively sharing cross-chain information, forming a multi-layer multi-chain system architecture with multi-chain collaboration, and solving the problems of poor performance and insufficient capacity under the single-chain architecture of blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and more particularly to two methods for transferring resources across blockchains. This application also relates to two devices for transferring resources across blockchains, a computing device, and a computer-readable storage medium. Background Art

[0002] With the development of Internet technology, blockchain technology is being used more and more. Blockchain is essentially a database with data "hash verification" function, which has the advantages of decentralization, distribution, and tamper-proofing. In existing technologies, blockchain applications and underlying technology platforms present a variety of states, but each chain in mainstream blockchain applications is mostly still an independent, vertical closed system, which leads to the lack of a unified interconnection mechanism between chains, which greatly limits the liquidity of digital collections and information on the blockchain. In order to solve the information interaction between chains, cross-chain technology came into being.

[0003] However, when the cross-chain resources are digital collections with collectible value, it is difficult to synchronize the value of the same digital collection between different chains. This means that digital collections can only be exchanged and collected within the same chain most of the time and cannot be used in cross-chain transactions. In addition, the diverse states of blockchain applications and underlying technology platforms have led to great differentiation between blockchains, extremely high barriers to interoperability, and inability to simply and effectively share cross-chain information. With the continuous deepening of informatization, business forms have become increasingly complex. A single blockchain, based on the trade-off between decentralization, scalability and security, cannot meet the application scenario requirements of high transaction throughput and low latency. In other words, the ability of a single chain to store and process information is not high. As the blockchain runs for a longer time, the stored information may exceed the capacity limit of the single-chain storage medium. This shortcoming of low processing power and low storage capacity has greatly restricted the further expansion of blockchain application areas and the deployment of related businesses. Summary of the Invention

[0004] In light of this, embodiments of this application provide two cross-chain resource transfer methods. This application also involves two cross-chain resource transfer devices, a computing device, and a computer-readable storage medium to address existing issues such as the difficulty of cross-chain information sharing between blockchains, the poor mobility of digital collections and information between blockchains, and performance bottlenecks faced by a single blockchain.

[0005] According to a first aspect of an embodiment of the present application, a method for cross-chain resource transfer is provided, comprising:

[0006] Determine cross-chain events between the source chain and the target chain through the source chain application layer;

[0007] According to the source chain management layer, encapsulate the cross-chain resources to be cross-chained in the source chain and associated with the cross-chain event into a target cross-chain package;

[0008] Based on the source chain management layer, the cross-chain contract of the source chain core application layer is called, and the target cross-chain package is sent to the relay unit;

[0009] Calling the target contract of the target chain core application layer based on the target chain management layer to obtain the target cross-chain package in the relay unit;

[0010] Among them, the source chain application layer is used to monitor cross-chain events, the source chain management layer is used to generate a sending event of the target cross-chain package, the target chain management layer is used to generate a receiving event of the target cross-chain package, the source chain core application layer is used to maintain the cross-chain contract, and the target chain core application layer is used to maintain the target contract.

[0011] According to a second aspect of an embodiment of the present application, a resource cross-chain transfer device is provided, comprising:

[0012] A determination module, configured to determine a cross-chain event between a source chain and a target chain through the source chain application layer;

[0013] The encapsulation module is configured to encapsulate the cross-chain resources to be cross-chain associated with the cross-chain event in the source chain into a target cross-chain package according to the source chain management layer;

[0014] A sending module is configured to call the cross-chain contract of the source chain core application layer based on the source chain management layer and send the target cross-chain package to the relay unit;

[0015] A receiving module is configured to call the target contract of the target chain core application layer based on the target chain management layer, and obtain the target cross-chain package in the relay unit;

[0016] Among them, the source chain application layer is used to monitor cross-chain events, the source chain management layer is used to generate a sending event of the target cross-chain package, the target chain management layer is used to generate a receiving event of the target cross-chain package, the source chain core application layer is used to maintain the cross-chain contract, and the target chain core application layer is used to maintain the target contract.

[0017] According to a third aspect of an embodiment of the present application, another method for cross-chain resource transfer is provided, including:

[0018] Determine cross-chain events between the source and target chains through the application layer;

[0019] According to the management layer, encapsulate the cross-chain resources to be cross-chained in the source chain and associated with the cross-chain event into a target cross-chain package;

[0020] Based on the management layer calling the cross-chain contract of the core application layer, the target cross-chain package is sent to the relay unit;

[0021] Based on the management layer calling the target contract of the core application layer, obtaining the target cross-chain package in the relay unit;

[0022] Among them, the application layer is used to monitor cross-chain events, the management layer is used to generate sending and receiving events of the target cross-chain package, and the core application layer is used to maintain cross-chain contracts and target contracts.

[0023] According to a fourth aspect of an embodiment of the present application, another cross-chain resource transfer device is provided, comprising:

[0024] A cross-chain event determination module, configured to determine cross-chain events between a source chain and a target chain through the application layer;

[0025] The module for encapsulating cross-chain resources to be processed is configured to encapsulate the cross-chain resources to be processed associated with the cross-chain event in the source chain into a target cross-chain package according to the management layer;

[0026] A target cross-chain packet sending module is configured to call the cross-chain contract of the core application layer based on the management layer and send the target cross-chain packet to the relay unit;

[0027] The target cross-chain package receiving module is configured to call the target contract of the core application layer based on the management layer to obtain the target cross-chain package in the relay unit.

[0028] According to the fifth aspect of an embodiment of the present application, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the resource cross-chain transfer method when executing the instructions.

[0029] According to a sixth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer instructions, which, when executed by a processor, implement the steps of the resource cross-chain transfer method.

[0030] The resource cross-chain transfer method provided in this application determines the cross-chain event between the source chain and the target chain through the source chain application layer; according to the source chain management layer, the cross-chain resources to be transferred in the source chain associated with the cross-chain event are encapsulated into a target cross-chain package; based on the source chain management layer, the cross-chain contract of the source chain core application layer is called and the target cross-chain package is sent to the relay unit; based on the target chain management layer, the target contract of the target chain core application layer is called to obtain the target cross-chain package in the relay unit.

[0031] An embodiment of the present application realizes the trusted interoperability of different blockchains, and performs cross-chain information sharing simply and effectively, forming a multi-layer multi-chain system architecture for multi-chain collaboration, thereby solving the problems of poor performance and insufficient capacity existing in the single-chain architecture of blockchain. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 This is a flow chart of a method for cross-chain resource transfer provided by an embodiment of the present application;

[0033] Figure 2 This is a schematic diagram of a cross-chain contract structure of a resource cross-chain transfer method provided by this application in an embodiment;

[0034] Figure 3 This is a processing flow chart of a method for cross-chain resource transfer applied to fund transfers provided in one embodiment of the present application;

[0035] Figure 4 This is a schematic diagram of a resource cross-chain transfer method provided in one embodiment of the present application;

[0036] Figure 5 This is a temporal diagram of a resource cross-chain transfer method provided by an embodiment of the present application;

[0037] Figure 6 This is a flowchart of another method for cross-chain resource transfer provided by an embodiment of the present application;

[0038] Figure 7 This is a schematic diagram of the structure of a resource cross-chain transfer device provided in one embodiment of the present application;

[0039] Figure 8 This is a schematic diagram of the structure of another cross-chain resource transfer device provided by an embodiment of the present application;

[0040] Figure 9 This is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0041] The following description sets forth many specific details to facilitate a thorough understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of the present application. Therefore, the present application is not limited to the specific implementations disclosed below.

[0042] The terms used in one or more embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of the present application. The singular forms "a", "the" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.

[0043] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0044] First, the terms involved in one or more embodiments of the present application are explained.

[0045] Relayer: Relay unit, cross-chain packet relay off-chain system, responsible for interacting with the two cross-chain chains.

[0046] Packet: A cross-chain packet is a unified message carrier between two chains, containing cross-chain interaction information.

[0047] NFT: Non-fungible token, is a unique cryptocurrency token used to represent digital assets (including jpg and video clips).

[0048] In this application, two cross-chain resource transfer methods are provided. This application also involves two cross-chain resource transfer devices, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0049] In actual applications, current blockchain applications and underlying technology platforms present a variety of states. The variety of blockchains leads to great differences among blockchains, which in turn leads to extremely high barriers to communication between blockchain applications. There will be problems such as inability to effectively share cross-chain information, or the complexity of cross-chain information sharing will be high, making it difficult to simply share cross-chain information. In addition, due to the cross-chain resource sharing process between blockchains, different blockchains find it difficult to realize the value of the same digital collection.

[0050] In addition, each chain in the mainstream blockchain application is an independent, vertical closed system. This situation leads to a lack of a unified interconnection mechanism between chains, and the single-chain architecture itself has poor performance and insufficient capacity. This makes the single-chain architecture mainly used for the storage of important data. More often, in order to save storage space in the blockchain, the hash value of the data to be stored is calculated, and then the hash value is stored on the chain. All of the above performances show that the blockchain with a single-chain architecture is difficult to meet the application requirements of high transaction throughput and low latency scenarios. Therefore, it is urgent to realize a multi-layer multi-chain system architecture with multi-chain collaboration through cross-chain technology to solve the performance bottleneck of the blockchain with a single-chain architecture.

[0051] Therefore, in this application, two cross-chain resource transfer methods are proposed. By constructing the application layer, the core application layer and the management layer, the cross-chain resource transfer of the blockchain is realized, and the specific structure of the blockchain of the two cross-chain parties is not restricted. It only needs to ensure that the two cross-chain parties support smart contracts. Cross-chain transactions can be realized regardless of homogeneous chains or heterogeneous chains. Then, through this cross-chain method, cross-chain information sharing can be realized simply and effectively, and the flexibility of cross-chain is guaranteed, which also facilitates the development and expansion of new functions by relevant developers; through this cross-chain resource transfer method, a multi-layer multi-chain system architecture with multi-chain collaboration can be easily realized, so that the blockchain can face more complex application scenarios and improve the performance of blockchain applications in various scenarios.

[0052] Figure 1 A flowchart of a resource cross-chain transfer method provided according to an embodiment of the present application is shown, which specifically includes the following steps:

[0053] Step S102: Determine the cross-chain event between the source chain and the target chain through the source chain application layer.

[0054] Specifically, an embodiment of the present application provides a method for cross-chain resource transfer, which implements cross-chain resource transfer through the application layer, core application layer and management layer, such as Figure 2 As shown in the schematic diagram of the cross-chain contract structure of a resource cross-chain transfer method, this method can realize the separation of cross-chain logic and application logic, achieve seamless access to other application modules, and ensure the scope of application of the resource cross-chain transfer method; the application layer can be understood as the application layer contract developed by the developers and maintainers participating in the cross-chain according to specific business needs. They cross the chain by calling the core application layer contract corresponding to the source chain; the core application layer can be understood as the combination of related cross-chain functions, such as cross-chain forwarding NFT, etc., for the upper application layer to call, reducing the burden on application developers to develop cross-chain applications; the management layer can be understood as the implementation of the registration and management of the core application layer and the off-chain relay unit, and is the only import and export of cross-chain resources, responsible for the parsing and routing of cross-chain resources to the corresponding application layer contract.

[0055] It should be noted that the source chain and target chain involved in the resource cross-chain transfer method provided in this embodiment respectively correspond to a set of application layers, core application layers and management layers, that is, the source chain corresponds to the source chain application layer, the source chain core application layer and the source chain management layer, and the target chain corresponds to the target chain application layer, the target chain core application layer and the target chain management layer; this situation occurs when the operators maintaining the target chain and the source chain are different and there is no joint research and development, or when the operators maintaining the target chain and the source chain are the same, but the two are developed separately and are not associated with the same set of application layers, core application layers and management layers.

[0056] The source chain application layer can be understood as the application layer corresponding to the source chain. For example, it corresponds to the application program, software, or APP used by users to process cross-chain events. For example, if user A has personal accounts in both blockchain A and blockchain B, and wishes to transfer resource C from account A to account B, the user uses cross-chain software D to transfer account resources between the two chains. At this time, the source chain application layer is associated with cross-chain software D. The source chain can be understood as the blockchain that sends relevant resources when conducting cross-chain business, that is, the initiating chain of the cross-chain behavior; the target chain can be understood as the blockchain that receives relevant resources when conducting cross-chain business, that is, the receiving chain of the cross-chain behavior. A cross-chain event can be understood as an event used to process resources from two blockchains across chains. It should be noted that cross-chain events include sending events and receiving events.

[0057] It should be noted that the source chain and the target chain can be Ethereum, Aergo, Hyperledger, etc., wherein the specific blockchains of the source chain and the target chain are determined by the actual usage scenario and are not limited in this embodiment.

[0058] Based on this, when users have the need to transfer resources across chains, they operate the relevant programs developed by the developers and maintainers. At this time, the source chain application layer associated with the relevant programs confirms the initiating chain and receiving chain of the cross-chain behavior in the user's resource cross-chain transfer needs, that is, the source chain and the target chain, and determines the cross-chain events between the source chain and the target chain.

[0059] Furthermore, during the processing of cross-chain events, if the starting time of the cross-chain event is not determined, the processing of the cross-chain event cannot be carried out. To solve this problem, in this embodiment, the specific implementation method is as follows:

[0060] The cross-chain request is received through the source chain application layer; and a cross-chain event between the source chain and the target chain is determined based on the cross-chain request.

[0061] Among them, cross-chain requests can be understood as request information generated by users based on their operations when operating related applications, which is used to represent the user's specific operations. It should be noted that cross-chain requests include information such as the user's selection of the corresponding source chain and target chain, and the designation of cross-chain resources.

[0062] Based on this, when users have cross-chain needs, they use relevant software or programs to perform operations that meet their cross-chain needs, including but not limited to selecting the source chain and target chain, logging into accounts on the source chain and target chain, selecting resources that need to be cross-chain, etc. Based on these operations, a cross-chain request is generated. The source chain application layer determines the source chain, target chain and related resources that need to be cross-chain based on the cross-chain request, and creates a cross-chain event based on this.

[0063] For example, User A stores an avatar resource C in their account on Blockchain A. Avatar resource C is part of User A's digital collection and is a unique NFT asset on Blockchain A. User A wishes to perform a cross-chain transfer of C to their account on Blockchain B. They then open cross-chain software D on their phone and select Blockchain A from the Source Chain menu, which displays Blockchains A, B, and Y. Similarly, they select Blockchain B from the Target Chain menu. They then log in to their account on Blockchain A and select avatar C from their account, confirming that the cross-chain transfer is for avatar C. They then log in to their account on Blockchain B to confirm their identity and confirm that the cross-chain transfer requires avatar C to their account on Blockchain B. Based on User A's actions, a cross-chain request is generated. Based on this cross-chain request, the source chain application layer generates a cross-chain event to transfer avatar C from User A's account on Blockchain A to User A's account on Blockchain B.

[0064] In summary, through the source chain application layer and cross-chain request, the source chain and target chain of the cross-chain event, as well as the related cross-chain resources to be cross-chained, are determined. Based on this information, a cross-chain event is generated, and the cross-chain request is used as the starting mark of the cross-chain event to carry out the cross-chain event.

[0065] Furthermore, in a cross-chain event, since the blockchain is an independent, vertically closed system, the blockchain cannot autonomously transfer the resources to be transferred across the chain. In order to successfully transfer the resources to be transferred across the chain in the source chain to the target chain, in this embodiment, the specific implementation method is as follows:

[0066] The matching contract of the source chain management layer is called as the cross-chain event matching relay unit between the source chain and the target chain; the source chain core application layer is constructed based on the source chain application layer, and the target chain core application layer is constructed based on the target chain application layer.

[0067] Among them, the source chain management layer can be understood as the management layer corresponding to the source chain, which is used to realize the registration and management of the core application layer of the source chain, and is the only exit for the cross-chain related cross-chain resources in the source chain; the matching contract can be understood as the contract that connects the source chain with the relay unit, and the target chain with the relay unit to realize information interaction, such as Figure 2 A component management contract shown in the cross-chain contract structure diagram of a resource cross-chain transfer method; the source chain core application layer can be understood as the core application layer corresponding to the source chain, including the contract for sending the cross-chain resources on the source chain to the relay unit and the related NFT contracts, such as Figure 2A cross-chain contract structure diagram of a resource cross-chain transfer method shows a service contract and an NFT contract; the target chain application layer can be understood as the application layer corresponding to the target chain; the target chain core application layer can be understood as the core application layer associated with the target chain, which is used to receive the resources on the relay unit across the chain to the target chain contract and related NFT contracts, such as Figure 2 A cross-chain contract structure diagram of a resource cross-chain transfer method shows a service contract and an NFT contract; the relay unit can be understood as an intermediate unit responsible for interacting with both cross-chain chains, such as a relay chain, which can match the source chain and the target chain through the relevant contracts of the management layer, where the relevant contracts of the management layer are as follows: Figure 2 A relay management contract shown in a cross-chain contract structure diagram of a resource cross-chain transfer method.

[0068] Based on this, the matching contract of the source chain management layer is called to determine the relay unit that needs to be matched and connected between the source chain and the target chain. Then, the source chain is matched with the relay unit, and the target chain is matched with the relay unit. It should be noted that the process of determining the relay unit can use a preset relay unit as the relay unit that matches the source chain and the target chain, or when the current cross-chain event is not the first time, the relay unit used last time is used to match the source chain and the target chain. Or, when the source chain and target chain related to the previous cross-chain event are the same as the source chain and target chain related to the current cross-chain event, there is no need to re-match the relay unit with the source chain and the target chain. The previous matching relationship can be directly applied to execute subsequent steps. The specific matching method is determined by the actual usage scenario and is not limited in this embodiment. Then, the corresponding source chain core application layer is determined based on the source chain application layer, and the target layer core application layer is determined based on the target chain application layer. It should be noted that through the NFT contracts on the source chain core application layer and the target chain core application layer, the value synchronization of digital collections during cross-chain transfer can be achieved, allowing digital collections to be traded between chains.

[0069] Furthermore, when matching relay units between the source and target chains, the number of relay units that can be matched is unlimited. Multiple relay units can be matched between the source and target chains. During the subsequent cross-chain event execution, multiple relay units simultaneously receive and send related cross-chain resources. Preferably, an odd number of relay units is matched, so that when determining whether a target cross-chain packet sent to the target chain is credible, it is easier to determine the half number of relay units that sent the target cross-chain packet. In specific implementations, the number of relay units is determined by the actual use case and is not limited in this embodiment. Simultaneously matching multiple relay units in this way can increase the security of cross-chain transactions. During the execution of cross-chain events, especially in public chain environments, relay units have low credibility and may be malicious or fail due to attacks. In this case, cross-chain packets are easily intercepted, replayed, or even forged. In this case, due to the presence of multiple relay units, cross-chain transactions can still be carried out safely without causing the entire cross-chain business to be shut down, which greatly enhances the security, robustness, and high availability of the system.

[0070] Continuing with the above example, after determining that cross-chain events around chain A, chain B, and avatar C need to be carried out, the preset Relayer1, Relayer2, and Relayer3 are determined. Then, through the matching contract of the source chain management layer, both chain A and chain B are matched with Relayer1. Similarly, Relayer2 and Relayer3 are matched. Then, the source chain core application layer is constructed based on the source chain application layer, and the target chain core application layer is constructed based on the target chain application layer. Subsequently, the cross-chain event processing is carried out using the source chain core application layer, the target chain core application layer, and each Relayer.

[0071] In summary, by establishing a matching relationship between the relay unit and the source chain and the target chain, information transmission between the source chain and the target chain can be carried out through the relay unit. Due to the characteristics of the relay unit itself, it can monitor the sending and receiving events in the blockchain, avoiding the problem that the blockchain itself is an independent, vertical closed system and cannot independently send and receive cross-chain information. The relay unit is used to extract and send relevant resources to the blockchains of both parties across the chain.

[0072] Furthermore, in the process of constructing the source chain core application layer through the source chain application layer, and constructing the target chain core application layer through the target chain application layer, it is necessary to combine the blockchain types corresponding to the source chain application layer and the target chain application layer. In this embodiment, the specific implementation method is as follows:

[0073] Querying the source chain type associated with the source chain application layer and determining at least one initial cross-chain contract corresponding to the source chain type; building the source chain core application layer that maintains the at least one initial cross-chain contract;

[0074] Accordingly, the target chain core application layer is constructed based on the target chain application layer, including:

[0075] Query the target chain type associated with the target chain application layer, and determine at least one initial target contract corresponding to the target chain type; and construct the target chain core application layer that maintains the at least one initial target contract.

[0076] The source chain type can be understood as the blockchain type of the source chain, such as Ethereum, Aergo, Hyperledger, etc.; the initial cross-chain contract can be understood as the contract to be used when a certain type of source chain performs cross-chain transmission; similarly, the target chain type can be understood as the blockchain type of the target chain; the initial target contract can be understood as the contract to be used when a certain type of target chain performs cross-chain reception.

[0077] Based on this, determine the source chain type associated with the source chain application layer, that is, the type of source chain that users can choose when performing cross-chain. It should be noted that there can be more than one source chain type, and the corresponding initial cross-chain contract can also be more than one, such as Figure 2 A cross-chain contract structure diagram of a resource cross-chain transfer method is shown below, which includes NFT1 contract and NFT2 contract. Then, based on the determined initial cross-chain contract, the source chain core application layer is constructed to maintain the initial cross-chain contract; the construction process of the target chain core application layer is similar to that of the source chain core application layer, which will not be repeated here.

[0078] Continuing with the above example, in the process of building the source chain core application layer and the target chain core application layer, it is necessary to query the source chain types that can be selected in the source chain menu list, and determine the corresponding initial cross-chain contract based on the selectable source chain type. Then, based on the obtained initial cross-chain contract, build a source chain core application layer that can call and maintain the initial cross-chain contract. Similarly, creating the target chain core application layer is different from creating the source chain core application layer. The target chain core application layer here creates and queries the selectable target chain type in the target chain menu list. The specific details are not repeated here. Based on the above steps, the core application layers corresponding to chain A and chain B are created. Then, based on the relevant contracts in the created core application layer, the value synchronization of avatar C in chain A and chain B is realized. The cross-chain transmission of avatar C between chain A and chain B can also be realized based on the relevant contracts in the created core application layer.

[0079] In summary, the core application layer of the source chain and the core application layer of the target chain created by the above method can be realized, and the related application layers can be expanded and upgraded relatively easily. Only the application contract of the corresponding interface can be implemented to cross the chain through the management layer. This greatly increases the flexibility of cross-chain and also facilitates developers to develop and expand new functions.

[0080] Step S104: According to the source chain management layer, the cross-chain resources to be associated with the cross-chain event in the source chain are encapsulated into a target cross-chain package.

[0081] Specifically, after the cross-chain event is confirmed, for security reasons during the cross-chain process of resources, the relevant cross-chain resources need to be encapsulated into a resource package, and then the resource package is transmitted across the chain. In addition, by encapsulating cross-chain resources, the uniformity of cross-chain transmission can be guaranteed, thereby improving transmission efficiency and quality.

[0082] Among them, the source chain management layer can be understood as the management layer corresponding to the source chain, which is used to generate and manage the core application layer of the source chain. It can call some contracts in the core application layer of the source chain to process cross-chain events, and the core application layer of the source chain is also responsible for matching between the source chain and the relay unit. In addition, the source chain management layer has the only exit for the source chain to send cross-chain resources, and is responsible for encapsulating, parsing and routing the target cross-chain package to the corresponding contract; the cross-chain resources to be sent can be understood as the resources that need to be sent from the source chain to the target chain in the cross-chain event; the target cross-chain package can be understood as the resource package obtained after encapsulating the cross-chain resources to be sent.

[0083] Based on this, through the source chain management layer, the cross-chain resources to be sent in the source chain are encapsulated into target cross-chain packages, ensuring the uniformity of cross-chain transmission forms, improving transmission efficiency and quality, and ensuring the security of cross-chain resources transmitted between chains.

[0084] Furthermore, in the process of sending the target cross-chain package, if the contract to which the target cross-chain package is routed is unclear, cross-chain resource errors may occur. For example, cross-chain resource transfers on user A's A chain to other people's accounts on chain B may cause property losses. To avoid cross-chain resource errors, in this embodiment, the specific implementation is as follows:

[0085] Determine the business information associated with the cross-chain event in the target chain management layer, and determine the to-be-crossed-chain resources associated with the cross-chain event in the source chain; encapsulate the business information and the to-be-crossed-chain resources according to the source chain management layer to obtain a target cross-chain package.

[0086] Among them, business information can be understood as the contract information indicating that the target cross-chain package is routed to the designated contract, ensuring that the cross-chain resources are transferred from the source chain to the designated contract of the target chain, and avoiding property losses caused by cross-chain errors.

[0087] Based on this, when transferring the cross-chain resources in the source chain to the target chain, it is necessary to determine the contract information of the target chain that routes the cross-chain resources to the target chain. Therefore, the business information of the designated contract related to the cross-chain event in the target chain management layer must be determined first. Figure 2The routing contract in the management layer shown in the cross-chain contract structure diagram of a resource cross-chain transfer method determines the business information of the specified contract, then determines the resources to be transferred across the chain, and then encapsulates the business information and the resources to be transferred across the chain into a target cross-chain package.

[0088] Continuing with the above example, after constructing the source chain management layer, the routing contract in the source chain management layer is called to determine the business information associated with the cross-chain event in the B chain management layer. Then, the management contract of the source chain management layer is called again to encapsulate the business information and the resources of avatar C together to obtain the target packet. Subsequently, the target packet is transferred from chain A to chain B.

[0089] In summary, by encapsulating business information into the target cross-chain package, the cross-chain resources can be accurately routed to the designated contract of the target chain, avoiding transmission errors in the process of trading cross-chain resources between chains during cross-chain events, which may cause asset losses.

[0090] Step S106: Based on the source chain management layer, the cross-chain contract of the source chain core application layer is called, and the target cross-chain package is sent to the relay unit.

[0091] Specifically, after obtaining the target cross-chain package, since the blockchain is an independent, vertically closed system, it cannot realize the autonomous transmission of the target cross-chain package by itself. At this time, the target cross-chain package needs to be sent to the relay unit.

[0092] Among them, the cross-chain contract can be understood as the contract that the source chain relies on to transmit data across the chain to the relay unit, that is, the contract to which the source chain needs to send the data, such as Figure 2 A service contract shown in a cross-chain contract structure diagram of a resource cross-chain transfer method.

[0093] Based on this, the source chain management layer can call the contract on the source chain core application layer. The called contract is the cross-chain contract used by the source chain to transmit data across chains. Through this cross-chain contract, the target cross-chain package is sent to the relay unit.

[0094] Furthermore, there is more than one contract on the core application layer of the source chain. Using a contract that does not match the cross-chain event will cause the cross-chain event to not proceed normally. Therefore, calling a cross-chain contract requires first determining the cross-chain contract in the contract of the core application layer of the source chain. In this embodiment, the specific implementation method is as follows:

[0095] Determine the target source chain type corresponding to the source chain; query the at least one initial cross-chain contract maintained by the core application layer of the source chain, and select the initial cross-chain contract associated with the target source chain type as the cross-chain contract according to the query result; execute the sending event in the cross-chain event based on the source chain management layer, and send the target cross-chain package to the relay unit by calling the cross-chain contract.

[0096] Among them, the target source chain type can be understood as the blockchain type of the source chain. By determining the type of the source chain, we can further infer the type of blockchain for cross-chain resource transmission of this type, what type of cross-chain contract to use, and the corresponding NFT contract to ensure that the cross-chain resources can achieve value synchronization between the target chain and the source chain; the cross-chain contract can be understood as a contract that realizes the sending of cross-chain resources from the target chain to the relay unit, as well as the NFT contract that realizes the value synchronization of the cross-chain resources in the target chain and the source chain, such as Figure 2 The service contract and NFT1 and NFT2 contracts are shown in the cross-chain contract structure diagram of a cross-chain resource transfer method. The NFT contract is called by the core application layer of the source chain and the core application layer of the target chain in the sending event and the receiving event, respectively, to achieve value synchronization of the cross-chain resources between the target chain and the source chain.

[0097] Based on this, the type of the source chain is determined, and then all the initial cross-chain contracts maintained by the core application layer of the source chain are queried, and the contract corresponding to the type of the source chain in the initial cross-chain contract is selected as the cross-chain contract. At this time, the cross-chain contract matches the cross-chain transmission task of the source chain, and the cross-chain transmission of resources in the source chain can be realized; then the source chain management layer executes the sending event in the cross-chain event, that is, the event of sending the resources in the source chain to the relay unit. The management layer relies on the cross-chain contract to send the target cross-chain package from the source chain to the relay unit.

[0098] Continuing with the above example, after generating the target packet for avatar C, the type of chain A is further determined. Then, all initial cross-chain contracts maintained by the core application layer of the source chain are queried. Then, based on the type of chain A, the corresponding initial cross-chain contract is selected as the cross-chain contract. The source chain management layer is then used to call the cross-chain contract, and the target cross-chain packet of avatar C resources is sent from chain A to Relayer1, Relayer2, and Relayer3. Subsequently, the target packet is sent from the Relayer to chain B.

[0099] In summary, through the above methods, the sending event is realized, and the cross-chain resources to be sent out of the source chain are sent. The first step of the cross-chain event is realized, and the cross-chain resources are sent to the relay unit. This solves the problem that the source chain cannot independently send its own resources to the target chain. Through the relay unit as a link, resource interaction between chains is realized.

[0100] Furthermore, the blockchain is an independent, vertically closed system that cannot independently send resources. In order to respond to cross-chain events and communicate resources between different chains, a relay unit can be introduced to execute the sending event. In this embodiment, the specific implementation method is as follows:

[0101] Based on the source chain management layer calling the cross-chain contract of the source chain core application layer, a sending event of the target cross-chain package is generated; when the relay unit monitors the sending event, the target cross-chain package is sent to the relay unit according to the source chain management layer.

[0102] Among them, the process of calling the cross-chain contract has been explained and will not be repeated here. When the cross-chain contract is called and the target cross-chain package is obtained, a sending event is generated. It should be noted that the target cross-chain package may include a status information, which may include information indicating that the target cross-chain package is now ready and can be sent to the relay unit. The relay unit monitors the source chain. After detecting the status information that the target cross-chain package is ready at this time, it monitors the sending event. The relay unit obtains the target cross-chain package in the source chain. During the execution of the sending event, the source chain management layer provides the only exit for the target cross-chain package to be sent from the source chain. Its relevant features are included in the following. Figure 2 A sending contract shown in a cross-chain contract structure diagram of a resource cross-chain transfer method.

[0103] Continuing with the above example, when the target packet in chain A is sent to the Relayer, the source chain management layer calls the cross-chain contract to generate a send event. Relayer1, Relayer2, and Relayer3 monitor chain A in real time. After determining that the send event of the target cross-chain packet of avatar C needs to be sent, Relayer1, Relayer2, and Relayer3 obtain the target cross-chain packet of avatar C in chain A, and then send the target packet from the Relayer to chain B to realize cross-chain resources.

[0104] In summary, through the above method, the resources that need to be sent in the source chain are read into the relay unit through the monitoring of the relay unit, which solves the problem that the source chain cannot independently send its own resources to the target chain. The relay unit is used as a link to realize resource interaction between chains.

[0105] Step S108: Based on the target chain management layer, the target contract of the target chain core application layer is called to obtain the target cross-chain package in the relay unit.

[0106] Among them, the source chain application layer is used to monitor cross-chain events, the source chain management layer is used to generate a sending event of the target cross-chain package, the target chain management layer is used to generate a receiving event of the target cross-chain package, the source chain core application layer is used to maintain the cross-chain contract, and the target chain core application layer is used to maintain the target contract; in addition, the target contract can be understood as being similar to the cross-chain contract, the difference being that the target contract is applied to the target chain for cross-chain transmission of data, that is, the contract that the target chain needs to receive data in the relay unit.

[0107] Based on this, the target chain management layer can call the contract on the target chain core application layer. The called contract is the target contract used by the target chain to transmit data across the chain. Through this target contract, the target cross-chain package is sent from the relay unit to the target chain.

[0108] Furthermore, the blockchain is an independent, vertically closed system that cannot independently receive resources. In order to respond to cross-chain events and communicate resources between different chains, a relay unit can be introduced to execute the received events. In this embodiment, the specific implementation method is as follows:

[0109] Based on the target chain management layer calling the target contract of the target chain core application layer, a reception event of the target cross-chain package is generated; when the relay unit monitors the reception event, the target cross-chain package is sent to the target chain according to the target chain management layer.

[0110] Among them, the process of calling the target contract is similar to the process of calling the cross-chain contract, which will not be repeated here. When the target contract is called, a receiving event is generated. It should be noted that the target cross-chain package can include a status information. After the target cross-chain package is sent to the relay unit, the status can be changed to, and it needs to be sent to the target chain. The relay unit monitors the target chain. When it detects that the target cross-chain package is in the relay unit at this time and the preparation for the target chain to receive resource data has been completed, the receiving event is monitored. The relay unit sends the target cross-chain package to the target chain. During the execution of the receiving event, the target chain management layer provides the only entry for the target cross-chain package to be transmitted to the target chain. Its relevant features are included in the following. Figure 2 A receiving contract shown in a cross-chain contract structure diagram of a resource cross-chain transfer method.

[0111] Continuing with the above example, when the target packet in Relayer is sent to Chain B, a receive event is generated after the target contract is called by the target chain management layer. After Relayer1, Relayer2, and Relayer3 monitor the receive event, Relayer1, Relayer2, and Relayer3 send the target cross-chain packet of avatar C to Chain B. Subsequently, the target packet is processed on Chain B to achieve the cross-chain transfer of avatar C to User A's Chain B account.

[0112] In summary, through the above method, the resources to be sent in the relay unit are sent to the target chain through the relay unit's monitoring. Chains are independent vertical systems and do not interact with each other. Therefore, it is necessary to set up a relay unit to monitor in the middle. Through the relay unit to monitor the sending and receiving events, transactions in one chain enter the other chain through the relay unit, realizing cross-chain transactions and interoperability between the two chains.

[0113] Furthermore, after sending the target resource package to the target chain, it is still impossible to determine which specific contract in the target chain the target resource package will be routed to. In order to ensure that the cross-chain event continues, in this embodiment, the specific implementation method is as follows:

[0114] Based on the target chain management layer, the target cross-chain package is parsed to obtain the cross-chain resources and the business information; the business query contract of the target chain management layer is called to process the business information to obtain business contract information; and the cross-chain resources are forwarded to the business contract according to the business contract information.

[0115] Among them, the business query contract can be understood as being used to determine the business contract information; the business contract information can be understood as being used to specify the business contract and guide the subsequent routing of the target cross-chain package to the specified contract, that is, routing to the business contract, so that in the cross-chain event, the resources that need to be cross-chain can be traded to the on-chain account of the specified target chain.

[0116] Based on this, the target cross-chain package is parsed by the target chain management layer to parse out the resources and business information to be cross-chain included in the target cross-chain, and then the business query contract of the target chain management layer is called to process the business information to obtain the business contract information indicating the business contract; it should be noted that the processing method here can be to parse the business information or to decrypt the business information, which depends on the relationship between the business information and the business contract information, and depends on the actual usage scenario, which is not limited in this embodiment; finally, the resources to be cross-chain are forwarded to the business contract according to the business contract information.

[0117] Continuing with the above example, after link B receives the target packet, it parses the target cross-chain packet of avatar C through the target chain management layer, parses out the avatar C resources and business information, and then calls the business query contract of the target chain management layer to parse the business information and obtain the business contract information indicating the business contract. Then, according to the business contract information, the avatar C resource is routed to the business contract, realizing the cross-chain of avatar C from user A's account on chain A to user A's account on chain B.

[0118] In summary, through the above methods, the resources to be cross-chained are routed to the designated contract, so that the resources can be accurately transferred across chains, ensuring the security of the user's on-chain assets and specifically solving the problem of cross-chain resource loss caused by resource cross-chain errors.

[0119] Furthermore, when there is more than one relay unit, in actual application, the relay unit may be attacked and the target cross-chain packet may be sent incorrectly. In order to solve this security problem and maintain the lightweight deployment of the execution process while ensuring security, in this embodiment, the specific implementation method is as follows:

[0120] The execution status of the target cross-chain package is queried in the target chain through the relay unit; when the execution status is the first execution status, the relay unit is controlled to discard the target cross-chain package; when the execution status is the second execution status, the target cross-chain package is processed on the target chain; when the execution status is the third execution status, the target contract is called based on the target chain management layer to obtain the target cross-chain package in the associated relay unit.

[0121] The execution state can be understood as the state information related to the processing of the target cross-chain package in the target chain after the target cross-chain package is sent to the target chain; the first execution state can be understood as the state in which the target cross-chain package has been routed to the business contract and on-chain in the target chain; the second execution state can be understood as the state in which it is recorded that the target cross-chain package has not been routed to the business contract and the number of relay units that have sent the target cross-chain package is greater than half; the third execution state can be understood as the state in which it is recorded that the target cross-chain package has not been routed to the business contract and the number of relay units that have sent the target cross-chain package is less than half; the associated relay unit can be understood as one of the relay units that have not sent the target cross-chain package to the target chain. It should be noted that when there is more than one relay unit that has not sent the target cross-chain package to the target chain, one of them needs to be selected as the associated relay unit. The selection method can be selected according to a preset order or according to the time sequence of sending the target cross-chain package to the target chain. The specific method to be adopted is determined by the actual usage scenario and is not limited in this embodiment.

[0122] Based on this, the execution status of the target cross-chain package in the target chain is queried through the relay unit. When the execution status shows that the target cross-chain package has been routed to the business contract and is on the target chain, the target cross-chain package in the relay unit is deleted, because the cross-chain event has been completed at this time, and the purpose of the cross-chain task has been achieved. At this time, there is no need to continue to send the target cross-chain package to the target chain, saving resources; when the target cross-chain package has not been routed to the business contract, and the number of relay units that have sent the target cross-chain package is greater than half, it means that the target cross-chain package transmitted across the chain by the relay unit is trustworthy, indicating that the relay unit has not been attacked, causing the resources in the target cross-chain package to be used. Tampering. It should be noted that the target cross-chain package in the target chain can contain a counting information, recording how many relay units sent the target cross-chain package to the target chain. Further, the counting information can also record which relay unit sent the target cross-chain package. In this case, the relay unit can be avoided from being attacked, resulting in repeated sending problems; when the target cross-chain package has not been routed to the business contract, and the number of relay units that have sent the target cross-chain package is not more than half at this time, it means that the target cross-chain package sent by the relay unit to the target chain is not credible at this time and needs to continue to be sent. The other relay units that have not yet sent continue to send the target cross-chain package to the target chain.

[0123] Continuing with the above example, when the Relayer sends the target Packet to the B chain, Relayer1 queries the execution status of the target cross-chain package of avatar C in the B chain; when the execution status indicates that avatar C has been transferred to the B chain account of user A, Relayer1 is controlled to discard the target cross-chain package of avatar C; when the execution status indicates that avatar C has not been transferred to the B chain account of user A, and Relayer2 has already sent the target cross-chain package of avatar C to the B chain, it means that more than half of the Relayers have sent the target cross-chain package of avatar C to the B chain, and the target cross-chain package of avatar C received by the target chain is credible, so avatar C is transferred to the B chain account of user A; when the execution status indicates that avatar C has not been transferred to the B chain account of user A and no other Relayer has sent the target cross-chain package of avatar C to the B chain, the process of other Relayers sending the target cross-chain package of avatar C to the B chain continues.

[0124] In summary, through the above methods, the relay units are independent of each other and each forwards the monitored data packets. When a relay unit is attacked by a malicious user and commits malicious acts in the network or the relay unit is damaged, the entire cross-chain business will not be shut down, thus ensuring security and high availability.

[0125] Furthermore, if the cross-chain execution timeout occurs, it will cause resource deadlock, which will eventually lead to the loss of related resources and property losses. To solve this problem, in this embodiment, the specific implementation method is as follows:

[0126] In a case where the processing duration of the reception event monitored by the relay unit is greater than a duration threshold, the target cross-chain packet is sent to the source chain.

[0127] The duration threshold may be understood as a preset time length. When the processing time of a received event is longer than the duration threshold, it indicates that the processing of the received event has timed out.

[0128] Based on this, when the relay unit monitors the receiving event, it will record the processing time of the receiving event. When the processing time is greater than the preset time threshold, the target cross-chain package will be sent to the source chain. It should be noted that the relay unit can monitor the processing time of the receiving event by monitoring whether there is a target cross-chain package in the target chain, that is, recording the identity identifier related to the target cross-chain package in the relay unit, and then traversing the identity identifiers of all cross-chain packages in the target chain to determine whether the target cross-chain package has been sent to the target chain, and determine the time when the target cross-chain package appears on the target chain, and compare this time with the time when the relay unit sends the target cross-chain package to determine the processing time of the receiving event; in addition, a time stamp can be added to the target cross-chain package, which records the time when the target cross-chain package arrives at any node of the cross-chain time or the time point of the processing flow to determine the processing time of the receiving event; when there is more than one relay unit, the recorded processing time is the time between the target cross-chain package being sent from the relay unit and being routed to the designated contract.

[0129] Continuing with the above example, during the process of Relayer sending the target Packet to Chain B, that is, during the execution of the receive event, taking Relayer1's sending process as an example, if Relayer1's processing time for monitoring the receive event exceeds the preset time threshold of 1 minute, Relayer1 will send avatar C back to Chain A.

[0130] In summary, through the above methods, in the event of a cross-chain timeout, the resources are rolled back, so that the relevant equipment or system is informed of the processing timeout, and then the timeout problem is repaired or the relevant maintenance node is notified to perform repairs. The rolled back resources ensure that the resources will not be lost, avoiding property losses.

[0131] The resource cross-chain transfer method provided in this application determines the cross-chain event between the source chain and the target chain through the source chain application layer; according to the source chain management layer, the cross-chain resources to be transferred in the source chain that are associated with the cross-chain event are encapsulated into a target cross-chain package; based on the source chain management layer, the cross-chain contract of the source chain core application layer is called to send the target cross-chain package to the relay unit; based on the target chain management layer, the target contract of the target chain core application layer is called to obtain the target cross-chain package in the relay unit, thereby realizing trusted interoperability of different blockchains, simply and effectively sharing cross-chain information, forming a multi-layer multi-chain system architecture with multi-chain collaboration, and solving the problems of poor performance and insufficient capacity under the single-chain architecture of blockchain.

[0132] The following combined Figure 3 Taking the application of the resource cross-chain transfer method provided by this application in fund transfer as an example, the resource cross-chain transfer method is further explained. Figure 2 A processing flow chart of a resource cross-chain transfer method for fund transfer provided in an embodiment of the present application is shown, which specifically includes the following steps:

[0133] Step S302: Receive a cross-chain request through the source chain application layer.

[0134] Specifically, user A needs to transfer a certain amount of funds Z from their account on chain X to their account on chain Y. User A logs in to their mobile banking account, selects their account on chain X, and then chooses to transfer funds to their account on chain Y. User A performs a series of operations, including logging in to their account on chain X, entering their account number on chain Y, completing identity verification, and selecting to transfer funds Z. These operations form a transfer request, i.e., a cross-chain request, which is received by the application layer.

[0135] Step S304: Determine the cross-chain event between the source chain and the target chain based on the cross-chain request.

[0136] Specifically, upon receiving a transfer request from user A, the server that maintains data on chain X determines that a cross-chain event related to user A is about to be executed.

[0137] Step S306: Call the matching contract of the source chain management layer as the cross-chain event matching relay unit between the source chain and the target chain.

[0138] Specifically, the matching contract of the source chain management layer is called to match Relayers for chain X and chain Y. The number of matched Relayers is 9, namely Relayer1, Relayer2, ..., Relayer9.

[0139] Step S308: Construct the source chain core application layer based on the source chain application layer, and construct the target chain core application layer based on the target chain application layer.

[0140] Specifically, the source chain type corresponding to the source chain application layer is queried as chain X, and the type corresponding to the target chain application layer is determined to be chain Y. Then, it is determined that the initial cross-chain contracts corresponding to chain X and chain Y are both NFT contracts. Then, the source chain core application layer and the target chain core application layer are created to maintain the NFT contract.

[0141] Step S310: Determine the business information associated with the cross-chain event in the target chain management layer, and determine the cross-chain resources to be associated with the cross-chain event in the source chain.

[0142] Specifically, determine the funds Z in the X chain related to the transfer of user A, and determine that the funds Z correspond to the NFT contract in the core application layer of the source chain, such as Figure 4 In the process 1 of the schematic diagram of a resource cross-chain transfer method, the relevant account information of user A on the Y chain is determined, such as Figure 4 Schematic diagram of the two processes in a resource cross-chain transfer method.

[0143] Step S312: According to the source chain management layer, the business information and the resources to be cross-chained are encapsulated to obtain the target cross-chain package.

[0144] Specifically, according to the source chain management layer, the relevant account information of fund Z and user A’s account on the Y chain is encapsulated to obtain a packet, such as Figure 4 Schematic diagram of the three steps in a resource cross-chain transfer method.

[0145] Step S314: Based on the source chain management layer, the cross-chain contract of the source chain core application layer is called to generate a sending event of the target cross-chain package.

[0146] Specifically, based on the type of chain X, the cross-chain contract is determined in the core application layer of the source chain, and a sending event for the packet Z is generated.

[0147] Step S316: When the relay unit monitors the sending event, the target cross-chain packet is sent to the relay unit according to the source chain management layer.

[0148] Specifically, after Relayer1, Relayer2, ..., Relayer9 monitor the sending event, they send the packet to Relayer1, Relayer2, ..., Relayer9 according to the source chain management layer, such as Figure 4 Schematic diagram of the four steps in a cross-chain resource transfer method.

[0149] Step S318: Based on the target chain management layer, the target contract of the target chain core application layer is called to generate a receiving event of the target cross-chain package.

[0150] Specifically, according to the type of Y chain, the target contract is determined in the core application layer of the target chain, and a packet reception event rooted in Z is generated.

[0151] Step S320: When the relay unit monitors the receiving event, it sends the target cross-chain packet to the target chain according to the target chain management layer.

[0152] Specifically, after Relayer1, Relayer2, ..., Relayer9 monitor the reception event, they send the packets in Relayer1, Relayer2, ..., Relayer9 to the Y chain according to the target chain management layer, such as Figure 4 Schematic diagram of the five steps in a cross-chain resource transfer method.

[0153] Step S322: parse the target cross-chain package based on the target chain management layer to obtain the resources and business information to be cross-chained.

[0154] Specifically, Relayer1 is the first relay chain to send the packet to the Y chain. Relayer1 then queries the execution status of the packet and finds that the packet has not yet been routed to the designated contract of the Y chain, and is currently only sent to the Y chain by Relayer1. At this time, the second relay chain, Relayer2, continues to send the packet to the Y chain. The result of Relayer2's query on the execution status of the packet is the same as Relayer1. The process of the next relay chain sending the packet to the Y chain continues until the fifth relay chain, Relayer5, sends the packet to the Y chain. At this time, Relayer5 queries the execution status of the packet and finds that the packet has not yet been routed to the designated contract of the Y chain, but has been sent by 5 relay chains, which is more than half of the total number of relay chains, 9. At this time, the packet is forwarded to the Y business contract; the subsequent relay chain queries the execution status of the packet and finds that the packet is forwarded to the Y business contract. In this case, the packet in the relay chain is deleted and the packet is no longer sent to the Y chain.

[0155] The process of forwarding the packet to Y's business contract first requires parsing the packet based on the target chain management layer to obtain the funds Z and business information.

[0156] It should be noted that if the processing time of the received event is longer than the time threshold of 10 minutes, the packet will be sent back to the X chain, such as Figure 5The timeout state is shown in the temporal diagram of a resource cross-chain transfer method provided in an embodiment; if the processing time of the receiving time is less than 10 minutes, the resource cross-chain transfer method is executed according to steps S302 to S326, and the funds Z in user A's X chain account are sent to user A's Y chain account, as shown in FIG. Figure 5 The steps except the timeout state part are shown in the temporal diagram of a resource cross-chain transfer method provided by one embodiment.

[0157] Step S324: calling the business query contract of the target chain management layer to process the business information and obtain business contract information.

[0158] Specifically, the business information is parsed to determine the business contract information, such as Figure 4 Schematic diagram of the six steps in a resource cross-chain transfer method.

[0159] S326: Forward the cross-chain resources to the business contract according to the business contract information.

[0160] Specifically, the fund Z is sent to the account of user A on the Y chain, as shown in process 7 in the schematic diagram of a resource cross-chain transfer method.

[0161] The resource cross-chain transfer method provided in this application determines the cross-chain event between the source chain and the target chain through the source chain application layer; according to the source chain management layer, the cross-chain resources to be transferred in the source chain that are associated with the cross-chain event are encapsulated into a target cross-chain package; based on the source chain management layer, the cross-chain contract of the source chain core application layer is called to send the target cross-chain package to the relay unit; based on the target chain management layer, the target contract of the target chain core application layer is called to obtain the target cross-chain package in the relay unit, thereby realizing trusted interoperability of different blockchains, simply and effectively sharing cross-chain information, forming a multi-layer multi-chain system architecture with multi-chain collaboration, and solving the problems of poor performance and insufficient capacity under the single-chain architecture of blockchain.

[0162] Figure 6 A flowchart of another method for cross-chain resource transfer according to an embodiment of the present application is shown, which specifically includes the following steps:

[0163] Step S602: Determine the cross-chain event between the source chain and the target chain through the application layer.

[0164] Step S604: According to the management layer, the cross-chain resources to be cross-chained in the source chain and associated with the cross-chain event are encapsulated into a target cross-chain package.

[0165] Step S606: Based on the management layer calling the cross-chain contract of the core application layer, the target cross-chain package is sent to the relay unit.

[0166] Step S608: Based on the chain management layer, the target contract of the chain core application layer is called to obtain the target cross-chain package in the relay unit.

[0167] Among them, the application layer is used to monitor cross-chain events, the management layer is used to generate sending and receiving events of the target cross-chain package, and the core application layer is used to maintain cross-chain contracts and target contracts.

[0168] Specifically, the application layer is used to monitor cross-chain events, the management layer is used to generate sending events and receiving events of the target cross-chain package, and the core application layer is used to maintain cross-chain contracts and target contracts. It should be noted that the source chain and target chain involved in the other cross-chain resource transfer method provided in this embodiment correspond to the same set of application layers, core application layers, and management layers. This situation occurs when the operators maintaining the target chain and the source chain are different, but they are jointly developed, or when the operators maintaining the target chain and the source chain are the same and use the same set of application layers, core application layers, and management layers. By processing cross-chain events between the source chain and the target chain through the application layer, core application layer, and management layer, it is possible to more conveniently manage cross-chain events, thereby improving the security and efficiency of cross-chain event processing.

[0169] Optionally, determining a cross-chain event between a source chain and a target chain through the application layer includes:

[0170] Receiving a cross-chain request through the application layer;

[0171] Determine a cross-chain event between the source chain and the target chain based on the cross-chain request.

[0172] Optionally, after determining the cross-chain event between the source chain and the target chain through the source chain application layer, the process further includes:

[0173] Calling the matching contract of the management layer as the cross-chain event matching relay unit between the source chain and the target chain;

[0174] The core application layer is constructed based on the application layer.

[0175] Optionally, constructing the core application layer based on the application layer includes:

[0176] Query the source chain type and target chain type associated with the application layer, and determine at least one initial cross-chain contract corresponding to the source chain type, and determine at least one initial target contract corresponding to the target chain type;

[0177] Construct a core application layer that maintains the at least one initial cross-chain contract and the at least one initial target contract.

[0178] Optionally, calling the cross-chain contract of the core application layer based on the management layer and sending the target cross-chain package to the relay unit includes:

[0179] Determine a target source chain type corresponding to the source chain;

[0180] Querying the at least one initial cross-chain contract maintained by the core application layer, and selecting the initial cross-chain contract associated with the target source chain type as the cross-chain contract based on the query result;

[0181] Based on the management layer executing the sending event in the cross-chain event, the target cross-chain package is sent to the relay unit by calling the cross-chain contract.

[0182] Optionally, after determining the cross-chain event between the source chain and the target chain through the application layer, the process further includes:

[0183] Determine the business information associated with the cross-chain event in the management layer, and determine the resources to be cross-chained associated with the cross-chain event in the source chain;

[0184] According to the management layer, the business information and the resources to be cross-chained are encapsulated to obtain a target cross-chain package.

[0185] Optionally, after calling the target contract of the core application layer based on the management layer and obtaining the target cross-chain package in the relay unit, the method further includes:

[0186] Parsing the target cross-chain package based on the management layer to obtain the cross-chain resources and the business information;

[0187] Calling the business query contract of the management layer to process the business information and obtain business contract information;

[0188] Forward the cross-chain resources to be transferred to the business contract according to the business contract information.

[0189] Optionally, calling the cross-chain contract of the core application layer based on the management layer and sending the target cross-chain package to the relay unit includes:

[0190] Based on the management layer calling the cross-chain contract of the core application layer, a sending event of the target cross-chain package is generated;

[0191] When the relay unit monitors the sending event, the target cross-link packet is sent to the relay unit according to the management layer.

[0192] Optionally, calling the target contract of the core application layer based on the management layer to obtain the target cross-chain package in the relay unit includes:

[0193] Based on the management layer calling the target contract of the core application layer, a reception event of the target cross-chain package is generated;

[0194] When the relay unit monitors the reception event, the target cross-chain packet is sent to the target chain according to the management layer.

[0195] Optionally, after calling the target contract of the core application layer based on the management layer and obtaining the target cross-chain package in the relay unit, the method further includes:

[0196] querying the execution status of the target cross-chain package in the target chain through the relay unit;

[0197] When the execution state is the first execution state, controlling the relay unit to discard the target cross-link packet;

[0198] When the execution state is the second execution state, processing the target cross-chain packet on the target chain;

[0199] When the execution state is the third execution state, the target contract is called based on the management layer to obtain the target cross-chain package in the associated relay unit.

[0200] Optionally, when the relay unit monitors the sending event, after sending the target cross-chain packet to the relay unit according to the management layer, the method further includes:

[0201] In a case where the processing duration of the reception event monitored by the relay unit is greater than a duration threshold, the target cross-chain packet is sent to the source chain.

[0202] Another cross-chain resource transfer method provided by this application realizes the trusted interoperability of different blockchains, simply and effectively performs cross-chain information sharing, forms a multi-layer multi-chain system architecture with multi-chain collaboration, and solves the problems of poor performance and insufficient capacity under the single-chain architecture of blockchain.

[0203] The above is a schematic scheme of another cross-chain resource transfer method of this embodiment. It should be noted that the technical solution of this cross-chain resource transfer method is the same as the technical solution of the first cross-chain resource transfer method mentioned above. For details not described in detail in the technical solution of this cross-chain resource transfer method, please refer to the description of the technical solution of the first cross-chain resource transfer method. Corresponding to the above method embodiment, this application also provides an embodiment of a cross-chain resource transfer device. Figure 7 FIG. 1 shows a schematic diagram of a cross-chain resource transfer device provided by an embodiment of the present application. Figure 7 As shown, the device includes:

[0204] Determination module 702, configured to determine a cross-chain event between a source chain and a target chain through the source chain application layer;

[0205] The encapsulation module 704 is configured to encapsulate the cross-chain resources to be associated with the cross-chain event in the source chain into a target cross-chain package according to the source chain management layer;

[0206] The sending module 706 is configured to call the cross-chain contract of the source chain core application layer based on the source chain management layer and send the target cross-chain package to the relay unit;

[0207] The receiving module 708 is configured to call the target contract of the target chain core application layer based on the target chain management layer to obtain the target cross-chain package in the relay unit;

[0208] Among them, the source chain application layer is used to monitor cross-chain events, the source chain management layer is used to generate a sending event of the target cross-chain package, the target chain management layer is used to generate a receiving event of the target cross-chain package, the source chain core application layer is used to maintain the cross-chain contract, and the target chain core application layer is used to maintain the target contract.

[0209] In an optional embodiment, the determining module 702 may also be configured to:

[0210] The cross-chain request is received through the source chain application layer; and a cross-chain event between the source chain and the target chain is determined based on the cross-chain request.

[0211] In an optional embodiment, the resource cross-chain transfer device further includes:

[0212] The matching module is configured to call the matching contract of the source chain management layer as the cross-chain event matching relay unit between the source chain and the target chain; build the source chain core application layer based on the source chain application layer, and build the target chain core application layer based on the target chain application layer.

[0213] In an optional embodiment, the matching module may also be configured as follows:

[0214] Query the source chain type associated with the source chain application layer, and determine at least one initial cross-chain contract corresponding to the source chain type; construct the source chain core application layer that maintains the at least one initial cross-chain contract; query the target chain type associated with the target chain application layer, and determine at least one initial target contract corresponding to the target chain type; construct the target chain core application layer that maintains the at least one initial target contract.

[0215] In an optional embodiment, the sending module 706 may also be configured to:

[0216] Determine the target source chain type corresponding to the source chain; query the at least one initial cross-chain contract maintained by the core application layer of the source chain, and select the initial cross-chain contract associated with the target source chain type as the cross-chain contract according to the query result; execute the sending event in the cross-chain event based on the source chain management layer, and send the target cross-chain package to the relay unit by calling the cross-chain contract.

[0217] In an optional embodiment, the resource cross-chain transfer device further includes:

[0218] The business information encapsulation module is configured to determine the business information associated with the cross-chain event in the target chain management layer, and determine the to-be-crossed-chain resources associated with the cross-chain event in the source chain; according to the source chain management layer, encapsulate the business information and the to-be-crossed-chain resources to obtain a target cross-chain package.

[0219] In an optional embodiment, the resource cross-chain transfer device further includes:

[0220] The forwarding module is configured to parse the target cross-chain package based on the target chain management layer to obtain the cross-chain resources and the business information; call the business query contract of the target chain management layer to process the business information to obtain business contract information; and forward the cross-chain resources to the business contract according to the business contract information.

[0221] In an optional embodiment, the sending module 706 may also be configured to:

[0222] Based on the source chain management layer calling the cross-chain contract of the source chain core application layer, a sending event of the target cross-chain package is generated; when the relay unit monitors the sending event, the target cross-chain package is sent to the relay unit according to the source chain management layer.

[0223] In an optional embodiment, the receiving module 708 may also be configured to:

[0224] Based on the target chain management layer calling the target contract of the target chain core application layer, a reception event of the target cross-chain package is generated; when the relay unit monitors the reception event, the target cross-chain package is sent to the target chain according to the target chain management layer.

[0225] In an optional embodiment, the resource cross-chain transfer device further includes:

[0226] The status query module is configured to query the execution status of the target cross-chain package in the target chain through the relay unit; when the execution status is the first execution state, control the relay unit to discard the target cross-chain package; when the execution status is the second execution state, process the target cross-chain package on the target chain; when the execution status is the third execution state, call the target contract based on the target chain management layer to obtain the target cross-chain package in the associated relay unit.

[0227] In an optional embodiment, the resource cross-chain transfer device further includes:

[0228] The timeout module is configured to send the target cross-chain packet to the source chain when the processing time of the reception event monitored by the relay unit is greater than a time threshold.

[0229] The cross-chain resource transfer device provided in this application realizes the trusted interoperability of different blockchains, and simply and effectively carries out cross-chain information sharing, forming a multi-layer multi-chain system architecture with multi-chain collaboration, and solving the problems of poor performance and insufficient capacity under the single-chain architecture of blockchain.

[0230] The above is a schematic diagram of a cross-chain resource transfer device according to this embodiment. It should be noted that the technical solution of the cross-chain resource transfer device and the technical solution of the cross-chain resource transfer method described above are based on the same concept. For details not described in detail in the technical solution of the cross-chain resource transfer device, please refer to the description of the technical solution of the cross-chain resource transfer method described above.

[0231] Corresponding to the above method embodiment, the present application also provides another embodiment of a resource cross-chain transfer device, Figure 8 FIG. 1 shows a schematic diagram of the structure of another cross-chain resource transfer device provided by an embodiment of the present application. Figure 8 As shown, the device includes:

[0232] The cross-chain event determination module 802 is configured to determine a cross-chain event between a source chain and a target chain through the application layer;

[0233] The to-be-cross-chain resource packaging module 804 is configured to package the to-be-cross-chain resources associated with the cross-chain event in the source chain into a target cross-chain package according to the management layer;

[0234] The target cross-chain packet sending module 806 is configured to call the cross-chain contract of the core application layer based on the management layer and send the target cross-chain packet to the relay unit;

[0235] The target cross-chain packet receiving module 808 is configured to call the target contract of the core application layer based on the management layer to obtain the target cross-chain packet in the relay unit;

[0236] Among them, the application layer is used to monitor cross-chain events, the management layer is used to generate sending and receiving events of the target cross-chain package, and the core application layer is used to maintain cross-chain contracts and target contracts.

[0237] In an optional embodiment, the cross-chain event determination module 802 may also be configured to:

[0238] Receive a cross-chain request through the application layer; determine a cross-chain event between the source chain and the target chain based on the cross-chain request.

[0239] In an optional embodiment, the resource cross-chain transfer device further includes:

[0240] The relay unit matching module is configured to call the matching contract of the management layer to match the relay unit for the cross-chain event between the source chain and the target chain; and build the core application layer based on the application layer.

[0241] In an optional embodiment, the relay unit matching module may also be configured as follows:

[0242] Query the source chain type and target chain type associated with the application layer, and determine at least one initial cross-chain contract corresponding to the source chain type, and determine at least one initial target contract corresponding to the target chain type; build a core application layer that maintains the at least one initial cross-chain contract and the at least one initial target contract.

[0243] In an optional embodiment, the target cross-link packet sending module 806 may also be configured to:

[0244] Determine the target source chain type corresponding to the source chain; query the at least one initial cross-chain contract maintained by the core application layer, and select the initial cross-chain contract associated with the target source chain type as the cross-chain contract based on the query result; execute the sending event in the cross-chain event based on the management layer, and send the target cross-chain package to the relay unit by calling the cross-chain contract.

[0245] In an optional embodiment, the resource cross-chain transfer device further includes:

[0246] The business encapsulation module is configured to determine the business information associated with the cross-chain event in the management layer, and determine the to-be-crossed-chain resources associated with the cross-chain event in the source chain; according to the management layer, encapsulate the business information and the to-be-crossed-chain resources to obtain a target cross-chain package.

[0247] In an optional embodiment, the resource cross-chain transfer device further includes:

[0248] The target cross-chain packet forwarding module is configured to parse the target cross-chain packet based on the management layer to obtain the cross-chain resources and the business information; call the business query contract of the management layer to process the business information to obtain business contract information; and forward the cross-chain resources to the business contract according to the business contract information.

[0249] In an optional embodiment, the target cross-link packet sending module 806 may also be configured to:

[0250] Based on the management layer calling the cross-chain contract of the core application layer, a sending event of the target cross-chain package is generated; when the relay unit monitors the sending event, the target cross-chain package is sent to the relay unit according to the management layer.

[0251] In an optional embodiment, the target cross-link packet receiving module 808 may also be configured to:

[0252] Based on the management layer calling the target contract of the core application layer, a reception event of the target cross-chain package is generated; when the relay unit monitors the reception event, the target cross-chain package is sent to the target chain according to the management layer.

[0253] In an optional embodiment, the resource cross-chain transfer device further includes:

[0254] The execution status query module is configured to query the execution status of the target cross-chain package in the target chain through the relay unit; when the execution status is the first execution state, control the relay unit to discard the target cross-chain package; when the execution status is the second execution state, process the target cross-chain package on the target chain; when the execution status is the third execution state, call the target contract based on the management layer to obtain the target cross-chain package in the associated relay unit.

[0255] In an optional embodiment, the resource cross-chain transfer device further includes:

[0256] The receiving event timeout module is configured to send the target cross-chain packet to the source chain when the processing time of the receiving event monitored by the relay unit is greater than the time threshold.

[0257] Another cross-chain resource transfer device provided by this application realizes the trusted interoperability of different blockchains, and simply and effectively performs cross-chain information sharing, forming a multi-layer multi-chain system architecture with multi-chain collaboration, and solving the problems of poor performance and insufficient capacity under the single-chain architecture of blockchain.

[0258] The above is a schematic diagram of another cross-chain resource transfer device of this embodiment. It should be noted that the technical solution of this cross-chain resource transfer device and the technical solution of another cross-chain resource transfer method are based on the same concept. For details not described in detail in the technical solution of the cross-chain resource transfer device, please refer to the description of the technical solution of the other cross-chain resource transfer method.

[0259] Figure 9 The block diagram shows a structure of a computing device 900 according to an embodiment of the present application. The components of the computing device 900 include, but are not limited to, a memory 910 and a processor 920. The processor 920 is connected to the memory 910 via a bus 930, and a database 950 is used to store data.

[0260] The computing device 900 also includes an access device 940 that enables the computing device 900 to communicate via one or more networks 960. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 940 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0261] In one embodiment of the present application, the above components of the computing device 900 and Figure 9 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 9 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.

[0262] The computing device 900 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 900 can also be a mobile or stationary server.

[0263] Among them, when the processor 920 executes the instructions, it implements the steps of the resource cross-chain transfer method.

[0264] The above is a schematic diagram of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above-mentioned resource cross-chain transfer method are based on the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the above-mentioned resource cross-chain transfer method.

[0265] An embodiment of the present application also provides a computer-readable storage medium, which stores computer instructions, and when the instructions are executed by a processor, the steps of the resource cross-chain transfer method as described above are implemented.

[0266] The above is a schematic diagram of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium is based on the same concept as the technical solution of the aforementioned cross-chain resource transfer method. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the aforementioned cross-chain resource transfer method.

[0267] The foregoing description describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0268] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0269] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0270] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0271] The preferred embodiments of the present application disclosed above are intended only to help illustrate the present application. The optional embodiments do not describe all details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of this application. This application selects and describes these embodiments in detail in order to better explain the principles and practical applications of this application, so that those skilled in the art can better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.

Claims

1. A method for cross-chain resource transfer, characterized in that: include: Determine cross-chain events between the source chain and the target chain through the source chain application layer; According to the source chain management layer, encapsulate the cross-chain resources to be cross-chained in the source chain and associated with the cross-chain event into a target cross-chain package; Based on the source chain management layer, the cross-chain contract of the source chain core application layer is called, and the target cross-chain package is sent to the relay unit; Calling the target contract of the target chain core application layer based on the target chain management layer to obtain the target cross-chain package in the relay unit; The source chain application layer is used to monitor cross-chain events, the source chain management layer is used to generate a sending event of a target cross-chain package, the target chain management layer is used to generate a receiving event of a target cross-chain package, the source chain core application layer is used to maintain cross-chain contracts, and the target chain core application layer is used to maintain target contracts. After determining the cross-chain event between the source chain and the target chain through the source chain application layer, the following steps are also included: Calling the matching contract of the source chain management layer as the cross-chain event matching relay unit between the source chain and the target chain; The source chain core application layer is constructed based on the source chain application layer, and the target chain core application layer is constructed based on the target chain application layer.

2. The method according to claim 1, characterized in that Determining the cross-chain event between the source chain and the target chain through the source chain application layer includes: Receiving a cross-chain request through the source chain application layer; Determine a cross-chain event between the source chain and the target chain based on the cross-chain request.

3. The method according to claim 1, characterized in that The constructing of the source chain core application layer based on the source chain application layer includes: Querying the source chain type associated with the source chain application layer, and determining at least one initial cross-chain contract corresponding to the source chain type; Constructing the source chain core application layer that maintains the at least one initial cross-chain contract; Accordingly, the target chain core application layer is constructed based on the target chain application layer, including: Query the target chain type associated with the target chain application layer, and determine at least one initial target contract corresponding to the target chain type; Constructing the target chain core application layer that maintains the at least one initial target contract.

4. The method according to claim 3, characterized in that The source chain core application is called based on the source chain management layer Using the cross-chain contract of the layer, sending the target cross-chain package to the relay unit, including: Determine a target source chain type corresponding to the source chain; Querying the at least one initial cross-chain contract maintained by the core application layer of the source chain, and selecting the initial cross-chain contract associated with the target source chain type as the cross-chain contract based on the query result; Based on the source chain management layer executing the sending event in the cross-chain event, the target cross-chain package is sent to the relay unit by calling the cross-chain contract.

5. The method according to claim 1, wherein After determining the cross-chain event between the source chain and the target chain through the source chain application layer, the following steps are also included: Determine the business information associated with the cross-chain event in the target chain management layer, and determine the resources to be cross-chain associated with the cross-chain event in the source chain; According to the source chain management layer, the business information and the to-be-crossed-chain resources are encapsulated to obtain a target cross-chain package.

6. The method according to claim 5, characterized in that After calling the target contract of the target chain core application layer based on the target chain management layer and obtaining the target cross-chain package in the relay unit, the method further includes: Parsing the target cross-chain package based on the target chain management layer to obtain the to-be-crossed-chain resources and the business information; Calling the business query contract of the target chain management layer to process the business information and obtain business contract information; Forward the cross-chain resources to be transferred to the business contract according to the business contract information.

7. The method according to claim 1, characterized in that The method of calling the cross-chain contract of the core application layer of the source chain based on the source chain management layer and sending the target cross-chain package to the relay unit includes: The source chain management layer calls the cross-chain contract of the source chain core application layer to generate a sending event for the target cross-chain package; When the relay unit monitors the sending event, the target cross-link packet is sent to the relay unit according to the source link management layer.

8. The method according to claim 7, characterized in that The target chain management layer calls the target contract of the target chain core application layer to obtain the target cross-chain package in the relay unit, including: The target chain management layer calls the target contract of the target chain core application layer, generating a reception event of the target cross-chain package; When the relay unit monitors the reception event, the relay unit sends the target cross-chain packet to the target chain according to the target chain management layer.

9. The method according to claim 1, characterized in that After calling the target contract of the target chain core application layer based on the target chain management layer and obtaining the target cross-chain package in the relay unit, the method further includes: querying the execution status of the target cross-chain package in the target chain through the relay unit; When the execution state is the first execution state, controlling the relay unit to discard the target cross-link packet; When the execution state is the second execution state, processing the target cross-chain packet on the target chain; When the execution state is the third execution state, the target contract is called based on the target chain management layer to obtain the target cross-chain package in the associated relay unit.

10. The method according to claim 7, characterized in that When the relay unit monitors the sending event, after sending the target cross-chain packet to the relay unit according to the source chain management layer, the method further includes: In a case where the processing duration of the reception event monitored by the relay unit is greater than a duration threshold, the target cross-chain packet is sent to the source chain.

11. A cross-chain resource transfer device, characterized in that: include: A determination module, configured to determine a cross-chain event between a source chain and a target chain through the source chain application layer; The encapsulation module is configured to encapsulate the cross-chain resources to be cross-chain associated with the cross-chain event in the source chain into a target cross-chain package according to the source chain management layer; A sending module is configured to call the cross-chain contract of the source chain core application layer based on the source chain management layer and send the target cross-chain package to the relay unit; A receiving module is configured to call the target contract of the target chain core application layer based on the target chain management layer, and obtain the target cross-chain package in the relay unit; The source chain application layer is used to monitor cross-chain events, the source chain management layer is used to generate a sending event of a target cross-chain package, the target chain management layer is used to generate a receiving event of a target cross-chain package, the source chain core application layer is used to maintain cross-chain contracts, and the target chain core application layer is used to maintain target contracts. Among them, the resource cross-chain transfer device also includes a construction module, which is configured to call the matching contract of the source chain management layer as the cross-chain event matching relay unit between the source chain and the target chain; construct the source chain core application layer based on the source chain application layer, and construct the target chain core application layer based on the target chain application layer.

12. A method for transferring resources across chains, characterized in that: include: Determine cross-chain events between the source and target chains through the application layer; According to the management layer, encapsulate the cross-chain resources to be cross-chained in the source chain and associated with the cross-chain event into a target cross-chain package; Based on the management layer calling the cross-chain contract of the core application layer, the target cross-chain package is sent to the relay unit; Based on the management layer calling the target contract of the core application layer, obtaining the target cross-chain package in the relay unit; The application layer is used to monitor cross-chain events, the management layer is used to generate send and receive events of target cross-chain packages, and the core application layer is used to maintain cross-chain contracts and target contracts. After determining the cross-chain event between the source chain and the target chain through the application layer, the following steps are also included: Calling the matching contract of the source chain management layer as the cross-chain event matching relay unit between the source chain and the target chain; The source chain core application layer is constructed based on the source chain application layer, and the target chain core application layer is constructed based on the target chain application layer.

13. A cross-chain resource transfer device, characterized in that: include: A cross-chain event determination module, configured to determine cross-chain events between a source chain and a target chain through the application layer; The module for encapsulating cross-chain resources to be processed is configured to encapsulate the cross-chain resources to be processed associated with the cross-chain event in the source chain into a target cross-chain package according to the management layer; A target cross-chain packet sending module is configured to call the cross-chain contract of the core application layer based on the management layer and send the target cross-chain packet to the relay unit; A target cross-chain package receiving module is configured to call the target contract of the core application layer based on the management layer to obtain the target cross-chain package in the relay unit; The application layer is used to monitor cross-chain events, the management layer is used to generate send and receive events of target cross-chain packages, and the core application layer is used to maintain cross-chain contracts and target contracts. Among them, the resource cross-chain transfer device also includes a target chain core application layer construction module, which is configured to call the matching contract of the source chain management layer as the cross-chain event matching relay unit between the source chain and the target chain; construct the source chain core application layer based on the source chain application layer, and construct the target chain core application layer based on the target chain application layer.

14. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein: When the processor executes the instructions, the steps of the method according to any one of claims 1 to 10 or 12 are implemented.

15. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 10 or 12 are implemented.

16. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 10 or 12 are implemented.

Citation Information

Patent Citations

  • Cross-chain transaction processing method and device, electronic equipment and storage medium

    CN112235423A