Aero-engine simulation method, device, equipment, storage medium and program product

By obtaining the documentation information of external dynamic link libraries, generating target adaptation functions, and compiling the adaptation dynamic link libraries, the problem of insufficient scalability in aero-engine simulation systems is solved, and simulation efficiency and system scalability are improved.

CN120068396BActive Publication Date: 2025-11-25TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510046603.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2025-11-25
Estimated Expiration
2045-01-13

AI Technical Summary

Technical Problem

Existing aero-engine simulation systems lack scalability, failing to pre-adapt all external dynamic link library functions during the compilation phase, leading to increased development costs and low simulation efficiency.

Method used

By obtaining the documentation information of the external dynamic link library, a target adapter function is generated to be compatible with the input and output formats of the simulation system and the external dynamic link library. Based on the historical compilation situation, it is decided whether to compile the target adapter function and generate an adapter dynamic link library to realize data interaction and avoid repeated construction.

Benefits of technology

It improves the scalability and simulation efficiency of the aero-engine simulation system, reduces code redundancy, and enhances the flexibility and scalability of the simulation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120068396B_ABST
    Figure CN120068396B_ABST
Patent Text Reader

Abstract

The application relates to an aero-engine simulation method, device, equipment, storage medium and program product. The method comprises the following steps: acquiring specification file information of an external dynamic link library, the external dynamic link library being a packaged simulation algorithm; generating a target adaptation function according to the specification file information, the target adaptation function being used for compatibility of input and output formats of a simulation system and input and output formats of the external dynamic link library; if it is determined according to historical compilation conditions that the target adaptation function needs to be compiled, acquiring a target compiler, and generating an adaptation dynamic link library according to the target compiler and the target adaptation function; and completing data interaction with the external dynamic link library according to the adaptation dynamic link library, so as to realize simulation of the aero-engine. The method can improve the expansibility of the aero-engine simulation system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of aero-engine simulation technology, and in particular to an aero-engine simulation method, apparatus, equipment, storage medium, and program product. Background Technology

[0002] In the process of aero-engine simulation, the main software of the simulation system can call multiple external dynamic link libraries to improve the reusability and scalability of the simulation system. However, since different external dynamic link libraries may have different input parameter types, number of parameters, and output parameter types when encapsulating simulation algorithms, the main software cannot pre-adapt all possible external dynamic link library functions during the compilation stage, which affects the scalability of the simulation system to a certain extent.

[0003] In existing technologies, by agreeing on the input and output formats of external dynamic link library functions, that is, specifying the input parameter types and number of parameters, as well as the output parameter types, the main software can determine the function form of the external dynamic link library to be called during the compilation process.

[0004] However, with the increasing number of business scenarios, the development cost of external dynamic link libraries in existing technologies has increased, and the scalability of aero-engine simulation systems still needs to be improved. Summary of the Invention

[0005] Therefore, it is necessary to provide an aero-engine simulation method, apparatus, equipment, storage medium, and program product that can improve the scalability of aero-engine simulation systems in response to the above-mentioned technical problems.

[0006] Firstly, this application provides an aero-engine simulation method for use in an aero-engine simulation system, comprising:

[0007] Obtain the documentation information for the external dynamic link library, which is a packaged simulation algorithm;

[0008] The target adaptation function is generated based on the information in the specification document. The target adaptation function is used to ensure compatibility with the input and output formats of the simulation system and the input and output formats of the external dynamic link library.

[0009] If it is determined from historical compilation data that the target adapter function needs to be compiled, then obtain the target compiler and generate an adapter dynamic link library based on the target compiler and the target adapter function;

[0010] By adapting the dynamic link library, data interaction with external dynamic link libraries is completed, enabling the simulation of aero-engines.

[0011] In one embodiment, determining whether the target adapter function needs to be compiled based on historical compilation data includes:

[0012] Obtain the adapter function cache file, which stores the status list of compiled or loaded adapter functions. If the adapter function cache file does not contain the target adapter function, or if the status of the target adapter function in the adapter function cache file does not meet the preset conditions, then it is determined that the target adapter function needs to be compiled.

[0013] In one embodiment, obtaining the target compiler and generating an adapted dynamic link library based on the target compiler and the target adaptor function includes:

[0014] Obtain the target compiler based on the programming language of the target adaptation function; compile the target adaptation function using the target compiler to generate an adaptation dynamic link library.

[0015] In one embodiment, a target adapter function is generated based on specification document information. This target adapter function is used to ensure compatibility with the input / output formats of external dynamic link libraries, including:

[0016] Obtain the adaptation function template, which includes a first adaptation function that adapts to the input and output format of the simulation system; generate a second adaptation function based on the specification file information and the preset loading function, wherein the input and output format of the second adaptation function adapts to the input and output format of the external dynamic link library;

[0017] The target adaptation function is determined based on the first and second adaptation functions.

[0018] In one embodiment, the documentation information of the external dynamic link library includes the file name and function information of the external dynamic link library. The function information includes the function name, function input information and function return value information. The function input information includes the input parameter name, parameter type and description information.

[0019] In one embodiment, a second adapter function is generated based on the specification document information and a preset loading function, including:

[0020] Generate a loading method for the external dynamic link library based on the file name and the preset loading function; determine the function type of the second adapter function and the calling method of the external dynamic link library based on the function input information; determine the second adapter function based on the loading method, function type, and calling method.

[0021] In one embodiment, data interaction with an external dynamic link library is completed based on an adapted dynamic link library to achieve simulation of an aero-engine, including:

[0022] It calls the adapter dynamic link library and completes data interaction with the external dynamic link library based on the adapter dynamic link library; it receives the continue call instruction and updates the status of the target adapter function in the adapter function cache file according to the continue call instruction. The continue call instruction is used to indicate whether to continue calling the adapter dynamic link library.

[0023] Secondly, this application also provides an aero-engine simulation device for use in an aero-engine simulation system, comprising:

[0024] The acquisition module is used to obtain the documentation information of external dynamic link libraries, which are encapsulated simulation algorithms.

[0025] The generation module is used to generate target adaptation functions based on the information in the specification document. The target adaptation functions are used to be compatible with the input and output formats of the simulation system and the input and output formats of external dynamic link libraries.

[0026] The compilation module is used to obtain the target compiler if it is determined from the historical compilation situation that the target adapter function needs to be compiled, and to generate the adapter dynamic link library based on the target compiler and the target adapter function;

[0027] The simulation module is used to complete data interaction with external dynamic link libraries based on the adapted dynamic link library, so as to realize the simulation of aero-engines.

[0028] In one embodiment, the compilation model is specifically used to obtain an adapter function cache file, which is used to store a list of states of compiled or loaded adapter functions; if the adapter function cache file does not contain the target adapter function, or if the state corresponding to the target adapter function in the adapter function cache file does not meet the preset conditions, then it is determined that the target adapter function needs to be compiled.

[0029] In one embodiment, the compilation module is specifically used to obtain a target compiler based on the programming language of the target adapter function; and to compile the target adapter function according to the target compiler to generate an adapter dynamic link library.

[0030] In one embodiment, the generation module is specifically used to obtain an adaptation function template, which includes a first adaptation function adapted to the input and output format of the simulation system; generate a second adaptation function based on the specification document information and a preset loading function, wherein the input and output format of the second adaptation function is adapted to the input and output format of the external dynamic link library; and determine a target adaptation function based on the first and second adaptation functions.

[0031] In one embodiment, the documentation information of the external dynamic link library includes the file name and function information of the external dynamic link library. The function information includes the function name, function input information and function return value information. The function input information includes the input parameter name, parameter type and description information.

[0032] In one embodiment, the generation module is specifically used to generate a loading method for an external dynamic link library based on the file name and a preset loading function; determine the function type of the second adapter function and the calling method of the external dynamic link library based on the function input information; and determine the second adapter function based on the loading method, function type, and calling method.

[0033] In one embodiment, the simulation module is specifically used to call the adapter dynamic link library, complete the data interaction with the external dynamic link library according to the adapter dynamic link library; receive the continue call instruction, and update the status of the target adapter function in the adapter function cache file according to the continue call instruction. The continue call instruction is used to indicate whether to continue calling the adapter dynamic link library.

[0034] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any of the methods described in the first aspect above.

[0035] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the methods described in the first aspect above.

[0036] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements any of the methods described in the first aspect above.

[0037] The aforementioned aero-engine simulation method, apparatus, equipment, storage medium, and program product first obtain the specification information of an external dynamic link library (DLL), which encapsulates the simulation algorithm. Then, a target adapter function is generated based on the specification information. This target adapter function is used to ensure compatibility between the input / output formats of the simulation system and the input / output formats of the external DLL. Next, if historical compilation data indicates that the target adapter function needs to be compiled, a target compiler is obtained. An adapter DLL is generated based on the target compiler and the target adapter function. Finally, data interaction with the external DLL is completed using the adapter DLL, thus achieving aero-engine simulation. By generating target adapter functions compatible with various input / output formats based on the external DLL's specification information, and then compiling these target adapter functions to obtain the adapter DLL, the scalability of the simulation system is improved without modifying the main software or the external DLL. Furthermore, determining whether to compile the target adapter function based on historical compilation data during the compilation process avoids the problem of repeatedly building the adapter DLL during simulation, effectively improving simulation efficiency. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 This is a flowchart illustrating an aero-engine simulation method in one embodiment;

[0040] Figure 2 This is a flowchart illustrating the steps required to compile the target adapter function based on historical compilation data in one embodiment.

[0041] Figure 3 This is a flowchart illustrating the steps of generating an adapted dynamic link library in one embodiment.

[0042] Figure 4 This is a flowchart illustrating the steps for generating the target adaptation function in one embodiment;

[0043] Figure 5 This is a flowchart illustrating the steps of generating a second adapter function based on specification document information and a preset loading function in one embodiment.

[0044] Figure 6This is a flowchart illustrating the steps of completing data interaction with the external dynamic link library based on the adapted dynamic link library in one embodiment.

[0045] Figure 7 This is a flowchart illustrating the aero-engine simulation method in another embodiment;

[0046] Figure 8 This is a structural block diagram of an aero-engine simulation device in one embodiment;

[0047] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0049] In the process of aero-engine simulation, the main software of the simulation system can call multiple external dynamic link libraries to improve the reusability and scalability of the simulation system. However, since different external dynamic link libraries may have different input parameter types, number of parameters, and output parameter types when encapsulating simulation algorithms, the main software cannot pre-adapt all possible external dynamic link library functions during the compilation stage, which affects the scalability of the simulation system to a certain extent.

[0050] In existing technologies, by agreeing on the input and output formats of external dynamic link library functions, that is, specifying the input parameter types and number of parameters, as well as the output parameter types, the main software can determine the function form of the external dynamic link library to be called during the compilation process.

[0051] However, with the increasing number of business scenarios, the development cost of external dynamic link libraries in existing technologies has increased, and the scalability of aero-engine simulation systems still needs to be improved.

[0052] Another approach is to customize the calling functions based on the characteristics of external dynamic link libraries (DLLs), enabling adaptation of DLL function calls and data transfer. The advantage of this method is that both the main software and the DLL can be developed according to their respective needs without needing to concern themselves with their interaction methods. The disadvantage is that this method requires specialized personnel to parse DLL function information and perform data type conversions. When the external DLL changes, existing customization tools face the risk of recoding, reducing the integration efficiency of the main software with external tools, and its scalability still needs improvement.

[0053] In view of this, this application provides an aero-engine simulation method to improve the scalability of an aero-engine simulation system. The aero-engine simulation method provided in this application can be used in an aero-engine simulation system. The simulation system can be a software system including main software, and its execution entity can be an aero-engine simulation device. This aero-engine simulation device can be implemented through software, hardware, or a combination of both. It can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device in software form. In the following method embodiments, the execution entity is a computer device as an example for description. The computer device can be a server or a computer; this application does not limit the specific type of computer device.

[0054] In one exemplary embodiment, such as Figure 1 As shown, an aero-engine simulation method is provided. Taking the application of this method to an aero-engine simulation system as an example, the method includes the following steps 101 to 104. Wherein:

[0055] Step 101: Obtain the documentation information for the external dynamic link library.

[0056] The external dynamic link library is a packaged simulation algorithm.

[0057] Optionally, an external dynamic link library can be an externally integrated dynamic link library that the simulation system can call. A dynamic link library (DLL) can be a library file containing code and data that can be used by multiple programs simultaneously. The file extension of these library functions is usually ".dll", or other forms such as ".ocx" or ".drv". The main function of dynamic link libraries is to realize code sharing and modular development. By encapsulating commonly used functions or resources in dynamic link libraries, different applications can share this code and data, which can reduce redundancy and improve system efficiency.

[0058] Optionally, a dynamic link library can be called by other dynamic link libraries or applications.

[0059] Optionally, the documentation information for external dynamic link libraries can be generated by the developers of the dynamic link libraries, or it can be generated by a simulation system through parsing external dynamic link libraries. This application embodiment does not limit this.

[0060] Optionally, the documentation information for the external dynamic link library includes the file name and function information of the external dynamic link library. The function information includes the function name, function input information, and function return value information. The function input information includes the input parameter name, parameter type, and description information.

[0061] Optionally, the information included in the documentation is not limited to the above content, and information may be supplemented or tailored according to specific business needs.

[0062] Optionally, the file format of the explanatory document information is not limited in this embodiment. The file format of the explanatory document information and the file format parsing tool can be determined according to specific business needs. For example, the file format of the explanatory document information can be JSON format, or txt format, etc.

[0063] Step 102: Generate the target adaptation function based on the information in the documentation.

[0064] The target adaptation function is used to ensure compatibility between the input / output formats of the simulation system and the input / output formats of external dynamic link libraries.

[0065] Optionally, the target adapter function can be a type of function used to ensure that the code in an external dynamic link library and the application or other modules that call the external dynamic link library can work together well. The target adapter function acts as a bridge between the internal implementation of the external dynamic link library and the simulation system. By encapsulating the complex functional logic inside the external dynamic link library and presenting it in an interface form that meets the expectations of the simulation system, the target adapter function can also handle the conversion and transmission of data formats when data interaction occurs between the external dynamic link library and the simulation system. Different modules may use different data representation methods or data structures. The target adapter function can convert the data inside the external dynamic link library into a format that the simulation system can understand and use, and vice versa. That is, the target adapter function can be compatible with both the input and output formats of the simulation system and the input and output formats of the external dynamic link library.

[0066] Optionally, the target adaptation function may include two main parts: one part is used to interact with the simulation system, and the other part is used to call external dynamic link libraries. When calling the external dynamic link library, the input format of the simulation system can be converted into the input format corresponding to the external dynamic link library. Then, the external dynamic link library is called according to the converted input format, and the result returned by the external dynamic link library is converted into the output format corresponding to the simulation system, thereby feeding the result back to the simulation system.

[0067] Optionally, when generating the target adapter function, it is necessary to generate the target adapter function based on the file name and function information in the documentation of the external dynamic link library.

[0068] It is understandable that the input and output format of the simulation system can be fixed, that is, the parts that different target adaptation functions interact with the simulation system are the same, the difference lies in the part that calls the external dynamic link library. Therefore, when generating the target adaptation function, the part that calls the external dynamic link library can be obtained from the documentation of the external dynamic link library.

[0069] It is understood that the documentation information in this application embodiment is used to provide information about the external dynamic link library adapter and does not participate in the subsequent generation and use of the adapted dynamic link library.

[0070] Step 103: If it is determined from the historical compilation situation that the target adapter function needs to be compiled, then obtain the target compiler and generate the adapter dynamic link library based on the target compiler and the target adapter function.

[0071] Optionally, when calling external dynamic link libraries, there may be a problem of repeatedly building the adapter dynamic link library. For aero-engine simulation processes with high timeliness requirements, this can reduce solution efficiency. There is also the problem of process occupancy preventing the adapter dynamic link library from being used in a timely manner, thus causing the external dynamic link library to be unable to be scheduled normally by the simulation system's main software. To avoid the problem of repeatedly building the adapter dynamic link library during simulation, this embodiment checks the historical compilation status of the target adapter function before compiling it, and determines whether the target adapter function needs to be compiled based on the historical compilation status.

[0072] Understandably, if historical compilation data indicates that the target adapter function has not been compiled, the target compiler should be obtained to compile the target adapter function to obtain the adapter dynamic link library. If historical compilation data indicates that the target adapter function has been compiled, then no compilation is required, and the corresponding adapter dynamic link library can be loaded and called.

[0073] Optionally, the historical compilation information can be the historical compilation information of the target adapter function, or it can include the historical compilation information of all adapter functions in the simulation system. This application embodiment does not limit this.

[0074] Optionally, compiling the target adaptation function into an adaptation dynamic link library can also reduce redundancy in the simulation system and improve efficiency.

[0075] Step 104: Complete the data interaction with the external dynamic link library based on the adapted dynamic link library to realize the simulation of the aero-engine.

[0076] Optionally, an external dynamic link library can correspond to a specification file. Based on the specification file, a target adapter function for the external dynamic link library corresponding to that specification file is generated. It can be understood that the simulation system can call multiple external dynamic link libraries. Each time an external dynamic link library is called, a target adapter function may be generated. In this way, the simulation system can complete the call to the external dynamic link library by calling the adapter dynamic link library corresponding to the target adapter function.

[0077] The aforementioned aero-engine simulation method first obtains the specification file information of an external dynamic link library (DLL), which encapsulates the simulation algorithm. Then, a target adapter function is generated based on the specification file information. This target adapter function is used to ensure compatibility between the input / output formats of the simulation system and the input / output formats of the external DLL. Next, if historical compilation data indicates that the target adapter function needs to be compiled, a target compiler is obtained. An adapter DLL is then generated based on the target compiler and the target adapter function. Finally, data interaction with the external DLL is completed using the adapter DLL, thus achieving aero-engine simulation. By generating target adapter functions compatible with various input / output formats based on the external DLL's specification file information, and then compiling these target adapter functions to obtain the adapter DLL, the scalability of the simulation system is improved without modifying the main software or the external DLL. Furthermore, by determining whether to compile the target adapter function based on historical compilation data during the compilation process, the problem of repeatedly building the adapter DLL during simulation can be avoided, effectively improving simulation efficiency.

[0078] In one exemplary embodiment, such as Figure 2 As shown, optionally, the need to compile the target adapter function can be determined based on historical compilation data, including the following steps 201 to 202. Wherein:

[0079] Step 201: Obtain the adapter function cache file.

[0080] The adapter function cache file is used to store a list of states for compiled or loaded adapter functions.

[0081] Optionally, historical compilation information can be stored in an adapter function cache file. This cache file can be stored in a database or in a cache. When stored in the cache, the efficiency of obtaining historical compilation information is improved when determining whether to compile the target adapter function based on historical compilation information.

[0082] Optionally, the adapter function cache file can be in list form to store the status of multiple compiled or loaded adapter functions. This application embodiment does not limit the storage format of the adapter status. For example, the status of the adapter functions in the list can be stored in JSON format. The storage format of an adapter function is as follows: {“demo.dll”:{“isCompiled”:true,“isLoaded”:true,...}...}, where “demo.dll” can be the name or unique identifier of the adapter function; “isCompiled” indicates whether it is compiled, and the corresponding value can be true or false. When “isCompiled” is true, it indicates that it has been compiled; when “isCompiled” is false, it indicates that it has not been compiled. “isLoaded” indicates whether it is loaded, and the corresponding value can be true or false. When “isLoaded” is true, it indicates that it has been loaded; when “isLoaded” is false, it indicates that it has not been loaded.

[0083] Step 201: If the target adapter function is not included in the adapter function cache file, or if the state corresponding to the target adapter function in the adapter function cache file does not meet the preset conditions, then it is determined that the target adapter function needs to be compiled.

[0084] Optionally, the target adapter function can be searched in the adapter cache file based on its name or unique identifier to determine whether the target adapter function is included in the adapter function cache file. If the target adapter function is not included in the adapter function cache file, then the target adapter function needs to be compiled.

[0085] Optionally, if the adapter function cache file includes the target adapter function, then the status of the target adapter function is obtained. The default condition can be that it has been compiled, or the value of the "isCompiled" field in the status of the target adapter function is false. If the compilation status of the target adapter function is not compiled, then the target adapter function needs to be compiled. If the compilation status of the target adapter function is not compiled, then the target adapter function does not need to be compiled.

[0086] The above-mentioned method obtains a cache file of adaptor functions. This cache file stores a list of states for compiled or loaded adaptor functions. If the cache file does not contain the target adaptor function, or if the state of the target adaptor function in the cache file does not meet preset conditions, then it is determined that the target adaptor function needs to be compiled. In this way, determining whether compilation is necessary based on the compilation state of the target adaptor function avoids the problem of repeatedly building adaptor dynamic link libraries during simulation, effectively improving simulation efficiency.

[0087] In one exemplary embodiment, such as Figure 3 As shown, optionally, the target compiler is obtained, and an adapter dynamic link library is generated based on the target compiler and the target adapter function, including the following steps 301 to 302. Wherein:

[0088] Step 301: Obtain the target compiler based on the programming language of the target adaptation function.

[0089] Optionally, the operating system of the simulation system can be obtained, and then the appropriate target compiler can be determined according to the programming language of the target adapter function. For example, when the target adapter function is developed based on the C++ programming language under the Windows operating system, the Visual C++ compiler can be selected as the target compiler; when the target adapter function is developed based on the C programming language under the Linux operating system, GCC can be selected as the target compiler; when developed based on the Java programming language, the compiler that comes with the JDK is usually used as the target compiler. This application embodiment does not limit this.

[0090] Optionally, a compiler is integrated into the simulation system's integrated development environment. After determining the target compiler, the corresponding target compiler can be obtained from the integrated development environment to compile the target adaptation function.

[0091] Step 302: Compile the target adapter function according to the target compiler to generate the adapter dynamic link library.

[0092] Optionally, when compiling the target adapter function, the declaration, parameter types, return type, etc. of the target adapter function can be determined, and the source code of the target adapter function and other source files and header files that may depend on it can be organized to ensure the correctness and completeness of the target adapter function's code.

[0093] Optionally, the target compiler option configuration is obtained according to the requirements of the target compiler, and then the compilation script is obtained and executed to generate the adapted dynamic link library. For example, when generating the adapted dynamic link library, the "-shared" option is used in GCC according to the target compiler option configuration, and optimization options, debugging options, etc. are configured according to the target compiler option configuration. After the configuration is completed, the compilation script is executed.

[0094] Understandably, after the target adapter function is compiled, the adapter function cache file can be updated by adding the state of the target adapter function to the adapter function cache file, or by updating the value of "isCompiled" in the target adapter function state to true.

[0095] The above method obtains the target compiler based on the programming language of the target adaptation function, compiles the target adaptation function using the target compiler, and generates an adaptation dynamic link library. This method can reduce code redundancy in the simulation system and improve system efficiency.

[0096] In one exemplary embodiment, such as Figure 4 As shown, optionally, a target adapter function is generated based on the specification document information. The target adapter function is used to ensure compatibility with the input and output formats of external dynamic link libraries, including steps 401 to 403. Wherein:

[0097] Step 401: Obtain the adaptation function template.

[0098] The adaptation function template includes a first adaptation function that adapts to the input and output format of the simulation system.

[0099] Optionally, the adaptor function template can be pre-stored in the simulation system. After obtaining the specification document information, the adaptor function template can be obtained to retrieve the first adaptor function.

[0100] Optionally, the first adapter function can be the part of the target adapter function that interacts with the simulation system. The input and output formats of the first adapter function are the same as those of the simulation system and are fixed, and will not change due to different external dynamic link libraries.

[0101] Step 402: Generate a second adapter function based on the documentation information and the preset loading function.

[0102] The second adaptation function adapts its input and output formats to those of the external dynamic link library.

[0103] Optionally, the second adapter function can be the part of the target adapter function that calls an external dynamic link library, and it needs to be generated based on the documentation information of the external dynamic link library.

[0104] Optional, such as Figure 5 As shown, the second adapter function is generated based on the documentation information and the preset loading function, including the following steps 501 to 503. Wherein:

[0105] Step 501: Generate a loading method for the external dynamic link library based on the file name and the preset loading function.

[0106] Optionally, by parsing the documentation, the filename of the external dynamic link library can be obtained. By using the filename as the input parameter of the preset loading function, the loading statement of the external dynamic link library, i.e., the loading method of the external dynamic link library, can be obtained.

[0107] Optionally, the loading function can be determined based on the operating system of the simulation system. For example, on a Windows system, the loading function may include the LoadLibrary() function. In a Windows system, the pseudocode for the external dynamic link library loading statement can be as follows:

[0108] HMODULE hModule = LoadLibrary("demo.dll");

[0109] If (hModule = NULL) {

[0110] printf(Failed to load dll\n”);

[0111] return 1;

[0112] }

[0113] In this context, "demo.dll" is the filename of the external dynamic link library.

[0114] Step 502: Determine the function type of the second adapter function and the calling method of the external dynamic link library based on the function input information.

[0115] Optionally, determining the function type of the second adaptor function based on the function input information may include: obtaining function input information such as the input parameter name and parameter type of the external dynamic link library by parsing the specification file information, concatenating the function input information into the input parameter prototype of the function type, and then generating the function type based on the input parameter prototype and function return value information.

[0116] For example, taking Windows as the operating system and C as the programming language, the function type can be determined using the typedef method. The relevant code is shown below:

[0117] Typedef int (*func) (int p0, double p1, char* p2);

[0118] Here, "int p0, double p1, char* p2" are the prototypes of the input parameters. After determining the function type of the second adapter function, the address of the external dynamic link library is obtained according to the GetProcAddress() function so that the methods in the external dynamic link library can be dynamically called at runtime. The relevant pseudocode is shown below:

[0119] func pDemo = (fun) GetProcAddress(hModule, “Demo”);

[0120] Optionally, after obtaining the address of the external dynamic link library through the GetProcAddress() function, the address is assigned as a function pointer, and the external dynamic link library is called through the function pointer. In this way, different external dynamic link libraries can be loaded and their functions can be called according to actual needs without recompiling the program, which enhances the flexibility and scalability of the simulation system.

[0121] Optionally, based on the parameter order and parameter type, corresponding parameter values ​​can be selected from the input parameters of the first adapter function to generate statements for passing data to the external dynamic link library function, such as "pint, pdouble, pchar". In this way, the calling method of the external dynamic link library can be obtained based on the function pointer and parameter values. For example, int res = pDemo(pint, pdouble, pchar), where res is the return result of calling the external dynamic link library, and its output format matches the output of the first adapter function.

[0122] Step 503: Determine the second adapter function based on the loading method, function type, and calling method.

[0123] Optionally, the loading method, function type, and calling method constitute a second adapter function. The input of the second adapter function is the input parameters of the first adapter function after conversion, which matches the input format of the external dynamic link library. The output format of the second adapter function is the format of the return result of the external dynamic link library after conversion, which matches the output of the first adapter function.

[0124] The above-described method of generating external dynamic link libraries based on file names and preset loading functions, determines the function type of the second adapter function and the calling method of the external dynamic link library based on function input information, and determines the second adapter function based on the loading method, function type, and calling method. This method can accurately and flexibly generate the second adapter function based on the documentation information.

[0125] Step 403: Determine the target adaptation function based on the first adaptation function and the second adaptation function.

[0126] Optionally, the first and second adapt functions can be combined into a target adapt function.

[0127] The above-mentioned method obtains the matching function template, generates a second matching function based on the specification file information and preset loading functions, and determines the target matching function based on the first and second matching functions. In this way, when determining the target matching function, the first matching function obtained from the matching function template can match the input and output formats of the simulation system. The second matching function is generated according to the specification file, and it converts the input format of the first matching function to use as input parameters to load and call external dynamic link libraries. It also converts the return result format of the external dynamic link library to a format that matches the first matching function. Thus, the target matching function can be automatically obtained based on the called external dynamic link library, effectively improving the scalability of the simulation system without modifying the main software or the external dynamic link library.

[0128] In one exemplary embodiment, such as Figure 6 As shown, optionally, data interaction with external dynamic link libraries is completed according to the adapted dynamic link library to realize the simulation of aero-engines, including the following steps 601 to 602. Wherein:

[0129] Step 601: Call the adapted dynamic link library and complete the data interaction with the external dynamic link library based on the adapted dynamic link library.

[0130] Optionally, the main software in the simulation system can call the appropriate dynamic link library according to business needs, and complete the data interaction with the external dynamic link library based on the call result.

[0131] Optionally, the adapter dynamic link library can be loaded using the LoadLibrary() function, the function pointer can be obtained using the GetProcAddress() function, and then the corresponding adapter dynamic link library can be called. In this embodiment, the process of calling the adapter dynamic link library is not limited.

[0132] Optionally, when loading the adapter dynamic link library, update the value of "isLoad" in the status of the target adapter function in the adapter function cache file to true.

[0133] Step 602: Receive the continue call instruction and update the status of the target adapter function in the adapter function cache file according to the continue call instruction.

[0134] The "Continue Call" instruction indicates whether to continue calling the adapted dynamic link library.

[0135] Optionally, when the continue call instruction indicates that the adapter dynamic link library will no longer be called, the FreeLibrary() function can be used to unload the adapter dynamic link library and update the "isLoad" value in the target adapter function's status in the adapter function cache file to false. Unloading the adapter dynamic link library can release related memory and system resources, avoiding memory waste, resource contention, and potential resource exhaustion. Furthermore, by unloading and loading different dynamic link libraries, the simulation system's functions can be dynamically switched, improving the simulation system's scalability.

[0136] As an optional implementation method, such as Figure 7 As shown, the aero-engine simulation method provided in this application embodiment may include the following specific steps:

[0137] Step 701: Obtain the documentation information for the external dynamic link library.

[0138] The external dynamic link library is a packaged simulation algorithm.

[0139] Step 702: Obtain the adaptation function template.

[0140] The adaptation function template includes a first adaptation function that adapts to the input and output format of the simulation system.

[0141] Step 703: Generate a loading method for the external dynamic link library based on the file name and the preset loading function.

[0142] Step 704: Determine the function type of the second adapter function and the calling method of the external dynamic link library based on the function input information.

[0143] Step 705: Determine the second adapter function based on the loading method, function type, and calling method.

[0144] The second adaptation function adapts its input and output formats to those of the external dynamic link library.

[0145] Step 706: Determine the target adaptation function based on the first adaptation function and the second adaptation function.

[0146] Step 707: Obtain the adapter function cache file.

[0147] The adapter function cache file is used to store a list of states for compiled or loaded adapter functions.

[0148] Step 708: If the target adapter function is not included in the adapter function cache file, or if the state corresponding to the target adapter function in the adapter function cache file does not meet the preset conditions, then it is determined that the target adapter function needs to be compiled.

[0149] Step 709: Obtain the target compiler based on the programming language of the target adapt function.

[0150] Step 710: Compile the target adapter function according to the target compiler to generate the adapter dynamic link library.

[0151] Step 711: Call the adapted dynamic link library and complete the data interaction with the external dynamic link library based on the adapted dynamic link library.

[0152] Step 712: Receive the continue call instruction and update the status of the target adapter function in the adapter function cache file according to the continue call instruction.

[0153] The "Continue Call" instruction indicates whether to continue calling the adapted dynamic link library.

[0154] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0155] Based on the same inventive concept, this application also provides an aero-engine simulation device for implementing the aero-engine simulation method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more aero-engine simulation device embodiments provided below can be found in the limitations of the aero-engine simulation method described above, and will not be repeated here.

[0156] In one exemplary embodiment, such as Figure 8 As shown, an aero-engine simulation device 800 is provided for use in an aero-engine simulation system, including: an acquisition module 801, a generation module 802, a compilation module 803, and a simulation module 804, wherein:

[0157] The acquisition module 801 is used to acquire the documentation information of an external dynamic link library, which is a packaged simulation algorithm.

[0158] The generation module 802 is used to generate target adaptation functions based on the information in the specification document. The target adaptation functions are used to be compatible with the input and output formats of the simulation system and the input and output formats of external dynamic link libraries.

[0159] The compiler module 803 is used to obtain the target compiler if it is determined from the historical compilation situation that the target adapter function needs to be compiled, and to generate the adapter dynamic link library based on the target compiler and the target adapter function;

[0160] The simulation module 804 is used to complete data interaction with external dynamic link libraries based on the adapted dynamic link library, so as to realize the simulation of aero-engines.

[0161] In one embodiment, the compilation model 803 is specifically used to obtain an adapter function cache file, which is used to store a list of states of compiled or loaded adapter functions; if the adapter function cache file does not contain the target adapter function, or if the state corresponding to the target adapter function in the adapter function cache file does not meet the preset conditions, then it is determined that the target adapter function needs to be compiled.

[0162] In one embodiment, the compilation module 803 is specifically used to obtain a target compiler based on the programming language of the target adaptation function; and to compile the target adaptation function according to the target compiler to generate an adaptation dynamic link library.

[0163] In one embodiment, the generation module 802 is specifically used to obtain an adaptation function template, which includes a first adaptation function that adapts to the input and output format of the simulation system; generate a second adaptation function based on the specification document information and a preset loading function, wherein the input and output format of the second adaptation function adapts to the input and output format of the external dynamic link library; and determine a target adaptation function based on the first and second adaptation functions.

[0164] In one embodiment, the documentation information of the external dynamic link library includes the file name and function information of the external dynamic link library. The function information includes the function name, function input information and function return value information. The function input information includes the input parameter name, parameter type and description information.

[0165] In one embodiment, the generation module 802 is specifically used to generate a loading method for an external dynamic link library based on the file name and a preset loading function; determine the function type of the second adapter function and the calling method of the external dynamic link library based on the function input information; and determine the second adapter function based on the loading method, function type, and calling method.

[0166] In one embodiment, the simulation module 804 is specifically used to call the adaptation dynamic link library, complete the data interaction with the external dynamic link library according to the adaptation dynamic link library; receive the continue call instruction, and update the status of the target adaptation function in the adaptation function cache file according to the continue call instruction. The continue call instruction is used to indicate whether to continue calling the adaptation dynamic link library.

[0167] Each module in the aforementioned aero-engine simulation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can call and execute the corresponding operations of each module.

[0168] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 9 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements an aero-engine simulation method.

[0169] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0170] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps described in any of the above method embodiments.

[0171] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps described in any of the above method embodiments.

[0172] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps described in any of the above method embodiments.

[0173] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0174] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0175] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for simulating an aero-engine, characterized in that, In a simulation system for aero-engines, the method includes: Obtain the documentation information of the external dynamic link library, which is a packaged simulation algorithm; A target adaptation function is generated based on the information in the specification document. The target adaptation function is used to be compatible with the input and output formats of the simulation system and the input and output formats of the external dynamic link library. If it is determined from historical compilation data that the target adapter function needs to be compiled, then the target compiler is obtained, and an adapter dynamic link library is generated based on the target compiler and the target adapter function. The data interaction with the external dynamic link library is completed based on the adapted dynamic link library, thereby realizing the simulation of the aero-engine.

2. The method according to claim 1, characterized in that, The step of determining whether the target adapter function needs to be compiled based on historical compilation data includes: Obtain the adapter function cache file, which is used to store the status list of compiled or loaded adapter functions; If the target adapter function is not included in the adapter function cache file, or if the state corresponding to the target adapter function in the adapter function cache file does not meet the preset conditions, then it is determined that the target adapter function needs to be compiled.

3. The method according to claim 2, characterized in that, The step of obtaining the target compiler and generating an adapted dynamic link library based on the target compiler and the target adaptation function includes: Obtain the target compiler based on the programming language of the target adaptation function; The target adapter function is compiled according to the target compiler to generate the adapter dynamic link library.

4. The method according to claim 1, characterized in that, The step of generating a target adapter function based on the documentation information, wherein the target adapter function is used to be compatible with the input and output formats of the external dynamic link library, includes: Obtain an adaptation function template, wherein the adaptation function template includes a first adaptation function that is adapted to the input and output format of the simulation system; A second adapter function is generated based on the documentation information and the preset loading function, and the input and output format of the second adapter function is adapted to the input and output format of the external dynamic link library. The target adaptation function is determined based on the first adaptation function and the second adaptation function.

5. The method according to claim 4, characterized in that, The documentation information of the external dynamic link library includes the file name and function information of the external dynamic link library. The function information includes the function name, function input information and function return value information. The function input information includes the input parameter name, parameter type and description information.

6. The method according to claim 5, characterized in that, The step of generating the second adapter function based on the description document information and the preset loading function includes: A method for loading external dynamic link libraries is generated based on the file name and a preset loading function; The function type of the second adapter function and the calling method of the external dynamic link library are determined based on the function input information. The second adapter function is determined based on the loading method, the function type, and the calling method.

7. The method according to claim 1, characterized in that, The step of completing data interaction with the external dynamic link library based on the adapted dynamic link library to realize the simulation of the aero-engine includes: The adapted dynamic link library is invoked, and data interaction with the external dynamic link library is completed based on the adapted dynamic link library; The system receives a continue call instruction and updates the status of the target adapter function in the adapter function cache file according to the continue call instruction. The continue call instruction indicates whether to continue calling the adapter dynamic link library.

8. An aircraft engine simulation device, characterized in that, In a simulation system for aero-engines, the device includes: The acquisition module is used to acquire the documentation information of an external dynamic link library, wherein the external dynamic link library is an encapsulated simulation algorithm; A generation module is used to generate a target adaptation function based on the information in the specification document. The target adaptation function is used to be compatible with the input and output formats of the simulation system and the input and output formats of the external dynamic link library. The compilation module is used to obtain the target compiler and generate an adaptation dynamic link library based on the target compiler and the target adaptation function if it is determined from the historical compilation situation that the target adaptation function needs to be compiled. The simulation module is used to complete data interaction with the external dynamic link library based on the adapted dynamic link library, so as to realize the simulation of the aero-engine.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Executable program running method and device, electronic equipment and computer storage medium

    CN112631684A

  • Method and device for generating executable dynamic link library file and storage medium

    CN115185539A