Smart contract calling method and system supporting distributed process engine

By deploying and executing distributed process engine scripts on the blockchain, the problem of asynchronous calls between smart contracts on the blockchain is solved, achieving transparency of business processes among multiple organizations and robustness of distributed systems, and simplifying the application development process.

CN115469987BActive Publication Date: 2026-06-05BEIJING SHENZHOU DIGITAL FANGYUAN TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING SHENZHOU DIGITAL FANGYUAN TECH CO LTD
Filing Date
2022-10-12
Publication Date
2026-06-05

Smart Images

  • Figure CN115469987B_ABST
    Figure CN115469987B_ABST
Patent Text Reader

Abstract

The application provides a smart contract calling method and system supporting a distributed process engine. The method comprises the following steps: reading a process engine script on a blockchain account address, wherein the process engine script comprises a signature, called smart contract interface information, and calling sequence; reading the signature of a process engine script deployment module; verifying the signature; if the signature is correct, calling the smart contract interface asynchronously, and calling the smart contract interface driven by an event or a user asynchronously. The smart contract calling method and system supporting the distributed process engine can solve the problem of asynchronous calling between blockchain smart contracts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain technology, and in particular to a smart contract invocation method and system that supports a distributed process engine. Background Technology

[0002] In blockchain applications, smart contract calls between multiple organizations are typically involved. These calls are usually implemented outside the blockchain using non-smart contracts. These implementations generally do not have publicly available source code, and the calling methods and processing flows are opaque. The process status between multiple organizations is unknown, which fundamentally contradicts the blockchain's principles of open code and data sharing. Furthermore, business processes implemented off-chain using non-smart contracts are generally centralized, not distributed systems, and their robustness is not as high as distributed systems. The application of existing process engines in blockchain is as follows:

[0003] 201610949938.7, A collaborative system and method for cross-system process engines based on distributed deployment, proposes a collaborative system and method for cross-system process engines based on distributed deployment, including a process registration center module, a process engine kernel and extension module, a node extension and process routing module, but does not mention how to combine the process engine and blockchain smart contracts.

[0004] Patent 202110812783.3, "Blockchain-based Process Management Method, System, and Storage Medium," proposes a blockchain-based process management method, system, and storage medium. Through a process engine, the operation results of each process node can be monitored. When the operation result of a process node becomes abnormal, the process engine can control the supernode to delete the operation information of the corresponding abnormal process node. This patent only proposes applying the process engine to node monitoring on the blockchain and how to roll back the operation to its original state when an abnormal node is detected. It does not address how to use the process engine to connect and call smart contracts on different blockchains to complete a complete business process.

[0005] There are calls between different smart contracts on the blockchain, which are generally synchronous calls oriented towards processes. How to make smart contract calls between different nodes become asynchronous calls, driven by users and data, has become a challenge. Summary of the Invention

[0006] The technical problem to be solved by the present invention is to provide a smart contract invocation method and system that supports a distributed process engine, which can solve the problem of asynchronous invocation between blockchain smart contracts.

[0007] To address the aforementioned technical problems, this invention provides a smart contract invocation method supporting a distributed process engine. The method includes: reading a process engine script from a blockchain ledger address, the process engine script including a signature, information about the smart contract interfaces to be invoked, and the order of invocation; reading the signature of the process engine script deployment module; verifying the signature; and if the signature is correct, asynchronously invoking the smart contract interfaces, wherein the asynchronous invocation is driven by an event or user.

[0008] In some implementations, the process engine scripts are in XML or JSON format.

[0009] In some implementations, the signature includes: the execution content, the release date, and a signature of version information.

[0010] In some implementations, the private key used for signing is the private key of the script developer's identity on the blockchain, and this signing information is used for authentication when the script is executed subsequently.

[0011] In some implementations, the process engine script is deployed via an engine script deployment module on a blockchain system.

[0012] In some implementations, after deployment, the blockchain's storage system allocates physical storage space to store distributed engine scripts.

[0013] In some implementations, after deployment, the deployed process engine script corresponds to an address on the blockchain, through which the process engine script can be accessed.

[0014] In some implementations, signature verification includes verifying the signature via a distributed process engine module.

[0015] In some implementations, the smart contract interface is invoked asynchronously, including through a distributed process engine module.

[0016] Furthermore, the present invention also provides a smart contract invocation system supporting a distributed process engine, the system comprising: one or more processors; a storage device for storing one or more programs; and when the one or more programs are executed by the one or more processors, the one or more processors implement the smart contract invocation method supporting a distributed process engine as described above.

[0017] With this design, the present invention has at least the following advantages:

[0018] By using process engine scripts to associate multiple smart contract call flows, the problem of asynchronous calls between blockchain smart contracts is solved; at the same time, by developing and releasing process engine scripts, the development of traditional blockchain applications is replaced, achieving the problem of decentralized application and simplifying the development of blockchain applications. Attached Figure Description

[0019] The above is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0020] Figure 1 This is the overall architecture diagram of the blockchain node module;

[0021] Figure 2 This is the overall flowchart. Detailed Implementation

[0022] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0023] Working principle section:

[0024] like Figure 1 As shown, a blockchain system supporting a distributed process engine consists of many blockchain nodes. Each blockchain node module includes the following parts: a distributed process engine module, an engine script deployment module, a blockchain node core function module, and a blockchain storage module.

[0025] Core functional modules of a blockchain node: including general functions of a typical blockchain, providing core functions of a blockchain node, including consensus module, smart contract virtual machine, p2p network communication module, algorithm security module, etc., providing general functions and interfaces for blockchain system nodes.

[0026] Distributed Process Engine Module: Provides parsing and execution functions for the distributed process engine, enabling it to read process engine scripts from the blockchain ledger and execute them.

[0027] Engine Script Deployment Module: Deploys the process engine scripts to the blockchain ledger and performs related version management and script security verification.

[0028] Based on the above solution, an XML-formatted workflow script can be written to describe the flow of leave approval contracts between smart contracts of different organizations, and this contract can be deployed on the blockchain to realize the approval and flow of business processes between different organizations on the blockchain.

[0029] System workflow:

[0030] In a blockchain system that supports a process engine, the development, deployment, and operation of the process engine can be divided into the following steps, which are described below.

[0031] 1. Write the distributed process engine documentation.

[0032] Developers write distributed workflow engine scripts, which must meet the following conditions:

[0033] 1) It must include the publisher's signature on the engine file script execution content, release time, and version information. The private key for signing uses the private key of the script developer's identity on the blockchain. This signature information facilitates authentication when executing the script later.

[0034] 2) The content format of the engine script file can be XML, JSON, or other formatted text.

[0035] 3) The engine script file must contain information about the smart contract interfaces being called, and must describe the order in which the smart contracts are called.

[0036] This document describes a smart contract for leave application and approval, and the smart contract process. Org.example1 represents organization one, and org.example2 represents organization two.

[0037] 1. Start of StarEvent;

[0038] The org.example1.approveTask smart contract initiates a leave application process by calling the process approval smart contract org.example2.decision;

[0039] 3. If the `approved` return variable of the `org.example2.decision` smart contract request is true, call the `org.example2.externalSystemCall` contract;

[0040] 4. If the `approved` return variable of the `org.example2.decision` smart contract is false, call the `org.example2.sendRejectionMail` contract to send a rejection email. The process ends at `rejectEnd`.

[0041] 5. When the approval process returns true, the org.example2.CallExternalSystemDelegate method of the org.example2.externalSystemCall contract is called, followed by the holidayApprovedTask contract, which ends at approveEnd.

[0042] The script file mentioned above contains the signature used for verification. A code example is shown below:

[0043]

[0044]

[0045] This document describes a smart contract for leave application and approval, and the smart contract process. Org.example1 represents Organization One, and org.example2 represents Organization Two.

[0046] 1. Start of StarEvent

[0047] The `org.example1.approveTask` smart contract initiates a leave application process by calling the `org.example2.decision` smart contract for process approval.

[0048] 3. If the `approved` variable of the `org.example2.decision` smart contract request is true, call the `org.example2.externalSystemCall` contract.

[0049] 4. If the `approved` return variable of the `org.example2.decision` smart contract is false, call the `org.example2.sendRejectionMail` contract to send a rejection email. The process ends at `rejectEnd`.

[0050] 5. When the approval process returns true, the `org.example2.CallExternalSystemDelegate` method of the `org.example2.externalSystemCall` contract is called, followed by the `holidayApprovedTask` contract, until `approveEnd` is reached.

[0051]

[0052]

[0053]

[0054] Deploying the distributed process engine file:

[0055] Developers deploy the process engine file script output in step 1 using the newly added engine script deployment module of the blockchain system. After deployment, the process engine script is copied to the corresponding address space on the blockchain ledger.

[0056] When deploying engine files, the following should be met:

[0057] 1) The blockchain's storage system (ledger) should allocate physical storage space to store the distributed engine scripts.

[0058] 2) Once the distributed engine script is deployed, it will correspond to an address on the blockchain, through which the script data can be accessed.

[0059] 3) Only the publisher has write permissions for this engine script data; other authorized users only have read permissions.

[0060] 4) For this engine script, the publisher can use the engine script to deploy modules, manage versions, and perform operations such as publishing, upgrading, revoking, and rolling back.

[0061] 5) Engine script deployment module: For officially released engine script signatures, the signature uses the private key of the engine script deployment module, and the signature information is stored on the blockchain ledger. The distributed process engine can find the relevant signature based on the engine script address and verify it.

[0062] 2. Distributed process engine execution engine script

[0063] 1) Distributed process engine module, reads the process script of the specified blockchain ledger address.

[0064] 2) Distributed process engine module: Verifies the deployment module signature of the process script and confirms that the script has passed the release review.

[0065] 3) Distributed process engine module: Verifies the developer signature in the process script to confirm the identity of the script developer.

[0066] 4) Distributed process engine module, which parses and executes process scripts.

[0067] Flowchart as follows Figure 2 As shown.

[0068] The technical solution of this invention can achieve the following objectives:

[0069] 1. To achieve the goal of simplifying development by enabling smart contract calls to other smart contracts through distributed engine scripts;

[0070] 2. The engine script is publicly available and cannot be tampered with, achieving the goals of openness and fairness.

[0071] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications, equivalent changes, or alterations made by those skilled in the art using the disclosed technical content shall fall within the protection scope of the present invention.

Claims

1. A smart contract invocation method supporting a distributed process engine, characterized in that, include: Read the process engine script on the blockchain ledger address. The process engine script includes: signature, smart contract interface information called, and the order of call. Read the signature of the process engine script deployment module; Verify the signature; If the signature is correct, the smart contract interface is invoked asynchronously, and the asynchronous invocation is driven by an event or user.

2. The smart contract invocation method supporting a distributed process engine according to claim 1, characterized in that, The process engine scripts are in either XML or JSON format.

3. The smart contract invocation method supporting a distributed process engine according to claim 1, characterized in that, The signature includes: The signature includes the execution content, release date, and version information.

4. The smart contract invocation method supporting a distributed process engine according to claim 3, characterized in that, The signing private key uses the private key of the script developer's identity on the blockchain. This signing information is used for authentication when the script is executed subsequently.

5. The smart contract invocation method supporting a distributed process engine according to claim 1, characterized in that, The process engine script is deployed through the engine script deployment module on the blockchain system.

6. The smart contract invocation method supporting a distributed process engine according to claim 5, characterized in that, After deployment, the blockchain's storage system allocates physical storage space to store the distributed engine scripts.

7. The smart contract invocation method supporting a distributed process engine according to claim 5, characterized in that, After deployment, the deployed process engine script will correspond to an address on the blockchain, and the process engine script can be accessed through the address.

8. The smart contract invocation method supporting a distributed process engine according to claim 1, characterized in that, Signature verification includes: The signature is verified through the distributed process engine module.

9. The smart contract invocation method supporting a distributed process engine according to claim 1, characterized in that, Asynchronous calls to smart contract interfaces include: The smart contract interface is called asynchronously through the distributed process engine module.

10. A smart contract invocation system supporting a distributed process engine, characterized in that, include: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the smart contract invocation method supporting a distributed process engine as described in any one of claims 1 to 9.