A data-driven engine implementation method based on smart contracts
By building B/S architecture and rule engine technology, the complex interaction problems between business systems in the blockchain ecosystem are solved, and the closed loop of business data is realized, which simplifies enterprise system management and improves business execution efficiency.
Patent Information
- Application Number
- CN202211313707.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-25
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-10-25
AI Technical Summary
In the traditional blockchain ecosystem, the complex interaction between business systems leads to complex operation and maintenance management and uncontrollable, and smart contracts cannot directly initiate HTTP calls, resulting in difficulties in the ecological management of the enterprise system.
Build a B/S architecture, establish a comprehensive configuration module and a link-to-chain API module, preset smart contracts, and realize business data winding, matching and automatic execution through rule engine technology, provide a unified standard general data winding API interface, and combine Socket, Http or WebService technology to drive the target business system.
It realizes a complete closed loop of business data on the chain, business scale matching and associated business automatic execution, simplifies the complex call relationship between business systems, and improves business execution efficiency and management control capabilities.
Smart Images

Figure CN115664985B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of big data technology, and in particular relates to a method for implementing a data-driven engine based on smart contracts. Background Art
[0002] In a traditional blockchain ecosystem, key data from all business systems must be uploaded to the blockchain, with smart contracts serving only as a conduit for this data. Collaboration between business systems is driven by inter-system interface calls. For example, in a typical sales scenario, after a user successfully places an order and pays for it on an online mall, the mall system invokes a blockchain smart contract to upload the paid order to the blockchain, while also invoicing the invoice system to store the order as data to be invoiced. Once the invoice system issues the invoice, it again invokes a blockchain smart contract to upload the invoice to the blockchain, and then invoices the mall system to return the corresponding invoice. In reality, some business scenarios can be even more complex. It's easy to see that the introduction of blockchain in this process, requiring the upload of various data to the blockchain, creates a complex, distributed network of inter-system calls, making the subsequent operation and management of the entire ecosystem extremely complex and uncontrollable.
[0003] In traditional applications, exchanging information through HTTP requests is commonplace. However, in the field of smart contracts, due to the limitations of the blockchain itself, smart contracts cannot directly initiate an HTTP call. Summary of the Invention
[0004] The purpose of this invention is to provide a data-driven engine implementation method based on smart contracts, which solves the technical problems of business data on-chain, business compliance model matching and automatic execution of related businesses.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: a method for implementing a data-driven engine based on smart contracts, comprising the following steps:
[0006] Step 1: Build a B / S architecture. Establish a compliance model configuration module on the server side of the B / S architecture. Pre-configure rules in the compliance model configuration module and establish a business compliance model with an underlying integrated rule engine. Provide a rule configuration interface for the business compliance model through the browser side of the B / S architecture.
[0007] Establish a mapping relationship between business compliance models and target businesses;
[0008] Step 2: Establish an on-chain API module on the server side. The on-chain API module provides a unified standard universal data on-chain API interface that is exposed to the outside world. The universal data on-chain API interface is referred to as the on-chain API interface below.
[0009] The on-chain API interface is used to receive business data;
[0010] Verify the format and specifications of business data in the on-chain API interface to obtain legal business data;
[0011] Step 3: Create a smart contract module on the server side and preset a general smart contract for data on-chain in the smart contract module;
[0012] The smart contract module completes the on-chain operation of legal business data based on smart contracts and through the blockchain consensus algorithm;
[0013] Step 4: Integrate the business compliance model into the on-chain API interface;
[0014] Step 5: Establish a compliance model execution module on the server side. The compliance model execution module uses rule engine technology to match legitimate business data with the business compliance model to obtain the target business;
[0015] Step 6: The compliance model execution module packages the target business into the corresponding interface message according to the formatted message template configured by the business compliance model, and generates the target business driving task;
[0016] Step 7: Establish a target business driver module on the server side. The target business driver module obtains the target business driver task, calls the target business system interface according to the scheduling plan and interface method configured by the business compliance model, and drives the automatic execution of the target business.
[0017] Preferably, a rule configuration page is provided on the browser side of the B / S architecture for opening a rule configuration operation interface to the user.
[0018] Preferably, the business compliance model is provided with an API interface for internal calls based on rule engine technology parsing and execution.
[0019] Preferably, the on-chain API interface is implemented using Socket, Http or WebService technology; the on-chain API interface calls the smart contract based on Web3j technology for uploading business data to the chain; the on-chain API interface accesses the API interface of the business compliance model, thereby sending legal business data to the business compliance model for matching.
[0020] Preferably, the rule configuration interface includes a source end and a target end, the source end is a matching input item of the business compliance model, and the target end is a matching result output item of the business compliance model.
[0021] Preferably, the form items on the source side include the data source system, data business type and keywords; the form items on the target side include the target system to be driven by the data-driven engine, target business type, interface address, data message content specification and format, interface method and scheduling plan.
[0022] Preferably, when executing step 5, the target services obtained are one or more.
[0023] Preferably, when executing step 7, the interface call is completed in the target business system using Socket, Http or WebService technology.
[0024] The present invention proposes a data-driven engine implementation method based on smart contracts, solving the technical problems of uploading business data to the blockchain, matching business compliance models, and automatically executing related businesses. It implements a visually configurable business compliance model based on rule engine technology, offering rich and flexible configuration capabilities to match one or more target businesses based on the source system of the uploaded data, the business type, or even one or more business attributes within the business data. It supports a wide variety of interface methods and enables the setting of scheduling policies for target businesses, systematically driving the automatic execution of subsequent businesses within the target system. This creates efficient data-driven business collaboration. The present invention implements a data-driven engine that combines smart contract-based data uploading, business compliance model parsing and matching, and scheduled scheduling to trigger the execution of target businesses. It provides a unified, standard, and universal data uploading API interface to facilitate data uploading operations by business systems. Furthermore, it integrates the business compliance model at the underlying layer of the uploading API. Based on the uploaded business data, the rule engine is used to automatically match target businesses and call the target business system interface according to the configured scheduling plan and interface method to drive the execution of the target business. It realizes a complete closed-loop business chain of "business data on-chain - business compliance model matching - automatic execution of related businesses". BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a flow chart of the present invention;
[0026] Figure 2 This is the data flow diagram of the present invention. DETAILED DESCRIPTION
[0027] A smart contract is a computer protocol designed to communicate, verify, or execute contracts in an information-based manner. As a piece of executable code residing at a specific address on a blockchain's distributed ledger, a smart contract allows transparent, trustworthy transactions between untrusted entities without a third party. These transactions are traceable and irreversible. They are characterized by standardization, irreversibility, non-default, and anonymity.
[0028] Smart contracts, based on blockchain technology, offer deterministic execution, Turing completeness, and security. Their emergence has opened new doors for blockchain applications, significantly enriching and facilitating their practical application in real-world business scenarios.
[0029] Depend on Figure 1-Figure 2 The method for implementing a data-driven engine based on a smart contract includes the following steps:
[0030] Step 1: Build a B / S architecture, establish a compliance model configuration module on the server side of the B / S architecture, pre-configure rules in the compliance model configuration module, and establish a business compliance model with an underlying integrated rule engine. Provide a rule configuration interface for the business compliance model through the browser side of the B / S architecture.
[0031] A rule configuration page is provided on the browser side of the B / S architecture, which is used to open a rule configuration operation interface to the user. In this embodiment, the corresponding business mapping driving rules are maintained through the rule configuration operation interface.
[0032] The rule configuration interface includes the source end and the target end. The source end is the matching input item of the business compliance model, and the target end is the matching result output item of the business compliance model.
[0033] The form items on the source side include the data source system, data business type (describing specific business, such as orders, invoices, etc.), keywords (optional, supporting multiple keywords and corresponding AND / OR / NOT logical operations, used to match specific fields in the on-chain data and further subdivide the matching rules); the form items on the target side include the target system to be driven by the data-driven engine, target business type, interface address, interface method (including but not limited to Socket, Http, WebService, etc.), data message content specifications and format (formatted message template), and scheduling plan (including synchronous immediate call, delayed call, and scheduled call), etc. In one matching rule, one source side can be configured to correspond to multiple target sides.
[0034] In one matching rule, one source end can correspond to multiple target ends.
[0035] The business compliance model has an API interface for internal calls based on rule engine technology parsing and execution.
[0036] Establish a mapping relationship between the business compliance model and the target business.
[0037] Step 2: Establish an on-chain API module on the server side. The on-chain API module provides a unified standard universal data on-chain API interface exposed to the outside world. The universal data on-chain API interface is referred to as the on-chain API interface below.
[0038] The on-chain API interface is used to receive business data.
[0039] The format and specifications of business data are verified for legality in the on-chain API interface to obtain legal business data.
[0040] The on-chain API interface is implemented using Socket, Http or WebService technology; the on-chain API interface calls smart contracts based on Web3j technology for uploading business data to the chain; the on-chain API interface accesses the API interface of the business compliance model, thereby sending legal business data to the business compliance model for matching.
[0041] The present invention provides a standardized access API and implements corresponding verification rules. When the API receives a call request, it performs a validity check. Once the data is verified, it calls the smart contract to upload the data to the blockchain. Once the data is successfully uploaded to the blockchain, it calls the rule engine to match the appropriate target business (which may be none, one or more). Then, based on the corresponding configuration, it executes the scheduling plan to drive the automatic execution of the target system business.
[0042] The present invention combines Socket, Http, WebService and other protocols or technologies to realize a unified standard universal data chain API interface exposed to the outside world; the API interface includes the following main functions: 1) data legitimacy verification, verification of data format and specifications, etc.; 2) based on Web3j and other technologies to call smart contracts to achieve the purpose of business data chain; 3) access to the calling API of the business compliance model to send the chain data to the business compliance model, thereby matching and driving the automatic execution of the associated target business.
[0043] Step 3: Create a smart contract module on the server side and preset a general smart contract for data on-chain in the smart contract module;
[0044] In this embodiment, the smart contract is a pre-written smart contract program with unified standards and universal data on the chain.
[0045] The smart contract module completes the on-chain operation of legal business data based on smart contracts and through the blockchain consensus algorithm;
[0046] Step 4: Integrate the business compliance model into the on-chain API interface;
[0047] Step 5: Establish a compliance model execution module on the server side. The compliance model execution module uses rule engine technology to match legitimate business data with the business compliance model to obtain target businesses; the obtained target businesses are one or more.
[0048] After the business data is successfully uploaded to the chain through the smart contract, the business data will continue to be fed into the parsing logic of the business compliance model, and the related target businesses configured in the compliance model will be automatically matched through the rule engine technology.
[0049] In this embodiment, according to the rule configuration, the target business may not be matched and the business process is completed; or one or more target businesses may be matched.
[0050] Step 6: The compliance model execution module packages the target business into the corresponding interface message according to the formatted message template configured by the business compliance model, and generates the target business driving task;
[0051] After the rule engine of the business compliance model parses out the matching target business, it will assemble the interface data message with the business data uploaded to the chain according to the pre-configured data message content specifications and format (formatted message template); at the same time, it will generate the target business driving task.
[0052] Step 7: Establish a target business driver module on the server side. The target business driver module obtains the target business driver task, calls the target business system interface according to the scheduling plan and interface method configured by the business compliance model, and drives the automatic execution of the target business.
[0053] Complete the interface call in the target business system using Socket, Http or WebService technology.
[0054] In this embodiment, the business system requires the development of interfaces for completing specific tasks, also known as "digital employees," using protocols or technologies such as Socket, Http, and WebService. These interfaces are then configured within the compliance model. The target business is then driven by a pre-configured schedule and interface. While executing the target business logic, there may still be a need to upload data to the blockchain, in which case the process enters a loop. If there is no subsequent need to upload data to the blockchain, the process ends.
[0055] like Figure 2As shown in Figure 2, this embodiment demonstrates the complete process of internal and external collaboration in uploading data to the blockchain and driving the execution of related businesses. A data-driven service platform is built to implement a data-driven engine based on smart contracts. The business compliance model is pre-configured through the compliance model visualization configuration page provided by the data-driven service platform. The business system sends the business data to be uploaded to the data-driven service platform through the universal data upload API interface. The data-driven service platform verifies the uploaded data and format. If the verification fails, an error message is fed back to the business system. If the verification passes, the universal upload smart contract is called through technologies such as Web3j. Once the business data is uploaded to the chain, the blockchain consensus algorithm is used to complete the upload. After the upload is completed, the business data is sent to the business compliance model for parsing. The business compliance model parses and matches the target business according to the rule engine. If no match is found, the business process ends. If the compliance model successfully matches one or more target businesses, the target business-driven tasks and corresponding interface messages are generated according to the rule configuration. Finally, the business-driven tasks are executed. According to the scheduling plan and interface method configured by the rules, the target business interface is called, and the "digital employee" in the business system (i.e., the independently encapsulated business execution interface module) completes the specific business action (Note: If the target business still has business needs for data upload, the process flows back to the beginning and enters a new round of upload process), thus ending the entire business process.
[0056] The target business system applies for business data on-chain by requesting the universal data on-chain API interface provided by the data-driven engine based on smart contracts. The engine will perform basic legitimacy verification on the requested data on-chain. The data is then on-chained by calling the on-chain smart contract. After on-chaining, the business data is automatically transferred to the business compliance model for matching. If one or more target businesses are matched, the engine will assemble the interface data message according to the data message content specification and format (formatted message template) corresponding to the business, and complete the call to the target system interface according to the scheduling plan, interface method, and interface address, triggering the automatic execution of subsequent business actions in the target business system. This forms a complete business chain of "business data on-chain - business compliance model matching - related business automatic execution", thereby solving the complex and intertwined mesh business call relationship between business systems in the traditional blockchain ecosystem and simplifying and shortening the business data chain.
[0057] In this embodiment, the compliance model configuration module provides a visual online rule configuration capability for the configuration of the business compliance model; the on-chain API module provides a unified standard universal data on-chain API interface for the business system to make data on-chain request calls, and provides certain data format and specification verification capabilities; the smart contract module provides a standard universal data on-chain capability. In the on-chain API module, the call to the smart contract is implemented through technologies such as Web3j to realize the on-chain of business data; the compliance model execution module parses and executes the compliance model based on the rule engine technology, and automatically matches the related target business according to the business data, and generates the target business-driven task according to the rule configuration; the target business-driven module is responsible for the specific execution of the target business-driven task, and calls the target business system interface according to the scheduling plan and interface method configured in the model to drive the automatic execution of the target business.
[0058] This invention introduces rule engine technology, integrating compliance models, smart contracts, and web services to build a third-party data-driven service platform. This creates a visually configurable business compliance model, achieves optimal data transmission links, optimizes the complex call relationships between data transmission across numerous business systems, and drives the automatic execution of associated target businesses by matching data with compliance models.
[0059] The present invention creates a configurable business compliance model: it introduces rule engine technology to provide flexible online configuration functions and call API interfaces; it supports the configuration of the target system to be driven, target business type, interface address, interface mode, data message content specifications and format, and scheduling plan based on dimensions such as data source system, data business type, and keywords; it supports matching one or more associated target businesses according to the compliance model, and drives the execution of the business according to the configured scheduling plan.
[0060] This invention provides a standardized universal data on-chain API interface that integrates on-chain smart contracts with business compliance model calls. This involves writing a unified, standard universal data on-chain smart contract; implementing a standardized universal data on-chain API that uses Web3j technology to call the smart contract and integrates API calls for the business compliance model. This creates a complete business chain: "on-chain business data - matching the business compliance model - and automatically executing related businesses."
[0061] The present invention uses a data-driven engine based on smart contracts, combined with the business-driven interfaces provided in various business systems of the enterprise, to realize intelligent operations such as intelligent form filling, intelligent auditing, intelligent reimbursement, intelligent certificate issuance, and intelligent reporting, thereby forming a set of enterprise data-driven service (digital employee) system platforms, promoting the simplest manual operation and the shortest data flow, maximizing the release of human resources, improving business execution efficiency, and helping enterprises to reduce costs and increase efficiency.
[0062] The present invention proposes a data-driven engine implementation method based on smart contracts, solving the technical problems of uploading business data to the blockchain, matching business compliance models, and automatically executing related businesses. It implements a visually configurable business compliance model based on rule engine technology, offering rich and flexible configuration capabilities to match one or more target businesses based on the source system of the uploaded data, the business type, or even one or more business attributes within the business data. It supports a wide variety of interface methods and enables the setting of scheduling policies for target businesses, systematically driving the automatic execution of subsequent businesses within the target system. This creates efficient data-driven business collaboration. The present invention implements a data-driven engine that combines smart contract-based data uploading, business compliance model parsing and matching, and scheduled scheduling to trigger the execution of target businesses. It provides a unified, standard, and universal data uploading API interface to facilitate data uploading operations by business systems. Furthermore, it integrates the business compliance model at the underlying layer of the uploading API. Based on the uploaded business data, the rule engine is used to automatically match target businesses and call the target business system interface according to the configured scheduling plan and interface method to drive the execution of the target business. It realizes a complete closed-loop business chain of "business data on-chain - business compliance model matching - automatic execution of related businesses".
Claims
1. A method for implementing a data-driven engine based on smart contracts, characterized by: The steps include: Step 1: Build a B / S architecture. Establish a compliance model configuration module on the server side of the B / S architecture. Pre-configure rules in the compliance model configuration module and establish a business compliance model with an underlying integrated rule engine. Provide a rule configuration interface for the business compliance model through the browser side of the B / S architecture. Establish a mapping relationship between business compliance models and target businesses; Step 2: Establish an on-chain API module on the server side. The on-chain API module provides a unified standard universal data on-chain API interface exposed to the outside world. The on-chain API interface is used to receive business data; Verify the format and specifications of the business data in the on-chain API interface to obtain legal business data; Step 3: Create a smart contract module on the server side and preset a general smart contract for data on-chain in the smart contract module; The smart contract module completes the on-chain operation of legal business data based on smart contracts and through the blockchain consensus algorithm; Step 4: Integrate the business compliance model into the on-chain API interface; Step 5: Establish a compliance model execution module on the server side. The compliance model execution module uses rule engine technology to match legitimate business data with the business compliance model to obtain the target business; The business compliance model has an API interface for internal calls based on rule engine technology parsing and execution; The on-chain API interface is implemented using Socket, Http or WebService technology; the on-chain API interface calls the smart contract based on Web3j technology to upload business data to the chain; the on-chain API interface is connected to the API interface of the business compliance model, thereby sending legitimate business data to the business compliance model for matching; The rule configuration interface includes the source side and the target side. The source side is the matching input item of the business compliance model, and the target side is the matching result output item of the business compliance model. The form items on the source side include the data source system, data business type, and keywords; the form items on the target side include the target system to be driven by the data-driven engine, target business type, interface address, data message content specification and format, interface method, and scheduling plan; Step 6: The compliance model execution module packages the target business into the corresponding interface message according to the formatted message template configured by the business compliance model, and generates the target business driving task; Step 7: Establish a target business driver module on the server side. The target business driver module obtains the target business driver task, calls the target business system interface according to the scheduling plan and interface method configured by the business compliance model, and drives the automatic execution of the target business.
2. The method for implementing a data-driven engine based on a smart contract according to claim 1, characterized in that: A rule configuration page is provided on the browser side of the B / S architecture for opening the rule configuration operation interface to users.
3. The method for implementing a data-driven engine based on a smart contract according to claim 1, wherein: When executing step 5, one or more target services are obtained.
4. The method for implementing a data-driven engine based on a smart contract according to claim 1, wherein: When executing step 7, the interface call is completed in the target business system using Socket, Http or WebService technology.
Citation Information
Patent Citations
Block chain transaction data migration method and device
CN112052235A
Method for defining blockchain uplink data business protocol and application business protocol
CN112380219A