[go: up one dir, main page]

CN111258714A - A blockchain smart contract execution method - Google Patents

A blockchain smart contract execution method Download PDF

Info

Publication number
CN111258714A
CN111258714A CN202010031773.1A CN202010031773A CN111258714A CN 111258714 A CN111258714 A CN 111258714A CN 202010031773 A CN202010031773 A CN 202010031773A CN 111258714 A CN111258714 A CN 111258714A
Authority
CN
China
Prior art keywords
contract
intelligent
intelligent contract
target function
service program
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.)
Granted
Application number
CN202010031773.1A
Other languages
Chinese (zh)
Other versions
CN111258714B (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.)
University of Electronic Science and Technology of China
Guangdong Electronic Information Engineering Research Institute of UESTC
Original Assignee
University of Electronic Science and Technology of China
Guangdong Electronic Information Engineering Research Institute of UESTC
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 University of Electronic Science and Technology of China, Guangdong Electronic Information Engineering Research Institute of UESTC filed Critical University of Electronic Science and Technology of China
Priority to CN202010031773.1A priority Critical patent/CN111258714B/en
Publication of CN111258714A publication Critical patent/CN111258714A/en
Application granted granted Critical
Publication of CN111258714B publication Critical patent/CN111258714B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明公开了一种区块链智能合约执行方法,在区块链节点中设置合约数据服务模块和合约装载模块,区块链节点自用户处接收智能合约的动态共享库以及智能合约部署交易,进行合法性校验后将智能合约动态共享库转发给合约装载模块进行装载,创建并启动合约Docker容器,然后启动合约服务程序,区块链节点自用户处到接收到智能合约请求转发至合约服务程序进行执行。采用本发明可以快速完成智能合约的加载运行,提升区块链智能合约调用的便捷性和高效性。

Figure 202010031773

The invention discloses a blockchain smart contract execution method. A contract data service module and a contract loading module are set in a blockchain node, and the blockchain node receives a dynamic shared library of smart contracts and smart contract deployment transactions from users. After the legality check, the smart contract dynamic shared library is forwarded to the contract loading module for loading, the contract Docker container is created and started, and then the contract service program is started. The blockchain node receives the smart contract request from the user and forwards it to the contract service program is executed. By adopting the present invention, the loading and running of the smart contract can be quickly completed, and the convenience and efficiency of the blockchain smart contract invocation can be improved.

Figure 202010031773

Description

一种区块链智能合约执行方法A blockchain smart contract execution method

技术领域technical field

本发明属于区块链技术领域,更为具体地讲,涉及一种区块链智能合约执行方法。The invention belongs to the technical field of blockchain, and more specifically, relates to a method for executing a blockchain smart contract.

背景技术Background technique

区块链技术作为一种全新的分布式基础架构与计算范式,涵盖了P2P网络、加密算法、智能合约、共识算法等多种技术。基于这种集成式的技术堆叠,区块链实现了一种防篡改、可追溯、去中心化的系统,有效解决了传统模式中存在的中央权威、可靠性差、安全性低等问题。As a new distributed infrastructure and computing paradigm, blockchain technology covers P2P networks, encryption algorithms, smart contracts, consensus algorithms and other technologies. Based on this integrated technology stack, the blockchain implements a tamper-proof, traceable, and decentralized system, which effectively solves the problems of central authority, poor reliability, and low security in the traditional model.

智能合约(Smart contract)是一种旨在以信息化方式传播、验证或执行合同的计算机协议。从本质上讲,区块链中的智能合约是一段由各个参与方共同编写、确认之后部署在区块链上并以沙箱形式运行的代码。但是目前智能合约执行大多存在设计复杂、功能扩展困难等问题。A smart contract is a computer protocol designed to disseminate, verify or execute contracts in an informative manner. Essentially, a smart contract in a blockchain is a piece of code that is jointly written by various parties, confirmed and then deployed on the blockchain to run in a sandbox. However, most of the current smart contract execution has problems such as complex design and difficulty in function expansion.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于克服现有技术的不足,提供一种区块链智能合约执行方法,快速完成智能合约的加载运行,提升区块链智能合约调用的便捷性和高效性。The purpose of the present invention is to overcome the deficiencies of the prior art, provide a blockchain smart contract execution method, quickly complete the loading and running of the smart contract, and improve the convenience and efficiency of the blockchain smart contract invocation.

为实现上述发明目的,本发明区块链智能合约执行方法包括以下步骤:In order to achieve the above purpose of the invention, the blockchain smart contract execution method of the present invention includes the following steps:

S1:在区块链节点中设置合约数据服务模块和合约装载模块,其中合约数据服务模块采用基于网络套接字UDS的远程过程调用RPC实现,用于为智能合约目标函数的执行提供所需的业务数据,在区块链节点启动时以UDS的形式启动;合约装载模块用于创建并启动合约Docker容器;S1: Set up a contract data service module and a contract loading module in the blockchain node. The contract data service module is implemented by remote procedure call RPC based on network socket UDS, which is used to provide the required execution of the smart contract target function. Business data is started in the form of UDS when the blockchain node is started; the contract loading module is used to create and start the contract Docker container;

S2:区块链节点自用户处接收智能合约的动态共享库以及智能合约部署交易,该动态共享库中的文件由智能合约源代码编译得到;区块链节点对接收到的智能合约部署交易进行合法性校验,校验通过后将智能合约动态共享库转发给合约装载模块;S2: The blockchain node receives the dynamic shared library of the smart contract and the smart contract deployment transaction from the user, and the files in the dynamic shared library are compiled from the smart contract source code; the blockchain node executes the received smart contract deployment transaction. Validity verification, after the verification is passed, the smart contract dynamic shared library is forwarded to the contract loading module;

S3:合约装载模块利用接收到的智能合约动态共享库和基础环境Docker镜像创建合约Docker镜像,随后对该合约和区块链节点进行目录映射,得到目录映射关系,再利用所述合约Docker镜像和目录映射关系来创建并启动合约Docker容器;S3: The contract loading module uses the received smart contract dynamic shared library and the basic environment Docker image to create a contract Docker image, and then performs directory mapping on the contract and blockchain nodes to obtain the directory mapping relationship, and then uses the contract Docker image and Directory mapping relationship to create and start the contract Docker container;

S4:Docker容器内的合约服务程序启动,在启动过程中对合约动态共享库进行解析进而创建智能合约实例,并创建与合约数据服务模块通信的客户端;S4: The contract service program in the Docker container is started, and the contract dynamic shared library is parsed during the startup process to create a smart contract instance, and create a client that communicates with the contract data service module;

S5:区块链节点自用户处到接收到智能合约请求,智能合约请求包括合约地址、目标函数名及其执行参数;区块链节点对收到的智能合约调用请求进行合法性校验,校验通过后根据合约地址将该智能合约调用请求转发至对应的合约服务程序;S5: The blockchain node receives the smart contract request from the user, and the smart contract request includes the contract address, target function name and its execution parameters; After the verification is passed, the smart contract call request is forwarded to the corresponding contract service program according to the contract address;

S6:Docker容器内的合约服务程序首先解析出该智能合约调用请求中的目标函数名及其执行参数,并创建智能合约编程接口对应的实例对象;然后根据合约实例和目标函数名,利用反射机制获取目标函数的句柄;最后将目标函数执行参数和编程接口实例对象封装成目标函数的请求参数,通过获取到的目标函数句柄完成相应的处理逻辑,在整个处理过程合约服务程序利用编程接口的实例对象向合约数据服务模块获取相应的业务数据。S6: The contract service program in the Docker container first parses out the target function name and its execution parameters in the smart contract call request, and creates an instance object corresponding to the smart contract programming interface; then uses the reflection mechanism according to the contract instance and target function name Obtain the handle of the target function; finally, encapsulate the target function execution parameters and the programming interface instance object into the request parameters of the target function, and complete the corresponding processing logic through the obtained target function handle, and the contract service program uses the programming interface instance throughout the processing process. The object obtains the corresponding business data from the contract data service module.

本发明区块链智能合约执行方法,在区块链节点中设置合约数据服务模块和合约装载模块,区块链节点自用户处接收智能合约的动态共享库以及智能合约部署交易,进行合法性校验后将智能合约动态共享库转发给合约装载模块进行装载,创建并启动合约Docker容器,然后启动合约服务程序,区块链节点自用户处到接收到智能合约请求转发至合约服务程序进行执行。In the blockchain smart contract execution method of the invention, a contract data service module and a contract loading module are set in the blockchain node, and the blockchain node receives the dynamic shared library of the smart contract and the smart contract deployment transaction from the user, and performs legality verification. After verification, the smart contract dynamic shared library is forwarded to the contract loading module for loading, the contract Docker container is created and started, and then the contract service program is started. The blockchain node receives the smart contract request from the user and forwards it to the contract service program for execution.

本发明中智能合约源码被编译成动态共享库文件的形式,具有代码文件简洁、便于快速加载的特点,采用Docker容器的方式运行智能合约,并以UDS服务的方式将合约数据服务模块、合约装载模块以及合约服务程序进行整合,具有设计简捷轻便的特点,同时还可以实现智能合约之间的相互调用,使得各个智能合约不在相互独立,便于业务功能的扩展。In the present invention, the source code of the smart contract is compiled into the form of a dynamic shared library file, which has the characteristics of concise code file and easy to load quickly. The smart contract is run in the way of Docker container, and the contract data service module and contract are loaded in the way of UDS service. The integration of modules and contract service programs has the characteristics of simple and lightweight design. At the same time, it can also realize mutual calls between smart contracts, so that each smart contract is not independent of each other, which is convenient for the expansion of business functions.

附图说明Description of drawings

图1是本发明区块链智能合约执行方法的具体实施方式流程图。FIG. 1 is a flow chart of a specific implementation of the blockchain smart contract execution method of the present invention.

具体实施方式Detailed ways

下面结合附图对本发明的具体实施方式进行描述,以便本领域的技术人员更好地理解本发明。需要特别提醒注意的是,在以下的描述中,当已知功能和设计的详细描述也许会淡化本发明的主要内容时,这些描述在这里将被忽略。The specific embodiments of the present invention are described below with reference to the accompanying drawings, so that those skilled in the art can better understand the present invention. It should be noted that, in the following description, when the detailed description of known functions and designs may dilute the main content of the present invention, these descriptions will be omitted here.

实施例Example

图1是本发明区块链智能合约执行方法的具体实施方式流程图。如图1所示,本发明区块链智能合约执行方法的具体步骤包括:FIG. 1 is a flow chart of a specific implementation of the blockchain smart contract execution method of the present invention. As shown in Figure 1, the specific steps of the blockchain smart contract execution method of the present invention include:

S101:区块链节点设置:S101: Blockchain Node Settings:

在区块链节点中设置合约数据服务模块和合约装载模块,其中合约数据服务模块采用基于网络套接字UDS(Unix Domain Socket)的远程过程调用RPC实现,用于为智能合约目标函数的执行提供所需的业务数据,在区块链节点启动时以UDS的形式启动;合约装载模块用于创建并启动合约Docker容器。A contract data service module and a contract loading module are set up in the blockchain node. The contract data service module is implemented by remote procedure call RPC based on network socket UDS (Unix Domain Socket), which is used to provide the execution of smart contract target functions. The required business data is started in the form of UDS when the blockchain node starts; the contract loading module is used to create and start the contract Docker container.

S102:智能合约部署:S102: Smart Contract Deployment:

区块链节点自用户处接收智能合约的动态共享库以及智能合约部署交易,该动态共享库中的文件由智能合约源代码编译得到;区块链节点对接收到的智能合约部署交易进行合法性校验,校验通过后将智能合约动态共享库转发给合约装载模块。The blockchain node receives the dynamic shared library of the smart contract and the smart contract deployment transaction from the user, and the files in the dynamic shared library are compiled from the source code of the smart contract; the blockchain node checks the validity of the received smart contract deployment transaction. After verification, the smart contract dynamic shared library is forwarded to the contract loading module after the verification is passed.

S103:合约装载:S103: Contract loading:

合约装载模块利用接收到的智能合约动态共享库和基础环境Docker镜像创建合约Docker镜像,随后对该合约和区块链节点进行目录映射,得到目录映射关系,再利用所述合约Docker镜像和目录映射关系来创建并启动合约Docker容器。基础环境Docker镜像中仅包含Ubuntu操作系统和合约服务程序。The contract loading module uses the received smart contract dynamic shared library and the basic environment Docker image to create a contract Docker image, and then performs directory mapping on the contract and blockchain nodes to obtain the directory mapping relationship, and then uses the contract Docker image and directory mapping. relationship to create and start a contract Docker container. The basic environment Docker image only contains the Ubuntu operating system and the contract service program.

其中,目录映射的具体过程包括:The specific process of directory mapping includes:

1)将合约数据服务模块启动时创建的UDS文件与Docker容器中的文件进行关联;1) Associate the UDS file created when the contract data service module starts with the file in the Docker container;

2)将合约服务程序启动时创建的UDS文件所在目录与区块链节点中该智能合约的目录进行关联;2) Associate the directory of the UDS file created when the contract service program is started with the directory of the smart contract in the blockchain node;

3)将区块链中所有合约的目录与合约Docker容器中的新建合约目录进行关联。3) Associate the directories of all contracts in the blockchain with the newly created contract directory in the contract Docker container.

S104:合约服务程序启动:S104: The contract service program starts:

Docker容器内的合约服务程序启动(合约服务程序在合约Docker容器启动后会自动以基于UDS的RPC服务形式启动),在启动过程中对合约动态共享库进行解析进而创建智能合约实例,并创建合约数据服务模块通信的客户端。其中,智能合约实例是由合约服务程序在加载智能合约动态共享库时利用反射机制所创建的,与合约数据服务模块通信的客户端是由合约服务程序利用合约Docker容器中合约数据服务的UDS文件所创建的。The contract service program in the Docker container is started (the contract service program will automatically start in the form of a UDS-based RPC service after the contract Docker container is started), and the contract dynamic shared library is parsed during the startup process to create a smart contract instance and create a contract Client for data service module communication. Among them, the smart contract instance is created by the contract service program using the reflection mechanism when loading the smart contract dynamic shared library, and the client that communicates with the contract data service module is the UDS file of the contract data service in the contract Docker container by the contract service program. created.

S105:智能合约请求处理:S105: Smart contract request processing:

区块链节点自用户处到接收到智能合约请求,智能合约请求包括合约地址、目标函数名及其执行参数;区块链节点对收到的智能合约调用请求进行合法性校验,校验通过后根据合约地址将该智能合约调用请求转发至对应的合约服务程序。The blockchain node receives the smart contract request from the user, and the smart contract request includes the contract address, target function name and its execution parameters; the blockchain node checks the validity of the received smart contract call request, and the verification passes Then forward the smart contract call request to the corresponding contract service program according to the contract address.

S106:智能合约执行:S106: Smart contract execution:

Docker容器内的合约服务程序首先解析出该智能合约调用请求中的目标函数名及其执行参数,并创建智能合约编程接口对应的实例对象;然后根据合约实例和目标函数名,利用反射机制获取目标函数的句柄;最后将目标函数执行参数和编程接口实例对象封装成目标函数的请求参数,通过获取到的目标函数句柄完成相应的处理逻辑,在整个处理过程合约服务程序利用编程接口的实例对象通过与合约数据服务模块通信的客户端获取相应的业务数据。The contract service program in the Docker container first parses out the target function name and its execution parameters in the smart contract call request, and creates an instance object corresponding to the smart contract programming interface; then uses the reflection mechanism to obtain the target according to the contract instance and target function name. The handle of the function; finally, the target function execution parameters and the programming interface instance object are encapsulated into the request parameters of the target function, and the corresponding processing logic is completed through the obtained target function handle. The client that communicates with the contract data service module obtains the corresponding business data.

为了实现智能合约之间的相互调用,合约服务程序可以利用合约Docker容器中所有智能合约的UDS文件与其他智能合约的合约Docker容器中的合约服务程序建立通信连接,并向其发送合约调用请求,从而实现智能合约之间的调用In order to realize mutual calls between smart contracts, the contract service program can use the UDS files of all smart contracts in the contract Docker container to establish a communication connection with the contract service program in the contract Docker container of other smart contracts, and send a contract call request to it. So as to realize the call between smart contracts

为了更好地说明本发明的技术方案,以支付领域中的转账应用为你对本发明进行说明,其具体过程如下:In order to better illustrate the technical solution of the present invention, the present invention will be explained with the transfer application in the payment field. The specific process is as follows:

区块链节点在启动时以UDS的形式启动合约数据服务模块。The blockchain node starts the contract data service module in the form of UDS at startup.

用户根据合约服务程序预定的编程接口编写转账合约代码,该合约代码中的Transfer函数提供具体的转账操作。用户将转账合约编译成动态共享库,并将其打包后发往区块链节点请求合约部署。区块链节点首先验证该部署请求的合法性,验证通过后,由合约装载模块利用转账合约的动态共享库和基础环境Docker镜像创建转账合约的Docker镜像,随后利用该合约Docker镜像和设置的目录挂载关系创建并启动转账合约的Docker容器。The user writes the transfer contract code according to the programming interface predetermined by the contract service program, and the Transfer function in the contract code provides specific transfer operations. The user compiles the transfer contract into a dynamic shared library, packages it, and sends it to the blockchain node to request contract deployment. The blockchain node first verifies the legitimacy of the deployment request. After the verification is passed, the contract loading module uses the dynamic shared library of the transfer contract and the basic environment Docker image to create a Docker image of the transfer contract, and then uses the contract Docker image and the set directory. The mount relationship creates and starts the Docker container of the transfer contract.

转账合约Docker容器内的合约服务程序启动,对转账合约的动态共享库进行解析进而创建转账合约实例对象,随后创建与合约数据服务模块通信的客户端,最后以UDS的形式完成整个服务的启动。The contract service program in the Docker container of the transfer contract starts, parses the dynamic shared library of the transfer contract to create the transfer contract instance object, then creates a client that communicates with the contract data service module, and finally completes the startup of the entire service in the form of UDS.

用户向区块链节点发送合约调用请求,请求中的合约地址为转账合约的合约地址,目标函数名为Transfer,执行参数为用户A向用户B转账10元。区块链节点对该调用请求进行合法性校验,校验通过后将该请求转发给合约服务程序。The user sends a contract call request to the blockchain node. The contract address in the request is the contract address of the transfer contract, the target function is named Transfer, and the execution parameter is that user A transfers 10 yuan to user B. The blockchain node checks the validity of the call request, and after the verification passes, the request is forwarded to the contract service program.

合约服务程序首先从该合约调用请求中获取出目标函数名Transfer及其执行参数用户A向用户B转账10元,随后合约服务程序会创建智能合约编程接口对应的实例对象,接着利用反射机制从转账合约实例对象中获取名为Transfer的函数句柄,随后将目标函数的执行参数用户A向用户B转账10元以及编程接口的实例对象封装成目标函数的请求参数,最后利用该参数和Transfer的函数句柄来执行真正的转账操作逻辑,在执行转账逻辑时,会利用编程接口的实例对象通过与合约数据服务模块通信的客户端来请求相应的业务数据来完成账户余额的更改。The contract service program first obtains the target function name Transfer and its execution parameters from the contract call request. User A transfers 10 yuan to user B, and then the contract service program creates an instance object corresponding to the smart contract programming interface, and then uses the reflection mechanism to transfer money from the transfer. Obtain a function handle named Transfer from the contract instance object, and then encapsulate the execution parameter of the target function, user A to transfer 10 yuan to user B, and the instance object of the programming interface into the request parameter of the target function, and finally use this parameter and the function handle of Transfer To execute the real transfer operation logic, when executing the transfer logic, the instance object of the programming interface will be used to request the corresponding business data through the client that communicates with the contract data service module to complete the change of the account balance.

尽管上面对本发明说明性的具体实施方式进行了描述,以便于本技术领域的技术人员理解本发明,但应该清楚,本发明不限于具体实施方式的范围,对本技术领域的普通技术人员来讲,只要各种变化在所附的权利要求限定和确定的本发明的精神和范围内,这些变化是显而易见的,一切利用本发明构思的发明创造均在保护之列。Although the illustrative specific embodiments of the present invention have been described above to facilitate the understanding of the present invention by those skilled in the art, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, As long as various changes are within the spirit and scope of the present invention as defined and determined by the appended claims, these changes are obvious, and all inventions and creations utilizing the inventive concept are included in the protection list.

Claims (4)

1. A block chain intelligent contract execution method is characterized by comprising the following steps:
s1: setting a contract data service module and a contract loading module in a block link point, wherein the contract data service module is realized by Remote Procedure Call (RPC) based on a network socket Universal Description System (UDS) and is used for providing required service data for the execution of an intelligent contract target function, and the contract data service module is started in the form of the UDS when the block link point is started; the contract loading module is used for creating and starting a contract Docker container;
s2: the block chain link point receives a dynamic shared library of the intelligent contract and an intelligent contract deployment transaction from a user, and a file in the dynamic shared library is compiled by an intelligent contract source code; the block link points carry out validity check on the received intelligent contract deployment transaction, and the intelligent contract dynamic shared library is forwarded to the contract loading module after the check is passed;
s3: the contract loading module creates a contract Docker mirror image by using the received intelligent contract dynamic shared library and the basic environment Docker mirror image, then performs directory mapping on the contract and the block link point to obtain a directory mapping relation, and then creates and starts a contract Docker container by using the contract Docker mirror image and the directory mapping relation;
s4: starting a contract service program in the Docker container, analyzing a contract dynamic shared library in the starting process to create an intelligent contract instance, and creating a client communicated with a contract data service module;
s5: the block chain node receives an intelligent contract request from a user, wherein the intelligent contract request comprises a contract address, a target function name and an execution parameter thereof; the block chain link points carry out validity check on the received intelligent contract calling request, and the intelligent contract calling request is forwarded to a corresponding contract loading service program according to the contract address after the check is passed;
s6: firstly, analyzing a target function name and an execution parameter thereof in the intelligent contract calling request by a contract service program in the Docker container, and creating an instance object corresponding to an intelligent contract programming interface; then, acquiring a handle of the target function by using a reflection mechanism according to the contract instance and the target function name; finally, the target function execution parameter and the programming interface instance object are packaged into the request parameter of the target function, the corresponding processing logic is completed through the obtained target function handle, and the contract service program utilizes the instance object of the programming interface to obtain the corresponding service data from the contract data service module in the whole processing process.
2. The method of claim 1, wherein the step of mapping the directory in step S3 comprises:
1) associating a UDS file created when a contract data service module is started with a file in a Docker container;
2) associating a directory where a UDS file is located and created when a contract service program is started with a directory of the intelligent contract in a block chain node;
3) the directories of all the contracts in the blockchain are associated with the newly-created contract directory in the contract Docker container.
3. A method for block chain intelligent contract execution according to claim 1, wherein in step S4, the intelligent contract instance is created by a contract service program using a reflection mechanism when loading the intelligent contract dynamic shared library, and the client communicating with the contract data service module is created by the contract service program using a UDS file of the contract data service in the contract Docker container.
4. A block chain intelligent contract execution method according to claim 1, wherein the contract service program establishes a communication connection with the contract service programs in the contract Docker containers of other intelligent contracts by using UDS files of all intelligent contracts in the contract Docker containers, and sends contract call requests thereto.
CN202010031773.1A 2020-01-13 2020-01-13 Intelligent contract execution method for block chain Expired - Fee Related CN111258714B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010031773.1A CN111258714B (en) 2020-01-13 2020-01-13 Intelligent contract execution method for block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010031773.1A CN111258714B (en) 2020-01-13 2020-01-13 Intelligent contract execution method for block chain

Publications (2)

Publication Number Publication Date
CN111258714A true CN111258714A (en) 2020-06-09
CN111258714B CN111258714B (en) 2023-03-10

Family

ID=70948746

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010031773.1A Expired - Fee Related CN111258714B (en) 2020-01-13 2020-01-13 Intelligent contract execution method for block chain

Country Status (1)

Country Link
CN (1) CN111258714B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035090A (en) * 2020-07-13 2020-12-04 翼帆数字科技(苏州)有限公司 Intelligent contract management system and method based on containerization technology
CN113312429A (en) * 2021-06-22 2021-08-27 工银科技有限公司 Intelligent contract management system, method, medium, and article in a blockchain
CN113360251A (en) * 2021-08-11 2021-09-07 北京微芯感知科技有限公司 Intelligent contract execution and cross-contract calling method, device and storage medium
CN115879936A (en) * 2022-09-30 2023-03-31 北京同邦卓益科技有限公司 Intelligent contract safe operation method and device of block chain and related equipment
CN116975850A (en) * 2023-09-25 2023-10-31 腾讯科技(深圳)有限公司 Contract operation method, contract operation device, electronic equipment and storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169765A (en) * 2017-05-11 2017-09-15 电子科技大学 A kind of method adjusted into Mobile state of being known together based on business degree of belief to block chain
CN109032706A (en) * 2018-07-16 2018-12-18 百度在线网络技术(北京)有限公司 Intelligent contract executes method, apparatus, equipment and storage medium
CN109240900A (en) * 2018-08-16 2019-01-18 北京京东尚科信息技术有限公司 Block chain network service platform and its intelligent contract detection method, storage medium
CN109299587A (en) * 2018-09-11 2019-02-01 平安科技(深圳)有限公司 Algorithm protection method, device, equipment and storage medium based on go language
WO2019072310A2 (en) * 2018-12-29 2019-04-18 Alibaba Group Holding Limited System and method for implementing native contract on blockchain
CN109766722A (en) * 2019-01-22 2019-05-17 苏州同济区块链研究院有限公司 The method and its system of intelligent contract are constructed in a kind of block chain
WO2019133308A1 (en) * 2017-12-29 2019-07-04 Ebay Inc. Secure management of content distribution data blocks on a blockchain
US20190305932A1 (en) * 2018-03-30 2019-10-03 Townsend Security, Inc. Distributed key management and encryption for blockchains
CN110392052A (en) * 2019-07-22 2019-10-29 中国工商银行股份有限公司 A kind of block chain intelligence contract processing system and method
CN110390213A (en) * 2019-07-31 2019-10-29 中国工商银行股份有限公司 The security deployment method and system of intelligent contract under block chain network environment
CN110399184A (en) * 2019-07-31 2019-11-01 中国工商银行股份有限公司 The execution method and device of intelligent contract in block chain
CN110572398A (en) * 2019-09-10 2019-12-13 腾讯科技(深圳)有限公司 block chain network control method, device, equipment and storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169765A (en) * 2017-05-11 2017-09-15 电子科技大学 A kind of method adjusted into Mobile state of being known together based on business degree of belief to block chain
WO2019133308A1 (en) * 2017-12-29 2019-07-04 Ebay Inc. Secure management of content distribution data blocks on a blockchain
US20190305932A1 (en) * 2018-03-30 2019-10-03 Townsend Security, Inc. Distributed key management and encryption for blockchains
CN109032706A (en) * 2018-07-16 2018-12-18 百度在线网络技术(北京)有限公司 Intelligent contract executes method, apparatus, equipment and storage medium
CN109240900A (en) * 2018-08-16 2019-01-18 北京京东尚科信息技术有限公司 Block chain network service platform and its intelligent contract detection method, storage medium
CN109299587A (en) * 2018-09-11 2019-02-01 平安科技(深圳)有限公司 Algorithm protection method, device, equipment and storage medium based on go language
CN110249307A (en) * 2018-12-29 2019-09-17 阿里巴巴集团控股有限公司 System and method for executing primary contract on block chain
WO2019072310A2 (en) * 2018-12-29 2019-04-18 Alibaba Group Holding Limited System and method for implementing native contract on blockchain
CN109766722A (en) * 2019-01-22 2019-05-17 苏州同济区块链研究院有限公司 The method and its system of intelligent contract are constructed in a kind of block chain
CN110392052A (en) * 2019-07-22 2019-10-29 中国工商银行股份有限公司 A kind of block chain intelligence contract processing system and method
CN110390213A (en) * 2019-07-31 2019-10-29 中国工商银行股份有限公司 The security deployment method and system of intelligent contract under block chain network environment
CN110399184A (en) * 2019-07-31 2019-11-01 中国工商银行股份有限公司 The execution method and device of intelligent contract in block chain
CN110572398A (en) * 2019-09-10 2019-12-13 腾讯科技(深圳)有限公司 block chain network control method, device, equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A. BRINCKMAN ET AL: ""A Comparative Evaluation of Blockchain Systems for Application Sharing Using Containers"", 《2017 IEEE 13TH INTERNATIONAL CONFERENCE ON E-SCIENCE (E-SCIENCE)》 *
朱岩等: ""基于安全多方计算的区块链智能合约执行系统"", 《密码学报》 *
陈虹: ""基于区块链技术的学分银行构建"", 《中国职业技术教育》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035090A (en) * 2020-07-13 2020-12-04 翼帆数字科技(苏州)有限公司 Intelligent contract management system and method based on containerization technology
CN112035090B (en) * 2020-07-13 2024-06-07 翼帆数字科技(苏州)有限公司 Intelligent contract intelligent management system and method based on containerization technology
CN113312429A (en) * 2021-06-22 2021-08-27 工银科技有限公司 Intelligent contract management system, method, medium, and article in a blockchain
CN113312429B (en) * 2021-06-22 2023-01-17 工银科技有限公司 Intelligent contract management system, method, medium, and article in a blockchain
CN113360251A (en) * 2021-08-11 2021-09-07 北京微芯感知科技有限公司 Intelligent contract execution and cross-contract calling method, device and storage medium
CN113360251B (en) * 2021-08-11 2021-12-21 北京微芯感知科技有限公司 Intelligent contract execution and cross-contract calling method, device and storage medium
CN115879936A (en) * 2022-09-30 2023-03-31 北京同邦卓益科技有限公司 Intelligent contract safe operation method and device of block chain and related equipment
CN116975850A (en) * 2023-09-25 2023-10-31 腾讯科技(深圳)有限公司 Contract operation method, contract operation device, electronic equipment and storage medium
CN116975850B (en) * 2023-09-25 2024-01-05 腾讯科技(深圳)有限公司 Contract operation method, contract operation device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111258714B (en) 2023-03-10

Similar Documents

Publication Publication Date Title
CN111258714B (en) Intelligent contract execution method for block chain
CN111163129B (en) A resource processing method and device based on a cross-chain network
CN110191063B (en) Service request processing method, device, equipment and storage medium
TWI767182B (en) H5-Based Access Components and Mobile Terminals
CN111861482B (en) Block chain account checking method and system
US11716264B2 (en) In situ triggered function as a service within a service mesh
WO2020173500A1 (en) Public chain-based sub-chain business system
CN108572986B (en) A method and node device for updating data
CN109995713A (en) Service processing method and relevant device in a kind of micro services frame
CN109815025B (en) Service model calling method, device and storage medium
CN108881111A (en) A kind of method and device for realizing multi-tenant system
CN112149079A (en) Planning review management platform and user access authorization method based on microservice architecture
CN112866421B (en) Intelligent contract operation method and device based on distributed cache and NSQ
CN112035090B (en) Intelligent contract intelligent management system and method based on containerization technology
CN107809332A (en) Compound interface configures and compound interface call method, device
CN102299849B (en) Service capability calling system and method
CN101930361B (en) Method and system for providing online data storage service
CN104598525B (en) A kind of replication runs, equipment and system
CN104852971A (en) Plug-in protocol device and data communication method based on plug-in protocol
US9047442B2 (en) Provisioning managed devices with states of arbitrary type
CN112966833A (en) Machine learning model platform based on Kubernetes cluster
CN115412557B (en) Block chain resource management method and device based on multi-chain cooperation
CN111898162A (en) Parallel task execution method and device, storage medium and electronic equipment
CN115756399B (en) A scenario-based assembleable middle-end business integration method and system
CN110851261A (en) Task processing method, system, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20230310