Search

CN-113850573-B - Intelligent contract execution method and device

CN113850573BCN 113850573 BCN113850573 BCN 113850573BCN-113850573-B

Abstract

The invention discloses an execution method and device of an intelligent contract, and relates to the technical field of digital currency. One embodiment of the method includes invoking an application layer contract to perform business logic processing in response to a smart contract execution request and constructing a funds lamination contract parameter required for funds lamination contract execution, and performing funds processing by invoking the funds lamination contract by the application lamination contract according to the business logic and the funds lamination contract parameter. The implementation mode can separate application logic processing and fund processing in a business scene, ensures that contract responsibility is clear, logic processing is simple, and realizes complex contracts by combining simple contracts through calling among intelligent contracts so as to be suitable for more business application scenes.

Inventors

  • Mu changchun
  • DI GANG
  • QIAN YOUCAI
  • Du jinzhao

Assignees

  • 中国人民银行数字货币研究所

Dates

Publication Date
20260508
Application Date
20210819

Claims (7)

  1. 1. A method of executing an intelligent contract, comprising: In response to the intelligent contract execution request, invoking an application layer contract to execute business logic processing and constructing fund layer contract parameters required by fund layer contract execution; according to the business logic and the fund layer contract parameters, invoking a fund layer contract through the application layer contract to execute fund processing; The application layer contracts and the fund layer contracts are stored and managed through a contract management library, wherein the contract management library comprises a first contract management library and a second contract management library, and the first contract management library is used for managing the fund layer contracts and checking and controlling the application layer contracts; during the execution of the intelligent contract, auditing in the process of the transaction is carried out according to the business data transmitted to the first contract management library; After the transaction is finished, performing post-traceability checking according to the data reserved in the first contract management library and the second contract management library; the first contract management library is subjected to deployment management by a central agency side, and the second contract management library is subjected to deployment management by an operation agency side; the application layer is uploaded and registered to the first contract management library after the second contract management library passes the examination and approval; and after the central agency checks the signature in the first contract management library, the fund layer contract is sent to each operation agency for unified deployment.
  2. 2. The method of performing according to claim 1, wherein the method further comprises: in the event that a fund layer contract involves a fund operation, the fund operation is completed by invoking an interface of the digital money system through the fund layer contract.
  3. 3. The method of claim 1, wherein the application lamination is set to a about-managed state when the application lamination is about to pass the first contract management library audit, such that the application lamination is about to no longer perform the signing operation and cannot be continued.
  4. 4. The execution method of claim 1, wherein the first contract management library is configured with a contract management interface to audit and manage the application layer contracts through the contract management interface.
  5. 5. An intelligent contract execution apparatus, comprising: an application contract execution module for calling an application layer contract to execute business logic processing in response to the intelligent contract execution request, and constructing fund layer contract parameters required by fund layer contract execution; The fund contract executing module is used for calling a fund layer contract to execute fund processing through the application layer contract according to the business logic and the fund layer contract parameters; The application layer contracts and the fund layer contracts are stored and managed through a contract management library, wherein the contract management library comprises a first contract management library and a second contract management library, and the first contract management library is used for managing the fund layer contracts and checking and controlling the application layer contracts; during the execution of the intelligent contract, auditing in the process of the transaction is carried out according to the business data transmitted to the first contract management library; After the transaction is finished, performing post-traceability checking according to the data reserved in the first contract management library and the second contract management library; the first contract management library is subjected to deployment management by a central agency side, and the second contract management library is subjected to deployment management by an operation agency side; the application layer is uploaded and registered to the first contract management library after the second contract management library passes the examination and approval; and after the central agency checks the signature in the first contract management library, the fund layer contract is sent to each operation agency for unified deployment.
  6. 6. An electronic device that executes a smart contract, comprising: One or more processors; Storage means for storing one or more programs, When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-4.
  7. 7. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-4.

Description

Intelligent contract execution method and device Technical Field The invention relates to the technical field of digital currency, in particular to an intelligent contract executing method and device. Background Contracts refer to agreement commitments that transaction participants have made to each other. A smart contract is a set of digitally specified commitments that includes an agreement on how the parties fulfill the commitments. An intelligent contract is generally considered to be a computer protocol that aims to propagate, verify, or execute contracts in an informative manner. With the popularization of digital currency, intelligent contracts are applied to more business scenes, and the processing logic of the intelligent contracts is more and more complicated and diversified. Then, how to uniformly manage and execute the intelligent contracts with complex and diverse processing logic is a technical problem to be solved in the present day. Disclosure of Invention In view of the above, the embodiment of the invention provides a method and a device for executing an intelligent contract, which can separate application logic processing from fund processing in a business scene, has definite contract responsibility and simple logic processing, and realizes complex contracts by combining simple contracts through calling among the intelligent contracts so as to be suitable for more business application scenes. To achieve the above object, according to one aspect of the embodiments of the present invention, there is provided a method of executing an intelligent contract. A method for executing intelligent contracts includes calling application layer contracts to execute business logic processing and constructing fund contract parameters required by fund layer contract execution in response to intelligent contract execution requests, and calling fund layer contracts to execute fund processing through the application layer contracts according to the business logic and the fund contract parameters. Optionally, the method further comprises invoking an interface of the digital money system through the fund layer contract to complete the fund operation in the event that the fund layer contract relates to the fund operation. Optionally, the application layer contract and the fund layer contract are stored and managed by a contract management library. Optionally, the contract management library comprises a first contract management library and a second contract management library, wherein the first contract management library is used for managing fund layer contracts and checking and controlling application layer contracts, and the second contract management library is used for managing application layer contracts. Optionally, the application layer is uploaded and registered to the first contract management library after passing the second contract management library, and the fund layer is uniformly deployed after passing the first contract management library. Optionally, when the application layer is about to pass the first contract management library audit, the application layer is set to be about to be in a control state, so that the application layer can not execute the signing operation any more and can not be executed continuously. Optionally, the first contract management library is configured with a contract management interface to audit and manage the application layer contracts through the contract management interface. According to another aspect of the embodiment of the present invention, there is provided an execution apparatus of an intelligent contract. An execution device of an intelligent contract comprises an application contract execution module and a fund contract execution module, wherein the application contract execution module is used for responding to an intelligent contract execution request, calling an application layer contract to execute business logic processing and constructing fund contract parameters required by fund laminated contract execution, and the fund contract execution module is used for calling the fund layer contract through the application layer contract to execute fund processing according to the business logic and the fund contract parameters. Optionally, the device further comprises a fund operation processing module, wherein the fund operation processing module is used for calling an interface of the digital currency system through the fund layer contract to complete the fund operation in the case that the fund layer contract relates to the fund operation. Optionally, the application layer contract and the fund layer contract are stored and managed by a contract management library. Optionally, the contract management library comprises a first contract management library and a second contract management library, wherein the first contract management library is used for managing fund layer contracts and checking and controlling application layer contracts, and the seco