WO2023169193A1 - Method and device for generating smart contract - Google Patents

Method and device for generating smart contract Download PDF

Info

Publication number
WO2023169193A1
WO2023169193A1 PCT/CN2023/077153 CN2023077153W WO2023169193A1 WO 2023169193 A1 WO2023169193 A1 WO 2023169193A1 CN 2023077153 W CN2023077153 W CN 2023077153W WO 2023169193 A1 WO2023169193 A1 WO 2023169193A1
Authority
WO
WIPO (PCT)
Prior art keywords
contract
smart contract
creation
business account
target business
Prior art date
Application number
PCT/CN2023/077153
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 WO2023169193A1 publication Critical patent/WO2023169193A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/313Logic programming, e.g. PROLOG programming language
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0863Generation of secret information including derivation or calculation of cryptographic keys or passwords involving passwords or one-time passwords
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds

Definitions

  • the present disclosure relates to the field of blockchain technology, and specifically to methods and devices for generating smart contracts.
  • the present disclosure provides a method, device, electronic device, and computer-readable storage medium for generating smart contracts.
  • One or more embodiments of the present disclosure provide a method for generating a smart contract, including: in response to receiving a creation request for instructing the creation of a smart contract, obtaining contract attribute information in the creation request; obtaining and creating the request The corresponding target business account; based on the contract attribute information, generate a smart contract in the target business account.
  • obtaining contract attribute information in the creation request includes: in response to receiving a creation request for instructing the creation of a smart contract, presenting a preset page; Based on the preset page, obtain the contract attribute information determined by the user.
  • the method for generating the smart contract before obtaining the contract attribute information in the creation request in response to receiving the creation request for instructing the creation of the smart contract, the method for generating the smart contract further includes: in response to detecting the account authentication information, presenting Contract creation page; based on the contract creation page, the creation request for instructing the creation of a smart contract is received.
  • obtaining the target business account corresponding to the creation request includes: in response to determining that the target business account does not exist, generating a random secret key; creating a business account based on the random secret key, and determining the created business account as the target business account .
  • the method for generating a smart contract further includes: obtaining resource configuration information of the target business account; and generating smart contracts in the target business account based on the contract attribute information.
  • the contract includes: generating a smart contract in the target business account based on the contract attribute information and the resource configuration information of the target business account.
  • the contract attribute information includes at least one of the following: the contract logic of the smart contract, the type of blockchain deployed by the distributed application implemented by the smart contract, the language type of the smart contract, and the calling method of the smart contract.
  • the method for generating a smart contract further includes: in response to receiving an update request for the smart contract, updating the smart contract based on the update request.
  • One or more embodiments of the present disclosure provide an apparatus for generating a smart contract, including: a first acquisition unit configured to, in response to receiving a creation request for instructing the creation of a smart contract, acquire the Contract attribute information; the second acquisition unit is configured to obtain the target business account corresponding to the creation request; the generation unit is configured to generate a smart contract in the target business account based on the contract attribute information.
  • the first acquisition unit includes: a first presentation module configured to present a preset page in response to receiving a creation request indicating the creation of a smart contract; and the acquisition module is configured to present a preset page based on the preset page , obtain the contract attribute information determined by the user.
  • the device for generating a smart contract includes: a second presentation module configured to present a contract creation page in response to detecting account authentication information; a receiving module configured to The contract-based creation page receives a creation request indicating the creation of a smart contract.
  • the first acquisition unit includes: a secret key generation module configured to generate a random secret key in response to determining that the target business account does not exist; an account generation module configured to create a business account based on the random secret key, and Identify the created business account as the target business account.
  • the device for generating a smart contract further includes: a third acquisition unit configured to acquire resource configuration information of the target business account; the generation unit includes: a generation module configured to based on the contract attribute information, and The resource configuration information of the target business account is used to generate a smart contract in the target business account.
  • the contract attribute information includes at least one of the following: the contract logic of the smart contract, the type of blockchain deployed by the distributed application implemented by the smart contract, the language type of the smart contract, and the calling method of the smart contract.
  • the means for generating the smart contract further includes: in response to receiving an update request for the smart contract, updating the smart contract based on the update request.
  • One or more embodiments of the present disclosure provide an electronic device, including: one or more processors: a storage device for storing one or more programs. When the one or more programs are processed by the one or more processors, Execution, causing one or more processors to implement the above methods for generating smart contracts.
  • One or more embodiments of the present disclosure provide a computer-readable storage medium on which a computer program is stored, wherein the above method for generating a smart contract is implemented when the program is executed by a processor.
  • Figure 1 is an exemplary system architecture diagram in which embodiments of the present disclosure may be applied;
  • Figure 2 is a flowchart of one embodiment of a method for generating a smart contract according to the present disclosure
  • Figure 3 is a flowchart of another embodiment of a method for generating a smart contract according to the present disclosure
  • Figure 4 is a schematic diagram of a preset page in the method for generating smart contracts according to the present disclosure
  • Figure 5 is a schematic diagram of another preset page in the method for generating smart contracts according to the present disclosure.
  • Figure 6 is a flow chart of yet another embodiment of a method for generating a smart contract according to the present disclosure
  • Figure 7 is a flow chart of an application scenario of the method for generating smart contracts according to the present disclosure.
  • Figure 8 is a schematic diagram of another preset page in the method for generating smart contracts according to the present disclosure.
  • Figure 9 is a schematic structural diagram of an embodiment of a device for generating smart contracts according to the present disclosure.
  • FIG. 10 is a block diagram of an electronic device used to implement a method for generating a smart contract according to an embodiment of the present disclosure.
  • FIG. 1 shows an exemplary system architecture 100 to which embodiments of the method for generating smart contracts or the apparatus for generating smart contracts of the present disclosure may be applied.
  • the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105.
  • Network 104 is used between terminal devices 101, 102, 103 and server 105 The medium that provides the communication link.
  • Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
  • terminal devices 101, 102, 103 Users can use terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc.
  • the terminal devices 101, 102, and 103 may be user terminal devices, on which various client applications may be installed, such as image applications, video applications, shopping applications, chat applications, search applications, financial applications, etc.
  • the terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting receiving server messages, including but not limited to smartphones, tablet computers, e-book readers, electronic players, laptop computers and desktop computers. etc.
  • the terminal devices 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, and 103 are hardware, they can be various electronic devices. When the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, multiple software modules used to provide distributed services), or as a single software or software module. There are no specific limitations here.
  • the server 105 After receiving a creation request for instructing the creation of a smart contract, the server 105 obtains the contract attribute information in the creation request, obtains the target business account corresponding to the creation request, and generates a smart contract in the target business account based on the contract attribute information. contract.
  • the method for generating smart contracts provided by the embodiments of the present disclosure can be executed by the server 105, and accordingly, the device for generating smart contracts can be provided in the server 105.
  • a process 200 of one embodiment of a method for generating a smart contract according to the present disclosure is shown, including the following steps:
  • Step 201 In response to receiving a creation request indicating the creation of a smart contract, obtain the contract attribute information in the creation request.
  • the execution subject of the method for generating a smart contract receives a creation request indicating the creation of a smart contract
  • the contract attribute information in the creation request is obtained.
  • the creation request used to instruct the creation of smart contracts is the request information used to request the creation of smart contracts.
  • Smart contracts can realize the core functions of distributed applications (Decentralized Application, DAPP) on the blockchain to complete the blockchain. function output.
  • Contract attribute information refers to the contract logic of the smart contract or the business logic of the business served by the smart contract, the language type of the smart contract, the type of blockchain on which the distributed application of the smart contract implementation/service is deployed, and the name of the smart contract. , category, storage address, calling method and other information related to the smart contract.
  • Step 202 Obtain the target business account corresponding to the creation request.
  • the target business account corresponding to the creation request can be obtained.
  • the identification of the target business account can be included in the creation request, or can be obtained by the user inputting information.
  • Step 203 Generate a smart contract in the target business account based on the contract attribute information.
  • a smart contract can be generated in the target business account based on the contract attribute information.
  • the contract identifier in the contract attribute information is used as the identifier of the smart contract to be generated; the smart contract is stored in the contract attribute information. storage address; use the contract logic and business logic contained in the contract attribute information as the logic of the smart contract; use the language type included in the contract attribute information to compile the smart contract; and deploy the smart contract in the area included in the contract attribute information.
  • a blockchain type of blockchain On a blockchain type of blockchain.
  • the method for generating a smart contract responds to receiving a creation request for instructing the creation of a smart contract, obtains the contract attribute information in the creation request, obtains the target business account corresponding to the creation request, and based on the contract attribute information , generate smart contracts in the target business account, so that users can obtain deployment in the target business account without knowing the underlying operating principles/operational logic of different blockchains, and without knowing the compilation principles of smart contracts.
  • On-chain smart contracts on this blockchain can improve the efficiency of creating smart contracts.
  • the creation of smart contracts can focus more on the logic of the smart contract or the services it serves.
  • the business logic of distributed applications improves the accuracy of the smart contracts created.
  • a process 300 of another embodiment of a method for generating a smart contract according to the present disclosure is shown, including the following steps:
  • Step 301 In response to receiving a creation request indicating the creation of a smart contract, a preset page is presented.
  • a preset page when the execution subject of the method for generating a smart contract (for example, the server 105 shown in FIG. 1) receives a creation request for instructing the creation of a smart contract, a preset page may be presented.
  • the preset page can present the contract templates stored in the database for generating smart contracts.
  • Each contract template can be the underlying logic/underlying program abstracted from the general functions of the distributed application served by the smart contract.
  • Step 302 Obtain the contract attribute information determined by the user based on the preset page.
  • the contract name and contract description of the smart contract to be created input by the user, and the compiled language of the smart contract to be created can be obtained on the default page, as shown in Figure 5 , you can obtain the contract template and other information selected by the user on the default page.
  • Step 303 Obtain the target business account corresponding to the creation request.
  • Step 304 Generate a smart contract in the target business account based on the contract attribute information.
  • step 303 and step 304 in this embodiment is consistent with the description of step 202 and step 203, and will not be described again here.
  • the method for generating smart contracts obtained in this embodiment obtains the contract attribute information determined by the user based on the preset page, and can complete the generation of smart contracts through visual operations on the page, improving creation And the efficiency of generating smart contracts, as well as user convenience.
  • a process 600 of yet another embodiment of a method for generating a smart contract according to the present disclosure including the following steps:
  • Step 601 In response to detecting account authentication information, a contract creation page is presented.
  • the execution subject of the method for generating a smart contract detects the account authentication information, it can present the contract creation page, so that after the user performs identity authentication/authority authentication through the account authentication information, the page can be jumped to the contract creation platform/contract development system, and a default page can be presented. , to complete the creation and generation of smart contracts during the human-computer interaction process between the display device and the user.
  • Step 602 Receive a creation request indicating the creation of a smart contract based on the contract creation page.
  • a creation request indicating the creation of a smart contract may be received based on the contract creation page.
  • Step 603 In response to receiving a creation request indicating the creation of a smart contract, obtain the contract attribute information in the creation request.
  • Step 604 Obtain the target business account corresponding to the creation request.
  • Step 605 Generate a smart contract in the target business account based on the contract attribute information.
  • step 603, step 604, and step 605 in this embodiment is consistent with the description of step 201, step 202, and step 203, and will not be described again here.
  • the method for generating smart contracts adds that the contract creation page is presented only after the account authentication information is detected, and the user is received based on the presented contract creation page. Create a request to create a smart contract so that the user corresponding to the account authentication information can maintain the smart contract he created.
  • obtaining the target business account corresponding to the creation request includes: in response to determining that the target business account does not exist, generating a random secret key; based on Create a business account with a random secret key, and determine the created business account as the target business account.
  • a random secret key is generated based on a random number or a key algorithm
  • a business account is created based on the random secret key
  • the created business account is determined to be used to generate the smart contract.
  • Target business account to create the target business account when the target business account does not exist in the system.
  • the method for generating the smart contract also includes: obtaining the resource configuration information of the target business account; based on the contract attribute information, generating the smart contract in the target business account, including: based on the contract attribute information and the resource configuration information of the target business account, in A smart contract is generated in the target business account.
  • the resource configuration information of the target business account can be obtained, and based on the contract attribute information and the resource configuration information of the target business account, a smart contract is generated in the target business account, where the resource configuration information includes the corresponding information of the target business account. on-chain resource information.
  • the contract attribute information includes at least one of the following: the contract logic of the smart contract, the area where the distributed application implemented by the smart contract is deployed The type of blockchain, the language type of smart contracts, and the calling method of smart contracts.
  • the contract attribute information may include at least one of the following: contract logic of the smart contract or business logic of the business served by the smart contract, and the type of blockchain on which the distributed application of the smart contract implementation/service is deployed. , the language type of smart contracts, and the calling method of smart contracts.
  • the attribute information of the smart contract to be generated needs to meet the attributes indicated by the contract attribute information included in the creation request.
  • the method for generating a smart contract includes: in response to receiving an update request for the smart contract, updating the smart contract based on the update request .
  • the smart contract after receiving an update request for the smart contract, the smart contract can be updated based on the update request to achieve maintenance and editing of the smart contract.
  • methods used to generate smart contracts include:
  • the user logs in to his account through the login service module. After that, he completes the authentication of the login information through the authentication and account module and forwards the login status to the contract development platform;
  • the contract development platform presents the preset page to the display interface to obtain the basic information of the smart contract to be created on at least one preset page (Figure 4), and obtain the contract template selected by the user ( Figure 5). And obtain the user's parameter configuration information for the smart contract (as shown in Figure 8), based on the above
  • the above basic information, contract template and parameter configuration information (these three belong to contract attribute information) are used to generate a smart contract belonging to the sub-account in the current login account (ie, the target business account).
  • the steps to generate a sub-account include: if the secret key does not exist, generate the secret key first; if there is a pre-generated secret key, create a sub-account (that is, an on-chain account of the blockchain) based on the secret key; for the created The sub-account configures resources on the chain; completes the creation of smart contracts, and publishes smart contracts.
  • the contract development platform adopts the language type indicated by the contract attribute information, deploys the smart contract in the underlying application of the blockchain/blockchain indicated by the contract attribute information, and generates the smart contract.
  • the contract s page calling method and/or interface calling method.
  • the fourth step is that after the smart contract is released, the smart contract in the account can be queried based on the account on the blockchain to edit, call, update and other operations on the smart contract.
  • the present disclosure provides an embodiment of a device for generating smart contracts.
  • the device embodiment is the same as that shown in Figures 2, 3 and 6.
  • the device can be applied to various electronic devices.
  • the device for generating a smart contract in this embodiment includes: a first acquisition unit 901, a second acquisition unit 902, and a generation unit 903.
  • the first obtaining unit is configured to obtain the contract attribute information in the creation request in response to receiving a creation request for instructing the creation of a smart contract
  • the second obtaining unit is configured to obtain the target business account corresponding to the creation request.
  • the generation unit is configured to generate smart contracts in the target business account based on the contract attribute information.
  • the first acquisition unit includes: a first presentation module configured to present a preset page in response to receiving a creation request indicating the creation of a smart contract; and the acquisition module is configured to present a preset page based on the preset page , obtain the contract attribute information determined by the user.
  • the device for generating a smart contract includes: a second presentation module configured to present a contract creation page in response to detecting account authentication information; a receiving module configured to receive instructions based on the contract creation page Create a creation request for a smart contract.
  • the first acquisition unit includes: a secret key generation module configured to respond to It is determined that the target business account does not exist, and a random secret key is generated; the account generation module is configured to create a business account based on the random secret key, and determine the created business account as the target business account.
  • the device for generating a smart contract further includes: a third acquisition unit configured to acquire resource configuration information of the target business account; the generation unit includes: a generation module configured to based on the contract attribute information, and The resource configuration information of the target business account is used to generate a smart contract in the target business account.
  • the contract attribute information includes at least one of the following: the contract logic of the smart contract, the type of blockchain deployed by the distributed application implemented by the smart contract, the language type of the smart contract, and the calling method of the smart contract.
  • the means for generating the smart contract further includes: in response to receiving an update request for the smart contract, updating the smart contract based on the update request.
  • Each unit in the above-mentioned device 900 corresponds to the steps in the method described with reference to FIG. 2, FIG. 3, and FIG. 6. Therefore, the operations, features and achievable technical effects described above for the method for generating a smart contract are also applicable to the device 900 and the units included therein, and will not be described again here.
  • the present disclosure also provides an electronic device and a readable storage medium.
  • FIG. 10 it is a block diagram of an electronic device 1000 for a method for generating a smart contract according to an embodiment of the present disclosure.
  • Electronic devices are intended to refer to various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
  • Electronic devices may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices.
  • the components shown herein, their connections and relationships, and their functions are examples only and are not intended to limit implementations of the disclosure described and/or claimed herein.
  • the electronic device includes: one or more processors 1001, memory 1002, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces.
  • the various components are connected to each other using different buses and can be installed on a common motherboard or otherwise installed as needed.
  • the processor may process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface.
  • multiple processors and/or multiple buses may be used with multiple memories and multiple memories, if desired.
  • multiple electronic devices can be connected, each device providing part of the necessary operation (eg, as a server array, a set of blade servers, or a multi-processor system).
  • Figure 10 takes a processor 1001 as an example.
  • the memory 1002 is the non-transitory computer-readable storage medium provided by the present disclosure.
  • the memory stores instructions that can be executed by at least one processor, so that the at least one processor executes the method for generating a smart contract provided by the present disclosure.
  • the non-transitory computer-readable storage medium of the present disclosure stores computer instructions, which are used to cause the computer to execute the method for generating a smart contract provided by the present disclosure.
  • the memory 1002 can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions/modules corresponding to the method for generating smart contracts in the embodiments of the present disclosure.
  • the processor 1001 executes various functional applications and data processing of the server by running non-transient software programs, instructions and modules stored in the memory 1002, that is, implementing the method for generating a smart contract in the above method embodiment.
  • the memory 1002 may include a storage program area and a storage data area, wherein the storage program area may store an operating system and an application program required for at least one function; the storage data area may store data created according to the use of an electronic device for extracting video clips. Data etc.
  • memory 1002 may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device.
  • memory 1002 optionally includes memory located remotely relative to processor 1001, and these remote memories may be connected via a network to electronic devices used to extract video clips. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.
  • the electronic device used for the method of generating a smart contract may also include: input device 1003, output Device 1004 and bus 1005.
  • the processor 1001, the memory 1002, the input device 1003 and the output device 1004 can be connected through a bus 1005 or other means. In Figure 10, the connection through the bus 1005 is taken as an example.
  • the input device 1003 may receive input numeric or character information and generate key signal input related to user settings and functional control of an electronic device for extracting video clips, such as a touch screen, keypad, mouse, trackpad, touch pad, pointer An input device such as a stick, one or more mouse buttons, a trackball, or a joystick.
  • Output devices 1004 may include display devices, auxiliary lighting devices (eg, LEDs), tactile feedback devices (eg, vibration motors), and the like.
  • the display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
  • Various implementations of the systems and techniques described herein may be implemented in digital electronic circuitry, integrated circuit systems, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include implementation in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor
  • the processor which may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device. An output device.
  • machine-readable medium and “computer-readable medium” refer to any computer program product, apparatus, and/or means for providing machine instructions and/or data to a programmable processor ( For example, magnetic disks, optical disks, memories, programmable logic devices (PLD)), including machine-readable media that receive machine instructions as machine-readable signals.
  • machine-readable signal refers to any signal used to provide machine instructions and/or data to a programmable processor.
  • the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer.
  • a display device eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor
  • a keyboard and pointing device eg, a mouse or a trackball
  • Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and may be provided in any form, including Acoustic input, voice input or tactile input) to receive input from the user.
  • the systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., A user's computer having a graphical user interface or web browser through which the user can interact with implementations of the systems and technologies described herein), or including such backend components, middleware components, or any combination of front-end components in a computing system.
  • the components of the system may be interconnected by any form or medium of digital data communication (eg, a communications network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
  • Computer systems may include clients and servers.
  • Clients and servers are generally remote from each other and typically interact over a communications network.
  • the relationship of client and server is created by computer programs running on corresponding computers and having a client-server relationship with each other.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Human Computer Interaction (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present disclosure relates to the technical field of block chains, and provides a method and device for generating a smart contract. The method comprises: in response to receiving a creation request for instructing to create a smart contract, obtaining contract attribute information in the creation request; obtaining a target service account corresponding to the creation request; and generating the smart contract in the target service account on the basis of the contract attribute information.

Description

用于生成智能合约的方法和装置Methods and apparatus for generating smart contracts
本公开要求于2022年3月10日提交的申请号为202210229854.1、发明名称为“用于生成智能合约的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。This disclosure claims priority from the Chinese patent application with application number 202210229854.1 and the invention title "Method and Device for Generating Smart Contracts" filed on March 10, 2022, the entire content of which is incorporated into this disclosure by reference.
技术领域Technical field
本公开涉及区块链技术领域,具体涉及用于生成智能合约的方法和装置。The present disclosure relates to the field of blockchain technology, and specifically to methods and devices for generating smart contracts.
背景技术Background technique
随着区块链技术的发展,越来越多的信息交互场景应用区块链技术来实现,区块链的功能输出主要通过分布式应用来实现,而分布式应用在区块链上的主要功能是通过智能合约来实现。由于不同区块链的开发语言以及所支持的链上智能合约的种类不同,即便是功能相同的分布式应用,在部署于不同的区块链上时,需要开发人员从底层逻辑开始、重复的开发不同版本的智能合约,存在智能合约开发效率低的问题。With the development of blockchain technology, more and more information interaction scenarios are implemented using blockchain technology. The functional output of blockchain is mainly realized through distributed applications, and the main function of distributed applications on blockchain is Functions are implemented through smart contracts. Due to the different development languages of different blockchains and the types of smart contracts supported on the chain, even distributed applications with the same functions require developers to start from the underlying logic and repeat the process when deployed on different blockchains. When developing different versions of smart contracts, there is a problem of low smart contract development efficiency.
发明内容Contents of the invention
本公开提供了一种用于生成智能合约的方法、装置、电子设备以及计算机可读存储介质。The present disclosure provides a method, device, electronic device, and computer-readable storage medium for generating smart contracts.
本公开的一个或多个实施例提供了一种用于生成智能合约的方法,包括:响应于接收到用于指示创建智能合约的创建请求,获取创建请求中的合约属性信息;获取与创建请求对应的目标业务账户;基于合约属性信息,在目标业务账户中生成智能合约。One or more embodiments of the present disclosure provide a method for generating a smart contract, including: in response to receiving a creation request for instructing the creation of a smart contract, obtaining contract attribute information in the creation request; obtaining and creating the request The corresponding target business account; based on the contract attribute information, generate a smart contract in the target business account.
在一些实施例中,响应于接收到用于指示创建智能合约的创建请求,获取创建请求中的合约属性信息,包括:响应于接收到用于指示创建智能合约的创建请求,呈现预设页面;基于预设页面,获取用户确定的合约属性信息。 In some embodiments, in response to receiving a creation request for instructing the creation of a smart contract, obtaining contract attribute information in the creation request includes: in response to receiving a creation request for instructing the creation of a smart contract, presenting a preset page; Based on the preset page, obtain the contract attribute information determined by the user.
在一些实施例中,在响应于接收到用于指示创建智能合约的创建请求,获取创建请求中的合约属性信息之前,用于生成智能合约的方法还包括:响应于检测到账户认证信息,呈现合约创建页面;基于合约创建页面接收用于指示创建智能合约的创建请求。In some embodiments, before obtaining the contract attribute information in the creation request in response to receiving the creation request for instructing the creation of the smart contract, the method for generating the smart contract further includes: in response to detecting the account authentication information, presenting Contract creation page; based on the contract creation page, the creation request for instructing the creation of a smart contract is received.
在一些实施例中,获取与创建请求对应的目标业务账户包括:响应于确定不存在目标业务账户,生成随机秘钥;基于随机秘钥创建业务账户,并将创建的业务账户确定为目标业务账户。In some embodiments, obtaining the target business account corresponding to the creation request includes: in response to determining that the target business account does not exist, generating a random secret key; creating a business account based on the random secret key, and determining the created business account as the target business account .
在一些实施例中,在将创建的业务账户确定为目标业务账户之后,用于生成智能合约的方法还包括:获取目标业务账户的资源配置信息;基于合约属性信息,在目标业务账户中生成智能合约,包括:基于合约属性信息、以及目标业务账户的资源配置信息,在目标业务账户中生成智能合约。In some embodiments, after determining the created business account as the target business account, the method for generating a smart contract further includes: obtaining resource configuration information of the target business account; and generating smart contracts in the target business account based on the contract attribute information. The contract includes: generating a smart contract in the target business account based on the contract attribute information and the resource configuration information of the target business account.
在一些实施例中,合约属性信息包括以下至少一项:智能合约的合约逻辑、智能合约实现的分布式应用所部署的区块链的类型、智能合约的语言类型、智能合约的调用方式。In some embodiments, the contract attribute information includes at least one of the following: the contract logic of the smart contract, the type of blockchain deployed by the distributed application implemented by the smart contract, the language type of the smart contract, and the calling method of the smart contract.
在一些实施例中,用于生成智能合约的方法还包括:响应于接收到针对智能合约的更新请求,基于更新请求更新智能合约。In some embodiments, the method for generating a smart contract further includes: in response to receiving an update request for the smart contract, updating the smart contract based on the update request.
本公开的一个或多个实施例提供了一种用于生成智能合约的装置,包括:第一获取单元,被配置为响应于接收到用于指示创建智能合约的创建请求,获取创建请求中的合约属性信息;第二获取单元,被配置为获取与创建请求对应的目标业务账户;生成单元,被配置为基于合约属性信息,在目标业务账户中生成智能合约。One or more embodiments of the present disclosure provide an apparatus for generating a smart contract, including: a first acquisition unit configured to, in response to receiving a creation request for instructing the creation of a smart contract, acquire the Contract attribute information; the second acquisition unit is configured to obtain the target business account corresponding to the creation request; the generation unit is configured to generate a smart contract in the target business account based on the contract attribute information.
在一些实施例中,第一获取单元,包括:第一呈现模块,被配置为响应于接收到用于指示创建智能合约的创建请求,呈现预设页面;获取模块,被配置为基于预设页面,获取用户确定的合约属性信息。In some embodiments, the first acquisition unit includes: a first presentation module configured to present a preset page in response to receiving a creation request indicating the creation of a smart contract; and the acquisition module is configured to present a preset page based on the preset page , obtain the contract attribute information determined by the user.
在一些实施例中,用于生成智能合约的装置包括:第二呈现模块,被配置为响应于检测到账户认证信息,呈现合约创建页面;接收模块,被配置为 基于合约创建页面接收用于指示创建智能合约的创建请求。In some embodiments, the device for generating a smart contract includes: a second presentation module configured to present a contract creation page in response to detecting account authentication information; a receiving module configured to The contract-based creation page receives a creation request indicating the creation of a smart contract.
在一些实施例中,第一获取单元包括:秘钥生成模块,被配置为响应于确定不存在目标业务账户,生成随机秘钥;账户生成模块,被配置为基于随机秘钥创建业务账户,并将创建的业务账户确定为目标业务账户。In some embodiments, the first acquisition unit includes: a secret key generation module configured to generate a random secret key in response to determining that the target business account does not exist; an account generation module configured to create a business account based on the random secret key, and Identify the created business account as the target business account.
在一些实施例中,用于生成智能合约的装置还包括:第三获取单元,被配置为获取目标业务账户的资源配置信息;生成单元,包括:生成模块,被配置为基于合约属性信息、以及目标业务账户的资源配置信息,在目标业务账户中生成智能合约。In some embodiments, the device for generating a smart contract further includes: a third acquisition unit configured to acquire resource configuration information of the target business account; the generation unit includes: a generation module configured to based on the contract attribute information, and The resource configuration information of the target business account is used to generate a smart contract in the target business account.
在一些实施例中,合约属性信息包括以下至少一项:智能合约的合约逻辑、智能合约实现的分布式应用所部署的区块链的类型、智能合约的语言类型、智能合约的调用方式。In some embodiments, the contract attribute information includes at least one of the following: the contract logic of the smart contract, the type of blockchain deployed by the distributed application implemented by the smart contract, the language type of the smart contract, and the calling method of the smart contract.
在一些实施例中,用于生成智能合约的装置还包括:响应于接收到针对智能合约的更新请求,基于更新请求更新智能合约。In some embodiments, the means for generating the smart contract further includes: in response to receiving an update request for the smart contract, updating the smart contract based on the update request.
本公开的一个或多个实施例提供了一种电子设备,包括:一个或多个处理器:存储装置,用于存储一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现以上用于生成智能合约的方法。One or more embodiments of the present disclosure provide an electronic device, including: one or more processors: a storage device for storing one or more programs. When the one or more programs are processed by the one or more processors, Execution, causing one or more processors to implement the above methods for generating smart contracts.
本公开的一个或多个实施例提供了一种计算机可读存储介质,其上存储有计算机程序,其中,程序被处理器执行时实现以上用于生成智能合约的方法。One or more embodiments of the present disclosure provide a computer-readable storage medium on which a computer program is stored, wherein the above method for generating a smart contract is implemented when the program is executed by a processor.
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or important features of the embodiments of the disclosure, nor is it intended to limit the scope of the disclosure. Other features of the present disclosure will become readily understood from the following description.
附图说明Description of the drawings
附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. in:
图1是本公开的实施例可以应用于其中的示例性系统架构图;Figure 1 is an exemplary system architecture diagram in which embodiments of the present disclosure may be applied;
图2是根据本公开的用于生成智能合约的方法的一个实施例的流程图; Figure 2 is a flowchart of one embodiment of a method for generating a smart contract according to the present disclosure;
图3是根据本公开的用于生成智能合约的方法的另一个实施例的流程图;Figure 3 is a flowchart of another embodiment of a method for generating a smart contract according to the present disclosure;
图4是根据本公开的用于生成智能合约的方法中一个预设页面的示意图;Figure 4 is a schematic diagram of a preset page in the method for generating smart contracts according to the present disclosure;
图5是根据本公开的用于生成智能合约的方法中另一个预设页面的示意图;Figure 5 is a schematic diagram of another preset page in the method for generating smart contracts according to the present disclosure;
图6是根据本公开的用于生成智能合约的方法的又一个实施例的流程图;Figure 6 is a flow chart of yet another embodiment of a method for generating a smart contract according to the present disclosure;
图7是根据本公开的用于生成智能合约的方法的一个应用场景的流程图;Figure 7 is a flow chart of an application scenario of the method for generating smart contracts according to the present disclosure;
图8是根据本公开的用于生成智能合约的方法中又一个预设页面的示意图;Figure 8 is a schematic diagram of another preset page in the method for generating smart contracts according to the present disclosure;
图9是根据本公开的用于生成智能合约的装置的一个实施例的结构示意图;Figure 9 is a schematic structural diagram of an embodiment of a device for generating smart contracts according to the present disclosure;
图10是用来实现本公开实施例的用于生成智能合约的方法的电子设备的框图。FIG. 10 is a block diagram of an electronic device used to implement a method for generating a smart contract according to an embodiment of the present disclosure.
具体实施方式Detailed ways
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the present disclosure are included to facilitate understanding and should be considered to be exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the disclosure. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
图1示出了可以应用本公开的用于生成智能合约的方法或用于生成智能合约的装置的实施例的示例性系统架构100。FIG. 1 shows an exemplary system architecture 100 to which embodiments of the method for generating smart contracts or the apparatus for generating smart contracts of the present disclosure may be applied.
如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间 提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in Figure 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. Network 104 is used between terminal devices 101, 102, 103 and server 105 The medium that provides the communication link. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103可以是用户终端设备,其上可以安装有各种客户端应用,例如图像类应用、视频类应用、购物类应用、聊天类应用、搜索类应用、金融类应用等。Users can use terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. The terminal devices 101, 102, and 103 may be user terminal devices, on which various client applications may be installed, such as image applications, video applications, shopping applications, chat applications, search applications, financial applications, etc.
终端设备101、102、103可以是具有显示屏并且支持接收服务器消息的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、电子播放器、膝上型便携计算机和台式计算机等等。The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting receiving server messages, including but not limited to smartphones, tablet computers, e-book readers, electronic players, laptop computers and desktop computers. etc.
终端设备101、102、103可以是硬件,也可以是软件。当终端设备101、102、103为硬件时,可以是各种电子设备,当终端设备101、102、103为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务的多个软件模块),也可以实现成单个软件或软件模块。在此不做具体限定。The terminal devices 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, and 103 are hardware, they can be various electronic devices. When the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, multiple software modules used to provide distributed services), or as a single software or software module. There are no specific limitations here.
服务器105在接收到用于指示创建智能合约的创建请求后,获取创建请求中的合约属性信息,获取与该创建请求对应的目标业务账户,并基于合约属性信息,在该目标业务账户中生成智能合约。After receiving a creation request for instructing the creation of a smart contract, the server 105 obtains the contract attribute information in the creation request, obtains the target business account corresponding to the creation request, and generates a smart contract in the target business account based on the contract attribute information. contract.
需要说明的是,本公开的实施例所提供的用于生成智能合约的方法可以由服务器105执行,相应地,用于生成智能合约的装置可以设置于服务器105中。It should be noted that the method for generating smart contracts provided by the embodiments of the present disclosure can be executed by the server 105, and accordingly, the device for generating smart contracts can be provided in the server 105.
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the number of terminal devices, networks and servers in Figure 1 is only illustrative. Depending on implementation needs, there can be any number of end devices, networks, and servers.
继续参考图2,示出了根据本公开的用于生成智能合约的方法的一个实施例的流程200,包括以下步骤:Continuing to refer to FIG. 2 , a process 200 of one embodiment of a method for generating a smart contract according to the present disclosure is shown, including the following steps:
步骤201,响应于接收到用于指示创建智能合约的创建请求,获取创建请求中的合约属性信息。 Step 201: In response to receiving a creation request indicating the creation of a smart contract, obtain the contract attribute information in the creation request.
在本实施例中,当用于生成智能合约的方法的执行主体(例如图1所示的服务器105)接收到用于指示创建智能合约的创建请求后,获取创建请求中的合约属性信息。其中,用于指示创建智能合约的创建请求是用于请求创建智能合约的请求信息,通过智能合约可以实现分布式应用(Decentralized Application,DAPP)在区块链上的核心功能,以完成区块链的功能输出。合约属性信息是指智能合约的合约逻辑或者智能合约所服务的业务的业务逻辑、智能合约的语言类型、智能合约实现/服务的分布式应用所部署于的区块链的类型、智能合约的名称、类别、存储地址、调用方式等与智能合约关联的信息。In this embodiment, when the execution subject of the method for generating a smart contract (such as the server 105 shown in Figure 1) receives a creation request indicating the creation of a smart contract, the contract attribute information in the creation request is obtained. Among them, the creation request used to instruct the creation of smart contracts is the request information used to request the creation of smart contracts. Smart contracts can realize the core functions of distributed applications (Decentralized Application, DAPP) on the blockchain to complete the blockchain. function output. Contract attribute information refers to the contract logic of the smart contract or the business logic of the business served by the smart contract, the language type of the smart contract, the type of blockchain on which the distributed application of the smart contract implementation/service is deployed, and the name of the smart contract. , category, storage address, calling method and other information related to the smart contract.
步骤202,获取与创建请求对应的目标业务账户。Step 202: Obtain the target business account corresponding to the creation request.
在本实施例中,可以获取与创建请求对应的目标业务账户,该目标业务账户的标识可以包含于创建请求中,也可以由用户输入信息获取。In this embodiment, the target business account corresponding to the creation request can be obtained. The identification of the target business account can be included in the creation request, or can be obtained by the user inputting information.
步骤203,基于合约属性信息,在目标业务账户中生成智能合约。Step 203: Generate a smart contract in the target business account based on the contract attribute information.
在本实施例中,可以根据合约属性信息在目标业务账户中生成智能合约,具体地,采用合约属性信息中的合约标识作为待生成的智能合约的标识;将智能合约存储于合约属性信息所包含的存储地址中;采用合约属性信息中所包含的合约逻辑以及业务逻辑作为智能合约的逻辑;采用合约属性信息包含的语言类型编译智能合约;以及,将智能合约部署于合约属性信息所包含的区块链类型的区块链上。In this embodiment, a smart contract can be generated in the target business account based on the contract attribute information. Specifically, the contract identifier in the contract attribute information is used as the identifier of the smart contract to be generated; the smart contract is stored in the contract attribute information. storage address; use the contract logic and business logic contained in the contract attribute information as the logic of the smart contract; use the language type included in the contract attribute information to compile the smart contract; and deploy the smart contract in the area included in the contract attribute information. On a blockchain type of blockchain.
本实施例提供的用于生成智能合约的方法,响应于接收到用于指示创建智能合约的创建请求,获取创建请求中的合约属性信息,获取与创建请求对应的目标业务账户,基于合约属性信息,在目标业务账户中生成智能合约,使用户在不需要了解不同区块链的底层运行原理/运行逻辑的情况下,以及在不需要了解智能合约的编译原理的情况下,即可获得部署于该区块链上的链上智能合约,可以提高创建智能合约的效率。The method for generating a smart contract provided by this embodiment responds to receiving a creation request for instructing the creation of a smart contract, obtains the contract attribute information in the creation request, obtains the target business account corresponding to the creation request, and based on the contract attribute information , generate smart contracts in the target business account, so that users can obtain deployment in the target business account without knowing the underlying operating principles/operational logic of different blockchains, and without knowing the compilation principles of smart contracts. On-chain smart contracts on this blockchain can improve the efficiency of creating smart contracts.
另外,可以使智能合约的创建更关注于智能合约的逻辑、或者其所服务 的分布式应用的业务逻辑,提高所创建的智能合约的准确性。In addition, the creation of smart contracts can focus more on the logic of the smart contract or the services it serves. The business logic of distributed applications improves the accuracy of the smart contracts created.
继续参考图3,示出了根据本公开的用于生成智能合约的方法的另一个实施例的流程300,包括以下步骤:Continuing to refer to FIG. 3 , a process 300 of another embodiment of a method for generating a smart contract according to the present disclosure is shown, including the following steps:
步骤301,响应于接收到用于指示创建智能合约的创建请求,呈现预设页面。Step 301: In response to receiving a creation request indicating the creation of a smart contract, a preset page is presented.
在本实施例中,当用于生成智能合约的方法的执行主体(例如图1所示的服务器105)接收到用于指示创建智能合约的创建请求后,可以呈现预设页面,该预设页面中可以呈现出数据库中所存储的用于生成智能合约的合约模板,每一个合约模板可以是智能合约所服务的分布式应用的通用功能所抽象出的底层逻辑/底层程序。In this embodiment, when the execution subject of the method for generating a smart contract (for example, the server 105 shown in FIG. 1) receives a creation request for instructing the creation of a smart contract, a preset page may be presented. The preset page can present the contract templates stored in the database for generating smart contracts. Each contract template can be the underlying logic/underlying program abstracted from the general functions of the distributed application served by the smart contract.
步骤302,基于预设页面,获取用户确定的合约属性信息。Step 302: Obtain the contract attribute information determined by the user based on the preset page.
在本实施例中,如图4所示,可以在该预设页面获取用户所输入的待创建的智能合约的合约名称、合约描述,待创建的智能合约的编译语言,以及如图5所示,可以在预设页面获取用户所选择的合约模板等信息。In this embodiment, as shown in Figure 4, the contract name and contract description of the smart contract to be created input by the user, and the compiled language of the smart contract to be created can be obtained on the default page, as shown in Figure 5 , you can obtain the contract template and other information selected by the user on the default page.
步骤303,获取与创建请求对应的目标业务账户。Step 303: Obtain the target business account corresponding to the creation request.
步骤304,基于合约属性信息,在目标业务账户中生成智能合约。Step 304: Generate a smart contract in the target business account based on the contract attribute information.
本实施例中对步骤303、步骤304的描述与步骤202、步骤203的描述一致,此处不再赘述。The description of step 303 and step 304 in this embodiment is consistent with the description of step 202 and step 203, and will not be described again here.
本实施例提供的用于生成智能合约的方法,相比于图2描述的实施例,基于预设页面获取用户确定的合约属性信息,可以通过页面可视化操作的方式完成智能合约的生成,提高创建与生成智能合约的效率,以及方便用户使用。Compared with the embodiment described in Figure 2, the method for generating smart contracts provided in this embodiment obtains the contract attribute information determined by the user based on the preset page, and can complete the generation of smart contracts through visual operations on the page, improving creation And the efficiency of generating smart contracts, as well as user convenience.
继续参考图6,示出了根据本公开的用于生成智能合约的方法的又一个实施例的流程600,包括以下步骤:Continuing to refer to FIG. 6 , a process 600 of yet another embodiment of a method for generating a smart contract according to the present disclosure is shown, including the following steps:
步骤601,响应于检测到账户认证信息,呈现合约创建页面。Step 601: In response to detecting account authentication information, a contract creation page is presented.
在本实施例中,用于生成智能合约的方法的执行主体(例如图1所示的 服务器105)检测到账户认证信息后,可以呈现合约创建页面,以在用户通过账户认证信息进行身份认证/权限认证后,可以将页面跳转至合约创建平台/合约开发系统,并呈现预设页面,以在显示设备与用户的人机交互过程中完成智能合约的创建与生成。In this embodiment, the execution subject of the method for generating a smart contract (for example, as shown in Figure 1 After the server 105) detects the account authentication information, it can present the contract creation page, so that after the user performs identity authentication/authority authentication through the account authentication information, the page can be jumped to the contract creation platform/contract development system, and a default page can be presented. , to complete the creation and generation of smart contracts during the human-computer interaction process between the display device and the user.
步骤602,基于合约创建页面接收用于指示创建智能合约的创建请求。Step 602: Receive a creation request indicating the creation of a smart contract based on the contract creation page.
在本实施例中,可以基于合约创建页面接收用于指示创建智能合约的创建请求。In this embodiment, a creation request indicating the creation of a smart contract may be received based on the contract creation page.
步骤603,响应于接收到用于指示创建智能合约的创建请求,获取创建请求中的合约属性信息。Step 603: In response to receiving a creation request indicating the creation of a smart contract, obtain the contract attribute information in the creation request.
步骤604,获取与创建请求对应的目标业务账户。Step 604: Obtain the target business account corresponding to the creation request.
步骤605,基于合约属性信息,在目标业务账户中生成智能合约。Step 605: Generate a smart contract in the target business account based on the contract attribute information.
本实施例中对步骤603、步骤604、步骤605的描述与步骤201、步骤202、步骤203的描述一致,此处不再赘述。The description of step 603, step 604, and step 605 in this embodiment is consistent with the description of step 201, step 202, and step 203, and will not be described again here.
本实施例提供的用于生成智能合约的方法,相比于图2描述的实施例,增加了在检测到账户认证信息后,才呈现出合约创建页面,以及基于所呈现的合约创建页面接收用于创建智能合约的创建请求,以便于账户认证信息所对应的用户维护其所创建的智能合约。Compared with the embodiment described in Figure 2, the method for generating smart contracts provided by this embodiment adds that the contract creation page is presented only after the account authentication information is detected, and the user is received based on the presented contract creation page. Create a request to create a smart contract so that the user corresponding to the account authentication information can maintain the smart contract he created.
在上述结合图2、图3和图6描述的实施例的一些可选的实现方式中,获取与创建请求对应的目标业务账户包括:响应于确定不存在目标业务账户,生成随机秘钥;基于随机秘钥创建业务账户,并将创建的业务账户确定为目标业务账户。In some optional implementations of the embodiments described above in conjunction with Figures 2, 3 and 6, obtaining the target business account corresponding to the creation request includes: in response to determining that the target business account does not exist, generating a random secret key; based on Create a business account with a random secret key, and determine the created business account as the target business account.
在本实施例中,若确定不存在目标业务账户,基于随机数或者密钥算法生成随机秘钥,并基于该随机秘钥创建业务账户,将所创建的业务账户确定为用于生成智能合约的目标业务账户,以在系统中不存在目标业务账户时,实现目标业务账户的创建。In this embodiment, if it is determined that the target business account does not exist, a random secret key is generated based on a random number or a key algorithm, a business account is created based on the random secret key, and the created business account is determined to be used to generate the smart contract. Target business account to create the target business account when the target business account does not exist in the system.
在该可选的实施例中,在将创建的业务账户确定为目标业务账户之后, 用于生成智能合约的方法还包括:获取目标业务账户的资源配置信息;基于合约属性信息,在目标业务账户中生成智能合约,包括:基于合约属性信息、以及目标业务账户的资源配置信息,在目标业务账户中生成智能合约。In this optional embodiment, after determining the created business account as the target business account, The method for generating the smart contract also includes: obtaining the resource configuration information of the target business account; based on the contract attribute information, generating the smart contract in the target business account, including: based on the contract attribute information and the resource configuration information of the target business account, in A smart contract is generated in the target business account.
在本实施例中,可以获取目标业务账户的资源配置信息,并基于合约属性信、目标业务账户的资源配置信息,在目标业务账户中生成智能合约,其中,资源配置信息中包含目标业务账户对应的链上资源信息。In this embodiment, the resource configuration information of the target business account can be obtained, and based on the contract attribute information and the resource configuration information of the target business account, a smart contract is generated in the target business account, where the resource configuration information includes the corresponding information of the target business account. on-chain resource information.
在上述结合图2、图3和图6描述的实施例的一些可选的实现方式中,合约属性信息包括以下至少一项:智能合约的合约逻辑、智能合约实现的分布式应用所部署的区块链的类型、智能合约的语言类型、智能合约的调用方式。In some optional implementations of the embodiments described above in conjunction with Figure 2, Figure 3 and Figure 6, the contract attribute information includes at least one of the following: the contract logic of the smart contract, the area where the distributed application implemented by the smart contract is deployed The type of blockchain, the language type of smart contracts, and the calling method of smart contracts.
在本实施例中,合约属性信息可以包括以下至少一项:智能合约的合约逻辑或者智能合约所服务的业务的业务逻辑、智能合约实现/服务的分布式应用所部署于的区块链的类型、智能合约的语言类型、智能合约的调用方式。待生成的智能合约的属性信息需要满足创建请求中所包含的合约属性信息指示的属性。In this embodiment, the contract attribute information may include at least one of the following: contract logic of the smart contract or business logic of the business served by the smart contract, and the type of blockchain on which the distributed application of the smart contract implementation/service is deployed. , the language type of smart contracts, and the calling method of smart contracts. The attribute information of the smart contract to be generated needs to meet the attributes indicated by the contract attribute information included in the creation request.
在上述结合图2、图3和图6描述的实施例的一些可选的实现方式中,用于生成智能合约的方法包括:响应于接收到针对智能合约的更新请求,基于更新请求更新智能合约。In some optional implementations of the embodiments described above in conjunction with Figures 2, 3 and 6, the method for generating a smart contract includes: in response to receiving an update request for the smart contract, updating the smart contract based on the update request .
在本实施例中,当接收到针对智能合约的更显请求后,可以基于更新请求更新智能合约,以实现对智能合约的维护与编辑。In this embodiment, after receiving an update request for the smart contract, the smart contract can be updated based on the update request to achieve maintenance and editing of the smart contract.
在一些应用场景中,如图7所示,用于生成智能合约的方法包括:In some application scenarios, as shown in Figure 7, methods used to generate smart contracts include:
第一步,用户通过登陆服务模块进行账户登陆,之后,通过认证与账户模块完成登陆信息的认证以及将登陆态转发至合约开发平台;In the first step, the user logs in to his account through the login service module. After that, he completes the authentication of the login information through the authentication and account module and forwards the login status to the contract development platform;
第二步,合约开发平台将预设页面呈现至显示界面,以在至少一个预设页面获取待创建智能合约的基本信息(如图4),获取用户所选择的合约模板(如图5),以及获取用户对智能合约的参数配置信息(如图8),基于上 述基本信息、合约模板以及参数配置信息(该三者属于合约属性信息)生成属于当前登陆账户中的子账户(即,目标业务账户)的智能合约。In the second step, the contract development platform presents the preset page to the display interface to obtain the basic information of the smart contract to be created on at least one preset page (Figure 4), and obtain the contract template selected by the user (Figure 5). And obtain the user's parameter configuration information for the smart contract (as shown in Figure 8), based on the above The above basic information, contract template and parameter configuration information (these three belong to contract attribute information) are used to generate a smart contract belonging to the sub-account in the current login account (ie, the target business account).
在该步骤中,若不存在子账户,则需要先创建子账户后,再生成智能合约。生成子账户的步骤包括:若不存在秘钥,则首先生成秘钥;若存在预先生成的秘钥,则基于该秘钥创建子账户(即,区块链的链上账户);为创建的子账户配置链上资源;完成智能合约的创建,以及发布智能合约。In this step, if there is no sub-account, you need to create the sub-account first and then generate the smart contract. The steps to generate a sub-account include: if the secret key does not exist, generate the secret key first; if there is a pre-generated secret key, create a sub-account (that is, an on-chain account of the blockchain) based on the secret key; for the created The sub-account configures resources on the chain; completes the creation of smart contracts, and publishes smart contracts.
第三步,智能合约发布后,合约开发平台将该智能合约采用合约属性信息所指示的语言类型、部署于合约属性信息所指示的区块链/区块链的底层应用中,并生成该智能合约的页面调用方式和/或接口调用方式。In the third step, after the smart contract is released, the contract development platform adopts the language type indicated by the contract attribute information, deploys the smart contract in the underlying application of the blockchain/blockchain indicated by the contract attribute information, and generates the smart contract. The contract’s page calling method and/or interface calling method.
第四步,智能合约发布后,可以基于区块链的链上账户查询该账户中的智能合约,以对智能合约进行编辑、调用、更新等操作。The fourth step is that after the smart contract is released, the smart contract in the account can be queried based on the account on the blockchain to edit, call, update and other operations on the smart contract.
进一步参考图9,作为对上述各图所示方法的实现,本公开提供了一种用于生成智能合约的装置的一个实施例,该装置实施例与图2、图3和图6所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。With further reference to Figure 9, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for generating smart contracts. The device embodiment is the same as that shown in Figures 2, 3 and 6. Corresponding to the method embodiment, the device can be applied to various electronic devices.
如图9所示,本实施例的用于生成智能合约的装置,包括:第一获取单元901、第二获取单元902、生成单元903。其中,第一获取单元,被配置为响应于接收到用于指示创建智能合约的创建请求,获取创建请求中的合约属性信息;第二获取单元,被配置为获取与创建请求对应的目标业务账户;生成单元,被配置为基于合约属性信息,在目标业务账户中生成智能合约。As shown in Figure 9, the device for generating a smart contract in this embodiment includes: a first acquisition unit 901, a second acquisition unit 902, and a generation unit 903. Wherein, the first obtaining unit is configured to obtain the contract attribute information in the creation request in response to receiving a creation request for instructing the creation of a smart contract; the second obtaining unit is configured to obtain the target business account corresponding to the creation request. ; The generation unit is configured to generate smart contracts in the target business account based on the contract attribute information.
在一些实施例中,第一获取单元,包括:第一呈现模块,被配置为响应于接收到用于指示创建智能合约的创建请求,呈现预设页面;获取模块,被配置为基于预设页面,获取用户确定的合约属性信息。In some embodiments, the first acquisition unit includes: a first presentation module configured to present a preset page in response to receiving a creation request indicating the creation of a smart contract; and the acquisition module is configured to present a preset page based on the preset page , obtain the contract attribute information determined by the user.
在一些实施例中,用于生成智能合约的装置包括:第二呈现模块,被配置为响应于检测到账户认证信息,呈现合约创建页面;接收模块,被配置为基于合约创建页面接收用于指示创建智能合约的创建请求。In some embodiments, the device for generating a smart contract includes: a second presentation module configured to present a contract creation page in response to detecting account authentication information; a receiving module configured to receive instructions based on the contract creation page Create a creation request for a smart contract.
在一些实施例中,第一获取单元包括:秘钥生成模块,被配置为响应于 确定不存在目标业务账户,生成随机秘钥;账户生成模块,被配置为基于随机秘钥创建业务账户,并将创建的业务账户确定为目标业务账户。In some embodiments, the first acquisition unit includes: a secret key generation module configured to respond to It is determined that the target business account does not exist, and a random secret key is generated; the account generation module is configured to create a business account based on the random secret key, and determine the created business account as the target business account.
在一些实施例中,用于生成智能合约的装置还包括:第三获取单元,被配置为获取目标业务账户的资源配置信息;生成单元,包括:生成模块,被配置为基于合约属性信息、以及目标业务账户的资源配置信息,在目标业务账户中生成智能合约。In some embodiments, the device for generating a smart contract further includes: a third acquisition unit configured to acquire resource configuration information of the target business account; the generation unit includes: a generation module configured to based on the contract attribute information, and The resource configuration information of the target business account is used to generate a smart contract in the target business account.
在一些实施例中,合约属性信息包括以下至少一项:智能合约的合约逻辑、智能合约实现的分布式应用所部署的区块链的类型、智能合约的语言类型、智能合约的调用方式。In some embodiments, the contract attribute information includes at least one of the following: the contract logic of the smart contract, the type of blockchain deployed by the distributed application implemented by the smart contract, the language type of the smart contract, and the calling method of the smart contract.
在一些实施例中,用于生成智能合约的装置还包括:响应于接收到针对智能合约的更新请求,基于更新请求更新智能合约。In some embodiments, the means for generating the smart contract further includes: in response to receiving an update request for the smart contract, updating the smart contract based on the update request.
上述装置900中的各单元与参考图2、图3和图6描述的方法中的步骤相对应。由此上文针对用于生成智能合约的方法描述的操作、特征及所能达到的技术效果同样适用于装置900及其中包含的单元,在此不再赘述。Each unit in the above-mentioned device 900 corresponds to the steps in the method described with reference to FIG. 2, FIG. 3, and FIG. 6. Therefore, the operations, features and achievable technical effects described above for the method for generating a smart contract are also applicable to the device 900 and the units included therein, and will not be described again here.
根据本公开的实施例,本公开还提供了一种电子设备和一种可读存储介质。According to embodiments of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
如图10所示,是根据本公开实施例的用于生成智能合约的方法的电子设备1000的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。As shown in FIG. 10 , it is a block diagram of an electronic device 1000 for a method for generating a smart contract according to an embodiment of the present disclosure. Electronic devices are intended to refer to various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are examples only and are not intended to limit implementations of the disclosure described and/or claimed herein.
如图10所示,该电子设备包括:一个或多个处理器1001、存储器1002,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安 装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图10中以一个处理器1001为例。As shown in Figure 10, the electronic device includes: one or more processors 1001, memory 1002, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be installed on a common motherboard or otherwise installed as needed. Pack. The processor may process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used with multiple memories and multiple memories, if desired. Likewise, multiple electronic devices can be connected, each device providing part of the necessary operation (eg, as a server array, a set of blade servers, or a multi-processor system). Figure 10 takes a processor 1001 as an example.
存储器1002即为本公开所提供的非瞬时计算机可读存储介质。其中,该存储器存储有可由至少一个处理器执行的指令,以使该至少一个处理器执行本公开所提供的用于生成智能合约的方法。本公开的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本公开所提供的用于生成智能合约的方法。The memory 1002 is the non-transitory computer-readable storage medium provided by the present disclosure. Wherein, the memory stores instructions that can be executed by at least one processor, so that the at least one processor executes the method for generating a smart contract provided by the present disclosure. The non-transitory computer-readable storage medium of the present disclosure stores computer instructions, which are used to cause the computer to execute the method for generating a smart contract provided by the present disclosure.
存储器1002作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本公开实施例中的用于生成智能合约的方法对应的程序指令/模块(例如,附图9所示的第一获取单元901、第二获取单元902、生成单元903)。处理器1001通过运行存储在存储器1002中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的用于生成智能合约的方法。As a non-transient computer-readable storage medium, the memory 1002 can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions/modules corresponding to the method for generating smart contracts in the embodiments of the present disclosure. (For example, the first acquisition unit 901, the second acquisition unit 902, and the generation unit 903 shown in Figure 9). The processor 1001 executes various functional applications and data processing of the server by running non-transient software programs, instructions and modules stored in the memory 1002, that is, implementing the method for generating a smart contract in the above method embodiment.
存储器1002可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据用于提取视频片段的电子设备的使用所创建的数据等。此外,存储器1002可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器1002可选包括相对于处理器1001远程设置的存储器,这些远程存储器可以通过网络连接至用于提取视频片段的电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 1002 may include a storage program area and a storage data area, wherein the storage program area may store an operating system and an application program required for at least one function; the storage data area may store data created according to the use of an electronic device for extracting video clips. Data etc. In addition, memory 1002 may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 1002 optionally includes memory located remotely relative to processor 1001, and these remote memories may be connected via a network to electronic devices used to extract video clips. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.
用于生成智能合约的方法的电子设备还可以包括:输入装置1003、输出 装置1004以及总线1005。处理器1001、存储器1002、输入装置1003和输出装置1004可以通过总线1005或者其他方式连接,图10中以通过总线1005连接为例。The electronic device used for the method of generating a smart contract may also include: input device 1003, output Device 1004 and bus 1005. The processor 1001, the memory 1002, the input device 1003 and the output device 1004 can be connected through a bus 1005 or other means. In Figure 10, the connection through the bus 1005 is taken as an example.
输入装置1003可接收输入的数字或字符信息,以及产生与用于提取视频片段的电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置1004可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。该显示设备可以包括但不限于,液晶显示器(LCD)、发光二极管(LED)显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。The input device 1003 may receive input numeric or character information and generate key signal input related to user settings and functional control of an electronic device for extracting video clips, such as a touch screen, keypad, mouse, trackpad, touch pad, pointer An input device such as a stick, one or more mouse buttons, a trackball, or a joystick. Output devices 1004 may include display devices, auxiliary lighting devices (eg, LEDs), tactile feedback devices (eg, vibration motors), and the like. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、专用ASIC(专用集成电路)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described herein may be implemented in digital electronic circuitry, integrated circuit systems, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include implementation in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor The processor, which may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device. An output device.
这些计算程序(也称作程序、软件、软件应用、或者代码)包括可编程处理器的机器指令,并且可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。如本文使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。 These computing programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine language Calculation program. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or means for providing machine instructions and/or data to a programmable processor ( For example, magnetic disks, optical disks, memories, programmable logic devices (PLD)), including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer. Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and may be provided in any form, including Acoustic input, voice input or tactile input) to receive input from the user.
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., A user's computer having a graphical user interface or web browser through which the user can interact with implementations of the systems and technologies described herein), or including such backend components, middleware components, or any combination of front-end components in a computing system. The components of the system may be interconnected by any form or medium of digital data communication (eg, a communications network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。Computer systems may include clients and servers. Clients and servers are generally remote from each other and typically interact over a communications network. The relationship of client and server is created by computer programs running on corresponding computers and having a client-server relationship with each other.
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开所公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that various forms of the process shown above may be used, with steps reordered, added or deleted. For example, each step described in the present disclosure can be executed in parallel, sequentially, or in a different order. As long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, there is no limitation here.
上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进 等,均应包含在本公开保护范围之内。 The above-mentioned specific embodiments do not constitute a limitation on the scope of the present disclosure. It will be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions are possible depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this disclosure etc., shall be included in the protection scope of this disclosure.

Claims (16)

  1. 一种用于生成智能合约的方法,包括:A method for generating smart contracts, including:
    响应于接收到用于指示创建智能合约的创建请求,获取所述创建请求中的合约属性信息;In response to receiving a creation request indicating the creation of a smart contract, obtain the contract attribute information in the creation request;
    获取与所述创建请求对应的目标业务账户;以及Obtain the target business account corresponding to the creation request; and
    基于所述合约属性信息,在所述目标业务账户中生成智能合约。Based on the contract attribute information, a smart contract is generated in the target business account.
  2. 根据权利要求1所述的方法,其中,所述响应于接收到用于指示创建智能合约的创建请求,获取所述创建请求中的合约属性信息,包括:The method according to claim 1, wherein in response to receiving a creation request indicating the creation of a smart contract, obtaining the contract attribute information in the creation request includes:
    响应于接收到用于指示创建智能合约的创建请求,呈现预设页面;以及In response to receiving a create request instructing the creation of a smart contract, rendering a preset page; and
    基于所述预设页面,获取用户确定的合约属性信息。Based on the preset page, the contract attribute information determined by the user is obtained.
  3. 根据权利要求1所述的方法,其中,在响应于接收到用于指示创建智能合约的创建请求,获取所述创建请求中的合约属性信息之前,所述方法还包括:The method according to claim 1, wherein in response to receiving a creation request for instructing the creation of a smart contract, before obtaining the contract attribute information in the creation request, the method further includes:
    响应于检测到账户认证信息,呈现合约创建页面;以及In response to detecting the account authentication information, present the contract creation page; and
    基于所述合约创建页面接收所述用于指示创建智能合约的创建请求。The creation request for instructing the creation of a smart contract is received based on the contract creation page.
  4. 根据权利要求1所述的方法,其中,所述获取与所述创建请求对应的目标业务账户,包括:The method according to claim 1, wherein the obtaining the target business account corresponding to the creation request includes:
    响应于确定不存在所述目标业务账户,生成随机秘钥;以及In response to determining that the target business account does not exist, generating a random secret key; and
    基于所述随机秘钥创建业务账户,并将创建的所述业务账户确定为所述目标业务账户。Create a business account based on the random secret key, and determine the created business account as the target business account.
  5. 根据权利要求4所述的方法,其中,在将创建的所述业务账户确定为所述目标业务账户之后,所述方法还包括: The method of claim 4, wherein after determining the created business account as the target business account, the method further includes:
    获取所述目标业务账户的资源配置信息;Obtain the resource configuration information of the target business account;
    所述基于所述合约属性信息,在所述目标业务账户中生成智能合约,包括:Generating a smart contract in the target business account based on the contract attribute information includes:
    基于所述合约属性信息、以及所述目标业务账户的资源配置信息,在所述目标业务账户中生成智能合约。Based on the contract attribute information and the resource configuration information of the target business account, a smart contract is generated in the target business account.
  6. 根据权利要求1-5之一所述的方法,其中,所述合约属性信息包括以下至少一项:智能合约的合约逻辑、智能合约实现的分布式应用所部署的区块链的类型、智能合约的语言类型、智能合约的调用方式。The method according to any one of claims 1 to 5, wherein the contract attribute information includes at least one of the following: contract logic of the smart contract, type of blockchain deployed by the distributed application implemented by the smart contract, smart contract Language type and smart contract calling method.
  7. 根据权利要求1-5之一所述的方法,其中,所述方法还包括:The method according to one of claims 1-5, wherein the method further includes:
    响应于接收到针对所述智能合约的更新请求,基于所述更新请求更新所述智能合约。In response to receiving an update request for the smart contract, the smart contract is updated based on the update request.
  8. 一种用于生成智能合约的装置,包括:A device for generating smart contracts, including:
    第一获取单元,被配置为响应于接收到用于指示创建智能合约的创建请求,获取所述创建请求中的合约属性信息;A first acquisition unit configured to, in response to receiving a creation request for instructing the creation of a smart contract, acquire the contract attribute information in the creation request;
    第二获取单元,被配置为获取与所述创建请求对应的目标业务账户;以及A second acquisition unit configured to acquire the target business account corresponding to the creation request; and
    生成单元,被配置为基于所述合约属性信息,在所述目标业务账户中生成智能合约。A generating unit configured to generate a smart contract in the target business account based on the contract attribute information.
  9. 根据权利要求8所述的装置,其中,所述第一获取单元,包括:The device according to claim 8, wherein the first acquisition unit includes:
    第一呈现模块,被配置为响应于接收到用于指示创建智能合约的创建请求,呈现预设页面;以及A first rendering module configured to render a preset page in response to receiving a creation request indicating creation of a smart contract; and
    获取模块,被配置为基于所述预设页面,获取用户确定的合约属性信息。 The acquisition module is configured to acquire the contract attribute information determined by the user based on the preset page.
  10. 根据权利要求8所述的装置,其中,所述装置包括:The device of claim 8, wherein said device includes:
    第二呈现模块,被配置为响应于检测到账户认证信息,呈现合约创建页面;以及The second presentation module is configured to present the contract creation page in response to detecting the account authentication information; and
    接收模块,被配置为基于所述合约创建页面接收所述用于指示创建智能合约的创建请求。A receiving module configured to receive the creation request for instructing the creation of a smart contract based on the contract creation page.
  11. 根据权利要求8所述的装置,其中,所述第一获取单元,包括:The device according to claim 8, wherein the first acquisition unit includes:
    秘钥生成模块,被配置为响应于确定不存在所述目标业务账户,生成随机秘钥;以及a secret key generation module configured to generate a random secret key in response to determining that the target business account does not exist; and
    账户生成模块,被配置为基于所述随机秘钥创建业务账户,并将创建的所述业务账户确定为所述目标业务账户。An account generation module is configured to create a business account based on the random secret key, and determine the created business account as the target business account.
  12. 根据权利要求11所述的装置,其中,所述装置还包括:The device of claim 11, further comprising:
    第三获取单元,被配置为获取所述目标业务账户的资源配置信息;The third acquisition unit is configured to acquire the resource configuration information of the target business account;
    所述生成单元,包括:The generation unit includes:
    生成模块,被配置为基于所述合约属性信息、以及所述目标业务账户的资源配置信息,在所述目标业务账户中生成智能合约。A generation module configured to generate a smart contract in the target business account based on the contract attribute information and the resource configuration information of the target business account.
  13. 根据权利要求8-12之一所述的装置,其中,所述合约属性信息包括以下至少一项:智能合约的合约逻辑、智能合约实现的分布式应用所部署的区块链的类型、智能合约的语言类型、智能合约的调用方式。The device according to one of claims 8-12, wherein the contract attribute information includes at least one of the following: contract logic of the smart contract, type of blockchain deployed by the distributed application implemented by the smart contract, smart contract Language type and smart contract calling method.
  14. 根据权利要求8-12之一所述的装置,其中,所述装置还包括:The device according to one of claims 8-12, wherein the device further includes:
    响应于接收到针对所述智能合约的更新请求,基于所述更新请求更新所述智能合约。In response to receiving an update request for the smart contract, the smart contract is updated based on the update request.
  15. 一种电子设备,包括: An electronic device including:
    至少一个处理器;以及at least one processor; and
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-7中任一项所述的方法。The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any one of claims 1-7 Methods.
  16. 一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行权利要求1-7中任一项所述的方法。 A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.
PCT/CN2023/077153 2022-03-10 2023-02-20 Method and device for generating smart contract WO2023169193A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210229854.1 2022-03-10
CN202210229854.1A CN114661274A (en) 2022-03-10 2022-03-10 Method and device for generating intelligent contract

Publications (1)

Publication Number Publication Date
WO2023169193A1 true WO2023169193A1 (en) 2023-09-14

Family

ID=82029646

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/077153 WO2023169193A1 (en) 2022-03-10 2023-02-20 Method and device for generating smart contract

Country Status (2)

Country Link
CN (1) CN114661274A (en)
WO (1) WO2023169193A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114661274A (en) * 2022-03-10 2022-06-24 京东科技信息技术有限公司 Method and device for generating intelligent contract

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175842A (en) * 2019-03-27 2019-08-27 阿里巴巴集团控股有限公司 Transfer account method, system, calculating equipment and storage medium based on block chain
CN110599132A (en) * 2019-09-24 2019-12-20 腾讯科技(深圳)有限公司 Method and device for generating reward data and computer readable storage medium
US20200334674A1 (en) * 2019-04-19 2020-10-22 Coinbase, Inc. Systems and methods for blockchain administration
CN112163949A (en) * 2020-09-25 2021-01-01 湖南和信安华区块链科技有限公司 Intelligent contract generation method and device based on contract component imaging
US20210327007A1 (en) * 2020-08-28 2021-10-21 Alipay (Hangzhou) Information Technology Co., Ltd. Signing methods, apparatuses and devices of electronic contract
CN114661274A (en) * 2022-03-10 2022-06-24 京东科技信息技术有限公司 Method and device for generating intelligent contract

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175842A (en) * 2019-03-27 2019-08-27 阿里巴巴集团控股有限公司 Transfer account method, system, calculating equipment and storage medium based on block chain
US20200334674A1 (en) * 2019-04-19 2020-10-22 Coinbase, Inc. Systems and methods for blockchain administration
CN110599132A (en) * 2019-09-24 2019-12-20 腾讯科技(深圳)有限公司 Method and device for generating reward data and computer readable storage medium
US20210327007A1 (en) * 2020-08-28 2021-10-21 Alipay (Hangzhou) Information Technology Co., Ltd. Signing methods, apparatuses and devices of electronic contract
CN112163949A (en) * 2020-09-25 2021-01-01 湖南和信安华区块链科技有限公司 Intelligent contract generation method and device based on contract component imaging
CN114661274A (en) * 2022-03-10 2022-06-24 京东科技信息技术有限公司 Method and device for generating intelligent contract

Also Published As

Publication number Publication date
CN114661274A (en) 2022-06-24

Similar Documents

Publication Publication Date Title
CN110795195B (en) Webpage rendering method and device, electronic equipment and storage medium
WO2018072634A1 (en) Application processing method and device
US11403117B2 (en) Methods for processing mini program, and related devices
US9021507B2 (en) Dynamic use of data across multiple programs
CN111930521A (en) Method and device for deploying application, electronic equipment and readable storage medium
WO2021023149A1 (en) Method and apparatus for dynamically returning message
CN110727434B (en) Rendering method, rendering device, electronic equipment and storage medium
WO2021243589A1 (en) Prioritizing sequential application tasks
US11734454B2 (en) Method for providing applet service capability, electronic device, and storage medium
US11843674B2 (en) Virtual workspace experience visualization and optimization
US20210319347A1 (en) Fast and scalable multi-tenant serve pool for chatbots
CN111752843A (en) Method, device, electronic equipment and readable storage medium for determining influence surface
CN112015468B (en) Interface document processing method and device, electronic equipment and storage medium
WO2023169193A1 (en) Method and device for generating smart contract
CN114089974A (en) Cloud code development system, method, device, equipment and storage medium
CN112506854A (en) Method, device, equipment and medium for storing page template file and generating page
EP3828739B1 (en) Parallelization of authentication strategies
CN112069137B (en) Method, device, electronic equipment and computer readable storage medium for generating information
CN111966877B (en) Front-end service method, device, equipment and storage medium
CN111615171B (en) Access method and device of wireless local area network
WO2018145574A1 (en) Information processing method and device, terminal, server and storage medium
US11558207B2 (en) Method and apparatus for starting up blockchain system, and non-transitory computer-readable storage medium
CN113691403A (en) Topological node configuration method, related device and computer program product
CN112559867A (en) Business content output method, device, equipment, storage medium and program product
CN114817794A (en) Webpage content control method, device, equipment and medium

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

Country of ref document: EP

Kind code of ref document: A1