Business execution method and electronic device
By constructing a visual business process in an enterprise-level software system and converting it into orchestrated text, and by utilizing lazy loading and instruction list techniques, the problem of low business execution efficiency was solved. This enabled efficient parallel processing and conditional jumps for technology-intensive processes, thereby improving the system's execution efficiency and reliability.
Patent Information
- Application Number
- CN202511508909.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-10-21
AI Technical Summary
In existing technologies, enterprise-level software systems have low business execution efficiency and insufficient support for parallel processing and conditional jumps in technology-intensive processes (such as firmware synchronization and real-time computing), resulting in long development cycles, high performance overhead, and difficulty in achieving real-time dynamic adjustment of business processes.
By pre-building a visual business process and converting it into orchestrated text, the environment is initialized using a lazy loading method, an instruction chain is generated, and business node instances are called to achieve parallel processing and conditional jumps, avoiding unnecessary serialization overhead.
It improves business execution efficiency and reliability, reduces development cycles, reduces the irrationality of memory resource allocation, and supports the efficient execution of technology-intensive processes.
Smart Images

Figure CN120994281B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of business execution technology, and in particular to business execution methods and electronic devices. Background Technology
[0002] In modern enterprise software systems, there are often key subsystems that carry core business logic. These systems, as the enterprise's digital hub, typically exhibit highly complex business logic, which not only includes multi-level conditional judgments and branching processes, but also involves cross-operations of multiple technical dimensions.
[0003] In related technologies, the entire business execution code is first compiled based on the business operation logic and stored. When a user's business execution command is received, the corresponding business execution code is called and executed. This results in low business execution efficiency and insufficient support for parallel processing and conditional jumps in technology-intensive processes (such as firmware synchronization and real-time computing). Summary of the Invention
[0004] This application provides a business execution method and an electronic device to at least address the problems of low execution efficiency and insufficient support for parallel processing and conditional jumps in related technologies.
[0005] This application provides a business execution method, which includes: responding to a business execution instruction input by a user, invoking orchestration text of a target business, wherein the orchestration text is generated by text conversion of a visualized business process of the target business; determining an instruction chain list representing the execution order of business nodes based on the orchestration text, and determining business node instances of the orchestration text based on the business nodes in the orchestration text; loading configuration parameters and establishing data connections based on the orchestration text to build a target runtime environment, and in the target runtime environment, sequentially invoking business node instances based on the instruction chain list to execute the target business.
[0006] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the steps of any of the above-described business execution methods when executing the computer program.
[0007] This application demonstrates that upon receiving user-inputted business execution instructions, the corresponding orchestration text can be directly invoked, and environment initialization can be performed based on the orchestration text. This includes setting up the runtime environment, generating the instruction chain, and instantiating business nodes. Since this method uses lazy loading for environment initialization, it improves the rationality of memory resource allocation and avoids unnecessary serialization overhead. Furthermore, the invocation of business node instances based on the instruction chain can meet the execution requirements of parallel processing and conditional jumps in technology-intensive processes. Therefore, it can solve the technical problems of low execution efficiency and insufficient support for parallel processing and conditional jumps in related technologies, thereby improving business execution efficiency and reliability. Attached Figure Description
[0008] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0009] Figure 1 A flowchart of a business execution method provided in an embodiment of this application;
[0010] Figure 2 This is a schematic diagram of a visual process orchestration framework according to one embodiment of this application;
[0011] Figure 3 This is a schematic diagram illustrating the business execution process of one embodiment of this application;
[0012] Figure 4 This is a schematic diagram illustrating the conversion of text layout according to an embodiment of this application. Detailed Implementation
[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0014] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0015] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0016] In modern enterprise software systems, there are critical subsystems that carry core business logic. These systems often have the following typical characteristics: First, as the enterprise's digital hub, they handle key business processes related to the enterprise's core competitiveness, and almost every new requirement will intersect with these core logics; Second, the business logic of these systems is usually highly complex, not only including multi-level condition judgments and branching processes, but also involving cross-operations of multiple technical dimensions, including but not limited to in-memory data computation, distributed caching processing, database persistence operations, third-party service calls, and cross-system RPC (Remote Procedure Call) communication and other complex interactions.
[0017] As the system continued to iterate and evolve, and after multiple rounds of development team changes, it gradually accumulated "technical debt." The business logic was riddled with hard-coded conditional branches, the code's abstraction hierarchy was chaotic, and a network of coupling dependencies formed between modules. This architectural degradation meant that even local logic adjustments could trigger unpredictable chain reactions, forcing the development team to implement full-link regression testing. More seriously, when business departments requested adjustments to the execution order or rules of processes, the development team often needed to perform large-scale code refactoring. Achieving real-time dynamic adjustments to business processes presented a near-impossible technical challenge, directly hindering the company's business agility and innovation speed.
[0018] To address these issues, a process management solution needs to be introduced to adjust existing business processes. However, it has been found that current mainstream process management solutions suffer from three major technical bottlenecks:
[0019] 1. Architectural coupling problem:
[0020] The workflow engines used in related technologies (such as Activiti) deeply bind business logic with process control, resulting in process changes requiring code modifications and redeployment. Statistics from an e-commerce platform show that each adjustment to promotional rules requires an average of 3 days of development time and 1 hour of service downtime. Activiti, an open-source Java workflow and business process management engine, is an open-source engine that transforms flowcharts into runnable programs.
[0021] 2. Limited expressive ability:
[0022] While the process engines used in related technologies (such as LiteFlow, a lightweight process engine) offer relatively comprehensive process management, they lack sufficient support for visualization technologies. They struggle to visually express the user's intended design logic, offering only EL (Expression Language) expressions. Developers must manually visualize the corresponding logical flows, which is not user-friendly for newcomers, often requiring considerable time to understand, resulting in a relatively high learning curve. Furthermore, in real-world business scenarios, transitions between nodes are possible, but the process engine does not support direct jumps. This forces some business logic to employ roundabout methods, further complicating the code.
[0023] 3. Low execution efficiency:
[0024] Interpreted workflow engines (such as Apache Airflow) used in related technologies incur up to 300% additional performance overhead in complex workflows. Test data shows that when processing workflows with more than 50 nodes, the engine itself consumes 65% of the total response time, making the sacrifice of performance for the sake of the workflow framework a poor trade-off. Apache Airflow, in particular, is an open-source data orchestration platform that uses Python scripts to write workflows, with a scheduling engine responsible for timing, concurrency, monitoring, and retries.
[0025] Furthermore, the related technologies disclose a business process management framework. This framework proposes a custom DSL (Domain-Specific Language) for describing processes based on BPMN (Business Process Model and Notation) 2.0 extension at the process modeling layer. The engine layer adopts state machine-driven operation, and the execution layer supports distributed transaction coordination and instance snapshots to solve the flexibility and performance problems of traditional workflow engines in complex business scenarios. It is suitable for long-cycle process management such as approval and production scheduling.
[0026] However, this solution still has the following significant drawbacks:
[0027] 1. Weak technical process support: This technical solution focuses on approval-type business processes and does not adequately support parallel processing and conditional jumps for technology-intensive processes (such as firmware synchronization and real-time computing).
[0028] 2. The configuration is cumbersome and the learning curve is steep. It relies on XML (Extensible Markup Language) / JSON (JavaScript Object Notation) to define interface contracts, which is less efficient than declarative annotations. Furthermore, the BPMN extension syntax is rather obscure, requiring additional training, making it difficult for small and medium-sized enterprises to adapt.
[0029] 3. Visualization deficiencies: It only supports the conversion from BPMN to code, lacks bidirectional real-time mapping capabilities, and cannot intuitively display technical nodes such as parallel branches and exception retries.
[0030] To address at least one of the aforementioned technical problems, this application proposes a business execution method. This method pre-constructs a visual business process to represent the logical order of business execution, and performs text conversion on the visual business process to obtain corresponding orchestrated text. This orchestrated text is stored for subsequent business execution invocation. Therefore, upon receiving a user-inputted business execution instruction, the corresponding orchestrated text can be directly invoked, and environment initialization is performed based on the orchestrated text, including setting up the runtime environment, generating an instruction list, and instantiating business nodes. That is, this method uses lazy loading for environment initialization, which improves the rationality of memory resource allocation and avoids unnecessary serialization overhead. Simultaneously, invoking business node instances based on the instruction list can meet the execution requirements of parallel processing and conditional jumps for technology-intensive processes, improving business execution efficiency and reliability.
[0031] The business execution method of this application will be described in detail below with reference to the accompanying drawings.
[0032] Reference Figure 1 As shown, the business execution method of this application embodiment may include the following steps:
[0033] S1, in response to the business execution command input by the user, calls the orchestration text of the target business, wherein the orchestration text is generated by text conversion of the visual business process of the target business.
[0034] Specifically, upon receiving a user-input service execution command, feature extraction and command recognition are performed on the command to obtain the identification information of the target service. The identification information can be an identifier code, text name, etc., with no specific limitations. Then, by matching the identification information of the target service with pre-stored formatted text, the formatted text of the target service is obtained.
[0035] This orchestration text is generated by converting the visualized business process of the target business into text. In other words, users orchestrate business processes based on a visual interface, generating visualized business processes and ensuring the reliability of the orchestration. Then, the visualized business processes are converted into orchestration text for storage and business execution. On the one hand, this can reduce storage space, and on the other hand, it can ensure that the orchestration text meets the calling format requirements, thus providing a guarantee for the smooth execution of the business.
[0036] S2, determine the instruction chain list used to represent the execution order of business nodes based on the orchestration text, and determine the business node instances of the orchestration text based on the business nodes in the orchestration text.
[0037] In other words, lexical and syntactic analysis is performed on the compiled text to extract the relationship chain of business nodes, which is then converted into an instruction flow linked list data structure in memory, resulting in an instruction linked list. This instruction linked list essentially constitutes a finite state machine, with each node containing execution conditions and jump logic, providing a navigation graph for subsequent process execution.
[0038] Perform path scanning on the arranged text to identify nodes in the arranged text that are in the target class. Assuming that the @IntNode annotation class represents the business function node unit in the process, all nodes with the @IntNode annotation class under the scanned path are taken as business nodes in the arranged text. Instantiate the business nodes in the arranged text to obtain the business node instance corresponding to each business node.
[0039] S3 loads configuration parameters and establishes data connections based on the orchestrated text to build the target runtime environment. In the target runtime environment, business node instances are called sequentially based on the instruction chain to execute the target business.
[0040] In other words, after loading the orchestration text, the system identifies the configuration parameters and data connections required for the execution of the target business based on the orchestration text, thus completing the preparation of process data and building the target runtime environment. The mapping relationship between the orchestration text and configuration parameters and data connections can be pre-set. After loading the orchestration text, the system looks up the corresponding configuration parameters and data connection relationships based on the identification information in the orchestration text. The configuration parameters are pre-loaded and stored, and the connection channels are built based on the data connection relationships, resulting in the basic environment, i.e., the target runtime environment, providing fundamental environmental support for the execution of the target business.
[0041] Different business operations require different configuration parameters and data connection relationships. For example, when performing system synchronization operations, the necessary configuration parameters include the default file storage path, matching rules, keyword list, and brand list. These parameters can be loaded according to the actual situation. Data connections can include the connection relationship between the current execution engine and other units, or the connection relationship between different units, to meet the data exchange needs of business operations.
[0042] In the target runtime environment, the business node instances of each node are sequentially called based on the parsed instruction list. The corresponding business logic is then executed based on each business node instance to complete the target business. Since each business node instance corresponds to one instruction list node, parallel processing can be performed synchronously using different business node instances.
[0043] In addition, after the target business is completed, the target operating environment is cleared to release resources and improve resource utilization.
[0044] When this embodiment receives a user-inputted business execution command, it directly calls the corresponding orchestration text and performs environment initialization based on the orchestration text, including setting up the runtime environment, generating the instruction chain, and instantiating the business nodes. That is, it performs environment initialization based on lazy loading, which improves the rationality of memory resource allocation and avoids unnecessary serialization overhead. At the same time, the call to the business node instance based on the instruction chain can meet the execution requirements of parallel processing and conditional jumps for technology-intensive processes, thereby improving business execution efficiency and reliability.
[0045] In some embodiments of this application, determining an instruction list representing the execution order of business nodes based on the orchestrated text includes: performing lexical and syntactic analysis on the orchestrated text to determine the next node pointer for each business node in the orchestrated text; determining a node relationship list based on the next node pointer for each business node in the orchestrated text; determining the instruction flow node corresponding to each business node based on the node relationship list; and connecting the instruction flow nodes according to the access order to generate an instruction list.
[0046] Specifically, the node relationship list describes the connection relationships between nodes, and the instruction list is a sequence of instructions arranged in the order of execution.
[0047] When a user triggers a business execution command, the process enters the parsing phase. First, predefined formatted text is loaded from the storage medium. Lexical and syntactic analysis is then performed on the formatted text to extract the "next" relationship chain, generating a node relationship list. Here, "next" represents the next node pointed to by each node.
[0048] Next, the node relationship linked list is analyzed to understand the connection topology between nodes and determine the starting node of the process. An empty instruction flow linked list is created as the result container. Then, the node corresponding to the starting ID (IdentityDocument) is found in the node relationship linked list, and the instruction content of that node is copied to the new instruction flow node. Sequence numbers are assigned to the instruction flow nodes to set the execution order. This process is repeated cyclically until an end marker is encountered (e.g., next_node_id=-1) or no next node is found. Finally, the instruction flow nodes are connected according to the access order to obtain the instruction linked list. This linked list essentially constitutes a finite state machine, with each node containing execution conditions and jump logic, providing a navigation graph for subsequent process execution and improving node jump efficiency and stability.
[0049] In some embodiments of this application, determining the business node instance of the arranged text based on the business nodes in the arranged text includes: scanning the arranged text to identify the business nodes in the arranged text; instantiating the business nodes based on a preset reflection mechanism to obtain the business node instance corresponding to the business node; determining the business node instance of the arranged text according to the business node instance corresponding to each business node, and storing the business node instance of the arranged text in a target container so that during the execution of the target business, the corresponding business node instance can be called from the target container based on the instruction chain.
[0050] In other words, the system scans all nodes annotated with `@IntNode` under the package path of the orchestrated text (referring to the Java JAR file path). These annotated classes represent business function nodes in the process, thus obtaining the business nodes in the orchestrated text. Then, through Java reflection (i.e., the default reflection mechanism), these classes are instantiated, and the obtained business node instances are registered with the Spring container and the target container for unified management. This achieves loose coupling of business nodes, facilitating subsequent dynamic expansion and maintenance of nodes.
[0051] The instantiation of business nodes based on Java reflection can include the following steps: First, locate the "blueprint" (Class object) of the business node using its fully qualified name (in string form) to obtain the class information. Second, call the API (Application Programming Interface) to construct an object instance of that class to obtain the corresponding business node instance. The API refers to all methods provided by the `java.lang.Class` class and the `java.lang.reflect` package (such as the `Field`, `Method`, and `Constructor` classes). The API allows viewing, analyzing, and manipulating the internal structure of a class at runtime.
[0052] In some embodiments of this application, storing a business node instance of the orchestrated text into a target container includes: matching the business node instance of the orchestrated text with a pre-stored business node instance in the target container; storing the business node instance in the target container if the business node instance fails to match the pre-stored business node instance in the target container; storing the business node instance in the target container if the business node instance successfully matches the pre-stored business node instance in the target container and the business node instance is in a concurrent branch of the orchestrated text, and deleting the business node instance from the target container after the target business is executed; and not storing the business node instance if the business node instance successfully matches the pre-stored business node instance in the target container and the business node instance is not in a concurrent branch of the orchestrated text.
[0053] In other words, during the instantiation and registration process, it is necessary to determine whether the newly added business node instance already exists in the Spring container, i.e., the target container. This can be done by identifying the unique identifier of the business node instance, specifically the `id` field in the `@IntNode` annotated class.
[0054] If the newly added business node instance is not duplicated with the pre-stored business node instance in the Spring container, the newly added business node instance will be stored in the Spring container and await the business execution call.
[0055] If the newly added business node instance is the same as the pre-stored business node instance in the Spring container, and the newly added business node instance is in a concurrent branch, that is, the user performed concurrent processing in this business instruction flow, and the business node instance is only responsible for the current flow, then the business node instance is saved to prevent data sharing errors caused by concurrent processing under single-instance conditions, and the business node instance is deleted after the execution of the target business flow ends.
[0056] If a newly added business node instance is duplicated with a pre-stored business node instance in the Spring container, and the newly added business node instance has no concurrent branches, then the business node instance will be discarded, and the user will be reminded that the node ID of a business node instance in the Spring container cannot be duplicated.
[0057] This embodiment is a technical solution that performs corresponding storage / discard actions based on the matching result between the business node and the pre-stored business node instance in the target container, and whether the business node instance is in a concurrent branch. This prevents data sharing under singleton conditions from causing errors, ensures the execution efficiency and stability of the business process, and reduces the storage of duplicate instances.
[0058] In some embodiments of this application, business node instances are sequentially invoked based on an instruction chain to execute a target business, including: identifying the next business node to be executed based on the instruction chain, invoking the business node instance of the business node, and obtaining the intermediate data and process parameters required by the business node; injecting the intermediate data and process parameters into the business node instance through dependency injection, and outputting the execution result of the business node, wherein the execution result of the business node serves as the intermediate data of the next business node corresponding to the business node; and determining that the target business has been completed when the next business node to be executed identified by the instruction chain is empty.
[0059] In other words, the business execution process strictly follows the orchestration definition, sequentially calling the business logic of each business node in a chained order. Specifically, based on the parsed and generated instruction chain, the target business is coordinated for execution. Business node instances are retrieved from the Spring container on demand based on the instruction chain. Intermediate data and process parameters that the business node instances depend on are injected into the business node instances through dependency injection, ensuring successful execution and improving the stability of business execution. Intermediate data refers to the execution result of the previous node required by the business node, and process parameters are common parameters of the process, such as whether to continue after failure, execution timeout, and whether to skip. During execution, a shared context environment (common data) is maintained to facilitate data transfer between nodes. When it is detected that the "next" pointer of a node is empty, the target business execution is considered complete, and the entire process terminates.
[0060] In some embodiments of this application, after outputting the execution result of the business node, the business execution method further includes: determining the preset evaluation conditions corresponding to the business node; evaluating the execution path and execution result of the business node based on the preset evaluation conditions to identify the execution status of the business node; if the execution status of the business node determines that the business node has been successfully executed, identifying the next business node to be executed based on the instruction chain; if the execution status of the business node determines that the business node has failed, identifying the exception type of the business node, and performing execution control on the target business according to the exception type, and generating a corresponding exception reminder signal.
[0061] In other words, after each node completes its execution, its execution status and the "next" pointer are checked to determine the subsequent direction of the process. Specifically, the execution path and result of the business node are evaluated using preset evaluation conditions to determine the execution status of that business node and whether the current node has succeeded or failed, in order to decide whether to terminate. The specific success or failure judgment logic is determined by the current business node. For example, for a download node, the corresponding preset evaluation conditions should check whether the required file actually exists in a certain path and whether the execution result is equal to the expected value. If so, the node is considered to have succeeded; otherwise, the node is considered to have failed.
[0062] When a business node is determined to have executed successfully, the execution of the target business continues based on the identified "next" pointer, which points to the next business node to be executed. When a business node is determined to have failed, the execution flow is controlled based on the exception type of that business node. Different execution flow handling is performed for different execution exception situations, and corresponding exception alert signals are generated to improve the execution efficiency of the business process.
[0063] In some embodiments of this application, identifying the anomaly type of a service node and controlling the execution of the target service based on the anomaly type includes: obtaining the instruction list position of the service node; if the instruction list position of the service node is the target position, determining that the anomaly type of the service node is a system-level critical error and controlling the target service to stop execution; if the instruction list position of the service node is not the target position, determining that the anomaly type of the service node is a business logic anomaly, executing the node recovery execution strategy, and controlling the target service to stop execution if the number of consecutive occurrences of the business logic anomaly exceeds a preset number.
[0064] In other words, the distinction between a "business logic exception" and a "system-level critical error" is made based on the position of the business node in the instruction chain process. A system-level critical error refers to an error so severe that execution cannot continue. The distinction between "business logic exceptions" and "system-level critical errors" is based on the target location, which can be determined according to the actual business requirements. For example, in a file download process, since subsequent archiving depends on the preceding files, if the file download fails in the first step, there is no need to continue, and it is considered a system-level critical error.
[0065] For business logic exceptions, a unified exception interception and transformation mechanism is provided, supporting recovery strategies such as retry and skipping to avoid affecting the overall process. Furthermore, when the number of consecutive occurrences of business logic exceptions exceeds a preset limit, the process execution is automatically paused, employing a circuit breaker mechanism to prevent system resource exhaustion. For system-level critical errors, the process is immediately terminated and resource reclamation is performed, saving and persisting process data, releasing temporary memory and CPU (Central Processing Unit) resources currently occupied by the process, and releasing FTP (File Transfer Protocol) connections, database connections, etc. In addition, all exception events are recorded in the monitoring system, forming a complete audit trail.
[0066] In some embodiments of this application, the business execution method further includes: determining business nodes and annotating the business nodes with node classes; visually displaying the business nodes and arranging and connecting multiple business nodes through user operations to obtain an initial business process corresponding to the target business; compiling the node code of the corresponding business nodes based on the node class annotations of the business nodes in the initial business process to generate a visual business process of the target business; and converting the visual business process of the target business into text based on a preset data structure to obtain an edited text.
[0067] Specifically, based on this business execution method Figure 2 The system framework shown is an example. (Reference) Figure 2 As shown, the system consists of four parts: business engine, orchestration visualization tool, orchestration engine, and control engine. The following describes the functions of these parts in detail, taking the firmware automated synchronization process as an example.
[0068] First, let's describe the business scenario of automated firmware synchronization. Firmware is the running program of the server's baseboard controller and basic input / output system, used to manage and control the server. As business grows, firmware is continuously released and updated from various channels. A system is needed to aggregate these firmware files from different sources, in different formats, and with different processes, ultimately forming a unified, standardized firmware query system. Therefore, a complete firmware synchronization process compatible with different data sources needs to be designed. In this case, downloading firmware is the smallest indivisible unit, its function being to download the target file to the target path based on the provided FTP path. File lookup is a prerequisite for downloading firmware; its purpose is to retrieve available FTP paths based on the provided FTP path and user-provided rules for the firmware download node to use. These are two typical business nodes, representing the specific execution logic of the user's business. As for when and how file lookup and firmware download are used, the system automatically generates the invocation process based on the user's plan. This plan is essentially an orchestration concept, that is, how to use each business node. Orchestration is a text string used to describe how all business nodes will execute under what circumstances. Of course, in order to make it easier for users to orchestrate business nodes, this embodiment introduces an orchestration visualization tool, which can arrange and combine business nodes in a visual way.
[0069] Business Engine: A set of process specifications that constrain business nodes. Taking firmware download and file search as examples above, these two nodes need to meet minimum coding requirements, namely, they need to use the `@IntNode(id="instructionFetch", name="Pull instruction file", type="Common")` annotation to identify the node class. This indicates that the class is a node managed by the control engine, used for identifying business nodes during execution. Specific node class annotations need to meet certain rules to improve the construction and execution efficiency of the business process:
[0070] 1. All classes annotated with @IntNode must satisfy the execution call method (such as the run method) of the control engine. The run method refers to a predefined block of code (function or method) used to execute a specific task or logic. Users need to specify the business logic to be executed in the run method. The specific execution scheduling is handled by the system framework.
[0071] 2. `@IntNode` is an annotation used to mark the current class. It contains three attributes: `id` is the unique identifier for this node; `name` is the name; and `type` is the node type. Depending on the business logic, nodes are divided into three types: Common, Switch, and Goto. The type affects the return value of the `run` method. Specifically:
[0072] When type is Common, the return value of the run method is not required. After the control engine completes the execution of this node, it continues to execute the next node in sequence.
[0073] When the type is Switch, the return value of the run method is a string containing the ID of the next node. For example, if the firmware type is BMC (Baseboard Management Controller), it follows the BMC adaptation process; if it is BIOS (Basic Input / Output System), it follows the BIOS adaptation process; and if it is CPLD (Complex Programmable Logic Device), it follows the CPLD adaptation process. Here, a firmware process jump node (procedureSwitch) needs to be written. In the run method, the ID of the node to continue to the next step under different conditions is specified. After the current node is executed, the next node specified by the current branch will be executed.
[0074] When type is goto, it can be understood as a special branch node with only one jump item. It is a simplification of the branch node. This requires the run method to return the node ID as a string. The applicable scenario is that if the current node encounters an exception or does not meet the required input data format, it can directly jump to the failure handling node or the termination node.
[0075] The orchestration visualization tool is a built-in workflow editing tool that allows users to arrange and combine individual business units for visual editing. It serves as the framework's entry point, where users can drag and drop multiple business nodes, connecting them with lines to achieve visual management of node execution, similar to drawing a flowchart. This generates an initial business process, clearly indicating the flow of business nodes in a flowchart format, providing a clear overall logic. The initial business process represents the execution logic of each node within the business logic.
[0076] Using the orchestration visualization tool, users simply right-click on a business node in the initial business process to generate node code. This automatically generates a simple node class, meaning users only need to write the current business code in the generated class file. The node code includes node class comments for that business node and represents the specific execution code for that node. For example, taking a download node as an example, the specific execution code for that download node defines how to perform the download, which should include connecting to an FTP server, inputting the path, checking connectivity, saving the file, checking for validity, and deleting temporary files.
[0077] The orchestration engine is a module that transforms content between orchestration text and orchestration visualization tools. Its main purpose is to convert the content of the visualization orchestration tool into orchestration text and to parse the orchestration text into visualization tool elements. The orchestration text is a formatted data structure used by the control engine, which will string together business nodes for execution based on this data structure.
[0078] Control Engine: It connects and runs the processes designed by the user using the orchestration visualization tool, and handles any exceptions that occur. Its processing flowchart is to receive the user's business execution instructions, call the stored orchestration text, and complete the business execution.
[0079] Combination Figure 3 As shown, the control engine, as the core scheduling center of the entire process system, operates in four main stages: initialization preparation, process parsing, execution scheduling, and exception handling, forming a complete lifecycle management mechanism. Details are as follows:
[0080] 1. Initialization preparation phase:
[0081] Upon system startup, the control engine first performs environment initialization. The core task of this phase is to scan all classes annotated with `@IntNode` in the package path. These annotated classes represent business function nodes in the process. Using Java reflection, the control engine instantiates these classes and registers the instances with the Spring container for unified management. This design achieves loose coupling between nodes, facilitating subsequent dynamic expansion and maintenance. Simultaneously, the control engine prepares the process data, including loading necessary configuration parameters and establishing data connections—essentially setting up the basic environment.
[0082] 2. Process Analysis Phase:
[0083] For example, when a user triggers a specific process named "custom1", the control engine enters the process parsing phase. First, it loads predefined, formatted text from storage. The parsing module performs lexical and syntactic analysis on the text, focusing on extracting the "next" relationship chains and converting them into an instruction flow linked list data structure in memory. This linked list essentially constitutes a finite state machine, with each node containing execution conditions and jump logic, providing a navigation graph for subsequent process execution.
[0084] 3. Execution scheduling phase:
[0085] The control engine coordinates execution based on the parsed instruction chain. It retrieves node instances from the Spring container on demand, providing the necessary intermediate data and process parameters to the nodes via dependency injection. The execution process strictly follows the orchestration definition, sequentially calling the business logic of each node in a chained order. During execution, the engine maintains a shared context (public data) to facilitate data transfer between nodes. After each node completes execution, the engine checks its output and the "next" pointer to determine the subsequent direction of the process. When it detects that a node's "next" pointer is null, the engine gracefully terminates the entire process.
[0086] 4. Exception handling mechanism:
[0087] The control engine incorporates multi-level exception handling strategies. For business logic exceptions, it provides a unified exception interception and transformation mechanism, supporting recovery strategies such as retry and skipping. For critical system-level errors, it immediately terminates the process and performs resource reclamation. All exception events are logged to the monitoring system, forming a complete audit trail. The engine also implements a circuit breaker mechanism, automatically pausing process execution when consecutive exceptions occur to prevent system resource exhaustion.
[0088] Therefore, the control engine employs a combination of design patterns: the factory pattern for node instantiation, the observer pattern for event notification, and the strategy pattern for encapsulating different execution algorithms. Its architectural advantages lie in separating process logic from business implementation, and enabling configurable business processes through orchestration text. For execution efficiency, a lazy loading mechanism is used, instantiating specific nodes only when actually needed. In terms of data management, thread-safe data sharing is achieved through context objects, avoiding unnecessary serialization overhead.
[0089] This design enables the system to have excellent scalability. Adding new business functions only requires adding a new `@IntNode` class and updating the orchestration text, without modifying the core engine code. Furthermore, through integration with the Spring container, it can easily interface with other enterprise systems to achieve more complex integration scenarios. The engine also reserves extension points, supporting the loading of different parsers and executors via the SPI mechanism to meet the needs of different protocols and formats.
[0090] This implementation decouples business logic from business nodes, preventing hard-coded rules from becoming bloated and unusable later, thus improving business orchestration efficiency. Meanwhile, declarative annotations (i.e., using @IntNode to annotate node classes) reduce configuration and learning costs and broaden its applicability.
[0091] In some embodiments of this application, during the execution of the target service, the service execution method further includes: obtaining the node status of the service nodes in the instruction chain list; and displaying the visualized service process based on the node status to visualize the execution progress of the target service.
[0092] In other words, during business execution, the status of nodes in the instruction chain is updated based on their execution status. Different visual node colors are then matched to the updated node status in the instruction chain, thus changing the node colors of the visualized business process and visually displaying the execution progress of the target business. This achieves bidirectional real-time mapping, intuitively displaying node statuses such as parallel branches and exception retries.
[0093] like Figure 4 As shown, a compressor converts the visual business process generated by the orchestration visualization tool into orchestrated text. An interpreter can then convert the orchestrated text back into a visual business process, enabling bidirectional conversion. Therefore, after the user-orchestrated visual process is converted into orchestrated text, the visual process is deleted. During application, the orchestrated text is converted back into a visual process based on user needs for display, thus reducing memory usage.
[0094] Therefore, the business execution method disclosed in this application is applied to Figure 2 Taking the system framework shown as an example, this system allows complex business logic to be broken down into independent units, and then each unit can be dragged and dropped to form a complete process using a visual method. It has the following characteristics:
[0095] 1. Separation of powers:
[0096] The system framework will extract three main modules: business unit (referred to as Node) orchestration, and control logic. Business units focus on handling specific business processes and are handled by the user. Orchestration involves the arrangement and combination of business units and process transitions, also handled by the user. The control logic is responsible for reading and executing the user's business units and orchestrations, and controlling data flow; this should be the responsibility of the framework.
[0097] 2. Visualized layout:
[0098] The system framework should also have an orchestration management module, which is specifically responsible for displaying and editing the user's orchestration. It supports dragging and dropping nodes in a graphical way, and supports converting the generated orchestration diagram into text for storage and handing it over to the control logic. It also supports converting text descriptions into graphics for the user to edit.
[0099] 3. Data-driven:
[0100] The system framework is completely neutral. The process depends entirely on the user's data, orchestration, and business nodes. The framework supports user input of test data and graphically displays the running trajectory during trial runs.
[0101] 4. Stable performance:
[0102] The framework needs to complete most of the work at startup, including parsing rules, registering components, and assembling metadata. During execution, the framework's performance consumption should be minimized. Simple checks should also be performed on user rules or business units (e.g., checking if rules lead to non-existent nodes, or if there are infinite loops in the jump nodes, to prevent program malfunctions due to user input errors), preventing hidden loops from affecting the overall process.
[0103] Therefore, this method decouples various business logics, is suitable for the refactoring of complex business logic, and prevents hard-coded rules from becoming bloated and unusable later.
[0104] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0105] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above-described business execution method embodiments.
[0106] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0107] The above provides a detailed description of a business execution method and electronic device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A business execution method, characterized in that, The method includes: In response to a user-inputted business execution command, the orchestration text of the target business is invoked, wherein the orchestration text is generated by text conversion of the visualized business process of the target business; Based on the orchestration text, an instruction chain list for representing the execution order of business nodes is determined, and business node instances of the orchestration text are determined based on the business nodes in the orchestration text. Based on the arranged text, configuration parameters are loaded and data connections are established to build the target runtime environment. In the target runtime environment, business node instances are sequentially called based on the instruction chain to execute the target business. After the target business is executed, the target runtime environment is cleared. The method further includes: Identify the business nodes and annotate them with node classes; The business nodes are visualized, and multiple business nodes are arranged and connected through user operations to obtain the initial business process corresponding to the target business. Based on the node class annotations of the business nodes in the initial business process, the node code of the corresponding business nodes is compiled to generate a visual business process of the target business. Based on a preset data structure, the visualized business process of the target business is converted into text to obtain the arranged text; The node class annotation for the business nodes includes: The target class is determined based on the execution call method of the preset control engine; The business node is annotated with a node class according to the target class. The node class annotation includes the unique identifier, name and type of the corresponding business node. The type affects the return value of the execution call method.
2. The business execution method according to claim 1, characterized in that, Based on the arranged text, an instruction list is determined to characterize the execution order of business nodes, including: Lexical and syntactic analysis are performed on the arranged text to determine the next node to be pointed to for each business node in the arranged text; The next node in the arranged text points to a linked list of node relationships. The instruction flow node corresponding to each business node is determined based on the node relationship chain. The instruction flow nodes are connected in the order of access to generate the instruction linked list.
3. The business execution method according to claim 1, characterized in that, Determining the business node instance of the arranged text based on the business nodes in the arranged text includes: Scan the arranged text to identify the business nodes in the arranged text; The business node is instantiated based on a preset reflection mechanism to obtain the business node instance corresponding to the business node. The business node instance of the orchestrated text is determined based on the business node instance corresponding to each business node, and the business node instance of the orchestrated text is stored in the target container so that the corresponding business node instance can be called from the target container based on the instruction chain during the execution of the target business.
4. The business execution method according to claim 3, characterized in that, Storing the business node instance of the arranged text into the target container includes: Match the business node instance of the arranged text with the pre-stored business node instance in the target container; If a business node instance fails to match a pre-stored business node instance in the target container, the business node instance will be stored in the target container. If a business node instance successfully matches a pre-stored business node instance in the target container and the business node instance is in a concurrent branch of the orchestrated text, the business node instance is stored in the target container, and the business node instance is deleted from the target container after the target business is executed. If a business node instance successfully matches a pre-stored business node instance in the target container and the business node instance is not in a concurrent branch of the orchestrated text, the business node instance is not stored.
5. The business execution method according to claim 1, characterized in that, The process of sequentially invoking business node instances based on the instruction chain to execute the target business includes: Based on the instruction chain, the next business node to be executed is identified, the business node instance of the business node is called, and the intermediate data and process parameters required by the business node are obtained. The intermediate data and process parameters are injected into the business node instance through dependency injection, and the execution result of the business node is output. The execution result of the business node serves as the intermediate data for the next business node corresponding to the business node. If the next pending service node identified by the instruction chain is empty, the target service is determined to have been completed.
6. The business execution method according to claim 5, characterized in that, After outputting the execution result of the business node, the method further includes: Determine the preset evaluation conditions corresponding to the business node; The execution path and execution result of the business node are evaluated based on preset evaluation conditions to identify the execution status of the business node; If the execution status of the business node determines that the business node has been successfully executed, the next business node to be executed is identified based on the instruction chain. If the execution of a business node is determined to have failed based on its execution status, the anomaly type of the business node is identified, and the execution control of the target business is performed according to the anomaly type, and a corresponding anomaly alert signal is generated.
7. The business execution method according to claim 6, characterized in that, Identifying the anomaly type of the service node and performing execution control on the target service based on the anomaly type includes: Obtain the position of the instruction chain list where the business node is located; If the instruction chain position of the service node is the target position, determine that the exception type of the service node is a system-level critical error, and control the target service to stop execution; If the instruction chain position of the business node is not the target position, the exception type of the business node is determined to be a business logic exception, the node recovery execution strategy is executed, and if the number of consecutive occurrences of the business logic exception exceeds a preset number, the target business is controlled to stop execution.
8. The business execution method according to claim 1, characterized in that, During the execution of the target service, the method further includes: Obtain the node status of the business nodes in the instruction chain list; The visualization of the business process is based on the node status to visualize the execution progress of the target business.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the business execution method as described in any one of claims 1 to 8 when executing the computer program.
Citation Information
Patent Citations
Task engine execution method and device, equipment and medium
CN113672371A
Business process processing method and device, computer equipment, readable storage medium and program product
CN119671506A