System and method for generating execution language based on point-line structure
Through systems and methods based on dot-line structures, users can intuitively create and connect nodes to generate execution language construction objects, solving the problems of complexity and inefficiency of traditional methods, and achieving efficient and flexible execution language generation.
Patent Information
- Application Number
- CN202411579636.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-03-14
AI Technical Summary
The traditional execution language generation method is complex, requiring developers to have a deep understanding of syntax details and write a large amount of code, which leads to unintuitive user operations and low development efficiency.
The system and method based on the dot-line structure is adopted to extend the manager, user interaction interface and execution language generation engine through component extension, which supports users to create directed lines and nodes, drag and connect nodes to generate execution language construction objects, and automatically generate code that complies with execution language rules.
Improve development efficiency, allowing users to build complex execution languages without deep understanding of execution language grammar rules, reduce learning costs, and enhance system flexibility and adaptability.
Smart Images

Figure CN119621032A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software development, and in particular to a system and method for generating an execution language based on a point-line structure. Background Art
[0002] In the field of software development and process orchestration, execution language (EL) is the core element for implementing execution control logic and process control. However, traditional EL generation methods have a series of challenges, the most notable of which are complex grammatical rules and cumbersome code writing, which severely limit users' intuitive operations and development efficiency.
[0003] Traditional EL generation methods usually require developers to deeply understand the syntax details and write a lot of code, which becomes particularly difficult when dealing with complex logic and processes. In addition, due to the complex syntax rules, error troubleshooting and repair also become time-consuming and labor-intensive.
[0004] How to generate execution language intuitively and flexibly to meet ever-changing business needs and improve development efficiency is a technical problem that needs to be solved. Summary of the invention
[0005] The technical task of the present invention is to address the above shortcomings and provide a system and method for generating an execution language based on a point-line structure to solve the technical problem of how to generate an execution language intuitively and flexibly to meet ever-changing business needs and improve development efficiency.
[0006] In a first aspect, the present invention provides a system for generating an execution language based on a point-line structure, including a component extension manager, a user interaction interface, and an execution language generation engine;
[0007] The component extension manager interacts with the user through the component extension management interface to support the user to create a directed line, the directed line is configured with a start point and an end point, and is used to support the user to define various types of operation units as nodes and configure the business logic and business data of the operation units;
[0008] The user interaction interface is used to display directed lines and nodes as components, and is used to support users to use nodes and directed lines between nodes as construction objects of the execution language, and to perform graphical drawing and adjustment of the execution language construction objects by graphical interface operations such as dragging nodes and connecting nodes through directed lines;
[0009] The execution language generation engine is used to monitor the user's graphical interface operations on the user interaction interface, and build objects based on the graphical interface operations and the drawn execution language, generate code that conforms to the execution language rules, and return the code to the user interaction interface; correspondingly, the user interaction interface is used to display the code and support users to view and edit the code.
[0010] Preferably, the component extension manager is used to support users in performing version updates on created nodes.
[0011] Preferably, the user interaction interface provides a graphical interface based on React or Vue, and provides graphical interface operation services based on HTML5Canvas or SVG, and the graphical interface operation services include dragging directed lines and nodes and connecting nodes through directed lines.
[0012] Preferably, the execution language generation engine is used to perform the following operations:
[0013] For the execution language construction object drawn by the user, obtain the business logic and business data of each node, and obtain the starting point and end point of each directed line;
[0014] Using the starting point and end point of the directed line between nodes as edge information, update and record the direct subordinate nodes of the node, and update and record the in-degree and out-degree of the node. The in-degree represents the number of directed lines connected to the node whose starting point is the node, and the out-degree represents the number of directed lines connected to the node whose end point is the node;
[0015] Determine the position of the node according to the node and the in-degree and out-degree, where the node with in-degree 0 is used as the starting node and the node with out-degree 0 is used as the ending node;
[0016] Traverse all nodes. During the traversal process, nodes with an out-degree greater than 1 are nodes with branches. For nodes with branches, deeply traverse the branches of the node according to the logical relationship between the nodes. When traversing the branches, push the branches into the stack from the starting point in sequence, and record the end node of the deep traversal. When the number of end nodes is equal to the out-degree of the branch starting point, the traversal of all branches ends. If the branch contains sub-branches, deeply traverse the sub-branches. In the process of traversing the branches, generate corresponding relationship nodes according to the type and logical relationship of the nodes. The relationship nodes include calling functions, setting variables, executing conditional judgments and loops, and use the stack to assist in processing branches. When encountering a node with an out-degree of 0, that is, the end of the branch, pop the nodes out of the stack in sequence and process the previously stacked nodes;
[0017] For each branch, all nodes are maintained as a hierarchical node, and are converted into codes of the corresponding execution language according to the node type and business data. During the code generation process, the code is checked for errors in real time. If syntax errors, logic errors or inconsistencies occur, prompts and repair suggestions are sent to the user.
[0018] After all branches are processed, a complete execution language code is generated, and the codes corresponding to each branch are organized according to the logical order drawn by the user in the user interaction interface to form an executable program or script, and the program or script is returned to the user interaction interface.
[0019] In a second aspect, the present invention provides a method for generating an execution language based on a dot-line structure, which is used to generate an execution language by using a system for generating an execution language based on a dot-line structure as described in any one of the first aspects, and the method comprises the following steps:
[0020] Point-line structure management: create a directed line through the component extension manager, the directed line is configured with a start point and an end point, customize various types of operation units as nodes, and configure the business logic and business data of the operation unit through the component extension manager;
[0021] Execution language drawing: taking nodes and directed lines between nodes as construction objects of the execution language, and performing graphical drawing and adjustment of execution language construction objects by dragging nodes and connecting nodes through directed lines in the user interaction interface;
[0022] Execution language generation: The execution language generation engine monitors the user's graphical interface operations on the user interaction interface, builds objects based on the graphical interface operations and the drawn execution language, generates code that conforms to the execution language rules through the execution language generation engine, and returns the code to the user interaction interface; correspondingly, the code is displayed through the user interaction interface and the code is viewed and edited.
[0023] Preferably, the point-line structure management further includes performing version updates on the created nodes through a component extension manager.
[0024] Preferably, the user interaction interface provides a graphical interface based on React or Vue, and provides graphical interface operation services based on HTML5 Canvas or SVG, wherein the graphical interface operation services include dragging directed lines and nodes and connecting nodes through directed lines.
[0025] Preferably, executing language generation comprises the following steps:
[0026] For the execution language construction object drawn by the user, obtain the business logic and business data of each node, and obtain the starting point and end point of each directed line;
[0027] Using the starting point and end point of the directed line between nodes as edge information, update and record the direct subordinate nodes of the node, and update and record the in-degree and out-degree of the node. The in-degree represents the number of directed lines connected to the node whose starting point is the node, and the out-degree represents the number of directed lines connected to the node whose end point is the node;
[0028] Determine the position of the node according to the node and the in-degree and out-degree, where the node with in-degree 0 is used as the starting node and the node with out-degree 0 is used as the ending node;
[0029] Traverse all nodes. During the traversal process, nodes with an out-degree greater than 1 are nodes with branches. For nodes with branches, deeply traverse the branches of the node according to the logical relationship between the nodes. When traversing the branches, push the branches into the stack from the starting point in sequence, and record the end node of the deep traversal. When the number of end nodes is equal to the out-degree of the branch starting point, the traversal of all branches ends. If the branch contains sub-branches, deeply traverse the sub-branches. In the process of traversing the branches, generate corresponding relationship nodes according to the type and logical relationship of the nodes. The relationship nodes include calling functions, setting variables, executing conditional judgments and loops, and use the stack to assist in processing branches. When encountering a node with an out-degree of 0, that is, the end of the branch, pop the nodes out of the stack in sequence and process the previously stacked nodes;
[0030] For each branch, all nodes are maintained as a hierarchical node, and are converted into codes of the corresponding execution language according to the node type and business data. During the code generation process, the code is checked for errors in real time. If syntax errors, logic errors or inconsistencies occur, prompts and repair suggestions are sent to the user.
[0031] After all branches are processed, a complete execution language code is generated, and the codes corresponding to each branch are organized according to the logical order drawn by the user in the user interaction interface to form an executable program or script, and the program or script is returned to the user interaction interface.
[0032] The system and method for generating execution language based on point-line structure of the present invention have the following advantages:
[0033] 1. Improve development efficiency: Users can drag and drop the created components through the graphical interface to draw the execution language parsing object, and automatically generate the execution language code based on the user's graphical operation and the drawn execution language parsing object, which improves the efficiency of software development and process orchestration;
[0034] 2. Reduce learning costs: Users do not need to have an in-depth understanding of the grammatical rules of the execution language. They can complete the construction of complex execution languages through a graphical interface, which reduces the threshold for learning and use;
[0035] 3. Flexible adaptation to needs: The component extension manager allows users to customize operation units and logical relationships according to actual needs, making the system more flexible. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] The present invention is further described below in conjunction with the accompanying drawings.
[0038] Figure 1 This is a flowchart of a system for generating an execution language based on a dot-line structure according to Embodiment 1;
[0039] Figure 2 This is a schematic diagram of the working interface of a system for generating an execution language based on a point-line structure in Example 1. DETAILED DESCRIPTION
[0040] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments may be combined with each other.
[0041] The embodiments of the present invention provide a system and method for generating an execution language based on a point-line structure, which are used to solve the technical problem of how to generate an execution language intuitively and flexibly to meet ever-changing business needs and improve development efficiency.
[0042] Embodiment 1:
[0043] The present invention discloses a system for generating an execution language based on a point-line structure, comprising a component extension manager, a user interaction interface and an execution language generation engine.
[0044] The component extension manager interacts with the user through the component extension management interface to support the user in creating directed lines, which are configured with a start point and an end point, to support the user in defining various types of operation units as nodes, and to configure the business logic and business data of the operation units.
[0045] In this embodiment, the user parses the execution language according to the service of the conventional execution language, and can construct the operation unit into a node according to the parsed operation unit, and configure the business logic and business data of the operation unit, wherein the business logic between the operation units, that is, the business relationship, includes loops, conditions, sorting, and inclusion, etc. At the same time, the component extension manager in this embodiment supports the user to update the version of the created node.
[0046] The component extension manager of this embodiment allows users to customize operation units and logical relationships between operation units. The execution unit is displayed in the form of a component in the user interaction interface. Users can select appropriate components according to their needs, customize operation units and logical relationships, and the component supports version upgrades to ensure that the component can work normally when the system is updated.
[0047] The user interaction interface is used to display directed lines and nodes as components, and to support users to use nodes and directed lines between nodes as construction objects of the execution language, and to perform graphical drawing and adjustment of execution language construction objects by graphical interface operations such as dragging nodes and connecting nodes through directed lines.
[0048] In this embodiment, the user interaction interface provides a graphical interface based on React or Vue, and provides a graphical interface operation service based on HTML5 Canvas or SVG. The graphical interface operation service includes dragging directed lines and nodes and connecting nodes through directed lines.
[0049] The system of this embodiment provides an intuitive graphical interface through a user interaction interface. The user completes the construction and adjustment of the execution language through visual operations. There is no need to have an in-depth understanding of complex grammatical rules. The user only needs to depict the order of execution through nodes and arrows. It is simple and easy to learn.
[0050] The execution language generation engine is used to monitor the user's graphical interface operations on the user interaction interface, and build objects based on the graphical interface operations and the drawn execution language, generate code that conforms to the execution language rules, and return the code to the user interaction interface; correspondingly, the user interaction interface is used to display the code and support users to view and edit the code.
[0051] In this embodiment, the execution language generation engine is responsible for mapping the operations on the user interaction interface into the execution language code. As a specific implementation, the execution language generation engine performs the following operations:
[0052] (1) For the execution language construction object drawn by the user, obtain the business logic and business data of each node, and obtain the starting point and end point of each directed line;
[0053] (2) Using the starting point and end point of the directed line between nodes as edge information, update and record the direct subordinate nodes of the node, and update and record the in-degree and out-degree of the node. The in-degree represents the number of directed lines connected to the node whose starting point is the node, and the out-degree represents the number of directed lines connected to the node whose end point is the node;
[0054] (3) Determine the position of the node based on the node and the in-degree and out-degree, where the node with in-degree 0 is used as the starting node and the node with out-degree 0 is used as the ending node;
[0055] (4) Traverse all nodes. During the traversal process, nodes with an out-degree greater than 1 are nodes with branches. For nodes with branches, deeply traverse the branches of the node according to the logical relationship between the nodes. When traversing the branches, push the branches into the stack from the starting point in sequence, and record the end node of the deep traversal. When the number of end nodes is equal to the out-degree of the branch starting point, the traversal of all branches ends. If the branch contains sub-branches, deeply traverse the sub-branches. In the process of traversing the branches, corresponding relationship nodes are generated according to the type and logical relationship of the nodes. The relationship nodes include calling functions, setting variables, executing conditional judgments, and loops. The stack is used to assist in processing branches. When a node with an out-degree of 0, i.e., the end point of the branch, the nodes are popped out of the stack in sequence, and the previously stacked nodes are processed;
[0056] (5) For each branch, all nodes are maintained as a hierarchical node, and are converted into codes of the corresponding execution language according to the node type and business data. During the code generation process, real-time error detection is performed on the code. If syntax errors, logical errors or inconsistencies occur, prompts and repair suggestions are sent to the user;
[0057] (6) After all branches are processed, a complete execution language code is generated, and the codes corresponding to each branch are organized according to the logical order drawn by the user in the user interaction interface to form an executable program or script, and the program or script is returned to the user interaction interface.
[0058] In this implementation, the work of the execution language generation engine includes parsing graphic operations and generating code. During the code generation process, the execution language generation engine will go through a series of carefully designed steps to ensure that the generated code not only conforms to the grammatical rules of EL, but also accurately reflects the logic and operations constructed by the user in the graphical interface, including data structure analysis, determination of starting and end points, traversal and branch processing, code generation and stack operations, error detection and processing, completion and output.
[0059] Data structure analysis: The execution language generation engine will deeply analyze the internal data structures. These data structures contain the operation units defined by the user in the graphical interface and the logical relationships between them (such as sequence, condition, loop, containment, etc.). The execution language generation engine traverses the above data structures and extracts all necessary information to prepare for subsequent code generation; and by parsing the edge information, it updates and records the direct subordinate nodes of the node, and updates and records the in-degree of the node.
[0060] Determine the starting point and end point: In the execution language, the execution of the code usually starts from a clear starting point and ends at one or more end points. The execution language generation engine parses the edge information, updates the node's direct subordinate nodes, and updates the node's in-degree. Then, the node's position is determined based on the node's in-degree and out-degree. The starting node and the end node are defined first, and the nodes with an in-degree of 0 are stored in the starting node because they have no other preconditions or dependencies; and the nodes with an out-degree of 0 are placed in the defined end point because they no longer have any other subsequent nodes.
[0061] Traversal and branch processing: The execution language generation engine starts from each starting point and traverses the entire process in the logical order defined by the user in the graphical interface. During the traversal process, nodes with an out-degree greater than 1 are nodes with branches. For nodes with branches, the execution language generation engine deeply traverses their branches according to the node relationship. When traversing each branch, the execution language generation engine pushes the branches into the stack from the starting point in sequence and records the end point of the deep traversal. When the number of end points is equal to the out-degree of the branch starting point, the traversal of all branches ends. If a branch contains a branch, it is recursively processed according to the above method.
[0062] Code generation and stack operations: In the process of traversing branches, the execution language generation engine generates corresponding relationship nodes according to the node types and logical relationships, including calling functions, setting variables, executing conditional judgments, loops, etc. At the same time, the execution language generation engine uses the stack to assist in processing branches; when encountering a node with an out-degree of 0 (i.e., the end point of the branch), the execution language generation engine begins to pop the stack in sequence and process the previously pushed nodes. In this way, the execution language generation engine can ensure that the order of code generation is correct and that each branch is properly processed. Ultimately, all nodes are maintained as a hierarchical node, and then converted into corresponding EL statements according to the node type and necessary business data.
[0063] Error detection and handling: During the code generation process, the execution language generation engine performs real-time error detection. If any syntax errors, logical errors or inconsistencies are found, the execution language generation engine will immediately prompt the user and provide corresponding repair suggestions, which will help users correct errors in time and improve the quality and stability of the code.
[0064] Completion and output: When all branches are processed and there are no errors, the execution language generation engine will generate complete execution language code. The above execution language code will be organized according to the logical order defined by the user in the graphical interface to form an executable program or script. The user can directly use the generated execution language code for subsequent use or development work.
[0065] Through the above steps and strategies, the execution language generation engine can automatically generate code that conforms to the grammatical rules of the execution language, providing users with an efficient, convenient and reliable programming experience. It not only reduces the complexity and workload of manual code writing, but also improves the quality and maintainability of the code.
[0066] The system workflow of this embodiment is as follows: Figure 1 As shown, for the target execution language, a new service orchestration is created. For related components not displayed on the user interaction interface, the component extension manager can be used to customize the related execution units as nodes, and the business logic and business data of the execution units can be configured; then, sequential drawing is performed through the user interaction interface. During the drawing process, related components are selected in the user interaction interface, nodes are arranged by dragging and dropping, and the nodes are connected by directed lines; finally, the execution language generation engine reads the user's graphic operations on the user interaction interface to generate the execution language code.
[0067] User interface such as Figure 2 As shown, directed lines and execution units are displayed in the form of components, and users are supported to perform graphical operations on components, such as dragging connections.
[0068] Embodiment 2:
[0069] The present invention provides a method for generating an execution language based on a point-line structure, generating execution language code through the system disclosed in Example 1, including three steps of point-line structure management, execution language drawing and execution language generation.
[0070] Point-line structure management: Create a directed line through the component extension manager, the directed line is configured with a start point and an end point, customize various types of operation units as nodes, and configure the business logic and business data of the operation unit through the component extension manager.
[0071] In this embodiment, the user parses the execution language according to the service of the conventional execution language, and can construct the operation unit into a node according to the parsed operation unit, and configure the business logic and business data of the operation unit, wherein the business logic between the operation units, that is, the business relationship, includes loops, conditions, sorting, and inclusion, etc. At the same time, the component extension manager in this embodiment supports the user to update the version of the created node.
[0072] The component extension manager of this embodiment allows users to customize operation units and logical relationships between operation units. The execution unit is displayed in the form of a component in the user interaction interface. Users can select appropriate components according to their needs, customize operation units and logical relationships, and the component supports version upgrades to ensure that the component can work normally when the system is updated.
[0073] Execution language drawing: taking nodes and directed lines between nodes as construction objects of the execution language, and performing graphical drawing and adjustment of execution language construction objects by dragging nodes and connecting nodes through directed lines in the user interaction interface.
[0074] In this embodiment, the user interaction interface provides a graphical interface based on React or Vue, and provides a graphical interface operation service based on HTML5 Canvas or SVG. The graphical interface operation service includes dragging directed lines and nodes and connecting nodes through directed lines.
[0075] In this embodiment, an intuitive graphical interface is provided through a user interaction interface. The user completes the construction and adjustment of the execution language through visual operations. There is no need to have an in-depth understanding of complex grammatical rules. The user only needs to depict the order to be executed through nodes and arrows. It is simple and easy to learn.
[0076] Execution language generation: The execution language generation engine monitors the user's graphical interface operations on the user interaction interface, builds objects based on the graphical interface operations and the drawn execution language, generates code that conforms to the execution language rules through the execution language generation engine, and returns the code to the user interaction interface; correspondingly, the code is displayed through the user interaction interface and the code is viewed and edited.
[0077] In this embodiment, the execution language generation engine is responsible for mapping the operations on the user interaction interface into the execution language code. As a specific implementation, the execution language code is generated through the following steps:
[0078] (1) For the execution language construction object drawn by the user, obtain the business logic and business data of each node, and obtain the starting point and end point of each directed line;
[0079] (2) Using the starting point and end point of the directed line between nodes as edge information, update and record the direct subordinate nodes of the node, and update and record the in-degree and out-degree of the node. The in-degree represents the number of directed lines connected to the node whose starting point is the node, and the out-degree represents the number of directed lines connected to the node whose end point is the node;
[0080] (3) Determine the position of the node based on the node and the in-degree and out-degree, where the node with in-degree 0 is used as the starting node and the node with out-degree 0 is used as the ending node;
[0081] (4) Traverse all nodes. During the traversal process, nodes with an out-degree greater than 1 are nodes with branches. For nodes with branches, deeply traverse the branches of the node according to the logical relationship between the nodes. When traversing the branches, push the branches into the stack from the starting point in sequence, and record the end node of the deep traversal. When the number of end nodes is equal to the out-degree of the branch starting point, the traversal of all branches ends. If the branch contains sub-branches, deeply traverse the sub-branches. In the process of traversing the branches, corresponding relationship nodes are generated according to the type and logical relationship of the nodes. The relationship nodes include calling functions, setting variables, executing conditional judgments, and loops. The stack is used to assist in processing branches. When a node with an out-degree of 0, i.e., the end point of the branch, the nodes are popped out of the stack in sequence, and the previously stacked nodes are processed;
[0082] (5) For each branch, all nodes are maintained as a hierarchical node, and are converted into codes of the corresponding execution language according to the node type and business data. During the code generation process, real-time error detection is performed on the code. If syntax errors, logical errors or inconsistencies occur, prompts and repair suggestions are sent to the user;
[0083] (6) After all branches are processed, a complete execution language code is generated, and the codes corresponding to each branch are organized according to the logical order drawn by the user in the user interaction interface to form an executable program or script, and the program or script is returned to the user interaction interface.
[0084] In this embodiment, the specific code generation steps are configured by executing the language generation engine to ensure that the generated code not only conforms to the grammatical rules of EL, but also accurately reflects the logic and operations constructed by the user in the graphical interface, including data structure analysis, determination of starting and end points, traversal and branch processing, code generation and stack operations, error detection and processing, completion and output.
[0085] Data structure analysis: The execution language generation engine will deeply analyze the internal data structures. These data structures contain the operation units defined by the user in the graphical interface and the logical relationships between them (such as sequence, condition, loop, containment, etc.). The execution language generation engine traverses the above data structures and extracts all necessary information to prepare for subsequent code generation; and by parsing the edge information, it updates and records the direct subordinate nodes of the node, and updates and records the in-degree of the node.
[0086] Determine the starting point and end point: In the execution language, the execution of the code usually starts from a clear starting point and ends at one or more end points. The execution language generation engine parses the edge information, updates the node's direct subordinate nodes, and updates the node's in-degree. Then, the node's position is determined based on the node's in-degree and out-degree. The starting node and the end node are defined first, and the nodes with an in-degree of 0 are stored in the starting node because they have no other preconditions or dependencies; and the nodes with an out-degree of 0 are placed in the defined end point because they no longer have any other subsequent nodes.
[0087] Traversal and branch processing: The execution language generation engine starts from each starting point and traverses the entire process in the logical order defined by the user in the graphical interface. During the traversal process, nodes with an out-degree greater than 1 are nodes with branches. For nodes with branches, the execution language generation engine deeply traverses their branches according to the node relationship. When traversing each branch, the execution language generation engine pushes the branches into the stack from the starting point in sequence and records the end point of the deep traversal. When the number of end points is equal to the out-degree of the branch starting point, the traversal of all branches ends. If a branch contains a branch, it is recursively processed according to the above method.
[0088] Code generation and stack operations: In the process of traversing branches, the execution language generation engine generates corresponding relationship nodes according to the node types and logical relationships, including calling functions, setting variables, executing conditional judgments, loops, etc. At the same time, the execution language generation engine uses the stack to assist in processing branches; when encountering a node with an out-degree of 0 (i.e., the end point of the branch), the execution language generation engine begins to pop the stack in sequence and process the previously pushed nodes. In this way, the execution language generation engine can ensure that the order of code generation is correct and that each branch is properly processed. Ultimately, all nodes are maintained as a hierarchical node, and then converted into corresponding EL statements according to the node type and necessary business data.
[0089] Error detection and handling: During the code generation process, the execution language generation engine performs real-time error detection. If any syntax errors, logical errors or inconsistencies are found, the execution language generation engine will immediately prompt the user and provide corresponding repair suggestions, which will help users correct errors in time and improve the quality and stability of the code.
[0090] Completion and output: When all branches are processed and there are no errors, the execution language generation engine will generate complete execution language code. The above execution language code will be organized according to the logical order defined by the user in the graphical interface to form an executable program or script. The user can directly use the generated execution language code for subsequent use or development work.
[0091] Through the above steps and strategies, the execution language generation engine can automatically generate code that conforms to the grammatical rules of the execution language, providing users with an efficient, convenient and reliable programming experience. It not only reduces the complexity and workload of manual code writing, but also improves the quality and maintainability of the code.
[0092] The present invention has been shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the means in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.
Claims
1. A system for generating an execution language based on a point-line structure, characterized in that: Includes component extension manager, user interaction interface and execution language generation engine; The component extension manager interacts with the user through the component extension management interface to support the user to create a directed line, the directed line is configured with a start point and an end point, and is used to support the user to define various types of operation units as nodes and configure the business logic and business data of the operation units; The user interaction interface is used to display directed lines and nodes as components, and is used to support users to use nodes and directed lines between nodes as construction objects of the execution language, and to perform graphical drawing and adjustment of the execution language construction objects by graphical interface operations such as dragging nodes and connecting nodes through directed lines; The execution language generation engine is used to monitor the user's graphical interface operations on the user interaction interface, and build objects based on the graphical interface operations and the drawn execution language, generate code that conforms to the execution language rules, and return the code to the user interaction interface; correspondingly, the user interaction interface is used to display the code and support users to view and edit the code.
2. The system for generating execution language based on point-line structure according to claim 1, characterized in that: The component extension manager is used to support users to perform version updates on created nodes.
3. The system for generating execution language based on point-line structure according to claim 1, characterized in that: The user interaction interface provides a graphical interface based on React or Vue, and provides a graphical interface operation service based on HTML5 Canvas or SVG. The graphical interface operation service includes dragging directed lines and nodes and connecting nodes through directed lines.
4. The system for generating execution language based on point-line structure according to claim 1, characterized in that: The execution language generation engine is used to perform the following operations: For the execution language construction object drawn by the user, obtain the business logic and business data of each node, and obtain the starting point and end point of each directed line; Using the starting point and end point of the directed line between nodes as edge information, update and record the direct subordinate nodes of the node, and update and record the in-degree and out-degree of the node. The in-degree represents the number of directed lines connected to the node whose starting point is the node, and the out-degree represents the number of directed lines connected to the node whose end point is the node; Determine the position of the node according to the node and the in-degree and out-degree, where the node with in-degree 0 is used as the starting node and the node with out-degree 0 is used as the ending node; Traverse all nodes. During the traversal process, nodes with an out-degree greater than 1 are nodes with branches. For nodes with branches, deeply traverse the branches of the node according to the logical relationship between the nodes. When traversing the branches, push the branches into the stack from the starting point in sequence, and record the end node of the deep traversal. When the number of end nodes is equal to the out-degree of the branch starting point, the traversal of all branches ends. If the branch contains sub-branches, deeply traverse the sub-branches. In the process of traversing the branches, generate corresponding relationship nodes according to the type and logical relationship of the nodes. The relationship nodes include calling functions, setting variables, executing conditional judgments and loops, and use the stack to assist in processing branches. When encountering a node with an out-degree of 0, that is, the end of the branch, pop the nodes out of the stack in sequence and process the previously stacked nodes; For each branch, all nodes are maintained as a hierarchical node, and are converted into codes of the corresponding execution language according to the node type and business data. During the code generation process, the code is checked for errors in real time. If syntax errors, logic errors or inconsistencies occur, prompts and repair suggestions are sent to the user. After all branches are processed, a complete execution language code is generated, and the codes corresponding to each branch are organized according to the logical order drawn by the user in the user interaction interface to form an executable program or script, and the program or script is returned to the user interaction interface.
5. A method for generating an execution language based on a point-line structure, characterized in that: The method for generating an execution language by using a system for generating an execution language based on a point-line structure as claimed in any one of claims 1 to 4 comprises the following steps: Point-line structure management: create a directed line through the component extension manager, the directed line is configured with a start point and an end point, customize various types of operation units as nodes, and configure the business logic and business data of the operation unit through the component extension manager; Execution language drawing: taking nodes and directed lines between nodes as construction objects of the execution language, and performing graphical drawing and adjustment of execution language construction objects by dragging nodes and connecting nodes through directed lines in the user interaction interface; Execution language generation: The execution language generation engine monitors the user's graphical interface operations on the user interaction interface, builds objects based on the graphical interface operations and the drawn execution language, generates code that conforms to the execution language rules through the execution language generation engine, and returns the code to the user interaction interface; correspondingly, the code is displayed through the user interaction interface and the code is viewed and edited.
6. The method for generating execution language based on point-line structure according to claim 5, characterized in that: Point-line structure management also includes version updates of created nodes through the component extension manager.
7. The method for generating execution language based on point-line structure according to claim 5, characterized in that: The user interaction interface provides a graphical interface based on React or Vue, and provides graphical interface operation services based on HTML5 Canvas or SVG. The graphical interface operation services include dragging directed lines and nodes and connecting nodes through directed lines.
8. The method for generating execution language based on point-line structure according to claim 5, characterized in that: Execution language generation includes the following steps: For the execution language construction object drawn by the user, obtain the business logic and business data of each node, and obtain the starting point and end point of each directed line; Using the starting point and end point of the directed line between nodes as edge information, update and record the direct subordinate nodes of the node, and update and record the in-degree and out-degree of the node. The in-degree represents the number of directed lines connected to the node whose starting point is the node, and the out-degree represents the number of directed lines connected to the node whose end point is the node; Determine the position of the node according to the node and the in-degree and out-degree, where the node with in-degree 0 is used as the starting node and the node with out-degree 0 is used as the ending node; Traverse all nodes. During the traversal process, nodes with an out-degree greater than 1 are nodes with branches. For nodes with branches, deeply traverse the branches of the node according to the logical relationship between the nodes. When traversing the branches, push the branches into the stack from the starting point in sequence, and record the end node of the deep traversal. When the number of end nodes is equal to the out-degree of the branch starting point, the traversal of all branches ends. If the branch contains sub-branches, deeply traverse the sub-branches. In the process of traversing the branches, generate corresponding relationship nodes according to the type and logical relationship of the nodes. The relationship nodes include calling functions, setting variables, executing conditional judgments and loops, and use the stack to assist in processing branches. When encountering a node with an out-degree of 0, that is, the end of the branch, pop the nodes out of the stack in sequence and process the previously stacked nodes; For each branch, all nodes are maintained as a hierarchical node, and are converted into codes of the corresponding execution language according to the node type and business data. During the code generation process, the code is checked for errors in real time. If syntax errors, logic errors or inconsistencies occur, prompts and repair suggestions are sent to the user. After all branches are processed, a complete execution language code is generated, and the codes corresponding to each branch are organized according to the logical order drawn by the user in the user interaction interface to form an executable program or script, and the program or script is returned to the user interaction interface.