WO2021042715A1 - 用于开发智能合约的系统、方法和装置 - Google Patents

用于开发智能合约的系统、方法和装置 Download PDF

Info

Publication number
WO2021042715A1
WO2021042715A1 PCT/CN2020/082672 CN2020082672W WO2021042715A1 WO 2021042715 A1 WO2021042715 A1 WO 2021042715A1 CN 2020082672 W CN2020082672 W CN 2020082672W WO 2021042715 A1 WO2021042715 A1 WO 2021042715A1
Authority
WO
WIPO (PCT)
Prior art keywords
smart contract
interface
client
server
target
Prior art date
Application number
PCT/CN2020/082672
Other languages
English (en)
French (fr)
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 北京海益同展信息科技有限公司
Priority to JP2022503963A priority Critical patent/JP7298008B2/ja
Priority to EP20860135.1A priority patent/EP4027242A4/en
Priority to US17/637,907 priority patent/US20220278860A1/en
Publication of WO2021042715A1 publication Critical patent/WO2021042715A1/zh

Links

Images

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • 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

Definitions

  • the embodiments of the present disclosure relate to the field of computer technology, and in particular to systems, methods, and devices for developing smart contracts.
  • Blockchain is a distributed accounting mechanism based on computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • the smart contract in the blockchain technology is a software program that runs on the blockchain platform and is interpreted and executed by the smart contract virtual machine.
  • a smart contract can be understood as a set of commitments defined in digital form, including agreements on which contract participants can execute these commitments.
  • the smart contract development interface of the blockchain platform is usually in the paradigm of process programming.
  • the embodiments of the present disclosure propose systems, methods, and devices for developing smart contracts.
  • the embodiments of the present disclosure provide a system for developing smart contracts.
  • the system includes: a protocol acquisition module configured to obtain a target smart contract interface protocol, wherein the target smart contract interface protocol is used to define the target Smart contract interface; client development module, configured to generate smart contract client interface and smart contract client proxy based on the target smart contract interface specification, where the smart contract client interface is the client used to define the target smart contract interface Define the information, the smart contract client agent is used to implement the smart contract client interface, the smart contract client interface and the smart contract client agent are used to build the client smart contract application; the server development module is configured to be based on the target smart contract interface Protocol, generate a smart contract server interface and a smart contract server skeleton, where the smart contract server interface is the server definition information used to define the target smart contract interface, and the smart contract server skeleton is used to establish the smart contract client interface and The connection between the smart contract server interface, the smart contract server interface and the smart contract server skeleton are used to construct the server smart contract.
  • the protocol obtaining module is further configured to obtain the target smart contract interface protocol of the target smart contract interface by using a predetermined smart contract interface protocol template.
  • the client-side definition information and the server-side definition information include information used to characterize the association relationship between the target smart contract interface and the target blockchain.
  • the system further includes: a test module configured to use the target test case to test the constructed client-side smart contract application and the server-side smart contract, wherein the target test case is based on the smart contract client interface And smart contract client agent generation.
  • the embodiments of the present disclosure provide a method for developing a client-side smart contract application.
  • the method includes: obtaining a target smart contract interface specification sent by a protocol acquisition module, wherein the target smart contract interface specification is used to define Target smart contract interface; based on the target smart contract interface specification, generate a smart contract client interface and a smart contract client proxy, where the smart contract client interface is the client definition information used to define the target smart contract interface, and the smart contract client The proxy is used to implement the smart contract client interface, and the smart contract client interface and the smart contract client proxy are used to build client smart contract applications.
  • the client definition information includes information used to characterize the association relationship between the target smart contract interface and the target blockchain.
  • the embodiments of the present disclosure provide a method for developing a server-side smart contract.
  • the method includes: obtaining a target smart contract interface specification sent by a protocol acquisition module, wherein the target smart contract interface specification is used to define the target Smart contract interface; based on the target smart contract interface specification, generate a smart contract server interface and a smart contract server skeleton, where the smart contract server interface is the server definition information used to define the target smart contract interface, and the smart contract server skeleton It is used to establish the connection between the smart contract client interface and the smart contract server interface.
  • the smart contract server interface and the smart contract server skeleton are used to construct the server smart contract.
  • the server definition information includes information used to characterize the association relationship between the target smart contract interface and the target blockchain.
  • the embodiments of the present disclosure provide a device for developing a client-side smart contract application, the device comprising: a first obtaining unit configured to obtain the target smart contract interface protocol sent by the protocol obtaining module, wherein, The target smart contract interface specification is used to define the target smart contract interface; the first generation unit is configured to generate a smart contract client interface and a smart contract client proxy based on the target smart contract interface specification, where the smart contract client interface is used To define the client-side definition information of the target smart contract interface, the smart contract client agent is used to implement the smart contract client interface, and the smart contract client interface and the smart contract client agent are used to build the client-side smart contract application.
  • the embodiments of the present disclosure provide a device for developing a server-side smart contract.
  • the device includes: a second obtaining unit configured to obtain the target smart contract interface protocol sent by the protocol obtaining module, wherein the target The smart contract interface specification is used to define the target smart contract interface; the second generation unit is configured to generate the smart contract server interface and the smart contract server skeleton based on the target smart contract interface specification, where the smart contract server interface is used for Define the server definition information of the target smart contract interface.
  • the smart contract server skeleton is used to establish the connection between the smart contract client interface and the smart contract server interface.
  • the smart contract server interface and the smart contract server skeleton are used to build the service End smart contract.
  • embodiments of the present disclosure provide an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, when one or more programs are processed by one or more The processor executes, so that one or more processors implement the method of any one of the methods described in the second aspect and the third aspect.
  • the embodiments of the present disclosure provide a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, it implements any one of the methods described in the second and third aspects. Methods.
  • the system, method, and device for developing smart contracts obtained by the embodiments of the present disclosure obtain the target smart contract interface specification through the protocol acquisition module, where the target smart contract interface specification is used to define the target smart contract interface, and then the client develops the module Based on the target smart contract interface specification, a smart contract client interface and a smart contract client proxy are generated, where the smart contract client interface is the client definition information used to define the target smart contract interface, and the smart contract client proxy is used to implement smart
  • the contract client interface, smart contract client interface and smart contract client agent are used to build client smart contract applications, and the server development module generates smart contract server interfaces and smart contract server skeletons based on the target smart contract interface specifications.
  • the smart contract server interface is the server definition information used to define the target smart contract interface
  • the smart contract server skeleton is used to establish the connection between the smart contract client interface and the smart contract server interface
  • the smart contract server interface and the smart contract server interface
  • the smart contract server-side skeleton is used to construct the server-side smart contract, which can realize the interface-oriented smart contract development based on the smart contract client interface and the smart contract server interface, which helps to simplify the process of smart contract development and obtain easy maintenance
  • client-side smart contract applications and server-side smart contracts can be developed separately, which further simplifies the process of smart contract development and improves the efficiency of smart contract development.
  • Figure 1 is an exemplary system architecture diagram to which the present application can be applied;
  • Figure 2 is a sequence diagram of an embodiment of the system for developing smart contracts according to the present application.
  • Figure 3 is a schematic diagram of an application scenario of the system for developing smart contracts according to the present application.
  • Fig. 4 is a flowchart of an embodiment of a method for developing a client-side smart contract application according to the present application
  • Fig. 5 is a flowchart of an embodiment of a method for developing a server-side smart contract according to the present application
  • Fig. 6 is a schematic structural diagram of an embodiment of an apparatus for developing client-side smart contract applications according to the present application
  • Fig. 7 is a schematic structural diagram of an embodiment of an apparatus for developing a server-side smart contract according to the present application.
  • FIG. 8 is a schematic structural diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present application.
  • Figure 1 shows a system for developing smart contracts, a method for developing client-side smart contracts, a method for developing server-side smart contracts, a device for developing client-side smart contracts, or a device for developing smart contracts on the client side to which the present disclosure can be applied.
  • the system architecture 100 may include a protocol acquisition module 101, a network 102, a client development module 103, and a server development module 104.
  • the network 102 is used to provide a medium for communication links between the protocol acquisition module 101 and the client development module 103 and between the protocol acquisition module 101 and the server development module 104.
  • the network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, and so on.
  • the client developer can use the client development module 103 to interact with the protocol acquisition module 101 through the network 102 to receive the smart contract interface protocol sent by the protocol acquisition module 101.
  • server-side developers can use the server-side development module 104 to interact with the protocol acquisition module 101 through the network 102 to receive the smart contract interface protocol sent by the protocol acquisition module 101.
  • the protocol acquisition module 101 may be hardware or software.
  • the protocol acquisition module 101 can be various electronic devices with the function of acquiring the smart contract interface protocol, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and so on.
  • the protocol acquisition module 101 is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, multiple software or software modules for providing distributed services), or as a single software or software module. There is no specific limitation here.
  • the client development module 103 may be hardware or software. When the client development module 103 is hardware, it can be various electronic devices with software development functions, including but not limited to laptop computers and desktop computers. When the client development module 103 is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, multiple software or software modules for providing distributed services), or as a single software or software module. There is no specific limitation here.
  • the server development module 104 may be hardware or software.
  • the server development module 104 can be various electronic devices with software development functions, including but not limited to laptop computers and desktop computers.
  • the server development module 104 is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, multiple software or software modules for providing distributed services), or as a single software or software module. There is no specific limitation here.
  • the protocol acquisition module 101, the client development module 103, and the server development module 104 are all software, the three can be installed in the same electronic device (such as a laptop or desktop computer).
  • the method for developing client-side smart contract applications provided by the embodiments of the present disclosure is generally executed by the client-side development module 103. Accordingly, the device for developing client-side smart contract applications is generally set on the client side. In the development module 103.
  • the method for developing a server-side smart contract provided by the embodiments of the present disclosure is generally executed by the server-side development module 104. Accordingly, the device for developing a server-side smart contract is generally set in the server-side development module 104.
  • protocol acquisition modules networks, client-side development modules, and server-side development modules in FIG. 1 is only illustrative. According to implementation needs, there can be any number of protocol acquisition modules, networks, client-side development modules, and server-side development modules.
  • FIG. 2 shows a sequence diagram 200 of an embodiment of the system for developing smart contracts according to the present application.
  • the system for developing smart contracts in the embodiments of the present application may include a protocol acquisition module configured to obtain a target smart contract interface protocol, where the target smart contract interface protocol is used to define the target smart contract interface;
  • the client development module is It is configured to generate a smart contract client interface and a smart contract client proxy based on the target smart contract interface specification, where the smart contract client interface is the client definition information used to define the target smart contract interface, and the smart contract client proxy is used for Realize the smart contract client interface, the smart contract client interface and smart contract client agent are used to build the client smart contract application;
  • the server development module is configured to generate the smart contract server interface and smart based on the target smart contract interface specification
  • the contract server skeleton where the smart contract server interface is the server definition information used to define the target smart contract interface, and the smart contract server skeleton is used to establish the connection between the smart contract client interface and the smart contract server interface.
  • the smart contract server interface and the smart contract server skeleton are used to construct the server smart contract.
  • the protocol obtaining module obtains the target smart contract interface protocol.
  • the protocol obtaining module (for example, the protocol obtaining module 101 shown in FIG. 1) can obtain the target smart contract interface protocol locally or remotely through a wired connection or a wireless connection.
  • the target smart contract interface specification is used to define the target smart contract interface.
  • the target smart contract interface may be the interface of the smart contract to be developed, which is used to realize the interaction between the smart contract to be developed and the nodes in the target blockchain.
  • the target blockchain may be the blockchain to which the smart contract to be developed belongs.
  • the target smart contract interface specification may include information used to define the interface method, interface data, etc. of the target smart contract interface.
  • the target smart contract interface is the fund depository interface.
  • the target smart contract interface specification may include information used to define the two interface methods of account opening and transfer, and may also include information used to define interface data such as user names and passwords.
  • the information used to define the target smart contract interface included in the target smart contract interface specification may be the information determined by the developer.
  • the protocol acquisition module can obtain the target smart contract interface protocol based on the information determined by the developer.
  • the protocol acquisition module may be further configured to use a predetermined smart contract interface protocol template to obtain the target smart contract interface protocol of the target smart contract interface.
  • the smart contract interface specification template can be a predetermined template used to obtain the smart contract interface specification.
  • the developer can enter the information used to define the target smart contract interface in the smart contract interface specification template to obtain the target smart contract interface Statute.
  • the smart contract interface template may include interface method items. The developer can enter account opening and transfer in the interface method item, and then obtain the target smart contract based on the information input by the developer to define the interface method of the target smart contract interface Interface protocol.
  • This implementation method uses the smart contract interface protocol template, which can simplify the steps for obtaining the target smart contract interface protocol, and help improve the efficiency of smart contract development.
  • step 202 the protocol acquisition module sends the target smart contract interface protocol to the client development module.
  • the protocol obtaining module may send the target smart contract interface protocol to the client development module (for example, the client development module 103 shown in FIG. 1).
  • the client development module generates a smart contract client interface and a smart contract client proxy based on the target smart contract interface specification.
  • the client development module can generate a smart contract client interface and a smart contract client proxy based on the target smart contract interface specification.
  • the smart contract client interface can be the client definition information used to define the target smart contract interface.
  • the client definition information may include information defining the target smart contract interface in a programming language supported by the client.
  • the smart contract client agent can be used to implement the smart contract client interface.
  • the smart contract client interface and smart contract client proxy can be used to build client smart contract applications.
  • the client development module can use a predetermined smart contract client framework to generate smart contract client interfaces and smart contract client agents.
  • the smart contract client framework may be a predetermined framework, which may include basic functions for the client to access the smart contract based on an interface.
  • the client development module can be based on the smart contract client framework to convert the target smart contract interface specification into the language supported by the client, and then generate the smart contract client interface.
  • the client development module can combine functions in the smart contract client framework that are used to implement the smart contract client interface to obtain a smart contract client agent.
  • the client definition information may also include information used to characterize the association relationship between the target smart contract interface and the target blockchain.
  • the association relationship between the target smart contract interface and the target blockchain may refer to the association relationship between the transaction generated through the target smart contract interface and the target blockchain.
  • developers can encapsulate the block number and transaction confirmation time of the transaction corresponding to the target smart contract interface (that is, the transaction generated through the target smart contract interface) in the target blockchain into the smart contract client interface , And then obtain client-side definition information including information that characterizes the association relationship between the target smart contract interface and the target blockchain.
  • This implementation method helps to develop a more comprehensive client-side smart contract application by expanding the blockchain-related information of the target smart contract interface in the smart contract client interface; and, in the process of generating the smart contract client interface , Encapsulating information related to the blockchain can simplify the subsequent process of developing client-side smart contract applications based on the smart contract client-side interface, and improve the development efficiency of client-side smart contract applications.
  • step 204 the protocol acquisition module sends the target smart contract interface protocol to the server development module.
  • the protocol obtaining module may send the target smart contract interface protocol to the server development module (for example, the server development module 104 shown in FIG. 1).
  • step 204 can be executed synchronously with the above step 202, or it can be executed before or after step 202 is executed.
  • the execution order of step 202 and step 204 described in this embodiment should not be regarded as a specific implementation of this application. Way restrictions.
  • step 204 can be executed synchronously with step 202
  • step 205 can also be executed synchronously with the aforementioned step 203, or step 205 can be executed before or after the aforementioned step 203; in step 204, it can be executed at step 202.
  • step 205 can also be executed before or after step 203 is executed, or step 205 and step 203 can be executed synchronously; in the case that step 204 can be executed after step 202 is executed, the following step 205 can also be executed. It can be executed before or after step 203 is executed, or step 205 and step 203 are executed synchronously. That is, the application does not limit the specific execution order of step 203 and step 205. It is only necessary that step 203 is executed after step 202 and step 205 is executed after step 202. Execute after step 204.
  • step 205 the server development module generates a smart contract server interface and a smart contract server skeleton based on the target smart contract interface specification.
  • the server development module can generate a smart contract server interface and a smart contract server skeleton based on the target smart contract interface specification.
  • the smart contract server interface may be the server definition information used to define the target smart contract interface.
  • the server definition information may include information defining the target smart contract interface in a programming language supported by the server.
  • the smart contract server skeleton can be used to establish the connection between the smart contract client interface and the smart contract server interface. Specifically, it can be used to provide routing and routing of smart contract requests sent through the smart contract client interface to the smart contract server interface. adaptation.
  • the smart contract server interface and the smart contract server skeleton can be used to construct a server smart contract.
  • the server development module can use a predetermined smart contract server framework to generate a smart contract server interface and a smart contract server skeleton.
  • the smart contract server-side framework may be a predetermined framework, which may include the basic functions of the server-side accessing the smart contract based on the interface.
  • the server-side development module can be based on the smart contract server-side framework to convert the target smart contract interface specification into a language supported by the server-side, and then generate the smart contract server-side interface.
  • the server development module can combine functions in the smart contract server framework for routing and adapting the smart contract client interface to the smart contract server interface to obtain the smart contract server skeleton.
  • the server definition information may also include information used to characterize the association relationship between the target smart contract interface and the target blockchain.
  • developers can encapsulate the block number and transaction confirmation time of the transaction corresponding to the target smart contract interface (that is, the transaction generated through the target smart contract interface) in the target blockchain into the smart contract server interface , And then obtain server-side definition information including information that characterizes the association relationship between the target smart contract interface and the target blockchain.
  • This implementation method helps to develop a more comprehensive server-side smart contract by expanding the blockchain-related information of the target smart contract interface in the smart contract server-side interface; and, in the process of generating the smart contract server-side interface, Encapsulating information related to the blockchain can simplify the subsequent development of server-side smart contracts based on the smart contract server-side interface, and improve the efficiency of server-side smart contract development.
  • the above-mentioned system for developing smart contracts may further include: a test module (not shown in the figure), configured to use target test cases to intelligently monitor the constructed client Contract applications and server-side smart contracts are tested.
  • target test cases can be generated based on smart contract client interfaces and smart contract client agents.
  • developers can use existing software development tools to determine target test cases based on smart contract client interfaces and smart contract client agents.
  • a target test case is equivalent to a smart contract request.
  • the client smart contract application can request the smart contract from the server smart contract, and then the client smart can be determined based on the information fed back from the server smart contract.
  • the status of contract applications and server-side smart contracts to implement functional testing of client-side smart contract applications and server-side smart contracts.
  • FIG. 3 is a schematic diagram of an application scenario of the system for developing smart contracts according to this embodiment.
  • the protocol obtaining module 301 may first obtain the target smart contract interface protocol 302, where the target smart contract interface protocol 302 is used to define the target smart contract interface. Then, the protocol acquisition module 301 can send the target smart contract interface protocol 302 to the client development module 303 and the server development module 304 respectively.
  • the client development module 303 can generate a smart contract client interface 305 and a smart contract client proxy 306 based on the received target smart contract interface specification 302, where the smart contract client interface 305 is used to define the target smart contract interface
  • the smart contract client agent 306 is used to implement the smart contract client interface, and the smart contract client interface 305 and the smart contract client agent 306 are used to build client smart contract applications.
  • the server development module 304 can generate a smart contract server interface 307 and a smart contract server skeleton 308 based on the received target smart contract interface specification 302, where the smart contract server interface 307 is used to define the target smart contract interface
  • the server definition information of the smart contract, the smart contract server skeleton 308 is used to establish the connection between the smart contract client interface and the smart contract server interface, and the smart contract server interface 307 and the smart contract server skeleton 308 are used to build server intelligence contract.
  • the method provided by the above-mentioned embodiments of the present disclosure can implement interface-oriented smart contract development based on the smart contract client interface and the smart contract server interface, which helps simplify the process of smart contract development and obtain smart contracts that are easy to maintain; and, Based on the smart contract interface protocol, client-side smart contract applications and server-side smart contracts can be developed separately, which further simplifies the process of smart contract development and improves the efficiency of smart contract development.
  • a process 400 of one embodiment of the method for developing a client-side smart contract application according to the present disclosure is shown.
  • the method for developing client-side smart contract applications includes the following steps:
  • Step 401 Obtain the target smart contract interface protocol sent by the protocol acquisition module.
  • the executor of the method for developing client-side smart contract applications can obtain the protocol acquisition module (for example, as shown in FIG. 1) through a wired connection or a wireless connection.
  • the illustrated protocol obtains the target smart contract interface protocol sent by the module 101).
  • the target smart contract interface specification is used to define the target smart contract interface.
  • the target smart contract interface may be the interface of the smart contract to be developed, which is used to realize the interaction between the smart contract to be developed and the nodes in the target blockchain.
  • the target blockchain may be the blockchain to which the smart contract to be developed belongs.
  • Step 402 Generate a smart contract client interface and a smart contract client proxy based on the target smart contract interface specification.
  • the above-mentioned execution subject can generate a smart contract client interface and a smart contract client proxy.
  • the smart contract client interface can be the client definition information used to define the target smart contract interface.
  • the client definition information may include information defining the target smart contract interface in a programming language supported by the client.
  • the smart contract client agent can be used to implement the smart contract client interface.
  • the smart contract client interface and smart contract client proxy can be used to build client smart contract applications.
  • the client definition information may also include information used to characterize the association relationship between the target smart contract interface and the target blockchain.
  • the execution subject in the embodiment corresponding to FIG. 4 may have the same characteristics as the client development module in the above-mentioned system for developing smart contracts. Therefore, the embodiment corresponding to FIG. 4 may be the same as the above The characteristics of the client development module in the system for developing smart contracts are combined to form a new technical solution. To avoid repetition, I won't repeat it here.
  • the method for developing client-side smart contract applications obtains the target smart contract interface specification, where the target smart contract interface specification is used to define the target smart contract interface, and then generates based on the target smart contract interface specification Smart contract client interface and smart contract client agent, where the smart contract client interface is the client definition information used to define the target smart contract interface, the smart contract client agent is used to implement the smart contract client interface, and the smart contract client
  • the client interface and smart contract client agent are used to build client smart contract applications, so that interface-oriented client smart contract application development can be realized based on the smart contract client interface, which helps to simplify the process of client smart contract application development. Obtain a client-side smart contract application that is easy to maintain.
  • FIG. 5 shows a process 500 of an embodiment of a method for developing a server-side smart contract.
  • the process 500 of the method for developing a server-side smart contract includes the following steps:
  • Step 501 Obtain the target smart contract interface protocol sent by the protocol acquisition module.
  • the execution subject of the method for developing a server-side smart contract can obtain the target smart contract interface sent by the protocol acquisition module through a wired connection or a wireless connection.
  • the target smart contract interface specification is used to define the target smart contract interface.
  • the target smart contract interface may be the interface of the smart contract to be developed, which is used to realize the interaction between the smart contract to be developed and the nodes in the target blockchain.
  • the target blockchain can be the blockchain to which the smart contract to be developed belongs
  • Step 502 Generate a smart contract server interface and a smart contract server skeleton based on the target smart contract interface specification.
  • the above-mentioned execution subject can generate a smart contract server interface and a smart contract server skeleton.
  • the smart contract server interface may be the server definition information used to define the target smart contract interface.
  • the server definition information may include information defining the target smart contract interface in a programming language supported by the server.
  • the smart contract server skeleton can be used to establish the connection between the smart contract client interface and the smart contract server interface. Specifically, it can be used to provide routing and routing of smart contract requests sent through the smart contract client interface to the smart contract server interface. adaptation.
  • the smart contract server interface and the smart contract server skeleton can be used to construct a server smart contract.
  • the server definition information may also include information used to characterize the association relationship between the target smart contract interface and the target blockchain.
  • the execution subject in the embodiment corresponding to FIG. 5 may have the same characteristics as the server-side development module in the above-mentioned system for developing smart contracts. Therefore, the embodiment corresponding to FIG. 5 may be the same as the above
  • the features of the server-side development module in the system for developing smart contracts are combined to form a new technical solution. To avoid repetition, I won't repeat it here.
  • the method for developing server-side smart contracts obtains the target smart contract interface specification, wherein the target smart contract interface specification is used to define the target smart contract interface, and then based on the target smart contract interface specification, the smart contract is generated
  • the contract server interface and the smart contract server skeleton where the smart contract server interface is the server definition information used to define the target smart contract interface, and the smart contract server skeleton is used to establish the smart contract client interface and the smart contract server
  • the connection between the interfaces, the smart contract server interface and the smart contract server skeleton are used to construct the server smart contract, so that the interface-oriented server smart contract development can be realized based on the smart contract server interface, which helps to simplify the server
  • a server-side smart contract application that is easy to maintain is obtained.
  • the present disclosure provides an embodiment of a device for developing client-side smart contract applications, which is similar to the method embodiment shown in FIG. 4
  • the device can be specifically applied to various electronic devices.
  • the apparatus 600 for developing a client-side smart contract application in this embodiment includes: a first acquiring unit 601 and a first generating unit 602.
  • the first obtaining unit 601 is configured to obtain the target smart contract interface protocol sent by the protocol obtaining module, where the target smart contract interface protocol is used to define the target smart contract interface; the first generating unit 602 is configured to be based on the target smart contract interface
  • the protocol generates a smart contract client interface and a smart contract client proxy.
  • the smart contract client interface is the client definition information used to define the target smart contract interface, and the smart contract client proxy is used to implement the smart contract client interface.
  • the smart contract client interface and smart contract client proxy are used to build client smart contract applications.
  • the first obtaining unit 601 may obtain the target smart contract interface protocol sent by the protocol obtaining module (for example, the protocol obtaining module 101 shown in FIG. 1) through a wired connection or a wireless connection.
  • the target smart contract interface specification is used to define the target smart contract interface.
  • the target smart contract interface may be the interface of the smart contract to be developed, which is used to realize the interaction between the smart contract to be developed and the nodes in the target blockchain.
  • the target blockchain may be the blockchain to which the smart contract to be developed belongs.
  • the first generating unit 602 may generate a smart contract client interface and a smart contract client proxy.
  • the smart contract client interface can be the client definition information used to define the target smart contract interface.
  • the client definition information may include information defining the target smart contract interface in a programming language supported by the client.
  • Smart contract client agent can be used to implement smart contract client interface.
  • the smart contract client interface and smart contract client proxy can be used to build client smart contract applications.
  • the client definition information may also include information used to characterize the association relationship between the target smart contract interface and the target blockchain.
  • the device 600 provided by the above-mentioned embodiments of the present disclosure can implement interface-oriented client-side smart contract application development based on the smart contract client interface, which helps simplify the process of client-side smart contract application development and obtain easy-to-maintain client smart contracts application.
  • the present disclosure provides an embodiment of a device for developing a server-side smart contract.
  • the device embodiment is similar to the method embodiment shown in FIG. 5.
  • the device can be specifically applied to various electronic devices.
  • the apparatus 700 for developing a server-side smart contract in this embodiment includes: a second acquiring unit 701 and a second generating unit 702.
  • the second obtaining unit 701 is configured to obtain the target smart contract interface protocol sent by the protocol obtaining module, where the target smart contract interface protocol is used to define the target smart contract interface; the second generating unit 702 is configured to be based on the target smart contract interface
  • the protocol generates the smart contract server interface and the smart contract server skeleton.
  • the smart contract server interface is the server definition information used to define the target smart contract interface, and the smart contract server skeleton is used to establish the smart contract client interface and The connection between the smart contract server interface, the smart contract server interface and the smart contract server skeleton are used to construct the server smart contract.
  • the second obtaining unit 701 may obtain the target smart contract interface protocol sent by the protocol obtaining module through a wired connection or a wireless connection.
  • the target smart contract interface specification is used to define the target smart contract interface.
  • the target smart contract interface can be the interface of the smart contract to be developed, which is used to realize the interaction between the smart contract to be developed and the nodes in the target blockchain.
  • the target blockchain can be the blockchain to which the smart contract to be developed belongs
  • the second generating unit 702 may generate a smart contract server interface and a smart contract server skeleton.
  • the smart contract server interface may be the server definition information used to define the target smart contract interface.
  • the server definition information may include information defining the target smart contract interface in a programming language supported by the server.
  • the smart contract server skeleton can be used to establish the connection between the smart contract client interface and the smart contract server interface. Specifically, it can be used to provide routing and routing of smart contract requests sent through the smart contract client interface to the smart contract server interface. adaptation.
  • the smart contract server interface and the smart contract server skeleton can be used to construct a server smart contract.
  • the server definition information may also include information used to characterize the association relationship between the target smart contract interface and the target blockchain.
  • the units recorded in the device 700 correspond to the steps in the method described with reference to FIG. 5. Therefore, the operations, features, and beneficial effects produced by the method described above are also applicable to the device 700 and the units contained therein, and will not be repeated here.
  • the device 700 provided by the above-mentioned embodiment of the present disclosure can implement interface-oriented server-side smart contract development based on the smart contract server-side interface, which helps to simplify the process of server-side smart contract application development and obtain easy-to-maintain server-side smart contract applications .
  • FIG. 8 shows a schematic structural diagram of an electronic device (for example, the client development module 103 or the server development module 104 in FIG. 1) 800 suitable for implementing the embodiments of the present disclosure.
  • the electronic device shown in FIG. 8 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
  • the electronic device 800 may include a processing device (such as a central processing unit, a graphics processor, etc.) 801, which may be loaded into a random access device according to a program stored in a read-only memory (ROM) 802 or from a storage device 808
  • the program in the memory (RAM) 803 executes various appropriate actions and processing.
  • various programs and data required for the operation of the electronic device 800 are also stored.
  • the processing device 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804.
  • An input/output (I/O) interface 805 is also connected to the bus 804.
  • the following devices can be connected to the I/O interface 805: including input devices 806 such as keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including output devices such as liquid crystal display (LCD), speakers, vibrators, etc. 807; including storage devices 808 such as magnetic tapes, hard disks, etc.; and communication devices 809.
  • the communication device 809 may allow the electronic device 800 to perform wireless or wired communication with other devices to exchange data.
  • FIG. 8 shows an electronic device 800 having various devices, it should be understood that it is not required to implement or have all of the illustrated devices. It may alternatively be implemented or provided with more or fewer devices.
  • an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network through the communication device 809, or installed from the storage device 808, or installed from the ROM 802.
  • the processing device 801 the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
  • the computer-readable medium described in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable removable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
  • the computer-readable signal medium may send, propagate or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains the target smart contract interface protocol sent by the acquisition module, wherein the target smart contract interface The protocol is used to define the target smart contract interface; based on the target smart contract interface protocol, a smart contract client interface and a smart contract client proxy are generated, where the smart contract client interface is the client definition information used to define the target smart contract interface, The smart contract client agent is used to implement the smart contract client interface, and the smart contract client interface and the smart contract client agent are used to build client smart contract applications.
  • the electronic device when one or more of the above programs are executed by the electronic device, the electronic device is caused to: obtain the target smart contract interface specification sent by the protocol acquisition module, where the target smart contract interface specification is used to define the target smart contract interface; based on the target The smart contract interface specification generates a smart contract server interface and a smart contract server skeleton.
  • the smart contract server interface is the server definition information used to define the target smart contract interface, and the smart contract server skeleton is used to establish smart contract clients The connection between the smart contract server interface and the smart contract server interface.
  • the smart contract server interface and the smart contract server skeleton are used to construct the server smart contract.
  • the computer program code used to perform the operations of the present disclosure can be written in one or more programming languages or a combination thereof.
  • the programming languages include object-oriented programming languages—such as Java, Smalltalk, C++, and also conventional The procedural programming language-such as "C" language or similar programming language.
  • the program code can be executed entirely on the user's computer, partly on the user's computer, executed as an independent software package, partly on the user's computer and partly executed on a remote computer, or entirely executed on the remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to pass Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service provider for example, using an Internet service provider to pass Internet connection.
  • each block in the flowchart or block diagram may represent a module, program segment, or part of code, and the module, program segment, or part of code contains one or more for realizing the specified logical function Executable instructions.
  • the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two blocks shown in succession can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or operations Or it can be realized by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present disclosure can be implemented in software or hardware. Among them, the name of the unit does not constitute a limitation on the unit itself under certain circumstances.
  • the first obtaining unit can also be described as "a unit for obtaining the target smart contract interface specification.”

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Databases & Information Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Stored Programmes (AREA)

Abstract

本公开的实施例公开了用于开发智能合约的系统、方法和装置。该系统的一具体实施方式包括:规约获取模块,被配置成获取目标智能合约接口规约;客户端开发模块,被配置成基于目标智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理,其中,智能合约客户端接口和智能合约客户端代理用于构建客户端智能合约应用;服务端开发模块,被配置成基于目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架,其中,智能合约服务端接口和智能合约服务端骨架用于构建服务端智能合约。该实施方式有助于简化智能合约开发的过程,获得便于维护的智能合约。

Description

用于开发智能合约的系统、方法和装置
本专利申请要求于2019年9月4日提交的、申请号为201910832970.0、申请人为北京海益同展信息科技有限公司、发明名称为“用于开发智能合约的系统、方法和装置”的中国专利申请的优先权,该申请的全文以引用的方式并入本申请中。
技术领域
本公开的实施例涉及计算机技术领域,尤其涉及用于开发智能合约的系统、方法和装置。
背景技术
区块链是基于分布式数据存储、点对点传输、共识机制、加密算法等计算机技术产生的分布式记账机制。区块链技术中的智能合约是运行在区块链平台中的、由智能合约虚拟机解释执行的软件程序。实践中,可以将一个智能合约理解为一套以数字形式定义的承诺,包括合约参与方可以在上面执行这些承诺的协议。
目前,区块链平台的智能合约开发接口通常是过程编程范式的。
发明内容
本公开的实施例提出了用于开发智能合约的系统、方法和装置。
第一方面,本公开的实施例提供了一种用于开发智能合约的系统,该系统包括:规约获取模块,被配置成获取目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;客户端开发模块,被配置成基于目标智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理,其中,智能合约客户端接口为用于定义目标智能合约接口的客户端定义信息,智能合约客户端代理用于实现智能合约客户端接口,智能合约客户端接口和智能合约客户端代理用于构建客户端智能合约应用;服务端开发模块,被配置成基于目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架, 其中,智能合约服务端接口为用于定义目标智能合约接口的服务端定义信息,智能合约服务端骨架用于建立智能合约客户端接口与智能合约服务端接口之间的联系,智能合约服务端接口和智能合约服务端骨架用于构建服务端智能合约。
在一些实施例中,规约获取模块进一步被配置成:利用预先确定的智能合约接口规约模板,获取目标智能合约接口的目标智能合约接口规约。
在一些实施例中,客户端定义信息和服务端定义信息包括用于表征目标智能合约接口与目标区块链的关联关系的信息。
在一些实施例中,该系统还包括:测试模块,被配置成利用目标测试用例,对所构建的客户端智能合约应用和服务端智能合约进行测试,其中,目标测试用例基于智能合约客户端接口和智能合约客户端代理生成。
第二方面,本公开的实施例提供了一种用于开发客户端智能合约应用的方法,该方法包括:获取规约获取模块发送的目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;基于目标智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理,其中,智能合约客户端接口为用于定义目标智能合约接口的客户端定义信息,智能合约客户端代理用于实现智能合约客户端接口,智能合约客户端接口和智能合约客户端代理用于构建客户端智能合约应用。
在一些实施例中,客户端定义信息包括用于表征目标智能合约接口与目标区块链的关联关系的信息。
第三方面,本公开的实施例提供了一种用于开发服务端智能合约的方法,该方法包括:获取规约获取模块发送的目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;基于目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架,其中,智能合约服务端接口为用于定义目标智能合约接口的服务端定义信息,智能合约服务端骨架用于建立智能合约客户端接口与智能合约服务端接口之间的联系,智能合约服务端接口和智能合约服 务端骨架用于构建服务端智能合约。
在一些实施例中,服务端定义信息包括用于表征目标智能合约接口与目标区块链的关联关系的信息。
第四方面,本公开的实施例提供了一种用于开发客户端智能合约应用的装置,该装置包括:第一获取单元,被配置成获取规约获取模块发送的目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;第一生成单元,被配置成基于目标智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理,其中,智能合约客户端接口为用于定义目标智能合约接口的客户端定义信息,智能合约客户端代理用于实现智能合约客户端接口,智能合约客户端接口和智能合约客户端代理用于构建客户端智能合约应用。
第五方面,本公开的实施例提供了一种用于开发服务端智能合约的装置,该装置包括:第二获取单元,被配置成获取规约获取模块发送的目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;第二生成单元,被配置成基于目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架,其中,智能合约服务端接口为用于定义目标智能合约接口的服务端定义信息,智能合约服务端骨架用于建立智能合约客户端接口与智能合约服务端接口之间的联系,智能合约服务端接口和智能合约服务端骨架用于构建服务端智能合约。
第六方面,本公开的实施例提供了一种电子设备,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现上述第二方面和第三方面所描述的方法中任一实施例的方法。
第七方面,本公开的实施例提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理器执行时实现上述第二方面和第三方面所描述的方法中任一实施例的方法。
本公开的实施例提供的用于开发智能合约的系统、方法和装置,通过规约获取模块获取目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口,接着客户端开发模块基于目标 智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理,其中,智能合约客户端接口为用于定义目标智能合约接口的客户端定义信息,智能合约客户端代理用于实现智能合约客户端接口,智能合约客户端接口和智能合约客户端代理用于构建客户端智能合约应用,以及服务端开发模块基于目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架,其中,智能合约服务端接口为用于定义目标智能合约接口的服务端定义信息,智能合约服务端骨架用于建立智能合约客户端接口与智能合约服务端接口之间的联系,智能合约服务端接口和智能合约服务端骨架用于构建服务端智能合约,从而可以基于智能合约客户端接口和智能合约服务端接口,实现面向接口的智能合约开发,有助于简化智能合约开发的过程,获得便于维护的智能合约;并且,基于智能合约接口规约,可以分别对客户端智能合约应用和服务端智能合约进行开发,进一步简化了智能合约开发的过程,提高了智能合约开发的效率。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本公开的其它特征、目的和优点将会变得更明显:
图1是本申请可以应用于其中的示例性系统架构图;
图2是根据本申请的用于开发智能合约的系统的一个实施例的时序图;
图3是根据本申请的用于开发智能合约的系统的一个应用场景的示意图;
图4是根据本申请的用于开发客户端智能合约应用的方法的一个实施例的流程图;
图5是根据本申请的用于开发服务端智能合约的方法的一个实施例的流程图;
图6是根据本申请的用于开发客户端智能合约应用的装置的一个实施例的结构示意图;
图7是根据本申请的用于开发服务端智能合约的装置的一个实施 例的结构示意图;
图8是适于用来实现本申请实施例的电子设备的计算机系统的结构示意图。
具体实施方式
下面结合附图和实施例对本公开作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。
需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本公开。
图1示出了可以应用本公开的用于开发智能合约的系统、用于开发客户端智能合约的方法、用于开发服务端智能合约的方法、用于开发客户端智能合约的装置或用于开发服务端智能合约的装置的实施例的示例性系统架构100。
如图1所示,系统架构100可以包括规约获取模块101、网络102、客户端开发模块103和服务端开发模块104。网络102用以在规约获取模块101和客户端开发模块103之间以及规约获取模块101和服务端开发模块104之间提供通信链路的介质。网络102可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。
客户端开发人员可以使用客户端开发模块103通过网络102与规约获取模块101交互,以接收规约获取模块101发送的智能合约接口规约。相类似的,服务端开发人员可以使用服务端开发模块104通过网络102与规约获取模块101交互,以接收规约获取模块101发送的智能合约接口规约。
规约获取模块101可以是硬件,也可以是软件。当规约获取模块101为硬件时,可以是具有获取智能合约接口规约的功能的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等。当规约获取模块101为软件时,可以安装在上述所列举 的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务的多个软件或软件模块),也可以实现成单个软件或软件模块。在此不做具体限定。
客户端开发模块103可以是硬件,也可以是软件。当客户端开发模块103为硬件时,可以是具有软件开发功能的各种电子设备,包括但不限于膝上型便携计算机和台式计算机等等。当客户端开发模块103为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务的多个软件或软件模块),也可以实现成单个软件或软件模块。在此不做具体限定。
相类似的,服务端开发模块104可以是硬件,也可以是软件。当服务端开发模块104为硬件时,可以是具有软件开发功能的各种电子设备,包括但不限于膝上型便携计算机和台式计算机等等。当服务端开发模块104为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务的多个软件或软件模块),也可以实现成单个软件或软件模块。在此不做具体限定。
特别的,当规约获取模块101、客户端开发模块103和服务端开发模块104均为软件时,三者可以安装在同一个电子设备(例如膝上型便携计算机或台式计算机)中。
需要说明的是,本公开的实施例所提供的用于开发客户端智能合约应用的方法一般由客户端开发模块103执行,相应地,用于开发客户端智能合约应用的装置一般设置于客户端开发模块103中。本公开的实施例所提供的用于开发服务端智能合约的方法一般由服务端开发模块104执行,相应地,用于开发服务端智能合约的装置一般设置于服务端开发模块104中。
应该理解,图1中的规约获取模块、网络、客户端开发模块和服务端开发模块的数目仅仅是示意性的。根据实现需要,可以具有任意数目的规约获取模块、网络、客户端开发模块和服务端开发模块。
请参考图2,示出了根据本申请的用于开发智能合约的系统的一个实施例的时序图200。
本申请实施例中的用于开发智能合约的系统可以包括规约获取模块,被配置成获取目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;客户端开发模块,被配置成基于目标智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理,其中,智能合约客户端接口为用于定义目标智能合约接口的客户端定义信息,智能合约客户端代理用于实现智能合约客户端接口,智能合约客户端接口和智能合约客户端代理用于构建客户端智能合约应用;服务端开发模块,被配置成基于目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架,其中,智能合约服务端接口为用于定义目标智能合约接口的服务端定义信息,智能合约服务端骨架用于建立智能合约客户端接口与智能合约服务端接口之间的联系,智能合约服务端接口和智能合约服务端骨架用于构建服务端智能合约。
如图2所示,在步骤201中,规约获取模块获取目标智能合约接口规约。
在本实施例中,规约获取模块(例如图1所示的规约获取模块101)可以通过有线连接方式或无线连接方式从本地或远程获取目标智能合约接口规约。其中,目标智能合约接口规约用于定义目标智能合约接口。目标智能合约接口可以为待开发的智能合约的接口,用于实现待开发的智能合约与目标区块链中的节点之间的交互。目标区块链可以为待开发的智能合约所属的区块链。
具体的,作为示例,目标智能合约接口规约可以包括用于定义目标智能合约接口的接口方法、接口数据等的信息。例如,目标智能合约接口为资金存管接口。目标智能合约接口规约可以包括用于定义开户、转账这两个接口方法的信息,还可以包括用于定义用户名、密码等接口数据的信息。
实践中,目标智能合约接口规约包括的用于定义目标智能合约接口的信息可以是开发人员确定出的信息。进而,规约获取模块可以基于开发人员确定出的信息,获得目标智能合约接口规约。
在本实施例的一些可选的实现方式中,规约获取模块可以进一步 被配置成:利用预先确定的智能合约接口规约模板,获取目标智能合约接口的目标智能合约接口规约。其中,智能合约接口规约模板可以是预先确定的、用于获取智能合约接口规约的模板,开发人员可以在智能合约接口规约模板中输入用于定义目标智能合约接口的信息,进而获得目标智能合约接口规约。作为示例,智能合约接口模板可以包括接口方法项,开发人员可以在接口方法项的位置输入开户和转账,进而基于开发人员输入的用于定义目标智能合约接口的接口方法的信息,获得目标智能合约接口规约。
本实现方式利用智能合约接口规约模板,可以简化目标智能合约接口规约的获取步骤,有助于提高智能合约开发的效率。
在步骤202中,规约获取模块向客户端开发模块发送目标智能合约接口规约。
在本实施例中,基于步骤201所获得的目标智能合约接口规约,规约获取模块可以向客户端开发模块(例如图1所示的客户端开发模块103)发送上述目标智能合约接口规约。
在步骤203中,客户端开发模块基于目标智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理。
在本实施例中,客户端开发模块可以基于目标智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理。其中,智能合约客户端接口可以为用于定义目标智能合约接口的客户端定义信息。具体的,客户端定义信息可以包括以客户端支持的程序语言定义目标智能合约接口的信息。智能合约客户端代理可以用于实现智能合约客户端接口。智能合约客户端接口和智能合约客户端代理可以用于构建客户端智能合约应用。
实践中,可以采用各种方法生成智能合约客户端接口和智能合约客户端代理。具体的,作为示例,客户端开发模块可以利用预先确定的智能合约客户端框架,生成智能合约客户端接口和智能合约客户端代理。其中,智能合约客户端框架可以为预先确定的框架,其可以包括客户端基于接口访问智能合约的基础功能。具体的,客户端开发模块可以基于智能合约客户端框架,将目标智能合约接口规约转化为客 户端支持的语言,进而生成智能合约客户端接口。在此基础上,客户端开发模块可以对智能合约客户端框架中的、用于实现智能合约客户端接口的功能进行组合,获得智能合约客户端代理。
在本实施例的一些可选的实现方式中,客户端定义信息还可以包括用于表征目标智能合约接口与目标区块链的关联关系的信息。具体的,目标智能合约接口与目标区块链的关联关系可以指通过目标智能合约接口产生的交易与目标区块链的关联关系。实践中,开发人员可以将目标智能合约接口所对应的交易(即通过目标智能合约接口产生的交易)在目标区块链中所属区块的编号、交易确认时间等封装到智能合约客户端接口中,进而获得包括表征目标智能合约接口与目标区块链的关联关系的信息的客户端定义信息。
本实现方式通过在智能合约客户端接口中扩展目标智能合约接口的区块链相关信息,有助于开发出更为全面的客户端智能合约应用;并且,在生成智能合约客户端接口的过程中,对区块链相关信息进行封装,可以简化后续基于智能合约客户端接口开发客户端智能合约应用的过程,提高客户端智能合约应用的开发效率。
实践中,基于所生成的智能合约客户端接口和智能合约客户端代理,开发人员可以构建客户端智能合约应用。
在步骤204中,规约获取模块向服务端开发模块发送目标智能合约接口规约。
在本实施例中,基于步骤201所获得的目标智能合约接口规约,规约获取模块可以向服务端开发模块(例如图1所示的服务端开发模块104)发送上述目标智能合约接口规约。
需要说明的是,本步骤204可以与上述步骤202同步执行,也可以在步骤202执行之前或之后执行,本实施例中所描述的步骤202、步骤204的执行顺序并不应作为对本申请具体实现方式的限制。此外,可以理解,在步骤204可以与步骤202同步执行的情况下,下述步骤205也可以与上述步骤203同步执行,或步骤205在上述步骤203之前或之后执行;在步骤204可以在步骤202执行之前执行的情况下,下述步骤205也可以在步骤203执行之前或之后执行,或步骤205与 步骤203同步执行;在步骤204可以在步骤202执行之后执行的情况下,下述步骤205也可以在步骤203执行之前或之后执行,或步骤205与步骤203同步执行,即本申请对步骤203和步骤205的具体执行顺序也不做限制,只需步骤203在步骤202之后执行,步骤205在步骤204之后执行即可。
在步骤205中,服务端开发模块基于目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架。
在本实施例中,服务端开发模块可以基于目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架。其中,智能合约服务端接口可以为用于定义目标智能合约接口的服务端定义信息。具体的,服务端定义信息可以包括以服务端支持的程序语言定义目标智能合约接口的信息。智能合约服务端骨架可以用于建立智能合约客户端接口与智能合约服务端接口之间的联系,具体可以用于提供通过智能合约客户端接口发送的智能合约请求到智能合约服务端接口的路由和适配。智能合约服务端接口和智能合约服务端骨架可以用于构建服务端智能合约。
实践中,可以采用各种方法生成智能合约服务端接口和智能合约服务端骨架。具体的,作为示例,服务端开发模块可以利用预先确定的智能合约服务端框架,生成智能合约服务端接口和智能合约服务端骨架。其中,智能合约服务端框架可以为预先确定的框架,其可以包括服务端基于接口访问智能合约的基础功能。具体的,服务端开发模块可以基于智能合约服务端框架,将目标智能合约接口规约转化为服务端支持的语言,进而生成智能合约服务端接口。在此基础上,服务端开发模块可以对智能合约服务端框架中的、用于实现智能合约客户端接口到智能合约服务端接口的路由和适配的功能进行组合,获得智能合约服务端骨架。
在本实施例的一些可选的实现方式中,服务端定义信息还可以包括用于表征目标智能合约接口与目标区块链的关联关系的信息。实践中,开发人员可以将目标智能合约接口所对应的交易(即通过目标智能合约接口产生的交易)在目标区块链中所属区块的编号、交易确认 时间等封装到智能合约服务端接口中,进而获得包括表征目标智能合约接口与目标区块链的关联关系的信息的服务端定义信息。
本实现方式通过在智能合约服务端接口中扩展目标智能合约接口的区块链相关信息,有助于开发出更为全面的服务端智能合约;并且,在生成智能合约服务端接口的过程中,对区块链相关信息进行封装,可以简化后续基于智能合约服务端接口开发服务端智能合约的过程,提高服务端智能合约的开发效率。
实践中,基于所生成的智能合约服务端接口和智能合约服务端骨架,开发人员可以构建服务端智能合约。
在本实施例的一些可选的实现方式中,上述用于开发智能合约的系统还可以包括:测试模块(图中未示出),被配置成利用目标测试用例,对所构建的客户端智能合约应用和服务端智能合约进行测试,其中,目标测试用例可以基于智能合约客户端接口和智能合约客户端代理生成。具体的,开发人员可以利用现有的软件开发工具,基于智能合约客户端接口和智能合约客户端代理确定目标测试用例。
实践中,一个目标测试用例相当于一次智能合约请求,通过目标测试用例,可以使客户端智能合约应用向服务端智能合约请求智能合约,进而基于服务端智能合约反馈的信息既可以确定客户端智能合约应用和服务端智能合约的状态,以实现对客户端智能合约应用和服务端智能合约的功能测试。
继续参见图3,图3是根据本实施例的用于开发智能合约的系统的应用场景的一个示意图。
在图3的应用场景中,规约获取模块301可以首先获取目标智能合约接口规约302,其中,目标智能合约接口规约302用于定义目标智能合约接口。然后,规约获取模块301可以将目标智能合约接口规约302分别发送给客户端开发模块303和服务端开发模块304。
接着,客户端开发模块303可以基于接收到的目标智能合约接口规约302,生成智能合约客户端接口305和智能合约客户端代理306,其中,智能合约客户端接口305为用于定义目标智能合约接口的客户 端定义信息,智能合约客户端代理306用于实现智能合约客户端接口,智能合约客户端接口305和智能合约客户端代理306用于构建客户端智能合约应用。
以及,服务端开发模块304可以基于接收到的目标智能合约接口规约302,生成智能合约服务端接口307和智能合约服务端骨架308,其中,智能合约服务端接口307为用于定义目标智能合约接口的服务端定义信息,智能合约服务端骨架308用于建立智能合约客户端接口与智能合约服务端接口之间的联系,智能合约服务端接口307和智能合约服务端骨架308用于构建服务端智能合约。
本公开的上述实施例提供的方法可以基于智能合约客户端接口和智能合约服务端接口,实现面向接口的智能合约开发,有助于简化智能合约开发的过程,获得便于维护的智能合约;并且,基于智能合约接口规约,可以分别对客户端智能合约应用和服务端智能合约进行开发,进一步简化了智能合约开发的过程,提高了智能合约开发的效率。
继续参考图4,示出了根据本公开的用于开发客户端智能合约应用的方法的一个实施例的流程400。该用于开发客户端智能合约应用的方法,包括以下步骤:
步骤401,获取规约获取模块发送的目标智能合约接口规约。
在本实施例中,用于开发客户端智能合约应用的方法的执行主体(例如图1所示的客户端开发模块103)可以通过有线连接方式或者无线连接方式获取规约获取模块(例如图1所示的规约获取模块101)发送的目标智能合约接口规约。其中,目标智能合约接口规约用于定义目标智能合约接口。目标智能合约接口可以为待开发的智能合约的接口,用于实现待开发的智能合约与目标区块链中的节点之间的交互。目标区块链可以为待开发的智能合约所属的区块链。
步骤402,基于目标智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理。
在本实施例中,基于步骤401中得到的目标智能合约接口规约,上述执行主体可以生成智能合约客户端接口和智能合约客户端代理。 其中,智能合约客户端接口可以为用于定义目标智能合约接口的客户端定义信息。具体的,客户端定义信息可以包括以客户端支持的程序语言定义目标智能合约接口的信息。智能合约客户端代理可以用于实现智能合约客户端接口。智能合约客户端接口和智能合约客户端代理可以用于构建客户端智能合约应用。
在本实施例的一些可选的实现方式中,客户端定义信息还可以包括用于表征目标智能合约接口与目标区块链的关联关系的信息。
实践中,基于所生成的智能合约客户端接口和智能合约客户端代理,开发人员可以构建客户端智能合约应用。
需要说明的是,图4所对应的实施例中的执行主体,可以与上述用于开发智能合约的系统中的客户端开发模块具有相同的特征,因此,图4所对应的实施例可以与上述用于开发智能合约的系统中的客户端开发模块所具有的特征相结合,以构成新的技术方案。为避免重复,在此不再赘述。
本公开的实施例提供的用于开发客户端智能合约应用的方法,通过获取目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口,接着基于目标智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理,其中,智能合约客户端接口为用于定义目标智能合约接口的客户端定义信息,智能合约客户端代理用于实现智能合约客户端接口,智能合约客户端接口和智能合约客户端代理用于构建客户端智能合约应用,从而可以基于智能合约客户端接口,实现面向接口的客户端智能合约应用开发,有助于简化客户端智能合约应用开发的过程,获得便于维护的客户端智能合约应用。
进一步参考图5,其示出了用于开发服务端智能合约的方法的一个实施例的流程500。该用于开发服务端智能合约的方法的流程500,包括以下步骤:
步骤501,获取规约获取模块发送的目标智能合约接口规约。
在本实施例中,用于开发服务端智能合约的方法的执行主体(例如图1所示的服务端开发模块104)可以通过有线连接方式或者无线 连接方式获取规约获取模块发送的目标智能合约接口规约。其中,目标智能合约接口规约用于定义目标智能合约接口。目标智能合约接口可以为待开发的智能合约的接口,用于实现待开发的智能合约与目标区块链中的节点之间的交互。目标区块链可以为待开发的智能合约所属的区块链
步骤502,基于目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架。
在本实施例中,基于步骤501中得到的目标智能合约接口规约,上述执行主体可以生成智能合约服务端接口和智能合约服务端骨架。其中,智能合约服务端接口可以为用于定义目标智能合约接口的服务端定义信息。具体的,服务端定义信息可以包括以服务端支持的程序语言定义目标智能合约接口的信息。智能合约服务端骨架可以用于建立智能合约客户端接口与智能合约服务端接口之间的联系,具体可以用于提供通过智能合约客户端接口发送的智能合约请求到智能合约服务端接口的路由和适配。智能合约服务端接口和智能合约服务端骨架可以用于构建服务端智能合约。
在本实施例的一些可选的实现方式中,服务端定义信息还可以包括用于表征目标智能合约接口与目标区块链的关联关系的信息。
实践中,基于所生成的智能合约服务端接口和智能合约服务端骨架,开发人员可以构建服务端智能合约。
需要说明的是,图5所对应的实施例中的执行主体,可以与上述用于开发智能合约的系统中的服务端开发模块具有相同的特征,因此,图5所对应的实施例可以与上述用于开发智能合约的系统中的服务端开发模块所具有的特征相结合,以构成新的技术方案。为避免重复,在此不再赘述。
本公开的实施例提供的用于开发服务端智能合约的方法,通过获取目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口,接着基于目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架,其中,智能合约服务端接口为用于定义目标智能合约接口的服务端定义信息,智能合约服务端骨架用于 建立智能合约客户端接口与智能合约服务端接口之间的联系,智能合约服务端接口和智能合约服务端骨架用于构建服务端智能合约,从而可以基于智能合约服务端接口,实现面向接口的服务端智能合约开发,有助于简化服务端智能合约应用开发的过程,获得便于维护的服务端智能合约应用。
进一步参考图6,作为对上述各图所示方法的实现,本公开提供了一种用于开发客户端智能合约应用的装置的一个实施例,该装置实施例与图4所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。
如图6所示,本实施例的用于开发客户端智能合约应用的装置600包括:第一获取单元601和第一生成单元602。其中,第一获取单元601被配置成获取规约获取模块发送的目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;第一生成单元602被配置成基于目标智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理,其中,智能合约客户端接口为用于定义目标智能合约接口的客户端定义信息,智能合约客户端代理用于实现智能合约客户端接口,智能合约客户端接口和智能合约客户端代理用于构建客户端智能合约应用。
在本实施例中,第一获取单元601可以通过有线连接方式或者无线连接方式获取规约获取模块(例如图1所示的规约获取模块101)发送的目标智能合约接口规约。其中,目标智能合约接口规约用于定义目标智能合约接口。目标智能合约接口可以为待开发的智能合约的接口,用于实现待开发的智能合约与目标区块链中的节点之间的交互。目标区块链可以为待开发的智能合约所属的区块链。
在本实施例中,基于第一获取单元601得到的目标智能合约接口规约,第一生成单元602可以生成智能合约客户端接口和智能合约客户端代理。其中,智能合约客户端接口可以为用于定义目标智能合约接口的客户端定义信息。具体的,客户端定义信息可以包括以客户端支持的程序语言定义目标智能合约接口的信息。智能合约客户端代理 可以用于实现智能合约客户端接口。智能合约客户端接口和智能合约客户端代理可以用于构建客户端智能合约应用。
实践中,基于所生成的智能合约客户端接口和智能合约客户端代理,开发人员可以构建客户端智能合约应用。
在本实施例的一些可选的实现方式中,客户端定义信息还可以包括用于表征目标智能合约接口与目标区块链的关联关系的信息。
可以理解的是,该装置600中记载的诸单元与参考图4描述的方法中的各个步骤相对应。由此,上文针对方法描述的操作、特征以及产生的有益效果同样适用于装置600及其中包含的单元,在此不再赘述。
本公开的上述实施例提供的装置600可以基于智能合约客户端接口,实现面向接口的客户端智能合约应用开发,有助于简化客户端智能合约应用开发的过程,获得便于维护的客户端智能合约应用。
进一步参考图7,作为对上述各图所示方法的实现,本公开提供了一种用于开发服务端智能合约的装置的一个实施例,该装置实施例与图5所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。
如图7所示,本实施例的用于开发服务端智能合约的装置700包括:第二获取单元701和第二生成单元702。其中,第二获取单元701被配置成获取规约获取模块发送的目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;第二生成单元702被配置成基于目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架,其中,智能合约服务端接口为用于定义目标智能合约接口的服务端定义信息,智能合约服务端骨架用于建立智能合约客户端接口与智能合约服务端接口之间的联系,智能合约服务端接口和智能合约服务端骨架用于构建服务端智能合约。
在本实施例中,第二获取单元701可以通过有线连接方式或者无线连接方式获取规约获取模块发送的目标智能合约接口规约。其中,目标智能合约接口规约用于定义目标智能合约接口。目标智能合约接 口可以为待开发的智能合约的接口,用于实现待开发的智能合约与目标区块链中的节点之间的交互。目标区块链可以为待开发的智能合约所属的区块链
在本实施例中,基于第二获取单元701得到的目标智能合约接口规约,第二生成单元702可以生成智能合约服务端接口和智能合约服务端骨架。其中,智能合约服务端接口可以为用于定义目标智能合约接口的服务端定义信息。具体的,服务端定义信息可以包括以服务端支持的程序语言定义目标智能合约接口的信息。智能合约服务端骨架可以用于建立智能合约客户端接口与智能合约服务端接口之间的联系,具体可以用于提供通过智能合约客户端接口发送的智能合约请求到智能合约服务端接口的路由和适配。智能合约服务端接口和智能合约服务端骨架可以用于构建服务端智能合约。
实践中,基于所生成的智能合约服务端接口和智能合约服务端骨架,开发人员可以构建服务端智能合约。
在本实施例的一些可选的实现方式中,服务端定义信息还可以包括用于表征目标智能合约接口与目标区块链的关联关系的信息。
可以理解的是,该装置700中记载的诸单元与参考图5描述的方法中的各个步骤相对应。由此,上文针对方法描述的操作、特征以及产生的有益效果同样适用于装置700及其中包含的单元,在此不再赘述。
本公开的上述实施例提供的装置700可以基于智能合约服务端接口,实现面向接口的服务端智能合约开发,有助于简化服务端智能合约应用开发的过程,获得便于维护的服务端智能合约应用。
下面参考图8,其示出了适于用来实现本公开实施例的电子设备(例如图1中的客户端开发模块103或服务端开发模块104)800的结构示意图。图8示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图8所示,电子设备800可以包括处理装置(例如中央处理器、图形处理器等)801,其可以根据存储在只读存储器(ROM)802中的 程序或者从存储装置808加载到随机访问存储器(RAM)803中的程序而执行各种适当的动作和处理。在RAM 803中,还存储有电子设备800操作所需的各种程序和数据。处理装置801、ROM 802以及RAM 803通过总线804彼此相连。输入/输出(I/O)接口805也连接至总线804。
通常,以下装置可以连接至I/O接口805:包括例如键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置806;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置807;包括例如磁带、硬盘等的存储装置808;以及通信装置809。通信装置809可以允许电子设备800与其他设备进行无线或有线通信以交换数据。虽然图8示出了具有各种装置的电子设备800,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置809从网络上被下载和安装,或者从存储装置808被安装,或者从ROM 802被安装。在该计算机程序被处理装置801执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开所述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可 读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取规约获取模块发送的目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;基于目标智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理,其中,智能合约客户端接口为用于定义目标智能合约接口的客户端定义信息,智能合约客户端代理用于实现智能合约客户端接口,智能合约客户端接口和智能合约客户端代理用于构建客户端智能合约应用。
或者,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取规约获取模块发送的目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;基于目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架,其中,智能合约服务端接口为用于定义目标智能合约接口的服务端定义信息,智能合约服务端骨架用于建立智能合约客户端接口与智能合约服务端接口之间的联系,智能合约服务端接口和智能合约服务端骨架用于构建服务端智能合约。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的 软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一获取单元还可以被描述为“获取目标智能合同接口规约的单元”。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。

Claims (12)

  1. 一种用于开发智能合约的系统,包括:
    规约获取模块,被配置成获取目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;
    客户端开发模块,被配置成基于所述目标智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理,其中,智能合约客户端接口为用于定义所述目标智能合约接口的客户端定义信息,智能合约客户端代理用于实现智能合约客户端接口,智能合约客户端接口和智能合约客户端代理用于构建客户端智能合约应用;
    服务端开发模块,被配置成基于所述目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架,其中,智能合约服务端接口为用于定义所述目标智能合约接口的服务端定义信息,智能合约服务端骨架用于建立智能合约客户端接口与智能合约服务端接口之间的联系,智能合约服务端接口和智能合约服务端骨架用于构建服务端智能合约。
  2. 根据权利要求1所述的系统,其中,所述规约获取模块进一步被配置成:
    利用预先确定的智能合约接口规约模板,获取目标智能合约接口的目标智能合约接口规约。
  3. 根据权利要求1所述的系统,其中,所述客户端定义信息和所述服务端定义信息包括用于表征所述目标智能合约接口与目标区块链的关联关系的信息。
  4. 根据权利要求1-3之一所述的系统,其中,所述系统还包括:
    测试模块,被配置成利用目标测试用例,对所构建的客户端智能合约应用和服务端智能合约进行测试,其中,所述目标测试用例基于所述智能合约客户端接口和所述智能合约客户端代理生成。
  5. 一种用于开发客户端智能合约应用的方法,包括:
    获取规约获取模块发送的目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;
    基于所述目标智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理,其中,智能合约客户端接口为用于定义所述目标智能合约接口的客户端定义信息,智能合约客户端代理用于实现智能合约客户端接口,智能合约客户端接口和智能合约客户端代理用于构建客户端智能合约应用。
  6. 根据权利要求5所述的方法,其中,所述客户端定义信息包括用于表征所述目标智能合约接口与目标区块链的关联关系的信息。
  7. 一种用于开发服务端智能合约的方法,包括:
    获取规约获取模块发送的目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;
    基于所述目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架,其中,智能合约服务端接口为用于定义所述目标智能合约接口的服务端定义信息,智能合约服务端骨架用于建立智能合约客户端接口与智能合约服务端接口之间的联系,智能合约服务端接口和智能合约服务端骨架用于构建服务端智能合约。
  8. 根据权利要求7所述的方法,其中,所述服务端定义信息包括用于表征所述目标智能合约接口与目标区块链的关联关系的信息。
  9. 一种用于开发客户端智能合约应用的装置,包括:
    第一获取单元,被配置成获取规约获取模块发送的目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;
    第一生成单元,被配置成基于所述目标智能合约接口规约,生成智能合约客户端接口和智能合约客户端代理,其中,智能合约客户端 接口为用于定义所述目标智能合约接口的客户端定义信息,智能合约客户端代理用于实现智能合约客户端接口,智能合约客户端接口和智能合约客户端代理用于构建客户端智能合约应用。
  10. 一种用于开发服务端智能合约的装置,包括:
    第二获取单元,被配置成获取规约获取模块发送的目标智能合约接口规约,其中,目标智能合约接口规约用于定义目标智能合约接口;
    第二生成单元,被配置成基于所述目标智能合约接口规约,生成智能合约服务端接口和智能合约服务端骨架,其中,智能合约服务端接口为用于定义所述目标智能合约接口的服务端定义信息,智能合约服务端骨架用于建立智能合约客户端接口与智能合约服务端接口之间的联系,智能合约服务端接口和智能合约服务端骨架用于构建服务端智能合约。
  11. 一种电子设备,包括:
    一个或多个处理器;
    存储装置,其上存储有一个或多个程序,
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求5-8中任一所述的方法。
  12. 一种计算机可读介质,其上存储有计算机程序,其中,该程序被处理器执行时实现如权利要求5-8中任一所述的方法。
PCT/CN2020/082672 2019-09-04 2020-04-01 用于开发智能合约的系统、方法和装置 WO2021042715A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2022503963A JP7298008B2 (ja) 2019-09-04 2020-04-01 スマートコントラクトを開発するためのシステム、方法及び装置
EP20860135.1A EP4027242A4 (en) 2019-09-04 2020-04-01 SYSTEM, METHOD AND APPARATUS FOR DEVELOPING INTELLIGENT CONTRACTS
US17/637,907 US20220278860A1 (en) 2019-09-04 2020-04-01 System, method and apparatus for developing smart contract

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910832970.0A CN110532115B (zh) 2019-09-04 2019-09-04 用于开发智能合约的系统、方法和装置
CN201910832970.0 2019-09-04

Publications (1)

Publication Number Publication Date
WO2021042715A1 true WO2021042715A1 (zh) 2021-03-11

Family

ID=68666870

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/082672 WO2021042715A1 (zh) 2019-09-04 2020-04-01 用于开发智能合约的系统、方法和装置

Country Status (5)

Country Link
US (1) US20220278860A1 (zh)
EP (1) EP4027242A4 (zh)
JP (1) JP7298008B2 (zh)
CN (1) CN110532115B (zh)
WO (1) WO2021042715A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110532115B (zh) * 2019-09-04 2021-03-05 北京海益同展信息科技有限公司 用于开发智能合约的系统、方法和装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107943950A (zh) * 2017-11-24 2018-04-20 中钞信用卡产业发展有限公司杭州区块链技术研究院 一种区块链中数据智能合约生成的方法及系统
CN109615518A (zh) * 2018-12-11 2019-04-12 北京瑞卓喜投科技发展有限公司 一种智能合约系统的构建方法和智能合约系统
CN109683867A (zh) * 2018-12-27 2019-04-26 石更箭数据科技(上海)有限公司 一种对接区块链的方法及其装置、介质、终端
WO2019082100A1 (en) * 2017-10-24 2019-05-02 Tata Consultancy Services Limited SYSTEM AND METHOD FOR GENERATING A BLOCK CHAIN APPLICATION FOR DIFFERENT BLOCK CHAIN TECHNOLOGIES
CN110532115A (zh) * 2019-09-04 2019-12-03 北京海益同展信息科技有限公司 用于开发智能合约的系统、方法和装置

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000181716A (ja) * 1998-12-16 2000-06-30 Fujitsu Ltd 分散オブジェクトにおけるメソッド実行最適化方式
US20050278693A1 (en) * 2004-06-15 2005-12-15 Brunell Edward G Distribution adaptor for network management application development
US20150379510A1 (en) * 2012-07-10 2015-12-31 Stanley Benjamin Smith Method and system to use a block chain infrastructure and Smart Contracts to monetize data transactions involving changes to data included into a data supply chain.
US10402792B2 (en) * 2015-08-13 2019-09-03 The Toronto-Dominion Bank Systems and method for tracking enterprise events using hybrid public-private blockchain ledgers
US10022613B2 (en) * 2016-05-02 2018-07-17 Bao Tran Smart device
US11556521B2 (en) * 2017-09-29 2023-01-17 Oracle International Corporation System and method for providing an interface for a blockchain cloud service
US10476847B1 (en) * 2017-12-08 2019-11-12 Symbiont.Io, Inc. Systems, methods, and devices for implementing a smart contract on a distributed ledger technology platform
CN108052321B (zh) * 2017-12-28 2020-12-25 杭州趣链科技有限公司 一种基于配置信息自动生成区块链智能合约的方法
CN109981546B (zh) * 2017-12-28 2021-08-20 北京京东尚科信息技术有限公司 获取应用模块间的远程调用关系的方法和装置
CN108846745B (zh) * 2018-04-19 2022-06-07 深圳市迅雷网络技术有限公司 区块链交易处理辅助系统、区块链数据处理系统及方法
CN108763058A (zh) * 2018-04-24 2018-11-06 苏州同济区块链研究院有限公司 一种区块链测评系统
US11169985B2 (en) * 2018-07-27 2021-11-09 Oracle International Corporation System and method for supporting SQL-based rich queries in hyperledger fabric blockchains
US11182379B2 (en) * 2018-08-24 2021-11-23 Oracle International Corporation DAG based methods and systems of transaction processing in a distributed ledger
CN109614093B (zh) * 2018-11-01 2022-02-22 播金信息科技(上海)有限公司 可视化智能合约系统以及智能合约的处理方法
CN109542421B (zh) * 2018-11-12 2021-09-07 夸克链科技(深圳)有限公司 一种模块化区块链智能合约
CN109683869A (zh) * 2018-12-29 2019-04-26 北京阿斯特时代科技有限公司 Dapp的开发方法和装置
ES2870919T3 (es) * 2019-03-04 2021-10-28 Advanced New Technologies Co Ltd Interfaz de software para contratos inteligentes
US11822538B2 (en) * 2020-11-05 2023-11-21 Oracle International Corporation Systems and methods of transaction identification generation for transaction-based environment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019082100A1 (en) * 2017-10-24 2019-05-02 Tata Consultancy Services Limited SYSTEM AND METHOD FOR GENERATING A BLOCK CHAIN APPLICATION FOR DIFFERENT BLOCK CHAIN TECHNOLOGIES
CN107943950A (zh) * 2017-11-24 2018-04-20 中钞信用卡产业发展有限公司杭州区块链技术研究院 一种区块链中数据智能合约生成的方法及系统
CN109615518A (zh) * 2018-12-11 2019-04-12 北京瑞卓喜投科技发展有限公司 一种智能合约系统的构建方法和智能合约系统
CN109683867A (zh) * 2018-12-27 2019-04-26 石更箭数据科技(上海)有限公司 一种对接区块链的方法及其装置、介质、终端
CN110532115A (zh) * 2019-09-04 2019-12-03 北京海益同展信息科技有限公司 用于开发智能合约的系统、方法和装置

Also Published As

Publication number Publication date
CN110532115B (zh) 2021-03-05
EP4027242A4 (en) 2023-09-20
EP4027242A1 (en) 2022-07-13
JP2022541805A (ja) 2022-09-27
JP7298008B2 (ja) 2023-06-26
CN110532115A (zh) 2019-12-03
US20220278860A1 (en) 2022-09-01

Similar Documents

Publication Publication Date Title
WO2021056968A1 (zh) 用于执行智能合约的方法和装置
WO2022105591A1 (zh) 缓存服务器性能测试方法、装置、设备和介质
JP2023521120A (ja) 共同トレーニングモデルを評価するための方法及び装置
CN109951546A (zh) 基于智能合约的事务请求处理方法、装置、设备和介质
CN113505520A (zh) 用于支持异构联邦学习的方法、装置和系统
WO2021139379A1 (zh) 活动配置方法、装置、可读介质及电子设备
CN113821352A (zh) 一种远程服务的调用方法和装置
WO2021042714A1 (zh) 用于生成信息的方法和装置
WO2021042715A1 (zh) 用于开发智能合约的系统、方法和装置
CN110377273A (zh) 一种数据处理的方法、装置、介质和电子设备
CN114513552A (zh) 数据处理方法、装置、设备及存储介质
CN109819042A (zh) 用于提供软件开发工具包的方法和装置
US8789021B2 (en) Method and apparatus for object-oriented load testing of computing systems
CN115022328B (zh) 服务器集群以及服务器集群的测试方法、装置和电子设备
US20160308991A1 (en) Analytics system architecture
CN109947659A (zh) 用于测试应用的系统、方法和装置
CN112929453B (zh) 一种共享session数据的方法和装置
CN109840109A (zh) 用于生成软件开发工具包的方法和装置
CN115374207A (zh) 业务处理方法及装置、电子设备和计算机可读存储介质
CN114546370A (zh) 一种数据对接方法及相关装置
CN109271310B (zh) 移动应用程序网络功能的开发测试方法和装置
CN110196832A (zh) 用于获取快照信息的方法及装置
CN115348310B (zh) 反向代理方法、装置、系统、电子设备及存储介质
CN112883697B (zh) 工作流表单生成方法、装置、电子设备和计算机可读介质
CN111831531B (zh) 测试方法和装置

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: 20860135

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022503963

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020860135

Country of ref document: EP

Effective date: 20220404