CN112819464B - Intelligent contract processing method, processing device, terminal equipment and storage medium - Google Patents

Intelligent contract processing method, processing device, terminal equipment and storage medium Download PDF

Info

Publication number
CN112819464B
CN112819464B CN202110076962.5A CN202110076962A CN112819464B CN 112819464 B CN112819464 B CN 112819464B CN 202110076962 A CN202110076962 A CN 202110076962A CN 112819464 B CN112819464 B CN 112819464B
Authority
CN
China
Prior art keywords
contract
executed
blockchain
execution
digital assets
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.)
Active
Application number
CN202110076962.5A
Other languages
Chinese (zh)
Other versions
CN112819464A (en
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.)
Shenzhen Tianqi Xuda Technology Co ltd
Original Assignee
Shenzhen Tianqi Xuda 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 Shenzhen Tianqi Xuda Technology Co ltd filed Critical Shenzhen Tianqi Xuda Technology Co ltd
Priority to CN202110076962.5A priority Critical patent/CN112819464B/en
Publication of CN112819464A publication Critical patent/CN112819464A/en
Application granted granted Critical
Publication of CN112819464B publication Critical patent/CN112819464B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/38Payment protocols; Details thereof
    • G06Q20/381Currency conversion
    • 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/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • G06Q20/0655Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash e-cash managed centrally

Abstract

The application is applicable to the technical field of blockchain, and provides an intelligent contract processing method, a processing device, terminal equipment and a storage medium, wherein the method comprises the following steps: receiving an execution contract request sent by a node of a first blockchain, wherein the execution contract request comprises target information of a contract to be executed and a first preset number of first digital assets, the first digital assets are legal assets of the first blockchain, and the contract to be executed is located on the second blockchain; exchanging the first preset number of first digital assets into second digital assets through a target gateway of the second blockchain, wherein the second digital assets are legal assets of the second blockchain; and executing the contract to be executed according to the target information of the contract to be executed and the second digital asset, and obtaining an execution result of the contract to be executed. The application can solve the problems of centralization and low transaction efficiency in the cross-link technology to a certain extent.

Description

Intelligent contract processing method, processing device, terminal equipment and storage medium
Technical Field
The application belongs to the field of blockchain, and particularly relates to an intelligent contract processing method, an intelligent contract processing device, terminal equipment and a storage medium.
Background
Smart contracts are a computer protocol that propagates, validates, or executes contracts in an informative manner, allowing trusted transactions to be made without third parties, and which cannot be tracked while also being irreversible.
Because the blockchain has the characteristics of centralization, non-falsification and the like. Thus, smart contracts are typically implemented through blockchains. For example, smart contracts are implemented by ethernet.
The intelligent contract is executed with the corresponding currency. For example, when a smart contract is deployed on an ethernet, ethernet coin is required to drive the execution of the smart contract. When the user is not on the same chain with the intelligent contract, the user needs to exchange the currency of the user into the currency corresponding to the blockchain where the intelligent contract is located through a cross-chain technology, and then the user drives the intelligent contract to execute.
For example, the blockchain where the user is located is the a chain, the blockchain where the intelligent contract is located is the B chain, the user needs to exchange the a coin (the coin type corresponding to the a chain) into the C coin (the coin type corresponding to the C chain, at this time, the C chain is the intermediate node) through the gateway of the C chain, then the C coin is exchanged into the B coin through the gateway of the C chain, and finally the B coin is used to execute the intelligent contract.
However, the intermediate node is a centralized blockchain, the reliability of which is not guaranteed. In addition, two times of currency exchange, the exchange of the currency of the intermediate node into the corresponding currency of the intelligent contract always has delay, which leads to longer execution time of the intelligent contract, and thus, the transaction efficiency is low.
Disclosure of Invention
The embodiment of the application provides an intelligent contract processing method, an intelligent contract processing device, terminal equipment and a storage medium, which can solve the problems of centralization and low transaction efficiency in a cross-link technology to a certain extent.
In a first aspect, an embodiment of the present application provides an intelligent contract processing method applied to a node of a second blockchain, including:
receiving an execution contract request sent by a node of a first blockchain, wherein the execution contract request comprises target information of a contract to be executed and a first preset number of first digital assets, the first digital assets are legal assets of the first blockchain, and the contract to be executed is positioned on the second blockchain;
exchanging the first preset number of first digital assets into second digital assets through a target gateway of the second blockchain, wherein the second digital assets are legal assets of the second blockchain;
and executing the contract to be executed according to the target information of the contract to be executed and the second digital asset, and obtaining an execution result of the contract to be executed.
In a second aspect, an embodiment of the present application provides an intelligent contract processing apparatus, applied to a node of a second blockchain, including:
a request receiving module, configured to receive an execution contract request sent by a node of a first blockchain, where the execution contract request includes target information of a contract to be executed and a first preset number of first digital assets, where the first digital assets are legal assets of the first blockchain, and the contract to be executed is located on the second blockchain;
the asset exchange module is used for exchanging the first digital assets with the first preset number into second digital assets through a target gateway of a second blockchain, wherein the second digital assets are legal assets of the second blockchain;
and the contract executing module is used for executing the contract to be executed according to the target information of the contract to be executed and the second digital asset to obtain an executing result of the contract to be executed.
In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method according to the first aspect when the processor executes the computer program.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a computer program product, which when run on a terminal device, causes the terminal device to perform the smart contract processing method as described in any one of the first aspects above.
It will be appreciated that the advantages of the second to fifth aspects may be found in the relevant description of the first aspect, and are not described here again.
Compared with the prior art, the embodiment of the application has the beneficial effects that:
the application provides an intelligent contract processing method, which comprises the steps of firstly, receiving a contract executing request sent by a node of a first blockchain, wherein the contract executing request comprises target information of a contract to be executed and a first preset number of first digital assets, the first digital assets are legal assets of the first blockchain, and the contract to be executed is positioned on a second blockchain. And then exchanging the first preset number of first digital assets into second digital assets through a target gateway of the second blockchain, wherein the second digital assets are legal assets of the second blockchain. And finally, executing the contract to be executed according to the target information of the contract to be executed and the second digital asset, and obtaining an execution result of the contract to be executed. Because the target gateway and the contracts to be executed are both on the second blockchain, only one time of asset exchange is needed, and no second time of asset exchange exists, the time for executing the contracts is reduced, and the transaction efficiency is improved. And at this time, the second blockchain is used as the blockchain where the intelligent contract is located and is not an intermediate node, so that the problem of centralization is solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments or the description of the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a smart contract processing method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an intelligent contract processing apparatus according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in the present description and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Furthermore, the terms "first," "second," "third," and the like in the description of the present specification and in the appended claims, are used for distinguishing between descriptions and not necessarily for indicating or implying a relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
In order to illustrate the technical scheme of the application, the following description is made by specific examples.
Example 1
An intelligent contract processing method according to a first embodiment of the present application is described below, and the method is applied to a node of a second blockchain, referring to fig. 1, and includes:
step S101, receiving an executing contract request sent by a node of a first blockchain, where the executing contract request includes target information of a contract to be executed and a first preset number of first digital assets, the first digital assets are legal assets of the first blockchain, and the contract to be executed is located on a second blockchain.
In step S101, the node of the first blockchain and the node of the second blockchain refer to terminal devices of contract participants. For example, the node of the first blockchain refers to the computer of contract party A and the node of the second blockchain refers to the computer of contract party B. The target information refers to related information of the contract to be executed, such as the name, number, execution parameter, and the like of the contract to be executed.
When the contract to be executed needs to be executed, the node of the first blockchain sends a contract executing request to the node of the second blockchain, and the node of the second blockchain receives the contract executing request.
Step S102, exchanging the first digital assets with the first preset number into second digital assets through a target gateway of the second blockchain, wherein the second digital assets are legal assets of the second blockchain.
In step S102, since the quorum asset of the first blockchain is the first digital asset, the second blockchain is to be executed. Therefore, when the node of the second blockchain receives the contract executing request, the node of the second blockchain needs to exchange the first digital assets with the first preset number into the second digital assets through the target gateway of the second blockchain, and then the second digital assets can be used to drive the execution of the contract to be executed.
And step S103, executing the contract to be executed according to the target information of the contract to be executed and the second digital asset, and obtaining an execution result of the contract to be executed.
In step S103, when the first digital assets with the first preset number are converted into the second digital assets, the node of the second blockchain executes the contract to be executed according to the target information of the contract to be executed and the second digital assets, so as to obtain an execution result of the contract to be executed.
In some possible implementations, the target information of the contract to be executed includes a target identifier of the contract to be executed and an execution parameter of the contract to be executed; correspondingly, executing the to-be-executed contract on the second blockchain according to the target information of the to-be-executed contract and the second digital asset to obtain an execution result of the to-be-executed contract, wherein the method comprises the following steps: searching a storage address corresponding to a target identifier of the contract to be executed in a second blockchain; sending the storage address, the execution parameters of the to-be-executed contract and the second digital asset to the virtual machine of the second blockchain to instruct the virtual machine of the second blockchain to search the contract state of the to-be-executed contract according to the storage address, and executing the to-be-executed contract according to the execution parameters of the to-be-executed contract, the contract state and the second digital asset to obtain an execution result of the to-be-executed contract; and receiving an execution result sent by the virtual machine of the second block chain.
In this implementation, the target information of the contract to be executed includes a target identifier of the contract to be executed and an execution parameter of the contract to be executed. After exchanging the first digital assets with the first preset number into the second digital assets, the nodes of the second blockchain search the storage addresses corresponding to the target identifiers of the contracts to be executed in the second blockchain. The node of the second blockchain then sends the storage address, the execution parameters of the contract to be executed, and the second digital asset to the virtual machine of the second blockchain. And searching the contract state of the contract to be executed by the virtual machine of the second blockchain according to the storage address, executing the contract to be executed according to the execution parameters, the contract state and the second digital asset of the contract to be executed to obtain an execution result of the contract to be executed, and sending the execution result to a node of the second blockchain. The node of the second blockchain thereby receives the execution result.
In some embodiments, the execution result includes a new contract state; after receiving the execution result sent by the virtual machine of the second blockchain, the method further comprises: the storage address of the new contract state in the execution result is stored in association with the target identification in the second blockchain.
In this embodiment, the execution result includes a new contract state after the contract to be executed is executed. After the virtual machine of the second blockchain obtains the execution result of the to-be-executed contract, storing a new contract state in the execution result, and sending the storage address of the new contract and the execution result to the node of the second blockchain. After the node of the second blockchain receives the request, the storage address of the new contract state in the execution result and the target identifier are stored in the second blockchain in a correlated mode. It should be appreciated that the execution contract request may also be stored in the second blockchain.
In other embodiments, prior to receiving the execution contract request sent by the node of the first blockchain, the method includes: receiving a deployment contract request, wherein the deployment contract request comprises byte codes of contracts to be executed and a second preset number of second digital assets; the byte code of the contract to be executed is deployed on a second blockchain and a second predetermined number of second digital assets are paid for.
In this embodiment, the deployment contract request includes the byte code of the contract to be executed and a second preset number of second digital assets. The node of the second blockchain first receives a deployment contract request. The byte code of the contract to be executed is then deployed on a second blockchain and a second predetermined number of second digital assets are paid for. It should be noted that, in order to facilitate maintenance of the contracts to be executed on the second blockchain, the synchronization method used by the nodes of the second blockchain in the process of deploying the bytecodes of the contracts to be executed on the second blockchain adopts a method of sequential synchronization and full synchronization, that is, adopts a method of sequential synchronization and full synchronization to synchronize the bytecodes of the contracts to be executed on the nodes of the second blockchain to other nodes of the second blockchain.
In some possible implementations, the method further includes: a target identification of the contract to be executed is generated. Accordingly, deploying the byte code of the contract to be executed on the second blockchain and paying for the second digital asset, including: sending the byte code of the contract to be executed and the second digital asset to the virtual machine of the second blockchain to instruct the virtual machine of the second blockchain to operate the byte code of the contract to be executed to obtain a contract state, and storing the contract state to obtain a storage address of the contract state; a storage address of the contract state is received and stored in a second blockchain in association with the target identification.
In this implementation, the virtual machine of the second blockchain runs the bytecode of the contract to be executed, and obtains the contract state. The contract state includes the participant variable of the contract to be executed, the function entry address table, the global variable table, the static variable table and the like. Then, the virtual machine of the second blockchain stores the contract state to obtain a storage address of the contract state, and sends the storage address of the contract state to the node of the second blockchain. After receiving the storage address of the contract state, the node of the second blockchain stores the storage address of the contract state in association with the target identifier in the second blockchain.
A specific application scenario of the present application is described below.
The first blockchain is a bit coin blockchain, the second blockchain is a Rainbow blockchain, the third blockchain is an Ethernet, the blockchain in which user A is located is the first blockchain to be executed on the Ethernet. Conventionally, when the user a wants to drive execution of a contract to be executed, it is necessary to exchange Cheng Ruibo coins for bitcoin, exchange the rapo coin for ethernet coin, and finally use the ethernet coin for driving execution of the contract to be executed. At this point, the second blockchain is the central node and there are two asset exchanges. In the present application, the to-be-executed contract is about on the second blockchain, and when the user a wants to drive the execution of the to-be-executed contract, the to-be-executed contract request is sent through the node of the first blockchain. And then the node of the second blockchain exchanges Cheng Ruibo coins for the bitcoin, and finally, the contract to be executed can be executed according to the request for the contract to be executed and the Rate coin.
In summary, the present application provides an intelligent contract processing method, first, a contract executing request sent by a node of a first blockchain is received, the contract executing request includes target information of a contract to be executed and a first preset number of first digital assets, the first digital assets are legal assets of the first blockchain, and the contract to be executed is located on a second blockchain. And then exchanging the first preset number of first digital assets into second digital assets through a target gateway of the second blockchain, wherein the second digital assets are legal assets of the second blockchain. And finally, executing the contract to be executed according to the target information of the contract to be executed and the second digital asset, and obtaining an execution result of the contract to be executed. Because the target gateway and the contracts to be executed are both on the second blockchain, only one time of asset exchange is needed, and no second time of asset exchange exists, the time for executing the contracts is reduced, and the transaction efficiency is improved. And at this time, the second blockchain is used as the blockchain where the intelligent contract is located and is not an intermediate node, so that the problem of centralization is solved.
In addition, the current contracts to be executed are all deployed on the third blockchain, and when a plurality of contract executing requests are received, the contracts to be executed can only be executed sequentially, so that the execution time is long and the efficiency is low. In the application, each contract to be executed can be deployed on each second blockchain, so that each contract to be executed can be executed simultaneously, the execution time of the contract to be executed is further reduced, and the transaction efficiency is improved.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present application.
Example two
FIG. 2 illustrates an example of an intelligent contract processing apparatus that is applied to a node of a second blockchain, only portions relevant to embodiments of the present application being shown for ease of illustration. The apparatus 200 comprises:
the request receiving module 201 is configured to receive an execution contract request sent by a node of a first blockchain, where the execution contract request includes target information of a contract to be executed and a first preset number of first digital assets, where the first digital assets are legal assets of the first blockchain, and the contract to be executed is located on the second blockchain.
The asset exchange module 202 is configured to exchange a first preset number of first digital assets into second digital assets through a target gateway of a second blockchain, where the second digital assets are legal assets of the second blockchain.
And the contract executing module 203 is configured to execute the contract to be executed according to the target information of the contract to be executed and the second digital asset, and obtain an execution result of the contract to be executed.
Optionally, the target information of the contract to be executed includes a target identifier of the contract to be executed and an execution parameter of the contract to be executed.
Accordingly, the contract execution module 203 is specifically configured to execute:
searching a storage address corresponding to a target identifier of the contract to be executed in a second blockchain;
sending the storage address, the execution parameters of the to-be-executed contract and the second digital asset to the virtual machine of the second blockchain to instruct the virtual machine of the second blockchain to search the contract state of the to-be-executed contract according to the storage address, and executing the to-be-executed contract according to the execution parameters of the to-be-executed contract, the contract state and the second digital asset to obtain an execution result of the to-be-executed contract;
and receiving an execution result sent by the virtual machine of the second block chain.
Optionally, the execution result includes a new contract state.
Accordingly, the smart contract processing apparatus 200 further includes:
and the storage module is used for storing the storage address of the new contract state in the execution result and the target identifier in the second blockchain in a correlated way.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to a part of the method embodiment, and will not be described herein.
Example III
Fig. 3 is a schematic diagram of a terminal device according to a third embodiment of the present application. As shown in fig. 3, the terminal device 300 of this embodiment includes: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301. The steps of the various method embodiments described above are implemented when the processor 301 executes the computer program 303. Alternatively, the processor 301 may implement the functions of the modules/units in the above-described embodiments of the apparatus when executing the computer program 303.
Illustratively, the computer program 303 may be partitioned into one or more modules/units that are stored in the memory 302 and executed by the processor 301 to complete the present application. The one or more modules/units may be a series of instruction segments of a computer program capable of performing a specific function, which instruction segments are used to describe the execution of the computer program 303 in the terminal device 300. For example, the computer program 303 may be divided into a request receiving module, an asset exchange module, and a contract executing module, each of which specifically functions as follows:
receiving an execution contract request sent by a node of a first blockchain, wherein the execution contract request comprises target information of a contract to be executed and a first preset number of first digital assets, the first digital assets are legal assets of the first blockchain, and the contract to be executed is located on the second blockchain;
exchanging the first preset number of first digital assets into second digital assets through a target gateway of the second blockchain, wherein the second digital assets are legal assets of the second blockchain;
and executing the contract to be executed according to the target information of the contract to be executed and the second digital asset, and obtaining an execution result of the contract to be executed.
The terminal device may include, but is not limited to, a processor 301, a memory 302. It will be appreciated by those skilled in the art that fig. 3 is merely an example of a terminal device 300 and is not intended to limit the terminal device 300, and may include more or fewer components than shown, or may combine certain components, or different components, such as the terminal device described above may also include input and output devices, network access devices, buses, etc.
The processor 301 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware cards, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 302 may be an internal storage unit of the terminal device 300, for example, a hard disk or a memory of the terminal device 300. The memory 302 may be an external storage device of the terminal device 300, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided in the terminal device 300. Further, the memory 302 may also include both an internal storage unit and an external storage device of the terminal device 300. The memory 302 is used for storing the computer program and other programs and data required for the terminal device. The memory 302 described above may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other manners. For example, the apparatus/terminal device embodiments described above are merely illustrative, e.g., the division of the modules or units described above is merely a logical function division, and there may be additional divisions in actual implementation, e.g., multiple units or plug-ins may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules/units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the above-described method embodiments, or may be implemented by a computer program to instruct related hardware, where the above-described computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of the above-described method embodiments. The computer program comprises computer program code, and the computer program code can be in a source code form, an object code form, an executable file or some intermediate form and the like. The computer readable medium may include: any entity or device capable of carrying the computer program code described above, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium described above can be appropriately increased or decreased according to the requirements of the jurisdiction's legislation and the patent practice, for example, in some jurisdictions, the computer readable medium does not include electrical carrier signals and telecommunication signals according to the legislation and the patent practice.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (8)

1. An intelligent contract processing method, applied to a node of a second blockchain, comprising:
receiving an execution contract request sent by a node of a first blockchain, wherein the execution contract request comprises target information of a contract to be executed and a first preset number of first digital assets, the first digital assets are legal assets of the first blockchain, the contract to be executed is positioned on the second blockchain, and the target information of the contract to be executed comprises a target identification of the contract to be executed and execution parameters of the contract to be executed;
exchanging the first preset number of first digital assets into second digital assets through a target gateway of the second blockchain, wherein the second digital assets are legal assets of the second blockchain;
executing the contract to be executed according to the target information of the contract to be executed and the second digital asset, and obtaining an execution result of the contract to be executed;
before the executing contract request sent by the node receiving the first blockchain, the method comprises the following steps:
receiving a deployment contract request, wherein the deployment contract request comprises byte codes of the contracts to be executed and a second preset number of second digital assets;
generating a target identifier of a contract to be executed;
sending the byte code of the contract to be executed and the second digital asset to the virtual machine of the second blockchain to instruct the virtual machine of the second blockchain to operate the byte code of the contract to be executed to obtain a contract state, and storing the contract state to obtain a storage address of the contract state;
and receiving a storage address of the contract state, and storing the storage address of the contract state in association with the target identifier in the second blockchain.
2. The smart contract processing method of claim 1, wherein executing the contract to be executed on the second blockchain based on the target information of the contract to be executed and the second digital asset, to obtain an execution result of the contract to be executed, includes:
searching a storage address corresponding to the target identifier of the contract to be executed in the second blockchain;
sending the storage address, the execution parameters of the to-be-executed contract and the second digital asset to the virtual machine of the second blockchain to instruct the virtual machine of the second blockchain to search the contract state of the to-be-executed contract according to the storage address, and execute the to-be-executed contract according to the execution parameters of the to-be-executed contract, the contract state and the second digital asset to obtain an execution result of the to-be-executed contract;
and receiving the execution result sent by the virtual machine of the second blockchain.
3. The smart contract processing method of claim 2, wherein the execution result includes a new contract state;
after receiving the execution result sent by the virtual machine of the second blockchain, the method further includes:
and storing a storage address of the new contract state in the execution result in the second blockchain in association with the target identifier.
4. An intelligent contract processing apparatus, characterized by nodes applied to a second blockchain, comprising:
a request receiving module, configured to receive an execution contract request sent by a node of a first blockchain, where the execution contract request includes target information of a contract to be executed and a first preset number of first digital assets, where the first digital assets are legal assets of the first blockchain, the contract to be executed is located on the second blockchain, and the target information of the contract to be executed includes a target identifier of the contract to be executed and an execution parameter of the contract to be executed;
the asset exchange module is used for exchanging the first digital assets with the first preset number into second digital assets through a target gateway of a second blockchain, wherein the second digital assets are legal assets of the second blockchain;
the contract executing module is used for executing the contract to be executed according to the target information of the contract to be executed and the second digital asset, and obtaining an executing result of the contract to be executed;
the intelligent contract processing device is further used for receiving a deployment contract request before the request receiving module receives an execution contract request sent by a node of a first blockchain, wherein the deployment contract request comprises byte codes of the contracts to be executed and a second preset number of second digital assets; generating a target identifier of a contract to be executed; sending the byte code of the contract to be executed and the second digital asset to the virtual machine of the second blockchain to instruct the virtual machine of the second blockchain to operate the byte code of the contract to be executed to obtain a contract state, and storing the contract state to obtain a storage address of the contract state; and receiving a storage address of the contract state, and storing the storage address of the contract state in association with the target identifier in the second blockchain.
5. The intelligent contract processing apparatus as recited in claim 4, wherein said contract execution module is specifically configured to execute:
searching a storage address corresponding to the target identifier of the contract to be executed in the second blockchain;
sending the storage address, the execution parameters of the to-be-executed contract and the second digital asset to the virtual machine of the second blockchain to instruct the virtual machine of the second blockchain to search the contract state of the to-be-executed contract according to the storage address, and execute the to-be-executed contract according to the execution parameters of the to-be-executed contract, the contract state and the second digital asset to obtain an execution result of the to-be-executed contract;
and receiving the execution result sent by the virtual machine of the second blockchain.
6. The smart contract processing apparatus of claim 5, wherein the execution result includes a new contract state;
accordingly, the smart contract processing apparatus further includes:
and the storage module is used for storing the storage address of the new contract state in the execution result and the target identifier in the second blockchain in a correlated way.
7. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1-3 when executing the computer program.
8. A computer readable storage medium storing a computer program, which when executed by a processor performs the method according to any one of claims 1-3.
CN202110076962.5A 2021-01-20 2021-01-20 Intelligent contract processing method, processing device, terminal equipment and storage medium Active CN112819464B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110076962.5A CN112819464B (en) 2021-01-20 2021-01-20 Intelligent contract processing method, processing device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110076962.5A CN112819464B (en) 2021-01-20 2021-01-20 Intelligent contract processing method, processing device, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112819464A CN112819464A (en) 2021-05-18
CN112819464B true CN112819464B (en) 2023-11-21

Family

ID=75858804

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110076962.5A Active CN112819464B (en) 2021-01-20 2021-01-20 Intelligent contract processing method, processing device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112819464B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115617918B (en) * 2022-12-19 2023-03-07 深圳百纳维科技有限公司 Method, device and system for operating piece-wise intelligent contract and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106960388A (en) * 2017-03-01 2017-07-18 中钞信用卡产业发展有限公司北京智能卡技术研究院 The method and apparatus of the digital asset circulation of transregional piece of chain
CN108665249A (en) * 2018-05-18 2018-10-16 北京三六五八网络科技有限公司 Digital asset processing method and processing device
CN109146448A (en) * 2018-07-13 2019-01-04 杭州复杂美科技有限公司 Across chain assets transfer method, equipment and storage medium
US10298585B1 (en) * 2018-01-26 2019-05-21 Accenture Global Solutions Limited Blockchain interoperability
CN111213168A (en) * 2019-09-11 2020-05-29 阿里巴巴集团控股有限公司 System and method for digital asset transfer

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106960388A (en) * 2017-03-01 2017-07-18 中钞信用卡产业发展有限公司北京智能卡技术研究院 The method and apparatus of the digital asset circulation of transregional piece of chain
US10298585B1 (en) * 2018-01-26 2019-05-21 Accenture Global Solutions Limited Blockchain interoperability
CN108665249A (en) * 2018-05-18 2018-10-16 北京三六五八网络科技有限公司 Digital asset processing method and processing device
CN109146448A (en) * 2018-07-13 2019-01-04 杭州复杂美科技有限公司 Across chain assets transfer method, equipment and storage medium
CN111213168A (en) * 2019-09-11 2020-05-29 阿里巴巴集团控股有限公司 System and method for digital asset transfer

Also Published As

Publication number Publication date
CN112819464A (en) 2021-05-18

Similar Documents

Publication Publication Date Title
CN110288345B (en) Cross-link communication method, device, main chain node and storage medium
CN109064334B (en) Intelligent contract accounting method, computer device and readable storage medium
CN111901121B (en) Cross-blockchain authentication method and device and electronic equipment
CN109815657B (en) Identity authentication method and device based on alliance chain, computer readable storage medium and terminal equipment
CN111782275B (en) Transaction processing method and device based on blockchain and electronic equipment
TWI737977B (en) Block chain-based transaction processing method and device, and electronic equipment
EP3812992A1 (en) Block chain transaction method and apparatus
CN112163412B (en) Data verification method and device, electronic equipment and storage medium
CN111026367B (en) Micro-service arrangement method, device, terminal equipment and storage medium
CN111163130A (en) Network service system and data transmission method thereof
CN112819464B (en) Intelligent contract processing method, processing device, terminal equipment and storage medium
CN112632619A (en) Cross-link certificate storage method and device, terminal equipment and storage medium
CN112633885A (en) Multi-signature transaction implementation method and related device
CN111260364B (en) Block chain-based extensible quick payment method and system
CN116029825B (en) Block chain transaction method, device and system, electronic equipment and storage medium
CN111210345B (en) Signature method and device based on block chain network transaction and terminal equipment
CN110059081A (en) Data output method, device and the computer equipment shown based on data
CN109271564A (en) Declaration form querying method and equipment
CN115085909A (en) Random number generation method, device, computer equipment and medium
CN109800823B (en) Clustering method and device for POS terminals
CN112258188A (en) Processing method, device, equipment and system for block chain transaction
CN113781043A (en) Block chain-based currency transaction method and device and electronic equipment
CN113743915B (en) Block chain transfer transaction privacy protection method, block chain link point equipment and medium
CN115174589B (en) Selection method and device of blockchain virtual machine, electronic equipment and storage medium
CN111709735B (en) System and method for processing trusted transaction based on blockchain

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
GR01 Patent grant
GR01 Patent grant