Simulation model component generation method and device, equipment and storage medium
By generating and compiling the target simulation model components, the problem of low security of model components during joint simulation is solved, the high security and universality of model components are achieved, and the protection of technical achievements is ensured.
Patent Information
- Application Number
- CN202411994679.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2044-12-31
AI Technical Summary
During the joint simulation process, the security of model components is low, which can easily lead to the leakage of technical secrets or their own technical achievements.
By displaying the component library to the target user, receiving component information, generating the initial simulation model, and generating a code file based on the connection relationship for compilation, the target simulation model components are generated. This component meets the requirements of preset calling interfaces and model calculations, and its internal information is not open to other users.
The security of model components is improved, so that the target simulation model components can be shared with other users, while their internal structure and data will not be opened, ensuring the protection of intellectual property rights.
Smart Images

Figure CN119989642A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of modeling and simulation technology, and in particular to a method, device, equipment and storage medium for generating a simulation model component. Background Art
[0002] Since the current equipment / system involves the close coupling of multiple disciplines such as pneumatics, thermal power, mechanics, hydraulics, and electronics, the integration and joint simulation of multiple professional model components are required in the process of building their numerical simulation models. In the process of model integration, the responsible personnel / units of each subsystem are generally required to submit the professional model components to the overall responsible personnel / unit for integration and to carry out joint simulation work.
[0003] In the prior art, since the model components contain a large amount of technical details and data, it is easy to cause technical secrets or own technological achievements to be leaked to others during the model component submission process. Therefore, the security of the model components is relatively low when conducting joint simulation. Summary of the invention
[0004] Based on this, it is necessary to provide a simulation model component generation method, device, equipment and storage medium that can improve the security of model components during joint simulation to address the above technical problems.
[0005] In a first aspect, the present application provides a simulation model component generation method, comprising:
[0006] Displaying a component library to a target user, the component library including multiple model components, the model components including code type model components, user packaged program type model components, standard type model components, or model components supporting loading of code or user packaged programs;
[0007] Receive component information input by a target user, where the component information includes identifiers of at least two model components and connection relationships between the model components;
[0008] generating an initial simulation model based on component information;
[0009] A code file is generated according to the connection relationship in the initial simulation model, and the code file is compiled to generate a target simulation model component. The target simulation model component meets the preset calling interface and model calculation requirements, and the internal information of the target simulation model component is not open to other users.
[0010] In one embodiment, generating an initial simulation model according to component selection information includes:
[0011] Obtain a parameter list of each model component and display the parameter list to the target user based on a preset graphical configuration interface; receive parameter configuration information input by the target user, the parameter configuration information including whether each parameter in the parameter list is open to the public; generate an initial simulation model based on the parameter configuration information and the connection relationship between each model component.
[0012] In one embodiment, generating an initial simulation model according to parameter configuration information and connection relationships between model components includes:
[0013] For each parameter, if the parameter is not open to the public, the attribute value of the parameter is obtained, and when generating the initial simulation model, the attribute value of the parameter is used as the fixed value of the parameter; if there is a parameter that is open to the public among the parameters, a model attribute configuration interface is generated, and the attribute configuration interface includes the name of the parameter, the description information of the parameter and the parameter value; based on the fixed value of each parameter and at least one of the model attribute configuration interfaces, and the connection relationship between each model component, the initial simulation model is generated.
[0014] In one embodiment, receiving component information input by a target user includes:
[0015] A canvas interface is displayed to the target user so that the target user can select a model component from the component library and drag the model component to the canvas interface; component information input by the target user is received according to the canvas interface.
[0016] In one embodiment, the component information may also be functional description information of the target simulation model component, and generating the initial simulation model according to the component information further includes:
[0017] The functional description information is parsed to determine the function of the target simulation model component; the target component is determined from the component library according to the function of the target simulation model component and a preset analysis model; and an initial simulation model is generated according to the target component.
[0018] In one of the embodiments, in the code file, each model component is a member object, and the parameters of the model component are attributes of the member object.
[0019] In a second aspect, the present application also provides a simulation model component generation device, comprising:
[0020] A display module is used to display a component library to a target user, wherein the component library includes a plurality of model components, and the model components include code type model components, user packaged program type model components, standard type model components, or model components that support loading code or user packaged programs;
[0021] A receiving module, used to receive component information input by a target user, wherein the component information includes identifiers of at least two model components and connection relationships between the model components;
[0022] A first generating module, used for generating an initial simulation model according to component information;
[0023] The second generation module is used to generate a code file according to the connection relationship in the simulation model, and compile the code file to generate a target simulation model component. The target simulation model component meets the preset calling interface and model calculation requirements, and the internal information of the target simulation model component is not open to other users.
[0024] In one of the embodiments, the first generation module is specifically used to obtain a parameter list of each model component and display the parameter list to a target user based on a preset graphical configuration interface; receive parameter configuration information input by the target user, the parameter configuration information including whether each parameter in the parameter list is open to the public; and generate an initial simulation model based on the parameter configuration information and the connection relationship between each model component.
[0025] In one of the embodiments, the first generation module is used to obtain the attribute value of each parameter if the parameter is not open to the public, and use the attribute value of the parameter as the fixed value of the parameter when generating the initial simulation model; if there are parameters that are open to the public among the parameters, a model attribute configuration interface is generated, and the attribute configuration interface includes the name of the parameter, the description information of the parameter and the parameter value; based on the fixed value of each parameter and at least one of the model attribute configuration interfaces, and the connection relationship between each model component, the initial simulation model is generated.
[0026] In one embodiment, the receiving module is specifically used to display a canvas interface to the target user, so that the target user can select a model component from the component library and drag the model component to the canvas interface; and receive component information input by the target user according to the canvas interface.
[0027] In one of the embodiments, the component information may also be functional description information of the target simulation model component. The first generation module is further used to parse the functional description information to determine the function of the target simulation model component; determine the target component from the component library according to the function of the target simulation model component and a preset analysis model; and generate an initial simulation model according to the target component.
[0028] In one of the embodiments, in the code file, each model component is a member object, and the parameters of the model component are attributes of the member object.
[0029] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any of the methods described in the first aspect when executing the computer program.
[0030] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any of the methods described in the first aspect.
[0031] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the methods described in the first aspect.
[0032] The above-mentioned simulation model component generation method, device, equipment and storage medium display a component library to the target user, wherein the component library includes multiple model components, and the model components include code-type model components, user-encapsulated program-type model components, standard-type model components or model components that support loading code or user-encapsulated programs; receive component information input by the target user, wherein the component information includes the identification of at least two model components and the connection relationship of each model component; generate an initial simulation model according to the component information; generate a code file according to the connection relationship in the simulation model, and compile the code file to generate a target simulation model component, wherein the target simulation model component meets the preset call interface and model calculation requirements, and the internal information of the target simulation model component is not open to other users. In this way, when generating the target simulation model component, the initial simulation model can be generated through the connection relationship between the model components in the component library and each model component, and the code file is generated from the initial simulation model and then compiled, so that the obtained target simulation model component can be shared with other users for use, and at the same time, due to encapsulation, the internal structure and data of the target simulation model component will not be open to the user, so that the security of the model component can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 A schematic diagram of a flow chart of a method for generating a simulation model component in one embodiment;
[0035] Figure 2 A schematic diagram of a process for generating an initial simulation model in one embodiment;
[0036] Figure 3 A schematic flow chart of the steps of generating an initial simulation model in another embodiment;
[0037] Figure 4A flowchart of a step of receiving component information input by a target user in one embodiment;
[0038] Figure 5 A schematic flow chart of the steps of generating an initial simulation model in another embodiment;
[0039] Figure 6 A schematic diagram of a flow chart of a method for generating a simulation model component in another embodiment;
[0040] Figure 7 A structural block diagram of a simulation model component generating device in one embodiment;
[0041] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] Since the current equipment / system involves the close coupling of multiple disciplines such as pneumatics, thermal power, mechanics, hydraulics, and electronics, the integration and joint simulation of multiple professional models are required in the process of building their numerical simulation models. In the process of model integration, the responsible personnel / units of each subsystem are generally required to submit the professional models to the overall responsible personnel / unit for integration and joint simulation. Since the model contains a large amount of technical details and data, it is easy to leak technical secrets or their own technical achievements to others during the model submission process. Therefore, in the actual work process, due to the issues of intellectual property rights and achievement protection, the professional models developed by each unit / department / personnel will not be delivered to others for use. At the same time, many professions and personnel have various forms of model development. Some are self-developed code programs. Different professional model tools and integration interfaces are different. Direct delivery of code is prone to leakage of technical achievements, and it is impossible to control the use scenarios and purposes. Encrypting and encapsulating the code before delivery brings development difficulties and technical challenges to developers, increasing the cost and cycle of model development. In many cases, the input-output ratio is not cost-effective.
[0044] Due to the difficulty in ensuring intellectual property protection and the heavy workload of model interface adaptation, the current professional models are severely fragmented, making it difficult to form a system-level integrated simulation effect. Relying solely on simulation calculations of a single discipline or a single system can only calculate the performance results of the components or subsystems themselves, and cannot effectively model the influence and action process between multiple systems after coupling. The simulation dimension and realism are difficult to guarantee, resulting in computer simulation technology being unable to effectively assist system development and performance prediction and analysis.
[0045] Therefore, there is an urgent need to solve a simulation model component generation method that can improve the security and versatility of model components and provide guarantee conditions for the shared use and integrated simulation of model components, so as to enhance the effectiveness of digital simulation technology in the product / equipment R&D process.
[0046] In view of this, the present application provides a simulation model component generation method that can effectively improve the security of model components. The simulation model component generation method provided in the embodiment of the present application, its execution subject can be a simulation model component generation device, and the simulation model component generation device can be implemented by software, hardware, or a combination of software and hardware. It can be embedded in or independent of the processor in the computer device in the form of hardware, or it can be stored in the memory of the computer device in the form of software. In the following method embodiments, the execution subject is a computer device as an example for explanation, wherein the computer device can be a terminal, for example, a laptop or a desktop computer, etc. The embodiment of the present application does not limit the specific type of the computer device.
[0047] In an exemplary embodiment, Figure 1 As shown, a simulation model component generation method is provided, comprising the following steps 101 to 104. Among them:
[0048] Step 101: Display the component library to the target user.
[0049] The component library includes multiple model components, and the model components include code-type model components, user-packaged program-type model components, standard-type model components, or model components that support loading codes or user-packaged programs.
[0050] Optionally, the target user may be the owner of the simulation model component, that is, the target user may obtain the simulation model component by executing the method in the embodiment of the present application.
[0051] Exemplarily, the model component may be an adder, a unit converter, etc.
[0052] Optionally, the component library can be stored in the storage medium of the terminal in the form of a database or configuration file, or stored in the storage medium of the server. It can be understood that when the component library is stored in the storage medium of the server, when the component library needs to be displayed to the target user, the terminal can send component library request information to the server and receive component library information sent by the server.
[0053] Optionally, the model components in the component library may be displayed to the target user through a component display interface.
[0054] In one possible implementation, the component library can be displayed to the target user in a default display mode. Since the component library includes multiple model components, the default display mode can be to display all model components on the component display interface, or to classify the model components and display the categories of the model components on the component display interface. When classifying the model components, they can be classified according to the functional type or the first letter of the name of the model components.
[0055] In another possible implementation, a preset number of first model components and a drop-down icon can be displayed. It can be understood that after the drop-down icon is triggered, the component display interface can display a preset number of second model components, wherein the first model component and the second model component are different and both belong to the model library.
[0056] It should be noted that the embodiment of the present application does not limit the manner in which the model components in the component library are displayed to the target user through the component display interface, and can be set according to actual needs.
[0057] Step 102: receiving component information input by a target user.
[0058] The component information includes identifications of at least two model components and connection relationships between the model components.
[0059] Optionally, the connection relationship between the model components can be a physical connection, a logical connection or an interface connection, or a combination of the above connection relationships, which is not limited in the embodiments of the present application. Among them, the physical connection can be connecting the model components together through physical media such as wires and mechanical devices, so that energy, matter or signals can be directly transmitted between the model components; the logical connection can be associating the model components through software codes, algorithms or data structures, and realizing the connection relationship of the model components through a calculation process; the interface connection can be connecting the model components through a predefined interface standard or protocol.
[0060] In a possible implementation, the identifiers of the model components and the connection relationships of the model components input by the target user may be received based on the input interface.
[0061] In another possible implementation, the component information file may be uploaded to the terminal based on a preset file upload interface, and the component information file may be analyzed by a parsing method corresponding to the file format, thereby receiving the component information input by the target user.
[0062] It is understandable that the user can enter the identification of each model component and the connection relationship of each model component in the component information file, and upload the component information file. The file format of the component information file can be a text file, an image file, a table file, etc., which is not limited to this in the embodiment of the present application.
[0063] Optionally, the target user can also upload the model components in the component library to the terminal through the function extension module in the component library (i.e., the model component that supports loading code or user packaged program), and provide a data interface for interacting with other model components by setting the input and output ports of each model component.
[0064] Step 103: Generate an initial simulation model according to the component information.
[0065] Optionally, the corresponding model components may be obtained from the component library according to the identifiers of the model components in the component information, and the model components may be connected according to corresponding connection relationships, thereby generating an initial simulation model.
[0066] Optionally, the initial simulation model may be displayed to the target user via a display interface, so that the target user may confirm or adjust the initial simulation model.
[0067] Optionally, the connection relationship between each model component can be verified to ensure that the interconnected model components meet the basic requirements. For example, if model component A is connected to model component B, it is necessary to verify whether the data format of the output port of model component A is consistent with the input port of model component B. If the data formats are inconsistent, model component A and model component B cannot be directly connected.
[0068] Optionally, the verification result may be displayed to the target user through a display interface, so that the target user can adjust the connection relationship of the model components according to the verification result.
[0069] Step 104: Generate a code file according to the connection relationship in the initial simulation model, and compile the code file to generate a target simulation model component.
[0070] Among them, the target simulation model component meets the preset calling interface and model calculation requirements, and the internal information of the target simulation model component is not open to other users.
[0071] Optionally, an independent code file is generated from the initial simulation model, wherein interface functions in the code file are generated according to the input / output ports of the initial simulation model. At the same time, a calling code is generated through a preset calling interface. The connection relationship can represent the calling relationship of the interfaces corresponding to each model component. The interface corresponding to each model component is called through the corresponding calling code, that is, data interaction can be performed with other function codes and interface codes through the calling code, thereby generating a code file.
[0072] Optionally, the programming language of the independent code file may be any programming language, for example, C language or C++ language.
[0073] Optionally, when compiling a code file, the compilation environment and compiler may be determined according to the programming language corresponding to the code file. For example, for C or C++, GCC (GNU Compiler Collection) may be used as the compiler, and for Java, JDK (Java Development Kit) may be used as the compiler.
[0074] Optionally, after compiling the code file, a target simulation model component is obtained. The target simulation model component can be an executable file, and its interface function conforms to the programming language specification. Therefore, the versatility of the target simulation model component can be improved. When other users use the target simulation model component, they can plug and play, reducing the difficulty of using the simulation model component. At the same time, since the target simulation model component is compiled and generated, other users cannot view its code, the model components included inside, and the connection relationship between the model components.
[0075] Optionally, after generating the target simulation model component, the target simulation model component may be verified to ensure that the target simulation model component can be used normally.
[0076] Optionally, the target simulation model component may also be stored in a component library, and the display icon of the target simulation model component may be implemented in the form of text, formula, picture, etc.
[0077] The above simulation model component generation method is to display a component library to a target user, wherein the component library includes multiple model components, wherein the model components include a code type model component, a user packaged program type model component, a standard type model component, or a model component that supports loading code or a user packaged program; receive component information input by the target user, wherein the component information includes the identification of at least two model components and the connection relationship between each model component; generate an initial simulation model according to the component information; generate a code file according to the connection relationship in the simulation model, and compile the code file to generate a target simulation model component, wherein the target simulation model component meets the preset call interface and model calculation requirements, and the internal information of the target simulation model component is not open to other users. In this way, when generating the target simulation model component, the initial simulation model can be generated through the connection relationship between the model components in the component library and each model component, and the code file generated from the initial simulation model is then compiled, so that the obtained target simulation model component can be shared with other users for use, and at the same time, due to encapsulation, the internal structure and data of the target simulation model component will not be open to the user, so that the security of the model component can be effectively improved.
[0078] In an exemplary embodiment, Figure 2As shown, optionally, generating an initial simulation model according to the component selection information includes the following steps 201 to 203. Among them:
[0079] Step 201, obtain a parameter list of each model component, and display the parameter list to a target user based on a preset graphical configuration interface.
[0080] Optionally, each model component is parsed to determine a parameter list of each model component, or a corresponding parameter list is obtained from a component library according to an identifier of each model component.
[0081] Optionally, after receiving a trigger instruction from the target user for the model component, the parameter list of the model component can be displayed to the target user based on a preset graphical configuration interface; or after receiving component information input by the target user, the parameter list can be displayed to the target user based on a preset graphical configuration interface. At this time, there are multiple preset graphical configuration interfaces on the display interface, corresponding to multiple model components respectively.
[0082] Step 202: receiving parameter configuration information input by the target user.
[0083] The parameter configuration information includes whether each parameter in the parameter list is open to the public.
[0084] Optionally, the graphical configuration interface includes parameter names, parameter descriptions, and parameter configuration information of each parameter, and the target user can input or select whether the corresponding parameter is to be disclosed to the public in the parameter configuration information.
[0085] Step 203: Generate an initial simulation model according to the parameter configuration information and the connection relationship between each model component.
[0086] Optionally, the connection relationship between each model component in the initial simulation model is public.
[0087] Optional, such as Figure 3 As shown, according to the parameter configuration information and the connection relationship between each model component, an initial simulation model is generated, including the following steps 301 to 303. Among them:
[0088] Step 301 : For each parameter, if the parameter is not disclosed to the public, the attribute value of the parameter is obtained, and when generating the initial simulation model, the attribute value of the parameter is used as the fixed value of the parameter.
[0089] Optionally, the parameter configuration information may also include parameter values of various parameters configured by the target user. For the parameters of each model component, if the target user configures a certain parameter that is not disclosed to the public, the parameter value corresponding to the parameter in the parameter configuration information may be used as the attribute value.
[0090] Optionally, the attribute value of the parameter may also be determined based on a standard value or a historical parameter value of the parameter in a corresponding model component. The historical parameter value may be the corresponding parameter value when the model component is used to generate other simulation model components.
[0091] Optionally, since the parameter is not open to the public, the value of the parameter is fixed when the initial simulation model is generated.
[0092] Step 302: If there are parameters that are disclosed to the public among the parameters, a model attribute configuration interface is generated.
[0093] The property configuration interface includes the parameter name, parameter description information and parameter value.
[0094] Optionally, a model property configuration interface may be generated for an externally disclosed parameter, or a model property configuration interface may be generated based on all externally disclosed parameters in each model component.
[0095] Optionally, if there are two or more parameters open to the public, a model property configuration interface can be generated, which includes two or more property configuration bars. It can be understood that one property configuration bar corresponds to one parameter open to the public, and the property configuration bar includes the parameter name, parameter description information and parameter value.
[0096] Optionally, the model attribute configuration interface can be automatically combined and reconstructed through a templated attribute interface configuration method and structured attribute parameter description information, so as to graphically set parameter values for the parameters selected by the target user for public disclosure.
[0097] Optionally, the model property configuration interface can be used to configure parameter values in response to parameters exposed by the target simulation model component when other users use the target simulation model component.
[0098] Optionally, when other users use the target simulation model component, the parameter value of each parameter in the model property configuration interface may display a default value, which may be set by the target user when generating the target simulation model component, or, when generating the target simulation model component, determined by the terminal device based on the standard value or historical parameter value of the parameter in the corresponding model component.
[0099] Step 303: Generate an initial simulation model according to the fixed values of the parameters and at least one of the model attribute configuration interfaces, and the connection relationship between the model components.
[0100] Optionally, when the parameters of each model component are not open to the public, an initial simulation model can be generated based on the fixed values of each parameter and the connection relationship between each model component; when the parameters of each model component are open to the public, the initial simulation model can be generated based on the magic heart attribute configuration interface and the connection relationship between each model component; when there are parameters that are open to the public and parameters that are not open to the public among the parameters of each model component, the initial simulation model can be generated based on the fixed values of the parameters that are not open to the public and the attribute configuration interface of the corresponding public parameters, as well as the connection relationship between each model component.
[0101] Optionally, the generated initial simulation model can be presented to the user through a display interface. If there are parameters open to the public in the initial simulation model, the display interface may include the connection relationship between each model component and a model property configuration interface. Specifically, when there are two or more parameters open to the public, if one parameter open to the public corresponds to one model property configuration interface, the display interface may include two or more model property configuration interfaces; if all parameters open to the public correspond to one model property configuration interface, the display interface includes one model property configuration interface, and the model property configuration interface includes two or more property configuration bars.
[0102] For each parameter mentioned above, if the parameter is not open to the public, the attribute value of the parameter is obtained. When generating the initial simulation model, the attribute value of the parameter is used as the fixed value of the parameter. If there are parameters that are open to the public among the parameters, a model attribute configuration interface is generated. According to the fixed value of each parameter and at least one of the model attribute configuration interfaces, and the connection relationship between each model component, the initial simulation model is generated. It is determined whether each parameter is open to the public according to the parameter configuration information of the target user. When generating the initial simulation model, the parameter value of each parameter is determined according to the fixed value of the parameter that is not open to the public and, or, the model attribute configuration interface. In this way, the parameters in the initial simulation model do not need to be fully open to the public, which can ensure the security of the model. When other users use the target simulation model component, they can also configure the corresponding parameter values for the parameters disclosed in the target simulation model component according to the model attribute configuration interface.
[0103] In an exemplary embodiment, in a code file, each model component is a member object, and the parameters of the model component are attributes of the member object.
[0104] Optionally, each model component in the initial simulation model generates a member object, and the parameters in the model component are the attributes of the corresponding member object. The parameters of the model component can be open to the public, that is, other users can reconfigure the parameter value when using the target simulation model component, or they can be closed to the public, that is, other users do not know the parameter when using the target simulation model component. Therefore, when generating the code file, for the parameters that are not open to the public, obtain their attribute values and use the parameters as constants. For the parameters that are open to the public, use them as variables, and generate a parameter value configuration function interface to support other users to configure the parameter values.
[0105] In an exemplary embodiment, Figure 4 As shown, optionally, receiving component information input by a target user includes the following steps 401 to 402. Among them:
[0106] Step 401 : Displaying a canvas interface to a target user, so that the target user can select a model component from a component library and drag the model component to the canvas interface.
[0107] Optionally, the canvas interface and the component library can be displayed on the display interface at the same time. The canvas interface and the component library can be displayed top to bottom or left to right, or the component library can be located inside the canvas interface. The embodiments of the present application do not limit how to display the canvas interface and the component library in the display interface.
[0108] Optionally, by receiving a drag command from the target user to the component library, a corresponding model component can be selected from the component library, and then the model component can be moved to the canvas interface. At the same time, the drag command can also be movement information of the model component on the canvas interface. For example, on the current canvas interface, model component A is connected to model component B and model component C. By receiving a drag command from the target user, model component D can be selected from the component library and model component D can be connected to model component C. Alternatively, by receiving a drag command from the target user, the connection relationship between model A and model component C can be deleted.
[0109] Step 402: Receive component information input by a target user according to the canvas interface.
[0110] Optionally, a save button is displayed on the screen interface. When receiving a trigger instruction for the save button from the target user, the model components displayed on the current canvas interface and the connection relationship between the model components are stored, thereby receiving component information input by the target user according to the canvas interface.
[0111] The above method displays a canvas interface to the target user, so that the target user can select a model component from the component library and drag the model component to the canvas interface, and receives component information input by the target user according to the canvas interface. For the target user, determining the component information through the canvas interface is more intuitive, and the input component information is also more accurate.
[0112] In an exemplary embodiment, Figure 5 As shown, optionally, the component information may also be functional description information of the target simulation model component, and generating the initial simulation model according to the component information also includes the following steps 501 to 503. Among them:
[0113] Step 501: parse the functional description information to determine the function of the target simulation model component.
[0114] Optionally, the functional description information may be written in accordance with preset formats and rules, and thus the functional description information may be parsed according to the corresponding formats and rules, or the function of the target simulation model component may be determined from the functional description information through natural language processing technology.
[0115] Step 502: determine the target component from the component library according to the function of the target simulation model component and the preset analysis model.
[0116] Optionally, the preset analysis model can be a convolutional neural network model or a recurrent neural network model, etc., which can be achieved by inputting the functions of the target simulation model components into the preset analysis model and then inputting the target components. If there are two or more target components, the preset analysis model can also output the connection relationship between the target components.
[0117] Optionally, the preset analysis model can be based on the function of the historical simulation model component and the structure of the corresponding historical simulation model component (i.e., the model component contained in the historical simulation model component) as a training sample. By training the neural network model, the analysis model can learn the relationship between the function of the simulation model component and the included model components.
[0118] Step 503: Generate an initial simulation model according to the target component.
[0119] In a possible implementation manner, an initial simulation model is determined according to a target component and a connection relationship between target components, and then the initial simulation model is displayed to a target user through a display interface.
[0120] In another possible implementation, after the target component is determined, the target component can be displayed to the target user through a canvas interface. The target user can confirm or adjust each target component and its connection relationship based on the canvas interface, which can improve the accuracy of generating the initial simulation model. Then, after receiving the confirmation instruction from the target user, the initial simulation model can be determined based on the target component and the connection relationship between each target component.
[0121] Optionally, the target component is equivalent to the model component in steps 201 to 203. When determining the initial simulation model based on the connection relationship between the target component and the target component, it can be implemented in the same manner as the above steps 201 to 203, and the embodiments of the present application will not be repeated.
[0122] The above-mentioned parsing of the functional description information is used to determine the function of the target simulation model component, and the target component is determined from the component library according to the function of the target simulation model component and the preset analysis model, and the initial simulation model is generated according to the target component. In this way, the target component can be quickly determined from the component library according to the functional description information of the target simulation model component, and then the initial simulation model is generated according to the target component. This can effectively improve the efficiency and accuracy of the generation of the simulation model component, and at the same time improve the versatility of the generation of the simulation model component. That is, for non-professionals, they only need to input the function of the desired target simulation model component to quickly and accurately generate the corresponding target simulation model component.
[0123] As an optional implementation, Figure 6 As shown, the simulation model component generation method provided in the embodiment of the present application may include the following specific steps:
[0124] Step 601, displaying the component library to the target user.
[0125] The component library includes multiple model components, and the model components include code-type model components, user-packaged program-type model components, standard-type model components, or model components that support loading codes or user-packaged programs.
[0126] Step 602 : Displaying a canvas interface to the target user, so that the target user can select a model component from the component library and drag the model component to the canvas interface.
[0127] Step 603: Receive component information input by the target user according to the canvas interface.
[0128] The component information includes identifications of at least two model components and connection relationships between the model components.
[0129] Step 604, obtaining a parameter list of each model component, and displaying the parameter list to the target user based on a preset graphical configuration interface.
[0130] Step 605: receiving parameter configuration information input by the target user.
[0131] The parameter configuration information includes whether each parameter in the parameter list is open to the public.
[0132] Step 606: For each parameter, if the parameter is not disclosed to the public, the attribute value of the parameter is obtained, and when generating the initial simulation model, the attribute value of the parameter is used as the fixed value of the parameter.
[0133] Step 607: If there are parameters that are disclosed to the public among the parameters, a model attribute configuration interface is generated.
[0134] The property configuration interface includes the parameter name, parameter description information and parameter value.
[0135] Step 608: Generate an initial simulation model according to the fixed values of the parameters and at least one of the model property configuration interfaces, and the connection relationship between the model components.
[0136] Step 609: Generate a code file according to the connection relationship in the initial simulation model, and compile the code file to generate a target simulation model component.
[0137] Among them, the target simulation model component meets the preset calling interface and model calculation requirements, and the internal information of the target simulation model component is not open to other users.
[0138] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0139] Based on the same inventive concept, the embodiment of the present application also provides a simulation model component generation device for implementing the simulation model component generation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more simulation model component generation device embodiments provided below can refer to the limitations of the simulation model component generation method above, and will not be repeated here.
[0140] In an exemplary embodiment, Figure 7 As shown, a simulation model component generation device is provided, including: a display module 701, a receiving module 702, a first generation module 703 and a second generation module 704, wherein:
[0141] Display module 701, used to display the component library to the target user, the component library includes multiple model components, the model components include code type model components, user packaged program type model components, standard type model components or model components supporting loading code or user packaged programs;
[0142] A receiving module 702 is used to receive component information input by a target user, where the component information includes identifiers of at least two model components and connection relationships between the model components;
[0143] A first generating module 703, used to generate an initial simulation model according to component information;
[0144] The second generation module 704 is used to generate a code file according to the connection relationship in the simulation model, and compile the code file to generate a target simulation model component. The target simulation model component meets the preset calling interface and model calculation requirements, and the internal information of the target simulation model component is not open to other users.
[0145] In an exemplary embodiment, the first generation module 703 is specifically used to obtain a parameter list of each model component and display the parameter list to a target user based on a preset graphical configuration interface; receive parameter configuration information input by the target user, the parameter configuration information including whether each parameter in the parameter list is open to the public; and generate an initial simulation model based on the parameter configuration information and the connection relationship between each model component.
[0146] In an exemplary embodiment, the first generation module 703 is used to obtain the attribute value of each parameter if the parameter is not disclosed to the public, and use the attribute value of the parameter as the fixed value of the parameter when generating the initial simulation model; if there are parameters that are disclosed to the public among the parameters, a model attribute configuration interface is generated, and the attribute configuration interface includes the name of the parameter, the description information of the parameter and the parameter value; based on the fixed value of each parameter and at least one of the model attribute configuration interfaces, and the connection relationship between each model component, the initial simulation model is generated.
[0147] In an exemplary embodiment, the receiving module 702 is specifically used to display a canvas interface to the target user, so that the target user can select a model component from the component library and drag the model component to the canvas interface; and receive component information input by the target user according to the canvas interface.
[0148] In an exemplary embodiment, the component information may also be functional description information of the target simulation model component. The first generation module 703 is further used to parse the functional description information to determine the function of the target simulation model component; determine the target component from the component library according to the function of the target simulation model component and a preset analysis model; and generate an initial simulation model according to the target component.
[0149] In an exemplary embodiment, in a code file, each model component is a member object, and the parameters of the model component are attributes of the member object.
[0150] Each module in the above-mentioned simulation model component generation device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0151] Optionally, a joint simulation system is provided, comprising the method and apparatus in any one of the above embodiments.
[0152] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a simulation model component generation method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0153] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0154] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0155] Display a component library to a target user, the component library including multiple model components, the model components including code type model components, user packaged program type model components, standard type model components or model components supporting loading code or user packaged programs; receive component information input by the target user, the component information including the identifiers of at least two model components and the connection relationship between the model components; generate an initial simulation model according to the component information; generate a code file according to the connection relationship in the initial simulation model, and compile the code file to generate a target simulation model component, the target simulation model component meets the preset calling interface and model calculation requirements, and the internal information of the target simulation model component is not open to other users.
[0156] In one embodiment, when the processor executes the computer program, it also implements the following steps: obtaining a parameter list of each model component, and displaying the parameter list to the target user based on a preset graphical configuration interface; receiving parameter configuration information input by the target user, the parameter configuration information including whether each parameter in the parameter list is open to the public; and generating an initial simulation model based on the parameter configuration information and the connection relationship between each model component.
[0157] In one embodiment, when the processor executes the computer program, the following steps are also implemented: for each parameter, if the parameter is not disclosed to the public, the attribute value of the parameter is obtained, and when generating the initial simulation model, the attribute value of the parameter is used as the fixed value of the parameter; if there is a parameter disclosed to the public among the parameters, a model attribute configuration interface is generated, and the attribute configuration interface includes the name of the parameter, the description information of the parameter and the parameter value; based on the fixed value of each parameter and at least one of the model attribute configuration interfaces, and the connection relationship between each model component, the initial simulation model is generated.
[0158] In one embodiment, when the processor executes the computer program, the following steps are also implemented: displaying a canvas interface to the target user so that the target user can select a model component from the component library and drag the model component to the canvas interface; receiving component information input by the target user according to the canvas interface.
[0159] In one embodiment, the component information may also be functional description information of the target simulation model component. When the processor executes the computer program, the following steps are also implemented: parsing the functional description information to determine the function of the target simulation model component; determining the target component from the component library based on the function of the target simulation model component and a preset analysis model; and generating an initial simulation model based on the target component.
[0160] In one of the embodiments, in the code file, each model component is a member object, and the parameters of the model component are attributes of the member object.
[0161] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0162] Display a component library to a target user, the component library including multiple model components, the model components including code type model components, user packaged program type model components, standard type model components or model components supporting loading code or user packaged programs; receive component information input by the target user, the component information including the identifiers of at least two model components and the connection relationship between the model components; generate an initial simulation model according to the component information; generate a code file according to the connection relationship in the initial simulation model, and compile the code file to generate a target simulation model component, the target simulation model component meets the preset calling interface and model calculation requirements, and the internal information of the target simulation model component is not open to other users.
[0163] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a parameter list of each model component, and displaying the parameter list to the target user based on a preset graphical configuration interface; receiving parameter configuration information input by the target user, the parameter configuration information including whether each parameter in the parameter list is open to the public; generating an initial simulation model based on the parameter configuration information and the connection relationship between each model component.
[0164] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for each parameter, if the parameter is not disclosed to the public, the attribute value of the parameter is obtained, and when generating the initial simulation model, the attribute value of the parameter is used as the fixed value of the parameter; if there is a parameter disclosed to the public among the parameters, a model attribute configuration interface is generated, and the attribute configuration interface includes the name of the parameter, the description information of the parameter and the parameter value; based on the fixed value of each parameter and at least one of the model attribute configuration interfaces, and the connection relationship between each model component, the initial simulation model is generated.
[0165] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: displaying a canvas interface to the target user so that the target user can select a model component from the component library and drag the model component to the canvas interface; receiving component information input by the target user according to the canvas interface.
[0166] In one embodiment, the component information may also be functional description information of the target simulation model component. When the computer program is executed by the processor, the following steps are also implemented: parsing the functional description information to determine the function of the target simulation model component; determining the target component from the component library based on the function of the target simulation model component and a preset analysis model; and generating an initial simulation model based on the target component.
[0167] In one of the embodiments, in the code file, each model component is a member object, and the parameters of the model component are attributes of the member object.
[0168] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0169] Display a component library to a target user, the component library including multiple model components, the model components including code type model components, user packaged program type model components, standard type model components or model components supporting loading code or user packaged programs; receive component information input by the target user, the component information including the identifiers of at least two model components and the connection relationship between the model components; generate an initial simulation model according to the component information; generate a code file according to the connection relationship in the initial simulation model, and compile the code file to generate a target simulation model component, the target simulation model component meets the preset calling interface and model calculation requirements, and the internal information of the target simulation model component is not open to other users.
[0170] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a parameter list of each model component, and displaying the parameter list to the target user based on a preset graphical configuration interface; receiving parameter configuration information input by the target user, the parameter configuration information including whether each parameter in the parameter list is open to the public; generating an initial simulation model based on the parameter configuration information and the connection relationship between each model component.
[0171] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for each parameter, if the parameter is not disclosed to the public, the attribute value of the parameter is obtained, and when generating the initial simulation model, the attribute value of the parameter is used as the fixed value of the parameter; if there is a parameter disclosed to the public among the parameters, a model attribute configuration interface is generated, and the attribute configuration interface includes the name of the parameter, the description information of the parameter and the parameter value; based on the fixed value of each parameter and at least one of the model attribute configuration interfaces, and the connection relationship between each model component, the initial simulation model is generated.
[0172] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: displaying a canvas interface to the target user so that the target user can select a model component from the component library and drag the model component to the canvas interface; receiving component information input by the target user according to the canvas interface.
[0173] In one embodiment, the component information may also be functional description information of the target simulation model component. When the computer program is executed by the processor, the following steps are also implemented: parsing the functional description information to determine the function of the target simulation model component; determining the target component from the component library based on the function of the target simulation model component and a preset analysis model; and generating an initial simulation model based on the target component.
[0174] In one of the embodiments, in the code file, each model component is a member object, and the parameters of the model component are attributes of the member object.
[0175] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0176] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.
[0177] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for generating a simulation model component, characterized in that: The method comprises: Displaying a component library to a target user, wherein the component library includes a plurality of model components, wherein the model components include code-type model components, user-packaged program-type model components, standard-type model components, or model components that support loading code or user-packaged programs; Receiving component information input by a target user, the component information including identifiers of at least two model components and connection relationships between the model components; generating an initial simulation model according to the component information; A code file is generated according to the connection relationship in the initial simulation model, and the code file is compiled to generate a target simulation model component, the target simulation model component meets the preset calling interface and model calculation requirements, and the internal information of the target simulation model component is not open to other users.
2. The method according to claim 1, characterized in that The generating an initial simulation model according to the component selection information comprises: Obtaining a parameter list of each of the model components, and displaying the parameter list to the target user based on a preset graphical configuration interface; receiving parameter configuration information input by the target user, wherein the parameter configuration information includes whether each parameter in the parameter list is disclosed to the public; The initial simulation model is generated according to the parameter configuration information and the connection relationship between the model components.
3. The method according to claim 2, characterized in that The generating the initial simulation model according to the parameter configuration information and the connection relationship between each of the model components comprises: For each of the parameters, if the parameter is not disclosed to the public, an attribute value of the parameter is obtained, and when generating an initial simulation model, the attribute value of the parameter is used as a fixed value of the parameter; If there are parameters disclosed to the public among the parameters, a model attribute configuration interface is generated, wherein the attribute configuration interface includes the name of the parameter, description information of the parameter and parameter value; The initial simulation model is generated according to at least one of the fixed values of the parameters and the model property configuration interface, and the connection relationship between the model components.
4. The method according to claim 1, characterized in that: The receiving component information input by the target user includes: Displaying a canvas interface to the target user, so that the target user can select the model component from the component library and drag the model component to the canvas interface; Receive component information input by the target user according to the canvas interface.
5. The method according to claim 1, characterized in that The component information may also be functional description information of the target simulation model component, and the generating of the initial simulation model according to the component information further includes: Parsing the functional description information to determine the function of the target simulation model component; Determining a target component from the component library according to the function of the target simulation model component and a preset analysis model; An initial simulation model is generated according to the target component.
6. The method according to claim 2, characterized in that In the code file, each of the model components is a member object, and the parameters of the model components are attributes of the member object.
7. A simulation model component generation device, characterized in that: The device comprises: A display module is used to display a component library to a target user, wherein the component library includes a plurality of model components, and the model components include code type model components, user packaged program type model components, standard type model components, or model components that support loading code or user packaged programs; A receiving module, configured to receive component information input by a target user, wherein the component information includes identifiers of at least two model components and connection relationships between the model components; A first generating module, used for generating an initial simulation model according to the component information; The second generation module is used to generate a code file according to the connection relationship in the initial simulation model, and compile the code file to generate a target simulation model component, wherein the target simulation model component meets the preset calling interface and model calculation requirements, and the internal information of the target simulation model component is not open to other users.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method for designing componentized and parameterized simulation model
CN103810018A
Adaptation system and method of multidisciplinary design and analysis tool
CN105988797A
Simulation model dynamic combination assembly system and method based on modularized modeling
CN117195572A
Simulation model code generation method and device
CN117971192A
Model construction method and device, equipment and storage medium
CN118037145A