WO2021228151A1 - 系统合约的创建 - Google Patents
系统合约的创建 Download PDFInfo
- Publication number
- WO2021228151A1 WO2021228151A1 PCT/CN2021/093380 CN2021093380W WO2021228151A1 WO 2021228151 A1 WO2021228151 A1 WO 2021228151A1 CN 2021093380 W CN2021093380 W CN 2021093380W WO 2021228151 A1 WO2021228151 A1 WO 2021228151A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- alliance chain
- target
- basic
- business
- alliance
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Definitions
- This specification relates to the field of blockchain technology, and in particular to a method and device for creating a system contract.
- the blockchain is divided into public blockchain, private blockchain, and consortium blockchain according to the degree of openness.
- the consortium chain is a blockchain network built for members of a specific group and limited third parties. Under the premise of decentralization, non-tampering, trustworthiness and other characteristics of blockchain technology, it has further added The access mechanism is jointly maintained by the members of the alliance chain.
- this specification provides a method and device for creating a system contract.
- a method for creating a system contract includes: obtaining a set of business rules corresponding to the basic alliance chain code, and the set of business rules includes at least one Business rules of the business type; in response to the selection instruction of the alliance chain members for the business rules, select the target business rule from the set of business rules; according to the target business type to which the target business rule belongs, and the predefined business types and all According to the corresponding relationship between the reserved interfaces in the basic alliance chain code, the target reserved interface corresponding to the target service type is determined; and the target system contract is created based on the target reserved interface and the target business rules.
- a device for creating a system contract includes: a first acquiring unit that acquires a set of business rules corresponding to the basic alliance chain code, and the set of business rules includes at least one business type
- the selection unit in response to the selection instruction of the alliance chain members for the business rules, selects the target business rule from the set of business rules; the determination unit, according to the target business type to which the target business rule belongs, and the predefined The correspondence between the service type and the reserved interface in the basic alliance chain code is determined, and the target reserved interface corresponding to the target service type is determined; the creation unit is based on the target reserved interface and the target business rule Create the target system contract.
- an electronic device including: a processor; a memory for storing executable instructions of the processor; wherein the processor executes the executable instructions to achieve the same as described in the first aspect The method described.
- a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method described in the first aspect.
- Fig. 1 is a schematic diagram of creating and deploying a system contract according to an exemplary embodiment of this specification.
- Fig. 2 is a flowchart of a method for creating a system contract shown in an exemplary embodiment of the present specification.
- Fig. 3 is a flowchart of a method for creating a system contract in the process of deploying a consortium chain according to an exemplary embodiment of this specification.
- Fig. 4 is a flowchart of a method for deploying a system contract in a consortium chain according to an exemplary embodiment of this specification.
- Fig. 5 is a schematic structural diagram of an electronic device shown in an exemplary embodiment of this specification.
- Fig. 6 is a block diagram of a device for creating a system contract according to an exemplary embodiment of this specification.
- first, second, third, etc. may be used in this specification to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
- first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
- word “if” as used herein can be interpreted as "when” or “when” or “in response to certainty”.
- Fig. 1 is a schematic diagram of creating and deploying a system contract according to an exemplary embodiment of this specification.
- members of the alliance chain can entrust the developer of the alliance chain technology to develop the alliance chain system.
- the developer of the alliance chain technology can write a basic alliance chain code on the developer’s device 11 shown in Figure 1 to create the general alliance chain system shown in Figure 1, which can realize The basic functions of the alliance chain.
- Fig. 2 is a flowchart of a method for creating a system contract shown in an exemplary embodiment of the present specification. As shown in Figure 2, the method may include the following steps:
- Step 202 Obtain a business rule set corresponding to the basic alliance chain code, where the business rule set includes business rules of at least one business type.
- the technical solution in this manual is applied to the equipment used by any alliance chain member.
- the equipment can be common user terminals, such as mobile phones, PCs (Personal Computers), tablet computers, notebook computers, and PDAs (Personal Computers). Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), etc., one or more embodiments of this specification do not limit this.
- Consortium chain is a kind of block chain created for specific groups. Different groups often have different governance requirements for consortium chain. For example, in a consortium chain, the leader of a specific company needs to control the authority to create an account, then the leader of a specific company can be determined as the administrator, and the business rule of "account created by the administrator" can be formulated in the created system contract ; In another consortium chain, all consortium chain members need to jointly decide whether or not to create an account, so the business rules of "create an account by voting by consortium chain members" can be formulated in the created system contract. It can be seen that for the governance needs of different alliance chains, different system contracts need to be created.
- this specification pre-creates a business rule set, which contains business rules for meeting different governance requirements.
- these business rules can be divided into different business types according to the governance direction involved, for example, they can be divided into account creation, node creation, contract deployment, and so on.
- each business type can include multiple business rules.
- the business type of account creation can include the aforementioned "account created by the administrator" and “account created by the members of the alliance chain” and other business rules;
- the node creates this Business types may include "nodes created by members of a specific enterprise in the consortium chain", "nodes created by members of the consortium chain by voting" and so on.
- the above examples are only illustrative, and which business types are included in the business rule set and which business rules are included in each business type can be set by those skilled in the art according to actual conditions, and are not limited here.
- Step 204 In response to a business rule selection instruction from a member of the alliance chain, a target business rule is selected from the set of business rules.
- the device used by the consortium chain member can display the creation option of a system contract.
- the device can further show the consortium chain member several alternatives contained in the business rule set Business rules.
- the alliance chain member only needs to trigger at least one of several business rule sets, and the device can receive a selection instruction for business rules.
- the alliance chain members only need to select the corresponding business rule from the set of candidate business rules according to their own governance needs to send the selection instruction for the business rule.
- Step 206 According to the target service type to which the target business rule belongs, and the correspondence between the predefined service type and the reserved interface in the basic alliance chain code, determine the target preset corresponding to the target service type. Leave the interface.
- the basic alliance chain code in this specification can be understood as the code used to construct the above-mentioned general alliance chain system.
- the basic alliance chain code contains several reserved interfaces, which are related to the basic functions defined in the basic alliance chain code. For example, "create account”, “create node”, “deploy contract”, etc. are all defined by the alliance chain Basic functions.
- business rules define how to implement these basic functions, such as creating accounts through voting, and creating accounts by administrators. It can be seen that on the basis of the foregoing business rule set containing several different business rules, the corresponding relationship between the predefined service type and the reserved interface may also be included. For example, the corresponding relationship shown in Table 1 below may be included.
- the above-mentioned set of business rules and the basic alliance chain code can be provided by the developer of the alliance chain technology.
- the developer of the alliance chain technology can pre-write the basic alliance chain code, and reserve a number of interfaces in the basic alliance chain code, and further, save the compiled business rule codes in the business rule set, and establish similar
- the corresponding relationship shown in Table 1 above is for alliance chain members to create system contracts that meet governance requirements by selecting business rules.
- the developer of the alliance chain technology can save the above-mentioned basic alliance chain code and the code of the business rule set into the system contract creation tool described above, so that the user can create a system contract through the creation tool.
- the consortium chain developer can provide an application program for creating a target system contract, and embed the above-mentioned basic consortium chain code and business rule set into the application program as a tool for creating the system contract.
- Step 208 Create a target system contract based on the target reserved interface and the target business rule.
- the reserved interface is related to the basic function defined in the basic alliance chain code, and the business rules define the specific way to realize the basic function. It can be seen that the created target system contract is used to implement business expansion for the corresponding basic functions through the target reserved interface.
- the system contract can be deployed at the same time as the alliance chain is deployed. Specifically, after obtaining the basic alliance chain code, the basic alliance chain code and the target system contract can be combined to form an extended alliance chain code, and the extended alliance chain code can be deployed to the devices of the alliance chain members to form a corresponding alliance chain.
- the extended alliance chain code is also deployed to the devices of other alliance chain members to form blockchain nodes corresponding to other alliance chain members. All blockchain nodes constitute the alliance chain network .
- this method completes the deployment of the target system contract, so that there is no need to separately execute the operation of deploying the target system contract, and the efficiency of deploying the system contract is improved.
- the operations of deploying the alliance chain and deploying the system contract can be performed separately.
- the basic alliance chain code can be deployed to the devices of the alliance chain members to form a blockchain node corresponding to the alliance chain member.
- the basic alliance chain code also It is deployed to the devices of other alliance chain members to form blockchain nodes corresponding to other alliance chain members. All blockchain nodes constitute the alliance chain network; after the deployment of the alliance chain is completed, the alliance chain members can report to the alliance chain.
- the blockchain node in the chain network submits a deployment transaction for the target system contract to deploy the target system contract to each blockchain node in the alliance chain network.
- the blockchain node can reach a consensus on the deployment transaction, and if the consensus is passed, each blockchain node can deploy the target system contract to the local by executing the deployment transaction.
- Regional block chain node The method separately executes the operations of deploying the alliance chain and deploying the system contract, so that the code of the system contract does not need to be implanted in the basic code of the alliance chain, making the deployment of the system contract more flexible, and facilitating subsequent modification or expansion of the system contract.
- the deployment of system contracts can also be restricted to prevent loopholes due to the flexibility of the deployment process.
- the blockchain node can verify the deployment transaction, and in the case where all or more than a preset proportion of the members in the basic alliance chain deployed above sign the deployment transaction, The deployment operation of the target system contract is completed by executing the deployment transaction, otherwise the deployment transaction is not executed to prevent the deployment of the target system contract.
- the system contract created by the above method may involve one or more business rules, and these business rules may belong to the same business type or multiple business types.
- alliance chain members can select any business rule in each business type shown in Table 1 to create a system contract; they can also select multiple business rules in any business type shown in Table 1
- the system contract contains both the business rules of "account created by the administrator" and the business rules of "voting to create an account”. Account. It is worth noting that only when the same type of business rules do not have mutual exclusion, a system contract is allowed to contain multiple business rules of the same type.
- the set of business rules contains several business rules belonging to different business types. Among them, different business rules are used to create system contracts that meet different governance requirements.
- the members of the alliance chain only need to select the corresponding business rules from the set of business rules to create a system contract that meets the governance requirements of the alliance chain.
- Fig. 3 is a flowchart of a method for creating a system contract in the process of deploying a consortium chain according to an exemplary embodiment of the present specification.
- the method is applied to devices used by members of the consortium chain.
- the method may include the following steps: step 301, Receive the alliance chain deployment request sent by the alliance chain member.
- the deployment of a consortium chain jointly managed by several enterprises is taken as an example.
- the members of these enterprises who need to participate in the management of the consortium chain can all be members of the consortium chain in this embodiment.
- the equipment used by member A can be pre-configured with the alliance chain deployment tool provided by the alliance chain technology developer, for example, it can be an application for deploying the alliance chain.
- member A can initiate the deployment request of the alliance chain by triggering the alliance chain deployment option in the application.
- step 302 a prompt for creating a system contract is displayed to the members of the alliance chain.
- the member's device after the member's device detects the deployment request of the alliance chain, it can show the user a prompt message for creating a system contract to prompt the user A to create a system contract.
- Step 303 Receive a system contract creation request sent by a member of the alliance chain.
- Step 304 Show several candidate business rules contained in the business rule set to the members of the alliance chain.
- the device of member A can obtain several candidate business rules included in the pre-created business rule set. Taking the two business types of "contract deployment” and “account creation” as examples, the business rules shown in Table 2 below can be displayed.
- Step 305 Receive a selection instruction from a member of the alliance chain.
- the members of the alliance chain can select target business rules from a number of alternative business rules according to the governance requirements of the alliance chain.
- member A when member A sees the business rules shown in Table 2, he can select the corresponding business rules according to the governance requirements of the alliance chain to be deployed.
- the members of the alliance chain believe that: allowing all members to deploy contracts can brainstorm and broaden the functions that the alliance chain can achieve, and then decide that all alliance chain members can deploy contracts; and for the creation of accounts, it is considered that it needs to be Specialized personnel manage it, and then decide that only the administrator has the authority to create accounts.
- member A can select the two business rules "All members can deploy contracts" and "Administrators can create accounts” according to the above governance requirements.
- Step 306 Select a target business rule from a number of candidate business rules according to the selection instruction of the alliance chain member.
- Step 307 Determine the target business type to which the target business rule belongs.
- the relationship between the two target business rules and business types selected by member A is: "All members can perform contract deployment” belong to the business type "Contract deployment”; “Administrators can create accounts” It belongs to the business type of "account creation”.
- Step 308 Determine the target reserved interface corresponding to the target service type in the basic alliance chain code.
- the device of member A may also store the correspondence between business rules and business types as shown in Table 3.
- Step 309 Create a target system contract based on the target reserved interface and target business rules.
- the target system contract can be created based on the correspondence between interface 1 and "all members can deploy contracts", and the correspondence between interface 2 and "administrators can create accounts”.
- Step 310 Generate an extended alliance chain code based on the target system contract and the basic alliance chain code.
- the extended alliance chain code can be formed based on the target system contract and the basic alliance chain code.
- the extended consortium chain code already contains the target system contract created according to the governance requirements of the consortium chain. Therefore, the consortium chain deployed based on the extended consortium chain code can meet the governance requirements put forward by the members of the consortium chain.
- Step 311A deploy the extended consortium chain code on the local device to form a blockchain node corresponding to the consortium chain member.
- step 311B the extended alliance chain code is sent to devices used by other alliance chain members, so that the extended alliance chain code is deployed in the devices of other alliance chain members, thereby forming blockchain nodes corresponding to other alliance chain members.
- the extended consortium chain code after obtaining the extended consortium chain code, on the one hand, it can be deployed on the local device.
- the extended consortium chain code can be sent to other consortium chain codes so that the extended consortium chain code can be deployed to In the equipment of other alliance chain members, blockchain nodes corresponding to other alliance chain members are formed, and all blockchain nodes constitute a blockchain network.
- the technical solution of this specification can create a system contract in the process of deploying the alliance chain without separately deploying the created system contract, which improves the efficiency of deploying the system contract.
- Fig. 4 is a method for deploying a system contract in a consortium chain according to an exemplary embodiment of this specification.
- the method is applied to any blockchain node in the consortium chain.
- the method may include the following steps: step 401, receiving the consortium Deployment transactions submitted by chain members.
- this embodiment does not create a target system contract during the deployment of the consortium chain, but deploys the created target system contract by submitting a deployment transaction to the blockchain nodes in the deployed consortium chain .
- the created alliance chain may be a basic alliance chain deployed based on the above-mentioned basic alliance chain code.
- the target system contract included in the deployment transaction can be created by the alliance chain members based on their own alliance chain governance requirements through methods such as step 303 to step 309, which will not be repeated here.
- all members in the consortium chain can sign the deployment transaction to indicate that they agree to deploy the target system contract in the deployment transaction to the consortium chain.
- the signing process is completed before submitting the deployment transaction to the blockchain node.
- a certain alliance chain member completes the creation of the target system contract
- they can sign the deployment transaction containing the target system contract by themselves, and the other
- the deployment transaction containing the target system contract can be sent to other consortium chain members through the instant messaging application, and other consortium chain members can also sign the deployment transaction after viewing it.
- Step 402 Perform a consensus on the deployment transaction with other blockchain nodes in the alliance chain network, and determine whether the consensus is passed; if the consensus is passed, step 403 is executed; otherwise, step 405 is executed.
- the deployment contract can be executed through the consensus mechanism of the alliance chain, and then the target system contract is deployed.
- a conventional POW (Proof of Work) consensus mechanism or a PBFT (Practical Byzantine Fault Tolerance, Byzantine Fault Tolerance) consensus mechanism may be used, or other consensus mechanisms may be used, which is not limited here.
- step 403 the deployment transaction is verified; if the verification is passed, step 404 is executed; otherwise, step 405 is executed.
- the deployment transaction can be verified through a preset verification standard.
- the signature verification standard may be: if more than half of the alliance chain members sign the deployment transaction, the signature verification is passed. Then, in this step, it is possible to determine whether the signature verification is passed by judging whether the number of signatures carried in the received deployment transaction exceeds half of the number of alliance chain members; if it exceeds, the verification is passed and step 404 is executed; otherwise, step 405 is executed. .
- Step 404 execute the deployment transaction to deploy the target system contract to the local blockchain node.
- the blockchain node can execute the deployment contract , Deploy the target system contract to the local blockchain node.
- Step 405 Do not execute the deployment transaction.
- the system contract is deployed by submitting a deployment transaction to the blockchain node, so that the deployment of the alliance chain and the deployment of the system contract are performed separately.
- the target system contract code in this embodiment does not need to be implanted into the basic code of the alliance chain, which makes the process of deploying the system contract more flexible and facilitates subsequent modification or expansion of the system contract.
- Fig. 5 is a schematic structural diagram of an electronic device according to an exemplary embodiment of this specification.
- the electronic device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510.
- the processor 502 reads the corresponding computer program from the non-volatile memory 510 to the memory 508 and then runs it to form a system contract creation device on a logical level.
- this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, etc. That is to say, the execution body of the following processing flow is not limited to each logic unit, and can also be Hardware or logic device.
- the system contract creation device may include: a first obtaining unit 601, which obtains a set of business rules corresponding to the basic alliance chain code, and the set of business rules contains at least one type of business Business rules; selection unit 602, in response to the alliance chain members’ selection instructions for business rules, select target business rules from the set of business rules; determining unit 603, based on the target business type to which the target business rules belong, and pre-defined The corresponding relationship between the service type and the reserved interface in the basic alliance chain code is determined to determine the target reserved interface corresponding to the target service type; the creation unit 604 is based on the target reserved interface and the target reserved interface The business rules create the target system contract.
- the reserved interface is related to a basic function defined in the basic alliance chain code, and the target system contract is used to implement business expansion for the corresponding basic function through the target reserved interface.
- it further includes: a display unit 605, in response to a system contract creation request initiated by the alliance chain member, displaying to the alliance chain member several candidate business rules contained in the business rule set; a receiving unit 606, When at least one candidate business rule in the business rule set is triggered, a selection instruction for the business rule is received.
- it further includes: a second obtaining unit 607, which obtains the basic alliance chain code, and the basic alliance chain code and the target system contract form an extended alliance chain code; a first deployment unit 608, which deploys the extended alliance Chain code to form a blockchain node corresponding to the alliance chain member; wherein the extended alliance chain code is also deployed to the devices of other alliance chain members to form a blockchain node corresponding to other alliance chain members Nodes, all blockchain nodes constitute a consortium chain network.
- it further includes: a second deployment unit 609, which deploys the basic alliance chain code to form a blockchain node corresponding to the alliance chain members; wherein the basic alliance chain code is also deployed to other alliances In the equipment of the chain members, the blockchain nodes corresponding to other alliance chain members are formed, and all the blockchain nodes constitute the alliance chain network; the submission unit 610 submits to the blockchain nodes in the alliance chain network the A deployment transaction of a target system contract to deploy the target system contract to each blockchain node of the alliance chain network.
- a signing unit 611 which signs the deployment transaction, and the deployment transaction is also signed by other members in the basic alliance chain; wherein, each block chain node of the alliance chain network
- the verification condition of the deployment transaction includes: the deployment transaction is signed by all or more than a preset proportion of the members in the basic alliance chain.
- the relevant part can refer to the part of the description of the method embodiment.
- the device embodiments described above are merely illustrative, where the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in this specification. Those of ordinary skill in the art can understand and implement without creative work.
- a non-transitory computer-readable storage medium including instructions, such as a memory including instructions, which can be executed by the processor of the system contract creation device to implement any of the The method described in 1, for example, the method may include: obtaining a set of business rules corresponding to the basic alliance chain code, the set of business rules containing business rules of at least one type of business; , Select a target business rule from the set of business rules; determine according to the target business type to which the target business rule belongs, and the correspondence between the predefined business type and the reserved interface in the basic alliance chain code A target reservation interface corresponding to the target service type; and a target system contract is created based on the target reservation interface and the target business rule.
- non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc., which is not limited in this specification.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Business, Economics & Management (AREA)
- Finance (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Accounting & Taxation (AREA)
- Software Systems (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- General Business, Economics & Management (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
一种系统合约的创建方法及装置;该方法包括:获取基础联盟链代码对应的业务规则集合,所述业务规则集合中包含至少一种业务类型的业务规则(202);响应于联盟链成员针对业务规则的选取指令,从所述业务规则集合中选取目标业务规则(204);根据所述目标业务规则所属的目标业务类型,以及预先定义的业务类型与所述基础联盟链代码中的预留接口之间的对应关系,确定与所述目标业务类型对应的目标预留接口(206);基于所述目标预留接口和所述目标业务规则创建目标系统合约(208)。
Description
本说明书涉及区块链技术领域,特别涉及一种系统合约的创建方法及装置。
随着区块链技术的不断发展,为了满足用户在不同场景的需求,区块链按照开放程度被划分为公有链(Public blockchain)、私有链(Private blockchain)和联盟链(Consortium blockchain)。其中,联盟链是针对某个特定群体的成员和有限的第三方构建的区块链网络,在具有区块链技术去中心化、不可篡改、可信任等多种特性的前提下,进一步加入了准入机制,并由联盟链中的成员共同维护。
发明内容
有鉴于此,本说明书提供一种系统合约的创建方法及装置。
本说明书提供技术方案如下:根据本说明书的第一方面,提出了一种系统合约的创建方法,该方法包括:获取基础联盟链代码对应的业务规则集合,所述业务规则集合中包含至少一种业务类型的业务规则;响应于联盟链成员针对业务规则的选取指令,从所述业务规则集合中选取目标业务规则;根据所述目标业务规则所属的目标业务类型,以及预先定义的业务类型与所述基础联盟链代码中的预留接口之间的对应关系,确定与所述目标业务类型对应的目标预留接口;基于所述目标预留接口和所述目标业务规则创建目标系统合约。
根据本说明书的第二方面,提出了一种系统合约的创建装置,该装置包括:第一获取单元,获取基础联盟链代码对应的业务规则集合,所述业务规则集合中包含至少一种业务类型的业务规则;选取单元,响应于联盟链成员针对业务规则的选取指令,从所述业务规则集合中选取目标业务规则;确定单元,根据所述目标业务规则所属的目标业务类型,以及预先定义的业务类型与所述基础联盟链代码中的预留接口之间的对应关系,确定与所述目标业务类型对应的目标预留接口;创建单元,基于所述目标预留接口和所述目标业务规则创建目标系统合约。
根据本说明书的第三方面,提供一种电子设备,包括:处理器;用于存储处理器可 执行指令的存储器;其中,所述处理器通过运行所述可执行指令以实现如第一方面所述的方法。
根据本说明书的第四方面,提供一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面所述方法的步骤。
图1是本说明书一示例性实施例示出的一种创建并部署系统合约的示意图。
图2是本说明书一示例性实施例示出的一种系统合约的创建方法的流程图。
图3是本说明书一示例性实施例示出的一种在部署联盟链过程中创建系统合约的方法的流程图。
图4是本说明书一示例性实施例示出的一种在联盟链中部署系统合约的方法的流程图。
图5是本说明书一示例性实施例示出的一种电子设备的结构示意图。
图6是本说明书一示例性实施例示出的一种系统合约的创建装置的框图。
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书的一些方面相一致的装置和方法的例子。
在本说明书使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书。在本说明书和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本说明书可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在…… 时”或“当……时”或“响应于确定”。
图1是本说明书一示例性实施例示出的一种创建并部署系统合约的示意图。
在本说明书中,联盟链成员可以委托联盟链技术的研发方研发联盟链系统。为此,联盟链技术的研发方可以在如图1所示的研发方设备11上编写基础联盟链代码,以用于创建如图1所示的通用联盟链系统,该通用联盟链系统可以实现联盟链所具有的基础功能。
在实际应用中,不同联盟链往往存在不同的治理需求,因此,需要对上述基础功能进行功能扩展,而功能扩展则需要通过创建系统合约来实现,为此,本说明书提出了一种系统合约的创建方法,在该方法中,由联盟链技术的研发方提供一系统合约创建工具,联盟链成员可以使用该工具自行创建满足治理需求的系统合约。进一步的,即可基于创建的系统合约和上述基础联盟链代码部署如图1所示的扩展联盟链系统。
图2是本说明书一示例性实施例示出的一种系统合约的创建方法的流程图。如图2所示,该方法可以包括以下步骤:
步骤202,获取基础联盟链代码对应的业务规则集合,所述业务规则集合中包含至少一种业务类型的业务规则。
本说明书的技术方案应用于任一联盟链成员所使用的设备,该设备可以为常见的用户终端,比如手机、PC(Personal Computer,个人计算机)、平板电脑、笔记本电脑、掌上电脑(PDAs,Personal Digital Assistants)、可穿戴设备(如智能眼镜、智能手表等)等,本说明书一个或多个实施例并不对此进行限制。
联盟链是一种针对特定群体创建的区块链,不同的群体往往对联盟链存在不同的治理需求。例如,在一联盟链中,需要由特定企业的领导掌控创建账号的权限,那么可以将特定企业的领导确定为管理员,并在创建的系统合约中制定“由管理员创建账户”的业务规则;而在另一联盟链中,需要由所有联盟链成员共同决定是否可以创建账户,那么可以在创建的系统合约中制定“由联盟链成员投票创建账户”的业务规则。可见,针对不同联盟链的治理需求,需要创建不同的系统合约。
为此,本说明书预先创建了业务规则集合,该业务规则集合中包含有用于满足不同治理需求的业务规则。其中,这些业务规则可以按照所涉及的治理方向划分为不同的业务类型,例如,可以划分为账号创建、节点创建、合约部署等。而每一业务类型可以包括多个业务规则,例如,账号创建这一业务类型可以包括上述“由管理员创建账户”和 “由联盟链成员投票创建账户”等多种业务规则;节点创建这一业务类型可以包括“由联盟链中特定企业的成员创建节点”、“由联盟链成员投票创建节点”等。当然,上述举例仅是示意性的,业务规则集合中包含哪些业务类型以及各个业务类型包含哪些业务规则,可由本领域技术人员根据实际情况设定,在此不作限定。
步骤204,响应于联盟链成员针对业务规则的选取指令,从所述业务规则集合中选取目标业务规则。
在本说明书中,联盟链成员所使用的设备可以展示一系统合约的创建选项,当该联盟链成员触发该创建选项时,设备可以进一步向该联盟链成员展示业务规则集合中包含的若干备选业务规则,此时,该联盟链成员只需触发若干业务规则集合中的至少一个,该设备便可接收到针对业务规则的选取指令。换言之,联盟链成员只需根据自身治理需求从备选业务规则集合中选取相应的业务规则即可发送针对该业务规则的选取指令。
步骤206,根据所述目标业务规则所属的目标业务类型,以及预先定义的业务类型与所述基础联盟链代码中的预留接口之间的对应关系,确定与所述目标业务类型对应的目标预留接口。
本说明书中的基础联盟链代码可以理解为用于构建上述通用联盟链系统的代码。基础联盟链代码中包含有若干预留接口,这些预留接口与基础联盟链代码中定义的基础功能相关,例如,“创建账户”、“创建节点”、“部署合约”等均为联盟链定义的基础功能。在此基础上,业务规则定义了具体如何实现这些基础功能,如上述通过投票方式创建账户、由管理员创建账户等。可见,在上述业务规则集合中包含若干不同业务规则的基础上,还可以包括预定义的业务类型与预留接口之间的对应关系,举例而言,可以包括如下表1所示的对应关系。
表1
参见上表1,在联盟链成员选取“由管理员创建账户”这一业务规则时,即可确定其属于“账户创建”这一业务类型,进而确定对应的目标预留接口为接口1。
在本说明书中,上述业务规则集合,以及基础联盟链代码可由联盟链技术的研发方提供。具体的,联盟链技术的研发方可以预先编写基础联盟链代码,并在基础联盟链代码中预留若干接口,进一步的,将编写完成的若干业务规则代码保存在业务规则集合中,并建立类似上表1所示的对应关系,以供联盟链成员通过选取业务规则创建满足治理需求的系统合约。具体的,联盟链技术的研发方可以将上述基础联盟链代码,以及业务规则集合的代码保存至上文所述的系统合约创建工具中,使得用户可以通过该创建工具创建系统合约。举例而言,联盟链研发方可以提供一用于创建目标系统合约的应用程序,并将上述基础联盟链代码以及业务规则集合植入在该应用程序中,以作为该系统合约创建工具。
步骤208,基于所述目标预留接口和所述目标业务规则创建目标系统合约。
预留接口与基础联盟链代码中定义的基础功能相关,而业务规则定义了具体实现该基础功能的方式。可见,创建的目标系统合约用于通过目标预留接口对相应的基础功能实现业务扩展。
在创建目标系统合约之后,需要将其部署至联盟链中。本说明书可以采用多种方式将目标系统合约部署至联盟链中。
在一种情况下,可以在部署联盟链的同时部署系统合约。具体的,可以在获取基础联盟链代码之后,将基础联盟链代码和目标系统合约组成扩展联盟链代码,并将该扩展联盟链代码部署至联盟链成员的设备中,进而形成对应于该联盟链成员的区块链节点,进一步的,该扩展联盟链代码还被部署至其他联盟链成员的设备中,以形成对应于其他联盟链成员的区块链节点,所有区块链节点构成联盟链网络。该方法在部署联盟链的过程中,完成了目标系统合约的部署,使得无需单独执行部署目标系统合约的操作,提高了部署系统合约的效率。
在另一种情况下,可以单独执行部署联盟链和部署系统合约的操作。具体的,可以在获取基础联盟链代码之后,将基础联盟链代码部署至联盟链成员的设备中,以形成对应于该联盟链成员的区块链节点,除此之外该基础联盟链代码还被部署至其他联盟链成员的设备中,以形成对应于其他联盟链成员的区块链节点,所有区块链节点构成联盟链网络;在完成联盟链的部署之后,该联盟链成员可以向联盟链网络中的区块链节点提交 针对目标系统合约的部署交易,以将该目标系统合约部署至联盟链网络中的各个区块链节点。具体的,区块链节点在接收到该部署交易后,可以对该部署交易进行共识,并在共识通过的情况下,各个区块链节点可以通过执行该部署交易,将目标系统合约部署至本地区块链节点。该方法单独执行部署联盟链和部署系统合约的操作,使得系统合约的代码无需植入联盟链的基础代码中,使得系统合约的部署更加灵活,方便后续对系统合约进行修改或扩展。其中,还可以对系统合约的部署进行一定的限制,以防止由于部署过程的灵活性而产生漏洞。例如,区块链节点在收到上述的部署交易后,可以对该部署交易进行验证,并在上述部署的基础联盟链中全部或超过预设比例的成员对该部署交易进行签名的情况下,才通过执行该部署交易完成对上述目标系统合约的部署操作,否则不执行该部署交易以阻止部署上述的目标系统合约。
在本说明书中,通过上述方法创建的系统合约中,可以涉及一个或多个业务规则,这些业务规则可以属于同一业务类型或多个业务类型。举例而言,联盟链成员可以在如表1所示的每一个业务类型中选择任一业务规则用于创建系统合约;也可以在如表1所示的任一业务类型中选择多个业务规则,例如,系统合约既包含“由管理员创建账户”的业务规则,又包含“投票创建账户”的业务规则,换言之,既允许管理员创建账户,又允许由联盟链成员投票决定是否创建新的账户。值得注意的是,只有在同一类型的业务规则不存在互斥性的情况下,才允许一系统合约中包含多个同一类型的业务规则,举例而言,当某一业务规则为“仅允许管理员创建账户”时,显然无法与“通过投票方式创建账户”兼容,即存在互斥性,在该情况下,一系统合约中仅允许包含一个统一类型的业务规则。
由上述技术方案可知,本说明书预先创建有业务规则集合,该业务规则集合中包含若干属于不同业务类型的业务规则,其中,不同的业务规则用于创建满足不同治理需求的系统合约,在该机制下,联盟链成员只需从业务规则集合中选取相应的业务规则即可创建满足联盟链治理需求的系统合约。通过这种方式创建系统合约,一方面无需联盟链成员掌握业务规则的编写技能;另一方面,无需联盟链技术的研发方针对不同联盟链的治理需求专门编写联盟链代码,提高了系统合约的创建效率。
图3是本说明书一示例性实施例示出的一种在部署联盟链过程中创建系统合约的方法的流程图,该方法应用于联盟链成员使用的设备,该方法可以包括以下步骤:步骤301,接收到联盟链成员发送的联盟链部署请求。
在本实施例中,以部署若干企业共同管理的联盟链为例,在该情况下,这些企业中 需要参与管理联盟链的成员均可作为本实施例中的联盟链成员。
以成员A请求部署联盟链为例进行介绍,在成员A所使用的设备中可以预先配置有联盟链技术研发方提供的联盟链部署工具,如可以为一用于部署联盟链的应用程序。此时,成员A可以通过触发该应用程序中的的联盟链部署选项,发起联盟链的部署请求。
步骤302,向联盟链成员展示创建系统合约的提示。
承接上述举例,在成员的设备检测到联盟链的部署请求后,可以向用户展示创建系统合约的提示信息,以提示用户A创建系统合约。
步骤303,接收到联盟链成员发送的系统合约创建请求。
步骤304,向联盟链成员展示业务规则集合中包含的若干备选业务规则。
承接上述举例,在接收到成员A发送的系统合约创建请求后,成员A的设备可以获取预先创建的业务规则集合中包含的若干备选业务规则。以“合约部署”和“账户创建”这两个业务类型为例,可以展示如下表2所示的业务规则。
表2
步骤305,接收联盟链成员的选取指令。
联盟链成员可以根据联盟链的治理需求,从若干备选业务规则中选取目标业务规则。
承接上述举例,当成员A看到如表2所示的业务规则后,即可根据待部署联盟链的治理需求选取相应的业务规则。假设联盟链中的成员经过讨论后认为:允许所有成员进行合约的部署,可以集思广益拓宽联盟链能够实现的功能,进而决定所有联盟链成员均可部署合约;而对于账户的创建,则认为需要由专门人员进行管理,进而决定仅由管理员拥有创建账户的权限。此时,成员A可根据上述治理需求选取“所有成员均可进行合约部署”以及“管理员可以创建账户”这两条业务规则。
步骤306,根据联盟链成员的选取指令从若干备选业务规则中选取目标业务规则。
步骤307,确定目标业务规则所属的目标业务类型。
承接上述举例,可以确定成员A选取的两个目标业务规则与业务类型之间的关系为:“所有成员均可进行合约部署”属于“合约部署”这一业务类型;“管理员可以创建账户”属于“账户创建”这一业务类型。
步骤308,确定基础联盟链代码中与目标业务类型对应的目标预留接口。
在本实施例中,成员A的设备中还可以保存有如表3所示的业务规则与业务类型之间的对应关系。
预留接口 | 业务类型 |
接口1 | 合约部署 |
接口2 | 账户创建 |
表3
此时,可以确定预留的接口1与合约部署对应,接口2与账户的账户创建对应。
步骤309,基于目标预留接口和目标业务规则创建目标系统合约。
承接上述举例,在本步骤中,可以基于接口1与“所有成员均可进行合约部署”的对应关系,以及接口2与“管理员可以创建账户”的对应关系创建目标系统合约。
步骤310,基于目标系统合约和基础联盟链代码生成扩展联盟链代码。
在创建目标系统合约之后,可以基于目标系统合约与基础联盟链代码组成扩展联盟链代码。显然,扩展联盟链代码中已包含根据联盟链治理需求创建的目标系统合约,因此,基于该扩展联盟链代码部署的联盟链能够满足联盟链成员提出的治理需求。
步骤311A,在本地设备部署扩展联盟链代码,以形成对应于该联盟链成员的区块链节点。
步骤311B,将扩展联盟链代码发送至其他联盟链成员使用的设备,以使该扩展联盟链代码被部署至其他联盟链成员的设备中,进而形成其他联盟链成员对应的区块链节点。
在本实施例中,在获得扩展联盟链代码后,一方面可以在本地设备进行部署,另一方面,可以将该扩展联盟链代码发送给其他联盟链代码,以使扩展联盟链代码被部署至其他联盟链成员的设备中,进而形成对应于其他联盟链成员的区块链节点,所有的区块链节点构成区块链网络。
由上述技术方案可知,本说明书的技术方案提供属于不同业务类型的业务规则,用户只需根据待部署联盟链的治理需求从中选取相应的业务规则,即可创建能够满足该治 理需求的系统合约,在提高系统合约创建效率的同时,无需联盟链成员掌握业务规则的编写技能。
进一步的,本说明书的技术方案可以在部署联盟链的过程中创建系统合约,而无需另行部署创建的系统合约,提高了部署系统合约的效率。
图4是本说明书一示例性实施例示出的一种在联盟链中部署系统合约的方法,该方法应用于联盟链中任一区块链节点,该方法可以包括以下步骤:步骤401,接收联盟链成员提交的部署交易。
与上一实施例不同的是,本实施例不在部署联盟链的过程中创建目标系统合约,而是通过向已部署联盟链中的区块链节点提交部署交易的方式,部署创建的目标系统合约。已创建的联盟链可以为基于上述基础联盟链代码部署的基础联盟链,具体部署过程可参照上文介绍,在此不作赘述。而部署交易中包含的目标系统合约,可以由联盟链成员基于自身的联盟链治理需求,通过如步骤303-步骤309的方法创建,在此也不作赘述。
值得注意的是,在本实施例中,联盟链中的所有成员可以对该部署交易进行签名,以表示同意将该部署交易中的目标系统合约部署至联盟链中。该签名的过程在向区块链节点提交部署交易之前完成,例如,某一联盟链成员完成目标系统合约的创建之后,一方面,可以自己对包含该目标系统合约的部署交易进行签名,另一方面,可以通过即时通讯应用将包含目标系统合约的部署交易发送给其他联盟链成员,其他联盟链成员在查看之后,也可以对该部署交易进行签名。
步骤402,与联盟链网络中其他区块链节点对所述部署交易进行共识,并判断共识是否通过;若共识通过,则执行步骤403;否则,执行步骤405。
由于本实施例在已部署的基础联盟链中部署目标系统合约,因此需要通过联盟链的共识机制才可以执行部署合约,进而对目标系统合约进行部署。本实施例可以采用常规的POW(Proof of Work,工作量证明)共识机制或者PBFT(Practical Byzantine Fault Tolerance,拜占庭容错)共识机制,也可以采用其他共识机制,在此不作限定。
步骤403,对部署交易进行验签;若验签通过,执行步骤404;否则,执行步骤405。
在本实施例中,在接收到部署交易之后,可以通过预先设置的验签标准对该部署交易进行验签。例如,该验签标准可以为:超过一半的联盟链成员对该部署交易进行签名,则验签通过。那么,本步骤可以通过判断接收到的部署交易中携带的签名数量是否超过联盟链成员数量的一半,进而确定验签是否通过;若超过,则验签通过,执行步骤404; 否则,执行步骤405。
步骤404,执行该部署交易,以将目标系统合约部署至本地区块链节点。
在本实施例中,在通过验签的情况下,即可认定联盟链中的成员同意将该部署交易中的目标系统合约部署至联盟链中,因此,区块链节点可以通过执行该部署合约,将目标系统合约部署至本地区块链节点中。
需要声明的是,在通过共识的情况下,其他区块链节点也会执行步骤403和404的步骤,以通过执行该部署交易,将目标系统合约部署至其他区块链节点中。
步骤405,不执行部署交易。
本实施例以向区块链节点提交部署交易的方式部署系统合约,使得联盟链的部署和系统合约的部署单独执行。相较于上一实施例,本实施例中的目标系统合约代码无需植入联盟链的基础代码中,使得部署系统合约的过程更加灵活,方便后续对系统合约进行修改或扩展。
图5为本说明书的一示例性实施例示出一种电子设备的示意结构图。请参考图5,在硬件层面,该电子设备包括处理器502、内部总线504、网络接口506、内存508以及非易失性存储器510,当然还可能包括其他业务所需要的硬件。处理器502从非易失性存储器510中读取对应的计算机程序到内存508中然后运行,在逻辑层面上形成系统合约的创建装置。当然,除了软件实现方式之外,本说明书并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。
请参考图6,在软件实施方式中,该系统合约的创建装置可以包括:第一获取单元601,获取基础联盟链代码对应的业务规则集合,所述业务规则集合中包含至少一种业务类型的业务规则;选取单元602,响应于联盟链成员针对业务规则的选取指令,从所述业务规则集合中选取目标业务规则;确定单元603,根据所述目标业务规则所属的目标业务类型,以及预先定义的业务类型与所述基础联盟链代码中的预留接口之间的对应关系,确定与所述目标业务类型对应的目标预留接口;创建单元604,基于所述目标预留接口和所述目标业务规则创建目标系统合约。
可选的,所述预留接口与所述基础联盟链代码中定义的基础功能相关,所述目标系统合约用于通过所述目标预留接口对相应的基础功能实现业务扩展。
可选的,还包括:展示单元605,响应于所述联盟链成员发起的系统合约创建请求, 向所述联盟链成员展示所述业务规则集合中包含的若干备选业务规则;接收单元606,在所述业务规则集合中的至少一个备选业务规则被触发的情况下,接收到针对业务规则的选取指令。
可选的,还包括:第二获取单元607,获取所述基础联盟链代码,所述基础联盟链代码和所述目标系统合约组成扩展联盟链代码;第一部署单元608,部署所述扩展联盟链代码,以形成对应于所述联盟链成员的区块链节点;其中,所述扩展联盟链代码还被部署至其他联盟链成员的设备中,以形成对应于其他联盟链成员的区块链节点,所有区块链节点构成联盟链网络。
可选的,还包括:第二部署单元609,部署所述基础联盟链代码,以形成对应于所述联盟链成员的区块链节点;其中,所述基础联盟链代码还被部署至其他联盟链成员的设备中,以形成对应于其他联盟链成员的区块链节点,所有区块链节点构成联盟链网络;提交单元610,向所述联盟链网络中的区块链节点提交针对所述目标系统合约的部署交易,以将所述目标系统合约部署至所述联盟链网络的各个区块链节点中。
可选的,还包括:签名单元611,对所述部署交易进行签名,所述部署交易还被所述基础联盟链中的其他成员签名;其中,所述联盟链网络的各个区块链节点对所述部署交易的验证条件包括:所述部署交易由所述基础联盟链中全部或超过预设比例的成员进行签名。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本说明书方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器,上述指令可由系统合约的创建装置的处理器执行以实现如上述实施例中任一所述的方法,比如该方法可以包括:获取基础联盟链代码对应的业务规则集合,所述业务规则集合中包含至少一种业务类型的业务规则;响应于联盟链成员针对业务规则的选取指令,从所述业务规则集合中选取目标业务规则;根据所述目标业务规则所属的目标业务类型,以及预先定义的业务类型与所述基础联盟链代码中的预留接口之间的对应关系,确定与所述目标业务类型对应的目标预留接口;基于所述目标预留接口和所 述目标业务规则创建目标系统合约。
其中,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等,本说明书并不对此进行限制。
以上所述仅为本说明书的较佳实施例而已,并不用以限制本说明书,凡在本说明书的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书保护的范围之内。
Claims (14)
- 一种系统合约的创建方法,包括:获取基础联盟链代码对应的业务规则集合,所述业务规则集合中包含至少一种业务类型的业务规则;响应于联盟链成员针对业务规则的选取指令,从所述业务规则集合中选取目标业务规则;根据所述目标业务规则所属的目标业务类型,以及预先定义的业务类型与所述基础联盟链代码中的预留接口之间的对应关系,确定与所述目标业务类型对应的目标预留接口;基于所述目标预留接口和所述目标业务规则创建目标系统合约。
- 根据权利要求1所述的方法,所述预留接口与所述基础联盟链代码中定义的基础功能相关,所述目标系统合约用于通过所述目标预留接口对相应的基础功能实现业务扩展。
- 根据权利要求1所述的方法,还包括:响应于所述联盟链成员发起的系统合约创建请求,向所述联盟链成员展示所述业务规则集合中包含的若干备选业务规则;在所述业务规则集合中的至少一个备选业务规则被触发的情况下,接收到针对业务规则的选取指令。
- 根据权利要求1所述的方法,还包括:获取所述基础联盟链代码,所述基础联盟链代码和所述目标系统合约组成扩展联盟链代码;部署所述扩展联盟链代码,以形成对应于所述联盟链成员的区块链节点;其中,所述扩展联盟链代码还被部署至其他联盟链成员的设备中,以形成对应于其他联盟链成员的区块链节点,所有区块链节点构成联盟链网络。
- 根据权利要求1所述的方法,还包括:部署所述基础联盟链代码,以形成对应于所述联盟链成员的区块链节点;其中,所述基础联盟链代码还被部署至其他联盟链成员的设备中,以形成对应于其他联盟链成员的区块链节点,所有区块链节点构成联盟链网络;向所述联盟链网络中的区块链节点提交针对所述目标系统合约的部署交易,以将所述目标系统合约部署至所述联盟链网络的各个区块链节点中。
- 根据权利要求5所述的方法,还包括:对所述部署交易进行签名,所述部署交易还被所述基础联盟链中的其他成员签名;其中,所述联盟链网络的各个区块链节点对所述部署交易的验证条件包括:所述部署交易由所述基础联盟链中全部或超过预设比例的成员进行签名。
- 一种系统合约的创建装置,包括:第一获取单元,获取基础联盟链代码对应的业务规则集合,所述业务规则集合中包含至少一种业务类型的业务规则;选取单元,响应于联盟链成员针对业务规则的选取指令,从所述业务规则集合中选取目标业务规则;确定单元,根据所述目标业务规则所属的目标业务类型,以及预先定义的业务类型与所述基础联盟链代码中的预留接口之间的对应关系,确定与所述目标业务类型对应的目标预留接口;创建单元,基于所述目标预留接口和所述目标业务规则创建目标系统合约。
- 根据权利要求7所述的装置,所述预留接口与所述基础联盟链代码中定义的基础功能相关,所述目标系统合约用于通过所述目标预留接口对相应的基础功能实现业务扩展。
- 根据权利要求7所述的装置,还包括:展示单元,响应于所述联盟链成员发起的系统合约创建请求,向所述联盟链成员展示所述业务规则集合中包含的若干备选业务规则;接收单元,在所述业务规则集合中的至少一个备选业务规则被触发的情况下,接收到针对业务规则的选取指令。
- 根据权利要求7所述的装置,还包括:第二获取单元,获取所述基础联盟链代码,所述基础联盟链代码和所述目标系统合约组成扩展联盟链代码;第一部署单元,部署所述扩展联盟链代码,以形成对应于所述联盟链成员的区块链节点;其中,所述扩展联盟链代码还被部署至其他联盟链成员的设备中,以形成对应于其他联盟链成员的区块链节点,所有区块链节点构成联盟链网络。
- 根据权利要求7所述的装置,还包括:第二部署单元,部署所述基础联盟链代码,以形成对应于所述联盟链成员的区块链节点;其中,所述基础联盟链代码还被部署至其他联盟链成员的设备中,以形成对应于其他联盟链成员的区块链节点,所有区块链节点构成联盟链网络;提交单元,向所述联盟链网络中的区块链节点提交针对所述目标系统合约的部署交 易,以将所述目标系统合约部署至所述联盟链网络的各个区块链节点中。
- 根据权利要求11所述的装置,还包括:签名单元,对所述部署交易进行签名,所述部署交易还被所述基础联盟链中的其他成员签名;其中,所述联盟链网络的各个区块链节点对所述部署交易的验证条件包括:所述部署交易由所述基础联盟链中全部或超过预设比例的成员进行签名。
- 一种电子设备,包括:处理器;用于存储处理器可执行任务的存储器;其中,所述处理器通过运行所述可执行指令以实现如权利要求1-6中任一项所述的方法。
- 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求1-6中任一项所述方法的步骤。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010411854.4A CN111338645B (zh) | 2020-05-15 | 2020-05-15 | 系统合约的创建方法及装置 |
CN202010411854.4 | 2020-05-15 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021228151A1 true WO2021228151A1 (zh) | 2021-11-18 |
Family
ID=71184893
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/093380 WO2021228151A1 (zh) | 2020-05-15 | 2021-05-12 | 系统合约的创建 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111338645B (zh) |
WO (1) | WO2021228151A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114553882A (zh) * | 2022-01-18 | 2022-05-27 | 广西壮族自治区信息中心 | 一种基于区块链的政务数据治理平台 |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111338645B (zh) * | 2020-05-15 | 2020-09-11 | 支付宝(杭州)信息技术有限公司 | 系统合约的创建方法及装置 |
CN112148613B (zh) * | 2020-09-28 | 2024-10-18 | 财付通支付科技有限公司 | 用于测试区块链服务的智能合约的生成方法及装置 |
CN112053274B (zh) * | 2020-10-12 | 2023-10-27 | 腾讯科技(深圳)有限公司 | 政务区块链网络的构建向导方法及装置 |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8370233B2 (en) * | 2008-03-31 | 2013-02-05 | Sap Ag | Managing consistent interfaces for business objects across heterogeneous systems |
CN109325366A (zh) * | 2018-08-22 | 2019-02-12 | 深圳前海微众银行股份有限公司 | 基于联盟链的业务处理方法、设备及计算机可读存储介质 |
CN109801152A (zh) * | 2019-01-24 | 2019-05-24 | 中国农业银行股份有限公司 | 基于区块链的企业年金业务处理方法及系统 |
CN110209575A (zh) * | 2019-05-20 | 2019-09-06 | 深圳壹账通智能科技有限公司 | 测试文档生成方法、装置、电子设备及存储介质 |
CN110941679A (zh) * | 2019-12-05 | 2020-03-31 | 腾讯科技(深圳)有限公司 | 一种合约数据处理方法、相关设备及介质 |
CN111124476A (zh) * | 2018-10-31 | 2020-05-08 | 阿里巴巴集团控股有限公司 | 业务规则配置和创建方法及装置 |
CN111338645A (zh) * | 2020-05-15 | 2020-06-26 | 支付宝(杭州)信息技术有限公司 | 系统合约的创建方法及装置 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109829296B (zh) * | 2019-01-29 | 2021-04-02 | 中化能源科技有限公司 | 基于联盟链的智能合约的沙箱实现方法 |
-
2020
- 2020-05-15 CN CN202010411854.4A patent/CN111338645B/zh active Active
-
2021
- 2021-05-12 WO PCT/CN2021/093380 patent/WO2021228151A1/zh active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8370233B2 (en) * | 2008-03-31 | 2013-02-05 | Sap Ag | Managing consistent interfaces for business objects across heterogeneous systems |
CN109325366A (zh) * | 2018-08-22 | 2019-02-12 | 深圳前海微众银行股份有限公司 | 基于联盟链的业务处理方法、设备及计算机可读存储介质 |
CN111124476A (zh) * | 2018-10-31 | 2020-05-08 | 阿里巴巴集团控股有限公司 | 业务规则配置和创建方法及装置 |
CN109801152A (zh) * | 2019-01-24 | 2019-05-24 | 中国农业银行股份有限公司 | 基于区块链的企业年金业务处理方法及系统 |
CN110209575A (zh) * | 2019-05-20 | 2019-09-06 | 深圳壹账通智能科技有限公司 | 测试文档生成方法、装置、电子设备及存储介质 |
CN110941679A (zh) * | 2019-12-05 | 2020-03-31 | 腾讯科技(深圳)有限公司 | 一种合约数据处理方法、相关设备及介质 |
CN111338645A (zh) * | 2020-05-15 | 2020-06-26 | 支付宝(杭州)信息技术有限公司 | 系统合约的创建方法及装置 |
Non-Patent Citations (1)
Title |
---|
LIAO QIUWEN: "Research on Product Traceability Scheme Based on Blockchain Technology", CHINESE MASTER’S THESES FULL-TEXT DATABASE, INFORMATION SCIENCE AND TECHNOLOGY, 15 May 2019 (2019-05-15), XP055866052 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114553882A (zh) * | 2022-01-18 | 2022-05-27 | 广西壮族自治区信息中心 | 一种基于区块链的政务数据治理平台 |
CN114553882B (zh) * | 2022-01-18 | 2024-03-19 | 广西壮族自治区信息中心 | 一种基于区块链的政务数据治理平台 |
Also Published As
Publication number | Publication date |
---|---|
CN111338645A (zh) | 2020-06-26 |
CN111338645B (zh) | 2020-09-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021228151A1 (zh) | 系统合约的创建 | |
EP3559891B1 (en) | Executing multi-party transactions using smart contracts | |
US11494344B2 (en) | Customized endorsement logic for blockchain | |
US11243945B2 (en) | Distributed database having blockchain attributes | |
CN113408746B (zh) | 一种基于区块链的分布式联邦学习方法、装置及终端设备 | |
US11769150B2 (en) | Transaction scheduling for block space on a blockchain | |
JP2021103572A (ja) | ブロックチェーンベースのデータ処理方法、装置、デバイス、記憶媒体、及びプログラム | |
TW201935384A (zh) | 資產管理方法及裝置、電子設備 | |
CN114817284A (zh) | 多租户环境中具有去中心化分类账的高级智能合约 | |
JP7228322B2 (ja) | ブロックチェーン・ネットワークにおける自動コミット・トランザクション管理 | |
TW201935383A (zh) | 資產管理方法及裝置、電子設備 | |
TWI738046B (zh) | 區塊鏈的智慧型合約執行方法及裝置和電子設備 | |
TWI726573B (zh) | 基於區塊鏈的資料壓縮、查詢方法及裝置和電子設備 | |
WO2019042176A1 (zh) | 黑名单数据交换方法及应用服务器 | |
TWI719797B (zh) | 區塊鏈中智能合約的儲存、執行方法及裝置和電子設備 | |
CN111679893B (zh) | 运行系统构建方法、装置、电子设备及存储介质 | |
CN110324399B (zh) | 将集群意识纳入设施管理门户 | |
CN110069346A (zh) | 多进程间资源共享方法、装置、电子设备 | |
JP6266588B2 (ja) | ローカル・データーおよびリモート・データーの同期 | |
WO2023231336A1 (zh) | 执行交易的方法和区块链节点 | |
WO2023231337A1 (zh) | 在区块链中执行交易的方法、区块链的主节点和从节点 | |
CN114827165A (zh) | 对多个交易进行分组的方法和区块链节点 | |
US20210073197A1 (en) | Byzantine consensus without centralized ordering | |
US8903889B2 (en) | Method, system and article for mobile metadata software agent in a data-centric computing environment | |
CN114157550B (zh) | 一种基于无冲突事务合并的联盟区块链系统 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21805008 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21805008 Country of ref document: EP Kind code of ref document: A1 |