A method and system for bidirectional data type inference in graphical programming

By using a two-layer graph tree structure and a bidirectional type derivation method, the problem of type determination for complex nested structures in graphical programming is solved, and intelligent type mapping and type conversion of tunnel nodes are realized, thereby improving the type security and development efficiency of the system.

CN121680822BActive Publication Date: 2026-04-28CHENGDU MAISHUO ELECTRIC CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHENGDU MAISHUO ELECTRIC CO LTD
Filing Date
2026-02-10
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing graphical programming systems only support one-way type inference, making it difficult to correctly handle complex nested structures and the type determination of tunnel exit nodes. In particular, type information is easily lost or erroneous in multi-layered nested control structures.

Method used

It adopts a two-layer graph-tree structure, combining depth-first search (DFS) and post-order traversal (LRD) to achieve bidirectional data type derivation from the outside to the inside and from the inside to the outside. The graph structure describes the data flow and the tree structure describes the hierarchical relationship, and the type conversion code is automatically generated.

Benefits of technology

It effectively solves the problem of type determination in nested structures, realizes intelligent type mapping and type conversion of tunnel nodes, and improves the type safety and development efficiency of graphical programming systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121680822B_ABST
    Figure CN121680822B_ABST
Patent Text Reader

Abstract

The application provides a method and system for bidirectional data type derivation in graphical programming, and relates to the technical field of graphical programming, and comprises the following steps: S1, parsing graphical programming data into a graph structure and a tree structure; S2, performing data type derivation from outside to inside: based on the tree structure, traversing each graph structure in a depth-first order, for a currently traversed graph structure, traversing internal nodes in a topological order of a directed acyclic graph, and according to a data flow direction, deriving a data type of a downstream node according to a data type of an upstream node; S3, performing data type derivation from inside to outside: based on the tree structure, traversing each graph structure in a postorder, for a currently traversed graph structure, determining a data type of an output boundary according to a data type of an internal node, and reversely propagating the data type to a corresponding node in a parent graph; and S4, automatically generating type conversion code according to a predefined data type processing rule.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of graphical programming technology, and more specifically to a method and system for bidirectional data type derivation in graphical programming. Background Technology

[0002] In the field of graphical programming, data type inference is a crucial step in code generation. However, most existing graphical programming systems only support unidirectional type inference, that is, forward inference from the data source to the data endpoint. For example, LabVIEW, as a representative product of graphical programming, has a primarily unidirectional inference mechanism, with limited support for complex nested structures. While this approach can maintain normal operation in simple linear data flows, it has significant shortcomings when dealing with complex nested structures. In particular, when there are multi-level nested control structures, type information is easily lost or erroneous during inter-level transmission.

[0003] Furthermore, in graphical programming, tunnel nodes are key elements connecting different levels of graph structures. When data enters a loop from outside through a tunnel node and then exits from inside, one-way derivation struggles to correctly determine the type of the tunnel exit node. This is because when the input is an array or list, the set type needs to be mapped to the element type for use by the loop body, which current systems do not adequately support; the type of the tunnel exit node needs to propagate from inside the subgraph outwards, but existing one-way derivation mechanisms cannot achieve this. Summary of the Invention

[0004] The purpose of this invention is to provide a method for bidirectional data type derivation in graphical programming. Based on the dual structure of the graph tree, the bidirectional mechanism of derivation from the outside in and from the inside out can ensure the complete transmission of data type information in the nested structure.

[0005] To solve the above-mentioned technical problems, the present invention adopts the following solution:

[0006] A method for bidirectional data type deduction in graphical programming includes the following steps:

[0007] S1. Receive graphical programming data and parse the graphical programming data into graph structure and tree structure;

[0008] The graph structure is a directed acyclic graph constructed based on each independently executable logic block in the graphical programming data. The data flow within the logic block is described by the connection relationship between nodes in the directed acyclic graph.

[0009] The tree structure describes the hierarchical nesting relationship between all graph structures. Each tree node uniquely corresponds to a graph structure. The graph structure corresponding to the tree node at the upper level is called the parent graph, and the graph structure corresponding to the tree node at the lower level is called the child graph.

[0010] S2. Perform data type derivation from the outside in: Based on the tree structure, traverse each graph structure in depth-first order. For the currently traversed graph structure, traverse the internal nodes according to the topological order of the directed acyclic graph, and deduce the data type of the downstream node according to the data flow direction based on the data type of the upstream node.

[0011] S3. Perform data type derivation from the inside out: Based on the tree structure, traverse each graph structure in post-order. For the currently traversed graph structure, determine the data type of its output boundary based on the data type of its internal nodes, and propagate the data type back to the corresponding node in its parent graph.

[0012] S4. Automatically generate type conversion code based on predefined data type processing rules.

[0013] Furthermore, in S2, the process of deriving the data type of the downstream node based on the data type of the upstream node is as follows:

[0014] Branching is performed based on the type of the upstream node;

[0015] If the upstream node is a loop structure node, the data type of the downstream node is automatically deduced based on the data type of the upstream node and the semantics of the loop structure; if the upstream node is another control structure node, the data type of the upstream node is deduced to the downstream node according to the predefined type deduction rules; if the upstream node is a normal node, the data type of the upstream node is directly passed to the downstream node.

[0016] Furthermore, when the upstream node is an input tunnel node of a loop structure, the process of automatically deriving the data type of the downstream node based on the data type of the upstream node and the semantics of the loop structure is as follows:

[0017] Determine whether the data type is an array or a list.

[0018] If yes, the data type of the downstream node is automatically deduced to be the element type of the array or list; otherwise, the data type of the upstream node is directly passed to the data type of the downstream node.

[0019] Furthermore, the data type of the downstream node is automatically deduced to be the element type of the array or list, which is reflected in the code generation as code that accesses a single element of the array or list according to the loop iteration index.

[0020] Furthermore, in S3, when the currently traversed graph structure is a subgraph corresponding to a cyclic structure, the process of determining the data type of its output boundary based on the data type of its internal nodes is as follows:

[0021] Detect the data type requirements of the corresponding receiving node in its parent graph, and determine the data type of its output boundary based on the data type generated internally and the data type requirements.

[0022] Furthermore, the process of determining the data type of its output boundaries is as follows:

[0023] If the data type generated internally is a simple type and the data type of the corresponding receiving node in the parent graph is a set type, then the data type of its output boundary is deduced to be a list type with that simple type as its element; otherwise, the data type generated internally is directly determined as the data type of its output boundary.

[0024] Furthermore, the data type of its output boundary is deduced to be a list type with this simple type as its elements. In code generation, this is reflected in the generation of code that creates a cached list, appends data in each loop iteration, and outputs the complete list after the loop ends.

[0025] Furthermore, the process of automatically generating type conversion code based on predefined data type processing rules is as follows:

[0026] Obtain predefined numeric type priority rules and display type conversion rules; wherein, the numeric types include integer type, floating-point type and high-precision type;

[0027] Detect all data connections. When the data types at both ends of the connection do not match, determine whether a display conversion is needed based on the display type conversion rules. If so, generate the corresponding code.

[0028] A system for performing bidirectional data type deduction in graphical programming, using the aforementioned method for performing bidirectional data type deduction in graphical programming, includes:

[0029] Graph structure parsing module: Receives graphical programming data and parses it into graph and tree structures;

[0030] The graph structure is a directed acyclic graph constructed based on each independently executable logic block in the graphical programming data. The data flow within the logic block is described by the connection relationship between nodes in the directed acyclic graph.

[0031] The tree structure describes the hierarchical nesting relationship between all graph structures. Each tree node uniquely corresponds to a graph structure. The graph structure corresponding to the tree node at the upper level is called the parent graph, and the graph structure corresponding to the tree node at the lower level is called the child graph.

[0032] The data type derivation module from the outside to the inside: Based on the tree structure, each graph structure is traversed in depth-first order. For the currently traversed graph structure, the internal nodes are traversed according to the topological order of the directed acyclic graph, and the data type of the downstream node is deduced according to the data flow direction based on the data type of the upstream node.

[0033] Data type derivation module from the inside out: Based on the tree structure, traverse each graph structure in post-order. For the currently traversed graph structure, determine the data type of its output boundary based on the data type of its internal nodes, and propagate the data type back to the corresponding node in its parent graph.

[0034] Display type conversion module: Automatically generates type conversion code based on predefined data type processing rules.

[0035] The beneficial effects of this invention are:

[0036] 1. Two-way type inference mechanism: It innovatively combines the inference from the outside to the inside of depth-first search (DFS) with the inference from the inside to the outside of post-order traversal (LRD), which effectively solves the problem of type determination in nested structures.

[0037] 2. Graph-Tree Two-Layer Data Structure: The two-layer structure, which uses a graph to describe the data flow and a tree to describe the hierarchical relationship, provides a solid data organization foundation for bidirectional type inference.

[0038] 3. Intelligent type mapping for tunnel nodes: Implements automatic mapping of arrays / lists to element types for tunnel entrance nodes, as well as a type backpropagation mechanism for tunnel exit nodes.

[0039] 4. Priority-based automatic type conversion: Define a complete type priority system and explicit conversion rules to achieve automatic generation of type conversion code.

[0040] In summary, this invention significantly improves the type safety and development efficiency of graphical programming systems, and is particularly suitable for engineering application scenarios involving complex nested control structures. It can be widely used in fields such as industrial automation, test and measurement, and data analysis. Attached Figure Description

[0041] Figure 1 This is a schematic diagram of the architecture of the graphical programming system in Embodiment 1 of the present invention.

[0042] Figure 2 This is a schematic diagram of the two-layer tree structure in Embodiment 1 of the present invention.

[0043] Figure 3 This is a flowchart illustrating the method in Embodiment 1 of the present invention. Detailed Implementation

[0044] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the present invention or its application or use. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0045] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps described in these embodiments do not limit the scope of the invention.

[0046] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.

[0047] Furthermore, for clarity and brevity, descriptions of well-known structures, functions, and configurations may have been omitted. Those skilled in the art will recognize that various changes and modifications can be made to the examples described herein without departing from the spirit and scope of this disclosure.

[0048] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0049] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.

[0050] The present invention will now be described in detail with reference to the accompanying drawings and embodiments:

[0051] Example 1

[0052] In this embodiment, a graphical programming system may be provided, the architecture of which is as follows: Figure 1As shown, the system includes a front-end diagram editor, a graph structure parsing module, a bidirectional type inference module, and a code generation module. Specifically, the front-end diagram editor is used by users to build program diagrams by dragging and dropping nodes and connecting data lines. The graph structure parsing module is used to parse JSON into Graph objects and build graph and tree structures, i.e., directed acyclic graphs and tree structures. The bidirectional type inference module includes an outside-in data type inference module, an inside-out data type inference module, and a display type conversion module. The outside-in data type inference module is mainly used for DFS inference from the outside to the inside, and its process can be topological sorting traversal, tunnel entry processing, and array index mapping in sequence. The inside-out data type inference module is mainly used for LRD inference from the inside to the outside, and its process can be subsequent traversal processing, tunnel exit propagation, and control node update in sequence. The display type conversion module is mainly used for display type conversion processing, and its process can be type priority judgment, conversion rule matching, and Convert code generation in sequence. The code generation module is used to generate type-safe C# code from the inferred type information.

[0053] The graph structure and tree structure constitute a two-layer data structure to represent the graphical program. Specifically, the graph structure refers to constructing each independently executable logical block in the graphical programming data into a directed acyclic graph (DAG). Each DAG includes a unique graph identifier, a graph name, the control node, a node set, and DAG data flow relationships, and is divided into a main graph and subgraphs. The tree structure is based on the hierarchical nesting relationship between all extracted graph structures. Each tree node uniquely corresponds to a graph structure, with the main graph as the root node of the tree. The graph structure corresponding to the upper-level tree node is called the parent graph, and the graph structure corresponding to the lower-level tree node is called the subgraph.

[0054] Specifically, the graph tree two-layer structure is as follows: Figure 2As shown, this includes a tree structure and its corresponding graph structure. The graph structure represents a data flow DAG, which includes a ForLoop subgraph DAG and a main graph DAG connected to it. Data flows from the ForLoop subgraph DAG to the main graph DAG. The tree structure represents a hierarchical relationship, recursively forming multiple levels of trees in a nested structure. The first level is the main graph Main, with Main as the root node, corresponding to the main graph DAG. The second level consists of ForLoop and WhileLoop subgraphs, which are the lower-level tree nodes. The ForLoop subgraphs correspond to the ForLoop subgraph DAG, and at this point, the main graph Main is the parent graph of the ForLoop and WhileLoop subgraphs. The third level consists of Branch-True, Branch-False, and inner ForLoop subgraphs, which are the lower-level tree nodes. At this point, the ForLoop subgraph is the parent graph of the Branch-True and Branch-False subgraphs, and the WhileLoop subgraph is the parent graph of the inner ForLoop subgraph.

[0055] Furthermore, a Depth-First Search (DFS) approach is proposed for graph structures, starting from the root graph and deriving the type along the data flow direction. Specifically, assuming the current input is the root graph Graph8, g.DeclType is called to derive the current graph type. All nodes in the graph are traversed. When a node is found, its type is determined, and then the node's own type can be used for type deduction. If the node type is ForLoopNode, which is a For loop structure node, the subgraph SubGraph is obtained; if the node type is WhileLoopNode, which is a While loop structure node, the subgraph SubGraph is obtained; if the node type is GraphControlNode, which is another control structure node, all subgraphs are traversed; if the node type is a normal node, the next node is traversed until no more nodes are found.

[0056] When performing type inference for the type of the calling node itself, special node type propagation needs to be handled, such as input tunnel nodes in a loop structure node. For input tunnel nodes, the conversion from array type or list type to element type needs to be handled. The specific process is as follows: when the current node is an input tunnel node, the data type of the input tunnel node is obtained, and it is checked whether it is an array type or list type. If it is, the data type of the downstream node is automatically inferred to the element type of the array or list, that is, a single element in the array or list, and array index access code is generated; if not, it is passed directly.

[0057] Furthermore, for tree structures, an inside-out type derivation (LRD) approach is proposed, employing a post-order traversal strategy to ensure that subgraphs are processed before parentgraphs, thereby updating the connection type of the control node's output ports, i.e., the type of the output boundary. Specifically, assuming the post-order traversal result of SortedTreeNodes is obtained, each graph name is traversed to obtain a Graph object. It is then determined whether the graph has a ControlNode. If so, the OutputPorts of the ControlNode are traversed, and each output port is traversed. If an output port exists, the Connections of the port are traversed, and the output port is determined to have a type. If a type exists, it is assigned to Connection.DataType.

[0058] When updating the connection type of the output port of the control node, special output ports need to be handled, such as output tunnel nodes in a loop structure. The type of the output tunnel node needs to be propagated back to the control node. Then, the input port of the output tunnel node is obtained, the corresponding tunnel exit node of the control node is found, and the tunnel exit node type of the control node is updated.

[0059] By integrating the above-mentioned outward-to-inward and inward-to-outward type deductions to form a complete bidirectional type deduction, this invention proposes a method for bidirectional data type deduction in graphical programming. It ensures the correctness of the deduction order through topological sorting and post-order traversal. Within a single graph, DAG topological sorting is used to determine the node processing order, ensuring that upstream nodes are processed first. Between graph trees, post-order traversal is used to determine the graph processing order, ensuring that subgraphs are processed first. This invention overcomes the limitations of traditional unidirectional type deduction, supports multiple structures such as multi-level nested loops, complex branches, and hybrid control, and achieves automatic mapping from array or list types of input tunnel nodes to element types, as well as backpropagation of data types of output tunnel nodes. It can automatically detect set types and extract element types, generating array index access code without requiring manual addition by the user.

[0060] like Figure 3 As shown, the method mainly includes the following steps S1-S4.

[0061] Step S1: Receive graphical programming data and parse the graphical programming data into graph structure and tree structure.

[0062] Step S2: Perform data type derivation from the outside in: Based on the tree structure, traverse each graph structure in depth-first order. For the currently traversed graph structure, traverse the internal nodes according to the topological order of the directed acyclic graph, and deduce the data type of the downstream node according to the data flow direction based on the data type of the upstream node.

[0063] In S2, the process of deriving the data type of the downstream node based on the data type of the upstream node mainly involves branching based on the node's own data type. The specific branching process is as follows:

[0064] If the upstream node is a circular node, the data type of the downstream node will be automatically deduced based on the data type of the upstream node and the semantics of the circular structure.

[0065] If the upstream node is another control structure node, the data type of the upstream node will be deduced to the downstream node according to the predefined type deduction rules;

[0066] If the upstream node is a regular node, the data type of the upstream node will be directly passed to the downstream node.

[0067] When the upstream node is an input tunnel node with a loop structure, the input tunnel node is processed as follows: it is determined whether the data type is an array type or a list type; if so, the data type of the downstream node is automatically deduced to be the element type of the array or list, which is reflected in the code generation as code that accesses a single element of the array or list according to the loop iteration index; if not, the data type of the upstream node is directly passed to the data type of the downstream node.

[0068] Step S3: Perform data type derivation from the inside out: Based on the tree structure, traverse each graph structure in postorder. For the currently traversed graph structure, determine the data type of its output boundary based on the data type of its internal nodes, and propagate this data type back to the corresponding node in its parent graph.

[0069] In S3, when the current traversed graph structure is a subgraph corresponding to a cyclic structure, it is necessary to check the data type requirements of the corresponding receiving node in its parent graph. Based on the data type generated internally and the data type requirements, the data type of its output boundary is determined. The process is as follows: if the data type generated internally is a simple type and the data type of the corresponding receiving node in the parent graph is a set type, then the data type of its output boundary is deduced to be a list type with that simple type as its element. In code generation, this is reflected in the generation of code that creates a cached list, appends data in each loop iteration, and outputs the complete list after the loop ends; otherwise, the data type generated internally is directly determined as the data type of its output boundary.

[0070] Step S4: Automatically generate type conversion code based on predefined data type processing rules.

[0071] The process of automatically generating type conversion code based on predefined data type handling rules is as follows:

[0072] Obtain predefined numeric type priority rules and display type conversion rules; wherein, the numeric types include integer type, floating-point type and high-precision type;

[0073] Detect all data connections. When the data types at both ends of the connection do not match, determine whether a display conversion is needed based on the display type conversion rules. If so, generate the corresponding code.

[0074] The numeric type priority rule determines the output type of multiple input nodes by defining the priority of numeric types. The display type conversion rule determines whether a display conversion is required by defining the mapping relationship between different types that need to be displayed, such as the display conversion target for signed integer types, the display conversion target for unsigned integer types, and the display conversion target for floating-point types.

[0075] Using the above method, the process of deriving bidirectional data types based on a two-layer graph tree structure includes the following three stages:

[0076] Phase 1: DFS deduces the main graph; at this point, the input is the main graph containing the ForLoop, and the deduced array input node type is Double[]; the deduced ForLoop node count port type is Int32, i.e., the element type, and this type is passed to the tunnel entrance;

[0077] Phase 2: DFS derivation of the subgraph; At this stage, the TunnelEnterNode is derived. First, it checks whether the input is a set type, which is either an array type or a list type. If it is Double[], i.e., a set type, then the element type is Double, and a single element is extracted from the set data. Then, the output port is set to Double[], the connection type is set to Double, and array[i], i.e., the index code, is generated. If it is not Double[], the type is passed directly. Then, the iterator node type is derived as Int32. Then, the operator node type is derived as Double. Then, the TunnelLeaveNode input type is derived as Double.

[0078] Phase 3: LRD reverse derivation; at this point, post-order traversal is used: first process the subgraph; for the subgraph, first obtain the tunnel exit type: Double; then, update the corresponding output port of ControlNode: Double; then, post-order traversal is used again: process the main graph again; update the output connection type of ForLoop to: Double.

[0079] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Based on the technical essence of the present invention, any simple modifications, equivalent substitutions, and improvements made to the above embodiments within the spirit and principles of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A method for bidirectional data type deduction in graphical programming, characterized in that, Includes the following steps: S1. Receive graphical programming data and parse the graphical programming data into graph structure and tree structure; The graph structure is a directed acyclic graph constructed based on each independently executable logic block in the graphical programming data. The data flow within the logic block is described by the connection relationship between nodes in the directed acyclic graph. The tree structure describes the hierarchical nesting relationship between all graph structures. Each tree node uniquely corresponds to a graph structure. The graph structure corresponding to the tree node at the upper level is called the parent graph, and the graph structure corresponding to the tree node at the lower level is called the child graph. S2. Perform data type derivation from the outside in: Based on the tree structure, traverse each graph structure in depth-first order. For the currently traversed graph structure, traverse the internal nodes according to the topological order of the directed acyclic graph, and deduce the data type of the downstream node according to the data flow direction based on the data type of the upstream node. In S2, the process of deriving the data type of the downstream node based on the data type of the upstream node is as follows: Branching is performed based on the type of the upstream node; If the upstream node is a loop structure node, the data type of the downstream node is automatically deduced based on the data type of the upstream node and the semantics of the loop structure; if the upstream node is another control structure node, the data type of the upstream node is deduced to the downstream node according to the predefined type deduction rules; if the upstream node is a normal node, the data type of the upstream node is directly passed to the downstream node. S3. Perform data type derivation from the inside out: Based on the tree structure, traverse each graph structure in post-order. For the currently traversed graph structure, determine the data type of its output boundary based on the data type of its internal nodes, and propagate the data type back to the corresponding node in its parent graph. In S3, when the currently traversed graph structure is a subgraph corresponding to a cyclic structure, the process of determining the data type of its output boundary based on the data type of its internal nodes is as follows: Detect the data type requirements of the corresponding receiving node in its parent graph, and determine the data type of its output boundary based on the data type generated internally and the data type requirements. S4. Automatically generate type conversion code based on predefined data type processing rules. The process is as follows: Retrieve predefined numeric type priority rules and display type conversion rules; detect all data connections, and when the data types at both ends of the connection do not match, determine whether a display conversion is required based on the display type conversion rules; if so, generate the corresponding code. The numerical types include integer types, floating-point types, and high-precision types.

2. The method for bidirectional data type derivation in graphical programming according to claim 1, characterized in that, When the upstream node is the input tunnel node of a loop structure, the process of automatically deriving the data type of the downstream node based on the data type of the upstream node and the semantics of the loop structure is as follows: Determine whether the data type is an array or a list. If yes, the data type of the downstream node is automatically deduced to be the element type of the array or list; otherwise, the data type of the upstream node is directly passed to the data type of the downstream node.

3. The method for bidirectional data type derivation in graphical programming according to claim 2, characterized in that, The data type of downstream nodes is automatically deduced to the element type of the array or list, which is reflected in the code generation as code that accesses a single element of the array or list according to the loop iteration index.

4. The method for bidirectional data type derivation in graphical programming according to claim 1, characterized in that, The process of determining the data type of its output boundaries is as follows: If the data type generated internally is a simple type and the data type of the corresponding receiving node in the parent graph is a set type, then the data type of its output boundary is deduced to be a list type with that simple type as its element; otherwise, the data type generated internally is directly determined as the data type of its output boundary.

5. The method for bidirectional data type derivation in graphical programming according to claim 4, characterized in that, The data type of its output boundary is deduced to be a list type with that simple type as its element. In code generation, this is reflected in the generation of code that creates a cached list, appends data in each loop iteration, and outputs the complete list after the loop ends.

6. A system for bidirectional data type deduction in graphical programming, characterized in that, The method for bidirectional data type derivation in graphical programming as described in any one of claims 1-5 includes: Graph structure parsing module: Receives graphical programming data and parses it into graph and tree structures; The graph structure is a directed acyclic graph constructed based on each independently executable logic block in the graphical programming data. The data flow within the logic block is described by the connection relationship between nodes in the directed acyclic graph. The tree structure describes the hierarchical nesting relationship between all graph structures. Each tree node uniquely corresponds to a graph structure. The graph structure corresponding to the tree node at the upper level is called the parent graph, and the graph structure corresponding to the tree node at the lower level is called the child graph. The data type derivation module from the outside to the inside: Based on the tree structure, each graph structure is traversed in depth-first order. For the currently traversed graph structure, the internal nodes are traversed according to the topological order of the directed acyclic graph, and the data type of the downstream node is deduced according to the data flow direction based on the data type of the upstream node. Data type derivation module from the inside out: Based on the tree structure, traverse each graph structure in post-order. For the currently traversed graph structure, determine the data type of its output boundary based on the data type of its internal nodes, and propagate the data type back to the corresponding node in its parent graph. Display type conversion module: Automatically generates type conversion code based on predefined data type processing rules.

Citation Information

Patent Citations

  • Model node execution sequence optimization method and electronic equipment

    CN121166298A