CN114926163A - Resource cross-chain transfer method and device - Google Patents

Resource cross-chain transfer method and device Download PDF

Info

Publication number
CN114926163A
CN114926163A CN202210600646.8A CN202210600646A CN114926163A CN 114926163 A CN114926163 A CN 114926163A CN 202210600646 A CN202210600646 A CN 202210600646A CN 114926163 A CN114926163 A CN 114926163A
Authority
CN
China
Prior art keywords
chain
target
cross
link
source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210600646.8A
Other languages
Chinese (zh)
Inventor
王迪
王炜煜
孙英男
张磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Encryption Native Technology Co Ltd
Original Assignee
Shanghai Encryption Native Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Encryption Native Technology Co Ltd filed Critical Shanghai Encryption Native Technology Co Ltd
Priority to CN202210600646.8A priority Critical patent/CN114926163A/en
Publication of CN114926163A publication Critical patent/CN114926163A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/10Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
    • G06Q20/102Bill distribution or payments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a resource cross-chain transfer method and a resource cross-chain transfer device, wherein the resource cross-chain transfer method comprises the following steps: determining a cross-link event between a source link and a target link through a source link application layer; according to a source chain management layer, packaging a resource to be cross-linked in the source chain, which is associated with the cross-link event, into a target cross-link package; based on a cross-link contract of a source link core application layer called by the source link management layer, sending the target cross-link packet to a relay unit; and calling a target contract of a target chain core application layer based on a target chain management layer to obtain the target cross-chain packet in the relay unit, thereby realizing the credible interoperation of different block chains, simply and effectively carrying out cross-chain information sharing, forming a multi-layer multi-chain system architecture with multi-chain cooperation, and solving the problems of poor performance, insufficient capacity and the like in the block chain single-chain architecture.

Description

Resource cross-chain transfer method and device
Technical Field
The application relates to the technical field of block chains, in particular to two resource cross-chain transfer methods. The application also relates to two resource cross-chain transfer devices, a computing device and a computer readable storage medium.
Background
With the development of internet technology, the blockchain technology is applied more and more, and the blockchain is essentially a database with a data hash verification function and has the advantages of decentralization, distribution, tamper resistance and the like; in the prior art, block chain applications and underlying technology platforms present various states, but each chain in the mainstream block chain applications is still an independent and vertical closed system, which results in a lack of a uniform interconnection mechanism between chains, which greatly limits the mobility of digital collections and information on the block chains, and a cross-chain technology arises for solving the problem of information interaction between chains.
However, in the case that the cross-chain resource is a digital collection with collection value, because it is difficult to synchronize the value of the same digital collection among different chains, the digital collection can only be exchanged and collected in the same chain most of the time, and cannot be applied to cross-chain transactions, and the application of the block chain and the underlying technology platform present various states, which results in a perfect differentiation among the block chains, the interworking barrier is very high, the cross-chain information sharing cannot be simply and effectively performed, and as the informatization is continuously deepened, the business form becomes increasingly complex, the single block chain is based on the trade-off between decentralization, expandability and security, and cannot meet the requirements of high transaction throughput and low delay application scenarios, that is to say, the single chain has low capability of information storage and processing, and even increases along with the operation time of the block chain, the condition that the stored information exceeds the upper limit of the capacity of the single-chain storage medium, the low processing capacity and the short board with the low storage capacity greatly limit the further application field expansion and the related service laying of the block chain.
Disclosure of Invention
In view of this, the embodiments of the present application provide two resource cross-chain transfer methods. The application relates to two resource cross-chain transfer devices, a computing device and a computer readable storage medium, which are used for solving the problems that cross-chain information sharing is difficult to carry out among block chains, the mobility of digital collections and information among the block chains is poor, a single chain faces performance bottlenecks and the like in the prior art.
According to a first aspect of an embodiment of the present application, a resource cross-chain transfer method is provided, including:
determining a cross-link event between a source link and a target link through a source link application layer;
according to a source chain management layer, packaging a resource to be cross-linked in the source chain, which is associated with the cross-link event, into a target cross-link package;
based on a cross-link contract of a source link core application layer called by the source link management layer, sending the target cross-link packet to a relay unit;
calling a target contract of a target chain core application layer based on a target chain management layer to obtain the target cross-chain packet in the relay unit;
the source chain application layer is used for monitoring a cross-chain event, the source chain management layer is used for generating a sending event of a target cross-chain packet, the target chain management layer is used for generating a receiving event of the target cross-chain packet, the source chain core application layer is used for maintaining a cross-chain contract, and the target chain core application layer is used for maintaining a target contract.
According to a second aspect of the embodiments of the present application, there is provided a resource cross-chain transfer apparatus, including:
the determining module is configured to determine a cross-link event between a source link and a target link through a source link application layer;
the encapsulation module is configured to encapsulate the to-be-cross-chain resources associated with the cross-chain events in the source chain into a target cross-chain packet according to a source chain management layer;
a sending module configured to send the target cross-link packet to a relay unit based on a cross-link contract of the source link management layer calling a source link core application layer;
a receiving module configured to obtain the target cross-link packet in the relay unit based on a target contract of a target chain management layer calling a target chain core application layer;
the source chain application layer is used for monitoring a cross-chain event, the source chain management layer is used for generating a sending event of a target cross-chain packet, the target chain management layer is used for generating a receiving event of the target cross-chain packet, the source chain core application layer is used for maintaining a cross-chain contract, and the target chain core application layer is used for maintaining the target contract.
According to a third aspect of the embodiments of the present application, there is provided another resource cross-chain transfer method, including:
determining a cross-link event between a source chain and a target chain through an application layer;
according to a management layer, packaging the resource to be cross-linked in the source chain and associated with the cross-link event into a target cross-link package;
based on a cross-link contract of a core application layer called by the management layer, sending the target cross-link contract to a relay unit;
acquiring the target cross-link package in the relay unit based on the target contract of the management layer calling the core application layer;
the application layer is used for monitoring cross-chain events, the management layer is used for generating sending event receiving events of target cross-chain packages, and the core application layer is used for maintaining cross-chain contracts and target contracts.
According to a fourth aspect of the embodiments of the present application, there is provided another resource cross-chain transfer apparatus, including:
a cross-chain event determining module configured to determine a cross-chain event between a source chain and a target chain through an application layer;
a resource to be linked to package module configured to package a resource to be linked to the link crossing event in the source link as a target link crossing package according to a management layer;
a target cross-link packet sending module configured to send the target cross-link packet to a relay unit based on a cross-link contract of the management layer calling a core application layer;
a target cross-chain packet receiving module configured to obtain the target cross-chain packet in the relay unit based on the target contract of the management layer calling the core application layer.
According to a fifth aspect of embodiments herein, there is provided a computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, the processor implementing the steps of the resource cross-chain transfer method when executing the instructions.
According to a sixth aspect of embodiments herein, there is provided a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the resource cross-chain transfer method.
According to the resource cross-chain transfer method, a cross-chain event between a source chain and a target chain is determined through a source chain application layer; according to a source chain management layer, packaging a resource to be cross-linked in the source chain, which is associated with the cross-link event, into a target cross-link packet; based on a cross-link contract of a source link core application layer called by the source link management layer, sending the target cross-link packet to a relay unit; and acquiring the target cross-link package in the relay unit based on a target contract of a target chain management layer calling a target chain core application layer.
According to the embodiment of the application, the credible interoperation of different block chains is realized, the cross-chain information sharing is simply and effectively carried out, a multi-chain cooperative multi-layer multi-chain system architecture is formed, and the problems of poor performance, insufficient capacity and the like in the block chain single-chain architecture are solved.
Drawings
FIG. 1 is a flowchart of a resource cross-chain transferring method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a cross-chain contract structure of a resource cross-chain transfer method provided by an embodiment of the present application;
FIG. 3 is a process flow diagram of a resource cross-chain transfer method applied to fund transfers according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a resource cross-chain transfer method according to an embodiment of the present application;
FIG. 5 is a schematic temporal diagram of a resource cross-chain transfer method according to an embodiment of the present application;
FIG. 6 is a flowchart of another resource cross-chain transfer method provided by an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a resource cross-chain transfer apparatus according to an embodiment of the present application;
FIG. 8 is a schematic structural diagram of another resource cross-chain transfer apparatus according to an embodiment of the present application;
fig. 9 is a block diagram of a computing device according to an embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The terminology used in the one or more embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the present application. As used in one or more embodiments of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present application refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments of the present application to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first aspect may be termed a second aspect, and, similarly, a second aspect may be termed a first aspect, without departing from the scope of one or more embodiments of the present application. The word "if," as used herein, may be interpreted as "at … …" or "when … …" or "in response to a determination," depending on the context.
First, the noun terms referred to in one or more embodiments of the present application are explained.
The Relay: and the relay unit is a cross-chain packet relay link lower system and is responsible for interacting with the cross-chain two-party chain.
Packet: the cross-chain packet is a unified message carrier for two chains and cross-chain, and contains cross-chain interaction information.
NFT: a non-homogeneous token is a unique cryptocurrency token that represents a digital asset (including in the form of jpg and video clips).
In the present application, two resource cross-chain transfer methods are provided, and the present application relates to two resource cross-chain transfer apparatuses, a computing device, and a computer-readable storage medium, which are described in detail in the following embodiments one by one.
In practical application, the current block chain application and the underlying technical platform present various states, and the various block chains cause extremely large differences of each block chain, so that the intercommunicating barriers among the block chain applications are extremely high, and the problem that cross-chain information sharing cannot be effectively performed or the problem that the complexity of cross-chain information sharing is high and the cross-chain information sharing is difficult to simply perform occurs; and in the process of resource cross-linking among the blockchains, different blockchains have difficulty in realizing values of the same digital collection.
The synchronization makes the process of cross-chain transaction of the digital collection more difficult to realize; in addition, each chain in the application of the main flow block chain is an independent and vertical closed system, so that a uniform interconnection mechanism is lacked between the chains, and the single chain architecture has the conditions of poor performance and insufficient capacity, so that the single chain architecture is mainly applied to storage of important data, and more times, in order to save storage space in the block chain, a hash value of the data to be stored is calculated and then the hash value is subjected to uplink storage.
Therefore, in the application, two resource cross-chain transfer methods are provided, by constructing an application layer, a core application layer and a management layer, resource cross-chain transfer of a block chain is realized, specific structures of the block chains of both cross-chain parties are not limited, and only the both cross-chain parties are required to support intelligent contracts, so that cross-chain transaction can be realized no matter homogeneous chains or heterogeneous chains, cross-chain information sharing can be simply and effectively realized through the cross-chain method, the flexibility of cross-chains is ensured, and development and expansion of new functions of related developers are facilitated; by the resource cross-chain transfer method, a multi-chain cooperative multi-layer multi-chain system architecture can be easily realized, so that the block chain can face more complicated application scenes, and the application performance of the block chain in various scenes is improved.
Fig. 1 shows a flowchart of a resource cross-chain transfer method provided in an embodiment of the present application, which specifically includes the following steps:
step S102: and determining a cross-link event between the source link and the target link through the source link application layer.
Specifically, according to the resource cross-chain transfer method provided in an embodiment of the present application, cross-chain transfer of resources is implemented through an application layer, a core application layer, and a management layer, as shown in fig. 2, a cross-chain contract structural schematic diagram of the resource cross-chain transfer method, such a manner may implement separation of cross-chain logic and application logic, implement seamless access to other application modules, and ensure an application range of the resource cross-chain transfer method; the application layer can be understood as an application layer contract which is automatically developed by a developer and a maintainer participating in cross-chaining according to a specific service requirement, and the application layer contract and the maintainer carry out cross-chaining by calling a core application layer contract corresponding to a source chain; the core application layer can be understood as the combination of related cross-chain functions, such as cross-chain forwarding NFT and the like, and is used for the upper application layer to call, so that the burden of an application developer on developing cross-chain application is reduced; the management layer can be understood as a unique import/export of cross-chain resources, and is responsible for parsing and routing the cross-chain resources to the corresponding application layer contract.
It should be noted that, the source chain and the target chain related to the resource cross-chain transfer method provided in this embodiment correspond to a set of application layer, core application layer, and management layer, respectively, 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 occurs when the operators maintaining the target chain and the source chain are different and are not jointly developed, or when the operators maintaining the target chain and the source chain are the same and are separately developed and are not associated with the same set of application layer, core application layer and management layer.
The source chain application layer may be understood as an application layer corresponding to a source chain, for example, corresponding to an application program, software, APP, and the like that are used when a user handles a cross-chain event, if a user a has own personal account in both a block chain a and a block chain B, the user a wishes to transfer a resource C in the block chain account a to the block chain account B, at this time, the user uses related cross-chain software D to transfer account resources on both chains, and at this time, the source chain application layer is associated with the cross-chain software D; the source chain may be understood as a block chain that sends related resources when performing a cross-chain service, that is, an initiation chain of a cross-chain behavior; the target chain may be understood as a block chain for receiving related resources when performing a cross-chain service, i.e. a receiving chain of a cross-chain behavior. A cross-chain event is understood to be an event for performing cross-chain processing on resources in two blockchains, and it should be noted that a cross-chain event includes a sending event and a receiving event.
It should be noted that the source chain and the target chain may be etherhouses, aergo, hyperhedgers, etc., where the specific block chains of the source chain and the target chain are determined by actual usage scenarios, and this embodiment is not limited.
Based on the method, under the condition that the user has the requirement of transferring the resources across the chains, the user operates the related programs developed by the developer and the maintainer, and at the moment, the source chain application layer associated with the related programs confirms the initiating chain and the receiving chain of the cross-chain behavior in the requirement of transferring the resources across the chains, namely the source chain and the target chain, and determines the cross-chain event between the source chain and the target chain.
Further, in the process of processing the cross-chain event, the processing on the cross-chain event cannot be performed without determining the starting time of the cross-chain event, and in order to solve the problem, in this embodiment, a specific implementation manner is as follows:
receiving, by the source chain application layer, a cross-chain request; and determining a cross-link event between the source link and the target link according to the cross-link request.
The cross-chain request may be understood as request information generated by a user based on an operation of the user in the process of operating a related application program, and it should be noted that the cross-chain request includes information such as selection of a source chain and a target chain corresponding to the user, and specification of cross-chain resources.
Based on the method, under the condition that a user has a cross-chain requirement, the user uses related software or programs to perform operations for meeting the self cross-chain requirement, wherein the operations include but are not limited to selecting a source chain and a target chain, logging in accounts on the source chain and the target chain, selecting resources needing to be subjected to cross-chain and the like, a cross-chain request is generated based on the operations, and a source chain application layer determines the source chain, the target chain and related resources needing to be subjected to cross-chain according to the cross-chain request and creates a cross-chain event based on the cross-chain event.
For example, user a stores an avatar resource C in its own account of blockchain a, where avatar resource C belongs to the digital collection of user a, is an NFT asset belonging to user a on chain a, and is unique on chain a. The user A wants to transfer C to a self account of a block chain B in a cross-chain manner, the user A opens cross-chain software D by using a mobile phone, selects a source chain from the block chain A, the block chain B and the block chain Y shown in a source chain menu list in the D as a block chain A, then selects a target chain from a target chain menu list in a similar selection mode as a block chain B, and determines that resources needing cross-chain are head images C by logging in an account of the user A in the chain A and clicking and selecting head images C in the user account, then realizes the confirmation of the identity of the user A through logging in the account of the user B, and then determines that the cross-chain transfer needs to transfer the head images C to the self account of the user B in the cross-chain manner. According to a series of operations of the user A, a cross-chain request is generated, and according to the cross-chain request, a source chain application layer generates a cross-chain event for transferring the avatar C from the account of the user A in the chain A to the account of the user A in the chain B in a cross-chain mode.
In summary, a source chain and a target chain of a cross-chain event and related resources to be cross-chain are determined through a source chain application layer and a cross-chain request, and the cross-chain event is generated based on the information, so that the cross-chain event is expanded by taking the cross-chain request as an initial mark of the cross-chain event.
Further, in a cross-link event, because the blockchain is an independent and vertical closed system, the blockchain cannot autonomously transmit the resource to be cross-linked, and in order to successfully transmit the resource to be cross-linked in the source chain to the target chain, in this embodiment, a specific implementation manner is as follows:
calling a matching contract of the source chain management layer to match a relay unit for the cross-chain event between the source chain and the target chain; and constructing the source chain core application layer based on the source chain application layer, and constructing the target chain core application layer based on the target chain application layer.
The source chain management layer can be understood as a management layer corresponding to a source chain, which is used for realizing registration and management of a source chain core application layer and is a unique outlet for performing chain crossing on related resources to be subjected to chain crossing in the source chain; matching contracts can be understood as contracts for realizing information interaction by connecting a source chain with a relay unit and connecting a target chain with the relay unit, such as component management contracts shown in a cross-chain contract structure schematic diagram of a resource cross-chain transfer method in fig. 2; the source chain core application layer may be understood as a core application layer corresponding to the source chain, which includes a contract for sending the resource to be cross-linked on the source chain to the relay unit and a related NFT contract, such as a service contract and an NFT contract shown in a cross-link contract structural diagram of a resource cross-link transfer method in fig. 2; the target chain application layer can be understood as an application layer corresponding to a target chain; the target chain core application layer may be understood as a core application layer associated with the target chain, and is configured to receive, to the cross-link of the resource on the relay unit, a contract of the target chain and a related NFT contract, such as a service contract and an NFT contract shown in a cross-link contract structural diagram of a resource cross-link transfer method in fig. 2; a relay unit may be understood as an intermediate unit responsible for interacting with both side chains of a cross-chain, such as a relay chain, which may implement matching of a relevant contract of a management layer with each of a source chain and a destination chain, where the relevant contract of the management layer is a relay management contract as shown in a cross-chain contract structure diagram of a resource cross-chain transfer method in fig. 2.
Based on the above, calling a matching contract of a source chain management layer, determining a relay unit of which the source chain and the target chain need to be matched and connected, matching the source chain and the relay unit, and matching the target chain and the relay unit; it should be noted that, in the process of determining the relay unit, a preset relay unit may be used as a relay unit matched with the source chain and the target chain, or when the current inter-chain event does not occur for the first time, the relay unit used for the last time is continuously used for matching with the source chain and the target chain, or the source chain and the target chain related to the last inter-chain event are the same as the source chain and the target chain related to the current inter-chain event, at this time, re-matching between the relay unit and the source chain and the target chain may not be needed, the last matching relationship may be directly applied to perform subsequent steps, which matching manner is determined by an actual usage scenario is specifically adopted, which is not limited in this embodiment; and then determining a corresponding source chain core application layer according to the source chain application layer, and determining a target layer core application layer according to the target chain application layer, wherein it needs to be explained that the value synchronization of the cross-chain transfer of the digital collection can be realized through NFT contracts on the source chain core application layer and the target chain core application layer, so that the digital collection is traded among chains.
In addition, the number of the matched relay units is unlimited, and multiple relay units can be matched with the source chain and the target chain, and in the subsequent chain-crossing event execution process, the multiple relay units simultaneously receive and transmit related chain-crossing resources, and preferably, odd number of relay units can be matched, so that in the process of judging whether a target chain-crossing packet transmitted to the target chain is credible, half number of the relay units transmitting the target chain-crossing packet is more easily determined when half number of the relay units are judged. In a specific implementation, the number of the relay units is determined by an actual usage scenario, and the embodiment is not limited. Therefore, the safety of the chain crossing time can be improved by simultaneously matching a plurality of relay units, because the reliability of the relay units is low in the execution process of the chain crossing event, particularly in the public link environment, the relay units can be badly or ineffectively attacked, the chain crossing packet is easy to intercept, replay and even forge, at the moment, the chain crossing transaction can still be safely carried out due to the plurality of relay units, the whole chain crossing service cannot be stopped, and the safety, the robustness and the high availability of the system are greatly enhanced.
Following the above example, after determining that the cross-link events around the a-link, the B-link and the avatar C need to be unfolded, determining preset Relayer1, Relayer2 and Relayer3, then matching the a-link and the B-link with the Relayer1 through a matching contract of the source link management layer, likewise matching the Relayer2 and the Relayer3, then constructing a source link core application layer according to the source link application layer, constructing a target link core application layer according to the target link application layer, and then unfolding the processing of the cross-link events with the source link core application layer, the target link core application layer and each Relayer.
In summary, the relay unit establishes a matching relationship with the source chain and the target chain, and information transmission between the source chain and the target chain can be performed through the relay unit, and due to the characteristics of the relay unit, the relay unit can monitor a sending event and a receiving event in the block chain, so that the problem that cross-chain information cannot be sent and received autonomously due to the fact that the block chain is an independent and vertical closed system is solved, and the relay unit extracts and sends related resources to the block chains of both cross-chain parties.
Further, in the process of constructing a source chain core application layer through a source chain application layer and constructing a target chain core application layer through a target chain application layer, block chain types corresponding to the source chain application layer and the target chain application layer respectively need to be combined, and in this embodiment, the specific implementation manner is as follows:
querying a 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;
correspondingly, the building the target chain core application layer based on the target chain application layer includes:
querying a target chain type associated with the target chain application layer, and determining at least one initial target contract corresponding to the target chain type; building the target chain core application layer that maintains the at least one initial target contract.
The source chain type can be understood as a block chain type of the source chain, such as etherhouse, aergo, hyperridge, and the like; an initial cross-chain contract may be understood as a contract to be used when a source chain of some type is in cross-chain transmission; similarly, the target chain type may be understood as the blockchain type of the target chain; an initial target contract may be understood as a contract to be used for some type of target chain to receive across links.
Based on this, the source chain types associated with the source chain application layer are determined, that is, when performing cross-chain, the types of the source chains that can be selected by the user need to be described, it should be noted that there may be more than one source chain type, and there may also be more than one corresponding initial cross-chain contract, as shown in a cross-chain contract structure diagram of a resource cross-chain transfer method in fig. 2, where the cross-chain contract structure diagram includes NFT1 contracts and NFT2 contracts, and then a source chain core application layer for maintaining the initial cross-chain contract is constructed according to the determined initial cross-chain contract; the construction of the target chain core application layer is similar to the construction process of the source chain core application layer, and details are not described herein.
Along the above example, in the process of constructing the source chain core application layer and the target chain core application layer, the source chain types which can be selected in the source chain menu list need to be queried, and determining a corresponding initial cross-link contract according to the selectable source link type, then constructing a source link core application layer which can call and maintain the initial cross-link contract according to the obtained initial cross-link contract, and similarly, creating a target link core application layer, which is different from the creation of the source link core application layer, the target chain core application layer creates a query that is based on the type of a selectable target chain in the target chain menu list, details are not repeated, based on the above steps, core application layers corresponding to the a chain and the B chain are created, then based on relevant contracts in the created core application layers, the a chain and the B chain are realized, and the value of the avatar C is synchronized, and the cross-chain transmission of the avatar C between the chain A and the chain B can be realized based on the established related contracts in the core application layer.
In summary, the source chain core application layer and the target chain core application layer created according to the above manner can be implemented, and extension and upgrade can be implemented relatively simply with the related application layers, and only by implementing an application contract of a corresponding interface, a cross-chain can be performed through the management layer. This greatly increases the flexibility of the cross-chain and also facilitates the development and expansion of new functions for developers.
Step S104: and according to a source chain management layer, packaging the resource to be cross-linked in the source chain, which is associated with the cross-link event, into a target cross-link package.
Specifically, after the chain crossing event is determined, the related resources to be subjected to chain crossing need to be packaged into a resource package form due to the safety consideration in the resource chain crossing process, then the resource package is transmitted in a chain crossing manner, and the uniformity of the chain crossing transmission form can be ensured through the packaging of the resources with the chain crossing, so that the transmission efficiency and quality are improved.
The source chain management layer can be understood as a management layer corresponding to a source chain, which is used for generating and managing a source chain core application layer, can call a part of contracts in the source chain core application layer to process cross-chain events, is also responsible for matching between the source chain and a relay unit, and is provided with a unique outlet for transmitting cross-chain resources by the source chain, and is responsible for encapsulating, analyzing and routing a target cross-chain packet to a corresponding contract; the resource to be subjected to cross-link can be understood as a resource which needs to be sent out from a source chain and sent to a target chain in a cross-link event; the target cross-chain package can be understood as a resource package obtained after cross-chain resources are packaged.
Based on the method, the source chain management layer encapsulates the to-be-cross-chain resources to be sent in the source chain as the target cross-chain packet, so that the uniformity of the cross-chain transmission form is ensured, the transmission efficiency and quality are improved, and the safety of the to-be-cross-chain resources in inter-chain transmission is ensured.
Further, in the process of sending the target cross-link packet, under the condition that the contract to which the target cross-link packet is routed is not clear, a resource cross-link error may occur, for example, the resource cross-link on the user a chain is transmitted to an account of another person in the B chain, so that property loss is caused, and in order to avoid the occurrence of the resource cross-link error, in this embodiment, a specific implementation manner is as follows:
determining business information associated with the cross-chain event in the target chain management layer and determining resources to be cross-chain associated with the cross-chain event in the source chain; and according to the source chain management layer, encapsulating the service information and the resource to be subjected to chain crossing to obtain a target chain crossing package.
The service information can be understood as contract information indicating that a target cross-link package is routed to a specified contract, so that the specified contract of the resource to be cross-linked from a source chain to the target chain is guaranteed, and property loss caused by cross-link fault is avoided.
Based on this, in the process of crossing a resource to be cross-linked in a source chain to a target chain, information of a contract for routing the resource to be cross-linked to the target chain needs to be determined, so that first, service information of a specified contract related to a cross-link event in a management layer of the target chain is determined, specifically, service information of the specified contract is determined according to a routing contract in the management layer shown in a cross-link contract structural diagram of a resource cross-link transfer method in fig. 2, then, the resource to be cross-linked is determined, and then, the service information and the resource to be cross-linked are jointly encapsulated into a target cross-link package.
According to the above example, after a source chain management layer is constructed, a routing contract in the source chain management layer is called, service information associated with a cross-chain event in a B chain management layer is determined, then the management contract of the source chain management layer is called, the service information and a resource of the avatar C are packaged together to obtain a target Packet, and the target Packet is subsequently crossed from an A chain to a B chain.
In conclusion, the service information is encapsulated into the target cross-chain packet, so that the resource to be cross-chain can be accurately routed to the specified contract of the target chain, and asset loss caused by transmission errors in the transaction process of the resource to be cross-chain between chains in a cross-chain event is avoided.
Step S106: and sending the target cross-link packet to a relay unit based on a cross-link contract of the source link management layer calling the source link core application layer.
Specifically, after the target inter-link bundle is obtained, since the block chain is an independent and vertical closed system, the block chain cannot realize the autonomous transmission of the target inter-link bundle, and at this time, the target inter-link bundle needs to be sent to the relay unit.
The cross-chain contract may be understood as a contract on which the source chain transfers data to the relay unit across chains, that is, a contract on which the source chain needs to send data, such as a service contract shown in a cross-chain contract structural diagram of a resource cross-chain transfer method in fig. 2.
Based on this, the source chain management layer may invoke a contract on the source chain core application layer, the invoked contract being a cross-chain contract for the source chain to use for cross-chain transmission of data, through which the target cross-chain packet is sent to the relay unit.
Further, more than one contract on the source chain core application layer is used, and a contract that is not matched with the cross-chain event is used, which may cause that the cross-chain event cannot be normally unfolded, so that invoking the cross-chain contract requires determining the cross-chain contract in the contract of the source chain core application layer, and in this embodiment, the specific implementation manner is as follows:
determining a target source chain type corresponding to the source chain; querying the at least one initial cross-link contract maintained by the source chain core application layer, and selecting the initial cross-link contract associated with the target source chain type as the cross-link contract according to a query result; and executing a sending event in the cross-chain events based on the source chain management layer, and sending the target cross-chain packet to a relay unit by calling the cross-chain contract.
The target source chain type can be understood as a blockchain type of a source chain, and by determining the type of the source chain, the blockchain type can be further deduced to carry out resource cross-chain transmission, and a cross-chain contract to be used is a contract of which type and a corresponding NFT contract, so that value synchronization of cross-chain resources between the target chain and the source chain can be realized; the cross-chain contract can be understood as a contract for transmitting a resource needing cross-chain from a target chain to a relay unit and an NFT contract for realizing value synchronization of the resource to be cross-chain in the target chain and a source chain, such as a service contract and NFT1 and NFT2 contracts shown in a cross-chain contract structural diagram of a resource cross-chain transfer method in fig. 2, where the NFT contract is called by a source chain core application layer and a target chain core application layer in a transmission event and a reception event respectively to realize value synchronization of the resource to be cross-chain between the target chain and the source chain.
Based on the method, the type of the source chain is determined, then all initial cross-chain contracts maintained by a source chain core application layer are inquired, contracts corresponding to the type of the source chain in the initial cross-chain contracts are selected as cross-chain contracts, the cross-chain contracts are matched with cross-chain transmission tasks of the source chain, and cross-chain transmission of resources in the source chain can be achieved; and then the source chain management layer executes a sending event in the cross-chain event, namely an event for sending the resource in the source chain to the relay unit, and the management layer sends the target cross-chain packet from the source chain to the relay unit by means of the cross-chain contract.
After the target Packet of the avatar C is generated along the above example, the type of the A chain is further determined, all initial cross-chain contracts maintained by a source chain core application layer are queried, then the corresponding initial cross-chain contracts are selected as cross-chain contracts according to the type of the A chain, then the cross-chain contracts are called by a source chain management layer, the target cross-chain packages of the avatar C resource are sent to the Relayer1, the Relayer2 and the Relayer3 from the A chain, and the target Packet is sent to the B chain from the Relayer in the subsequent realization.
In summary, by the above manner, sending the event is realized, the resource to be cross-linked is sent out of the source chain, the first step of the cross-linked event is realized, the cross-linked resource is sent to the relay unit, the problem that the source chain cannot independently send the resource to the target chain is solved, and resource interaction between chains is realized by using the relay unit as a link.
Further, the blockchain is an independent and vertical closed system, and cannot implement an autonomous sending resource, and in order to be able to respond to a cross-chain event and communicate resources between different chains, a relay unit may be introduced to execute the sending event, in this embodiment, a specific implementation manner is as follows:
generating a sending event of the target cross-chain packet based on the cross-chain contract of the source chain core application layer called by the source chain management layer; and under the condition that the relay unit monitors the sending event, sending the target cross-link packet to the relay unit according to the source link management layer.
The process of invoking the cross-link contract is described, and is not described herein again, and a sending event is generated under the condition that the cross-link contract is invoked and the target cross-link packet is obtained, it needs to be described that the target cross-link packet may include a state information, where the state information may include information representing that the target cross-link packet is already prepared at this time, and may be sent to the relay unit, the relay unit monitors the source chain, and after detecting the state information that the target cross-link packet is prepared at this time, i.e., monitors the sending event, the relay unit obtains the target cross-link packet in the source chain, and during the execution process of the sending event, the source chain management layer provides a unique outlet of the target cross-link packet from the source chain, and relevant features of the source cross-link contract are included in the sending contract shown in the cross-link contract structure diagram of the resource cross-link transfer method in fig. 2.
Along the use example, in the process of sending the target Packet in the chain A to the Relayer, a cross-chain contract is called through a source chain management layer to generate a sending event, the Relayer1, the Relayer2 and the Relayer3 monitor the chain A in real time, after the sending event needing to be sent to the target cross-chain Packet of the head portrait C is determined, the Relayer1, the Relayer2 and the Relayer3 obtain the target cross-chain Packet of the head portrait C in the chain A, and then the target Packet is sent to the chain B from the Relayer, so that the cross-chain of resources is realized.
In summary, in the above manner, the relay unit reads the resource to be sent in the source chain into the relay unit through monitoring of the relay unit, so that the problem that the source chain cannot autonomously send the resource to the target chain is solved, and resource interaction between chains is realized by using the relay unit as a link.
Step S108: and acquiring the target cross-link package in the relay unit based on a target contract of a target chain management layer calling a target chain core application layer.
The source chain application layer is used for monitoring a cross-chain event, the source chain management layer is used for generating a sending event of a target cross-chain packet, the target chain management layer is used for generating a receiving event of the target cross-chain packet, the source chain core application layer is used for maintaining a cross-chain contract, and the target chain core application layer is used for maintaining a target contract; further, a target contract may be understood to be similar to a cross-chain contract, with the difference being that the target contract applies to the contract on which the target chain is to rely for cross-chain transmission of data, i.e., the contract that the target chain needs to receive data in the relay unit.
Based on this, the target chain management layer may invoke a contract on the target chain core application layer, the invoked contract being a target contract for the target chain to use for cross-chain data transfer, through which the target cross-chain package is sent from the relay unit to the target chain.
Further, the blockchain is an independent and vertical closed system, and cannot implement autonomous receiving resources, and in order to implement intercommunication between resources of different chains in response to a cross-chain event, a relay unit may be introduced to execute a receiving event, in this embodiment, the specific implementation manner is as follows:
generating a receiving event of the target cross-chain packet based on the target chain management layer calling a target contract of the target chain core application layer; and under the condition that the relay unit monitors the receiving event, the target chain crossing packet is sent to the target chain according to the target chain management layer.
Wherein, the process of calling the target contract is similar to the process of calling the cross-link contract, which is not described herein again, in the case of calling the target contract, a receive event is generated, which may include, for example, a status message in the target cross-chain packet, the state information may be changed to that it needs to be sent to the target chain after the target inter-link packet is sent to the relay unit, which listens to the target chain, upon detecting that the target cross-link packet is in the relay unit at this time, and that the preparation of the target link to receive the resource data has been completed, i.e., the receiving event is monitored, the relay unit sends the target cross-link packet to the target chain, and during the execution of the receiving event, the target chain management layer provides a unique entry for the target cross-link packet to be transmitted to the target chain, the relevant characteristics are included in the receiving contract shown in the cross-chain contract structure diagram of the resource cross-chain transfer method in FIG. 2.
Along the above example, in the process of sending the target Packet in the Relayer to the B chain, after the target contract is called by the target chain management layer, the receiving event is generated, after the occurrence of the receiving event is monitored by the Relayer1, the Relayer2 and the Relayer3, the target cross-link Packet of the avatar C is sent to the B chain by the Relayer1, the Relayer2 and the Relayer3, and the target Packet is processed in the B chain subsequently, so that the avatar C is cross-linked to the B chain account of the user a.
In summary, in the above manner, the resource that needs to be transmitted in the relay unit is transmitted to the target chain through the listening of the relay unit. The chains are mutually independent vertical systems, and no interaction exists between the chains, so that a relay unit is required to be arranged for monitoring in the middle, a sending event and a receiving event are monitored through the relay unit, a transaction in one chain enters the other chain through the relay unit, and cross-chain transaction and intercommunication between the two chains are realized.
Further, after the target resource packet is sent to the target chain, it still cannot be determined to which specific contract in the target chain the target resource packet is to be routed, and in order to ensure that the chain crossing event continues, in this embodiment, a specific implementation manner is as follows:
analyzing the target chain spanning packet based on the target chain management layer to obtain the resource to be chain spanned and the service information; calling a service inquiry contract of the target chain management layer to process the service information to obtain service contract information; and forwarding the resource to be bridged to a service contract according to the service contract information.
Wherein, the business inquiry contract can be understood as being applied to determining business contract information; the service contract information may be understood as being used for specifying a service contract and directing the target cross-chain package to be subsequently routed to the specified contract, that is, to the service contract, so that in a cross-chain event, the resource needing cross-chain transaction may be traded to the on-chain account of the specified target chain.
On the basis, the target interlinkage package is analyzed through the target interlinkage management layer, the resources to be interlinked and the service information included in the target interlinkage can be analyzed, then the service inquiry contract of the target interlinkage management layer is called to process the service information, and the service contract information indicating the service contract is obtained; it should be noted that the processing manner here may be to analyze the service information, or to decrypt the service information, which depends on the relationship between the service information and the service contract information, and depends on the actual usage scenario, and this embodiment is not limited; and finally, forwarding the resource to be cross-linked to the service contract according to the service contract information.
According to the above example, after the link B receives the target Packet, the target chain crossing package of the head portrait C is analyzed through the target chain management layer, the head portrait C resource and the service information are analyzed, then the service inquiry contract of the target chain management layer is called to analyze the service information, the service contract information indicating the service contract is obtained, then the head portrait C resource is routed to the service contract according to the service contract information, and the purpose that the head portrait C crosses and links from the user A account of the chain A to the user A account of the chain B is achieved.
In conclusion, by the above manner, the resource to be subjected to chain crossing is routed to the specified contract, so that the resource is accurately subjected to chain crossing, the security of the asset on the user chain is ensured, and the problem of chain crossing resource loss caused by a resource chain crossing error is pertinently solved.
Further, in the case that there is more than one relay unit, in practical applications, there is a problem that a transmission target inter-link packet error occurs due to the fact that the relay unit is attacked, and in order to solve the security problem and keep lightweight deployment of the execution process under the condition that security is ensured, in this embodiment, a specific implementation manner is as follows:
querying, by the relay unit, an execution state of the target inter-chain packet in the target chain; when the execution state is a first execution state, controlling the relay unit to discard the target inter-link packet; processing the target cross-chain packet on the target chain under the condition that the execution state is a second execution state; and under the condition that the execution state is a third execution state, calling the target contract based on the target chain management layer to acquire the target cross-chain packet in the associated relay unit.
The execution state can be understood as state information related to the processed condition of the target cross-chain packet in the target chain after the target cross-chain packet is sent to the target chain; the first execution state may be understood as a state in which the target cross-link packet has been routed to a service contract and uplinked in the target chain; the second execution state may be understood as a state in which the target cross-link packet is recorded to have not been routed to the service contract, and the number of relay units that have sent the target cross-link packet at this time is greater than half; the third execution state may be understood as a state in which the target cross-link packet is recorded not to have been routed to the service contract yet, and the number of relay units that have sent the target cross-link packet at this time is not more than half; the associated relay unit may be understood as one of the relay units that has not sent the target inter-link packet to the target link, it should be noted that, when there is more than one relay unit that has not sent the target inter-link packet to the target link, one of the relay units needs to be selected as the associated relay unit, the selection mode may be selected according to a preset sequence, or may be selected according to a time sequence for sending the target inter-link packet to the target link, which type is determined by an actual usage scenario, and this embodiment is not limited.
Based on this, the relay unit queries the execution state of the target cross-link packet in the target chain, displays that the target cross-link packet has been routed to the service contract in the execution state, and deletes the target cross-link packet in the relay unit when the target chain is linked up, because the cross-link event is completed at this time, the purpose of the cross-link task is already achieved, and at this time, the target cross-link packet does not need to be continuously sent to the target chain, so that resources are saved; when the target cross-link packet is not routed to the service contract yet and the number of the relay units which have sent the target cross-link packet is greater than half, it indicates that the target cross-link packet which is transmitted by the relay unit in a cross-link manner is trustworthy at this time, and indicates that the relay unit is not attacked, so that resources in the target cross-link packet are tampered with, and it needs to be noted that the target cross-link packet in the target chain may include a count information, which relay unit sends the target cross-link packet to the target chain is recorded, and further, the count information may further record which relay unit sends the target cross-link packet specifically, and in this case, the problem of repeated sending caused by the fact that the relay unit is attacked can be avoided; when the target cross-link packet is not yet routed to the service contract and the number of the relay units which have sent the target cross-link packet is not more than half of the number, it indicates that the target cross-link packet which is sent to the target chain by the relay unit is not trusted yet and needs to be sent continuously, and other relay units which have not sent continuously send the target cross-link packet to the target chain.
Along the above example, in the process that the Relayer sends the target Packet to the B chain, the execution state of the target cross-chain Packet of the head image C is inquired in the B chain through the Relayer 1; when the execution state indicates that the avatar C has been transferred to the B-chain account of the user A, controlling the Relayer1 to discard the target cross-chain packet of the avatar C; when the execution state indicates that the avatar C is not transferred to the B chain account of the user A, and at the time, the Relayer2 already sends the target cross-chain package of the avatar C to the B chain, it indicates that more than half of Relayers already send the target cross-chain package of the avatar C to the B chain at the time, and the target chain receives the credibility of the target cross-chain package of the avatar C, and transfers the avatar C to the B chain account of the user A; and when the execution state indicates that the head portrait C is not transferred to the B chain account of the user A and no other Relayer sends the target cross-chain package of the head portrait C to the B chain, continuing the process that the other Relayer sends the target cross-chain package of the head portrait C to the B chain.
In summary, through the above manner, the relay units are independent from each other, and each relay unit forwards the monitored data packet, so that after the relay unit is attacked by a malicious user, the whole cross-link service is not stalled when the relay unit is malicious or damaged in the network, and the security and the high availability are ensured.
Further, in the case of performing timeout during the chain crossing time, a resource deadlock may be caused, which eventually results in a loss of a related resource and property loss, and in order to solve this problem, in this embodiment, a specific implementation manner is as follows:
and under the condition that the processing duration of the received event monitored by the relay unit is greater than a duration threshold, sending the target chain spanning packet to the source chain.
The duration threshold may be understood as a preset time length, and when the processing duration of the received event is greater than the duration threshold, it indicates that the received event is overtime.
Based on this, in the process that the relay unit monitors the received event, the processing duration of the received event is recorded, and when the processing duration is greater than a preset duration threshold, the target inter-link packet is sent to the source chain, it should be noted that, the relay unit monitors the processing duration of the received event, and may determine whether the target inter-link packet is sent to the target chain by monitoring whether the target inter-link packet exists in the target chain, that is, recording the identity of the target inter-link packet in the relay unit, and then traversing the identities of all inter-link packets in the target chain, thereby determining whether the target inter-link packet is sent to the target chain, determining the time when the target inter-link packet occurs in the target chain, and comparing the time with the time when the relay unit sends the target inter-link packet, thereby determining the processing duration of the received event; in addition, a time identifier can be added to the target cross-link packet, wherein any node of the target cross-link packet reaching the cross-link time or the time point of the processing flow is recorded, so that the processing time length of the received event is determined; in the case of more than one relay unit, the processing duration of the record is the time between when the target cross-chain packet is sent from the relay unit to being routed to the specified contract.
Along the above example, in the process that the Relayer sends the target Packet to the B chain, that is, in the execution process of the received event, taking the sending process of the Relayer1 as an example, if the processing time of the Relayer1 for monitoring the received event exceeds the preset time threshold value of 1 minute, the Relayer1 sends the avatar C back to the a chain.
In conclusion, by the above manner, under the condition of chain-crossing timeout, the resources are rolled back, so that the related equipment or system knows that the processing is overtime, and then the overtime problem is maintained or the related maintenance node is notified to maintain, and the rolled-back resources ensure that the resources are not lost, thereby avoiding property loss.
According to the resource cross-link transfer method, a cross-link event between a source link and a target link is determined through a source link application layer; according to a source chain management layer, packaging a resource to be cross-linked in the source chain, which is associated with the cross-link event, into a target cross-link package; based on a cross-link contract of a source link core application layer called by the source link management layer, sending the target cross-link packet to a relay unit; and calling a target contract of a target chain core application layer based on a target chain management layer to obtain the target cross-chain packet in the relay unit, thereby realizing the credible interoperation of different block chains, simply and effectively carrying out cross-chain information sharing, forming a multi-layer multi-chain system architecture with multi-chain cooperation, and solving the problems of poor performance, insufficient capacity and the like in the block chain single-chain architecture.
In the following, with reference to fig. 3, the application of the resource cross-chain transfer method provided in the present application in fund transfer is taken as an example to further explain the resource cross-chain transfer method. Fig. 2 shows a processing flow chart of a resource cross-chain transfer method applied to fund transfer, which is provided by an embodiment of the present application, and specifically includes the following steps:
step S302: a cross-chain request is received by a source chain application layer.
Specifically, a user A needs to transfer a certain amount of funds Z from an account of an X chain to an account of a Y chain, the user A logs in a mobile phone bank, selects an account of the user A on the X chain, then selects account transfer on the Y chain, the user A respectively logs in the account of the X chain, inputs the account number of the account of the Y chain, verifies the identity of the user A, selects some series of operations such as fund transfer Z and the like, the operations form a transfer request, namely a cross-chain request, and the application layer receives the cross-chain request.
Step S304: and determining a cross-chain event between the source chain and the target chain according to the cross-chain request.
Specifically, upon receiving a request for transfer from user A, the server that is always performing the maintenance of the data on the X-chain determines that a cross-chain event is to be performed with respect to user A.
Step S306: and calling a matching contract of a source chain management layer to match the relay unit for a cross-chain event between the source chain and the target chain.
Specifically, a matching contract of the source chain management layer is called, and the number of matched relays is 9, wherein the number of matched relays is equal to 9, and the matched relays are respectively relay 1, relay 2, … … and relay 9.
Step S308: and constructing a source chain core application layer based on the source chain application layer, and constructing a target chain core application layer based on the target chain application layer.
Specifically, a source chain type corresponding to a source chain application layer is queried to be an X chain, a type corresponding to a target chain application layer is determined to be a Y chain, initial cross-chain contracts corresponding to the X chain and the Y chain are determined to be NFT contracts, and then a source chain core application layer and a target chain core application layer for maintaining the NFT contracts are created.
Step S310: determining business information associated with a cross-chain event in a target chain management layer, and determining resources to be cross-chain associated with the cross-chain event in a source chain.
Specifically, the fund Z in the X chain related to the current transfer of the user a is determined, and the fund Z is determined to correspond to the NFT contract in the core application layer of the source chain, as shown in fig. 4 as process 1 in the schematic diagram of the resource cross-chain transfer method, and then the related account information of the user a on the Y chain is determined, as shown in fig. 4 as process 2 in the schematic diagram of the resource cross-chain transfer method.
Step S312: and according to the source chain management layer, encapsulating the service information and the resource to be subjected to chain crossing to obtain a target chain crossing package.
Specifically, according to the source chain management layer, the fund Z and the account information related to the account of the user a on the Y chain are encapsulated to obtain a packet, as shown in fig. 4, which is 3 processes in the schematic diagram of the resource cross-chain transfer method.
Step S314: and generating a sending event of the target cross-chain packet based on the cross-chain contract of the source chain core application layer called by the source chain management layer.
Specifically, according to the type of the X chain, a cross-chain contract is determined in a source chain core application layer, and a sending event of a packet about Z is generated.
Step S316: and under the condition that the relay unit monitors the transmission event, transmitting the target cross-link packet to the relay unit according to the source link management layer.
Specifically, after monitoring the sending event, the relay 1, the relay 2, … …, and the relay 9 send packets to the relay 1, the relay 2, … …, and the relay 9 according to the source chain management layer, as shown in fig. 4, which is a 4-process in the schematic diagram of the resource cross-chain transfer method.
Step S318: and calling a target contract of a target chain core application layer based on the target chain management layer to generate a receiving event of the target cross-chain packet.
Specifically, according to the type of the Y chain, a target contract is determined in a target chain core application layer, and a receiving event of a packet rooted at Z is generated.
Step S320: and under the condition that the relay unit monitors the receiving event, sending the target cross-link packet to the target link according to the target link management layer.
Specifically, after the receiver events are monitored by the Relayer1, the Relayer2, … … and the Relayer9, packets in the Relayer1, the Relayer2, … … and the Relayer9 are sent to the Y chain according to the target chain management layer, for example, 5 processes in the schematic diagram of the resource cross-chain transfer method shown in fig. 4.
Step S322: and analyzing the target cross-link packet based on the target link management layer to obtain the resource and service information to be cross-linked.
Specifically, the Relayer1 is the first relay chain which sends a packet to the Y chain, then the Relayer1 queries the execution state of the packet, checks that the packet is not yet routed to the designated contract of the Y chain, and currently only sends the packet to the Y chain by the Relayer1, at this time, the second relay chain Relayer2 sends the packet to the Y chain, the result of the Relayer2 querying the execution state of the packet is the same as that of the Relayer1, the process of sending the packet to the Y chain by the next relay chain is continued until the 5 th relay chain Relayer5 sends the packet to the Y chain, at this time, the execution state of the Relayer5 querying the packet is that the packet is not yet routed to the designated contract of the Y chain, but has been sent by the 5 relay chains, which is more than half of the total number of relay chains, and at this time, the packet is forwarded to the service contract of the Y chain; and then, the result of the relay chain inquiring the execution state of the packet is that the packet is forwarded to the service contract of Y, and in this case, the packet in the relay chain is deleted and is not sent to the Y chain any more.
In the process of forwarding the packet to the service contract of Y, the packet needs to be analyzed based on the target chain management layer to obtain the fund Z and the service information.
It should be noted that, when the processing duration of the received event is greater than the duration threshold by 10 minutes, the packet is returned to the X chain, as shown in an overtime state part in the time state diagram of the resource cross-chain transfer method provided in the embodiment of fig. 5; and in the case that the processing duration of the receiving time is less than 10 minutes, executing the resource cross-chain transfer method according to steps S302 to S326, and sending the fund Z of the user a in the X-chain account to the Y-chain account of the user a, as shown in the steps except the timeout state portion in the time-state diagram of the resource cross-chain transfer method provided in the embodiment of fig. 5.
Step S324: and calling a service inquiry contract of the target chain management layer to process the service information to obtain service contract information.
Specifically, the service information is analyzed to determine the service contract information, for example, the 6 processes in the schematic diagram of the resource cross-chain transfer method in fig. 4.
S326: and forwarding the resource to be cross-linked to the service contract according to the service contract information.
Specifically, the fund Z is sent to the account of the user a on the Y chain, as shown in the 7 processes in the schematic diagram of the 4 resource cross-chain transfer method.
According to the resource cross-chain transfer method, a cross-chain event between a source chain and a target chain is determined through a source chain application layer; according to a source chain management layer, packaging a resource to be cross-linked in the source chain, which is associated with the cross-link event, into a target cross-link packet; based on a cross-link contract of a source link core application layer called by the source link management layer, sending the target cross-link packet to a relay unit; and calling a target contract of a target chain core application layer based on a target chain management layer to obtain the target cross-chain packet in the relay unit, thereby realizing the credible interoperation of different block chains, simply and effectively carrying out cross-chain information sharing, forming a multi-layer multi-chain system architecture with multi-chain cooperation, and solving the problems of poor performance, insufficient capacity and the like in the block chain single-chain architecture.
Fig. 6 shows a flowchart of another resource cross-chain transfer method provided according to an embodiment of the present application, which specifically includes the following steps:
step S602: determining a cross-link event between a source link and a target link through an application layer.
Step S604: and according to a management layer, packaging the resource to be cross-linked in the source chain, which is associated with the cross-link event, into a target cross-link package.
Step S606: and sending the target cross-link package to the relay unit based on the cross-link contract of the management layer calling the core application layer.
Step S608: and acquiring the target cross-link package in the relay unit based on the target contract of the chain management layer calling the chain core application layer.
The application layer is used for monitoring cross-chain events, the management layer is used for generating sending event receiving events of target cross-chain packages, and the core application layer is used for maintaining cross-chain contracts and target contracts.
Specifically, the application layer is configured to monitor a cross-link event, the management layer is configured to generate a send event receive event of the target cross-link package, and the core application layer is configured to maintain a cross-link contract and a target contract. It should be noted that, the source chain and the target chain related to the other resource cross-chain transfer method provided in this embodiment correspond to the same set of application layer, core application layer, and management layer, and this situation occurs when the operators maintaining the target chain and the source chain are different but perform joint research and development, or when the operators maintaining the target chain and the source chain are the same and use the same set of application layer, core application layer, and management layer. The cross-chain event between the source chain and the target chain is processed through the application layer, the core application layer and the management layer, so that the cross-chain event can be more conveniently managed, and the safety and the efficiency of cross-chain event processing are improved.
Optionally, the determining, by the application layer, a cross-link event between the source link and the target link includes:
receiving, by the application layer, a cross-chain request;
and determining a cross-chain event between the source chain and the target chain according to the cross-chain request.
Optionally, the determining, by the source chain application layer, a cross-chain event between the source chain and the target chain further includes:
calling a matching contract of the management layer to match a relay unit for the cross-link event between the source chain and the target chain;
building the core application layer based on the application layer.
Optionally, the building the core application layer based on the application layer includes:
querying a source chain type and a target chain type associated with the application layer, determining at least one initial cross-chain contract corresponding to the source chain type, and determining at least one initial target contract corresponding to the target chain type;
a core application layer is built that maintains the at least one initial cross-link contract with at least one initial target contract.
Optionally, the sending the target cross-link packet to the relay unit based on the cross-link contract of the management layer calling the core application layer includes:
determining a target source chain type corresponding to the source chain;
querying the at least one initial cross-link contract maintained by the core application layer, and selecting the initial cross-link contract associated with the target source link type as the cross-link contract according to a query result;
and transmitting the target cross-link packet to a relay unit by calling the cross-link contract based on the management layer executing a transmission event in the cross-link events.
Optionally, the determining, by the application layer, a cross-link event between the source link and the target link further includes:
determining business information associated with the cross-chain event in the management layer and determining a resource to be cross-chain associated with the cross-chain event in the source chain;
and according to the management layer, encapsulating the service information and the resource to be subjected to chain crossing to obtain a target chain crossing packet.
Optionally, the obtaining the target inter-link package in the relay unit based on the target contract of the management layer calling core application layer further includes:
analyzing the target cross-chain packet based on the management layer to obtain the resources to be cross-chain and the service information;
calling a service inquiry contract of the management layer to process the service information to obtain service contract information;
and forwarding the resources to be cross-linked to the service contract according to the service contract information.
Optionally, the sending the target cross-link packet to the relay unit based on the cross-link contract of the management layer calling the core application layer includes:
generating a sending event of the target cross-chain package based on the cross-chain contract of the core application layer called by the management layer;
and under the condition that the relay unit monitors the sending event, sending the target cross-link packet to the relay unit according to the management layer.
Optionally, the obtaining the target cross-link package in the relay unit based on a target contract of a management layer calling a core application layer includes:
generating a receiving event of the target cross-chain package based on the target contract called by the management layer;
and under the condition that the relay unit monitors the receiving event, the target cross-link packet is sent to the target link according to the management layer.
Optionally, the obtaining the target inter-link package in the relay unit based on the target contract of the management layer calling the core application layer further includes:
querying, by the relay unit, an execution state of the target inter-chain packet in the target chain;
when the execution state is a first execution state, controlling the relay unit to discard the target inter-link packet;
processing the target cross-chain packet on the target chain under the condition that the execution state is a second execution state;
and under the condition that the execution state is a third execution state, calling the target contract based on the management layer to acquire the target cross-link package in the associated relay unit.
Optionally, when the relay unit monitors the sending event, after sending the target inter-link packet to the relay unit according to the management layer, the method further includes:
and under the condition that the processing duration of the received event monitored by the relay unit is greater than a duration threshold, sending the target chain spanning packet to the source chain.
According to the other resource cross-chain transfer method, trusted interoperation of different block chains is achieved, cross-chain information sharing is simply and effectively carried out, a multi-chain cooperative multi-layer multi-chain system architecture is formed, and the problems of poor performance, insufficient capacity and the like under the block chain single-chain architecture are solved.
The above is an illustrative scheme of another resource cross-chain transfer method of this embodiment. It should be noted that the technical solution of the resource cross-chain transfer method and the technical solution of the first resource cross-chain transfer method belong to the same concept, and details of the technical solution of the resource cross-chain transfer method, which are not described in detail, can be referred to in the description of the technical solution of the first resource cross-chain transfer method. Corresponding to the above method embodiment, the present application further provides an embodiment of a resource cross-chain transfer device, and fig. 7 shows a schematic structural diagram of a resource cross-chain transfer device provided in an embodiment of the present application. As shown in fig. 7, the apparatus includes:
a determining module 702 configured to determine, by a source chain application layer, a cross-chain event between a source chain and a target chain;
an encapsulating module 704 configured to encapsulate, according to a source chain management layer, a to-be-cross-chain resource associated with the cross-chain event in the source chain as a target cross-chain packet;
a sending module 706 configured to send the target cross-link packet to a relay unit based on a cross-link contract of the source link management layer invoking a source link core application layer;
a receiving module 708 configured to obtain the target cross-link packet in the relay unit based on a target contract of a target link management layer calling a target link core application layer;
the source chain application layer is used for monitoring a cross-chain event, the source chain management layer is used for generating a sending event of a target cross-chain packet, the target chain management layer is used for generating a receiving event of the target cross-chain packet, the source chain core application layer is used for maintaining a cross-chain contract, and the target chain core application layer is used for maintaining a target contract.
In an optional embodiment, the determining module 702 may be further configured to:
receiving, by the source chain application layer, a cross-chain request; and determining a cross-link event between the source link and the target link according to the cross-link request.
In an optional embodiment, the resource cross-chain transfer apparatus further includes:
a matching module configured to invoke a matching contract of the source chain management layer to match a relay unit for the cross-chain event between the source chain and the target chain; and constructing the source chain core application layer based on the source chain application layer, and constructing the target chain core application layer based on the target chain application layer.
In an optional embodiment, the matching module may be further configured to:
querying a 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; querying a target chain type associated with the target chain application layer, and determining at least one initial target contract corresponding to the target chain type; building the target chain core application layer that maintains the at least one initial target contract.
In an optional embodiment, the sending module 706 may be further configured to:
determining a target source chain type corresponding to the source chain; querying the at least one initial cross-link contract maintained by the source link core application layer, and selecting the initial cross-link contract associated with the target source link type as the cross-link contract according to a query result; and executing a sending event in the cross-chain events based on the source chain management layer, and sending the target cross-chain packet to a relay unit by calling the cross-chain contract.
In an optional embodiment, the resource cross-chain transferring apparatus further includes:
a business information encapsulation module configured to determine business information associated with the cross-chain event in the target chain management layer and determine a resource to be cross-chain associated with the cross-chain event in the source chain; and according to the source chain management layer, encapsulating the service information and the resource to be subjected to chain crossing to obtain a target chain crossing package.
In an optional embodiment, the resource cross-chain transfer apparatus further includes:
the forwarding module is configured to analyze the target cross-link packet based on the target chain management layer to obtain the resource to be cross-linked and the service information; calling a service inquiry contract of the target chain management layer to process the service information to obtain service contract information; and forwarding the resource to be bridged to a service contract according to the service contract information.
In an optional embodiment, the sending module 706 may be further configured to:
generating a sending event of the target cross-link package based on a cross-link contract called by the source link management layer to the source link core application layer; and under the condition that the relay unit monitors the sending event, sending the target cross-link packet to the relay unit according to the source link management layer.
In an optional embodiment, the receiving module 708 may be further configured to:
generating a receiving event of the target cross-chain packet based on the target chain management layer calling a target contract of the target chain core application layer; and under the condition that the relay unit monitors the receiving event, the target chain crossing packet is sent to the target chain according to the target chain management layer.
In an optional embodiment, the resource cross-chain transfer apparatus further includes:
a state query module configured to query, by the relay unit, an execution state of the target inter-chain packet in the target chain; controlling the relay unit to discard the target inter-link packet if the execution state is a first execution state; processing the target cross-chain packet on the target chain under the condition that the execution state is a second execution state; and under the condition that the execution state is a third execution state, calling the target contract based on the target chain management layer to acquire the target cross-chain packet in the associated relay unit.
In an optional embodiment, the resource cross-chain transferring apparatus further includes:
a time-out module configured to send the target inter-link packet to the source link when the processing duration according to the monitoring of the receiving event by the relay unit is greater than a duration threshold.
The resource cross-chain transfer device provided by the application realizes the credible interoperation of different block chains, simply and effectively carries out cross-chain information sharing, forms a multi-layer multi-chain system architecture with multi-chain cooperation, and solves the problems of poor performance, insufficient capacity and the like existing under the block chain single-chain architecture.
The above is an exemplary scheme of the resource cross-chain transfer apparatus according to this embodiment. It should be noted that the technical solution of the resource cross-chain transfer apparatus and the technical solution of the resource cross-chain transfer method belong to the same concept, and details of the technical solution of the resource cross-chain transfer apparatus, which are not described in detail, can be referred to the description of the technical solution of the resource cross-chain transfer method.
Corresponding to the above method embodiment, the present application further provides another resource cross-chain transfer apparatus embodiment, and fig. 8 shows a schematic structural diagram of another resource cross-chain transfer apparatus provided in the present application. As shown in fig. 8, the apparatus includes:
a cross-chain event determining module 802 configured to determine a cross-chain event between the source chain and the target chain through an application layer;
a to-be-cross-chain resource encapsulation module 804 configured to encapsulate, according to a management layer, to-be-cross-chain resources associated with the cross-chain event in the source chain as a target cross-chain packet;
a target cross-link packet sending module 806 configured to send the target cross-link packet to a relay unit based on a cross-link contract of the management layer invoking a core application layer;
a target cross-link packet receiving module 808, configured to obtain the target cross-link packet in the relay unit based on the management layer invoking the target contract of the core application layer;
the application layer is used for monitoring cross-chain events, the management layer is used for generating sending event receiving events of target cross-chain packages, and the core application layer is used for maintaining cross-chain contracts and target contracts.
In an optional embodiment, the cross-chain event determining module 802 may be further configured to:
receiving, by the application layer, a cross-chain request; and determining a cross-link event between the source link and the target link according to the cross-link request.
In an optional embodiment, the resource cross-chain transferring apparatus further includes:
a relay unit matching module configured to invoke a matching contract of the management layer to match a relay unit for the cross-link event between the source chain and the target chain; building the core application layer based on the application layer.
In an optional embodiment, the relay unit matching module may be further configured to:
querying a source chain type and a target chain type associated with the application layer, determining at least one initial cross-chain contract corresponding to the source chain type, and determining at least one initial target contract corresponding to the target chain type; building a core application layer with at least one initial target contract that maintains the at least one initial cross-link contract.
In an optional embodiment, the target inter-link packet sending module 806 may be further configured to:
determining a target source chain type corresponding to the source chain; querying the at least one initial cross-link contract maintained by the core application layer, and selecting the initial cross-link contract associated with the target source link type as the cross-link contract according to a query result; and transmitting the target cross-link packet to a relay unit by calling the cross-link contract based on the management layer executing a transmission event in the cross-link events.
In an optional embodiment, the resource cross-chain transfer apparatus further includes:
a business encapsulation module configured to determine business information associated with the cross-chain event in the management layer and determine a resource to be cross-chain associated with the cross-chain event in the source chain; and according to the management layer, packaging the service information and the resource to be subjected to chain crossing to obtain a target chain crossing packet.
In an optional embodiment, the resource cross-chain transfer apparatus further includes:
a target cross-chain packet forwarding module configured to analyze the target cross-chain packet based on the management layer to obtain the resource to be cross-chain and the service information; calling a service inquiry contract of the management layer to process the service information to obtain service contract information; and forwarding the resources to be cross-linked to the service contract according to the service contract information.
In an optional embodiment, the target inter-link packet sending module 806 may be further configured to:
generating a sending event of the target cross-link package based on the cross-link contract of the core application layer called by the management layer; and under the condition that the relay unit monitors the sending event, sending the target cross-link packet to the relay unit according to the management layer.
In an optional embodiment, the target inter-chain packet receiving module 808 may be further configured to:
generating a receiving event of the target cross-chain package based on the target contract of the core application layer called by the management layer; and under the condition that the relay unit monitors the receiving event, the target cross-link packet is sent to the target link according to the management layer.
In an optional embodiment, the resource cross-chain transferring apparatus further includes:
an execution state query module configured to query, by the relay unit, the execution state of the target inter-chain packet in the target chain; when the execution state is a first execution state, controlling the relay unit to discard the target inter-link packet; processing the target cross-chain packet on the target chain under the condition that the execution state is a second execution state; and under the condition that the execution state is a third execution state, calling the target contract based on the management layer to acquire the target cross-link package in the associated relay unit.
In an optional embodiment, the resource cross-chain transfer apparatus further includes:
a receive event timeout module configured to send the target inter-link packet to the source link if a processing duration according to the monitoring of the receive event by the relay unit is greater than a duration threshold.
The other resource cross-chain transfer device provided by the application realizes the credible interoperation of different block chains, simply and effectively carries out cross-chain information sharing, forms a multi-layer multi-chain system architecture with multi-chain cooperation, and solves the problems of poor performance, insufficient capacity and the like existing under the block chain single-chain architecture.
The above is another schematic scheme of the resource cross-chain transfer apparatus of this embodiment. It should be noted that the technical solution of the resource cross-chain transfer apparatus and the technical solution of another resource cross-chain transfer method belong to the same concept, and details that are not described in detail in the technical solution of the resource cross-chain transfer apparatus can be referred to the description of the technical solution of another resource cross-chain transfer method.
Fig. 9 illustrates a block diagram of a computing device 900 according to an embodiment of the present application. Components of the computing device 900 include, but are not limited to, a memory 910 and a processor 920. The processor 920 is coupled to the memory 910 via a bus 930, and a database 950 is used to store data.
Computing device 900 also includes access device 940, access device 940 enabling computing device 900 to communicate via one or more networks 960. Examples of such networks include the 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. 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 IEEE802.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 so forth.
In one embodiment of the present application, the above-described components of computing device 900 and other components not shown in FIG. 9 may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 9 is for purposes of example only and is not limiting as to the scope of the present application. Other components may be added or replaced as desired by those skilled in the art.
Computing device 900 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet computer, personal digital assistant, laptop computer, notebook computer, netbook, etc.), mobile phone (e.g., smartphone), wearable computing device (e.g., smartwatch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 900 may also be a mobile or stationary server.
Wherein, the processor 920 implements the steps of the resource cross-chain transferring method when executing the instructions.
The above is an illustrative scheme of a computing device of the present embodiment. It should be noted that the technical solution of the computing device and the technical solution of the resource cross-chain transfer method belong to the same concept, and details that are not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the resource cross-chain transfer method.
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 instructions implement the steps of the resource cross-chain transfer method as described above.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the resource cross-chain transfer method belong to the same concept, and details that are not described in detail in the technical solution of the storage medium can be referred to the description of the technical solution of the resource cross-chain transfer method.
The foregoing description has been directed to specific embodiments of this application. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in source code form, object code form, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U.S. disk, removable hard disk, magnetic diskette, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunications signal, and software distribution medium, etc. It should be noted that the computer-readable medium may contain suitable additions or subtractions depending on the requirements of legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer-readable media may not include electrical carrier signals or telecommunication signals in accordance with legislation and patent practice.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art will appreciate that the embodiments described in this specification are presently considered to be preferred embodiments and that acts and modules are not required in the present application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to the related descriptions of other embodiments.
The preferred embodiments of the present application disclosed above are intended only to aid in the explanation of the application. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and its practical application, to thereby enable others skilled in the art to best understand the application and its practical application. The application is limited only by the claims and their full scope and equivalents.

Claims (16)

1. A method for transferring resources across chains is characterized by comprising the following steps:
determining a cross-link event between a source link and a target link through a source link application layer;
according to a source chain management layer, packaging a resource to be cross-linked in the source chain, which is associated with the cross-link event, into a target cross-link package;
based on a cross-link contract of a source link core application layer called by the source link management layer, sending the target cross-link packet to a relay unit;
calling a target contract of a target chain core application layer based on a target chain management layer to acquire the target cross-chain packet in the relay unit;
the source chain application layer is used for monitoring a cross-chain event, the source chain management layer is used for generating a sending event of a target cross-chain packet, the target chain management layer is used for generating a receiving event of the target cross-chain packet, the source chain core application layer is used for maintaining a cross-chain contract, and the target chain core application layer is used for maintaining the target contract.
2. The method of claim 1, wherein determining, by a source chain application layer, a cross-chain event between a source chain and a target chain comprises:
receiving, by the source chain application layer, a cross-chain request;
and determining a cross-chain event between the source chain and the target chain according to the cross-chain request.
3. The method of claim 1, wherein after determining, by the source chain application layer, the cross-chain event between the source chain and the target chain, the method further comprises:
calling a matching contract of the source chain management layer to match a relay unit for the cross-chain event between the source chain and the target chain;
and constructing the source chain core application layer based on the source chain application layer, and constructing the target chain core application layer based on the target chain application layer.
4. The method of claim 3, wherein the building the source chain core application layer based on the source chain application layer comprises:
querying a 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;
correspondingly, the building of the target chain core application layer based on the target chain application layer includes:
querying a target chain type associated with the target chain application layer, and determining at least one initial target contract corresponding to the target chain type;
building the target chain core application layer that maintains the at least one initial target contract.
5. The method of claim 4, wherein sending the target cross-link packet to a relay unit based on a cross-link contract that the source link management layer invokes a source link core application layer comprises:
determining a target source chain type corresponding to the source chain;
querying the at least one initial cross-link contract maintained by the source chain core application layer, and selecting the initial cross-link contract associated with the target source chain type as the cross-link contract according to a query result;
and executing a sending event in the cross-chain events based on the source chain management layer, and sending the target cross-chain packet to a relay unit by calling the cross-chain contract.
6. The method of claim 1, wherein after determining, by the source chain application layer, the cross-chain event between the source chain and the target chain, the method further comprises:
determining business information associated with the cross-chain event in the target chain management layer and determining resources to be cross-chain associated with the cross-chain event in the source chain;
and according to the source chain management layer, packaging the service information and the resource to be subjected to chain crossing to obtain a target chain crossing packet.
7. The method of claim 6, wherein after obtaining the target cross-link package in the relay unit based on the target contract of the target chain management layer invoking the target chain core application layer, further comprising:
analyzing the target chain spanning packet based on the target chain management layer to obtain the resource to be subjected to chain spanning and the service information;
calling a service inquiry contract of the target chain management layer to process the service information to obtain service contract information;
and forwarding the resources to be cross-linked to the service contract according to the service contract information.
8. The method of claim 1, wherein sending the target cross-link packet to a relay unit based on a cross-link contract that the source link management layer invokes a source link core application layer comprises:
generating a sending event of the target cross-link package based on a cross-link contract called by the source link management layer to the source link core application layer;
and under the condition that the relay unit monitors the sending event, sending the target cross-link packet to the relay unit according to the source link management layer.
9. The method of claim 8, wherein obtaining the target cross-chain packet in the relay unit based on a target chain management layer invoking a target contract of a target chain core application layer comprises:
generating a receiving event of the target cross-chain packet based on the target chain management layer calling a target contract of the target chain core application layer;
and under the condition that the relay unit monitors the receiving event, the target chain crossing packet is sent to the target chain according to the target chain management layer.
10. The method of claim 3, wherein after obtaining the target cross-link package in the relay unit based on the target contract of the target chain management layer invoking the target chain core application layer, further comprising:
querying, by the relay unit, the target chain for an execution state of the target inter-chain packet;
when the execution state is a first execution state, controlling the relay unit to discard the target inter-link packet;
processing the target cross-chain packet on the target chain under the condition that the execution state is a second execution state;
and under the condition that the execution state is a third execution state, calling the target contract based on the target chain management layer to acquire the target cross-chain packet in the associated relay unit.
11. The method of claim 8, wherein after the transmitting the target inter-link packet to the relay unit according to the source link management layer in case that the relay unit listens for the transmission event, further comprising:
and sending the target chain spanning packet to the source chain under the condition that the processing time length of the received event monitored by the relay unit is greater than a time length threshold value.
12. A resource cross-chain transfer apparatus, comprising:
the determining module is configured to determine a cross-link event between a source link and a target link through a source link application layer;
the encapsulation module is configured to encapsulate the to-be-cross-chain resources associated with the cross-chain event in the source chain into a target cross-chain packet according to a source chain management layer;
a sending module configured to send the target cross-link packet to a relay unit based on a cross-link contract of the source link management layer calling a source link core application layer;
a receiving module configured to obtain the target cross-link packet in the relay unit based on a target contract of a target link management layer calling a target link core application layer;
the source chain application layer is used for monitoring a cross-chain event, the source chain management layer is used for generating a sending event of a target cross-chain packet, the target chain management layer is used for generating a receiving event of the target cross-chain packet, the source chain core application layer is used for maintaining a cross-chain contract, and the target chain core application layer is used for maintaining the target contract.
13. A method for transferring resources across chains is characterized by comprising the following steps:
determining a cross-link event between a source link and a target link through an application layer;
according to a management layer, packaging the resource to be cross-linked in the source chain and associated with the cross-link event into a target cross-link package;
based on a cross-link contract of a core application layer called by the management layer, sending the target cross-link contract to a relay unit;
calling a target contract of the core application layer based on the management layer to acquire the target cross-link packet in the relay unit;
the application layer is used for monitoring cross-chain events, the management layer is used for generating sending event receiving events of target cross-chain packages, and the core application layer is used for maintaining cross-chain contracts and target contracts.
14. A resource cross-chain transfer apparatus, comprising:
a cross-chain event determining module configured to determine a cross-chain event between a source chain and a target chain through an application layer;
a resource to be linked to package module configured to package a resource to be linked to the link crossing event in the source link as a target link crossing package according to a management layer;
a target cross-link packet sending module configured to send the target cross-link packet to a relay unit based on a cross-link contract of the management layer calling a core application layer;
a target cross-link packet receiving module configured to obtain the target cross-link packet in the relay unit based on a target contract of the management layer calling the core application layer;
the application layer is used for monitoring cross-chain events, the management layer is used for generating sending event receiving events of target cross-chain packages, and the core application layer is used for maintaining cross-chain contracts and target contracts.
15. A computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein the processor implements the steps of the method of any one of claims 1-11 or 13 when executing the instructions.
16. A computer-readable storage medium storing computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 1 to 11 or 13.
CN202210600646.8A 2022-05-30 2022-05-30 Resource cross-chain transfer method and device Pending CN114926163A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210600646.8A CN114926163A (en) 2022-05-30 2022-05-30 Resource cross-chain transfer method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210600646.8A CN114926163A (en) 2022-05-30 2022-05-30 Resource cross-chain transfer method and device

Publications (1)

Publication Number Publication Date
CN114926163A true CN114926163A (en) 2022-08-19

Family

ID=82812109

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210600646.8A Pending CN114926163A (en) 2022-05-30 2022-05-30 Resource cross-chain transfer method and device

Country Status (1)

Country Link
CN (1) CN114926163A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115796868A (en) * 2022-11-22 2023-03-14 紫绶(上海)信息科技有限公司 Method for realizing multi-block chain simultaneous casting launch and multi-chain NFT application
CN116340386A (en) * 2023-03-09 2023-06-27 北京京航计算通讯研究所 NFT data rights and interests identification method and system of distributed AI system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115796868A (en) * 2022-11-22 2023-03-14 紫绶(上海)信息科技有限公司 Method for realizing multi-block chain simultaneous casting launch and multi-chain NFT application
CN116340386A (en) * 2023-03-09 2023-06-27 北京京航计算通讯研究所 NFT data rights and interests identification method and system of distributed AI system
CN116340386B (en) * 2023-03-09 2024-05-07 北京京航计算通讯研究所 NFT data rights and interests identification method and system of distributed AI system

Similar Documents

Publication Publication Date Title
CN114926163A (en) Resource cross-chain transfer method and device
CN110266815B (en) Micro service network system based on block chain
US11451973B2 (en) Simulating operation of a 5G wireless telecommunication network
CN113778615B (en) Rapid and stable network shooting range virtual machine construction system
CN113626002A (en) Service execution method and device
JP2018092565A (en) Cloud relay device, cloud connection processing method, and program
WO2020042929A1 (en) Block chain system
CN110995829A (en) Instance calling method and device and computer storage medium
CN116755799A (en) Service arrangement system and method
CN115776501A (en) Block chain system architecture, management method, electronic equipment and readable storage medium
CN116389323A (en) Throughput test method, device and storage medium
CN114979148B (en) Data transmission method, device and computer readable storage medium
CN109271454A (en) A kind of method and the network equipment that data are synchronous
CN108713199A (en) Right management method, system, mobile terminal, shared charging equipment and server
CN114240651A (en) Cross-chain transaction sending method, device, equipment and storage medium
CN113612732A (en) Resource calling method and device and multi-party secure computing system
CN110011979A (en) Net hot standby implementation method and device more
CN110489272A (en) The operating system recovery method, apparatus and web camera of web camera
CN115248912B (en) System login method and device based on cloud terminal and computer readable storage medium
CN116647559A (en) Edge resource capacity expansion method, edge cloud system, equipment and storage medium
CN111181996B (en) Code detection image implementation method and system based on distributed multi-connection architecture
WO2023231714A1 (en) Communication method, apparatus, and system
CN113542313B (en) Third-party Internet of things platform equipment docking system and method
WO2024050838A1 (en) Communication method and apparatus
CN115988087B (en) Service calling method and device based on bus, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination