A method and apparatus for migrating smart contract code between heterogeneous blockchains
By utilizing the verification, processing, and execution layers of the target blockchain virtual machine, efficient migration of smart contract code between heterogeneous blockchains is achieved, solving the problem of low migration efficiency in existing technologies and improving the development efficiency of blockchain technology.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID DIGITAL TECHNOLOGY HOLDING CO LTD
- Filing Date
- 2022-12-19
- Publication Date
- 2026-08-04
AI Technical Summary
In existing technologies, differences in smart contract languages, block structures, and consensus mechanisms among blockchains with different architectures lead to difficulties in migrating smart contract code, resulting in low efficiency and an inability to meet the needs of the rapid development of blockchain technology.
By acquiring the configuration data of the source blockchain and the target blockchain, and using the virtual machine of the target blockchain to run the target smart contract, including the processing of the verification layer, processing layer and execution layer, the smart contract code migration between heterogeneous blockchains is realized, avoiding the need to rewrite the contract code.
It improves the efficiency of migrating smart contract code across different architectures, reduces migration costs, and promotes the healthy development of blockchain technology.
Smart Images

Figure CN116089004B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular to a method and apparatus for migrating smart contract code between heterogeneous blockchains. Background Technology
[0002] Blockchain technology is a novel decentralized infrastructure and distributed computing paradigm that utilizes a cryptographic chain of blocks to verify and store data, a distributed node consensus algorithm to generate and update data, and automated script code (smart contracts) to program and manipulate data. In recent years, with the accelerated development of blockchain industry applications, blockchain applications have sprung up on a massive scale. Current blockchain technology can no longer meet the needs of global blockchain application systems. This presents both challenges and opportunities for many tech enthusiasts, and many teams are setting their sights on a higher and more distant future, inevitably leading to upgrades and replacements of existing blockchain technologies.
[0003] As blockchain technology continues to evolve, smart contracts on the blockchain need to be constantly migrated. A smart contract is an automated scripting technology that runs on a blockchain. Once conditions are met, the contract automatically executes its intended plan. Given a set of facts as input, the smart contract will inevitably output the correct result and publish it to the blockchain, ensuring its immutability. Currently, due to differences in smart contract languages, block structures, consensus mechanisms, and encryption mechanisms between different blockchain architectures, migrating smart contract code already deployed on one blockchain to another with a different structure requires rewriting the contract code. This is difficult, inefficient, and detrimental to the healthy and rapid development of blockchain technology. Summary of the Invention
[0004] In view of this, this application provides a method and apparatus for migrating smart contract code between heterogeneous blockchains, aiming to accurately and efficiently realize the migration of smart contracts between heterogeneous blockchains.
[0005] Firstly, this application provides a method for migrating smart contract code between heterogeneous blockchains, the method comprising: Obtain the configuration data of the source blockchain, which includes the address and type of the source blockchain; The target smart contract is obtained based on the configuration data of the source blockchain, and the target smart contract is the smart contract code to be migrated from the source blockchain; Obtain the configuration data of the target blockchain in order to migrate the target smart contract to the target blockchain. The configuration data of the target blockchain includes the address and type of the target blockchain, wherein the architecture of the target blockchain and the source blockchain are different. The target smart contract is run using the virtual machine of the target blockchain.
[0006] Optionally, the virtual machine of the target blockchain includes a verification layer, a processing layer, and an execution layer, and running the target smart contract using the virtual machine of the target blockchain includes: Invoke the target smart contract on the target blockchain; The target smart contract is verified using the verification layer. The processing layer is used to adapt the target smart contract to the target blockchain; The target smart contract is sent to the target blockchain using the execution layer.
[0007] Optionally, the step of verifying the target smart contract using the verification layer includes: Verify whether the execution environment of the virtual machine of the target blockchain meets expectations; Verify the relevant parameters in the target smart contract being invoked; The request sent by the target smart contract is verified.
[0008] Optionally, adapting the target smart contract to the target blockchain using the processing layer includes: The target smart contract is populated with code according to the configuration of the target blockchain in order to build the execution environment of the target smart contract; Calculate the target resources corresponding to the target smart contract, whereby the target resources represent the resources required to invoke the target smart contract; Generate smart contract bytecode based on the target smart contract.
[0009] Optionally, calculating the target resource corresponding to the target smart contract includes: Obtain the execution environment of the target blockchain; Obtain the code size of the target smart contract; Obtain the execution method data of the target smart contract, wherein the execution method data includes the number of external methods referenced by the target smart contract and the number of variables involved; The target resource is obtained based on the execution environment, code size, and execution method data.
[0010] Optionally, sending the target smart contract to the target blockchain using the execution layer includes: Execute the smart contract bytecode; Generate a transaction data file based on the execution results; The transaction data file is sent to the target blockchain.
[0011] Optionally, obtaining the target smart contract based on the configuration data of the source blockchain includes: Access the source blockchain according to the source blockchain's configuration file; Obtain the data file containing the relevant smart contract bytecode from the source blockchain as the target smart contract.
[0012] Secondly, this application provides a device for migrating smart contract code between heterogeneous blockchains. The device includes: a source blockchain acquisition module, a smart contract acquisition module, a target blockchain acquisition module, and a smart contract execution module. The source blockchain acquisition module is used to acquire the configuration data of the source blockchain; The smart contract acquisition module is used to obtain the target smart contract based on the configuration data of the source blockchain. The target smart contract is the smart contract code to be migrated on the source blockchain. The target blockchain acquisition module is used to acquire configuration data of the target blockchain in order to migrate the target smart contract to the target blockchain, wherein the architecture of the target blockchain and the source blockchain are different; The smart contract execution module is used to run the target smart contract using the virtual machine of the target blockchain.
[0013] Optionally, the smart contract execution module is further configured to call the target smart contract on the target blockchain, then verify the target smart contract using the verification layer in the virtual machine of the target blockchain, then adapt the target smart contract to the target blockchain using the processing layer of the virtual machine, and finally send the target smart contract to the target blockchain using the execution layer in the virtual machine.
[0014] Optionally, the smart contract acquisition module is further configured to access the source blockchain according to the configuration file of the source blockchain, and then obtain the data file containing the relevant smart contract bytecode on the source blockchain as the target smart contract.
[0015] This application provides a method for migrating smart contracts on a blockchain. When executing the method, first, the configuration data of the source blockchain is obtained. Based on the configuration data of the source blockchain, the target smart contract is obtained. Then, the configuration data of the target blockchain is obtained to migrate the target smart contract to the target blockchain. Finally, the target smart contract is run using the virtual machine of the target blockchain. In this way, by using the virtual machine of the target blockchain to run the data file of the target smart contract, the migration of smart contract code between heterogeneous blockchains can be directly performed, improving the efficiency of migrating smart contract code between blockchains with different architectures. Thus, by utilizing the compatibility of blockchain virtual machines with smart contract code on different blockchains, the migration of smart contract code between different blockchains can be completed efficiently without rewriting new smart contract code conforming to the target blockchain or performing contract code conversion. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings used in the description of the embodiment or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart illustrating one method of migrating smart contract code between heterogeneous blockchains, as provided in this application embodiment; Figure 2 A flowchart illustrating another method for migrating smart contract code between heterogeneous blockchains, as provided in this application embodiment; Figure 3 This is a schematic diagram of a device for migrating smart contract code between heterogeneous blockchains, provided in an embodiment of this application. Detailed Implementation
[0018] As mentioned earlier, with the rapid development of technology, the upgrading and data migration of blockchains are inevitable. Smart contracts, which can be viewed as computer programs running on the blockchain with pre-defined rules, states, and conditional responses, can encapsulate, verify, and execute complex behaviors of distributed nodes to complete information exchange, value transfer, and asset management. The migration of smart contract code between different blockchains plays a crucial role in the development of blockchain technology. Existing solutions only propose methods for data migration between different blockchains, without addressing the migration of smart contract code across blockchains with different architectures. Therefore, the common approach is to rewrite the smart contract code according to the original, adapting it to the new blockchain, to complete the smart contract migration. However, this method is wasteful of human and material resources, resulting in high migration costs and low efficiency, and cannot efficiently complete the migration of smart contract code between heterogeneous blockchains.
[0019] In view of this, embodiments of this application provide a method for migrating smart contract code between heterogeneous blockchains. When executing this method, firstly, the configuration data of the source blockchain is obtained; then, the target smart contract is obtained based on the configuration data of the source blockchain; next, the configuration data of the target blockchain is obtained to migrate the target smart contract to the target blockchain. Finally, the target smart contract is run using the virtual machine of the target blockchain. In this way, by using the virtual machine of the target blockchain to run the data file of the target smart contract, the migration of smart contract code between heterogeneous blockchains can be directly performed, improving the efficiency of migrating smart contract code between blockchains with different architectures. Thus, by utilizing the compatibility of blockchain virtual machines with smart contract code on different blockchains, the migration of smart contract code between different blockchains can be efficiently completed without rewriting new smart contract code conforming to the target blockchain or performing contract code conversion.
[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0021] See Figure 1 , Figure 1 A flowchart of a method for migrating smart contract code between heterogeneous blockchains provided in this application embodiment includes: S101: Obtain the configuration data of the source blockchain.
[0022] The configuration data for the source blockchain includes its address and type. This data is used to access the source blockchain after obtaining access permissions and to retrieve the smart contract code to be migrated from it as the target smart contract. The source blockchain can be of various types, such as Ethereum (ETH) and high-performance public blockchains (Solana, SOL). The blockchain address can be used to log in to the application client to obtain the smart contract or the data to be migrated. The address length differs for each type of blockchain; for example, the address length for Ethereum is 42 (including the prefix 0x), and the address length for high-performance public blockchains is 44. Of course, the configuration data can also include other types of data, without affecting the normal implementation of this embodiment.
[0023] A blockchain is essentially a chain of blocks. Each block stores specific information, and these blocks are linked together in chronological order of their creation. This chain is stored on all servers; as long as at least one server in the system is operational, the entire blockchain is secure. These servers, known as nodes in the blockchain system, provide storage and computational support. Due to its decentralized, open, independent, and secure characteristics, blockchain can better protect user privacy and help users acquire more rights, thus changing the production relations of the internet and possessing immense potential application value in multiple fields.
[0024] S102: Obtain the target smart contract based on the configuration data of the source blockchain.
[0025] The target smart contract is the smart contract code to be migrated from the source blockchain. Smart contract code is a piece of code written on the blockchain. Once an event triggers a clause in the smart contract, the code executes automatically, essentially acting as a "computer transaction protocol for executing contract terms," primarily invoked and run by a virtual machine on the blockchain. Since the smart contract code, after compilation, can be packaged into a transaction, the transaction information is submitted, and consensus is achieved to complete the on-chain process. The contract information on the chain is stored in the physical environment as files; therefore, the transaction data file compiled from the smart contract code can be directly obtained from the physical storage layer of the source blockchain as the target smart contract. Of course, the target smart contract can also be the source code before compilation; neither will affect the normal implementation of this application's embodiments.
[0026] Optionally, the target smart contract can be obtained as follows: First, access the source blockchain according to its configuration file. Then, retrieve the data file containing the relevant smart contract bytecode from the source blockchain as the target smart contract. Of course, other methods can also be used to obtain the target smart contract, without affecting the normal operation of the embodiments of this application.
[0027] S103: Obtain the configuration data of the target blockchain in order to migrate the target smart contract to the target blockchain.
[0028] The configuration data of the target blockchain includes its address and type. The configuration data of the target blockchain can be similar in format to the configuration data of the source blockchain. Optionally, the target blockchain can differ from the source blockchain in type or architecture.
[0029] Here, "migrating the target smart contract to the target blockchain" refers to a physical migration. Since different blockchains use different virtual machines, the target smart contract also needs to be adapted to the virtual machine on the target blockchain to run on it. In some possible implementations, a migration application can be created to extract, store, and manage the smart contract source code files or transaction data files containing the smart contract bytecode from the source blockchain. This allows for direct migration of the heterogeneous blockchain smart contract code at the user interaction level, without affecting the normal implementation of the embodiments in this application.
[0030] S104: Run the target smart contract using the virtual machine of the target blockchain.
[0031] A virtual machine (VM) is a virtual representation or simulation environment of a physical computer. It is also a complete computer system, simulated by software and possessing full hardware system functionality, isolated from the host environment. Common VMs include the Java Virtual Machine (JVM), VMware, and VirtualBox. A blockchain VM, on the other hand, is an independent code execution environment built on the blockchain. Its main function is to handle smart contracts in the blockchain world, providing computing resources and runtime containers for smart contracts, allowing them to run and implement complex business logic. Different blockchain architectures use different blockchain VMs to run smart contracts. For example, the Ethereum Virtual Machine (EVM) is mostly composed of a stack-based architecture, capable of executing code of arbitrary algorithmic complexity. Developers can use programming languages with syntax similar to JavaScript and Python to create applications that run on the VM. The VM itself acts as a script engine, interpreting and executing scripts based on a stack data structure. Developers can use programming languages like Golang to create scripts that run on the VM. Optionally, the core mechanism of the blockchain virtual machine is to be compatible with the requirements of different blockchains for smart contract code, rules, etc., so that smart contracts on other heterogeneous blockchains can run directly on this blockchain, or directly identify and execute transaction data files containing smart contract bytecode on the source blockchain without source code.
[0032] Alternatively, the target smart contract can be run in the following manner: First, the target smart contract is invoked on the target blockchain using a virtual machine. Then, the target smart contract is verified using the verification layer of the virtual machine. Next, the target smart contract is adapted to the target blockchain virtual machine using the processing layer of the virtual machine. Finally, the target smart contract is sent to the target blockchain using the execution layer of the virtual machine.
[0033] This application embodiment directly and physically migrates smart contract code already deployed on one blockchain to another blockchain with a different structure. The migrated smart contract code is run directly and normally using a virtual machine. By leveraging the compatibility of the virtual machine with smart contract code on blockchains of different architectures, it is not necessary to rewrite the new smart contract code according to the logic to be migrated to the blockchain. This realizes the migration of smart contract code between different architectures, improves the migration efficiency of smart contract code between blockchains of different architectures, reduces the migration cost of smart contract code, and is conducive to promoting the rapid and healthy development of blockchain.
[0034] In the embodiments of this application, the above Figure 1 There are several possible implementations of step S104, which will be described below. It should be noted that the implementations given below are merely illustrative examples and do not represent all implementations of the embodiments of this application.
[0035] See Figure 2 The figure is a flowchart of another method for migrating smart contract code between heterogeneous blockchains according to an embodiment of this application. The method includes: S201: Invoke the target smart contract on the target blockchain.
[0036] Optionally, the target blockchain can utilize a virtual machine to call the target smart contract. First, it can determine if the target smart contract is source code. If so, it pre-compiles the target smart contract to generate bytecode. If the target smart contract is a compiled transaction data file, it directly initiates an instruction to call the target smart contract and runs it on the virtual machine.
[0037] S202: Verify the target smart contract using the virtual machine's verification layer.
[0038] The virtual machine's verification layer is primarily used to verify whether the code format of the target smart contract conforms to the requirements of the target blockchain. Optionally, the verification of the target smart contract can be performed as follows: first, verify whether the execution environment of the virtual machine on the target blockchain meets expectations; then, verify the relevant parameters in the calls to the target smart contract; and finally, verify the requests sent by the target smart contract. Optionally, if the target smart contract being migrated is source code, the verification layer can determine whether the bytecode compiled from the source code meets the format requirements. If the target smart contract is a transaction data file, the verification layer can determine whether the smart contract code contained in the transaction data file meets the format requirements. The verification layer can also pass the verified smart contract code to the processing layer in the virtual machine.
[0039] S203: Adapt the target smart contract to the target blockchain using the virtual machine's processing layer.
[0040] The processing layer in the virtual machine is mainly used to adapt the smart contract code from the source blockchain to the target blockchain.
[0041] In some possible implementations, the target smart contract can be processed as follows: First, the target smart contract is populated with code according to the configuration of the target blockchain to construct its execution environment. Then, the target resources corresponding to the target smart contract are calculated, whereby the target resources represent the resources required to invoke the target smart contract. Finally, smart contract bytecode is generated based on the target smart contract.
[0042] Specifically, filling in the target smart contract with code based on the configuration of the target blockchain involves adding necessary code to the target smart contract to construct the corresponding execution context. Alternatively, the target smart contract can be adapted according to the relevant parameters set by the target blockchain virtual machine, without affecting the normal implementation of this embodiment.
[0043] Optionally, the target resources corresponding to the target smart contract can be calculated as follows: First, obtain the execution environment of the target blockchain and determine whether the target resources need to be calculated in this operation. If calculation is required, obtain the code size of the target smart contract, and then obtain the execution method data of the target smart contract. The execution method data includes the number of external methods referenced by the target smart contract and the number of variables involved. Finally, the target resources are obtained based on the execution environment, code size, and execution method data.
[0044] In some possible approaches, the target resource can be Gas Fee, primarily used to measure the computational and storage resources consumed by messages, maintaining the computational and storage required for the operation of the blockchain network. This embodiment can provide a new Gas Fee calculation rule, uniformly charging Gas Fees for the deployment and invocation of blockchain smart contracts with different architectures, without being affected by the source blockchain. Optionally, it can first determine whether the development environment of the target blockchain is Ethereum, Fabric, Rust, or another development environment. Then, it can determine the amount of code in the target smart contract, such as the number of lines of code. Next, it can determine the data of external methods referenced by the target smart contract and the number of local and global variables involved. Finally, based on a set resource weight ratio, the Gas Fee is calculated using the above data. Of course, other methods can also be used to calculate the target resource, without affecting the normal implementation of this embodiment.
[0045] S204: Use the execution layer of the virtual machine to send the target smart contract to the target blockchain.
[0046] The execution layer within the virtual machine can load and execute the compiled bytecode of the target smart contract through an interpreter, package the execution result into a transaction data file, and send it to the target blockchain to generate a block for the blockchain to use. Optionally, information in the state database can be queried and modified during execution. The state database stores and retrieves all state information related to the blockchain user; after the smart contract is executed, the values in the state database can be modified based on the execution results.
[0047] This application's embodiments utilize a blockchain virtual machine to transfer the migrated target smart contract to the target blockchain, enabling the target smart contract to run normally on the target blockchain. Since different blockchain architectures have different virtual machines, the smart contract code needs to be adapted to the virtual machine on the target blockchain. Through the virtual machine's verification layer, processing layer, and execution layer, the migration of smart contract code between heterogeneous blockchains is successfully achieved. By leveraging the virtual machine's compatibility with smart contract code on heterogeneous blockchains, the data and logic of the blockchain are separated, improving the universality of the smart contract code and making the migration of smart contracts between heterogeneous blockchains more efficient.
[0048] The above are some specific implementations of the method for migrating smart contract code between heterogeneous blockchains provided in the embodiments of this application. Based on this, this application also provides a corresponding apparatus. The apparatus provided in the embodiments of this application will be described below from the perspective of functional modularization.
[0049] See Figure 3The diagram shows the structure of a device 300 for migrating smart contract code between heterogeneous blockchains. The device 300 includes a source blockchain acquisition module 310, a smart contract acquisition module 320, a target blockchain acquisition module 330, and a smart contract execution module 340. Source blockchain acquisition module 310 is used to acquire configuration data of the source blockchain; The smart contract acquisition module 320 is used to obtain the target smart contract based on the configuration data of the source blockchain, wherein the target smart contract is the smart contract code to be migrated on the source blockchain; The target blockchain acquisition module 330 is used to acquire configuration data of the target blockchain in order to migrate the target smart contract to the target blockchain, wherein the architecture of the target blockchain and the source blockchain are different; The smart contract execution module 340 is used to run the target smart contract using the virtual machine of the target blockchain.
[0050] Optionally, the smart contract execution module 340 is also used to call the target smart contract on the target blockchain, then use the verification layer in the virtual machine of the target blockchain to verify the target smart contract, then use the processing layer of the virtual machine to adapt the target smart contract to the target blockchain, and finally use the execution layer in the virtual machine to send the target smart contract to the target blockchain.
[0051] Optionally, the smart contract acquisition module 320 is further configured to access the source blockchain according to the configuration file of the source blockchain, and then obtain the data file containing the relevant smart contract bytecode on the source blockchain as the target smart contract.
[0052] In the embodiments of this application, the terms "first" and "second" (if they exist) are used only as name identifiers and do not represent the order of first and second.
[0053] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus a general-purpose hardware platform. Based on this understanding, the technical solution of this application can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as a read-only memory (ROM) / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network communication device such as a router) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0054] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0055] The above description is merely an exemplary implementation of this application and is not intended to limit the scope of protection of this application.
Claims
1. A method for migrating smart contract code between heterogeneous blockchains, characterized in that, The method includes: Obtain the configuration data of the source blockchain, which includes the address and type of the source blockchain; Access the source blockchain according to the source blockchain's configuration file; Obtain the data file containing the relevant smart contract bytecode from the source blockchain as the target smart contract, wherein the target smart contract is the smart contract code to be migrated from the source blockchain; Obtain the configuration data of the target blockchain in order to migrate the target smart contract to the target blockchain. The configuration data of the target blockchain includes the address and type of the target blockchain, wherein the architecture of the target blockchain and the source blockchain are different. The target smart contract is run using the virtual machine of the target blockchain; The virtual machine of the target blockchain includes a verification layer, a processing layer, and an execution layer. Running the target smart contract using the virtual machine of the target blockchain includes: Invoke the target smart contract on the target blockchain; The target smart contract is verified using the verification layer. The target smart contract is populated with code according to the configuration of the target blockchain in order to build the execution environment of the target smart contract; Calculate the target resources corresponding to the target smart contract, whereby the target resources represent the resources required to invoke the target smart contract; Generate smart contract bytecode based on the target smart contract; Execute the smart contract bytecode; Generate a transaction data file based on the execution results; The transaction data file is sent to the target blockchain.
2. The method of claim 1, wherein, The verification of the target smart contract using the verification layer includes: Verify whether the execution environment of the virtual machine of the target blockchain meets expectations; Verify the relevant parameters in the target smart contract being invoked; The request sent by the target smart contract is verified.
3. The method of claim 1, wherein, The calculation of the target resource corresponding to the target smart contract includes: Obtain the execution environment of the target blockchain; Obtain the code size of the target smart contract; Obtain the execution method data of the target smart contract, wherein the execution method data includes the number of external methods referenced by the target smart contract and the number of variables involved; The target resource is obtained based on the execution environment, code size, and execution method data.
4. A device for migrating an intelligent contract code between heterogeneous blockchains, characterized in that, The device includes: a source blockchain acquisition module, a smart contract acquisition module, a target blockchain acquisition module, and a smart contract execution module; The source blockchain acquisition module is used to acquire the configuration data of the source blockchain; The smart contract acquisition module is used to obtain the target smart contract based on the configuration data of the source blockchain. The target smart contract is the smart contract code to be migrated on the source blockchain. The target blockchain acquisition module is used to acquire configuration data of the target blockchain in order to migrate the target smart contract to the target blockchain, wherein the architecture of the target blockchain and the source blockchain are different; The smart contract execution module is used to run the target smart contract using the virtual machine of the target blockchain; The smart contract execution module is further configured to: invoke the target smart contract on the target blockchain; then verify the target smart contract using the verification layer in the virtual machine of the target blockchain; fill in the code of the target smart contract according to the configuration of the target blockchain to construct the execution environment of the target smart contract; calculate the target resources corresponding to the target smart contract, the target resources representing the resources required to invoke the target smart contract; generate smart contract bytecode according to the target smart contract; finally execute the smart contract bytecode; generate a transaction data file based on the execution result; and send the transaction data file to the target blockchain. The smart contract acquisition module is also used to access the source blockchain according to the configuration file of the source blockchain, and then obtain the data file containing the relevant smart contract bytecode on the source blockchain as the target smart contract.