Artificial intelligence assisted modeling method and system, non-transitory computer readable storage medium, electronic device, computer program product

CN122816614APending Publication Date: 2026-09-25SHANGHAI TOSUN TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611290243.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-25
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0002]人工智能(Artificial Intelligence,AI)辅助建模可以提高图形化模型的创建效率,但如果人工智能直接操作宿主图形编辑器,模型变化会表现为不可审计的创建、移动、连接和参数修改动作

Benefits of technology

[0010]本发明的有益效果是,本发明人工智能辅助建模方法通过将人工智能输出限制为模型描述语言文本,并强制对由入口文件及其直接或间接引用的其他模型描述语言文本构成的文本集合执行机器校验门禁,仅在机器校验门禁全部通过后方可形成语义关系图,再将该语义关系图转换为图形构建计划,最终根据图形构建计划生成完整图形化模型,解决了现有技术中人工智能直接操作宿主图形编辑器导致错误端口、孤立连线、类型不闭合或状态机迁移缺失在图形对象落地后才暴露、无法在宿主图形对象创建前有效拦截潜在错误的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122816614A_ABST
    Figure CN122816614A_ABST
Patent Text Reader

Abstract

The application relates to the field of software engineering and computer-aided modeling technology, in particular to an artificial intelligence-aided modeling method and system, a non-transitory computer-readable storage medium, an electronic device and a computer program product, wherein the method comprises the following steps: receiving modeling input and generating a model description language text according to the modeling input; taking an entry file in the model description language text as a starting point, collecting all other model description language texts directly or indirectly referenced by the entry file through a reference statement layer by layer in a recursive manner, and forming a text collection to be checked; analyzing each model description language text in the text collection to generate a corresponding abstract syntax tree; performing machine check access control on the text collection based on the abstract syntax trees; when the machine check access control is passed, constructing a semantic relationship graph based on the abstract syntax trees; generating a graph construction plan according to the semantic relationship graph, and generating a graphical model and an object corresponding relationship table according to the graph construction plan.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer technology and artificial intelligence technology, and more particularly to the fields of software engineering and computer-aided modeling technology. Specifically, it relates to an artificial intelligence-aided modeling method and system, a non-transitory computer-readable storage medium, an electronic device, and a computer program product. Background Technology

[0002] Artificial intelligence (AI)-assisted modeling can improve the efficiency of creating graphical models. However, if AI directly manipulates the host graphical editor, model changes will manifest as unauditable creation, movement, connection, and parameter modification actions. In this case, errors such as port breaks, orphaned connections, type incompleteness, or missing state machine transitions may only be exposed after the graphical object has been deployed, leading to a sharp increase in debugging costs and even propagating errors to downstream stages such as code generation and simulation execution.

[0003] Therefore, existing technologies have a technical problem: when artificial intelligence directly manipulates the host graphics editor during assisted modeling, it cannot effectively intercept potential errors before the host graphics object is created.

[0004] It should be noted that the information disclosed in this background section is only for understanding the background technology of this application concept and is not considered to constitute prior art information. Summary of the Invention

[0005] The purpose of this invention is to provide an artificial intelligence-assisted modeling method, comprising: Receive modeling input and generate model description language text based on the modeling input; Starting with the entry file in the model description language text, all other model description language texts directly or indirectly referenced by the entry file are collected recursively through reference statements, forming a text set to be checked. Parse the model description language texts in the text set and generate their respective abstract syntax trees; Based on the abstract syntax trees described above, machine verification access control is performed on the text collection; When the machine verifies the access control system and passes the verification, a semantic relationship graph is constructed based on the abstract syntax trees described above. A graph construction plan is generated based on the semantic relationship graph, and a graphical model and an object correspondence table are generated based on the graph construction plan. The object correspondence table includes the correspondence between each semantic object in the semantic relationship graph and each host graphical object in the graphical model.

[0006] In another aspect, the present invention also provides an artificial intelligence-assisted modeling system, including a computer device configured to include: The receiving module is configured to receive modeling input and generate model description language text based on the modeling input. The collection module is configured to start from the entry file in the model description language text, and recursively collect all other model description language texts that are directly or indirectly referenced by the entry file through reference statements, forming a set of texts to be checked. The parsing module is configured to parse the model description language text in the text set and generate their respective abstract syntax trees. The verification module is configured to perform machine verification access control on the text set based on each of the abstract syntax trees; The building module is configured to construct a semantic relation graph based on the abstract syntax trees when the machine verifies the access control; and The generation module is configured to generate a graph construction plan based on the semantic relationship graph, and to generate a graphical model and an object correspondence table based on the graph construction plan, wherein the object correspondence table includes the correspondence between each semantic object in the semantic relationship graph and each host graphical object in the graphical model.

[0007] Thirdly, the present invention also provides a non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the artificial intelligence-assisted modeling method as described above.

[0008] Fourthly, the present invention also provides an electronic device, comprising: Non-transitory computer-readable storage medium; processor; The non-transitory computer-readable storage medium stores instructions that, when executed by a processor, cause the processor to perform the artificial intelligence-assisted modeling method as described above.

[0009] Fifthly, the present invention also provides a computer program product, including instructions that, when executed by a processor, cause the processor to perform the artificial intelligence-assisted modeling method as described above.

[0010] The beneficial effects of this invention are that the AI-assisted modeling method of this invention restricts the output of AI to model description language text and forces machine verification gates to be applied to the text set consisting of the entry file and other model description language texts directly or indirectly referenced by it. Only after all machine verification gates are passed can a semantic relationship graph be formed. Then, the semantic relationship graph is converted into a graph construction plan, and finally a complete graphical model is generated according to the graph construction plan. This solves the technical problem in the prior art that when AI directly operates the host graphical editor, errors such as incorrect ports, isolated connections, non-closed types, or missing state machine transitions are only exposed after the graphical object is deployed, and potential errors cannot be effectively intercepted before the host graphical object is created.

[0011] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained through the structures particularly pointed out in the description and the drawings.

[0012] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0013] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0014] Figure 1 The diagram illustrates the steps of an artificial intelligence-assisted modeling method according to some embodiments; Figure 2 A block diagram illustrating the principle of an artificial intelligence-assisted modeling system according to some embodiments is shown; Figure 3 Block diagrams of electronic devices involved in some embodiments are shown. Detailed Implementation

[0015] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions 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, not all embodiments. 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.

[0016] AI-assisted modeling can improve the efficiency of creating graphical models, but if AI directly manipulates the host graphical editor, model changes will manifest as unauditable creation, movement, connection, and parameter modification actions. In this case, errors such as port breaks, orphaned connections, type inconsistencies, or missing state machine transitions may only surface after the graphical object has been deployed, leading to a sharp increase in debugging costs and potentially propagating errors to downstream stages such as code generation and simulation execution.

[0017] Therefore, existing technologies have a technical problem: when artificial intelligence directly manipulates the host graphics editor during assisted modeling, it cannot effectively intercept potential errors before the host graphics object is created.

[0018] Therefore, at least one embodiment provides an AI-assisted modeling method, comprising: receiving modeling input and generating model description language text based on the modeling input; starting from an entry file in the model description language text, recursively collecting all other model description language texts directly or indirectly referenced by the entry file through reference statements, and forming a text set to be checked; parsing each model description language text in the text set to generate its corresponding abstract syntax tree; performing machine verification gatekeeping on the text set based on each abstract syntax tree; when the machine verification gatekeeping passes, constructing a semantic relationship graph based on each abstract syntax tree; generating a graph construction plan based on the semantic relationship graph, and generating a graphical model and object correspondence table based on the graph construction plan, wherein the object correspondence table includes: the correspondence between each semantic object in the semantic relationship graph and each host graphical object in the graphical model.

[0019] This embodiment of the AI-assisted modeling method restricts AI output to model description language text and forces machine verification gates to be applied to the text set consisting of the entry file and other model description language texts directly or indirectly referenced by it. A semantic relationship graph can only be formed after all machine verification gates have passed. The semantic relationship graph is then converted into a graph construction plan, and finally a complete graphical model is generated based on the graph construction plan. This solves the technical problem in the prior art where AI directly operates the host graphical editor, causing errors such as incorrect ports, isolated connections, type non-closures, or missing state machine transitions to be exposed only after the graphical object is deployed, and the inability to effectively intercept potential errors before the host graphical object is created.

[0020] The various non-limiting embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings.

[0021] like Figure 1 As shown, some embodiments provide an artificial intelligence-assisted modeling method, including: Step S101: Receive modeling input and generate model description language text based on the modeling input; Step S102: Starting from the entry file in the model description language text, collect all other model description language texts that are directly or indirectly referenced by the entry file through reference statements, and form a text set to be checked. Step S103: Parse the model description language texts in the text set and generate their respective abstract syntax trees; Step S104: Based on each of the abstract syntax trees, perform machine verification access control on the text set; Step S105: When the machine verifies the access control, a semantic relation graph is constructed based on each of the abstract syntax trees. Step S106: Generate a graph construction plan based on the semantic relationship graph, and generate a graphical model and an object correspondence table based on the graph construction plan, wherein the object correspondence table includes the correspondence between each semantic object in the semantic relationship graph and each host graphical object in the graphical model.

[0022] Specifically, the modeling input refers to the external information that initiates the modeling process, which can be one or more of the following: natural language requirements, interface tables, state transition tables, and algorithm descriptions. This input information itself does not possess strict semantic constraints and needs to be transformed into structured model description language text through artificial intelligence or manual intervention.

[0023] Specifically, the reference statement is, for example, the import statement; the semantic object refers to the node or edge in the semantic relationship graph; the host graphical object refers to the model element in the graphical interface where the graphical model is located.

[0024] Specifically, in this embodiment, the artificial intelligence (AI) is only allowed to generate model description language text or modified fragments of model description language text, and is not allowed to directly create, move, delete or connect to host graphical objects.

[0025] Specifically, the model description language text generated based on the modeling input is a plain text format with predefined syntax, used to accurately describe semantic elements of the model such as components, ports, connections, state machines, and data types. Specifically, the model description language text includes one or more of the following: model declaration, repository declaration, graph declaration, port declaration, connection declaration, type declaration, data object declaration, and state machine declaration.

[0026] Specifically, the data object declaration includes various forms such as parameter declaration, signal declaration, persistent state declaration, and update declaration; the state machine declaration includes state machine body declaration, state machine data port declaration, initial state declaration, state declaration, and transition declaration.

[0027] Specifically, suppose a model Tad1Consumer includes three model description language texts, and the specific parts of each declaration in these three model description language texts are shown in the comments of the corresponding statements.

[0028] The statements in the Test_Dic_R2024b.repo.tad text file are as follows: repo Test_Dic_R2024b { / / Repository declaration: The repo keyword declares a repository. type BusType2(kind = numeric) = real; / / Type declaration type enum EnumType1(storage = native, default = Normal) { / / Type declaration Normal = 0, Service = 1 }; parameter f32p_LifeOK: real = 10.0; / / Parameter declaration parameter f32p_k: real = 1.0; / / Parameter declaration } The statements in the Tad1.repo.tad text file are as follows: repo Tad1 { / / Repository declaration: The repo keyword declares a repository. import ". / Test_Dic_R2024b.repo.tad" as TestDic; type Tad1LifeBus(kind = alias) = ​​TestDic.BusType2; / / Type declaration type Tad1Mode(kind = alias) = ​​TestDic.EnumType1; / / Type declaration unit percent = "%"; parameter LifeOkThreshold: real = TestDic.f32p_LifeOK; / / Parameter declaration parameter VehicleOdoScale: real = TestDic.f32p_k; / / Parameter declaration parameter FilterLifeHmiDefault: uint8 = 100; / / Parameter declaration } The statements in the Tad1Consumer.tad text file (entry file) are as follows: model Tad1Consumer { / / Model declaration import ". / Tad1.repo.tad" as Tad1; diagram Main(kind = dataflow) { / / Graph declaration input CurrentLife: real; / / Port declaration: The input keyword declares the input port. output HmiLife: uint8; / / Port declaration: The output keyword declares the output port. output ServiceRequired: bool; / / Port declaration: The output keyword declares the output port. signal IsLifeOk: bool = CurrentLife >= Tad1.LifeOkThreshold; / / Signal declaration persistent ScaledOdo: real = Tad1.FilterLifeHmiDefault *Tad1.VehicleOdoScale; / / Persistent state declaration node ControllerChart: Chart( chartDataInports = [CurrentLife, IsLifeOk], chartDataOutports = [HmiLife, ServiceRequired] ); ControllerChart.CurrentLife = CurrentLife; ControllerChart.IsLifeOk = IsLifeOk; HmiLife = ControllerChart.HmiLife; ServiceRequired = ControllerChart.ServiceRequired; update ScaledOdo = saturate(ScaledOdo + 1, 0, 100); / / Update declaration statemachine ControllerChart(decomposition = exclusive) { / / State machine body declaration data input { / / State machine data port declaration CurrentLife: real; IsLifeOk: bool; } data output { / / Declaration of state machine data ports HmiLife: uint8; ServiceRequired: bool; } start Normal; / / Initial state declaration state Normal { / / State declaration entry { HmiLife = Tad1.FilterLifeHmiDefault; ServiceRequired = false; } transition to_service: Normal->Service when (IsLifeOk==false); / / Transition declaration } state Service { / / State declaration entry { HmiLife = 0; ServiceRequired = true; } transition to _normal: Service->Normal when (IsLifeOk); / / Transition declaration } } } } Specifically, when parsing the model description language texts in the text set, lexical analysis and syntactic analysis are performed on each model description language text to generate their respective abstract syntax trees. The lexical analysis method is to segment the model description language text into a token stream and check whether each word and symbol is valid (such as correct keyword spelling, matching brackets, etc.). The syntactic analysis method is to check whether the order of the token streams conforms to predefined syntactic rules (such as model must be followed by model name, and left curly brace must be matched with right curly brace).

[0029] In some embodiments, the abstract syntax tree includes: file location, declaration boundaries, import references, expression structure, member access paths, state machine topology, and diagnostic location information.

[0030] Specifically, in addition to the node hierarchy, the abstract syntax tree also contains additional information. This additional information is attached to the nodes of the tree and is used to record the origin, structure, and location of the nodes, facilitating subsequent machine verification access control, error diagnosis, and tracing.

[0031] Specifically, the file location refers to the source file path to which each node in the abstract syntax tree belongs; the declaration boundary refers to the start and end positions (line number, column number) of each declaration statement in the source file; the import reference refers to the file path and alias referenced in the import statement; the expression structure refers to the nesting level and order of operations of expressions (such as comparison operations, function calls); the member access path refers to the qualified name path accessed through a preset symbol (such as Tad1.LifeOkThreshold), where the preset symbol is, for example, but not limited to, the dot "."; the state machine topology refers to the graph structure of states, transitions, and initial states in the state machine; and the diagnostic location information refers to the location information such as line number, column number, and node category used for error reporting.

[0032] In some embodiments, the machine verification access control includes one or more of name binding checks, type closure checks, port connection closure checks, state machine semantic closure checks, and source isolation checks; the name binding check includes: traversing the nodes of each of the abstract syntax trees, identifying and collecting all declaration nodes and reference nodes; finding the corresponding declaration node for each reference node, and reporting an error if there is an unmatched reference or multiple declaration nodes corresponding to the same name; the type closure check includes: verifying whether the output data type of the expression node is consistent with the target required data type; and verifying whether the data types between interconnected ports are compatible; the port The connection closure check includes: verifying whether the connection direction of each port matches the direction of the port it is connected to; and verifying whether each port receiving data has only one connection and whether each port outputting data has at least one connection; the state machine semantic closure check includes: verifying whether the model state machine has defined an initial state; verifying whether each declared state transition has a clear transition condition and target state; verifying whether the variables and / or events referenced in the transition action have been declared and defined; and the source isolation check includes: verifying whether the normalized paths of each model description language text in the text set to be checked are located within a preset controlled source range or the root directory of the model file.

[0033] Specifically, name binding checks ensure that every referenced name in the model description language text can find a unique declaration definition. The method for name binding checks is to traverse the abstract syntax tree, collect all declaration nodes (such as port declarations, signal declarations, and state declarations) and reference nodes (such as variable names used in expressions and state names referenced in migrations), and find the corresponding declaration node for each reference node.

[0034] Name binding checks may fail in cases such as, but not limited to, using unmatched references (e.g., using UnknownVar, but it is not declared anywhere in the model description language text) or having multiple declaration nodes corresponding to the same name (e.g., two signals are both called IsLifeOk).

[0035] Specifically, type closure checks ensure that the computation result type of all expression nodes in the model is consistent with the data type required by the target, and that the data types of interconnected ports are compatible. In type closure checks, the type required by the target can be a type constraint from the declared type, the assignment target, or the calling parameter, or it can be a type deduced from the expression itself.

[0036] Specifically, the type closure check method is as follows: 1) Check whether the result type of each expression node is consistent with the declared type of the variable or port receiving the result. For example, in the statement IsLifeOk: bool = CurrentLife >= Tad1.LifeOkThreshold, the comparison result should be bool, which is consistent with the declared type bool of IsLifeOk. 2) Check the interconnected port pairs to confirm whether the data types at both ends are compatible. Type closure checks may fail in cases including, but not limited to: the result type of the expression node not matching the target required type (e.g., assigning bool to a uint8 variable), or inconsistent types at both ends of a port connection (e.g., connecting a port of data type real to a port of data type int).

[0037] Specifically, port connection closure checks ensure the correct connection direction between ports. The port connection closure check method is as follows: 1) Check whether the source port of output data is connected to the target port of receiving data in each connection; 2) Check that each target port of receiving data has only one connection and each source port of output data has at least one connection.

[0038] Specifically, state machine semantic closure checks ensure that the definition of the state machine is complete and legal, and can be executed correctly at runtime. The methods for state machine semantic closure checks are: 1) checking whether the state machine specifies an initial state through the start statement; 2) checking whether each declared state transition has a clear transition condition and target state; 3) checking whether all variables and events referenced in the transition action have been declared and defined within the scope.

[0039] Specifically, source isolation checks ensure that all model description language text participating in machine verification gates originates from trusted and controlled sources, preventing untrusted sources such as external files, caches, and historical versions from participating in the machine verification gates. The source isolation check method involves verifying whether the normalized path (absolute path after normalization) of each text in the text set to be checked is within a preset controlled source range or the root directory of the model file. This preset controlled source range, such as a whitelist, is declared by the system designer or user in configuration files (YAML / JSON) or system integration interfaces. The system loads and normalizes these paths during initialization. During the source isolation check phase, the normalized paths of the text to be checked are compared; text not in the whitelist is rejected as a semantic source.

[0040] In some embodiments, based on the model description language text generated from the state transition table, interface table, or algorithm description, the machine verification access control performs corresponding state machine semantic closure checks, port connection closure checks, or type closure checks.

[0041] Specifically, the machine verification gate will perform targeted checks based on the source of the model description language text. That is, if the model description language text is generated from the state transition table, the machine verification gate will perform a state machine semantic closure check on the corresponding text set; if the model description language text is generated from the interface table, the machine verification gate will perform a port connection closure check on the corresponding text set; and if the model description language text is generated from the algorithm description, the machine verification gate will perform a type closure check on the corresponding text set.

[0042] In some embodiments, the semantic relationship graph includes semantic objects such as model nodes, graph nodes, subgraph nodes, block nodes, port nodes, connection edges, expression nodes, state machine nodes, state nodes, migration edges, and warehouse object nodes.

[0043] In some embodiments, the graph construction plan includes: a number of plan entries corresponding to each host graph object to be created or updated; each plan entry includes the following fields: plan entry identifier, semantic object identifier, host container, host graph object type, action type, port direction, endpoint reference, type constraint, layout anchor point, and failure fallback strategy; the host graph objects include: graph, subgraph, block, port, connection, and state machine object; and the layout anchor point is determined by the dependency edge, port direction, state machine carrier position, and subgraph boundary in the semantic relationship graph.

[0044] Specifically, the graphical construction plan refers to a list of instructions that tells the model import tool how to create or update the graphical model, where the model import tool belongs to the generation module; graph, subgraph, block, port, connection, and state machine object refer to various model elements that need to be presented in the graphical interface; the layout anchor point refers to the positioning reference point of each model element, which determines the position of the model element on the graphical interface.

[0045] Specifically, the plan entry identifier refers to the unique number of each plan; the semantic object identifier refers to the ID of the corresponding node in the semantic relationship graph; the host container refers to the parent container to which the model element in the graphical interface belongs; the host graphical object type refers to the type of the model element in the graphical interface (such as module, port, signal connection, status, etc.); the action type includes: create action and modify / update action; the port direction refers to the input / output direction of the port; the endpoint reference refers to the port reference at both ends of the connection line; the type constraint refers to the data type requirement; and the failure rollback strategy refers to the handling method if a plan fails to execute.

[0046] Specifically, the dependent edge refers to the relative position between model elements determined by the connection relationship, such as the two ports of a line should be placed close together; the port direction refers to the layout position of the input port or output port on the graph, such as the input port is usually placed on the left side of the graph and the output port is on the right side of the graph; the state machine carrier position refers to the area occupied by the state machine in the graph; the subgraph boundary refers to the position of the model element within the subgraph that does not exceed the bounding box of the corresponding subgraph.

[0047] The following example illustrates the style of a graphical construction plan and the process of generating a graphical model based on the graphical construction plan.

[0048] Assuming the system iterates through the semantic relationship graphs obtained from the language texts described by the three models mentioned above, the resulting graph construction plan is shown in Table 1:

[0049] In addition, some plan entries in the graph build plan also record endpoint references and failure rollback strategies (not shown in the table above). For example, for plan entry 009 (connecting CurrentLife to ControllerChart), the endpoint references are recorded: the source endpoint is port_CurrentLife, and the target endpoint is node_ControllerChart; the failure rollback strategy is: abort this build, roll back the created objects and output a structured diagnostic report, and refuse to deliver part of the model.

[0050] In addition, the corresponding plan entries in the graphics construction plan also record the layout anchor points of the corresponding model elements, as shown in Table 2:

[0051] The model import tool executes the graphical construction plan in the order of the plan item identifiers: Execution 001: Create a model root node named Tad1Consumer on the graphical interface.

[0052] Execution 002: Create a data flow graph named Main under the root node of the model and place it in the central area of ​​the graphical interface.

[0053] Execution 003: Create an input port named CurrentLife with type real on the left side of graph Main (x=100, y=150).

[0054] Execution 004: Create an output port named HmiLife of type uint8 on the right side of the Main graph (x=800, y=100).

[0055] Execution 005: Create an output port named ServiceRequired with type bool on the right side of Main (x=800, y=250).

[0056] Execution 006: Create a signal node named IsLifeOk of type bool in the middle region (x=250, y=200) of graph Main.

[0057] Execution 007: Create a persistent state node named ScaledOdo of type real at the bottom of graph Main (x=500, y=400).

[0058] Execution 008: Create a node named ControllerChart in the central region (x=400, y=150) of the Main graph, and configure its data input port as [CurrentLife, IsLifeOk] and data output port as [HmiLife,ServiceRequired].

[0059] Execute steps 009 to 012: Create four connection lines between the corresponding ports and nodes, with each connection line recording the source endpoint and the destination endpoint.

[0060] Execution 013: Create a mutually exclusive decomposition state machine inside the ControllerChart node.

[0061] Execute 014 and 015: Create two state nodes, Normal and Service, inside the state machine, and place them on the left and right sides respectively.

[0062] Execution 016: Create a migration edge from Normal to Service, and mark the migration condition as IsLifeOk == false.

[0063] Execution 017: Create a migration edge from Service to Normal, and mark the migration condition as IsLifeOk.

[0064] Once the execution is complete, the graphical model of the Tad1Consumer model will be created.

[0065] In some embodiments, the fields of the object mapping table include semantic object identifier, model description language text location, plan entry identifier, host graph object type, and host graph object identifier; and each created or updated host graph object has a mapping traceable to the model description language text or semantic relationship graph.

[0066] Specifically, the semantic object identifier refers to the unique and unchanging identifier of each semantic object in the semantic relationship graph, which does not change with the graph layout or tool version; the model description language text position refers to the position of the semantic object in the original model description language text (such as file name, row number, column number); the plan entry identifier refers to the number of the corresponding entry in the graph construction plan; and the host graph object identifier refers to the identifier of the model element in the graphical interface.

[0067] Specifically, through the object mapping table, bidirectional traceability between the semantic world and the graphical world is achieved, ensuring that changes to the model at any stage are traceable.

[0068] In some embodiments, before executing the graph construction plan, the method further includes performing a host landing check on the target host environment, an endpoint closure check on the connection entries in the graph construction plan, and an import closure check on the graphical model generated by executing the graph construction plan through pre-simulation. The host landing check confirms whether the target container exists, whether the layers are available, whether the subgraph boundaries are sufficient, whether object ownership is unique, and whether namespaces conflict. The endpoint closure check confirms whether the source object, source port, target object, target port, port direction, and port data type of each connection are semantically related. Figure 1 The import closure check confirms whether there are unbound objects, isolated connections, unknown types, unclosed state machine transitions, or host graphical objects with unrecorded corresponding relationships in the simulated graphical model.

[0069] Specifically, in the host landing check, whether the target container exists refers to whether the top-level model container specified in the target graphics modeling tool has been created and is available; whether the layer is available refers to whether the layer where the model element will be placed is in a writable state; whether the subgraph boundary is sufficient refers to whether the boundary range of the subgraph or subsystem can accommodate all sub-model elements (such as state boxes and transition lines inside the state machine); whether the object ownership is unique refers to the fact that each model element can only belong to one parent container and cannot be owned by two containers at the same time; whether the namespace conflicts refer to the fact that elements with the same name are not allowed in the same container (such as two ports both named CurrentLife).

[0070] Specifically, in the endpoint closure check, the source object refers to the object to which the starting end of the connection belongs (such as a port, signal, or module); the source port refers to the specific port name of the starting end; the target object refers to the object to which the ending end of the connection belongs; the target port refers to the specific port name of the ending end of the connection; the port direction includes the source port direction and the target port direction; the port data type refers to the port data type of the two ends of the connection. In this embodiment, the port data types of the two ends of the connection must be consistent (such as both being real or both being uint8).

[0071] Specifically, in the import closure check, an unbound object refers to a host graph object (model element) that does not have a corresponding semantic object; an isolated connection refers to one or both ends of the corresponding host graph object (such as a connecting line) not being connected to any valid host graph object; an unknown type refers to the corresponding host graph object using an undefined or unrecognized data type; an unclosed state machine transition refers to a transition in the corresponding state machine that has no source state or no target state; and an unrecorded correspondence refers to the corresponding host graph object not having a corresponding record with the semantic object.

[0072] In some embodiments, when any of the machine verification access control, host landing check, endpoint closure check, or import closure check fails, the system returns a structured diagnostic report to the AI ​​correction stage or the human review stage. The structured diagnostic report includes the failure location, the failure object, the failed access control, and the reason for rejection.

[0073] The following example fully describes the process of the AI-assisted modeling method in this embodiment.

[0074] Let's take the HvacModeManager air conditioning mode management model as an example.

[0075] Suppose the received modeling input is a natural language requirement, described as "a model is needed with three inputs: demandLevel, faultLevel, and blendCommand; two outputs: fanCommand and alarmScore; and a state machine, ControllerChart." Based on this, the artificial intelligence generates the following model description language text: model HvacModeManager { diagram Main(kind = dataflow) { input demandLevel: real64; input faultLevel: real64; input blendCommand: real64; output fanCommand: real64; output alarmScore: real64; node ControllerChart: Chart(chartDataInports = [demandLevel,faultLevel, blendCommand], chartDataOutports = [fanCommand, alarmScore]); ControllerChart.demandLevel = demandLevel; ControllerChart.faultLevel = faultLevel; ControllerChart.blendCommand = blendCommand; fanCommand = ControllerChart.fanCommand; alarmScore = ControllerChart.alarmScore; statemachine ControllerChart(decomposition = exclusive) { data input { demandLevel: real64; faultLevel: real64; blendCommand:real64;} data output { fanCommand: real64; alarmScore: real64;} start Idle; state Idle { transition start_run: Idle -> Active when (demandLevel >0);} state Active { entry { fanCommand = 2;} transition alarm: Active ->Fault when (faultLevel > 3);} state Fault { entry { alarmScore = 100;}} } } } The system determines that the file containing the model description language text is the entry file, and there are no additional import files. Therefore, the text set to be checked only contains this entry file.

[0076] The system performs lexical and syntactic analysis on the text, generating an abstract syntax tree. The abstract syntax tree contains one model declaration node (HvacModeManager), one graph declaration node (Main), five port declaration nodes, one node declaration node (ControllerChart), five assignment declaration nodes, one state machine declaration node, three state declaration nodes, and two transition declaration nodes.

[0077] Next, machine validation gates are executed, including: 1) Syntax check: Confirm that the declarations of model, diagram, input, output, node, assignment, and statemachine conform to the predefined syntax rules and have no lexical or syntax errors. 2) Name binding check: Traverse the abstract syntax tree to identify all declaration nodes and reference nodes. Confirm that demandLevel, faultLevel, blendCommand, ControllerChart.fanCommand, alarmScore, etc., all have corresponding declarations and no unmatched references or name conflicts. 3) Type closure check: Verify that the output data type of the expression node is consistent with the target data type requirement. All port types are real64, the state machine data input / output data types are consistent, and the data types at both ends of the assignment statement match. 4) Port connection closure check: Verify that the source port and target port of each assignment statement (connection declaration) exist and the connection direction is correct. The model input ports demandLevel, faultLevel, and blendCommand each have at least one connection, and the model output ports fanCommand and alarmScore each have only one connection. 5) State Machine Semantic Closure Check: Verify that the state machine defines the initial state Idle; each transition (start_run, alarm) has a clear transition condition and target state; and all variables referenced in the transition actions (fanCommand, alarmScore, demandLevel, faultLevel) have been declared. 6) Source Isolation Check: Verify that the normalized path of the entry file is located within the preset controlled source range or the root directory of the model file; the check passes.

[0078] After all machine verifications of the access control system pass, the system constructs a globally unified semantic relationship graph based on the abstract syntax trees. The nodes in the semantic relationship graph include: Model node: HvacModeManager; Graph node: Main; Port nodes: demandLevel, faultLevel, blendCommand, fanCommand, alarmScore; Block node: ControllerChart; State machine node: ControllerChart; State nodes: Idle, Active, Fault. The edges in the semantic relationship graph include: Connection edges: five assignment statements (demandLevel → ControllerChart.demandLevel, etc.); Migration edges: start_run (Idle to Active), alarm (Active to Fault).

[0079] The system then generates a graph construction plan based on the semantic relationship graph. This plan explicitly creates the Main graph, five graph boundary ports, a ControllerChart block, five connecting lines, a ControllerChart state machine object, three states, and two transitions. It also records the correspondence between semantic objects and the host graph objects. The graph construction plan is as follows: planId: gbp:HvacModeManager.Main sourceTad: HvacModeManager.tad preconditions: [syntaxClosed, symbolClosed, typeClosed, portClosed, stateMachineClosed, sourceIsolated] diagrams: - create diagram Main ports: - create input demandLevel: real64 - create input faultLevel: real64 - create input blendCommand: real64 - create output fanCommand: real64 - create output alarmScore: real64 blocks: - create Chart block ControllerChart links: - demandLevel -> ControllerChart.demandLevel - faultLevel -> ControllerChart.faultLevel - blendCommand -> ControllerChart.blendCommand - ControllerChart.fanCommand -> fanCommand - ControllerChart.alarmScore -> alarmScore stateMachines: - create ControllerChart with Idle, Active, Fault and transitionsstart_run, alarm layoutAnchors: - Main.inputs at layer 0 - ControllerChart at layer 1 - Main outputs at layer 2 objectMap: - semantic ControllerChart -> host Chart block ControllerChart - semantic transition start_run -> host transition Idle_to_Active Before executing the graph construction plan, the system performs the following three pre-checks: 1) Host landing check: Confirms that a usable top-level container exists in the target modeling tool, layers are available, subgraph boundaries are sufficient to accommodate three states and two migrations, object ownership is unique, and namespaces are conflict-free. 2) Endpoint closure check: Confirms that the source end object, source port, target end object, target port, port direction, and port data type of each connection line in the graph construction plan are semantically related. Figure 13) Import Closure Check: The pre-simulation executes the graphical construction plan to confirm that the generated graphical model does not contain unbound objects, orphaned connections, unknown types, unclosed state machine transitions, or host graphical objects with unrecorded corresponding relationships. The pre-simulation is achieved by building a lightweight virtual object model in memory through the pre-simulation engine within the generation module, and then "fake executing" the graphical construction plan line by line to generate the graphical model.

[0080] After the three preliminary checks are passed, the system creates a graphical model and a table of correspondence between the objects in the target graphical modeling tool according to the graphical construction plan. Finally, the graphical model is successfully generated, and all model elements can be traced back to the original generated model description language text or semantic relationship graph, thus ending the entire process.

[0081] like Figure 2 As shown, some embodiments also provide an artificial intelligence-assisted modeling system, including a computer device configured to include: The receiving module is configured to receive modeling input and generate model description language text based on the modeling input. The collection module is configured to start from the entry file in the model description language text, and recursively collect all other model description language texts that are directly or indirectly referenced by the entry file through reference statements, forming a set of texts to be checked. The parsing module is configured to parse the model description language text in the text set and generate their respective abstract syntax trees. The verification module is configured to perform machine verification access control on the text set based on each of the abstract syntax trees; The building module is configured to construct a semantic relation graph based on the abstract syntax trees when the machine verifies the access control; and The generation module is configured to generate a graph construction plan based on the semantic relationship graph, and to generate a graphical model and an object correspondence table based on the graph construction plan, wherein the object correspondence table includes the correspondence between each semantic object in the semantic relationship graph and each host graphical object in the graphical model.

[0082] The specific implementation functions of the receiving module, collecting module, parsing module, verification module, construction module, and generation module can be found in the aforementioned content on artificial intelligence-assisted modeling methods, and will not be repeated here.

[0083] The electronic devices in the embodiments of this disclosure are described below from the perspective of hardware processing: The embodiments disclosed herein do not limit the specific implementation of the electronic device.

[0084] like Figure 3As shown, some embodiments also provide an electronic device, including: a processor, a non-transitory computer-readable storage medium, a communication bus, and a communication interface; wherein the processor, the non-transitory computer-readable storage medium, and the communication interface communicate with each other through the communication bus; the non-transitory computer-readable storage medium stores instructions that, when executed by the processor, cause the processor to execute the aforementioned artificial intelligence-assisted modeling method.

[0085] Figure 3 The diagram shows a schematic structure of an electronic device, which is for illustration only and does not constitute a limitation on the electronic device. The electronic device may include fewer or more components than shown, or may combine components, or may use different component arrangements.

[0086] In some embodiments, the communication interface may include RS -232、 RS -485、 USB (include Type - C Physical interfaces such as Ethernet are used to connect external devices or bus adapters; they may also include wired network interfaces such as Ethernet. Wi - Fi Wireless network interfaces such as Bluetooth are used to establish communication connections between computer devices and other electronic devices.

[0087] In some embodiments, non-transitory computer-readable storage media include, but are not limited to: flash memory, hard disk, magnetic storage, magnetic disk, optical disk, and card-type storage (e.g., multimedia cards, secure digital cards). SD (e.g., memory). In some embodiments, the storage medium can serve as an internal storage unit of a computer device, such as a built-in hard disk; in other embodiments, it can serve as an external storage device, such as a plug-in hard disk or a smart memory card. SMC ), secure digital SD Cards, flash memory cards, etc. Furthermore, the storage medium can also include both internal storage units and external storage devices. This storage medium can be used to store application software and various types of data (such as computer program code) installed on the computer device, and can also be used to temporarily store data that has been output or will be output.

[0088] In some embodiments, the processor may be a central processing unit (CPU). CPU ), controller, microcontroller, microprocessor or other data processing chip, used to run program code in a storage medium and / or process data, such as executing a computer program.

[0089] In some embodiments, the communication bus may be an input / output bus, such as a peripheral component interconnect (PCI). PCI ) bus or extended industry standard structure ( EISA This bus can be divided into address bus, data bus, and control bus, etc.

[0090] Optionally, the computer device further includes a user interface. The user interface may include a display, an input unit (e.g., a keyboard), and a standard wired and / or wireless interface. Optionally, the display (or display module) may be... led Monitor, LCD monitor, touch screen LCD monitor, or OLED A monitor (or display module), also known as a display screen or display unit, is used to display information processed by a computer device and present a visual user interface.

[0091] When the processor executes the program, it implements the above. Figure 1 The steps in the illustrated AI-assisted modeling method embodiment are shown. Alternatively, the processor executes the computer program to implement the functions of each module or unit in the above-described device embodiments.

[0092] Some embodiments also provide a non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the artificial intelligence-assisted modeling method described above.

[0093] Please refer to the detailed description of the AI-assisted modeling method; it will not be repeated here.

[0094] Some embodiments also provide a computer program product including instructions that, when executed by a processor, cause the processor to perform the aforementioned artificial intelligence-assisted modeling method.

[0095] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0096] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0097] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a non-transitory computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0098] Based on the above-described preferred embodiments of the present invention, and through the foregoing description, those skilled in the art can make various changes and modifications without departing from the inventive concept. The technical scope of this invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.

Claims

1. An artificial intelligence-assisted modeling method, characterized in that, include: Receive modeling input and generate model description language text based on the modeling input; Starting with the entry file in the model description language text, all other model description language texts directly or indirectly referenced by the entry file are collected recursively through reference statements, forming a text set to be checked. Parse the model description language texts in the text set and generate their respective abstract syntax trees; Based on the abstract syntax trees described above, machine verification access control is performed on the text collection; When the machine verifies the access control system and passes the verification, a semantic relationship graph is constructed based on the abstract syntax trees described above. A graph construction plan is generated based on the semantic relationship graph, and a graphical model and an object correspondence table are generated based on the graph construction plan. The object correspondence table includes the correspondence between each semantic object in the semantic relationship graph and each host graphical object in the graphical model.

2. The artificial intelligence-assisted modeling method according to claim 1, characterized in that, The modeling inputs include one or more of the following: natural language requirements, interface table, state transition table, and algorithm description; The model description language text includes one or more of the following: model declaration, repository declaration, graph declaration, port declaration, connection declaration, type declaration, data object declaration, and state machine declaration.

3. The artificial intelligence-assisted modeling method according to claim 2, characterized in that, The machine verification access control includes one or more of the following: name binding check, type closure check, port connection closure check, state machine semantic closure check, and source isolation check; wherein The name binding check includes: traversing the nodes of each of the abstract syntax trees, identifying and collecting all declaration nodes and reference nodes; finding the corresponding declaration node for each reference node, and reporting an error if there is an unmatched reference or multiple declaration nodes corresponding to the same name; The type closure check includes: verifying whether the output data type of the expression node is consistent with the target required data type; and verifying whether the data types between interconnected ports are compatible. The port connection closure check includes: verifying whether the connection direction of each port matches the direction of the port it is connected to; and verifying whether each port receiving data has only one connection and whether each port outputting data has at least one connection. The state machine semantic closure check includes: verifying whether the model state machine defines an initial state; verifying whether each declared state transition has explicit transition conditions and a target state; verifying whether the variables and / or events referenced in the transition actions have been declared and defined; and The source isolation check includes: verifying whether the normalization path of each model description language text in the text set to be checked is located within a preset controlled source range or the root directory of the model file.

4. The artificial intelligence-assisted modeling method according to claim 3, characterized in that, If the model description language text generated based on the state transition table is used, then the state machine semantic closure check in the machine verification access control is performed on the corresponding text set. If the model description language text generated from the interface table is used, then the port connection closure check in the machine verification access control is performed on the corresponding text set. If the model description language text generated according to the algorithm description is used, then the type closure check in the machine verification access control is performed on the corresponding text set.

5. The artificial intelligence-assisted modeling method according to claim 1, characterized in that, The graphics construction plan includes: several plan entries corresponding to each host graphics object to be created or updated; Each plan entry includes one or more of the following fields: plan entry identifier, semantic object identifier, host container, host graph object type, action type, port direction, endpoint reference, type constraint, layout anchor point, and failure fallback strategy; The host graphical object includes: graph, subgraph, block, port, connection, state machine object; and The layout anchor point is determined by the dependency edges, port directions, state machine carrier positions, and subgraph boundaries in the semantic relationship graph.

6. The artificial intelligence-assisted modeling method according to claim 1, characterized in that, The fields of the object mapping table include: semantic object identifier, model description language text location, plan entry identifier, host graphical object type, and host graphical object identifier.

7. The artificial intelligence-assisted modeling method according to claim 1, characterized in that, Before executing the graphical construction plan, the process also includes performing a host landing check on the target host environment, an endpoint closure check on the connection entries in the graphical construction plan, and an import closure check on the graphical model generated by executing the graphical construction plan through pre-simulation. The host landing check confirms whether the target container exists, whether the layer is available, whether the subgraph boundary is sufficient, whether the object ownership is unique, and whether the namespace conflicts. The endpoint closure check confirms whether the source end object, source port, target end object, target port, port direction, and port data type of each connection line are consistent with the semantic relationship graph. as well as The import closure check confirms whether there are unbound objects, isolated connections, unknown types, unclosed state machine transitions, or host graphical objects with unrecorded corresponding relationships in the simulated graphical model.

8. The artificial intelligence-assisted modeling method according to claim 7, characterized in that, A structured diagnostic report is generated when any of the machine verification access control, host landing check, endpoint closure check, or import closure check fails. The structured diagnostic report includes: failure location, failure object, failure access control, and reason for rejection.

9. An artificial intelligence-assisted modeling system, characterized in that, Includes a computer device, the computer device being configured to include: The receiving module is configured to receive modeling input and generate model description language text based on the modeling input. The collection module is configured to start from the entry file in the model description language text, and recursively collect all other model description language texts that are directly or indirectly referenced by the entry file through reference statements, forming a set of texts to be checked. The parsing module is configured to parse the model description language text in the text set and generate their respective abstract syntax trees. The verification module is configured to perform machine verification access control on the text set based on each of the abstract syntax trees; The building module is configured to construct a semantic relation graph based on the abstract syntax trees when the machine verifies the access control; and The generation module is configured to generate a graph construction plan based on the semantic relationship graph, and to generate a graphical model and an object correspondence table based on the graph construction plan, wherein the object correspondence table includes the correspondence between each semantic object in the semantic relationship graph and each host graphical object in the graphical model.

10. The artificial intelligence-assisted modeling system according to claim 9, characterized in that, The modeling inputs include one or more of the following: natural language requirements, interface table, state transition table, and algorithm description; The model description language text includes one or more of the following: model declaration, repository declaration, graph declaration, port declaration, connection declaration, type declaration, data object declaration, and state machine declaration.

11. The artificial intelligence-assisted modeling system according to claim 9, characterized in that, The graphics construction plan includes: several plan entries corresponding to each host graphics object to be created or updated; Each plan entry includes one or more of the following fields: plan entry identifier, semantic object identifier, host container, host graph object type, action type, port direction, endpoint reference, type constraint, layout anchor point, and failure fallback strategy; The host graphical object includes: graph, subgraph, block, port, connection, and state machine object; The layout anchor point is determined by the dependency edges, port directions, state machine carrier positions, and subgraph boundaries in the semantic relationship graph.

12. A non-transitory computer-readable storage medium, characterized in that, The system stores instructions that, when executed by a processor, cause the processor to perform the artificial intelligence-assisted modeling method according to any one of claims 1-8.

13. An electronic device, characterized in that, include: Non-transitory computer-readable storage medium; processor; The non-transitory computer-readable storage medium stores instructions that, when executed by a processor, cause the processor to perform the artificial intelligence-assisted modeling method according to any one of claims 1-8.

14. A computer program product, characterized in that, Includes instructions that, when executed by a processor, cause the processor to perform the artificial intelligence-assisted modeling method according to any one of claims 1-8.