A method and system for constructing a custom electromagnetic transient model from PSCAD to ADPSS
By using automated parsing and semantic mapping methods, PSCAD models are automatically converted into ADPSS models, solving the problem of low migration efficiency and achieving efficient and accurate cross-platform model resource reuse.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2026-04-08
- Publication Date
- 2026-06-19
AI Technical Summary
In existing technologies, migrating PSCAD custom electromagnetic transient models to the ADPSS platform is inefficient, relies on human experience, is prone to errors, and produces inconsistent results, making it difficult to achieve efficient and accurate cross-platform model resource reuse.
By parsing PSCAD project files, an abstract syntax tree is constructed, which is then automatically converted into ADPSS model component descriptions using a predefined semantic mapping rule base. C++ source code and XML configuration files conforming to the interface standard are automatically generated, and combined with an automatic compilation toolchain, the model can be automatically migrated.
It significantly improves model building efficiency, reduces human error, ensures the consistency and standardization of model results, and lowers the professional requirements for technical personnel.
Smart Images

Figure CN122240125A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electromagnetic transient simulation of power systems, and relates to a method and system for constructing a custom electromagnetic transient model from PSCAD to ADPSS. Background Technology
[0002] Electromagnetic transient simulation of power systems is crucial for analyzing system dynamic behavior and designing protection and control strategies. Power System Computer-Aided Design (PSCAD), as a leading international electromagnetic transient simulation software, boasts a massive user base and a rich library of custom models. These custom models are mostly written in FORTRAN and have undergone extensive engineering validation, demonstrating high maturity and accuracy.
[0003] The Advanced Digital Power System Simulator (ADPSS) is a large-scale, fully digital real-time simulation device independently developed in my country, possessing significant advantages in parallel computing, real-time simulation, and connection with physical devices. The development of its application ecosystem urgently requires the support of abundant model resources.
[0004] In practical research and engineering applications, there is often a need to migrate mature and accurate custom models from PSCAD to the ADPSS platform in order to utilize ADPSS's high-performance computing capabilities or to perform cross-platform simulation result comparison and verification. Currently, this migration work relies entirely on manual work by engineers.
[0005] PSCAD and ADPSS differ fundamentally in their model architecture: PSCAD custom models primarily use FORTRAN procedural programming; while ADPSS's model interface standard requires models to be implemented in a component-based manner, typically using C++. Therefore, the core of converting PSCAD custom models to the ADPSS platform lies in the conversion from FORTRAN to C++. However, general programming language conversion methods are not suitable for this scenario because the FORTRAN programming used in PSCAD incorporates unique rules specific to the PSCAD software, such as the use of specific arrays for memory allocation and storage.
[0006] Engineers need to manually read and understand the mathematical logic and control flow of the FORTRAN source code, manually construct the equivalent model structure in ADPSS, manually write C++ code to implement the computational logic, and ensure compliance with the ADPSS interface standard. Finally, they must repeatedly debug to ensure that the dynamic response of the model before and after the conversion is consistent. This process has obvious drawbacks: First, it is extremely inefficient, often taking days or even weeks to convert a complex model; second, it is highly dependent on the engineer's personal experience and technical level, making knowledge transfer difficult; third, it is very easy to introduce human error, as any oversight during code rewriting and state mapping can lead to distortion of model behavior, and the errors are hidden and difficult to detect; fourth, the consistency of results cannot be guaranteed, and the model structure and performance may differ between conversions completed by different engineers or by the same engineer at different times.
[0007] Therefore, developing a construction method that can replace manual labor and achieve high efficiency, accuracy, and standardization has become a key technological requirement for promoting the development of the domestic simulation software ecosystem and facilitating the reuse of model resources. Summary of the Invention
[0008] In view of this, the purpose of this invention is to provide a method and system for constructing a custom electromagnetic transient model from PSCAD to ADPSS.
[0009] To achieve the above objectives, the present invention provides the following technical solution: A method for constructing a custom electromagnetic transient model from PSCAD to ADPSS, comprising the following steps performed in sequence: S1: Parse PSCAD project files, identify and extract relevant information and source code of user-defined models; S2: Perform lexical and syntactic analysis on the source code of the custom model to construct an abstract syntax tree that represents the complete logical structure of the model, which serves as a machine-readable intermediate representation for subsequent semantic mapping; S3: Based on the predefined PSCAD-ADPSS semantic mapping rule base, it automatically traverses the abstract syntax tree, identifies state variables, computational logic and control flow, and maps them into model component descriptions that meet the requirements of the ADPSS platform. S4: Based on the generated model component description, connect to the preset code template and automatically generate C++ source code files and model description XML configuration files that conform to the ADPSS interface standard; S5: Automatically invokes the compilation toolchain to compile the generated C++ source code files into dynamic link library files.
[0010] Furthermore, S1 includes: S11: Parse PSCAD project files and locate and identify nodes in user-defined models; S12: Automatically extract the model's input / output port names and data types, parameter names, default values, and units from the nodes; S13: Read the model source code of the PSCAD project file.
[0011] Furthermore, in S1, the custom model source code is either source code directly written using FORTRAN within the model or source code of external function files called by the model using FORTRAN.
[0012] Furthermore, in S2, the construction of the abstract syntax tree involves generating a lexical analyzer and a syntax analyzer based on the syntax rules of the PSCAD source code, using the analyzers to analyze the source code, and generating a tree-like data structure containing modules, variable declarations, arithmetic expressions, logical expressions, and control flow statement nodes.
[0013] Furthermore, in S3, the semantic mapping rule base contains general syntax rules for FORTRAN and the C language used by external files, as well as special rules for PSCAD. By analyzing this rule base, the source code is mapped into model component descriptions that meet the requirements of the ADPSS platform.
[0014] Furthermore, in step S4, the code template predefines the structural framework of the ADPSS model C++ class, including an array of state variables, functional functions, and output calculation functions; when generating code, the model component description data output in step S3 is filled into the corresponding placeholders, and the final C++ source code file and model description XML configuration file are rendered.
[0015] Furthermore, in step S5, the invocation of the compilation toolchain includes configuring external compilation environment parameters and automatically invoking a C++ compiler to compile the C++ source code file generated in step S4 to generate a dynamic link library file.
[0016] A construction system for implementing the method includes: The file parser module is used to execute S1 and output model interface information, parameter data and source code. The parser module receives the output of the file parser module and uses it for S2; The semantic mapping module receives the abstract syntax tree generated by the parser module and is used to execute S3; The code generator module receives the model component description from the semantic mapping module and is used to execute S4; The compiler module receives the source code and configuration file from the code generator module and executes S5. The modules are connected in series to form an automated production line.
[0017] Furthermore, it also includes a graphical user interface module, which provides a model file upload interface, one-click conversion operation controls, real-time visualization of process progress and status at each stage, and outputs error messages when conversion fails.
[0018] The beneficial effects of this invention are as follows: (1) This invention significantly improves the efficiency of building custom models. The original manual conversion method requires engineers to spend several days or even weeks, while this invention can complete the conversion of complex models in a short time through automated pipeline operations, greatly shortening the model migration cycle.
[0019] (2) Traditional methods rely heavily on engineers’ understanding of FORTRAN code and familiarity with the ADPSS interface standard. In contrast, this invention solidifies the transformation logic in the semantic mapping rule base and code template, so that even relatively inexperienced technicians can quickly obtain a standard-compliant ADPSS model.
[0020] (3) By using an abstract syntax tree as an intermediate representation and employing a predefined semantic mapping rule base for automatic identification and conversion, omissions or misunderstandings that may occur when manually reading code are avoided, ensuring that state variables, computational logic and control flow are accurately mapped.
[0021] (4) Since the conversion process is executed automatically by the system according to fixed rules and templates, the output results of different batches of models are consistent in structure and behavior, which is conducive to the standardized management of model resources and cross-platform verification.
[0022] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0023] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein: Figure 1 This is a flowchart of the present invention; Figure 2 The simulation output curves of the original PSCAD composite control model; Figure 3 The output curve of the ADPSS model obtained by the construction method of the present invention is shown in the simulation curve. Detailed Implementation
[0024] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0025] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0026] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0027] The following will use three highly representative custom models in power system simulation—PID controller, first-order inertial element, and lead-lag compensator—as examples to describe the implementation of the present invention in more detail. It should be noted that the described embodiments are only a part of the application of the present invention, not all of it. Based on the core conversion process of the present invention, those skilled in the art can apply it to other types of PSCAD custom models.
[0028] like Figure 1 As shown, a method for constructing a custom electromagnetic transient model from PSCAD to ADPSS includes the following steps performed in sequence: (1) Parse the PSCAD project file, identify and extract relevant information and source code of the user-defined model.
[0029] PSCAD project files include .pscx files, external function .c or .f files, etc. The parser needs to accurately locate the XML nodes describing the user-defined model and extract basic model information, including: unique identifiers and data types of input / output ports, names, default values, and units of model parameters, and source code containing the actual algorithm logic. Specifically, the source code includes: FORTRAN code (and, if external function files are called, the code within those files should also be included). This step provides accurate input for subsequent analysis.
[0030] (2) Perform lexical and syntactic analysis on the source code of the custom model, and construct an abstract syntax tree that represents the complete logical structure of the model, which serves as a machine-readable intermediate representation for subsequent semantic mapping.
[0031] This invention provides a customized syntax analyzer for PSCAD custom modeling. This analyzer scans and analyzes the source code read in step (1), converting it into a series of lexical units, and then constructs an Abstract Syntax Tree (AST) based on grammatical rules. The AST is a tree-like data structure that discards irrelevant details such as spaces and comments from the source code, but precisely preserves the program's structured information. For example, an assignment statement, a function call, and an integration loop all have corresponding node types and subtree structures in the AST. This AST constitutes an intermediate representation of the original model logic and is the foundation for all subsequent automated processing.
[0032] (3) Based on the predefined PSCAD-ADPSS semantic mapping rule library, the abstract syntax tree is automatically traversed to identify state variables, computational logic and control flow, and mapped to model component descriptions that meet the requirements of the ADPSS platform.
[0033] The system has a built-in semantic mapping module and a mapping rule library. The module performs a depth-first traversal of the abstract syntax tree obtained in step (2) and triggers the corresponding rules in the mapping rule library according to the type of the encountered node. The specific rules are as follows: State variable mapping rule: This rule is triggered when the module identifies a variable representing a historical value reference (e.g., the previous time-step output variable appearing on the right-hand side of an equality sign in a difference equation), or when it identifies an array in FORTRAN used to store intermediate states. The module analyzes the variable's scope and lifetime, determining it to be a state variable in the PSCAD model. Subsequently, the module creates a corresponding state variable in the description built for the target ADPSS model and records the source of its initial value. Simultaneously, read and write operations on this state variable in the original FORTRAN code are mapped to accesses to state variables in the ADPSS model.
[0034] The computational logic mapping rule converts arithmetic expression nodes, logical judgment nodes, loop control nodes, etc. in the abstract syntax tree into semantically equivalent C++ code snippets one by one.
[0035] Interface mapping rule: Map the model input / output ports extracted in step (1) to the ADPSS model XML description file. <input> , <output>Tags, and the corresponding member variables or function parameters in the C++ code.
[0036] (4) Based on the generated model component description, access the preset code template and automatically generate C++ source code files and model description XML configuration files that conform to the ADPSS interface standard.
[0037] This invention employs template technology to achieve structured output, pre-setting C++ model class templates and a code generator that conform to the ADPSS interface standard. The template is a skeleton, with specific content to be filled in indicated by special markers ({{state_variables}}, {{derivative_calculations}}, etc.). The code generator uses the model component descriptions (list of state variables, derivative equation strings, output calculation expressions, etc.) generated in step (3) that conform to the ADPSS platform requirements as data to fill the corresponding positions in the template. Through template rendering, syntactically correct, formatted, and standard-compliant C++ source files and model description XML configuration files are automatically generated. This method separates the conversion logic from the code style, making the system easier to maintain and adapt to different versions of the ADPSS interface.
[0038] (5) Automatically call the compilation toolchain to compile the generated C++ source code file into a dynamic link library file.
[0039] The system automatically calls the preset C++ compilation command (for example, calling vcvarsall.bat of Microsoft Visual Studio), and passes in the necessary include paths, library paths and compilation options to compile the C++ source code file into a dynamic link library file.
[0040] The following example, using a composite control model in PSCAD consisting of PID control, first-order inertial filtering, and lead-lag compensation in series, further illustrates this construction method.
[0041] (1) Extract the interface information, parameter data, and corresponding source code of the custom model, including: Input signal port: one, identified as $e1 (representing error signal input).
[0042] Output signal port: one, identified as $u1 (representing controller output).
[0043] Model parameters: seven in total, namely proportional coefficient $Kp, integral coefficient $Ki, derivative coefficient $Kd, sampling time $Ts, output filter time constant $Tf, first-stage inertia time constant $T1, and second-stage lead / lag time constant $T2.
[0044] FORTRAN source code: #STORAGE REAL:5 #LOCAL REAL kp, ki, kd, ts, tf, t1, t2 #LOCAL REAL e, e_prev, u, u_p, u_i, u_d, u_i_prev #LOCAL REAL u_f, u_f_prev, v, v_prev, y, y_prev IF (TIMEZERO) THEN STORF(NSTORF+0) = 0.0 STORF(NSTORF+1) = 0.0 STORF(NSTORF+2) = 0.0 STORF(NSTORF+3) = 0.0 STORF(NSTORF+4) = 0.0 ENDIF e = $e1 kp = $Kp ki = $Ki kd = $Kd ts = $Ts tf = $Tf t1 = $T1 t2 = $T2 u_i_prev = STORF(NSTORF+0) e_prev = STORF(NSTORF+1) u_f_prev = STORF(NSTORF+2) v_prev = STORF(NSTORF+3) y_prev = STORF(NSTORF+4) u_p = kp e u_i = u_i_prev + ki ts 0.5 (e + e_prev) u_d = kd v = v_prev + (ts / t2) (u - v_prev) y = y_prev + (ts / t1) (v - y_prev) u_f = u_f_prev + (ts / tf) (y - u_f_prev) $u1 = u_f STORF(NSTORF+0) = u_i STORF(NSTORF+1) = e STORF(NSTORF+2) = u_f STORF(NSTORF+3) = v STORF(NSTORF+4) = y (2) Perform automated lexical and syntactic analysis on the extracted FORTRAN source code and construct its abstract syntax tree.
[0045] Lexical analysis: transforms the source code character stream into a series of meaningful lexical units, such as keywords (#STORAGE, IF, THEN), identifiers (kp, u_i_prev), and operators ( , +, =), constants (0.0, 5, 0.5) and special symbols ($, :).
[0046] Syntax analysis: Based on grammatical rules, the sequence of lexical units is organized into an abstract syntax tree (AST). The AST includes the following key structures: A storage declaration node: corresponding to #STORAGE REAL:5, indicating that the model has requested storage space for 5 real numbers.
[0047] An initialization logic branch: a subtree rooted at IF (TIMEZERO) THEN, containing 5 child nodes that assign values to the STORF array.
[0048] A sequence of multiple assignment statement nodes constitutes the main computational logic of the model. Each assignment node contains an lvalue (the variable being assigned) and an rvalue (an expression subtree). For example, for the statement u_i = u_i_prev + ki... ts 0.5 (e + e_prev) has an AST node that clearly shows that this is an addition operation. The two operands of the addition are the variable u_i_prev and a complex multiplication expression subtree. This multiplication subtree is further decomposed into ki, ts, 0.5 and an addition expression (e + e_prev).
[0049] Specific function / array access nodes: Read and write operations on STORF (NSTORF+X) are recognized as accesses to specific storage locations.
[0050] Input / output and parameter mapping nodes: $e1, $Kp, etc. are recognized as symbolic references pointing to external interfaces.
[0051] (3) Automatically traverse the abstract syntax tree and map it to the model component description required by the ADPSS platform based on the predefined PSCAD-ADPSS semantic mapping rule library.
[0052] State Variable Identification and Explicit Mapping: The module first processes the #STORAGE REAL:5 declaration and subsequent access to the STORF array. Rules in the mapping rule base are triggered. The module analysis reveals that the five storage locations STORF(NSTORF+0) to STORF(NSTORF+4) are continuously read and written between simulation steps (e.g., u_i_prev = STORF(NSTORF+0) is used to read the value from the previous time step, and STORF(NSTORF+0) = u_i is used to update the current value). Their function is to maintain the continuity of data across time steps, and therefore they are identified as the five state variables of the model. Subsequently, according to the rules, the module creates continuous state variables with unique identifiers for each of these five states in the description constructed for the target ADPSS model, for example: state_0: The integral term u_i corresponding to the PID state_1: The error e_prev corresponding to the previous simulation step state_2: Corresponds to the final output filter value u_f state_3: Corresponding intermediate variable v state_4: Corresponding intermediate variable y Mapping between computational logic and interfaces: Algebraic operations (e.g., u_p = kp) e, u = u_p + u_i + u_d) are directly converted into equivalent C++ expressions. At the same time, the input port $e1 is mapped to the input variable inputs[0] of the ADPSS model, the output port $u1 is mapped to the output variable outputs[0], and all parameters with the $ prefix are mapped to the model's configuration parameters parameters[0] to parameters[6].
[0053] (4) Access the preset code template and automatically generate C++ source code files and model description XML configuration files that conform to the ADPSS interface standard.
[0054] The system pre-stores a C++ model class template file that conforms to the ADPSS FMI interface standard. This template defines the complete function framework required by the ADPSS model (such as InitProportional, StepProportional, TerminateProportional, etc.) and the skeleton of the XML configuration file, and includes parameterized placeholders in key locations.
[0055] The generator injects model description data as context variables into the template. The template then renders dynamically based on this, automatically generating five key files: PID_Cascade_ADPSS.h: A C++ header file that declares interface functions.
[0056] PID_Cascade_ADPSS.cpp: C++ source file, fully implementing all interface functions.
[0057] PID_Cascade_Model.h: A C++ header file that defines the model class and declares the model functions.
[0058] PID_Cascade_Model.cpp: A C++ source file containing model functions that fully implement all the functionalities of a custom model.
[0059] PID_Cascade_ADPSS.xml: An XML configuration file that describes the model name, version information, and lists the definitions of all inputs, outputs, parameters, and state variables.
[0060] (5) Automatically call the compilation toolchain to compile the generated C++ source code file into a dynamic link library file.
[0061] After the C++ source code files are generated, the build and deployer module takes over the generated files, automatically calling the pre-configured compiler (vcvarsall.bat in Microsoft Visual Studio) and passing in predefined compilation options (cl / LD / O2 / arch:IA32, / D WIN32 / D _WINDOWS / D _USRDLL / D EXPORTS), include path (pointing to ADPSS), and library path. The C++ source code files are then compiled and linked into the dynamic link library file PID_Cascade_ADPSS.dll. The module then creates a temporary directory and packages the successfully compiled PID_Cascade_ADPSS.dll, PID_Cascade_ADPSS.xml, and documentation resources into a self-contained model resource package.
[0062] Simulation results of the composite control model consisting of PID control, first-order inertial filtering, and lead-lag compensation in PSCAD are as follows: Figure 2 As shown, the simulation results of the ADPSS corresponding model obtained after using the method of the present invention are as follows: Figure 3 As shown, 10,000 uniformly sampled points were selected within the simulation time of 0-0.5s. Using the PSCAD model output $u1 as a benchmark, the relative error of the corresponding output of the ADPSS model was calculated. The verification results show that the average relative error is ≤2%, meeting the engineering accuracy requirements, proving that the method of this invention is effective. Furthermore, corresponding software can be developed to integrate the custom model construction method described in this invention.
[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.< / output>
Claims
1. A method for constructing a custom electromagnetic transient model from PSCAD to ADPSS, characterized in that: The steps are executed in the following order: S1: Parse PSCAD project files, identify and extract relevant information and source code of user-defined models; S2: Perform lexical and syntactic analysis on the source code of the custom model to construct an abstract syntax tree that represents the complete logical structure of the model, which serves as a machine-readable intermediate representation for subsequent semantic mapping; S3: Based on the predefined PSCAD-ADPSS semantic mapping rule base, it automatically traverses the abstract syntax tree, identifies state variables, computational logic and control flow, and maps them into model component descriptions that meet the requirements of the ADPSS platform. S4: Based on the generated model component description, connect to the preset code template and automatically generate C++ source code files and model description XML configuration files that conform to the ADPSS interface standard; S5: Automatically invokes the compilation toolchain to compile the generated C++ source code files into dynamic link library files.
2. The method for constructing a custom electromagnetic transient model from PSCAD to ADPSS according to claim 1, characterized in that: S1 includes: S11: Parse PSCAD project files and locate and identify nodes in user-defined models; S12: Automatically extract the model's input / output port names and data types, parameter names, default values, and units from the nodes; S13: Read the model source code of the PSCAD project file.
3. The method for constructing a custom electromagnetic transient model from PSCAD to ADPSS according to claim 1, characterized in that: In S1, the custom model source code is either the source code directly written using FORTRAN within the model or the source code of external function files called by the model using FORTRAN.
4. The method for constructing a custom electromagnetic transient model from PSCAD to ADPSS according to claim 1, characterized in that: In step S2, the construction of the abstract syntax tree involves generating a lexical analyzer and a syntax analyzer based on the syntax rules of the PSCAD source code, and using the analyzers to analyze the source code to generate a tree-like data structure containing modules, variable declarations, arithmetic expressions, logical expressions, and control flow statement nodes.
5. The method for constructing a custom electromagnetic transient model from PSCAD to ADPSS according to claim 1, characterized in that: In S3, the semantic mapping rule base contains general syntax rules for the C language used by FORTRAN and external files, as well as special rules for PSCAD. By analyzing this rule base, the source code is mapped into model component descriptions that meet the requirements of the ADPSS platform.
6. The method for constructing a custom electromagnetic transient model from PSCAD to ADPSS according to claim 1, characterized in that: In step S4, the code template predefines the structural framework of the ADPSS model C++ class, including an array of state variables, functional functions, and output calculation functions. When generating code, the model component description data output in step S3 is filled into the corresponding placeholders, and the final C++ source code file and model description XML configuration file are rendered.
7. The method for constructing a custom electromagnetic transient model from PSCAD to ADPSS according to claim 1, characterized in that: In step S5, the invocation of the compilation toolchain includes configuring external compilation environment parameters and automatically invoking a C++ compiler to compile the C++ source code file generated in step S4 to generate a dynamic link library file.
8. A construction system for implementing the method of any one of claims 1 to 7, characterized in that: include: The file parser module is used to execute S1 and output model interface information, parameter data and source code. The parser module receives the output of the file parser module and uses it for S2; The semantic mapping module receives the abstract syntax tree generated by the parser module and is used to execute S3; The code generator module receives the model component description from the semantic mapping module and is used to execute S4; The compiler module receives the source code and configuration file from the code generator module and executes S5. The modules are connected in series to form an automated production line.
9. The construction system according to claim 8, characterized in that: It also includes a graphical user interface module, which provides a model file upload interface, one-click conversion operation controls, real-time visualization of process progress and status at each stage, and outputs error messages when conversion fails.