Lightweight process engine implementation method and device, computer equipment and storage medium

By providing a lightweight process engine implementation method in resource-constrained environments, the problems of large size and high resource consumption of traditional process engine systems are solved, efficient and secure process execution is achieved, and dynamic process management and component design are supported.

CN119718454APending Publication Date: 2025-03-28SHENZHEN COMTOP INFORMATION TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411557819.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

Traditional process engines and operating systems have problems such as huge size, high resource consumption, complex configuration and insufficient security, which are difficult to meet the application needs in resource-constrained environments.

Method used

It provides a lightweight process engine implementation method, which obtains interface type information through scanning and reporting to the server through client module, obtains process configuration information, and writes and matches process configuration information in the local cache to execute specific processes.

Benefits of technology

It realizes the lightweight process engine system, improves the efficiency and security of the system, is suitable for resource-constrained environments, and supports component design and dynamic process management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718454A_ABST
    Figure CN119718454A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of process engines, in particular to a lightweight process engine implementation method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: scanning to obtain all interface type information of a client module; reporting all the interface type information to a server module; obtaining flow configuration information of the current service from the server module; writing the flow configuration information of the current service into a local cache module; in response to a service request of a service application end, querying a specific process corresponding to the service request; matching corresponding process configuration information from the local cache module according to a specific process corresponding to the service request; and executing a corresponding specific flow according to the corresponding flow configuration information. By adopting the method, the light weight of the process engine system can be realized, and the high efficiency and the safety of the process engine system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of process engines, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for implementing a lightweight process engine. Background Art

[0002] With the rapid development of information technology, process automation and operating systems play a vital role in all walks of life. However, traditional process engines and operating systems often have problems such as large size, high resource consumption, complex configuration and insufficient security, which makes it difficult to meet the application requirements in resource-constrained environments, such as embedded systems and IoT devices.

[0003] Although current low-code technology platforms and business process management (BPM) systems provide a certain degree of process automation support, they have problems with data security and privacy, complex version control and change management, changing skill requirements, and difficult technical implementation.

[0004] Therefore, there is an urgent need for a lightweight process engine implementation method, apparatus, computer equipment, computer-readable storage medium and computer program product that can achieve lightweight process engine systems and improve the efficiency and security of process engine systems. Summary of the invention

[0005] Based on this, it is necessary to provide a lightweight process engine implementation method, device, computer equipment, computer-readable storage medium and computer program product to address the above technical problems, which can realize the lightweight of the process engine system and improve the efficiency and security of the process engine system.

[0006] In a first aspect, the present application provides a lightweight process engine implementation method, which is applied to a client module, including:

[0007] Scan and obtain all interface type information of the client module;

[0008] Reporting all the interface type information to the server module;

[0009] Obtaining process configuration information of the current service from the server module;

[0010] Writing the process configuration information of the current service into the local cache module;

[0011] Respond to the business request from the business application end and query the specific process corresponding to the business request;

[0012] According to the specific process corresponding to the business request, matching the corresponding process configuration information from the local cache module;

[0013] According to the corresponding process configuration information, the corresponding specific process is executed.

[0014] In one embodiment, the specific process corresponding to the execution includes:

[0015] Through the process execution module, the corresponding specific process is executed according to the execution mode of each process node, and a custom execution plug-in is inserted before and after the execution of each process node.

[0016] In one embodiment, the method further comprises:

[0017] During the execution of a specific process, the hook mechanism is used to implement extended functions, which include business processing, execution interception hook, pre-hook, post-hook and rollback hook.

[0018] In one embodiment, the execution method includes a serial process; the execution of the corresponding specific process according to the execution method of each process node includes:

[0019] Execute interception operation on the current process node;

[0020] When the current process node is not intercepted, traverse the previous dependent nodes to obtain the node execution results of the previous dependent nodes;

[0021] Execute the node pre-hook of the current process node according to the node execution result of the pre-dependent node;

[0022] When the node pre-hook is finished executing, the current process node is executed;

[0023] When the current process node is finished executing, the post-hook of the current process node execution node is executed.

[0024] In one embodiment, the execution method includes parallel processes; the process execution module executes the corresponding specific process according to the execution method of each process node, including:

[0025] Submit at least one execution task of the current process node to the thread pool;

[0026] Execute interception operations on at least one current process node in parallel from the thread pool;

[0027] When at least one current process node is not intercepted, traverse the preceding dependent nodes to obtain the node execution result of at least one preceding dependent node;

[0028] Execute a node pre-hook of at least one current process node according to the node execution result of the pre-dependent node;

[0029] When the node pre-hook is finished, at least one current process node is executed;

[0030] When the execution of the current process node ends, at least one post-execution hook of the current process node is executed.

[0031] In one embodiment, the method further comprises:

[0032] In the process of obtaining the node execution result of at least one preceding dependent node, executing the node preceding hook, executing the current process node and the node following hook, if abnormal data is captured, the rollback hook is executed.

[0033] In a second aspect, the present application further provides a lightweight process engine implementation device, which is applied to a client module, and the device includes:

[0034] Interface scanning module, used to scan and obtain all interface type information of client modules;

[0035] A reporting module, used for reporting all the interface type information to the server module;

[0036] A configuration information acquisition module, which acquires the process configuration information of the current service from the server module;

[0037] A storage module, used to write the process configuration information of the current service into a local cache module;

[0038] A query module, used to respond to a business request from a business application end and query the specific process corresponding to the business request;

[0039] A configuration information matching module, used to match the corresponding process configuration information from the local cache module according to the specific process corresponding to the business request;

[0040] The process execution module is used to execute the corresponding specific process according to the corresponding process configuration information.

[0041] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0042] Scan and obtain all interface type information of the client module;

[0043] Reporting all the interface type information to the server module;

[0044] Obtaining process configuration information of the current service from the server module;

[0045] Writing the process configuration information of the current service into the local cache module;

[0046] Respond to the business request from the business application end and query the specific process corresponding to the business request;

[0047] According to the specific process corresponding to the business request, matching the corresponding process configuration information from the local cache module;

[0048] According to the corresponding process configuration information, the corresponding specific process is executed.

[0049] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0050] Scan and obtain all interface type information of the client module;

[0051] Reporting all the interface type information to the server module;

[0052] Obtaining process configuration information of the current service from the server module;

[0053] Writing the process configuration information of the current service into the local cache module;

[0054] Respond to the business request from the business application end and query the specific process corresponding to the business request;

[0055] According to the specific process corresponding to the business request, matching the corresponding process configuration information from the local cache module;

[0056] According to the corresponding process configuration information, the corresponding specific process is executed.

[0057] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0058] Scan and obtain all interface type information of the client module;

[0059] Reporting all the interface type information to the server module;

[0060] Obtaining process configuration information of the current service from the server module;

[0061] Writing the process configuration information of the current service into the local cache module;

[0062] Respond to the business request from the business application end and query the specific process corresponding to the business request;

[0063] According to the specific process corresponding to the business request, matching the corresponding process configuration information from the local cache module;

[0064] According to the corresponding process configuration information, the corresponding specific process is executed.

[0065] The above-mentioned lightweight process engine implementation method, device, computer equipment, computer-readable storage medium and computer program product quickly build and execute business processes in a componentized manner, effectively decoupling complex business logic. This design allows each part of the business process to be adjusted and replaced independently, thereby improving the flexibility and scalability of the system. Secondly, the lightweight process engine reduces the burden on developers in process management by automating process control, so that they can focus more on the implementation of core business logic. Through the lightweight process engine, real-time hot replacement of components can be achieved, and new components can be inserted into the existing logical process at any time to dynamically adjust the business logic. This ability enables the system to respond quickly to business changes and improves the adaptability and response speed of the system. In general, the implementation method of the lightweight process engine realizes the lightweight, high efficiency and security of the process engine through key technical points such as modular design, intelligent scheduling, and multi-level security mechanism, and has broad application prospects and important practical value. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0067] Figure 1 An application environment diagram of a lightweight process engine implementation method in one embodiment;

[0068] Figure 2 A schematic diagram of a flow chart of a method for implementing a lightweight process engine in an embodiment;

[0069] Figure 3 A schematic diagram of a flow chart of a lightweight process engine implementation method in another embodiment;

[0070] Figure 4 A schematic diagram of nodes and processes for arranging processes in the most detailed embodiment;

[0071] Figure 5 This is a diagram of the architecture of a lightweight process engine implementation device in the most detailed embodiment;

[0072] Figure 6It is a structural block diagram of a lightweight process engine implementation device in one embodiment;

[0073] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0074] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0075] The lightweight process engine implementation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers.

[0076] The client module (terminal 102) scans and obtains all interface type information of the client module; reports all interface type information to the server module; obtains the process configuration information of the current service from the server module (server 104); the client module (terminal 102) writes the process configuration information of the current service to the local cache module; responds to the business request of the business application end, queries the specific process corresponding to the business request; matches the corresponding process configuration information from the local cache module according to the specific process corresponding to the business request; executes the corresponding specific process according to the corresponding process configuration information.

[0077] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The server 104 may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.

[0078] In an exemplary embodiment, Figure 2 As shown, a lightweight process engine implementation method is provided, which is applied to Figure 1 The client module (terminal 102) in the example is used for explanation, and the steps include the following steps S202 to S214. Among them:

[0079] Step S202: Scan and obtain all interface type information of the client module.

[0080] Specifically, the client module needs to identify and obtain all interfaces (Component interfaces) available to the process engine. The "interface" here refers to the interface in programming. The client module needs to be able to identify all types in the system that implement a specific interface (such as the Component interface). Once these types are identified, the client module will collect their interface type information, which may include the name of the interface, method signature, implementation class, etc. The process engine can know which components can be called and how to call them.

[0081] Step S204: Report all interface type information to the server module.

[0082] Specifically, after scanning and obtaining the type information of all interfaces that implement a specific interface (such as the Component interface), the client module needs to send this information to the server module so that the server module can know the components and functions currently available to the client module. The reported information usually includes the name of the interface, method signature, implementation class details, etc. This information helps the server module understand the functional capabilities and availability of the client module.

[0083] The reporting process involves network communication. The client module sends the interface information to the server module through network requests (such as HTTP requests, RPC calls, etc.). This requires the server module to have a corresponding receiving and processing mechanism.

[0084] After receiving the reported interface information, the server module will process it, such as storing, verifying or updating its internal registry or database, in order to track and manage the functional status of the client module. Once the server module has the interface information of the client module, it can issue specific process configurations based on this information. These configuration information tells the client module what operations should be performed in a specific business scenario.

[0085] This reporting and issuing mechanism enables the process engine to support dynamic process management. That is, the server module can dynamically adjust and optimize the process configuration of the client module according to changes in business needs without redeploying or modifying the client module code.

[0086] In this way, new components can be added to the client module, and once reported and confirmed by the server module, they can be immediately incorporated into the business process, thereby speeding up the deployment and iteration of new functions.

[0087] Step S206, obtaining the process configuration information of the current service from the server module.

[0088] Specifically, the client module needs to know how to execute a specific business process. The execution details of these processes are usually defined and maintained by the server module, so the client needs to obtain this configuration information from the server. The server module is responsible for centrally managing the configuration information of all business processes. This information may include the various steps of the process, execution order, decision points, exception handling rules, etc.

[0089] The client module requests the process configuration information of the current service from the server module through some communication mechanism (such as API call, message queue, etc.). This usually happens when the client module is started or before a specific business process needs to be executed. If the process configuration information in the server module is updated, the client module needs to be able to obtain the latest configuration to ensure the accuracy and timeliness of process execution. The client module usually caches the process configuration information obtained from the server locally so that it can be quickly accessed when executing business requests, reducing dependence on the server and improving the efficiency of process execution.

[0090] Once the client module obtains the process configuration information, it can execute specific business processes according to these configurations. This includes calling the corresponding components, processing business logic, managing process status, etc. according to the instructions in the configuration. This mechanism improves the flexibility and maintainability of the process engine. The server can update the process configuration independently of the client module, and the client module only needs to re-obtain the latest configuration information to adapt to these changes.

[0091] Step S208, writing the process configuration information of the current service into the local cache module.

[0092] Specifically, once the client module obtains the process configuration information from the server module, it needs to store this information locally for quick access and execution later. This usually involves writing the configuration information to a local cache module. By caching the process configuration information locally, the client module can reduce its dependence on the server module and avoid the need to obtain configuration information from the server every time a business request is processed, thereby improving the efficiency of process execution.

[0093] Caching configuration information locally also helps improve system reliability. Even if the server module is temporarily unavailable, the client module can continue to process business requests as long as the latest process configuration information is in the local cache. When writing to the local cache, data consistency needs to be ensured. This means that the information in the local cache should be synchronized with the configuration information in the server module. This usually involves the client module being able to detect these changes and update the local cache after the server module updates the configuration information. The local cache can be stored in memory or on a local disk. The choice of storage medium depends on the size of the process configuration information, the frequency of access, and the performance requirements. If the process configuration information contains sensitive data, the security of the cache must also be considered to ensure that only authorized client modules can access and modify the cached information.

[0094] Step S210, in response to the service request of the service application end, query the specific process corresponding to the service request.

[0095] Specifically, when a business application (such as a user interface, external API, or other system) initiates a business request, the request will be sent to the business application server equipped with a lightweight process engine. The process engine on the business application server needs to be able to recognize and understand the request. This usually involves parsing the request data to extract information related to process execution, such as request type, user identity, request parameters, etc.

[0096] Based on the details of the business request, the process engine queries its internal configuration or local cache for a process definition that matches the request. This query process may involve a process matching algorithm to determine the process path that best suits the current request. The process engine determines the process to be executed based on the query results. When there are multiple possible process paths, it may be necessary to select the most appropriate process based on specific business rules or conditions. Once the specific process is determined, the process engine retrieves all relevant information about the process, including the various steps involved in the process, decision points, execution order, etc.

[0097] Step S212: Match the corresponding process configuration information from the local cache module according to the specific process corresponding to the business request.

[0098] Specifically, the process configuration information contains all the details required to execute the process, such as the various nodes (steps) in the process, the execution order of the nodes, the decision logic, exception handling rules, etc. This information is crucial for the correct execution of the process. The matching process may involve parsing the process definition file (such as XML, JSON and other formats) to determine the specific execution path. This may include complex process logic such as serial execution, parallel execution, conditional branching, etc.

[0099] Matching process configuration information from the local cache can significantly improve the efficiency of process execution, because it avoids obtaining configuration information from the server every time the process is executed, reducing network latency and server load. In order to ensure the correct execution of the process, the configuration information in the local cache needs to be consistent with the server. This means that any configuration updates on the server need to be synchronized to the local cache in a timely manner. If no matching process configuration information is found in the local cache, the process engine needs to have a corresponding error handling mechanism, such as returning error information, logging, and attempting to resynchronize the configuration. The process configuration information may contain sensitive business logic, so it is necessary to ensure the security of the local cache to prevent unauthorized access or data leakage.

[0100] Step S214, executing the corresponding specific process according to the corresponding process configuration information.

[0101] Specifically, the process engine executes each node (step) in the process one by one according to the configuration information. Each node may represent a service call, a script execution, a decision judgment or other business logic. During the execution process, the process engine monitors the execution status of the process, including execution time, execution order, node status, etc., to facilitate problem troubleshooting and performance optimization. If an exception or error is encountered during the execution of the process, the process engine needs to handle it according to the predefined exception handling rules, which may include transaction rollback, error compensation, retry mechanism or notification of relevant personnel.

[0102] The process may contain decision points. The process engine needs to determine the next execution path based on the actual runtime data and conditional judgments, which may involve conditional branches, loops, parallel processing, etc. According to the configuration information, some steps in the process may need to be executed synchronously (i.e., wait for the previous step to complete before executing the next step), while some steps may need to be executed asynchronously (i.e., start execution without waiting for the previous step to complete).

[0103] Once all nodes have been executed as configured, the process engine will mark the process as completed and perform necessary cleanup work, such as releasing resources, notifying related systems or users, etc. Finally, the process engine will return the execution results of the process to the business application end, which may include the success or failure status of the process, output data, error information, etc.

[0104] In the above-mentioned lightweight process engine implementation method, business processes are quickly constructed and executed in a componentized manner, effectively decoupling complex business logic. This design allows each part of the business process to be adjusted and replaced independently, thereby improving the flexibility and scalability of the system. Secondly, the lightweight process engine reduces the burden on developers in process management by automating process control, so that they can focus more on the implementation of core business logic. Through the lightweight process engine, real-time hot replacement of components can be achieved, and new components can be inserted into the existing logical process at any time to dynamically adjust the business logic. This capability enables the system to respond quickly to business changes and improves the adaptability and response speed of the system. In general, the implementation method of the lightweight process engine achieves the lightweight, high efficiency and security of the process engine through key technical points such as modular design, intelligent scheduling, and multi-level security mechanism, and has broad application prospects and important practical value.

[0105] In an exemplary embodiment, executing the corresponding specific process includes:

[0106] Through the process execution module, the corresponding specific process is executed according to the execution mode of each process node, and a custom execution plug-in is inserted before and after the execution of each process node.

[0107] Specifically, the process execution module is the core component in the process engine that is responsible for driving the process execution. It executes each node in the process in a predetermined order according to the process configuration information.

[0108] Each process node may have different execution modes, such as synchronous execution, asynchronous execution, serial execution, parallel execution, etc. The process execution module needs to understand these execution modes and execute the nodes accordingly. The process execution module executes the nodes in the process one by one. Each node may represent a specific business operation, service call, or logical judgment. Custom execution plug-ins (also called hooks, interceptors) can be inserted before and after the execution of each process node. These plug-ins can be used for logging, permission checking, data validation, performance monitoring, etc.

[0109] In this embodiment, a custom plug-in is used to extend the function and behavior of the process during the execution process. This approach ensures both the flexibility and scalability of the process and the efficient execution of the process.

[0110] In an exemplary embodiment, during the execution of a specific process, a hook mechanism is used to implement extended functions, and the extended functions include business processing, execution interception hook, pre-hook, post-hook and rollback hook.

[0111] Specifically, during the execution of a specific process, the hook mechanism is used to implement extended functions, allowing developers to insert custom logic at specific points in the process to enhance the functionality of the process engine. The following is a detailed explanation of these extended functions:

[0112] Business processing is the core part of process execution and involves specific business logic. At a certain node in the process, you can use the hook mechanism to insert custom logic before and after business processing, such as data validation, business rule application, etc.

[0113] Execution interception hooks allow checking or modifying operations before a process node is executed. For example, you can check user permissions, verify the validity of input data, or decide whether to execute a node based on a condition. If the interception condition is not met, the execution of the node can be prevented.

[0114] Pre-hooks are triggered before the actual logic of a process node is executed. This can be used to perform pre-processing operations such as initializing data, setting environment variables, logging, etc. Pre-hooks are a key mechanism to ensure that all necessary preparations are completed before a node is executed.

[0115] Post-hooks are triggered after a process node has completed execution, regardless of whether the node succeeded or failed. This can be used to perform post-processing operations, such as cleaning up resources, logging, sending notifications, etc. Post-hooks help ensure that the node can be correctly restored to a safe state after execution.

[0116] The rollback hook is triggered when the process fails to execute, and is used to undo the operations that have been executed to maintain data consistency and integrity. For example, in a database transaction, if an operation fails, the rollback hook can execute the necessary SQL commands to roll back the transaction.

[0117] Decouple business logic from process control logic to improve code maintainability and reusability. By defining standard hook interfaces, new functions can be easily expanded to adapt to changing business needs. Provide a structured error handling mechanism to ensure appropriate response when exceptions occur.

[0118] In this embodiment, the hook mechanism provides a powerful expansion capability for the process engine, so that developers can flexibly insert custom logic at specific points in the process to meet complex business needs.

[0119] In an exemplary embodiment, Figure 3 As shown, the execution mode includes a serial process; according to the execution mode of each process node, the corresponding specific process is executed, including:

[0120] Step S302, executing an interception operation on the current process node;

[0121] Step S304, when the current process node is not intercepted, traverse the preceding dependent nodes to obtain the node execution results of the preceding dependent nodes;

[0122] Step S306, executing the node pre-hook of the current process node according to the node execution result of the pre-dependent node;

[0123] Step S308, when the node pre-hook is executed, the current process node is executed;

[0124] Step S310, when the current process node is executed, execute the post-hook of the current process node.

[0125] Specifically, in a serial process, process nodes are executed one after another in a linear order. The execution of each node depends on the completion of the previous node. Before executing the current process node, first check whether there are any interception conditions (such as permission check, data validation, etc.). If the node is intercepted (that is, the interception condition is met), the execution of the current node will be stopped, which may trigger error handling or process rollback. If the current process node is not intercepted, the process engine will check and execute all the predecessor dependent nodes. These nodes are nodes that must be completed before the current node. Once the predecessor dependent nodes are executed, the process engine will collect the execution results of these nodes. These results may be used as input parameters or context information for the execution of the current node. The node pre-hook is an extension point before the actual logic execution of the current node. Custom logic such as logging and data pre-processing can be inserted here. After the node pre-hook is executed, the process engine will execute the core business logic of the current process node. After the process node is executed, the process engine will execute the node post-hook. This is usually used to perform post-processing operations such as logging, resource cleanup, sending notifications, etc.

[0126] In this embodiment, this process ensures that each process node can be executed at the right time and allows custom logic to be inserted at key points to meet business needs and enhance process control. In this way, the process engine can handle not only business logic, but also cross-cutting concerns such as process control, monitoring, and exception management.

[0127] In an exemplary embodiment, the execution mode includes parallel processes; by means of a process execution module, according to the execution mode of each process node, the corresponding specific process is executed, including:

[0128] Submit at least one execution task of the current process node to the thread pool;

[0129] Execute interception operations on at least one current process node in parallel from the thread pool;

[0130] When at least one current process node is not intercepted, traverse the preceding dependent nodes to obtain the node execution result of at least one preceding dependent node;

[0131] According to the node execution result of the preceding dependent node, execute at least one node preceding hook of the current process node;

[0132] When the node pre-hook is finished, at least one current process node is executed;

[0133] Step S412, when the execution of the current process node is completed, execute at least one post-hook of the current process node execution node.

[0134] Specifically, in a parallel process, multiple process nodes can be executed simultaneously instead of one after another. This approach can improve the execution efficiency of the process, especially when dealing with tasks that can be processed independently in parallel. The process execution module submits the execution task of the current process node to the thread pool. The thread pool is an executor that manages multiple threads and allows multiple tasks to be executed in parallel. The tasks submitted to the thread pool include the business logic of the execution node, pre- and post-hooks, etc.

[0135] Execute interception operations on the current process node in parallel from the thread pool. This means that interception checks for multiple nodes can be performed simultaneously instead of sequentially. If a node is intercepted, the execution of that node will be stopped, while other nodes that have not been intercepted can continue to execute. For nodes that have not been intercepted, the process execution module traverses their predecessor dependency nodes, which must be executed and completed first to provide the necessary execution results or context for the current node. After the execution of the predecessor dependency nodes is completed, their execution results are obtained. These results will be used as input for the execution of the current node. Use the execution results of the obtained predecessor dependency nodes to execute the node pre-hook of the current process node. This may include data preprocessing, permission verification, etc. After the node pre-hook is executed, the core business logic of the current process node is executed. After the execution of the current process node is completed, the node post-hook is executed. This usually includes post-processing operations such as resource cleanup, sending notifications, logging, etc.

[0136] In this embodiment, by processing the process in parallel, the execution time of the overall process can be significantly reduced, especially when processing tasks that can be completed in parallel. By managing parallel tasks through the thread pool, the process engine can effectively utilize system resources and improve processing capabilities.

[0137] In an exemplary embodiment, in the process of obtaining the node execution result of at least one preceding dependent node, executing a node preceding hook, executing a current process node, and executing a node following hook, and in the case of capturing abnormal data, a rollback hook is executed.

[0138] Specifically, when executing each stage of a process node (including obtaining the execution results of a preceding dependent node, executing a node pre-hook, executing the current process node, and executing a node post-hook), the process engine needs to be able to capture possible exceptions or errors.

[0139] A rollback hook is a special process node that defines the rollback operations that need to be performed when an exception occurs. These operations can undo some or all of the steps that have been executed to maintain data consistency and integrity.

[0140] Once abnormal data is captured during any of the above operations, the process engine will trigger the rollback hook. This means that further process execution will be stopped and the defined rollback steps will be started. The purpose of the rollback operation is to ensure that the system state returns to a known and consistent state. For example, in a database operation, if part of a transaction fails, the rollback hook will execute the necessary SQL commands to roll back the transaction and undo all updates that have been executed. The rollback hook usually contains error handling logic, such as recording error logs, notifying relevant personnel, cleaning up resources, etc. This helps developers diagnose problems and take appropriate remedial measures.

[0141] In an environment that supports transactions, the rollback hook can be tightly integrated with the transaction manager to ensure the atomicity, consistency, isolation, and durability (ACID properties) of the transaction. In some cases, if the process execution fails, it may be necessary to notify the user or caller so that they can take appropriate actions.

[0142] In this embodiment, the rollback hook is an important exception handling mechanism in the process engine, which ensures that the system can be restored to a safe state when an error occurs and minimizes the impact of the error on the system. By defining the rollback operation at the key point of the process, the robustness and reliability of the system can be improved.

[0143] The most detailed embodiment of this application is:

[0144] A lightweight business process orchestration component is designed to make business implementation clearer and more flexible. This component is a lightweight business process orchestration based on springbean. In complex scenarios, this component can abstract business logic components and process orchestration to meet business needs and make business scenarios clearer. This component can improve code reuse and system maintainability and scalability. Figure 4As shown, the component mainly consists of two parts: process and node:

[0145] 1. Process: supports local and remote definition; unifies the execution process through the template factory design pattern; supports serial and parallel execution; supports multi-dimensional process matching; has process variables, grayscale and other capabilities; 2. Node: exposes business processing, execution interception, pre-, post-, rollback and other extended hooks. For example, through the rollback hook, the business can achieve distributed transaction consistency; supports node custom configuration, such as applying strategic execution of business logic through configuration to improve the scalability of the system.

[0146] Lightweight process orchestration has the following features: 1. Unified component definition: Provide unified component implementation for all logics to make them highly cohesive and low-coupling. 2. Lightweight: Develop on demand and rely on lightweight. 3. Flexible rule matching: Use a combination of keywords and rule engine matching to achieve better process matching results. 4. Arbitrary orchestration: Support flexible orchestration and interruption, with branching, parallel, asynchronous and other capabilities, and support lightweight distributed transaction control operations. 5. Elegant hot refresh mechanism: When the rules change, there is no need to restart the application, and the application rules can be changed instantly.

[0147] like Figure 5 As shown in the figure, the architecture diagram of the lightweight process engine implementation device is shown. The process is as follows: 1. When the project starts, the orchestration client Client scans all types that implement the Component interface. 2. The client reports the scanned types to the process orchestration center server Server. 3. The client pulls the process configuration information of the current service from the Server. 4. The client writes the pulled configuration information to the local cache. 5. The request traffic enters the business application, and the business application queries the specific process through the Client. 6. The client matches the specific process configuration information from the local cache. 7. The client executes the process according to the configuration information.

[0148] The client is designed to manage all nodes through the process configuration bus, including component scanning, component reporting, process pulling, and process execution. 1. Component scanner: mainly scans all computing components that implement the Component interface when the project starts, and then sends the type information to the process configuration bus. 2. Reporting controller: takes over the computing components scanned by the component scanner, packages all type information and sends it to the Server. 3. Pull controller: pulls all processes configured on the current application from the Server and maintains them in the local cache. 4. Process matcher: matches the specific process to be executed through custom rules and conditions. 5. Process executor: executes nodes according to the execution mode of each node in the process (such as parallel serial rollback). 6. Custom execution aspects can be inserted before and after the execution of each node.

[0149] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0150] Based on the same inventive concept, the embodiment of the present application also provides a lightweight process engine implementation device for implementing the lightweight process engine implementation method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in the one or more lightweight process engine implementation device embodiments provided below can refer to the limitations of the lightweight process engine implementation method above, and will not be repeated here.

[0151] In an exemplary embodiment, Figure 6 As shown, a lightweight process engine implementation device is provided, including:

[0152] The interface scanning module 602 is used to scan and obtain all interface type information of the client module;

[0153] Reporting module 604, used to report all interface type information to the server module;

[0154] Configuration information acquisition module 606, obtains the process configuration information of the current service from the server module;

[0155] The storage module 608 is used to write the process configuration information of the current service into the local cache module;

[0156] A query module 610 is used to respond to a business request from a business application terminal and query a specific process corresponding to the business request;

[0157] The configuration information matching module 612 is used to match the corresponding process configuration information from the local cache module according to the specific process corresponding to the business request;

[0158] The process execution module 614 is used to execute the corresponding specific process according to the corresponding process configuration information.

[0159] In an exemplary embodiment, the process execution module 614 is also used to execute the corresponding specific process according to the execution mode of each process node, and insert a custom execution plug-in before and after the execution of each process node.

[0160] In an exemplary embodiment, the process execution module 614 is also used to implement extended functions using a hook mechanism during the execution of a specific process. The extended functions include business processing, execution interception hook, pre-hook, post-hook and rollback hook.

[0161] In an exemplary embodiment, the execution method includes a serial process; the process execution module 614 is also used to perform an interception operation on the current process node; when the current process node is not intercepted, traverse the predecessor dependent nodes to obtain the node execution results of the predecessor dependent nodes; according to the node execution results of the predecessor dependent nodes, execute the node pre-hook of the current process node; when the node pre-hook execution is completed, execute the current process node; when the current process node execution is completed, execute the node post-hook of the current process node.

[0162] In an exemplary embodiment, the execution method includes a parallel process, and the process execution module 614 is also used to submit the execution task of at least one current process node to the thread pool; execute the interception operation on at least one current process node in parallel from the thread pool; when at least one current process node is not intercepted, traverse the predecessor dependent nodes and obtain the node execution result of at least one predecessor dependent node; according to the node execution result of the predecessor dependent node, execute the node pre-hook of at least one current process node; when the node pre-hook execution is completed, execute at least one current process node; when the current process node execution is completed, execute at least one current process node execution node post-hook.

[0163] In an exemplary embodiment, the process execution module 614 is also used to execute a rollback hook when abnormal data is captured during the process of obtaining the node execution result of at least one preceding dependent node, executing a node pre-hook, executing the current process node and a node post-hook.

[0164] Each module in the above-mentioned lightweight process engine implementation device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0165] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a lightweight process engine implementation method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0166] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0167] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0168] Scan and obtain all interface type information of the client module;

[0169] Report all interface type information to the server module;

[0170] Get the process configuration information of the current service from the server module;

[0171] Write the process configuration information of the current service to the local cache module;

[0172] Respond to the business request from the business application end and query the specific process corresponding to the business request;

[0173] According to the specific process corresponding to the business request, the corresponding process configuration information is matched from the local cache module;

[0174] Execute the corresponding specific process according to the corresponding process configuration information.

[0175] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0176] Through the process execution module, the corresponding specific process is executed according to the execution mode of each process node, and a custom execution plug-in is inserted before and after the execution of each process node.

[0177] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0178] During the execution of a specific process, the hook mechanism is used to implement extended functions, including business processing, execution interception hook, pre-hook, post-hook and rollback hook.

[0179] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0180] Execution methods include serial processes;

[0181] Execute interception operation on the current process node;

[0182] When the current process node is not intercepted, traverse the previous dependent nodes to obtain the node execution results of the previous dependent nodes;

[0183] According to the node execution result of the previous dependent node, execute the node preceding hook of the current process node;

[0184] When the node pre-hook is finished executing, the current process node is executed;

[0185] When the current process node is finished executing, the post-hook of the current process node execution node is executed.

[0186] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0187] Execution methods include parallel processes;

[0188] Submit at least one execution task of the current process node to the thread pool;

[0189] Execute interception operations on at least one current process node in parallel from the thread pool;

[0190] When at least one current process node is not intercepted, traverse the preceding dependent nodes to obtain the node execution result of at least one preceding dependent node;

[0191] According to the node execution result of the preceding dependent node, execute at least one node preceding hook of the current process node;

[0192] When the node pre-hook is finished, at least one current process node is executed;

[0193] When the execution of the current process node ends, at least one post-execution hook of the current process node is executed.

[0194] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0195] In the process of obtaining the node execution result of at least one preceding dependent node, executing the node preceding hook, executing the current process node and the node following hook, if abnormal data is captured, the rollback hook is executed.

[0196] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0197] Scan and obtain all interface type information of the client module;

[0198] Report all interface type information to the server module;

[0199] Get the process configuration information of the current service from the server module;

[0200] Write the process configuration information of the current service to the local cache module;

[0201] Respond to the business request from the business application end and query the specific process corresponding to the business request;

[0202] According to the specific process corresponding to the business request, the corresponding process configuration information is matched from the local cache module;

[0203] Execute the corresponding specific process according to the corresponding process configuration information.

[0204] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0205] Through the process execution module, the corresponding specific process is executed according to the execution mode of each process node, and a custom execution plug-in is inserted before and after the execution of each process node.

[0206] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0207] During the execution of a specific process, the hook mechanism is used to implement extended functions, including business processing, execution interception hook, pre-hook, post-hook and rollback hook.

[0208] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0209] Execution methods include serial processes;

[0210] Execute interception operation on the current process node;

[0211] When the current process node is not intercepted, traverse the previous dependent nodes to obtain the node execution results of the previous dependent nodes;

[0212] According to the node execution result of the previous dependent node, execute the node preceding hook of the current process node;

[0213] When the node pre-hook is finished executing, the current process node is executed;

[0214] When the current process node is finished executing, the post-hook of the current process node execution node is executed.

[0215] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0216] Execution methods include parallel processes;

[0217] Submit at least one execution task of the current process node to the thread pool;

[0218] Execute interception operations on at least one current process node in parallel from the thread pool;

[0219] When at least one current process node is not intercepted, traverse the preceding dependent nodes to obtain the node execution result of at least one preceding dependent node;

[0220] According to the node execution result of the preceding dependent node, execute at least one node preceding hook of the current process node;

[0221] When the node pre-hook is finished, at least one current process node is executed;

[0222] When the execution of the current process node ends, at least one post-execution hook of the current process node is executed.

[0223] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0224] In the process of obtaining the node execution result of at least one preceding dependent node, executing the node preceding hook, executing the current process node and the node following hook, if abnormal data is captured, the rollback hook is executed.

[0225] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0226] Scan and obtain all interface type information of the client module;

[0227] Report all interface type information to the server module;

[0228] Get the process configuration information of the current service from the server module;

[0229] Write the process configuration information of the current service to the local cache module;

[0230] Respond to the business request from the business application end and query the specific process corresponding to the business request;

[0231] According to the specific process corresponding to the business request, the corresponding process configuration information is matched from the local cache module;

[0232] Execute the corresponding specific process according to the corresponding process configuration information.

[0233] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0234] Through the process execution module, the corresponding specific process is executed according to the execution mode of each process node, and a custom execution plug-in is inserted before and after the execution of each process node.

[0235] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0236] During the execution of a specific process, the hook mechanism is used to implement extended functions, including business processing, execution interception hook, pre-hook, post-hook and rollback hook.

[0237] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0238] Execution methods include serial processes;

[0239] Execute interception operation on the current process node;

[0240] When the current process node is not intercepted, traverse the previous dependent nodes to obtain the node execution results of the previous dependent nodes;

[0241] According to the node execution result of the previous dependent node, execute the node preceding hook of the current process node;

[0242] When the node pre-hook is finished executing, the current process node is executed;

[0243] When the current process node is finished executing, the post-hook of the current process node execution node is executed.

[0244] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0245] Execution methods include parallel processes;

[0246] Submit at least one execution task of the current process node to the thread pool;

[0247] Execute interception operations on at least one current process node in parallel from the thread pool;

[0248] When at least one current process node is not intercepted, traverse the preceding dependent nodes to obtain the node execution result of at least one preceding dependent node;

[0249] According to the node execution result of the preceding dependent node, execute at least one node preceding hook of the current process node;

[0250] When the node pre-hook is finished, at least one current process node is executed;

[0251] When the execution of the current process node ends, at least one post-execution hook of the current process node is executed.

[0252] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0253] In the process of obtaining the node execution result of at least one preceding dependent node, executing the node preceding hook, executing the current process node and the node following hook, if abnormal data is captured, the rollback hook is executed.

[0254] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0255] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0256] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0257] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A lightweight process engine implementation method, characterized in that: Applied to the client module, the method comprises: Scan and obtain all interface type information of the client module; Reporting all the interface type information to the server module; Obtaining process configuration information of the current service from the server module; Writing the process configuration information of the current service into the local cache module; Respond to the business request from the business application end and query the specific process corresponding to the business request; According to the specific process corresponding to the business request, matching the corresponding process configuration information from the local cache module; According to the corresponding process configuration information, the corresponding specific process is executed.

2. The method according to claim 1, characterized in that The specific process corresponding to the execution includes: Through the process execution module, the corresponding specific process is executed according to the execution mode of each process node, and a custom execution plug-in is inserted before and after the execution of each process node.

3. The method according to claim 2, characterized in that The method further comprises: During the execution of a specific process, the hook mechanism is used to implement extended functions, which include business processing, execution interception hook, pre-hook, post-hook and rollback hook.

4. The method according to claim 3, characterized in that The execution method includes a serial process; According to the execution mode of each process node, the corresponding specific process is executed, including: Execute interception operation on the current process node; When the current process node is not intercepted, traverse the previous dependent nodes to obtain the node execution results of the previous dependent nodes; Execute the node pre-hook of the current process node according to the node execution result of the pre-dependent node; When the node pre-hook is finished executing, the current process node is executed; When the current process node is finished executing, the post-hook of the current process node execution node is executed.

5. The method according to claim 3, characterized in that: The execution method includes parallel processes; The process execution module executes the corresponding specific process according to the execution mode of each process node, including: Submit at least one execution task of the current process node to the thread pool; Execute interception operations on at least one current process node in parallel from the thread pool; When at least one current process node is not intercepted, traverse the preceding dependent nodes to obtain the node execution result of at least one preceding dependent node; Execute a node pre-hook of at least one current process node according to the node execution result of the pre-dependent node; When the node pre-hook is finished, at least one current process node is executed; When the execution of the current process node ends, at least one post-execution hook of the current process node is executed.

6. The method according to claim 4 or 5, characterized in that: The method further comprises: In the process of obtaining the node execution result of at least one preceding dependent node, executing the node preceding hook, executing the current process node and the node following hook, if abnormal data is captured, the rollback hook is executed.

7. A lightweight process engine implementation device, characterized in that: Applied to a client module, the device comprises: Interface scanning module, used to scan and obtain all interface type information of client modules; A reporting module, used for reporting all the interface type information to the server module; A configuration information acquisition module, which acquires the process configuration information of the current service from the server module; A storage module, used to write the process configuration information of the current service into a local cache module; A query module, used to respond to a business request from a business application end and query a specific process corresponding to the business request; A configuration information matching module, used to match the corresponding process configuration information from the local cache module according to the specific process corresponding to the business request; The process execution module is used to execute the corresponding specific process according to the corresponding process configuration information.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Process execution control system, method and device, computer equipment and medium

    CN121008940A