System engineering simulation verification method based on Python simulation code

By automatically generating and associating Python simulation code in Capella system engineering modeling software and calling the Python interpreter to execute scripts, the problem that Capella does not support direct call of Python scripts is solved, and efficient and accurate support for system engineering simulation verification is achieved.

CN119987885AInactive Publication Date: 2025-05-13SHANGHAI PUGOUSHAN TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311497873.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-13
Publication Date
2025-05-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Capella system engineering modeling software does not support direct call of Python scripts, which makes it impossible to effectively utilize Python's powerful functions in system engineering simulation verification.

Method used

By automatically generating the Python simulation code in the Function function attribute interface in the Capella system engineering modeling software and associating it with the Function function module, calling the Python interpreter to execute the Python script, passing in the input parameters and obtaining the output parameters, and finally returning the result to Capella.

Benefits of technology

Capella implements the call and return of Python scripts, and makes full use of Python's functions to verify complex simulation models, improving the efficiency and accuracy of system engineering simulation verification.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The invention discloses a system engineering simulation verification method based on a Python simulation code, and the method comprises the following steps: 1, writing the Python simulation code in a Function function attribute interface in Caplla system engineering modeling software, and automatically generating the Python code based on the input and output parameters of a Function function module; step 2, in the Capella system engineering modeling software, using a Function function module to associate with a Python code; step 3, calling a Python interpreter to execute the Python script in the Caplla system engineering modeling software, introducing the input parameter, and obtaining an output parameter after executing the Python script; and step 4, returning the parameters executed by the Python interpreter to the Caphela, and completing system engineering simulation verification. The method has a wide application prospect, can be applied to the fields of industry, aviation, military and the like, has the advantages of simplicity, high efficiency, accuracy and the like, and can effectively improve the efficiency of system engineering simulation verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of system engineering simulation verification, and in particular to a system engineering simulation verification method based on Python simulation code. Background Art

[0002] With the rapid development of informatization and industrialization, the scale and complexity of system engineering are constantly increasing, so it is necessary to use simulation verification and other means to ensure the correctness and reliability of the system. System engineering simulation verification includes modeling, simulation and verification of system models to verify the performance, function and stability of the system during the design, development and implementation process.

[0003] In system engineering, Capella system engineering modeling software is a modeling software widely used in the field of system engineering. It has the characteristics of model reusability, model maintainability, and automatic document generation.

[0004] Python is a widely used high-level programming language. It can be used for various engineering simulation tasks because it supports a variety of computing tasks and data analysis. When using Capella for system engineering modeling, it is sometimes necessary to call Python simulation code to verify the correctness of the model. However, the Capella system does not support the function of directly calling Python scripts, so a new method is needed to solve this problem. Summary of the invention

[0005] The purpose of the present invention is to provide a method for system engineering simulation verification based on Python simulation code to solve the problems raised in the above background technology.

[0006] To achieve the above object, the present invention provides the following technical solution: comprising the following steps:

[0007] Step 1: In Capella system engineering modeling software, write Python simulation code in the Function property interface, and automatically generate Python code based on the input and output parameters of the Function module;

[0008] Step 2: In Capella system engineering modeling software, use the Function module to associate Python code;

[0009] Step 3: In the Capella system engineering modeling software, call the Python interpreter to execute the Python script, pass in the input parameters, and obtain the output parameters after executing the Python script;

[0010] Step 4: Return the parameters after the Python interpreter is executed to Capella to complete the system engineering simulation verification.

[0011] Preferably, the automatic generation of Python code in step one refers to using the name of the Function function module as the method name in the Python script, the input port as the Python function input parameter, and the output port as the Python function output parameter to automatically generate a Python script containing basic model information and transmission parameters.

[0012] Preferably, associating the Python code in step 2 refers to associating the Python code with the Function module, so that changes in the Python code can be monitored, identified and called by the Capella system engineering modeling software.

[0013] Preferably, the input parameters in step three refer to input parameters required for simulation verification set in Capella, including but not limited to variables, arrays, etc.

[0014] Preferably, the parameters in step 4 refer to the simulation verification result parameters returned to Capella after execution by the Python interpreter.

[0015] Compared with the prior art, the present invention has the following beneficial effects:

[0016] 1. The present invention can realize the call of Python script by Capella by associating the Python interpreter with the Capella system engineering modeling software, and transmit the result after execution back to Capella, so as to achieve the purpose of system engineering simulation verification. The advantage of the present invention is that it can make full use of the powerful function of Python to realize more complex simulation models, while not affecting the use of the Capella system engineering modeling software, and has a wide range of application prospects, and can be applied in the fields of industry, aviation, military, etc.

[0017] 2. The present invention also utilizes the Function function in the Capella system engineering modeling software to associate with the Python code, calls the Python interpreter to execute the Python script, and uses the Python interpreter to perform the simulation task, and outputs the simulation result to the system engineering simulation verification tool Capella, thereby realizing the simulation verification of the system engineering. This method has the advantages of simplicity, high efficiency, and accuracy, and can effectively improve the efficiency of the system engineering simulation verification. DETAILED DESCRIPTION

[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] Embodiment 1

[0020] The present invention provides a technical solution: a method for system engineering simulation verification based on Python simulation code, comprising the following steps:

[0021] Step 1: In Capella system engineering modeling software, write Python simulation code in the Function property interface, and automatically generate Python code based on the input and output parameters of the Function module;

[0022] Step 2: In Capella system engineering modeling software, use the Function module to associate Python code;

[0023] Step 3: In the Capella system engineering modeling software, call the Python interpreter to execute the Python script, pass in the input parameters, and obtain the output parameters after executing the Python script;

[0024] Step 4: Return the parameters after the Python interpreter is executed to Capella to complete the system engineering simulation verification.

[0025] The automatic generation of Python code in step 1 means that the name of the Function module is used as the method name in the Python script, the input port is used as the input parameter of the Python function, and the output port is used as the output parameter of the Python function, and a Python script containing basic model information and transmission parameters is automatically generated.

[0026] Associating Python code in step 2 means associating Python code with Function module so that changes in Python code can be monitored, identified and called by Capella system engineering modeling software.

[0027] The input parameters in step 3 refer to the input parameters required for setting simulation verification in Capella, including but not limited to variables, arrays, etc.

[0028] The parameters in step 4 refer to the simulation verification result parameters returned to Capella after the Python interpreter is executed. The simulation verification results can be displayed and analyzed in the Capella system engineering modeling software. The system engineering here refers to a system that contains multiple subsystems or modules and can be comprehensively simulated and verified. Simulation verification refers to verifying the performance and reliability of the system by simulating the system engineering.

[0029] Python code can be edited in Capella system engineering modeling software or Python editor, and third-party libraries and function libraries can be called for calculation and data processing;

[0030] The present invention also provides a system engineering simulation verification system for editing and calling Python simulation code in Capella, the system comprising:

[0031] Python simulation code editor: edit and store Python simulation codes written by system engineers;

[0032] Python simulation code listener: Synchronously monitors Python simulation code changes and synchronizes them to the Capella system;

[0033] Python simulation code executor: calls the Python interpreter to execute Python scripts and obtains execution parameters in real time;

[0034] Dynamic execution system interface: provides an entry for calling Python simulation code and receiving input parameters and output results.

[0035] The process of system engineering simulation verification includes but is not limited to the steps of system modeling, simulation verification, and simulation result analysis. System modeling includes but is not limited to building a system framework, designing system components, etc. Simulation verification includes but is not limited to simulating the system model, simulating the system operation status, evaluating the system performance, etc. Simulation result analysis includes but is not limited to processing, statistics and analysis of simulation data to evaluate the accuracy and reliability of the system model. The application scenarios of system engineering simulation verification include but are not limited to system development, system testing, system operation and maintenance, etc.

[0036] Embodiment 2

[0037] The present invention provides a technical solution: an embodiment of a method for system engineering simulation verification of calling Python simulation code, comprising the following steps:

[0038] Step 1: Create a Capella system engineering project, and create model elements such as Component and Function in the project;

[0039] Step 2: Based on the input and output port names and numbers of the Function function, the corresponding Python simulation code is automatically generated. The simulation code contains basic information such as the model and simulation parameters of the system to be simulated. The simulation algorithm needs to be expanded by the system engineer.

[0040] Step 3: After associating the written Python script with the Function in the Capella system engineering modeling software, start the Python simulation code listener. System engineers can modify it directly in the property interface of the Function, or modify the simulation code in the Python editor. The listener will monitor the changes of the Python simulation code and synchronize it to the Capella system.

[0041] Step 4: Run the written simulation call program dynamically in the system engineering simulation software Capella. The Python simulation code executor executes the simulation code through the PDB function of the Python interpreter, passes the simulation parameters and obtains the simulation results.

[0042] Capella system engineering modeling software refers to a software tool used for modeling, simulation and verification of system engineering. It has functions such as visual modeling, automatic model generation, and model simulation verification. The Python interpreter is called in the Capella system engineering modeling software to execute Python scripts, and the execution results of the Python interpreter are returned to the Capella system engineering modeling software for verification of system engineering simulation modeling. The Python scripts include but are not limited to simulation algorithms, data analysis algorithms, control algorithms, etc.

[0043] Capella system engineering modeling software includes but is not limited to Capella 1.4 and above

[0044] The association between Python script and Function in Capella system engineering modeling software is achieved by associating Function with Python script file address, where Python code can call other Python code for calculation and data processing.

[0045] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0046] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for system engineering simulation verification based on Python simulation code, comprising the following steps: Step 1: In Capella system engineering modeling software, write Python simulation code in the Function property interface, and automatically generate Python code based on the input and output parameters of the Function module; Step 2: In Capella system engineering modeling software, use the Function module to associate Python code; Step 3: In the Capella system engineering modeling software, call the Python interpreter to execute the Python script, pass in the input parameters, and obtain the output parameters after executing the Python script; Step 4: Return the parameters after the Python interpreter is executed to Capella to complete the system engineering simulation verification.

2. A method for system engineering simulation verification based on Python simulation code according to claim 1, characterized in that: The automatic generation of Python code in step 1 refers to using the name of the Function module as the method name in the Python script, the input port as the Python function input parameter, and the output port as the Python function output parameter to automatically generate a Python script containing basic model information and transmission parameters.

3. A method for system engineering simulation verification based on Python simulation code according to claim 1, characterized in that: Associating the Python code in step 2 refers to associating the Python code with the Function module so that changes in the Python code can be monitored, identified and called by the Capella system engineering modeling software.

4. A method for system engineering simulation verification based on Python simulation code according to claim 1, characterized in that: The input parameters in step 3 refer to the input parameters required for setting simulation verification in Capella, including but not limited to variables, arrays, etc.

5. The method for system engineering simulation verification based on Python simulation code according to claim 1, characterized in that: The parameters in step 4 refer to the simulation verification result parameters returned to Capella after the Python interpreter is executed.