WO2022134186A1 - Smart contract calling method and apparatus for blockchains, server, and storage medium - Google Patents

Smart contract calling method and apparatus for blockchains, server, and storage medium Download PDF

Info

Publication number
WO2022134186A1
WO2022134186A1 PCT/CN2020/142026 CN2020142026W WO2022134186A1 WO 2022134186 A1 WO2022134186 A1 WO 2022134186A1 CN 2020142026 W CN2020142026 W CN 2020142026W WO 2022134186 A1 WO2022134186 A1 WO 2022134186A1
Authority
WO
WIPO (PCT)
Prior art keywords
smart contract
contract
target
blockchain
information
Prior art date
Application number
PCT/CN2020/142026
Other languages
French (fr)
Chinese (zh)
Inventor
李伟
蔡亮
匡立中
张帅
钟蔚蔚
Original Assignee
杭州趣链科技有限公司
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 杭州趣链科技有限公司 filed Critical 杭州趣链科技有限公司
Publication of WO2022134186A1 publication Critical patent/WO2022134186A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • the present application relates to the field of blockchain technology, and in particular, to a method, device, server and storage medium for invoking a smart contract of a blockchain.
  • a middle-tier server is usually set up between the underlying blockchain platform and the client, which is responsible for data encoding/decoding, contract function encapsulation and The client's subscription information processing to the blockchain, etc.
  • the middle-tier server usually needs to customize the packaging for each smart contract in different blockchain platforms, and then provide the packaged interface to the Client call. In this way, once the middle-tier server is connected to many blockchain platforms or smart contracts, it will be very difficult to update and maintain the code of the middle-tier server.
  • the embodiments of the present application provide a blockchain smart contract calling method, device, server and storage medium, which can reduce the difficulty of updating and maintaining the code of the middle-tier server.
  • a first aspect of the embodiments of the present application provides a blockchain smart contract calling method, including:
  • the client receives a smart contract invocation request sent by the client, where the smart contract invocation request includes the contract identifier of the target smart contract and the chain identifier of the target blockchain where the target smart contract is located, wherein the target blockchain has been registered and deployed to the middle-tier server, and the target smart contract has been registered with the middle-tier server;
  • the embodiments of the present application pre-register and deploy different blockchains to the middle-tier server, assign corresponding chain identifiers to the blockchains, and register each smart contract to the middle-tier server to assign corresponding contract identifiers to the smart contracts.
  • the client calls the smart contract, it only needs to issue a smart contract call request with the chain ID and the contract ID.
  • Initiate the corresponding smart contract execution request to the corresponding blockchain obtain the corresponding smart contract execution result and return it to the client.
  • the middle-tier server does not need to customize and encapsulate each smart contract in different blockchain platforms, which can reduce the difficulty of updating and maintaining the code of the middle-tier server.
  • initiating a smart contract execution request to the target blockchain, and acquiring the execution result of the target smart contract may include:
  • the activated software development kit is invoked to initiate a smart contract execution request to the target blockchain according to the contract information, and obtain the execution result of the target smart contract.
  • the smart contract invocation request also includes attribute information of the target smart contract, the smart contract execution request is initiated to the target blockchain according to the contract information, and the execution result of the target smart contract is obtained.
  • attribute information of the target smart contract can include:
  • a smart contract execution request is initiated to the target blockchain through the contract information and the attribute information, and the execution result of the target smart contract is obtained.
  • the target blockchain is a blockchain of the Ethereum platform
  • the contract information includes a contract address and an interface description file of the target smart contract
  • the attribute information includes the target
  • the contract function name and function call parameters of the smart contract the smart contract execution request is initiated to the target blockchain through the contract information and the attribute information, and the execution result of the target smart contract is obtained, which may include:
  • the target blockchain is a blockchain of the fabric platform
  • the contract information includes a contract name of the target smart contract
  • the attribute information includes a contract function of the target smart contract name and function call parameters
  • the sending a smart contract execution request to the target blockchain through the contract information and the attribute information, and obtaining the execution result of the target smart contract may include:
  • a smart contract execution request is initiated to the target blockchain in combination with the contract name, the contract function name and the function call parameters, and the execution result of the target smart contract is obtained.
  • the target blockchain can be registered and deployed to the middle-tier server through the following steps:
  • the connectivity test passes, store the connection information and related files in a database, and assign a chain identifier to the target blockchain, so as to register and deploy the target blockchain to the middle layer server.
  • the target smart contract can be registered with the middle-tier server through the following steps:
  • the registration of the target smart contract is completed according to the contract information, and a contract identifier is allocated to the target smart contract.
  • a second aspect of the embodiments of the present application provides a blockchain smart contract invocation device, which is applied to a middle-tier server, and the device includes:
  • the contract invocation request receiving module is used to receive a smart contract invocation request sent by the client, where the smart contract invocation request includes the contract identifier of the target smart contract and the chain identifier of the target blockchain where the target smart contract is located, wherein, The target blockchain has been registered and deployed to the middle-tier server, and the target smart contract has been registered with the middle-tier server;
  • a contract information search module configured to search for the contract information of the target smart contract according to the contract identifier
  • a smart contract search module configured to initiate a smart contract execution request to the target blockchain based on the contract information and the chain identifier, and obtain the execution result of the target smart contract
  • the smart contract return module is used for returning the execution result of the target smart contract to the client.
  • a third aspect of the embodiments of the present application provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the computer program when the processor executes the computer program.
  • the steps of the method for invoking a smart contract of a blockchain provided by the first aspect of the embodiments of this application.
  • a fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the implementation of the first aspect of the embodiments of the present application is implemented The steps of the smart contract of the blockchain to call the method.
  • a fifth aspect of the embodiments of the present application provides a computer program product that, when the computer program product runs on a terminal device, enables the terminal device to execute the blockchain smart contract calling method described in the first aspect of the embodiments of the present application A step of.
  • FIG. 1 is a schematic structural diagram of a smart contract invocation system adopted by a blockchain smart contract invocation method provided by an embodiment of the present application;
  • FIG. 2 is a flowchart of an embodiment of a method for invoking a blockchain smart contract provided by an embodiment of the present application
  • FIG. 3 is a flowchart of an embodiment of another blockchain smart contract invocation method provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of the principle of a smart contract calling method for the Ethereum blockchain provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of the principle of a method for invoking a smart contract on a fabric block chain provided by an embodiment of the present application
  • FIG. 6 is a structural diagram of an embodiment of a blockchain smart contract invocation device provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a server provided by an embodiment of the present application.
  • Blockchain is a distributed shared ledger and database, which has the characteristics of decentralization, immutability, traceability, traceability, collective maintenance, openness and transparency.
  • a middle-tier server is usually set up to be responsible for data encoding and decoding, contract function encapsulation, and the business system to the blockchain in the communication process between the blockchain and the business system (client). Subscription information processing, etc.
  • the middle-tier server usually needs to customize the packaging for each smart contract in different blockchain platforms in advance.
  • the business requirements change for example, adding a new block chain or a smart contract
  • the code update process also needs to suspend the service, which will bring adverse effects to the normal operation of the business system.
  • the middle-tier server is connected to many blockchain platforms or smart contracts, it will be very difficult to update and maintain the code of the middle-tier server.
  • the embodiments of the present application provide a blockchain smart contract calling method, device, server, and storage medium, which can avoid customized packaging of each smart contract in different blockchain platforms, thereby reducing intermediate The difficulty of updating and maintaining the tier server code.
  • execution body of each method embodiment of the present application may be various types of terminal devices or servers, such as mobile phones, tablet computers, notebook computers, desktop computers, and wearable devices.
  • FIG. 1 is a schematic structural diagram of a smart contract invocation system adopted by a blockchain smart contract invocation method provided in an embodiment of the present application.
  • Figure 1 includes a business system, a middle-tier server and multiple different blockchain platforms.
  • the business system is the client, and the smart contract needs to be called from the blockchain platform through the middle-tier server; the middle-tier server is responsible for the blockchain and business
  • the data encoding and decoding, contract function encapsulation, and subscription information processing of the business system to the blockchain in the system (client) communication process are the execution subjects of each method embodiment proposed in this application; various blockchain platforms (For example, fabric or Ethereum, etc.) are connected with the middle-tier server to complete data interaction. It should be noted that this application does not limit the type and quantity of the connected blockchain platforms.
  • FIG. 2 shows a blockchain smart contract calling method provided by an embodiment of the present application, including:
  • 201 Receive a smart contract invocation request sent by a client, where the smart contract invocation request includes a contract identifier of a target smart contract and a chain identifier of a target blockchain where the target smart contract is located;
  • a client such as a business system needs to call a target smart contract, it can send a smart contract call request to the middle-tier server.
  • the smart contract call request includes the contract identifier of the target smart contract and the target area where the target smart contract is located.
  • the chain identity of the blockchain Specifically, the business system can call the contract invocation interface provided by the middle-tier server, and submit a contract invocation request containing specified information (such as chain ID, contract ID, contract name, and function call parameters) to the middle-tier server.
  • specified information such as chain ID, contract ID, contract name, and function call parameters
  • the target blockchain is pre-registered and deployed to the middle-tier server, and the target smart contract has been deployed to the target blockchain and registered to the middle-tier server.
  • the middle-tier server will assign a chain ID to the target blockchain to uniquely represent the target blockchain.
  • the middle-tier server will also assign a contract ID to the target smart contract to uniquely represent the target smart contract.
  • the middle-tier server can send the registered chain identifiers of different blockchains and the registered contract identifiers of different smart contracts to each client, so that the client can use it when calling the smart contract.
  • the target blockchain can be registered and deployed to the middle-tier server through the following steps:
  • connection information may include information such as blockchain IP address, blockchain interface, blockchain platform type and platform version, and related files may include SDK certificates and other blockchain-related files.
  • connection information and related files can be submitted to the middle-tier server through the corresponding interface, and the submitted connection information or related files will vary depending on the blockchain platform.
  • the middle-tier server After receiving the connection information and related files submitted by the target blockchain, the middle-tier server will initialize the SDK (software development kit) corresponding to the platform type of the target blockchain according to the information and files.
  • the initialization parameters can include Blockchain IP address, blockchain interface and SDK certificate, etc. For example, if the platform type of the target blockchain is fabric, the SDK corresponding to the fabric platform is initialized; if the platform type of the target blockchain is Ethereum, the SDK corresponding to the Ethereum platform is initialized, and so on.
  • the middle-tier server After the software development kit is initialized, the middle-tier server performs a connectivity call test to verify whether it can be connected and used normally. If the connectivity test passes, the middle-tier server will store the connection information and related files in the database, and assign a chain ID to the target blockchain, thus completing the operation of registering and deploying the target blockchain to the middle-tier server; If the connectivity test fails, it means that the target blockchain registration fails, and an error message can be returned to remind technicians to find the cause of the blockchain registration error.
  • the target smart contract can be registered with the middle-tier server through the following steps:
  • the registration process of the target smart contract needs to be performed. Specifically, the target smart contract is first deployed to the registered target blockchain, and the corresponding contract information is obtained. For the blockchain of the Ethereum platform, the contract address and the contract interface description file can be obtained as the contract information; For the blockchain of the fabric platform, the contract name can be obtained as contract information. After obtaining the contract information of the target smart contract, the middle-tier server will complete the registration of the target smart contract according to the contract information, and assign a contract ID to it. The chain identifies the chain ID association.
  • the middle-tier server After receiving the smart contract calling request, the middle-tier server searches for the contract information of the target smart contract according to the contract identifier in the request. Specifically, the contract information of the target smart contract can be stored in the database of the middle-tier server after the contract is registered. At this time, the middle-tier server can find the corresponding contract information from the database through the contract identifier.
  • the contract information here can be the contract address and interface description file corresponding to the contract identifier; for the fabric platform
  • the contract information here can be the contract name corresponding to the contract identifier.
  • the corresponding target blockchain can be determined through the chain identifier, and then the contract information is used to initiate a smart contract execution request to the target blockchain, thereby obtaining the execution result of the target smart contract.
  • step 203 reference may be made to the next embodiment of the present application.
  • the middle-tier server After obtaining the execution result of the target smart contract from the target blockchain, the middle-tier server will return the obtained execution result to the client, thereby completing a smart contract invocation process. In addition, if the invocation of the target smart contract fails, the middle-tier server can return notification information of the failure of the invocation of the smart contract to the client.
  • the embodiments of the present application pre-register and deploy different blockchains to the middle-tier server, assign corresponding chain identifiers to the blockchains, and register each smart contract to the middle-tier server to assign corresponding contract identifiers to the smart contracts.
  • the client calls the smart contract, it only needs to issue a smart contract call request with the chain ID and the contract ID.
  • Initiate the corresponding smart contract execution request to the corresponding blockchain obtain the corresponding smart contract execution result and return it to the client.
  • the middle-tier server does not need to customize and encapsulate each smart contract in different blockchain platforms, which can reduce the difficulty of updating and maintaining the code of the middle-tier server.
  • FIG. 3 shows another blockchain smart contract calling method provided by the embodiment of the present application, including:
  • 301 Receive a smart contract invocation request sent by a client, where the smart contract invocation request includes a contract identifier of a target smart contract and a chain identifier of a target blockchain where the target smart contract is located;
  • Steps 301-302 are the same as steps 201-202, for details, please refer to the relevant description of steps 201-202.
  • the middle-tier server can determine the corresponding target blockchain through the chain identification, find the corresponding chain information, and activate the SDK corresponding to the chain identification, that is, the software development kit.
  • the target blockchain is registered, its corresponding SDK has been initialized, and in step 303, the initialized SDK will be activated and started.
  • the specific operation method is to initiate a smart contract execution request to the target blockchain according to the contract information, and obtain the target smart contract. The execution result of the contract.
  • the smart contract invocation request also includes attribute information of the target smart contract, the smart contract execution request is initiated to the target blockchain according to the contract information, and the execution result of the target smart contract is obtained.
  • attribute information of the target smart contract can include:
  • a smart contract execution request is initiated to the target blockchain through the contract information and the attribute information, and the execution result of the target smart contract is obtained.
  • the smart contract invocation request sent by the business system may also include other attribute information of the target smart contract, such as contract function name, function invocation parameters and other information.
  • attribute information of the target smart contract such as contract function name, function invocation parameters and other information.
  • the target blockchain is a blockchain of the Ethereum platform
  • the contract information includes a contract address and an interface description file of the target smart contract
  • the attribute information includes the target
  • the contract function name and function call parameters of the smart contract the smart contract execution request is initiated to the target blockchain through the contract information and the attribute information, and the execution result of the target smart contract is obtained, which may include:
  • the contract information includes the contract address and interface description file, and combined with the contract function name and function call parameters submitted from the business system, it sends a smart contract execution request to the blockchain to obtain The corresponding smart contract execution result.
  • the target blockchain is a blockchain of the fabric platform
  • the contract information includes a contract name of the target smart contract
  • the attribute information includes a contract function of the target smart contract name and function call parameters
  • the sending a smart contract execution request to the target blockchain through the contract information and the attribute information, and obtaining the execution result of the target smart contract may include:
  • a smart contract execution request is initiated to the target blockchain in combination with the contract name, the contract function name and the function call parameters, and the execution result of the target smart contract is obtained.
  • the contract information includes the contract name, combined with the contract function name and function call parameters submitted from the business system, and sends a smart contract execution request to the blockchain to obtain the corresponding smart contract execution. result.
  • the middle-tier server After obtaining the execution result of the target smart contract from the target blockchain, the middle-tier server will return the obtained execution result to the client, thereby completing a smart contract invocation process. In addition, if the invocation of the target smart contract fails due to the absence of the contract address, the non-existence of the contract function name, or the illegal contract parameter list, the middle-tier server can return the notification information of the failure of the smart contract invocation to the client.
  • the embodiments of the present application pre-register and deploy different blockchains to the middle-tier server, assign corresponding chain identifiers to the blockchains, and register each smart contract to the middle-tier server to assign corresponding contract identifiers to the smart contracts.
  • the client calls the smart contract, it only needs to issue a smart contract call request with the chain ID and the contract ID.
  • Initiate the corresponding smart contract execution request to the corresponding blockchain obtain the corresponding smart contract execution result and return it to the client.
  • the middle-tier server does not need to customize and encapsulate each smart contract in different blockchain platforms, which can reduce the difficulty of updating and maintaining the code of the middle-tier server.
  • FIG. 4 is a schematic schematic diagram of a method for invoking a smart contract on the Ethereum blockchain provided by an embodiment of the present application.
  • business system A needs to call the smart contract in the Ethereum blockchain through the middle-tier server.
  • the specific operation process is as follows:
  • the business system A calls the contract calling interface provided by the middle-tier server, which will contain information such as chain ID, contract ID, contract function name (method Name) and function call parameter list (argList).
  • the contract call request is submitted to the middle-tier server;
  • the middle-tier server After receiving the contract call request, the middle-tier server queries the corresponding blockchain information through the chain ID, and then activates the SDK corresponding to the chain ID, that is, the SDK corresponding to the Ethereum platform (Fig. SDK-eth in 4);
  • the middle-tier server queries the corresponding contract information from the database through the contract ID.
  • the contract information can include information such as the contract address (address) and the contract interface description file (ABI). ;
  • the middle-tier server calls the activated SDK.
  • the contract address (address) and the contract interface description file (ABI) corresponding to the contract ID (contract ID) are combined with the contract interface description file (ABI), as well as the data sent by business system A.
  • Contract function name (method Name) and function call parameter list (argList) and other information initiate a smart contract execution request to the Ethereum blockchain corresponding to the chain ID to find and obtain the contract address (address) corresponding to the smart contract. Results of the;
  • the middle-tier server returns the execution result of the smart contract to the business system A, thus completing a smart contract invocation process. If the smart contract invocation fails, for example, the smart contract invocation fails due to the absence of the contract address (address), the non-existence of the contract function name (method Name), or the invalid function call parameter list (argList), the middle-tier server can return The error message that the smart contract invocation failed is sent to the business system A.
  • FIG. 5 is a schematic diagram of the principle of a method for invoking a smart contract on a fabric blockchain provided by an embodiment of the present application.
  • the business system B needs to call the smart contract in the fabric blockchain through the middle-tier server.
  • the specific operation process is as follows:
  • the business system B calls the contract calling interface provided by the middle-tier server, which will contain information such as chain ID, contract ID, contract function name (method Name) and function call parameter list (argList).
  • the contract call request is submitted to the middle-tier server;
  • the middle-tier server After receiving the contract call request, the middle-tier server queries the corresponding blockchain information through the chain ID, and then activates the SDK corresponding to the chain ID, that is, the SDK corresponding to the fabric platform ( Figure 5). SDK-fabric in );
  • the middle-tier server queries the corresponding contract information from the database through the contract ID.
  • the contract information can include contract name and other information;
  • the middle-tier server calls the activated SDK.
  • For the blockchain of the fabric platform combine the contract name (contract Name) corresponding to the contract ID (contract ID), and the contract function name (method Name) and the contract function name (method Name) sent by business system B.
  • Function call parameter list (argList) and other information initiate a smart contract execution request to the fabric blockchain corresponding to the chain ID to find and obtain the execution result of the smart contract corresponding to the contract name;
  • the middle-tier server returns the execution result of the smart contract to the business system B, thereby completing a smart contract invocation process. If the smart contract invocation fails, for example, the contract name (contract Name) does not exist, the contract function name (method Name) does not exist, or the function invocation parameter list (argList) is invalid due to the reason that the smart contract invocation fails, the middle-tier server can return The error message that the smart contract call fails is sent to the business system B.
  • a method for invoking a smart contract of a blockchain is mainly described above, and a device for invoking a smart contract of a blockchain will be described below.
  • an embodiment of a blockchain smart contract invocation device in the embodiment of the present application includes:
  • the contract invocation request receiving module 601 is configured to receive a smart contract invocation request sent by the client, where the smart contract invocation request includes the contract identifier of the target smart contract and the chain identifier of the target blockchain where the target smart contract is located, wherein , the target blockchain has been registered and deployed to the middle-tier server, and the target smart contract has been registered to the middle-tier server;
  • a contract information search module 602 configured to search for the contract information of the target smart contract according to the contract identifier
  • a smart contract search module 603, configured to initiate a smart contract execution request to the target blockchain based on the contract information and the chain identifier, and obtain the execution result of the target smart contract;
  • the smart contract returning module 604 is configured to return the execution result of the target smart contract to the client.
  • the smart contract search module may include:
  • a toolkit activation unit for activating a software development toolkit corresponding to the chain identifier
  • a smart contract search unit configured to call the activated software development toolkit to initiate a smart contract execution request to the target blockchain according to the contract information, and obtain the execution result of the target smart contract.
  • the smart contract invocation request further includes attribute information of the target smart contract
  • the smart contract search unit may be specifically configured to: initiate a smart contract to the target blockchain through the contract information and the attribute information contract execution request, and obtain the execution result of the target smart contract.
  • the target blockchain is a blockchain of the Ethereum platform
  • the contract information includes a contract address and an interface description file of the target smart contract
  • the attribute information includes the target The contract function name and function call parameters of the smart contract.
  • the smart contract search unit may include:
  • the first contract search subunit is used to initiate a smart contract execution request to the target blockchain in combination with the contract address, the interface description file, the contract function name and the function call parameters, and obtain the target smart The execution result of the contract.
  • the target blockchain is a blockchain of the fabric platform
  • the contract information includes a contract name of the target smart contract
  • the attribute information includes a contract function of the target smart contract name and function call parameters
  • the smart contract lookup unit may include:
  • the second contract search subunit is configured to initiate a smart contract execution request to the target blockchain by combining the contract name, the contract function name and the function call parameter, and obtain the execution result of the target smart contract.
  • the smart contract invoking device may further include:
  • a block chain information acquisition module used to acquire the connection information and related files of the target block chain
  • a toolkit initialization module for initializing a software development toolkit corresponding to the platform type of the target blockchain according to the connection information and related files;
  • a connectivity test module used to perform connectivity test on the initialized software development kit
  • a chain identification allocation module is used to store the connection information and related files in a database if the connectivity test passes, and assign a chain identification to the target blockchain, thereby registering the target blockchain and deployed to the middle-tier server.
  • the smart contract invoking device may further include:
  • a smart contract deployment module configured to deploy the target smart contract into the target blockchain and obtain contract information of the target smart contract
  • the contract identification allocation module is used for completing the registration of the target smart contract according to the contract information, and assigning a contract identification to the target smart contract.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any blockchain as shown in FIG. 2 or FIG. 3 is implemented.
  • the steps for the smart contract to call a method are not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, a blockchain, etc.
  • the embodiment of the present application also provides a computer program product, when the computer program product runs on the terminal device, the terminal device is made to execute the steps of implementing any blockchain smart contract invocation method as shown in FIG. 2 or FIG. 3 . .
  • FIG. 7 is a schematic diagram of a server provided by an embodiment of the present application.
  • the server 7 of this embodiment includes a processor 70 , a memory 71 , and a computer program 72 stored in the memory 71 and executable on the processor 70 .
  • the processor 70 executes the computer program 72, the steps in each of the above embodiments of the smart contract invocation method are implemented, for example, steps 201 to 204 shown in FIG. 2 .
  • the processor 70 executes the computer program 72, the functions of the modules/units in each of the foregoing apparatus embodiments, such as the functions of the modules 601 to 604 shown in FIG. 6 , are implemented.
  • the computer program 72 may be divided into one or more modules/units, which are stored in the memory 71 and executed by the processor 70 to complete the present application.
  • the one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 72 in the server 7 .
  • the so-called processor 70 may be a central processing unit (Central Processing Unit, CPU), and may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuits) Integrated Circuit, ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 71 may be an internal storage unit of the server 7 , such as a hard disk or a memory of the server 7 .
  • the memory 71 may also be an external storage device of the server 7, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a Secure Digital (SD) card equipped on the server 7, Flash card (Flash Card) and so on.
  • the memory 71 may also include both an internal storage unit of the server 7 and an external storage device.
  • the memory 71 is used to store the computer program and other programs and data required by the server.
  • the memory 71 may also be used to temporarily store data that has been output or will be output.

Landscapes

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

Abstract

The present application relates to the technical field of blockchains, and in particular to a smart contract calling method and apparatus for blockchains, a server, and a storage medium. In the present application, each blockchain is registered and deployed to a middle-tier server in advance, a corresponding chain identifier is allocated for the blockchain, and each smart contract is registered to the middle-tier server, and a corresponding contract identifier is allocated for the smart contract. In this way, when a client calls the smart contract, only one smart contract calling request having the chain identifier and the contract identifier needs to be sent; and upon receiving the smart contract calling request, the middle-tier server initiates a corresponding smart contract execution request to the corresponding blockchain according to the chain identifier and the contract identifier, obtains a corresponding smart contract execution result, and returns the smart contract execution result to the client. In the process, the middle-tier server does not need to perform customized encapsulation on each smart contract in different blockchain platforms, thereby reducing the difficulty of updating and maintaining a code of the middle-tier server.

Description

区块链的智能合约调用方法、装置、服务器和存储介质Blockchain smart contract calling method, device, server and storage medium
本申请要求于2020年12月21日提交国家知识产权局、申请号为202011543148.1、申请名称为“区块链的智能合约调用方法、装置、服务器和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office on December 21, 2020, the application number is 202011543148.1, and the application name is "blockchain smart contract calling method, device, server and storage medium", which The entire contents of this application are incorporated by reference.
技术领域technical field
本申请涉及区块链技术领域,尤其涉及一种区块链的智能合约调用方法、装置、服务器和存储介质。The present application relates to the field of blockchain technology, and in particular, to a method, device, server and storage medium for invoking a smart contract of a blockchain.
背景技术Background technique
在实际的区块链系统中,底层的区块链平台和客户端之间通常会架设一个中间层服务器,该服务器负责区块链与客户端通讯过程中的数据编/解码,合约函数封装以及客户端向区块链的订阅信息处理等工作。In the actual blockchain system, a middle-tier server is usually set up between the underlying blockchain platform and the client, which is responsible for data encoding/decoding, contract function encapsulation and The client's subscription information processing to the blockchain, etc.
目前,对于客户端向多个不同区块链平台进行智能合约调用的需求,中间层服务器通常需要针对不同区块链平台中的每个智能合约进行定制化封装,再将封装后的接口提供给客户端调用。这样一来,一旦中间层服务器对接的区块链平台或智能合约较多,则中间层服务器的代码更新和维护操作将变得十分困难。At present, for the needs of the client to call smart contracts to multiple different blockchain platforms, the middle-tier server usually needs to customize the packaging for each smart contract in different blockchain platforms, and then provide the packaged interface to the Client call. In this way, once the middle-tier server is connected to many blockchain platforms or smart contracts, it will be very difficult to update and maintain the code of the middle-tier server.
技术问题technical problem
有鉴于此,本申请实施例提供了一种区块链的智能合约调用方法、装置、服务器和存储介质,能够降低中间层服务器代码更新和维护的难度。In view of this, the embodiments of the present application provide a blockchain smart contract calling method, device, server and storage medium, which can reduce the difficulty of updating and maintaining the code of the middle-tier server.
技术解决方案technical solutions
本申请实施例的第一方面提供了一种区块链的智能合约调用方法,包括:A first aspect of the embodiments of the present application provides a blockchain smart contract calling method, including:
接收客户端发送的智能合约调用请求,所述智能合约调用请求包含目标智能合约的合约标识以及所述目标智能合约所处的目标区块链的链标识,其中,所述目标区块链已注册并部署到所述中间层服务器,所述目标智能合约已登记到所述中间层服务器;Receive a smart contract invocation request sent by the client, where the smart contract invocation request includes the contract identifier of the target smart contract and the chain identifier of the target blockchain where the target smart contract is located, wherein the target blockchain has been registered and deployed to the middle-tier server, and the target smart contract has been registered with the middle-tier server;
根据所述合约标识查找所述目标智能合约的合约信息;Find the contract information of the target smart contract according to the contract identifier;
基于所述合约信息和所述链标识,向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果;Based on the contract information and the chain identifier, initiate a smart contract execution request to the target blockchain, and obtain the execution result of the target smart contract;
将所述目标智能合约的执行结果返回至所述客户端。Return the execution result of the target smart contract to the client.
本申请实施例预先将各个不同的区块链注册并部署到中间层服务器,为区块链分配对应的链标识,以及将各个智能合约登记到中间层服务器,为智能合约分配对应的合约标识。通过这样设置,当客户端调用智能合约时,只需要发出一个带有链标识和合约标识的智能合约调用请求,中间层服务器在接收到该智能合约调用请求后,会根据该链标识和合约标识向对应的区块链发起对应的智能合约执行请求,获取对应的智能合约执行结果返回给客户端。在上述过程中,中间层服务器无需对不同区块链平台中的每个智能合约进行定制化封装,从而能够降低中间层服务器代码更新和维护的难度。The embodiments of the present application pre-register and deploy different blockchains to the middle-tier server, assign corresponding chain identifiers to the blockchains, and register each smart contract to the middle-tier server to assign corresponding contract identifiers to the smart contracts. With this setting, when the client calls the smart contract, it only needs to issue a smart contract call request with the chain ID and the contract ID. Initiate the corresponding smart contract execution request to the corresponding blockchain, obtain the corresponding smart contract execution result and return it to the client. In the above process, the middle-tier server does not need to customize and encapsulate each smart contract in different blockchain platforms, which can reduce the difficulty of updating and maintaining the code of the middle-tier server.
在本申请的一个实施例中,基于所述合约信息和所述链标识,向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果,可以包括:In an embodiment of the present application, based on the contract information and the chain identifier, initiating a smart contract execution request to the target blockchain, and acquiring the execution result of the target smart contract, may include:
激活与所述链标识对应的软件开发工具包;activate the software development kit corresponding to the chain identifier;
调用激活后的所述软件开发工具包,以根据所述合约信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。The activated software development kit is invoked to initiate a smart contract execution request to the target blockchain according to the contract information, and obtain the execution result of the target smart contract.
进一步的,所述智能合约调用请求还包含所述目标智能合约的属性信息,所述根据所述合约信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果,可以包括:Further, the smart contract invocation request also includes attribute information of the target smart contract, the smart contract execution request is initiated to the target blockchain according to the contract information, and the execution result of the target smart contract is obtained. , which can include:
通过所述合约信息和所述属性信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。A smart contract execution request is initiated to the target blockchain through the contract information and the attribute information, and the execution result of the target smart contract is obtained.
在本申请的一个实施例中,所述目标区块链为以太坊平台的区块链,所述合约信息包括所述目标智能合约的合约地址和接口描述文件,所述属性信息包括所述目标智能合约的合约函数名和函数调用参数,所述通过所述合约信息和所述属性信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果,可以包括:In an embodiment of the present application, the target blockchain is a blockchain of the Ethereum platform, the contract information includes a contract address and an interface description file of the target smart contract, and the attribute information includes the target The contract function name and function call parameters of the smart contract, the smart contract execution request is initiated to the target blockchain through the contract information and the attribute information, and the execution result of the target smart contract is obtained, which may include:
结合所述合约地址、所述接口描述文件、所述合约函数名和所述函数调用参数向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。Initiate a smart contract execution request to the target blockchain in combination with the contract address, the interface description file, the contract function name and the function call parameters, and obtain the execution result of the target smart contract.
在本申请的一个实施例中,所述目标区块链为fabric平台的区块链,所述合约信息包括所述目标智能合约的合约名称,所述属性信息包括所述目标智能合约的合约函数名和函数调用参数,所述通过所述合约信息和所述属性信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果,可以包括:In an embodiment of the present application, the target blockchain is a blockchain of the fabric platform, the contract information includes a contract name of the target smart contract, and the attribute information includes a contract function of the target smart contract name and function call parameters, the sending a smart contract execution request to the target blockchain through the contract information and the attribute information, and obtaining the execution result of the target smart contract, may include:
结合所述合约名称、所述合约函数名和所述函数调用参数向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。A smart contract execution request is initiated to the target blockchain in combination with the contract name, the contract function name and the function call parameters, and the execution result of the target smart contract is obtained.
在本申请的一个实施例中,所述目标区块链可以通过以下步骤注册并部署到所述中间层服务器:In an embodiment of the present application, the target blockchain can be registered and deployed to the middle-tier server through the following steps:
获取所述目标区块链的连接信息和相关文件;Obtain the connection information and related files of the target blockchain;
根据所述连接信息和相关文件初始化与所述目标区块链的平台类型对应的软件开发工具包;Initialize a software development kit corresponding to the platform type of the target blockchain according to the connection information and related files;
对初始化完成的所述软件开发工具包进行连通性测试;Connectivity testing is performed on the software development kit that has been initialized;
若所述连通性测试通过,则将所述连接信息和相关文件存储至数据库,并为所述目标区块链分配一个链标识,从而将所述目标区块链注册并部署到所述中间层服务器。If the connectivity test passes, store the connection information and related files in a database, and assign a chain identifier to the target blockchain, so as to register and deploy the target blockchain to the middle layer server.
在本申请的一个实施例中,所述目标智能合约可以通过以下步骤登记到所述中间层服务器:In an embodiment of the present application, the target smart contract can be registered with the middle-tier server through the following steps:
将所述目标智能合约部署到所述目标区块链中,并获取所述目标智能合约的合约信息;deploying the target smart contract into the target blockchain, and obtaining contract information of the target smart contract;
根据所述合约信息完成所述目标智能合约的登记,并为所述目标智能合约分配一个合约标识。The registration of the target smart contract is completed according to the contract information, and a contract identifier is allocated to the target smart contract.
本申请实施例的第二方面提供了一种区块链的智能合约调用装置,应用于中间层服务器,所述装置包括:A second aspect of the embodiments of the present application provides a blockchain smart contract invocation device, which is applied to a middle-tier server, and the device includes:
合约调用请求接收模块,用于接收客户端发送的智能合约调用请求,所述智能合约调用请求包含目标智能合约的合约标识以及所述目标智能合约所处的目标区块链的链标识,其中,所述目标区块链已注册并部署到所述中间层服务器,所述目标智能合约已登记到所述中间层服务器;The contract invocation request receiving module is used to receive a smart contract invocation request sent by the client, where the smart contract invocation request includes the contract identifier of the target smart contract and the chain identifier of the target blockchain where the target smart contract is located, wherein, The target blockchain has been registered and deployed to the middle-tier server, and the target smart contract has been registered with the middle-tier server;
合约信息查找模块,用于根据所述合约标识查找所述目标智能合约的合约信息;a contract information search module, configured to search for the contract information of the target smart contract according to the contract identifier;
智能合约查找模块,用于基于所述合约信息和所述链标识,向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果;a smart contract search module, configured to initiate a smart contract execution request to the target blockchain based on the contract information and the chain identifier, and obtain the execution result of the target smart contract;
智能合约返回模块,用于将所述目标智能合约的执行结果返回至所述客户端。The smart contract return module is used for returning the execution result of the target smart contract to the client.
本申请实施例的第三方面提供了一种服务器,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如本申请实施例的第一方面提供的区块链的智能合约调用方法的步骤。A third aspect of the embodiments of the present application provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the computer program when the processor executes the computer program. The steps of the method for invoking a smart contract of a blockchain provided by the first aspect of the embodiments of this application.
本申请实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如本申请实施例的第一方面提供的区块链的智能合约调用方法的步骤。A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the implementation of the first aspect of the embodiments of the present application is implemented The steps of the smart contract of the blockchain to call the method.
本申请实施例的第五方面提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行本申请实施例的第一方面所述的区块链的智能合约调用方法的步骤。A fifth aspect of the embodiments of the present application provides a computer program product that, when the computer program product runs on a terminal device, enables the terminal device to execute the blockchain smart contract calling method described in the first aspect of the embodiments of the present application A step of.
可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。It can be understood that, for the beneficial effects of the second aspect to the fifth aspect, reference may be made to the relevant description in the first aspect, which is not repeated here.
附图说明Description of drawings
图1是本申请实施例提供的区块链的智能合约调用方法所采用的智能合约调用系统的结构示意图;1 is a schematic structural diagram of a smart contract invocation system adopted by a blockchain smart contract invocation method provided by an embodiment of the present application;
图2是本申请实施例提供的一种区块链的智能合约调用方法的一个实施例的流程图;FIG. 2 is a flowchart of an embodiment of a method for invoking a blockchain smart contract provided by an embodiment of the present application;
图3是本申请实施例提供的另一种区块链的智能合约调用方法的一个实施例的流程图;3 is a flowchart of an embodiment of another blockchain smart contract invocation method provided by an embodiment of the present application;
图4是本申请实施例提供的对于以太坊区块链的智能合约调用方法的原理示意图;4 is a schematic diagram of the principle of a smart contract calling method for the Ethereum blockchain provided by an embodiment of the present application;
图5是本申请实施例提供的对于fabric区块链的智能合约调用方法的原理示意图;5 is a schematic diagram of the principle of a method for invoking a smart contract on a fabric block chain provided by an embodiment of the present application;
图6是本申请实施例提供的一种区块链的智能合约调用装置的一个实施例的结构图;6 is a structural diagram of an embodiment of a blockchain smart contract invocation device provided by an embodiment of the present application;
图7是本申请实施例提供的一种服务器的示意图。FIG. 7 is a schematic diagram of a server provided by an embodiment of the present application.
本发明的实施方式Embodiments of the present invention
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are set forth in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be practiced in other embodiments without 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. In addition, in the description of the specification of the present application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and should not be construed as indicating or implying relative importance.
区块链是一个分布式的共享账本和数据库,具有去中心化、不可篡改、全程留痕、可以追溯、集体维护、公开透明等特点。目前,在实际的区块链系统中,通常会架设一个中间层服务器,以负责区块链与业务系统(客户端)通讯过程中的数据编解码、合约函数封装以及业务系统向区块链的订阅信息处理等工作。然而,对于业务系统向区块链调用智能合约的处理,中间层服务器通常需要预先针对不同区块链平台中的每个智能合约进行定制化封装,当业务需求变更时(例如新增一条区块链或者一个智能合约),则需要重新修改代码并测试,代码的更新过程还需要暂停服务,给业务系统的正常运行带来不良影响。而且,一旦中间层服务器对接的区块链平台或智能合约较多,则中间层服务器的代码更新和维护操作将变得十分困难。Blockchain is a distributed shared ledger and database, which has the characteristics of decentralization, immutability, traceability, traceability, collective maintenance, openness and transparency. At present, in the actual blockchain system, a middle-tier server is usually set up to be responsible for data encoding and decoding, contract function encapsulation, and the business system to the blockchain in the communication process between the blockchain and the business system (client). Subscription information processing, etc. However, for the processing of calling smart contracts from the business system to the blockchain, the middle-tier server usually needs to customize the packaging for each smart contract in different blockchain platforms in advance. When the business requirements change (for example, adding a new block chain or a smart contract), the code needs to be re-modified and tested. The code update process also needs to suspend the service, which will bring adverse effects to the normal operation of the business system. Moreover, once the middle-tier server is connected to many blockchain platforms or smart contracts, it will be very difficult to update and maintain the code of the middle-tier server.
针对上述问题,本申请实施例提供了一种区块链的智能合约调用方法、装置、服务器和存储介质,能够避免对不同区块链平台中的每个智能合约进行定制化封装,从而降低中间层服务器代码更新和维护的难度。In view of the above problems, the embodiments of the present application provide a blockchain smart contract calling method, device, server, and storage medium, which can avoid customized packaging of each smart contract in different blockchain platforms, thereby reducing intermediate The difficulty of updating and maintaining the tier server code.
应当理解,本申请各个方法实施例的执行主体可以为各种类型的终端设备或服务器,比如手机、平板电脑、笔记本电脑、台式电脑和可穿戴设备等。It should be understood that the execution body of each method embodiment of the present application may be various types of terminal devices or servers, such as mobile phones, tablet computers, notebook computers, desktop computers, and wearable devices.
图1是本申请实施例提供的区块链的智能合约调用方法所采用的智能合约调用系统的结构示意图。图1包含业务系统、中间层服务器和多个不同的区块链平台,其中业务系统为客户端,需要通过中间层服务器从区块链平台中调用智能合约;中间层服务器负责区块链与业务系统(客户端)通讯过程中的数据编解码、合约函数封装以及业务系统向区块链的订阅信息处理等工作,是本申请提出的各个方法实施例的执行主体;各个不同的区块链平台(例如fabric或以太坊等)都与该中间层服务器对接,完成数据的交互。需要说明的是,本申请不对接入的区块链平台的种类和数量进行任何限定。FIG. 1 is a schematic structural diagram of a smart contract invocation system adopted by a blockchain smart contract invocation method provided in an embodiment of the present application. Figure 1 includes a business system, a middle-tier server and multiple different blockchain platforms. The business system is the client, and the smart contract needs to be called from the blockchain platform through the middle-tier server; the middle-tier server is responsible for the blockchain and business The data encoding and decoding, contract function encapsulation, and subscription information processing of the business system to the blockchain in the system (client) communication process are the execution subjects of each method embodiment proposed in this application; various blockchain platforms (For example, fabric or Ethereum, etc.) are connected with the middle-tier server to complete data interaction. It should be noted that this application does not limit the type and quantity of the connected blockchain platforms.
关于上述智能合约调用系统的具体工作原理,可以参阅下文所述的方法实施例。For the specific working principle of the above-mentioned smart contract calling system, reference may be made to the method embodiments described below.
请参阅图2,示出了本申请实施例提供的一种区块链的智能合约调用方法,包括:Please refer to FIG. 2, which shows a blockchain smart contract calling method provided by an embodiment of the present application, including:
201、接收客户端发送的智能合约调用请求,所述智能合约调用请求包含目标智能合约的合约标识以及所述目标智能合约所处的目标区块链的链标识;201. Receive a smart contract invocation request sent by a client, where the smart contract invocation request includes a contract identifier of a target smart contract and a chain identifier of a target blockchain where the target smart contract is located;
业务系统等客户端若需要调用某个目标智能合约,可以发送一个智能合约调用请求至中间层服务器,该智能合约调用请求中包含该目标智能合约的合约标识以及该目标智能合约所处的目标区块链的链标识。具体的,业务系统可以调用中间层服务器提供的合约调用接口,将包含指定信息(例如链标识、合约标识、合约名称和函数调用参数)的合约调用请求提交给中间层服务器。中间层服务器在接收到该智能合约调用请求之后,可以根据请求中的链标识找到对应的目标区块链,并根据请求中的合约标识从该目标区块链中获取到对应的目标智能合约。If a client such as a business system needs to call a target smart contract, it can send a smart contract call request to the middle-tier server. The smart contract call request includes the contract identifier of the target smart contract and the target area where the target smart contract is located. The chain identity of the blockchain. Specifically, the business system can call the contract invocation interface provided by the middle-tier server, and submit a contract invocation request containing specified information (such as chain ID, contract ID, contract name, and function call parameters) to the middle-tier server. After receiving the smart contract calling request, the middle-tier server can find the corresponding target blockchain according to the chain ID in the request, and obtain the corresponding target smart contract from the target blockchain according to the contract ID in the request.
其中,该目标区块链预先注册并部署到该中间层服务器,该目标智能合约已部署到该目标区块链且已登记到该中间层服务器。该目标区块链在注册后,中间层服务器会为该目标区块链分配一个链标识(chain ID),用于唯一地表示该目标区块链。该目标智能合约在登记后,中间层服务器也会为该目标智能合约分配一个合约标识(contract ID),用于唯一地表示该目标智能合约。中间层服务器可以将已注册的各个不同区块链的链标识以及已登记的各个不同智能合约的合约标识发送给各个客户端,以便后续客户端调用智能合约时使用。The target blockchain is pre-registered and deployed to the middle-tier server, and the target smart contract has been deployed to the target blockchain and registered to the middle-tier server. After the target blockchain is registered, the middle-tier server will assign a chain ID to the target blockchain to uniquely represent the target blockchain. After the target smart contract is registered, the middle-tier server will also assign a contract ID to the target smart contract to uniquely represent the target smart contract. The middle-tier server can send the registered chain identifiers of different blockchains and the registered contract identifiers of different smart contracts to each client, so that the client can use it when calling the smart contract.
在本申请的一个实施例中,所述目标区块链可以通过以下步骤注册并部署到所述中间层服务器:In an embodiment of the present application, the target blockchain can be registered and deployed to the middle-tier server through the following steps:
(1)获取所述目标区块链的连接信息和相关文件;(1) Obtain the connection information and related files of the target blockchain;
(2)根据所述连接信息和相关文件初始化与所述目标区块链的平台类型对应的软件开发工具包;(2) Initialize the software development kit corresponding to the platform type of the target blockchain according to the connection information and related files;
(3)对初始化完成的所述软件开发工具包进行连通性测试;(3) Connectivity test is performed on the software development kit that has been initialized;
(4)若所述连通性测试通过,则将所述连接信息和相关文件存储至数据库,并为所述目标区块链分配一个链标识,从而将所述目标区块链注册并部署到所述中间层服务器。(4) If the connectivity test passes, store the connection information and related files in the database, and assign a chain identifier to the target blockchain, so as to register and deploy the target blockchain to all the middle-tier server.
上述步骤描述是目标区块链的注册部署过程,然而应当理解的是,任意的一条区块链都可以通过上述相同的步骤注册并部署到该中间层服务器。在目标区块链注册时,用户可以于中间层服务器点击新建一条区块链,然后获取该目标区块链的连接信息和相关文件。其中,连接信息可以包括区块链IP地址、区块链接口、区块链平台类型和平台版本等信息,相关文件可以包括SDK证书等和区块链相关的文件。The above steps describe the registration and deployment process of the target blockchain, however, it should be understood that any blockchain can be registered and deployed to the middle-tier server through the same steps above. When the target blockchain is registered, the user can click on the middle-tier server to create a new blockchain, and then obtain the connection information and related files of the target blockchain. Wherein, the connection information may include information such as blockchain IP address, blockchain interface, blockchain platform type and platform version, and related files may include SDK certificates and other blockchain-related files.
连接信息和相关文件可以通过相应的接口提交给中间层服务器,所提交的连接信息或相关文件会因区块链平台的不同而有差异。中间层服务器在接收到目标区块链提交的连接信息和相关文件之后,会根据这些信息和文件初始化与该目标区块链的平台类型对应的SDK(软件开发工具包),初始化的参数可以包括区块链IP地址、区块链接口和SDK证书等。例如,若目标区块链的平台类型为fabric,则初始化fabric平台对应的SDK;若目标区块链的平台类型为以太坊,则初始化以太坊平台对应的SDK,以此类推。The connection information and related files can be submitted to the middle-tier server through the corresponding interface, and the submitted connection information or related files will vary depending on the blockchain platform. After receiving the connection information and related files submitted by the target blockchain, the middle-tier server will initialize the SDK (software development kit) corresponding to the platform type of the target blockchain according to the information and files. The initialization parameters can include Blockchain IP address, blockchain interface and SDK certificate, etc. For example, if the platform type of the target blockchain is fabric, the SDK corresponding to the fabric platform is initialized; if the platform type of the target blockchain is Ethereum, the SDK corresponding to the Ethereum platform is initialized, and so on.
在软件开发工具包初始化完成后,中间层服务器对其进行连通性调用的测试,以验证其是否可以正常连接和使用。若连通性测试通过,中间层服务器会将该连接信息和相关文件存储至数据库,并为该目标区块链分配一个链标识,从而完成将目标区块链注册并部署到中间层服务器的操作;若连通性测试不通过,则表示目标区块链注册失败,此时可以返回报错信息,用以提醒技术人员查找区块链注册出错的原因。After the software development kit is initialized, the middle-tier server performs a connectivity call test to verify whether it can be connected and used normally. If the connectivity test passes, the middle-tier server will store the connection information and related files in the database, and assign a chain ID to the target blockchain, thus completing the operation of registering and deploying the target blockchain to the middle-tier server; If the connectivity test fails, it means that the target blockchain registration fails, and an error message can be returned to remind technicians to find the cause of the blockchain registration error.
在本申请的一个实施例中,所述目标智能合约可以通过以下步骤登记到所述中间层服务器:In an embodiment of the present application, the target smart contract can be registered with the middle-tier server through the following steps:
(1)将所述目标智能合约部署到所述目标区块链中,并获取所述目标智能合约的合约信息;(1) Deploy the target smart contract into the target blockchain, and obtain the contract information of the target smart contract;
(2)根据所述合约信息完成所述目标智能合约的登记,并为所述目标智能合约分配一个合约标识。(2) Complete the registration of the target smart contract according to the contract information, and assign a contract identifier to the target smart contract.
上述步骤描述是目标智能合约部署的部署和登记过程,然而应当理解的是,任意的一个智能合约都可以通过上述相同的步骤登记到该中间层服务器。在目标区块链注册部署完成后,需要执行目标智能合约的登记过程。具体的,先将目标智能合约部署到已注册的该目标区块链中,获取相应的合约信息,其中,对于以太坊平台的区块链,可以获取合约地址和合约接口描述文件作为合约信息;对于fabric平台的区块链,可以获取合约名称作为合约信息。中间层服务器在获取到目标智能合约的合约信息后,会根据该合约信息完成该目标智能合约的登记,并为其分配一个合约标识contract ID,分配的合约标识contract ID和该目标区块链的链标识chain ID关联。The above steps describe the deployment and registration process of the target smart contract deployment, however, it should be understood that any smart contract can be registered to the middle-tier server through the same steps above. After the registration and deployment of the target blockchain is completed, the registration process of the target smart contract needs to be performed. Specifically, the target smart contract is first deployed to the registered target blockchain, and the corresponding contract information is obtained. For the blockchain of the Ethereum platform, the contract address and the contract interface description file can be obtained as the contract information; For the blockchain of the fabric platform, the contract name can be obtained as contract information. After obtaining the contract information of the target smart contract, the middle-tier server will complete the registration of the target smart contract according to the contract information, and assign a contract ID to it. The chain identifies the chain ID association.
202、根据所述合约标识查找所述目标智能合约的合约信息;202. Find the contract information of the target smart contract according to the contract identifier;
中间层服务器在接收到该智能合约调用请求之后,根据该请求中的合约标识查找该目标智能合约的合约信息。具体的,该目标智能合约的合约信息在合约登记后可以存储在中间层服务器的数据库中。此时,中间层服务器可以通过该合约标识从该数据库中查找对应的合约信息,对于以太坊平台的区块链,这里的合约信息可以为合约标识对应的合约地址和接口描述文件;对于fabric平台的区块链,这里的合约信息可以为合约标识对应的合约名称。After receiving the smart contract calling request, the middle-tier server searches for the contract information of the target smart contract according to the contract identifier in the request. Specifically, the contract information of the target smart contract can be stored in the database of the middle-tier server after the contract is registered. At this time, the middle-tier server can find the corresponding contract information from the database through the contract identifier. For the blockchain of the Ethereum platform, the contract information here can be the contract address and interface description file corresponding to the contract identifier; for the fabric platform The contract information here can be the contract name corresponding to the contract identifier.
203、基于所述合约信息和所述链标识,向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果;203. Based on the contract information and the chain identifier, initiate a smart contract execution request to the target blockchain, and obtain the execution result of the target smart contract;
通过该链标识可以确定对应的目标区块链,然后再利用该合约信息向该目标区块链发起智能合约执行请求,从而获取该目标智能合约的执行结果。关于步骤203的更具体的说明,可以参照本申请的下一个实施例。The corresponding target blockchain can be determined through the chain identifier, and then the contract information is used to initiate a smart contract execution request to the target blockchain, thereby obtaining the execution result of the target smart contract. For a more specific description of step 203, reference may be made to the next embodiment of the present application.
204、将所述目标智能合约的执行结果返回至所述客户端。204. Return the execution result of the target smart contract to the client.
中间层服务器在从目标区块链中获取到该目标智能合约的执行结果之后,会将获取到的该执行结果返回至客户端,从而完成一次智能合约的调用过程。另外,若该目标智能合约调用失败,则中间层服务器可以返回智能合约调用失败的通知信息至该客户端。After obtaining the execution result of the target smart contract from the target blockchain, the middle-tier server will return the obtained execution result to the client, thereby completing a smart contract invocation process. In addition, if the invocation of the target smart contract fails, the middle-tier server can return notification information of the failure of the invocation of the smart contract to the client.
总的来说,本申请的关键技术点在于:In general, the key technical points of this application are:
(1)当中间层服务器对接一条新的区块链时,将现有技术中修改中间层代码再更新的实现方式,修改为通过提交新链连接信息进行注册的方式;(1) When the middle-tier server connects to a new blockchain, the implementation method of modifying the middle-tier code and then updating in the prior art is modified to the method of submitting new chain connection information for registration;
(2)当区块链上部署一份新合约时,将现有技术中由中间层服务器对新合约接口进行封装后以特定接口暴露给业务系统的方式,修改为只登记智能合约调用的必要信息(合约地址、合约名称等)到中间层服务器,只提供通用合约调用接口给中间层服务器进行自定义调用的方式,大大提高了操作的灵活性。(2) When a new contract is deployed on the blockchain, the method of encapsulating the new contract interface by the middle-tier server in the existing technology and exposing it to the business system through a specific interface is modified to only register the necessary for smart contract calls Information (contract address, contract name, etc.) is sent to the middle-tier server, and only the general contract calling interface is provided to the middle-tier server to make custom calls, which greatly improves the flexibility of operation.
本申请实施例预先将各个不同的区块链注册并部署到中间层服务器,为区块链分配对应的链标识,以及将各个智能合约登记到中间层服务器,为智能合约分配对应的合约标识。通过这样设置,当客户端调用智能合约时,只需要发出一个带有链标识和合约标识的智能合约调用请求,中间层服务器在接收到该智能合约调用请求后,会根据该链标识和合约标识向对应的区块链发起对应的智能合约执行请求,获取对应的智能合约执行结果返回给客户端。在上述过程中,中间层服务器无需对不同区块链平台中的每个智能合约进行定制化封装,从而能够降低中间层服务器代码更新和维护的难度。The embodiments of the present application pre-register and deploy different blockchains to the middle-tier server, assign corresponding chain identifiers to the blockchains, and register each smart contract to the middle-tier server to assign corresponding contract identifiers to the smart contracts. With this setting, when the client calls the smart contract, it only needs to issue a smart contract call request with the chain ID and the contract ID. Initiate the corresponding smart contract execution request to the corresponding blockchain, obtain the corresponding smart contract execution result and return it to the client. In the above process, the middle-tier server does not need to customize and encapsulate each smart contract in different blockchain platforms, which can reduce the difficulty of updating and maintaining the code of the middle-tier server.
请参阅图3,示出了本申请实施例提供的另一种区块链的智能合约调用方法,包括:Please refer to FIG. 3, which shows another blockchain smart contract calling method provided by the embodiment of the present application, including:
301、接收客户端发送的智能合约调用请求,所述智能合约调用请求包含目标智能合约的合约标识以及所述目标智能合约所处的目标区块链的链标识;301. Receive a smart contract invocation request sent by a client, where the smart contract invocation request includes a contract identifier of a target smart contract and a chain identifier of a target blockchain where the target smart contract is located;
302、根据所述合约标识查找所述目标智能合约的合约信息;302. Find the contract information of the target smart contract according to the contract identifier;
步骤301-302与步骤201-202相同,具体可参照步骤201-202的相关说明。Steps 301-302 are the same as steps 201-202, for details, please refer to the relevant description of steps 201-202.
303、激活与所述链标识对应的软件开发工具包;303. Activate a software development kit corresponding to the chain identifier;
中间层服务器通过该链标识可以确定对应的目标区块链,查找到对应的链信息,从而激活与该链标识对应的SDK,即软件开发工具包。在目标区块链注册时,其对应的SDK已完成初始化,而在步骤303中会激活并启动初始化完成的SDK。The middle-tier server can determine the corresponding target blockchain through the chain identification, find the corresponding chain information, and activate the SDK corresponding to the chain identification, that is, the software development kit. When the target blockchain is registered, its corresponding SDK has been initialized, and in step 303, the initialized SDK will be activated and started.
304、调用激活后的所述软件开发工具包,以根据所述合约信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果;304. Invoke the activated software development kit to initiate a smart contract execution request to the target blockchain according to the contract information, and obtain the execution result of the target smart contract;
调用激活后的该软件开发工具包,以实现从区块链中调取智能合约的执行结果,具体操作方式是根据该合约信息向该目标区块链发起智能合约执行请求,并获取该目标智能合约的执行结果。Call the activated software development kit to realize the execution result of the smart contract from the blockchain. The specific operation method is to initiate a smart contract execution request to the target blockchain according to the contract information, and obtain the target smart contract. The execution result of the contract.
进一步的,所述智能合约调用请求还包含所述目标智能合约的属性信息,所述根据所述合约信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果,可以包括:Further, the smart contract invocation request also includes attribute information of the target smart contract, the smart contract execution request is initiated to the target blockchain according to the contract information, and the execution result of the target smart contract is obtained. , which can include:
通过所述合约信息和所述属性信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。A smart contract execution request is initiated to the target blockchain through the contract information and the attribute information, and the execution result of the target smart contract is obtained.
业务系统发送的智能合约调用请求中还可以包括该目标智能合约的其它属性信息,例如合约函数名、函数调用参数等信息。在调用目标智能合约时,可以将这部分属性信息和该合约信息结合,提交给对应的目标区块链,以发起智能合约执行请求。The smart contract invocation request sent by the business system may also include other attribute information of the target smart contract, such as contract function name, function invocation parameters and other information. When calling the target smart contract, this part of the attribute information can be combined with the contract information and submitted to the corresponding target blockchain to initiate a smart contract execution request.
在本申请的一个实施例中,所述目标区块链为以太坊平台的区块链,所述合约信息包括所述目标智能合约的合约地址和接口描述文件,所述属性信息包括所述目标智能合约的合约函数名和函数调用参数,所述通过所述合约信息和所述属性信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果,可以包括:In an embodiment of the present application, the target blockchain is a blockchain of the Ethereum platform, the contract information includes a contract address and an interface description file of the target smart contract, and the attribute information includes the target The contract function name and function call parameters of the smart contract, the smart contract execution request is initiated to the target blockchain through the contract information and the attribute information, and the execution result of the target smart contract is obtained, which may include:
结合所述合约地址、所述接口描述文件、所述合约函数名和所述函数调用参数向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。Initiate a smart contract execution request to the target blockchain in combination with the contract address, the interface description file, the contract function name and the function call parameters, and obtain the execution result of the target smart contract.
对于以太坊平台的区块链,其合约信息包括合约地址和接口描述文件,再结合从业务系统中提交过来的合约函数名和函数调用参数等信息,向区块链发送智能合约执行请求,从而获取对应的智能合约执行结果。For the blockchain of the Ethereum platform, the contract information includes the contract address and interface description file, and combined with the contract function name and function call parameters submitted from the business system, it sends a smart contract execution request to the blockchain to obtain The corresponding smart contract execution result.
在本申请的一个实施例中,所述目标区块链为fabric平台的区块链,所述合约信息包括所述目标智能合约的合约名称,所述属性信息包括所述目标智能合约的合约函数名和函数调用参数,所述通过所述合约信息和所述属性信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果,可以包括:In an embodiment of the present application, the target blockchain is a blockchain of the fabric platform, the contract information includes a contract name of the target smart contract, and the attribute information includes a contract function of the target smart contract name and function call parameters, the sending a smart contract execution request to the target blockchain through the contract information and the attribute information, and obtaining the execution result of the target smart contract, may include:
结合所述合约名称、所述合约函数名和所述函数调用参数向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。A smart contract execution request is initiated to the target blockchain in combination with the contract name, the contract function name and the function call parameters, and the execution result of the target smart contract is obtained.
对于fabric平台的区块链,其合约信息包括合约名称,再结合从业务系统中提交过来的合约函数名和函数调用参数等信息,向区块链发送智能合约执行请求,从而获取对应的智能合约执行结果。For the blockchain of the fabric platform, the contract information includes the contract name, combined with the contract function name and function call parameters submitted from the business system, and sends a smart contract execution request to the blockchain to obtain the corresponding smart contract execution. result.
305、将所述目标智能合约的执行结果返回至所述客户端。305. Return the execution result of the target smart contract to the client.
中间层服务器在从目标区块链中获取到该目标智能合约的执行结果之后,会将获取到的该执行结果返回至客户端,从而完成一次智能合约的调用过程。另外,若由于合约地址不存在,合约函数名不存在或者合约参数列表不合法等原因导致该目标智能合约调用失败,则中间层服务器可以返回智能合约调用失败的通知信息至该客户端。After obtaining the execution result of the target smart contract from the target blockchain, the middle-tier server will return the obtained execution result to the client, thereby completing a smart contract invocation process. In addition, if the invocation of the target smart contract fails due to the absence of the contract address, the non-existence of the contract function name, or the illegal contract parameter list, the middle-tier server can return the notification information of the failure of the smart contract invocation to the client.
本申请实施例预先将各个不同的区块链注册并部署到中间层服务器,为区块链分配对应的链标识,以及将各个智能合约登记到中间层服务器,为智能合约分配对应的合约标识。通过这样设置,当客户端调用智能合约时,只需要发出一个带有链标识和合约标识的智能合约调用请求,中间层服务器在接收到该智能合约调用请求后,会根据该链标识和合约标识向对应的区块链发起对应的智能合约执行请求,获取对应的智能合约执行结果返回给客户端。在上述过程中,中间层服务器无需对不同区块链平台中的每个智能合约进行定制化封装,从而能够降低中间层服务器代码更新和维护的难度。The embodiments of the present application pre-register and deploy different blockchains to the middle-tier server, assign corresponding chain identifiers to the blockchains, and register each smart contract to the middle-tier server to assign corresponding contract identifiers to the smart contracts. With this setting, when the client calls the smart contract, it only needs to issue a smart contract call request with the chain ID and the contract ID. Initiate the corresponding smart contract execution request to the corresponding blockchain, obtain the corresponding smart contract execution result and return it to the client. In the above process, the middle-tier server does not need to customize and encapsulate each smart contract in different blockchain platforms, which can reduce the difficulty of updating and maintaining the code of the middle-tier server.
为便于理解,下面以实际的应用场景来说明本申请提出的区块链的智能合约调用方法。For ease of understanding, the following uses an actual application scenario to illustrate the blockchain smart contract calling method proposed in this application.
图4是本申请实施例提供的对于以太坊区块链的智能合约调用方法的原理示意图。在图4中,业务系统A需要通过中间层服务器调用以太坊区块链中的智能合约,具体操作流程如下:FIG. 4 is a schematic schematic diagram of a method for invoking a smart contract on the Ethereum blockchain provided by an embodiment of the present application. In Figure 4, business system A needs to call the smart contract in the Ethereum blockchain through the middle-tier server. The specific operation process is as follows:
(4.1)业务系统A调用中间层服务器提供的合约调用接口,将包含链标识(chain ID)、合约标识(contract ID)、合约函数名(method Name)和函数调用参数列表(argList)等信息的合约调用请求提交给中间层服务器;(4.1) The business system A calls the contract calling interface provided by the middle-tier server, which will contain information such as chain ID, contract ID, contract function name (method Name) and function call parameter list (argList). The contract call request is submitted to the middle-tier server;
(4.2)中间层服务器在接收到合约调用请求后,通过其中的链标识(chain ID)查询到对应的区块链信息,然后激活该链标识对应的SDK,即以太坊平台对应的SDK(图4中的SDK-eth);(4.2) After receiving the contract call request, the middle-tier server queries the corresponding blockchain information through the chain ID, and then activates the SDK corresponding to the chain ID, that is, the SDK corresponding to the Ethereum platform (Fig. SDK-eth in 4);
(4.3)中间层服务器通过合约标识(contract ID)从数据库中查询对应的合约信息,对于以太坊平台的区块链,合约信息可以包括合约地址(address)和合约接口描述文件(ABI)等信息;(4.3) The middle-tier server queries the corresponding contract information from the database through the contract ID. For the blockchain of the Ethereum platform, the contract information can include information such as the contract address (address) and the contract interface description file (ABI). ;
(4.4)中间层服务器调用激活后的SDK,对于以太坊平台的区块链,结合合约标识(contract ID)对应的合约地址(address)和合约接口描述文件(ABI),以及业务系统A发送的合约函数名(method Name)和函数调用参数列表(argList)等信息,向该链标识对应的以太坊区块链发起智能合约执行请求,以查找并获取该合约地址(address)对应的智能合约的执行结果;(4.4) The middle-tier server calls the activated SDK. For the blockchain of the Ethereum platform, the contract address (address) and the contract interface description file (ABI) corresponding to the contract ID (contract ID) are combined with the contract interface description file (ABI), as well as the data sent by business system A. Contract function name (method Name) and function call parameter list (argList) and other information, initiate a smart contract execution request to the Ethereum blockchain corresponding to the chain ID to find and obtain the contract address (address) corresponding to the smart contract. Results of the;
(4.5)若智能合约调用成功,则中间层服务器返回智能合约的执行结果至该业务系统A,从而完成一次智能合约的调用过程。若智能合约调用失败,例如由于合约地址(address)不存在、合约函数名(method Name)不存在或者函数调用参数列表(argList)不合法等原因导致的智能合约调用失败,则中间层服务器可以返回智能合约调用失败的报错信息至该业务系统A。(4.5) If the smart contract invocation is successful, the middle-tier server returns the execution result of the smart contract to the business system A, thus completing a smart contract invocation process. If the smart contract invocation fails, for example, the smart contract invocation fails due to the absence of the contract address (address), the non-existence of the contract function name (method Name), or the invalid function call parameter list (argList), the middle-tier server can return The error message that the smart contract invocation failed is sent to the business system A.
图5是本申请实施例提供的对于fabric区块链的智能合约调用方法的原理示意图。在图5中,业务系统B需要通过中间层服务器调用fabric区块链中的智能合约,具体操作流程如下:FIG. 5 is a schematic diagram of the principle of a method for invoking a smart contract on a fabric blockchain provided by an embodiment of the present application. In Figure 5, the business system B needs to call the smart contract in the fabric blockchain through the middle-tier server. The specific operation process is as follows:
(5.1)业务系统B调用中间层服务器提供的合约调用接口,将包含链标识(chain ID)、合约标识(contract ID)、合约函数名(method Name)和函数调用参数列表(argList)等信息的合约调用请求提交给中间层服务器;(5.1) The business system B calls the contract calling interface provided by the middle-tier server, which will contain information such as chain ID, contract ID, contract function name (method Name) and function call parameter list (argList). The contract call request is submitted to the middle-tier server;
(5.2)中间层服务器在接收到合约调用请求后,通过其中的链标识(chain ID)查询到对应的区块链信息,然后激活该链标识对应的SDK,即fabric平台对应的SDK(图5中的SDK-fabric);(5.2) After receiving the contract call request, the middle-tier server queries the corresponding blockchain information through the chain ID, and then activates the SDK corresponding to the chain ID, that is, the SDK corresponding to the fabric platform (Figure 5). SDK-fabric in );
(5.3)中间层服务器通过合约标识(contract ID)从数据库中查询对应的合约信息,对于fabric平台的区块链,合约信息可以包括合约名称(contract Name)等信息;(5.3) The middle-tier server queries the corresponding contract information from the database through the contract ID. For the blockchain of the fabric platform, the contract information can include contract name and other information;
(5.4)中间层服务器调用激活后的SDK,对于fabric平台的区块链,结合合约标识(contract ID)对应的合约名称(contract Name),以及业务系统B发送的合约函数名(method Name)和函数调用参数列表(argList)等信息,向该链标识对应的fabric区块链发起智能合约执行请求,以查找并获取该合约名称(contract Name)对应的智能合约的执行结果;(5.4) The middle-tier server calls the activated SDK. For the blockchain of the fabric platform, combine the contract name (contract Name) corresponding to the contract ID (contract ID), and the contract function name (method Name) and the contract function name (method Name) sent by business system B. Function call parameter list (argList) and other information, initiate a smart contract execution request to the fabric blockchain corresponding to the chain ID to find and obtain the execution result of the smart contract corresponding to the contract name;
(5.5)若智能合约调用成功,则中间层服务器返回智能合约的执行结果至该业务系统B,从而完成一次智能合约的调用过程。若智能合约调用失败,例如合约名称(contract Name)不存在、合约函数名(method Name)不存在或者函数调用参数列表(argList)不合法等原因导致的智能合约调用失败,则中间层服务器可以返回智能合约调用失败的报错信息至该业务系统B。(5.5) If the smart contract invocation is successful, the middle-tier server returns the execution result of the smart contract to the business system B, thereby completing a smart contract invocation process. If the smart contract invocation fails, for example, the contract name (contract Name) does not exist, the contract function name (method Name) does not exist, or the function invocation parameter list (argList) is invalid due to the reason that the smart contract invocation fails, the middle-tier server can return The error message that the smart contract call fails is sent to the business system B.
需要说明的是,虽然以上只列出针对以太坊区块链和fabric区块链的实际应用场景,但本申请可以实现基于任何区块链平台的智能合约调用,若需要支持新的区块链平台,只需要中间层服务器对以下环节进行定制化操作,后续即可永久支持新的区块链平台的智能合约调用代理流程,具体环节包括:It should be noted that although the above only lists the actual application scenarios for the Ethereum blockchain and the fabric blockchain, this application can implement smart contract calls based on any blockchain platform. If you need to support new blockchains The platform only needs the middle-tier server to customize the operation of the following links, and then it can permanently support the new blockchain platform's smart contract invocation proxy process. The specific links include:
(1)按照新区块链平台的连接要求,新增一类区块链注册信息;(1) According to the connection requirements of the new blockchain platform, a new type of blockchain registration information is added;
(2)按照新区块链平台的合约调用规范,新增一类智能合约登记信息;(2) According to the contract calling specification of the new blockchain platform, a new type of smart contract registration information has been added;
(3)按照新区块链平台的合约调用规范,实现新平台的SDK初始化和交易封装逻辑。(3) According to the contract call specification of the new blockchain platform, implement the SDK initialization and transaction packaging logic of the new platform.
应理解,上述各个实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above-mentioned various embodiments does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. .
上面主要描述了一种区块链的智能合约调用方法,下面将对一种区块链的智能合约调用装置进行描述。A method for invoking a smart contract of a blockchain is mainly described above, and a device for invoking a smart contract of a blockchain will be described below.
请参阅图6,本申请实施例中一种区块链的智能合约调用装置的一个实施例包括:Referring to FIG. 6, an embodiment of a blockchain smart contract invocation device in the embodiment of the present application includes:
合约调用请求接收模块601,用于接收客户端发送的智能合约调用请求,所述智能合约调用请求包含目标智能合约的合约标识以及所述目标智能合约所处的目标区块链的链标识,其中,所述目标区块链已注册并部署到所述中间层服务器,所述目标智能合约已登记到所述中间层服务器;The contract invocation request receiving module 601 is configured to receive a smart contract invocation request sent by the client, where the smart contract invocation request includes the contract identifier of the target smart contract and the chain identifier of the target blockchain where the target smart contract is located, wherein , the target blockchain has been registered and deployed to the middle-tier server, and the target smart contract has been registered to the middle-tier server;
合约信息查找模块602,用于根据所述合约标识查找所述目标智能合约的合约信息;A contract information search module 602, configured to search for the contract information of the target smart contract according to the contract identifier;
智能合约查找模块603,用于基于所述合约信息和所述链标识,向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果;A smart contract search module 603, configured to initiate a smart contract execution request to the target blockchain based on the contract information and the chain identifier, and obtain the execution result of the target smart contract;
智能合约返回模块604,用于将所述目标智能合约的执行结果返回至所述客户端。The smart contract returning module 604 is configured to return the execution result of the target smart contract to the client.
在本申请的一个实施例中,所述智能合约查找模块可以包括:In an embodiment of the present application, the smart contract search module may include:
工具包激活单元,用于激活与所述链标识对应的软件开发工具包;a toolkit activation unit for activating a software development toolkit corresponding to the chain identifier;
智能合约查找单元,用于调用激活后的所述软件开发工具包,以根据所述合约信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。A smart contract search unit, configured to call the activated software development toolkit to initiate a smart contract execution request to the target blockchain according to the contract information, and obtain the execution result of the target smart contract.
进一步的,所述智能合约调用请求还包含所述目标智能合约的属性信息,所述智能合约查找单元具体可以用于:通过所述合约信息和所述属性信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。Further, the smart contract invocation request further includes attribute information of the target smart contract, and the smart contract search unit may be specifically configured to: initiate a smart contract to the target blockchain through the contract information and the attribute information contract execution request, and obtain the execution result of the target smart contract.
在本申请的一个实施例中,所述目标区块链为以太坊平台的区块链,所述合约信息包括所述目标智能合约的合约地址和接口描述文件,所述属性信息包括所述目标智能合约的合约函数名和函数调用参数,所述智能合约查找单元可以包括:In an embodiment of the present application, the target blockchain is a blockchain of the Ethereum platform, the contract information includes a contract address and an interface description file of the target smart contract, and the attribute information includes the target The contract function name and function call parameters of the smart contract. The smart contract search unit may include:
第一合约查找子单元,用于结合所述合约地址、所述接口描述文件、所述合约函数名和所述函数调用参数向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。The first contract search subunit is used to initiate a smart contract execution request to the target blockchain in combination with the contract address, the interface description file, the contract function name and the function call parameters, and obtain the target smart The execution result of the contract.
在本申请的一个实施例中,所述目标区块链为fabric平台的区块链,所述合约信息包括所述目标智能合约的合约名称,所述属性信息包括所述目标智能合约的合约函数名和函数调用参数,所述智能合约查找单元可以包括:In an embodiment of the present application, the target blockchain is a blockchain of the fabric platform, the contract information includes a contract name of the target smart contract, and the attribute information includes a contract function of the target smart contract name and function call parameters, the smart contract lookup unit may include:
第二合约查找子单元,用于结合所述合约名称、所述合约函数名和所述函数调用参数向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。The second contract search subunit is configured to initiate a smart contract execution request to the target blockchain by combining the contract name, the contract function name and the function call parameter, and obtain the execution result of the target smart contract.
在本申请的一个实施例中,所述智能合约调用装置还可以包括:In an embodiment of the present application, the smart contract invoking device may further include:
区块链信息获取模块,用于获取所述目标区块链的连接信息和相关文件;A block chain information acquisition module, used to acquire the connection information and related files of the target block chain;
工具包初始化模块,用于根据所述连接信息和相关文件初始化与所述目标区块链的平台类型对应的软件开发工具包;a toolkit initialization module for initializing a software development toolkit corresponding to the platform type of the target blockchain according to the connection information and related files;
连通性测试模块,用于对初始化完成的所述软件开发工具包进行连通性测试;A connectivity test module, used to perform connectivity test on the initialized software development kit;
链标识分配模块,用于若所述连通性测试通过,则将所述连接信息和相关文件存储至数据库,并为所述目标区块链分配一个链标识,从而将所述目标区块链注册并部署到所述中间层服务器。A chain identification allocation module is used to store the connection information and related files in a database if the connectivity test passes, and assign a chain identification to the target blockchain, thereby registering the target blockchain and deployed to the middle-tier server.
在本申请的一个实施例中,所述智能合约调用装置还可以包括:In an embodiment of the present application, the smart contract invoking device may further include:
智能合约部署模块,用于将所述目标智能合约部署到所述目标区块链中,并获取所述目标智能合约的合约信息;a smart contract deployment module, configured to deploy the target smart contract into the target blockchain and obtain contract information of the target smart contract;
合约标识分配模块,用于根据所述合约信息完成所述目标智能合约的登记,并为所述目标智能合约分配一个合约标识。The contract identification allocation module is used for completing the registration of the target smart contract according to the contract information, and assigning a contract identification to the target smart contract.
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如图2或图3表示的任意一种区块链的智能合约调用方法的步骤。Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any blockchain as shown in FIG. 2 or FIG. 3 is implemented. The steps for the smart contract to call a method.
本申请实施例还提供一种计算机程序产品,当该计算机程序产品在终端设备上运行时,使得终端设备执行实现如图2或图3表示的任意一种区块链的智能合约调用方法的步骤。The embodiment of the present application also provides a computer program product, when the computer program product runs on the terminal device, the terminal device is made to execute the steps of implementing any blockchain smart contract invocation method as shown in FIG. 2 or FIG. 3 . .
图7是本申请一实施例提供的服务器的示意图。如图7所示,该实施例的服务器7包括:处理器70、存储器71以及存储在所述存储器71中并可在所述处理器70上运行的计算机程序72。所述处理器70执行所述计算机程序72时实现上述各个智能合约调用方法的实施例中的步骤,例如图2所示的步骤201至204。或者,所述处理器70执行所述计算机程序72时实现上述各装置实施例中各模块/单元的功能,例如图6所示模块601至604的功能。FIG. 7 is a schematic diagram of a server provided by an embodiment of the present application. As shown in FIG. 7 , the server 7 of this embodiment includes a processor 70 , a memory 71 , and a computer program 72 stored in the memory 71 and executable on the processor 70 . When the processor 70 executes the computer program 72, the steps in each of the above embodiments of the smart contract invocation method are implemented, for example, steps 201 to 204 shown in FIG. 2 . Alternatively, when the processor 70 executes the computer program 72, the functions of the modules/units in each of the foregoing apparatus embodiments, such as the functions of the modules 601 to 604 shown in FIG. 6 , are implemented.
所述计算机程序72可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器71中,并由所述处理器70执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序72在所述服务器7中的执行过程。The computer program 72 may be divided into one or more modules/units, which are stored in the memory 71 and executed by the processor 70 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 72 in the server 7 .
所称处理器70可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 70 may be a central processing unit (Central Processing Unit, CPU), and may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuits) Integrated Circuit, ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
所述存储器71可以是所述服务器7的内部存储单元,例如服务器7的硬盘或内存。所述存储器71也可以是所述服务器7的外部存储设备,例如所述服务器7上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器71还可以既包括所述服务器7的内部存储单元也包括外部存储设备。所述存储器71用于存储所述计算机程序以及所述服务器所需的其他程序和数据。所述存储器71还可以用于暂时地存储已经输出或者将要输出的数据。The memory 71 may be an internal storage unit of the server 7 , such as a hard disk or a memory of the server 7 . The memory 71 may also be an external storage device of the server 7, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a Secure Digital (SD) card equipped on the server 7, Flash card (Flash Card) and so on. Further, the memory 71 may also include both an internal storage unit of the server 7 and an external storage device. The memory 71 is used to store the computer program and other programs and data required by the server. The memory 71 may also be used to temporarily store data that has been output or will be output.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the above-mentioned embodiments, those of ordinary skill in the art should understand that: it can still be used for the above-mentioned implementations. The technical solutions described in the examples are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions in the embodiments of the application, and should be included in the within the scope of protection of this application.

Claims (10)

  1. 一种区块链的智能合约调用方法,应用于中间层服务器,其特征在于,所述方法包括: A method for invoking a smart contract of a blockchain, applied to a middle-tier server, characterized in that the method comprises:
    接收客户端发送的智能合约调用请求,所述智能合约调用请求包含目标智能合约的合约标识以及所述目标智能合约所处的目标区块链的链标识,其中,所述目标区块链已注册并部署到所述中间层服务器,所述目标智能合约已登记到所述中间层服务器;Receive a smart contract invocation request sent by the client, where the smart contract invocation request includes the contract identifier of the target smart contract and the chain identifier of the target blockchain where the target smart contract is located, wherein the target blockchain has been registered and deployed to the middle-tier server, and the target smart contract has been registered with the middle-tier server;
    根据所述合约标识查找所述目标智能合约的合约信息;Find the contract information of the target smart contract according to the contract identifier;
    基于所述合约信息和所述链标识,向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果;Based on the contract information and the chain identifier, initiate a smart contract execution request to the target blockchain, and obtain the execution result of the target smart contract;
    将所述目标智能合约的执行结果返回至所述客户端。Return the execution result of the target smart contract to the client.
  2. 如权利要求1所述的智能合约调用方法,其特征在于,基于所述合约信息和所述链标识,向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果,包括: The smart contract calling method according to claim 1, wherein based on the contract information and the chain identifier, a smart contract execution request is initiated to the target blockchain, and an execution result of the target smart contract is obtained ,include:
    激活与所述链标识对应的软件开发工具包;activate the software development kit corresponding to the chain identifier;
    调用激活后的所述软件开发工具包,以根据所述合约信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。The activated software development kit is invoked to initiate a smart contract execution request to the target blockchain according to the contract information, and obtain the execution result of the target smart contract.
  3. 如权利要求2所述的智能合约调用方法,其特征在于,所述智能合约调用请求还包含所述目标智能合约的属性信息,所述根据所述合约信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果,包括: The smart contract invocation method according to claim 2, wherein the smart contract invocation request further includes attribute information of the target smart contract, and the smart contract is initiated to the target blockchain according to the contract information. Execute the request and obtain the execution result of the target smart contract, including:
    通过所述合约信息和所述属性信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。A smart contract execution request is initiated to the target blockchain through the contract information and the attribute information, and the execution result of the target smart contract is obtained.
  4. 如权利要求3所述的智能合约调用方法,其特征在于,所述目标区块链为以太坊平台的区块链,所述合约信息包括所述目标智能合约的合约地址和接口描述文件,所述属性信息包括所述目标智能合约的合约函数名和函数调用参数,所述通过所述合约信息和所述属性信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果,包括: The method for invoking a smart contract according to claim 3, wherein the target blockchain is a blockchain of the Ethereum platform, and the contract information includes a contract address and an interface description file of the target smart contract. The attribute information includes the contract function name and function call parameters of the target smart contract, the smart contract execution request is initiated to the target blockchain through the contract information and the attribute information, and the data of the target smart contract is obtained. Execution results, including:
    结合所述合约地址、所述接口描述文件、所述合约函数名和所述函数调用参数向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。Initiate a smart contract execution request to the target blockchain in combination with the contract address, the interface description file, the contract function name and the function call parameters, and obtain the execution result of the target smart contract.
  5. 如权利要求3所述的智能合约调用方法,其特征在于,所述目标区块链为fabric平台的区块链,所述合约信息包括所述目标智能合约的合约名称,所述属性信息包括所述目标智能合约的合约函数名和函数调用参数,所述通过所述合约信息和所述属性信息向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果,包括: The smart contract calling method according to claim 3, wherein the target blockchain is a blockchain of a fabric platform, the contract information includes a contract name of the target smart contract, and the attribute information includes all The contract function name and function call parameters of the target smart contract, the smart contract execution request is initiated to the target blockchain through the contract information and the attribute information, and the execution result of the target smart contract is obtained, including:
    结合所述合约名称、所述合约函数名和所述函数调用参数向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果。A smart contract execution request is initiated to the target blockchain in combination with the contract name, the contract function name and the function call parameters, and the execution result of the target smart contract is obtained.
  6. 如权利要求1至5中任一项所述的智能合约调用方法,其特征在于,所述目标区块链通过以下步骤注册并部署到所述中间层服务器: The smart contract invocation method according to any one of claims 1 to 5, wherein the target blockchain is registered and deployed to the middle-tier server through the following steps:
    获取所述目标区块链的连接信息和相关文件;Obtain the connection information and related files of the target blockchain;
    根据所述连接信息和相关文件初始化与所述目标区块链的平台类型对应的软件开发工具包;Initialize a software development kit corresponding to the platform type of the target blockchain according to the connection information and related files;
    对初始化完成的所述软件开发工具包进行连通性测试;Connectivity testing is performed on the software development kit that has been initialized;
    若所述连通性测试通过,则将所述连接信息和相关文件存储至数据库,并为所述目标区块链分配一个链标识,从而将所述目标区块链注册并部署到所述中间层服务器。If the connectivity test passes, store the connection information and related files in a database, and assign a chain identifier to the target blockchain, so as to register and deploy the target blockchain to the middle layer server.
  7. 如权利要求6所述的智能合约调用方法,其特征在于,所述目标智能合约通过以下步骤登记到所述中间层服务器: The smart contract invocation method according to claim 6, wherein the target smart contract is registered to the middle-tier server through the following steps:
    将所述目标智能合约部署到所述目标区块链中,并获取所述目标智能合约的合约信息;deploying the target smart contract into the target blockchain, and obtaining contract information of the target smart contract;
    根据所述合约信息完成所述目标智能合约的登记,并为所述目标智能合约分配一个合约标识。The registration of the target smart contract is completed according to the contract information, and a contract identifier is allocated to the target smart contract.
  8. 一种区块链的智能合约调用装置,应用于中间层服务器,其特征在于,所述装置包括: A smart contract invocation device for blockchain, applied to a middle-tier server, characterized in that the device includes:
    合约调用请求接收模块,用于接收客户端发送的智能合约调用请求,所述智能合约调用请求包含目标智能合约的合约标识以及所述目标智能合约所处的目标区块链的链标识,其中,所述目标区块链已注册并部署到所述中间层服务器,所述目标智能合约已登记到所述中间层服务器;The contract invocation request receiving module is used to receive a smart contract invocation request sent by the client, where the smart contract invocation request includes the contract identifier of the target smart contract and the chain identifier of the target blockchain where the target smart contract is located, wherein, The target blockchain has been registered and deployed to the middle-tier server, and the target smart contract has been registered with the middle-tier server;
    合约信息查找模块,用于根据所述合约标识查找所述目标智能合约的合约信息;a contract information search module, configured to search for the contract information of the target smart contract according to the contract identifier;
    智能合约查找模块,用于基于所述合约信息和所述链标识,向所述目标区块链发起智能合约执行请求,并获取所述目标智能合约的执行结果;a smart contract search module, configured to initiate a smart contract execution request to the target blockchain based on the contract information and the chain identifier, and obtain the execution result of the target smart contract;
    智能合约返回模块,用于将所述目标智能合约的执行结果返回至所述客户端。The smart contract return module is used for returning the execution result of the target smart contract to the client.
  9. 一种服务器,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7中任一项所述的区块链的智能合约调用方法的步骤。 A server, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, when the processor executes the computer program, the implementation of claims 1 to 7 The steps of the smart contract calling method of the blockchain described in any one of the steps.
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7中任一项所述的区块链的智能合约调用方法的步骤。A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the blockchain according to any one of claims 1 to 7 is implemented The steps for the smart contract to call a method.
PCT/CN2020/142026 2020-12-21 2020-12-31 Smart contract calling method and apparatus for blockchains, server, and storage medium WO2022134186A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011543148.1A CN112631803A (en) 2020-12-21 2020-12-21 Intelligent contract calling method, device, server and storage medium for block chain
CN202011543148.1 2020-12-21

Publications (1)

Publication Number Publication Date
WO2022134186A1 true WO2022134186A1 (en) 2022-06-30

Family

ID=75321995

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/142026 WO2022134186A1 (en) 2020-12-21 2020-12-31 Smart contract calling method and apparatus for blockchains, server, and storage medium

Country Status (2)

Country Link
CN (1) CN112631803A (en)
WO (1) WO2022134186A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113312427B (en) * 2021-05-24 2023-04-28 网易(杭州)网络有限公司 Block chain calling method, device, management service platform and storage medium
CN113689188A (en) * 2021-08-23 2021-11-23 交通银行股份有限公司 Decentralization information management system and method based on Ether house intelligent contracts
CN113542435B (en) * 2021-09-15 2021-12-14 支付宝(杭州)信息技术有限公司 User service using method and device
CN113535335B (en) * 2021-09-15 2022-01-11 支付宝(杭州)信息技术有限公司 Virtual resource allocation method and device based on block chain and electronic equipment
CN113535690B (en) * 2021-09-15 2021-12-21 支付宝(杭州)信息技术有限公司 Block chain service network establishing method and device
CN115086394A (en) * 2022-06-15 2022-09-20 亚信科技(中国)有限公司 Service information processing method and device and electronic equipment
CN116975850B (en) * 2023-09-25 2024-01-05 腾讯科技(深圳)有限公司 Contract operation method, contract operation device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107526624A (en) * 2017-07-18 2017-12-29 杭州趣链科技有限公司 A kind of intelligent contract enforcement engine based on Java Virtual Machine
CN108510389A (en) * 2018-03-30 2018-09-07 深圳前海微众银行股份有限公司 Intelligent contract call method, equipment and readable storage medium storing program for executing based on block chain
CN109376541A (en) * 2018-09-21 2019-02-22 上海点融信息科技有限责任公司 For running the method, apparatus and computer storage medium of intelligent contract
CN110175032A (en) * 2019-01-17 2019-08-27 杭州趣链科技有限公司 A kind of High Availabitity block chain open platform and apply dissemination method
US20190377617A1 (en) * 2018-06-08 2019-12-12 Optum, Inc. Domain and event type-specific consensus process for a distributed ledger
CN111176791A (en) * 2019-12-31 2020-05-19 杭州趣链科技有限公司 Cross-virtual machine calling method based on multi-virtual machine blockchain platform

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107526624A (en) * 2017-07-18 2017-12-29 杭州趣链科技有限公司 A kind of intelligent contract enforcement engine based on Java Virtual Machine
CN108510389A (en) * 2018-03-30 2018-09-07 深圳前海微众银行股份有限公司 Intelligent contract call method, equipment and readable storage medium storing program for executing based on block chain
US20190377617A1 (en) * 2018-06-08 2019-12-12 Optum, Inc. Domain and event type-specific consensus process for a distributed ledger
CN109376541A (en) * 2018-09-21 2019-02-22 上海点融信息科技有限责任公司 For running the method, apparatus and computer storage medium of intelligent contract
CN110175032A (en) * 2019-01-17 2019-08-27 杭州趣链科技有限公司 A kind of High Availabitity block chain open platform and apply dissemination method
CN111176791A (en) * 2019-12-31 2020-05-19 杭州趣链科技有限公司 Cross-virtual machine calling method based on multi-virtual machine blockchain platform

Also Published As

Publication number Publication date
CN112631803A (en) 2021-04-09

Similar Documents

Publication Publication Date Title
WO2022134186A1 (en) Smart contract calling method and apparatus for blockchains, server, and storage medium
TWI709058B (en) Block chain-based smart contract calling method and device, and electronic equipment
CN111163129B (en) Resource processing method and device based on cross-link network
US11132278B2 (en) Application programming interface security validation for system integration testing
US10104011B2 (en) System and method for determination of partition identifiers in a multitenant application server environment
CN110324399B (en) Bringing cluster awareness into a facility management portal
US20230040803A1 (en) Software release verification
US9734311B1 (en) Secure authentication of firmware configuration updates
US20210097476A1 (en) Container Management Method, Apparatus, and Device
US11816458B2 (en) Method and system for packaging infrastructure as code
CN107844306B (en) Application program repairing method and device, storage medium and terminal
CN114531477B (en) Method and device for configuring functional components, computer equipment and storage medium
WO2023071424A1 (en) Electronic device
WO2023045509A1 (en) Fingerprint access method and apparatus, and device and storage medium
CN115544585A (en) Method, equipment, device and storage medium for dynamically configuring secure memory
CN114489939A (en) Component deployment method, system and computer readable medium
CN114610598A (en) Test method, test device, electronic equipment and computer readable storage medium
CN112527669A (en) Self-testing method and system for local service
WO2023092316A1 (en) Third-party service login method and apparatus, terminal device, and storage medium
CN111651469B (en) Method and device for managing blockchain system contracts
CN114143053A (en) Third-party service login method and device, terminal equipment and storage medium
CN115390939A (en) Service processing method and system
CN112130900B (en) User information management method, system, equipment and medium for BMC
CN114443215A (en) Service application deployment method and device, computer equipment and storage medium
CN109918147B (en) Expansion method and device for drive under OpenStack and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20966748

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20966748

Country of ref document: EP

Kind code of ref document: A1