Macro function implementation method and system and storage medium

By breaking down macro functions into atomic operations and converting them into programming language code, the professional coding barriers and cross-platform compatibility issues are resolved, achieving efficient macro function implementation and reducing maintenance complexity.

CN121785601APending Publication Date: 2026-04-03北京中关村科金技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-08
Publication Date
2026-04-03

Smart Images

  • Figure CN121785601A_ABST
    Figure CN121785601A_ABST
Patent Text Reader

Abstract

The invention discloses a macro function implementation method and system and a storage medium, which are used for solving the problems of professional coding barriers, high maintenance complexity, cross-platform compatibility difficulty and the like in related technologies. The macro function implementation method comprises the following steps: disassembling a macro function to be implemented in a service system into a plurality of atomic operations, and generating a first flow chart based on the plurality of atomic operations; nodes in the first flow chart represent the atomic operations, and edges in the first flow chart represent relationships among different atomic operations; converting the first flow chart into a first code based on a first programming language; and calling an interface of the business system based on the first code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, system and storage medium for implementing macro functions. Background Technology

[0002] In some business scenarios, it is often necessary to implement macro functions in business systems to automate repetitive operations. The current mainstream approach is for the development team to write macro commands based on the business logic of the macro function and integrate them into the business system for execution. However, this traditional model has revealed problems in practical applications, including high barriers to specialized coding, high maintenance complexity, and cross-platform compatibility issues. Summary of the Invention

[0003] The purpose of this application is to provide a macro function implementation method, system, and storage medium to solve the above-mentioned technical problems.

[0004] To achieve the above objectives, the embodiments of this application adopt the following technical solutions: In a first aspect, embodiments of this application provide a macro function implementation method, including: The macro functions to be implemented in the business system are decomposed into multiple atomic operations, and a first flowchart is generated based on the multiple atomic operations; the nodes in the first flowchart represent the atomic operations, and the edges in the first flowchart represent the relationships between different atomic operations. Convert the first flowchart into first code based on the first programming language; The interface of the business system is called based on the first code.

[0005] Secondly, embodiments of this application provide a macro function implementation system, including: An orchestrator is used to decompose macro functions to be implemented in a business system into multiple atomic operations, and to generate a first flowchart based on the multiple atomic operations; the nodes in the first flowchart represent the atomic operations, and the edges in the first flowchart represent the relationships between different atomic operations. A conversion engine is used to convert the first flowchart into first code based on a first programming language; A macro executor is used to call the interface of the business system based on the first code.

[0006] Thirdly, embodiments of this application provide a computer-readable storage medium that, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the macro function implementation method provided in the first aspect.

[0007] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects: First, the macro functions to be implemented in the business system are broken down into the smallest executable units (atomic operations), and the smallest executable units and their relationships are abstracted into a first flowchart. This not only achieves atomic decoupling and reuse of macro functions, increasing process development efficiency, but also transforms the business logic of macro functions into an easy-to-understand graphical representation, allowing even non-professionals to directly participate in process design and modification, reducing professional barriers. Next, the first flowchart is converted into first code in a first programming language, forming a structured and executable intermediate representation layer. This not only expresses the complex logic of macro commands through concise syntax, improving the execution accuracy of macro commands, but also decouples the business logic of macro functions from the business system. This means that when the business system interface changes, only the mapping rules from the first code to the interface need to be adjusted, without modifying the flowchart or upper-level business logic, thus reducing maintenance complexity. Finally, by calling the interface of the business system based on the first code, the macro command is implemented in the business system. In this way, even if there are multiple business systems with incompatible macro command syntax, the same macro function can be implemented in different business systems simply by adapting the first code to the interface of each business system, thereby overcoming cross-platform compatibility and significantly reducing the difficulty of technology migration and the risk of business interruption. Attached Figure Description

[0008] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a schematic diagram of an example environment in which embodiments of this application can be implemented; Figure 2 A flowchart illustrating a macro function implementation method provided in an embodiment of this application; Figure 3 A schematic diagram of the structure of a macro function implementation system provided in this application embodiment; Figure 4 This is a schematic diagram of another macro function implementation system provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0009] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0010] The term "comprising" and its variations as used in this document are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the following description. The term "in response to" indicates that the performed operation depends on a condition or state. When the dependent condition or state is met, one or more operations may be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which multiple operations are performed.

[0011] It should be noted that the concepts of "first" and "second" mentioned in this document are used only to distinguish different devices, modules or units, and are not used to restrict the order of functions performed by these devices, modules or units or their interdependencies.

[0012] It should be noted that the terms "one" and "more" used in this document are illustrative rather than restrictive, and those skilled in the art should understand that, unless explicitly stated otherwise in the context, they should be understood as "one or more".

[0013] The names of messages or information exchanged between multiple devices in the embodiments of this document are for illustrative purposes only and are not intended to limit the scope of these messages or information.

[0014] Explanation of key terms: Work order system: An information system used to track, manage and execute customer service requests, commonly found in information technology (IT) operations and maintenance, customer support and other business scenarios.

[0015] Macros: A predefined set of operation instructions that automatically execute multiple consecutive operations based on a single trigger condition.

[0016] Domain-Specific Languages ​​(DSLs) are programming languages ​​specifically designed for problems in a particular domain, aiming to simplify task expression and solution construction within that domain. DSLs are mainly divided into internal DSLs and external DSLs. Internal DSLs are built on existing general-purpose programming languages ​​(such as Ruby, Java, Clojure, etc.), utilizing the syntax and features of the host language to implement domain-specific functionalities. External DSLs are independent of the host language, possessing their own syntax and parser.

[0017] DSL Engine: The DSL interpreter, which converts business rules into executable code.

[0018] No-code development: A development method that configures business logic through a graphical interface without writing code in traditional programming languages.

[0019] As mentioned earlier, the current mainstream macro functionality implementation methods have the following problems: First, there is the barrier of professional coding. The implementation of macro functions heavily relies on programming skills and requires the participation of professional developers. This necessitates a significant investment of professional development resources, making implementation difficult.

[0020] Second, it has high maintenance complexity. Hard-coded implementation leads to the coupling of macro commands with business logic. Changes in business logic require code-level modifications, which are not only time-consuming but also prone to introducing systemic risks.

[0021] Third, the cross-platform compatibility challenge. The macro command syntax of different business systems (such as Zendesk and ServiceNow) is incompatible with each other, which means that when migrating or integrating business systems, a complete syntax reconstruction is required, which significantly increases the difficulty of technology migration and the risk of business interruption.

[0022] In view of this, this application provides a macro function method. First, the macro function to be implemented in the business system is decomposed into the smallest executable unit (atomic operation), and the smallest executable unit and the relationship between them are abstracted into a first flowchart. This not only realizes the atomic decoupling and reuse of the macro function, increasing the efficiency of process development, but also transforms the business logic of the macro function into an easy-to-understand graphical expression, allowing even non-professionals to directly participate in process design and modification, reducing professional barriers. Then, the first flowchart is converted into the first code of a first programming language, forming a structured and executable intermediate representation layer. This not only expresses the complex logic of the macro command through concise syntax, improving the execution accuracy of the macro command, but also decouples the business logic of the macro function from the business system. This allows the mapping rules from the first code to the interface to be adjusted only when the business system interface changes, without modifying the flowchart or the upper-level business logic, thereby reducing maintenance complexity. Finally, the interface of the business system is called based on the first code, thus implementing the macro command in the business system. In this way, even if there are multiple business systems with incompatible macro command syntax, the same macro function can be implemented in different business systems simply by adapting the first code to the interface of each business system, thereby overcoming cross-platform compatibility and significantly reducing the difficulty of technology migration and the risk of business interruption.

[0023] The technical solutions of the various embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0024] Figure 1 A schematic diagram of an example environment in which embodiments of this application can be implemented is shown. This example environment includes a terminal device 100 and a server 200.

[0025] The terminal device 100 and the server 200 establish a communication connection, which may include, but is not limited to, at least one of the following: wired connection and wireless connection.

[0026] Terminal device 100 includes, but is not limited to, smartphones, tablets, laptops, desktop computers, smart voice interaction devices, smart home appliances, smartwatches, vehicle terminals, and aircraft. Server 200 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0027] Terminal device 100 can receive relevant parameters input by the user and send these parameters to server 200. Server 200 can obtain the processing result based on the received parameters and return the processing result to terminal device 100.

[0028] It should be understood that in some embodiments, the terminal device 100 may obtain the processing result itself based on the relevant parameters input by the user, without needing to interact with the server 200. This application embodiment does not limit this.

[0029] Based on the example environment described above, this application provides a macro function implementation method, which can be executed by an electronic device, specifically by a macro function implementation system deployed in the electronic device. Please refer to... Figure 2 The above is a flowchart illustrating a macro function implementation method provided in an embodiment of this application. The method includes the following steps: S202 breaks down the macro functions to be implemented in the business system into multiple atomic operations, and generates the first flowchart based on the multiple atomic operations.

[0030] Atomic operations can be implemented as the smallest executable unit. Atomic operations are indivisible and cannot be interrupted by any other task or event before completion. Nodes in the first flowchart represent atomic operations, and edges in the first flowchart represent relationships between different atomic operations. These relationships can include, but are not limited to, at least one of the following: execution order, conditional branches, data flow, etc. Each node has corresponding node information, which may include, but is not limited to: a unique identifier, type, configuration parameters (such as fields, operators, and values ​​in conditional expressions, field names and target values ​​in update fields, etc.), and position (such as coordinates in the canvas area). Each edge has corresponding edge information, which may include, but is not limited to: a unique identifier, the unique identifier of the source node, the unique identifier of the target node, the output handle of the source node (used to distinguish different conditional branches such as true / false in conditional judgment nodes), and the input handle of the target node, etc.

[0031] In S202 above, the macro function can be broken down into multiple atomic operations based on its business logic. For example, in a Customer Relationship Management (CRM) scenario, the business system includes a work order system. A macro function to be implemented in this system is: "When a work order priority becomes 'high,' automatically change its status to 'urgent' and notify the supervisor." Based on the business logic of this macro function, it can be broken down into the following atomic operations: Atomic operation 1: Determine if the priority of the work order is "high".

[0032] Atomic operation 2: When the priority of a work order is "high", change the status of the work order to "urgent".

[0033] Atomic operation 3: Send a notification email to the supervisor.

[0034] In S202 above, the first flowchart can be generated in various ways.

[0035] In one implementation, a corresponding node can be created for each atomic operation; based on the relationships between these atomic operations, edges are created between the nodes corresponding to these atomic operations. This yields the first flowchart.

[0036] In another implementation, the first flowchart can be generated visually. Specifically, a visual operation interface is presented, which includes a canvas area, a component library, a toolbar, etc. The component library provides multiple components used to implement different types of operations, and the toolbar provides functions such as saving, debugging, importing, and exporting. In response to a component selection operation in the component library, the selected component is added to the canvas area. In response to a component selection operation in the canvas area, the property panel of the selected component is presented, which is used to configure the component's properties (such as field mapping, delay settings, notification templates, etc.). In response to a connection operation between any two components in the canvas area, an edge is created to connect the two components. In response to a creation completion operation, the first flowchart is generated based on the components in the canvas area, the component properties, and the edges between the components.

[0037] S204, convert the first flowchart into first code based on the first programming language.

[0038] The first programming language can be any programming language that has the advantages of being concise, easy to understand, easy to write and maintain, such as DSL, and this application embodiment does not limit it. Considering that the first flowchart is not machine language, its logical relationship is not easy to read and use, while the first programming language has the advantages of being concise, easy to understand, easy to write and maintain. By converting the first flowchart into the first code of the first programming language, the logical relationship of the first flowchart can be expressed through concise syntax, thereby enabling electronic devices to better understand and use it.

[0039] In a preferred embodiment, the first programming language can be a DSL. A DSL is a system-independent programming language that can be precisely parsed. First code based on a DSL helps to more accurately implement macro functions in the business system.

[0040] In S204 above, the first flowchart can be converted into code based on the first code in various ways.

[0041] In one implementation, a large model with information understanding and processing capabilities (such as a large language model, a multimodal large model, etc.) can be used to convert the first flowchart into the first code.

[0042] In another implementation, a deep transformation method specifically designed for business systems is used to improve transformation accuracy and ensure that the first code accurately describes the atomic operations and relationships in the first flowchart. Specifically, S204 may further include: S2042 generates statements to describe nodes based on the syntax of the first programming language, the type of the node, and the configuration data of the node.

[0043] Specifically, in response to the node type being a conditional node, the node's configuration data is mapped to first key-value pairs based on the syntax of the first programming language. At least one empty first array is then added after each first key-value pair to obtain a statement describing the node. The first array contains corresponding conditional branches and is used to describe the node's child nodes under those conditional branches.

[0044] A conditional node can be understood as a node representing an atomic operation that is a conditional operation, such as the node representing atomic operation 1 in the above text. For mapping configuration data, the field names in the configuration data can be mapped to keys, and the field values ​​can be mapped to values, thus obtaining the first key-value pair.

[0045] For example, assuming the first programming language is DSL, and the node representing atomic operation 1 above is a conditional node, the following statement 1 describing this node can be obtained based on the above method: { "type": "condition", "field": "priority", "operator": "equals", "value": "high", "onTrue": [], "onFalse": []} In the above statement, "onTrue": [] and "onFalse": [] are both empty first arrays. "onTrue": [] corresponds to the conditional branch "high priority", and "onFalse": [] corresponds to the conditional branch "not high priority".

[0046] In response to a node being a non-conditional node, the node's configuration data is mapped to second key-value pairs based on the syntax of the first programming language. An empty second array is then appended to these second key-value pairs to obtain statements describing the node. The second array is used to describe the node's child nodes.

[0047] For example, a non-conditional judgment node can be understood as a node representing an atomic operation that does not belong to a conditional judgment operation, such as the node representing atomic operation 2 in the above text. For mapping configuration data, the field names in the configuration data can be mapped to keys, and the field values ​​can be mapped to values, thus obtaining the second key-value pair.

[0048] For example, assuming the first programming language is DSL, and the node representing atomic operation 2 above is a non-conditional judgment node, the following statement 2 describing this node can be obtained based on the above method: { "type": "update_field", "field": "status", "value": "resolved" "next": []} In this statement, "next": [] represents an empty second array.

[0049] For example, if the node representing atomic operation 3 above is a non-conditional judgment node, then based on the above method, we can obtain the following statement 3 to describe this node: { "type": "delay", "unit": "hours", "value": 24 "next": []} In this statement, "next": [] represents an empty second array.

[0050] S2044, the first code is obtained by assembling the statements used to describe the nodes based on the edge pairs between the nodes.

[0051] Specifically, based on the relationship represented by the edges between nodes, the statements used to describe the source node of the edge and the statements used to describe the target node of the edge can be assembled.

[0052] In some examples, for each edge in the first flowchart, the first statement and the second statement corresponding to that edge are obtained, where the first statement is the statement describing the source node of the edge, and the second statement is the statement describing the target node of the edge; in response to the source node being a conditional node, the second statement is inserted into the first statement as the first value corresponding to the first conditional branch, where the first conditional branch refers to the conditional branch represented by the edge, to obtain the first code; in response to the source node being a non-conditional node, the second statement is inserted into the second array of the first statement to obtain the first code. For example, suppose the source node of an edge is the node of atomic operation 1 mentioned above, and this node is a conditional node, described by statement 1 above; the conditional branch represented by this edge is "high priority", and the target node is the node of atomic operation 2 mentioned above, described by statement 2 above. Therefore, statement 2 is inserted into the first array of statement 1, ""onTrue": []". In this way, the two independent statements are assembled into a whole according to the relationship between the nodes, as follows: { "type": "condition", "field": "priority", "operator": "equals", "value": "high", "onTrue": [ { "type": "update_field", "field": "status", "value": "resolved" "next": [] }], "onFalse": []} For example, suppose the source node of an edge is the node of atomic operation 2 above, and the type of this node is a non-conditional judgment node, and the statement used to describe this node is statement 2 above; the target node of this edge is the node of atomic operation 3 above, and the statement used to describe this node is statement 3 above. Therefore, statement 3 is inserted into the second array ""next": []" of statement 2. In this way, the two independent statements are assembled into a whole according to the relationship between the nodes, as follows: { "type": "update_field", "field": "status", "value": "resolved" "next": [ { "type": "delay", "unit": "hours", "value": 24 "next": []} ]} In this way, discrete statements are assembled into a complete tree or list structure with a correct logical order. This method is suitable for handling various complex flowcharts, including nested conditions (where one conditional node can contain another conditional node), loops, etc., ultimately generating a complete, visually and machine-executable first code.

[0053] In practical applications, we can start from the root node of the first flowchart and use either a depth-first search (DFS) or breadth-first search (BFS) algorithm to traverse the first flowchart. Based on the relationships represented by the edges, we can process each node in sequence until we reach the end node of the first flowchart.

[0054] The foregoing illustrates a partial implementation of S204. It should be understood that S204 can also be implemented in other ways, and this application embodiment does not limit this.

[0055] S206, calls the business system's interface based on the first code.

[0056] In one implementation, considering that the programming language used by the business system may differ from the first programming language, in order to more accurately implement macro functions in the business system, the above-mentioned S206 may include the following steps: S2062, based on the first mapping relationship between the first programming language and the second programming language used by the business system, convert the first code into second code based on the second programming language.

[0057] The first mapping relationship can include field mapping relationships. In this case, fields in the first code can be mapped to fields in the second programming language. For example, if the business system is a Zendesk system, the field name "status" in the first code can be mapped to the field name "status" in the Zendesk system, and the field value "escalated" corresponding to that field name in the first code can be mapped to the field value "pending" in the Zendesk system, and so on.

[0058] Furthermore, the mapped field names and their corresponding field values ​​are reconstructed according to the syntax of the second programming language to obtain the second code. For example, if the first code is a tree-like or list-like DSL structure, after mapping the field names and field values ​​to the second programming language, it is reconstructed according to the syntax of the second programming language into a flat array, a JSON structure, or a piece of JavaScript code.

[0059] S2064, based on the business data in the business system, parse the second code to obtain the sequence of processing operations to be executed by the business system.

[0060] The processing operation sequence represents at least one processing operation to be executed by the business system and the execution order of these processing operations.

[0061] The second code describes the nodes and relationships between them in the first flowchart using the syntax of a second programming language. Therefore, the nodes in the first flowchart that are hit by the business data and the relationships between these nodes can be determined. Based on these hit nodes and their relationships, the sequence of processing operations to be executed by the business system can be obtained.

[0062] Specifically, the second code can be deserialized to obtain an Abstract Syntax Tree (AST); the business data in the business system can be matched with the AST, and the sequence of processing operations to be executed by the business system can be determined based on the matching results.

[0063] An abstract syntax tree (AST) is a traversable and evaluable program structure whose structure is completely consistent with the nested structure of secondary code. For example, a condition node contains subtrees with two branch conditions: onTrue and onFalse. This makes subsequent traversal and lookup highly efficient, enabling the rapid and accurate determination of the sequence of business operations to be executed by the business system.

[0064] In some examples, the logical operators and business logic defined in the second code can be followed, starting from the root node of the abstract syntax tree, and using a depth-first traversal approach to determine the next path based on the type and business data of each node in the abstract syntax tree.

[0065] For example, for conditional decision nodes, the `field`, `operator` (such as `equals`, `greater_than`), and `value` are read from the node, and the actual value of the corresponding field is obtained from the business data. A comparison operation is performed based on the `operator`, and the result is used to enter the corresponding conditional branch, continuing to traverse the subtree under that conditional branch. For non-conditional decision nodes, no "matching" is required; it represents a pending processing operation, which is then added to the execution queue, but not yet executed. The execution of all processing operations is concentrated after the traversal is complete to ensure the atomicity and consistency of the logic.

[0066] By traversing the entire abstract syntax tree, a sequence of processing operations is ultimately obtained. This sequence is the unique path derived by all conditional decision nodes after matching the current business data.

[0067] S2066, call the interface of the business system to execute each processing operation in the processing operation sequence in sequence.

[0068] Specifically, for each processing operation in the processing operation sequence, a first interface for executing the processing operation is determined based on the second mapping relationship between the operation type and the interface in the business system; based on the operation information of the processing operation, a call request for the first interface is generated, and the call request is sent to the business system.

[0069] The second mapping relationship can be pre-configured and stored in the electronic device according to actual needs, specifically in the macro executor of the electronic device. The second mapping relationship maps general operation types to interfaces specific to business systems.

[0070] For each processing operation in the processing operation sequence, after determining the first interface for executing the processing operation, the request body required by the first interface can be assembled based on the operation information of the processing operation (such as fields, values, etc. in the operation information) and the identification information of the business data. Furthermore, by sending a request (such as a PUT or POST request) to the first interface of the business system through an HTTP client (such as a RESTful Client), the first interface can be invoked to execute the processing operation through the first interface.

[0071] To facilitate understanding, specific examples will be used below.

[0072] Suppose there is a second piece of code whose goal is to "update the status of a work order to 'urgent' and send an email if the work order has a high priority; otherwise, only conditional a comment." Currently, a work order (ID: 123) with a "high" priority has triggered this macro.

[0073] The macro executor of the electronic device first parses the second code into an AST. The root node of the AST is a conditional judgment node with two conditional branches. Next, the macro executor reads the data of the work order (ID: 123), obtains the value of its priority field as "high", and then executes the conditional judgment "high equals "high". Since the judgment result is true, it enters the onTrue branch and adds the two action nodes (update_field and send_email) under this branch to the pending execution queue, while ignoring the onFalse branch. Thus, the sequence of processing operations to be processed by the business system is obtained.

[0074] The macro executor traverses the sequence of processing operations. When it reaches the processing operation `update_field`, it identifies the type as "update_field" and finds the first interface of the business system in the second mapping as `[PATCH / api / v2 / tickets / {ticket_id}.json]`. Further, it assembles the request body based on the node parameters: `{ "ticket": { "status": "urgent"}}`, and sends a PATCH request to `https: / / our_company.zendesk.com / api / v2 / tickets / 123.json`.

[0075] The macro executor iterates through the `send_email` operation and finds the first interface of the business system in the second mapping as `[POST / api / send_email]`. Further, it assembles the request body according to the node parameters: `{ "to": "manager@example.com", "subject": "Ticket escalated", "body": "Ticket 123 is marked asurgent."}`, and sends a POST request to this first interface.

[0076] In another implementation, if the business system uses the first programming language, the first code can be directly parsed based on the business data in the business system to obtain the sequence of processing operations to be executed by the business system; and the interface of the business system is called to execute each processing operation in the sequence of processing operations in turn.

[0077] The foregoing illustrates a partial implementation of S206. It should be understood that S206 can also be implemented in other ways, and this application embodiment does not limit this.

[0078] The macro function implementation method provided in this application first decomposes the macro function to be implemented in the business system into the smallest executable unit (atomic operation), and abstracts the smallest executable unit and the relationship between them into a first flowchart. This not only achieves atomic decoupling and reuse of the macro function, increasing process development efficiency, but also transforms the business logic of the macro function into an easy-to-understand graphical representation, allowing even non-professionals to directly participate in process design and modification, reducing professional barriers. Then, the first flowchart is converted into first code in a first programming language, forming a structured and executable intermediate representation layer. This not only expresses the complex logic of macro commands through concise syntax, improving the execution accuracy of macro commands, but also decouples the business logic of the macro function from the business system. This allows changes to the business system interface to be made only by adjusting the mapping rules from the first code to the interface, without modifying the flowchart or upper-level business logic, thereby reducing maintenance complexity. Finally, the macro command is implemented in the business system by calling the interface based on the first code. In this way, even if there are multiple business systems with incompatible macro command syntax, the same macro function can be implemented in different business systems simply by adapting the first code to the interface of each business system, thereby overcoming cross-platform compatibility and significantly reducing the difficulty of technology migration and the risk of business interruption.

[0079] Based on the same inventive concept, embodiments of this application also provide a macro function implementation system. Please refer to... Figure 3 The image below is a schematic diagram of a macro function implementation system 300 provided in an embodiment of this application. The system 300 includes: The orchestrator 310 is used to decompose the macro functions to be implemented in the business system into multiple atomic operations, and to generate a first flowchart based on the multiple atomic operations; the nodes in the first flowchart represent the atomic operations, and the edges in the first flowchart represent the relationships between different atomic operations.

[0080] The conversion engine 320 is used to convert the first flowchart into first code based on the first programming language.

[0081] The macro executor 330 is used to call the interface of the business system based on the first code.

[0082] The orchestrator 310 provides visual orchestration functionality. Specifically, the orchestrator 310 presents a visual operation interface, which includes a canvas area, a component library, and a toolbar. The component library provides multiple components used to implement different types of operations, and the toolbar provides functions such as saving, debugging, importing, and exporting. In response to the user's selection of a component from the component library, the selected component is added to the canvas area. In response to the user's selection of a component from the canvas area, the property panel of the selected component is presented, which is used to configure the component's properties (such as field mapping, delay settings, notification templates, etc.). In response to the user's connection operation between any two components in the canvas area, an edge is created to connect the two components. In response to the user's input indicating completion, a first flowchart is generated based on the components in the canvas area, the component properties, and the edges between the components.

[0083] In other embodiments, such as Figure 4 As shown, the macro function implementation system 300 may also include an interface layer 340.

[0084] The macro executor 330 is used to convert the first code into second code based on the second programming language based on the first mapping relationship between the first programming language and the second programming language used by the business system, and to parse the second code based on the business data in the business system to obtain the processing operation sequence to be executed by the business system.

[0085] The interface layer 340 is used to call the interface of the business system to execute each processing operation in the processing operation sequence in sequence.

[0086] Obviously, the macro function implementation system provided in the embodiments of this application can be used as the above-mentioned... Figure 2 The execution body of the macro function implementation method shown can therefore realize the macro function implementation device in Figure 2 The functions implemented are the same, so they will not be described in detail here.

[0087] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0088] Based on the same inventive concept, embodiments of this application also provide an electronic device in which the macro function implementation system provided in embodiments of this application can be deployed. Please refer to... Figure 5This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, at the hardware level, this electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or it may include non-volatile memory, such as at least one disk drive. Of course, this electronic device may also include other hardware required for other business operations.

[0089] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0090] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0091] The processor reads the corresponding computer program from non-volatile memory into main memory and then executes it, forming a macro-functional implementation system at the logical level. The processor executes the program stored in memory and specifically performs the following operations: An orchestrator is used to decompose macro functions to be implemented in a business system into multiple atomic operations, and to generate a first flowchart based on the multiple atomic operations; the nodes in the first flowchart represent the atomic operations, and the edges in the first flowchart represent the relationships between different atomic operations. A conversion engine is used to convert the first flowchart into first code based on a first programming language; A macro executor is used to call the interface of the business system based on the first code.

[0092] The above is as stated in this application. Figure 2The macro function implementation system execution method disclosed in the illustrated embodiments can be applied to a processor, or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0093] This electronic device can also execute methods for implementing macro functions and implement macro function implementation systems in... Figure 2 The functions of the embodiments shown are not described in detail here.

[0094] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0095] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform... Figure 2 The method of the illustrated embodiment is specifically used to perform the following operations: The macro functions to be implemented in the business system are decomposed into multiple atomic operations, and a first flowchart is generated based on the multiple atomic operations; the nodes in the first flowchart represent the atomic operations, and the edges in the first flowchart represent the relationships between different atomic operations. Convert the first flowchart into first code based on the first programming language; The interface of the business system is called based on the first code.

[0096] In summary, the above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

[0097] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0098] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0099] It should also be noted that 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. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0100] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

Claims

1. A method for implementing macro functions, characterized in that, include: The macro functions to be implemented in the business system are decomposed into multiple atomic operations, and a first flowchart is generated based on the multiple atomic operations; The nodes in the first flowchart represent the atomic operations, and the edges in the first flowchart represent the relationships between different atomic operations. Convert the first flowchart into first code based on the first programming language; The interface of the business system is called based on the first code.

2. The method according to claim 1, characterized in that, The step of converting the first flowchart into first code based on a first programming language includes: Based on the syntax of the first programming language, the type of the node, and the configuration data of the node, a statement is generated to describe the node; The statement is assembled based on the edges between the nodes to obtain the first code.

3. The method according to claim 2, characterized in that, The step of generating statements to describe the node based on the syntax of the first programming language, the type of the node, and the configuration data of the node includes: In response to the node being a conditional node, the configuration data of the node is mapped to a first key-value pair based on the syntax, and at least one empty first array is added after the first key-value pair to obtain a statement describing the node; wherein, the first array has a corresponding conditional branch, and the first array is used to describe the child nodes of the node under the conditional branch; In response to the node being a non-conditional node, the configuration data of the node is mapped to a second key-value pair based on the syntax, and an empty second array is added after the second key-value pair to obtain a statement describing the node; wherein, the second array is used to describe the child nodes of the node.

4. The method according to claim 3, characterized in that, The assembly of the statements based on the edges between the nodes to obtain the first code includes: For each edge in the first flowchart, obtain the first statement and the second statement corresponding to the edge; the first statement is a statement used to describe the source node of the edge, and the second statement is a statement used to describe the target node of the edge. In response to the source node being of the type of the condition judgment node, the second statement is inserted into the first array corresponding to the first condition branch in the first statement; the first condition branch refers to the condition branch represented by the edge, to obtain the first code; In response to the source node being of the type of the non-conditional judgment node, the second statement is inserted into the second array of the first statement to obtain the first code.

5. The method according to claim 1, characterized in that, The step of calling the interface of the business system based on the first code includes: Based on the first mapping relationship between the first programming language and the second programming language used by the business system, the first code is converted into second code based on the second programming language; The second code is parsed based on the business data in the business system to obtain the sequence of processing operations to be executed by the business system; The interface of the business system is invoked to execute each processing operation in the processing operation sequence in sequence.

6. The method according to claim 5, characterized in that, The second code is parsed based on business data from the business system to obtain a sequence of processing operations to be executed by the business system, including: The second code is deserialized to obtain an abstract syntax tree; The business data in the business system is matched with the abstract syntax tree, and the sequence of processing operations to be executed in the business system is determined based on the matching results.

7. The method according to claim 5, characterized in that, The interface that calls the business system sequentially executes each processing operation in the processing operation sequence, including: For each processing operation in the processing operation sequence, a first interface for executing the processing operation is determined based on the second mapping relationship between the operation type and the interface in the business system; Based on the operation information of the processing operation, a call request for the first interface is generated, and the call request is sent to the business system.

8. A macro function implementation system, characterized in that, include: An orchestrator is used to decompose the macro functions to be implemented in the business system into multiple atomic operations, and to generate a first flowchart based on the multiple atomic operations; The nodes in the first flowchart represent the atomic operations, and the edges in the first flowchart represent the relationships between different atomic operations. A conversion engine is used to convert the first flowchart into first code based on a first programming language; A macro executor is used to call the interface of the business system based on the first code.

9. The system according to claim 8, characterized in that, The system also includes an interface layer; The macro executor is used to convert the first code into second code based on the second programming language based on the first mapping relationship between the first programming language and the second programming language used by the business system, and to parse the second code based on the business data in the business system to obtain the processing operation sequence to be executed by the business system; The interface layer is used to call the interface of the business system to execute each processing operation in the processing operation sequence in sequence.

10. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the macro function implementation method as described in any one of claims 1 to 7.