Model management method and apparatus
By setting up replaceable modules in the Simulink model and adding runtime dependency files, the problem of low efficiency in module search and replacement is solved, enabling fast and efficient module replacement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-09
- Publication Date
- 2026-04-10
AI Technical Summary
In Simulink models, the large number of modules makes it inefficient and difficult for users unfamiliar with the model to manually find and replace modules.
By acquiring the first model and setting N modules with replaceable states, and adding runtime dependency files to them, the module nodes are displayed and the modules are updated when the second model is created, and the modules are directly replaced using the runtime dependency files.
It improves the speed and efficiency of module search and replacement, reduces the operational difficulty for users unfamiliar with the model, and simplifies the module replacement process.
Smart Images

Figure CN115859410B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of simulation modeling, and particularly relates to a model management method and device. BACKGROUND
[0002] Simulink is a visual simulation tool for multi-domain simulation and model-based design, which provides a graphical editor, a customizable block library and a solver, and can be used for dynamic system modeling and simulation. With Simulink, a mathematical model of a complex system can be quickly and directly built.
[0003] In the related art, after a model of a complex system is built, the model framework will not be changed in a short period of time, and a large number of simulations are performed on the model to achieve the modeling purpose. In this process, a separate model is usually saved, and the modules to be replaced are manually searched and replaced to study the influence of different modules on the entire system. However, since a large number of modules are involved in the model, it is difficult for users who are not familiar with the model to manually search, which affects the efficiency of module searching and replacing. SUMMARY
[0004] The embodiments of the application provide a model management method and device, which can reduce the difficulty of searching for a module to be replaced in a model and improve the searching and replacing efficiency.
[0005] In a first aspect, the embodiments of the application provide a model management method, which includes:
[0006] obtaining a first model, editing the first model based on a first input, and saving the edited first model as a first template, wherein the first input is used to set N first modules in each level of modules corresponding to the first model to a replaceable state, and add running dependency files corresponding to the N first modules, and the running dependency files store parameter information of at least one simulink model,
[0007] creating at least one second model according to the first template, and displaying nodes corresponding to each level of modules of the second model in a model configuration interface of the second model, wherein the each level of modules includes the N first modules and second modules other than the N first modules, and the display parameters of the nodes corresponding to the first modules and the second modules are different,
[0008] in response to a second input to a node corresponding to a target module in the N first modules, updating the target module in the second model based on parameter information of a target simulink model in a running dependency file corresponding to the target module, to obtain an updated second model, wherein the target simulink model is a simulink model matched with the target module.
[0009] In some implementable manners of the first aspect, before updating the target module in the second model, the method further comprises:
[0010] in response to the second input, displaying a module configuration interface corresponding to the target module,
[0011] in response to a third input to the module configuration interface, obtaining parameter information of the target Simulink model matched with the target module from a running dependency file corresponding to the target module.
[0012] In some implementable manners of the first aspect, the third input comprises a first sub-input and a second sub-input, and in response to the third input to the module configuration interface, the parameter information of the target Simulink model matched with the target module is obtained from the running dependency file corresponding to the target module, comprising:
[0013] in response to the first sub-input to the module configuration interface, obtaining parameter information of at least one Simulink model in the target module and its corresponding running dependency file,
[0014] by comparing the parameter information of the target module with the at least one Simulink model, filtering, from the at least one Simulink model, a candidate Simulink model satisfying a first matching condition with the target module,
[0015] in response to the second sub-input of selecting a target candidate Simulink model from the candidate Simulink model, determining the target candidate Simulink model as the target Simulink model.
[0016] In some implementable manners of the first aspect, the method further comprises:
[0017] in response to a second input to the node corresponding to the second module, displaying a module configuration interface of the second module, the module configuration interface comprising encapsulation parameters of the second module,
[0018] in response to a fourth input to the encapsulation parameters, updating the encapsulation parameters of the second module.
[0019] In some implementable manners of the first aspect, the first input comprises a third sub-input, a fourth sub-input and a fifth sub-input, the first model is obtained, and the first model is edited based on the first input, comprising:
[0020] obtaining the first model, parsing the first model to obtain a parsing result,
[0021] based on the parsing result, displaying nodes corresponding to modules at each level of the first model on the template configuration interface,
[0022] In response to a third sub-input of the first module corresponding node in the modules at each level, a module editing interface of the first module is displayed, the module editing interface comprising a first control and a second control,
[0023] In response to a fourth sub-input of the first control, the first module is set to a replaceable state, in which the first module can be replaced,
[0024] In response to a fifth sub-input of the second control, a corresponding running dependency file is added for the first module.
[0025] In some implementations of the first aspect, parsing the first model comprises, in the case that the first model comprises a subsystem module at each level of the modules, parsing lower-level modules of the subsystem module to obtain sub-modules of the subsystem module.
[0026] In some implementations of the first aspect, the method further comprises:
[0027] In the case that the second model is created, a preset template file is obtained, the preset template file comprising template information of a plurality of templates, the plurality of templates comprising a first template,
[0028] Based on the template information of the plurality of templates, template descriptions and top-level screenshots of the plurality of templates are previewed,
[0029] In response to a selection operation of the first template in the plurality of templates, the second model is created based on the first template.
[0030] In some implementations of the first aspect, after updating a target module in the second model to obtain an updated second model, the method further comprises: calling a model checker tool of simulink to perform model interface checking on the updated second model and generate a checking report.
[0031] In some implementations of the first aspect, the parameter information comprises input parameters, output parameters and encapsulation parameters.
[0032] In a second aspect, an embodiment of the present application provides a model management device, which comprises:
[0033] The editing module is configured to obtain a first model, edit the first model based on a first input, and save the edited first model as a first template, wherein the first input is used to set N first modules in each level of modules corresponding to the first model to a replaceable state, and add running dependency files corresponding to the N first modules respectively, the running dependency file storing parameter information of at least one simulink model,
[0034] The display module is configured to create at least one second model according to the first template, and display nodes corresponding to modules at each level of the second model in a model configuration interface of the second model, wherein the modules at each level include N first modules, and a second module other than the N first modules, and the display parameters corresponding to the nodes of the first modules and the second module are different,
[0035] The update module is configured to, in response to a second input to a node corresponding to a target module in the N first modules, update the target module in the second model based on parameter information of a target simulink model in a running dependency file corresponding to the target module, to obtain an updated second model, wherein the target simulink model is a simulink model matched with the target module.
[0036] In some implementable manners of the second aspect, the device further includes:
[0037] The display module is further configured to, in response to the second input, display a module configuration interface corresponding to the target module before updating the target module in the second model,
[0038] The acquisition module is configured to, in response to a third input to the module configuration interface, acquire parameter information of a target simulink model matched with the target module from a running dependency file corresponding to the target module.
[0039] In some implementable manners of the second aspect, the third input includes a first sub-input and a second sub-input, and the acquisition module includes:
[0040] The acquisition unit is configured to, in response to the first sub-input to the module configuration interface, acquire parameter information of at least one simulink model in the target module and a running dependency file corresponding to the target module,
[0041] The screening unit is configured to screen, from the at least one simulink model, a candidate simulink model satisfying a first matching condition with the target module by comparing the parameter information of the target module with the at least one simulink model,
[0042] The determination unit is configured to, in response to a second sub-input of selecting a target candidate simulink model from the candidate simulink model, determine that the target candidate simulink model is the target simulink model.
[0043] In some implementable manners of the second aspect, the device further includes:
[0044] The display module is further configured to, in response to the second input to the node corresponding to the second module, display a module configuration interface of the second module, and the module configuration interface includes encapsulation parameters of the second module,
[0045] The updating module is further configured to update the packaging parameter of the second module in response to a fourth input of the packaging parameter.
[0046] In some implementations of the second aspect, the first input includes a third sub-input, a fourth sub-input, and a fifth sub-input, and the editing module includes:
[0047] The parsing unit is configured to obtain the first model, parse the first model, and obtain a parsing result.
[0048] The display unit is configured to display nodes corresponding to each level module of the first model on the template configuration interface based on the parsing result.
[0049] The display unit is further configured to display a module editing interface of the first module in response to a third sub-input of the node corresponding to the first module in the each level module, the module editing interface including a first control and a second control.
[0050] The setting unit is configured to set the first module to a replaceable state in response to a fourth sub-input of the first control, the first module being replaceable in the replaceable state.
[0051] The adding unit is configured to add a corresponding running dependency file for the first module in response to a fifth sub-input of the second control.
[0052] In some implementations of the second aspect, the parsing unit is specifically configured to parse a lower level module of a subsystem module to obtain a sub-module of the subsystem module in a case where the each level module of the first model includes the subsystem module.
[0053] In some implementations of the second aspect, the device further includes:
[0054] The obtaining module is configured to obtain a preset template file in a case where the second model is created, the preset template file including template information of a plurality of templates, the plurality of templates including the first template.
[0055] The previewing module is configured to preview template description and top layer screenshots of the plurality of templates based on the template information of the plurality of templates.
[0056] The creating module is configured to create the second model based on the first template in response to a selection operation of the first template in the plurality of templates.
[0057] In some implementations of the second aspect, the device further includes an inspection module configured to, after updating a target module in the second model to obtain an updated second model, call a model inspector tool of the simulink to perform model interface inspection on the updated second model and generate an inspection report.
[0058] In some implementations of the second aspect, the parameter information includes an input parameter, an output parameter, and a packaging parameter.
[0059] In a third aspect, an electronic device is provided, and the electronic device includes a processor and a memory storing computer program instructions; and the processor implements the steps of the model management method according to the first aspect when executing the computer program instructions.
[0060] In a fourth aspect, a computer-readable storage medium is provided, and the computer-readable storage medium stores computer program instructions; and the computer program instructions are executed by a processor to implement the steps of the model management method according to the first aspect.
[0061] In a fifth aspect, a computer program product is provided, and the computer program product is stored in a nonvolatile storage medium, and the computer program product is executed by at least one processor to implement the steps of the model management method according to the first aspect.
[0062] In a sixth aspect, a chip is provided, and the chip includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is configured to run a program or instructions to implement the steps of the model management method according to the first aspect.
[0063] The present application provides a model management method and device, in the scene where the first model needs to be simulated, the first model can be edited based on the first input, the first input can be the editing input of the first model by the first user who is familiar with the first model, through the first input, N first modules in each level module corresponding to the first model can be set to a replaceable state, and N running dependency files corresponding to the first modules are added respectively, and after editing, a first template can be obtained. In this way, when the first model is simulated subsequently, a new model consistent with the model framework of the first model can be created based on the template, and at least one second model is obtained. Since the N first modules to be updated are preselected by the first input, and the corresponding running dependency file is allocated to each first module, in this step, the electronic device can display the nodes corresponding to each level module of the second model in the model configuration interface of the second model, and the display parameters of the nodes corresponding to the first modules and the remaining second modules not selected are different. Therefore, even for the second user who is not familiar with the first model, the N first modules to be updated can also be quickly found from each level module, and the searching speed is improved. Moreover, since the running dependency file corresponding to each first module is pre-specified by the first input, when the target module selected by the user is replaced, the electronic device can directly update the target module in the second model based on the parameter information of the target simulink model matched in the running dependency file corresponding to the target module, without the user searching for the corresponding running dependency file again, thereby simplifying the module replacement step and effectively improving the module replacement speed and efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0064] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly introduced.
[0065] Figure 1 is a flowchart of a model management method provided by an embodiment of the present application;
[0066] Figure 2 is a schematic diagram of an example of a template configuration interface provided by an embodiment of the present application;
[0067] Figure 3 is a schematic diagram of an example of a model configuration interface provided by another embodiment of the present application;
[0068] Figure 4 is a flowchart of a model management method provided by another embodiment of the present application;
[0069] Figure 5 is a flowchart of a model management method provided by still another embodiment of the present application;
[0070] Figure 6 is a flowchart of a model management method provided by still another embodiment of the present application;
[0071] Figure 7 is a structural schematic diagram of a model management device provided by an embodiment of the present application;
[0072] Figure 8 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0073] The features and exemplary embodiments of various aspects of the present application will be described in detail below, in order to make the purposes, technical solutions and advantages of the present application more clear and apparent, the present application will be further described in detail below in combination with the drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, but not to limit the present application. The present application can be implemented without some of these specific details by those skilled in the art. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.
[0074] After the model of a complex system is built, the model framework will not be changed in a short time, but a large number of simulations will be performed on the model to achieve the modeling purpose. In this process, it is usually necessary to save another copy of the model, manually find the module to be replaced and replace it, and study the influence of different modules on the entire system. However, since a large number of modules are involved in the model, it is difficult for users who are not familiar with the model to manually find them, which easily affects the efficiency of module searching and replacing.
[0075] To improve the problems in the related art, an embodiment of the present application provides a model management method. In a case where a sensor is placed in a first scene, in a scene where a first model needs to be simulated, the first model can be edited based on a first input. The first input can be an editing input of the first model by a first user who is familiar with the first model. Through the first input, N first modules in each level of modules corresponding to the first model can be set to a replaceable state, and N running dependency files corresponding to the N first modules are added respectively. After the editing is completed, a first template can be obtained. In this way, when the first model is simulated subsequently, a new model consistent with a model framework of the first model can be created based on the template, and at least one second model is obtained. Since the N first modules to be updated are preselected by the first input, and a corresponding running dependency file is allocated to each first module, in this step, the electronic device can display nodes corresponding to each level of modules of the second model in a model configuration interface of the second model, and the display parameters of the nodes corresponding to the first modules and the remaining second modules which are not selected are different. Therefore, even for a second user who is not familiar with the first model, the N first modules to be updated can be quickly found from each level of modules, and the searching speed is improved. Moreover, since the running dependency file corresponding to each first module is pre-specified by the first input, when a target module selected by the user is replaced, the electronic device can directly update the target module in the second model based on the parameter information of the target Simulink model matched in the running dependency file corresponding to the target module, without the user searching for the corresponding running dependency file again, so that the module replacement step is simplified, and the module replacement speed and efficiency are effectively improved. In this way, the problem that it is difficult for a user who is not familiar with a model to manually search, and the searching and replacement efficiency of the module is affected, in the related art, is improved.
[0076] The model management method provided by an embodiment of the present application will be described in detail below in combination with the accompanying drawings, specific embodiments, and application scenarios.
[0077] Figure 1 FIG. 1 is a flowchart of a model management method provided by an embodiment of the present application. The execution subject of the model management method can be an electronic device.
[0078] The electronic device can be a mobile phone, a tablet computer, a smart wearable device, an edge side device, a cloud service device, a server, or a server cluster, and the present application does not make a specific limitation thereto.
[0079] The model management method provided by an embodiment of the present application will be described below with the execution subject of the model management method being an electronic device as an example. It should be noted that the above execution subject and application scenario do not constitute a limitation on the present application.
[0080] As shown in FIG. 1, the model management method provided by an embodiment of the present application can include the following steps. Figure 1As shown, the model management method provided in this application embodiment may include steps 110-140.
[0081] Step 110: Obtain the first model, edit the first model based on the first input, and save the edited first model as the first template. The first input is used to set N first modules in each level of the first model to a replaceable state, and to add runtime dependency files corresponding to the N first modules. The runtime dependency files store parameter information for at least one Simulink model.
[0082] Step 120: Create at least one second model based on the first template, and display the corresponding nodes of each level of the second model's modules in the model configuration interface of the second model. Each level of modules includes N first modules and the remaining N first modules as second modules. The display parameters corresponding to the nodes of the first modules and the second modules are different.
[0083] Step 130: In response to the second input to the node corresponding to the target module in the N first modules, update the target module in the second model based on the parameter information of the target Simulink model in the runtime dependency file corresponding to the target module, and obtain the updated second model, wherein the target Simulink model is the Simulink model that matches the target module.
[0084] The model management method provided in the embodiments of the present application can be used to edit a first model based on a first input in a scenario where a sensor is placed in a first scene and the first model needs to be simulated. The first input can be an editing input of a first user who is familiar with the first model. Through the first input, N first modules in each level of modules corresponding to the first model can be set to a replaceable state, and N running dependency files corresponding to the N first modules can be added respectively. After the editing, a first template can be obtained. In this way, when the first model is simulated subsequently, a new model consistent with the model framework of the first model can be created based on the template, and at least one second model can be obtained. Since the N first modules to be updated are selected in advance through the first input, and a running dependency file corresponding to each first module is allocated, in this step, the electronic device can display nodes corresponding to each level of modules of the second model in a model configuration interface of the second model, and the display parameters of the nodes corresponding to the first modules and the remaining second modules that are not selected are different. Therefore, even for a second user who is not familiar with the first model, the N first modules to be updated can be quickly found from each level of modules, and the searching speed is improved. Moreover, since the running dependency file corresponding to each first module is specified in advance through the first input, when a target module selected by the user is replaced, the electronic device can directly update the target module in the second model based on the parameter information of a target Simulink model matched in the running dependency file corresponding to the target module, without the need for the user to search for the corresponding running dependency file again, so that the module replacement step is simplified, and the module replacement speed and efficiency are effectively improved.
[0085] The specific implementation of the above steps will be described in detail below with reference to specific embodiments.
[0086] In step 110, N is an integer greater than 1, the first model is an original system model to be simulated, and the first input is an editing input for editing the first model. Through the first input, N first modules in each level of modules corresponding to the first model can be set to a replaceable state, and a running dependency file corresponding to each first module can be added in a module configuration interface of the first module. The first module is a module to be replaced selected by the user through the first input.
[0087] In some embodiments of the present application, the first input can include a third sub-input, a fourth sub-input and a fifth sub-input, and step 110 can include the following steps: obtaining the first model, parsing the first model to obtain a parsing result, displaying nodes corresponding to modules of each level of the first model on a template configuration interface based on the parsing result, displaying a module editing interface of a first module in response to the third sub-input to the node corresponding to the first module, the module editing interface including a first control and a second control, setting the first module to a replaceable state in response to the fourth sub-input to the first control, the first module being replaceable in the replaceable state, and adding a corresponding running dependency file for the first module in response to the fifth sub-input to the second control.
[0088] Specifically, the nodes can be module identifiers, module icons, etc. The electronic device parses the first model by layer by layer reading the modules of the first model to obtain a parsing result, which can include parameter information of the modules of each level, including input parameters, output parameters and encapsulation parameters. The third sub-input can be a touch input such as a click input, a double-click input, a long-press input, etc. of the user to select the first module from the modules of each level and to the node corresponding to the first module. The first control is used to edit the specific state of the module, and the second control is used to add a running dependency file corresponding to the module. The fourth sub-input and the fifth sub-input can be touch inputs of the user to the first control and the second control, respectively.
[0089] In some embodiments, the dependency file can be a.m file, a.mat file, a.c file, etc., which is not specifically limited in the present application. The m file is a file that saves a piece of code, similar to a function body in C language, and is one of the most common file saving formats in matlab (Matrix Laboratory). The.mat file is a standard format for data storage in matlab, that is, a collection package of data generated by operation, which can save the results of one processing for next time use.
[0090] In some embodiments, displaying nodes corresponding to modules of each level of the first model on the template configuration interface can include: displaying a model structure tree including nodes corresponding to modules of each level of the first model on the template configuration interface.
[0091] For example, if the first model is "X_Model", when a first template is newly created based on the first model, the template creation interface 201 shown in FIG. 2A can be filled with a template name "Template 1", a template description "Test Template", and the first model "X_Model" selected from all files. Thus, the template configuration interface 202 can display nodes corresponding to modules of each level of "X_Model", for example, as shown in FIG. 2B. Figure 2 Figure 2 The illustrated modules A, templates B, lower-level modules A-1, A-2 of the module A, and lower-level modules B-1, B-2 of the module B. The third sub-input can be a double-click input of the user on the first module corresponding node "A-1". In response to the third sub-input, a module editing interface 203 of the first module A-1 is displayed on the template configuration interface 202, the module editing interface 203 includes a first control 204 and a second control 205. In response to a fourth sub-input on the first control 204, the first module A-1 is set to a replaceable state. In response to a fifth sub-input on the second control 205, a corresponding running dependency file "target file 1" is added to the first module A-1. The target file 1 can store parameter information of at least one simulink model, and the at least one simulink model includes a simulink model matching the first module A-1. In addition, the module editing interface 203 can also include module detail information of the first module A-1. The module detail information can include module name, whether to be encapsulated, encapsulation parameters, input, and output.
[0092] In some embodiments of the present application, parsing the first model can include, in the case that the first model includes a subsystem module at each level of the module, parsing lower-level modules of the subsystem module to obtain sub-modules of the subsystem module.
[0093] The electronic device can perform module acquisition, encapsulation parameter, and input / output parsing on the first model by calling a series of functions in matlab for operating the simulink model. If the first model has a module of the subsystem type, that is, a subsystem module, the electronic device further performs a deeper layer of parsing on the subsystem module to obtain lower-level modules of the subsystem module. In this way, the entire first model is parsed layer by layer to obtain each level of module corresponding to the first model.
[0094] In step 120, the first template is obtained based on the first model. The first template retains the model framework of the first model. Therefore, at least one second module created based on the first template has the same model framework as the first model, that is, the second model has the same level of module as the first model before being updated, and the parameter information of each level of module is also the same.
[0095] In some embodiments, the display parameter can include at least one of display color, display transparency, display line, display font, display size, and display style.
[0096] For example, after a first template "template 1" is newly created based on a first model "X_Model", a second model "Y_Model" can be created based on the "template 1", as shown in Figure 3As shown, in the model configuration interface 301 of the second model "X_Model", nodes corresponding to the modules "Module A, Template B, sub-modules A-1 and A-2 of Module A, and sub-modules B-1 and B-2 of Module B" can be displayed. In order to facilitate the user to distinguish the N first modules from the remaining modules, the display parameters of the nodes corresponding to the N first modules and the remaining modules are different. For example, the N first modules include A-1 and B-2, and the second modules include A, B, A-2 and B-1. As shown in the figure, Figure 3 As shown, the nodes corresponding to A-1 and B-2 can be displayed in bold and underlined, which is different from the nodes corresponding to the second modules.
[0097] In some embodiments of the present application, Figure 4 is a flowchart of a model management method provided by another embodiment of the present application. After step 110 and before step 120, the method can further include Figure 4 as shown in steps 410-430.
[0098] Step 410, in the case of creating a second model, a preset template file is obtained, the preset template file includes template information of a plurality of templates, and the plurality of templates include a first template,
[0099] Step 420, based on the template information of the plurality of templates, previewing the template description and the top layer screenshot of the plurality of templates,
[0100] Step 430, in response to a selection operation on the first template in the plurality of templates, creating a second model based on the first template.
[0101] In the embodiments of the present application, all template information is stored in a designated folder, so before creating a second model, the electronic device reads all template information in the designated folder, and presents the plurality of previously created template information for the user to select. In order to facilitate the user to select, the electronic device can preview the template description and the top layer screenshot of the model selected by the user by reading the template information, so as to facilitate the user to quickly understand the template information and quickly select the appropriate template. After the template selection is completed, at least one second model created by the project is based on this template, and the plurality of second models are simulated and compared after the module, which facilitates the analysis of the influence of different modules on the overall system.
[0102] In one embodiment, all models under the same template can be generated and managed by the same project. The project-based model management makes it easy to manage models created based on the same template, facilitates communication and simulation comparison.
[0103] In step 130, in order to study the influence of different modules on the whole system model, the electronic device can create at least one second model, in different second models, different first modules can be replaced to study the influence of different first modules on the whole system model, and the efficient replacement of N first modules is realized. Therefore, the second input can be the input of selecting the corresponding target module in the model configuration interface of the different second models for each second model.
[0104] Exemplarily, as shown in the model configuration interface 301 of the second model "X_Model", the nodes corresponding to the modules "Module A, Template B, the sub-modules A-1 and A-2 of Module A, and the sub-modules B-1 and B-2 of Module B" at different levels can be displayed. The second input can be the selection input of the user's click input, double-click input, long-press input, etc. on the node corresponding to the target module A-1 in the first module A-1 and B-2, and the application does not make specific limitations on this. Figure 3
[0105] In some embodiments of the application, Figure 5 is a flowchart of the model management method provided by another embodiment of the application, and before the step 130 of "updating the target module in the second model", the method can further include Figure 5 steps 510 and 520 shown in the figure.
[0106] Step 510, in response to the second input, display the module configuration interface corresponding to the target module,
[0107] Step 520, in response to the third input on the module configuration interface, from the running dependency file corresponding to the target module, the parameter information of the target simulink model matched with the target module is obtained.
[0108] Among them, the third input can be an input that triggers the electronic device to read the running dependency file corresponding to the target module, and the electronic device determines and obtains the parameter information of the target simulink model matched with the target module, or the third input can be a selection input of the user on the parameter information of the target simulink model after triggering the electronic device to read the running dependency file corresponding to the target module. That is, the target simulink model matched with the target module can be determined by the electronic device itself, or can be selected by the user.
[0109] In some embodiments of the present application, the target Simulink model matched with the target module can be autonomously selected by the user, the third input can include the first sub-input and the second sub-input, and step 520 can include the following steps: in response to the first sub-input to the module configuration interface, obtaining parameter information of at least one Simulink model in the target module and its corresponding running dependency file, filtering, from the at least one Simulink model, a candidate Simulink model that meets the first matching condition with the target module by comparing the parameter information of the target module and the at least one Simulink model, and in response to the second sub-input of selecting the target candidate Simulink model from the candidate Simulink model, determining the target candidate Simulink model as the target Simulink model.
[0110] In some embodiments of the present application, the target module can include a module configuration interface, the first sub-input can be an input for triggering the electronic device to display the candidate Simulink model that meets the first matching condition with the target module, and the first matching condition can include that the input parameters and the output parameters of the target module match the Simulink model. The second sub-input can be an input for selecting the target candidate Simulink model from the candidate Simulink model.
[0111] In some embodiments, the module configuration interface of the target module can include name information of the running dependency file corresponding to the target module, the first sub-input can be a click input, a long press input, a double-click input, etc. on the name information, and the present application does not make specific limitations on this. The second sub-input can be a click input, a long press input, a double-click input, etc. on the target candidate Simulink model, which is an input for selecting the target candidate Simulink model, and the present application does not make specific limitations on this.
[0112] In one example, in Figure 3 As shown in the module configuration interface 301, when the electronic device receives the second input of the user selecting the node corresponding to the target module A-1, in response to the second input, the module configuration interface 302 of the target module A-1 is displayed in the module configuration interface 301, and the replacement operation can be performed on the target module A-1 in the module configuration interface 302. Specifically, the module configuration interface 302 can include the name information “target file 1” 303 of the running dependency file corresponding to the target module, the first sub-input can be a double-click input on 303, and in response to the double-click input, the electronic device can filter, from all Simulink models of the target file 1, a candidate Simulink model that matches the parameter information of the target module A-1. Based on this, the electronic device can receive the second sub-input of the user selecting the target candidate Simulink model from the candidate Simulink model, and in response to the second sub-input, the target candidate Simulink model is determined as the target Simulink model.
[0113] The model management method provided in the embodiments of the present application first builds the entire system framework by the modeling personnel who is familiar with the entire system, and determines the interfaces between the modules. Based on the built framework model, i.e., the first model, a first template is established, and the N first modules that need to be replaced and their corresponding running dependency files are specified in the first template. In this way, since the N first module corresponding nodes can be highlighted in the model configuration interface based on the second model, even the user who is not familiar with the first model or the model framework can quickly replace the first module based on the specified running dependency file in the model configuration interface, the model use threshold is reduced, the module replacement step is simple, and the error rate is low. In different second models, the N first modules can be quickly replaced by other modules, and the influence analysis of a single module on the overall model is realized.
[0114] In some embodiments of the present application, for the second module which is not set to the replaceable state, the second module can be updated, Figure 6 is a flowchart of the model management method provided in another embodiment of the present application. After step 120, the method can further include Figure 6 The steps 610 and 620 shown.
[0115] Step 610, in response to the second input to the second module corresponding node, display the module configuration interface of the second module, and the module configuration interface includes the packaging parameters of the second module,
[0116] Step 620, in response to the fourth input to the packaging parameters, update the packaging parameters of the second module.
[0117] The fourth input is an editing input to the packaging parameters, which can be a voice input, a keyboard input, a touch input, etc., which is not limited in the present application.
[0118] For example, the second module is A-2, and its packaging parameter is 3. The fourth input can be an editing input that modifies the packaging parameter 3 to 2.
[0119] In the embodiments of the present application, for the second module which is not set to the replaceable state, the parameter of the second module in the second model can be modified, which is simple to operate and can quickly complete the modification operation.
[0120] In some embodiments of the present application, after updating the target module in the second model to obtain the updated second model, the method can further include: calling the model checker tool of simulink to perform model interface checking on the updated second model, and generating a checking report.
[0121] In this embodiment, the model configuration interface of the second model can provide an interface check control. Touch input to this control triggers the electronic device to call Simulink's model checker tool to check the currently generated second model. Check items may include, but are not limited to: whether interfaces are connected, whether units between modules match, and whether there are any missing runtime dependency files. This allows users to quickly check the correctness of the model, reducing the time spent manually troubleshooting.
[0122] It is understood that the model management method provided in this application embodiment can be executed by an electronic device or a control module in a model management device for executing the model management method. The model management device will now be described in detail.
[0123] Figure 7 This is a schematic diagram of the structure of a model management device provided in an embodiment of this application. Figure 7 As shown, the model management device 700 may include: an editing module 710, a display module 770, and an update module 730.
[0124] The editing module 710 is used to obtain a first model, edit the first model based on a first input, and save the edited first model as a first template. The first input is used to set N first modules in each level of the first model to a replaceable state, and to add the runtime dependency files corresponding to the N first modules respectively. The runtime dependency files store the parameter information of at least one Simulink model.
[0125] Display module 720 is used to create at least one second model based on the first template, and to display the corresponding nodes of each level of modules of the second model on the model configuration interface of the second model. Each level of modules includes N first modules and the remaining N first modules as second modules. The display parameters corresponding to the nodes of the first modules and the second modules are different.
[0126] The update module 730 is used to update the target module in the second model in response to the second input of the node corresponding to the target module in the N first modules, based on the parameter information of the target Simulink model in the runtime dependency file corresponding to the target module, so as to obtain the updated second model, wherein the target Simulink model is the Simulink model that matches the target module.
[0127] The model management apparatus provided in the application can edit a first model based on a first input in a scenario where the first model needs to be simulated. The first input can be an editing input of the first model by a first user who is familiar with the first model. Through the first input, N first modules in each level of modules corresponding to the first model can be set to a replaceable state, and N running dependency files corresponding to the N first modules are added respectively. After editing, a first template can be obtained. In this way, when the first model is simulated subsequently, a new model consistent with the model framework of the first model can be created based on the template, and at least one second model is obtained. Since the N first modules to be updated are preselected by the first input, and a corresponding running dependency file is allocated to each first module, in this step, the electronic device can display nodes corresponding to each level of modules of the second model in a model configuration interface of the second model, and the display parameters of the nodes of the first modules and the nodes of the remaining second modules that are not selected are different. Therefore, even for a second user who is not familiar with the first model, the N first modules to be updated can be quickly found from each level of modules, and the searching speed is improved. Moreover, since the running dependency file corresponding to each first module is pre-specified by the first input, when a target module selected by the user is replaced, the electronic device can directly update the target module in the second model based on the parameter information of the target Simulink model matched in the running dependency file corresponding to the target module, without the user searching for the corresponding running dependency file again, thereby simplifying the module replacement step and effectively improving the module replacement speed and efficiency.
[0128] In some implementable manners of the second aspect, the apparatus further includes:
[0129] The display module 720 is further configured to, before updating the target module in the second model, display a module configuration interface corresponding to the target module in response to a second input,
[0130] The acquisition module is configured to, in response to a third input to the module configuration interface, acquire parameter information of a target Simulink model matched with the target module from the running dependency file corresponding to the target module.
[0131] In some implementable manners of the second aspect, the third input includes a first sub-input and a second sub-input, and the acquisition module includes:
[0132] The acquisition unit is configured to, in response to the first sub-input to the module configuration interface, acquire parameter information of at least one Simulink model in the target module and the running dependency file corresponding to the target module,
[0133] The screening unit is configured to screen, from the at least one Simulink model, a candidate Simulink model satisfying a first matching condition with the target module by comparing parameter information of the target module with the at least one Simulink model,
[0134] The determining unit is configured to determine the target candidate Simulink model as the target Simulink model in response to a second sub-input of selecting the target candidate Simulink model from the candidate Simulink models.
[0135] In some implementable manners of the second aspect, the apparatus further includes:
[0136] The display module 720 is further configured to display a module configuration interface of the second module in response to a second input of the second module corresponding node, the module configuration interface including the packaging parameter of the second module,
[0137] The update module 730 is further configured to update the packaging parameter of the second module in response to a fourth input of the packaging parameter.
[0138] In some implementable manners of the second aspect, the first input includes a third sub-input, a fourth sub-input and a fifth sub-input, and the editing module 710 includes:
[0139] The parsing unit is configured to obtain the first model, parse the first model, and obtain a parsing result,
[0140] The display unit is configured to display nodes corresponding to each level module of the first model on the template configuration interface based on the parsing result,
[0141] The display unit is further configured to display a module editing interface of the first module in response to a third sub-input of a node corresponding to the first module in the each level module, the module editing interface including a first control and a second control,
[0142] The setting unit is configured to set the first module to a replaceable state in response to a fourth sub-input of the first control, the first module being replaceable in the replaceable state,
[0143] The adding unit is configured to add a corresponding running dependency file for the first module in response to a fifth sub-input of the second control.
[0144] In some implementable manners of the second aspect, the parsing unit is specifically configured to parse a lower level module of a subsystem module to obtain a sub-module of the subsystem module in a case where the each level module of the first model includes the subsystem module.
[0145] In some implementable manners of the second aspect, the apparatus further includes:
[0146] The acquisition module is configured to acquire a preset template file in the case of creating the second model, the preset template file including template information of a plurality of templates, the plurality of templates including the first template,
[0147] The preview module is configured to preview template description and a top layer screenshot of the plurality of templates based on the template information of the plurality of templates,
[0148] The creation module is configured to create the second model based on the first template in response to a selection operation on the first template in the plurality of templates.
[0149] In some implementable manners of the second aspect, the apparatus further includes an inspection module configured to, after updating the target module in the second model to obtain an updated second model, invoke a model inspector tool of simulink to perform model interface inspection on the updated second model, and generate an inspection report.
[0150] In some implementable manners of the second aspect, the parameter information includes input parameters, output parameters and encapsulation parameters.
[0151] The model management apparatus provided by the embodiments of the present application can implement Figures 1-6 The method embodiments of the present application can implement the various processes of the electronic device and achieve the same technical effects. To avoid repetition, the same technical effects will not be described here.
[0152] Figure 8 is a hardware structure schematic diagram of an electronic device provided by the embodiments of the present application.
[0153] As shown in Figure 8 , the electronic device 800 in the embodiment can include a processor 801 and a memory 802 having computer program instructions stored therein.
[0154] Specifically, the processor 801 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or can be configured as one or more integrated circuits that implement the embodiments of the present application.
[0155] The memory 802 can include mass storage for data or instructions. As an example and not by way of limitation, the memory 802 can include a hard disk drive (HDD), a floppy disk drive, flash memory, an optical disc (e.g., a compact disc (CD) or a digital versatile disc (DVD)), a solid-state drive (SSD), a USB drive, or a combination of two or more of these. Where appropriate, the memory 802 can include removable or non-removable (or fixed) media, where appropriate. The memory 802 can be internal or external to the integrated gateway disaster recovery appliance. In particular embodiments, the memory 802 is non-volatile, solid-state memory. The memory can include read-only memory (ROM), random-access memory (RAM), a magnetic disk storage medium, an optical storage medium, flash memory devices, electrical, optical, or other physically tangible / physical memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) that includes computer-executable instructions (e.g., software) that, when executed (e.g., by one or more processors), are operable to perform the operations described with respect to the methods according to embodiments of the application.
[0156] The processor 801 implements any one of the model management methods in the above embodiments by reading and executing computer program instructions stored in the memory 802.
[0157] In one example, the electronic device 800 can further include a communication interface 803 and a bus 810. Wherein, as shown, the processor 801, the memory 802, the communication interface 803 are connected through the bus 810 and complete the communication between each other. Figure 8
[0158] The communication interface 803 is mainly used to realize the communication between each module, device, unit and / or equipment in the embodiments of the application.
[0159] Bus 810 includes a hardware, software, or both that couples components of the online data traffic billing device to each other. As an example and not by way of limitation, the bus can include an accelerated graphics port (AGP) or other graphics bus, an enhanced industry standard architecture (EISA) bus, a front-side bus (FSB), a HyperTransport (HT) interconnect, an industry standard architecture (ISA) bus, an infiniband (IB) interconnect, a low pin count (LPC) bus, a memory bus, a microchannel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standards board (VLB) bus, or another suitable bus or a combination of two or more of these. Where suitable, bus 810 can include one or more buses. Although this application describes and illustrates a particular bus, this application contemplates any suitable bus or interconnect.
[0160] The electronic device provided by the embodiments of the present application can realize Figures 1-6 The method embodiments of the present application can realize the various processes of the electronic device and achieve the same technical effects. To avoid repetition, the details are not described here.
[0161] In combination with the model management method in the above embodiments, the embodiments of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; the computer program instructions are executed by a processor to realize the steps of any one of the model management methods in the above embodiments.
[0162] In combination with the model management method in the above embodiments, the embodiments of the present application can provide a computer program product for implementation. The (computer) program product is stored in a non-volatile storage medium, and the program product is executed by at least one processor to realize the steps of any one of the model management methods in the above embodiments.
[0163] The embodiments of the present application further provide a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, the processor is used to run programs or instructions, realize the various processes of the above model management method embodiments, and can achieve the same technical effects. To avoid repetition, the details are not described here.
[0164] It should be understood that the chip mentioned in the embodiments of the present application can also be referred to as a system-level chip, a system chip, a chip system, or a system-on-chip chip, etc.
[0165] It is to be understood that the application is not limited to the particular configurations and processes described hereinabove and shown in the figures. For the sake of brevity, detailed descriptions of known methods and processes are omitted. In the above embodiments, several specific steps are described and illustrated as examples. However, the method processes of the present application are not limited to the specific steps described and illustrated, and various changes, modifications and additions can be made thereto by one skilled in the art without departing from the spirit of the present application, and the order of the steps can be changed.
[0166] The functional blocks shown in the above described block diagrams can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, and the like. When implemented in software, the elements of the present application are program or code segments that are used to perform the required tasks. The program or code segments can be stored in a machine-readable medium or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. A "machine-readable medium" includes any medium that can store or transfer information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and the like. The code segments can be downloaded via computer networks such as the Internet, intranets, and the like.
[0167] It is also to be understood that the example embodiments described in the present application are based on a series of steps or apparatus to describe some methods or systems. However, the present application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in an order different from the embodiments, or several steps can be performed simultaneously.
[0168] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0169] The above only specifically describes the embodiments of the present application. For the convenience and brevity of description, the specific working processes of the above-described system, module and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described herein. It should be understood that the protection scope of the present application is not limited in this way. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed in the present application, and these modifications or replacements should be covered within the protection scope of the present application.
Claims
1. A model management method, characterized in that, The method includes: Obtain a first model, edit the first model based on a first input, and save the edited first model as a first template. The first input is used to set N first modules in each level of the first model to a replaceable state, and to add runtime dependency files corresponding to the N first modules. The runtime dependency files store parameter information for at least one Simulink model. At least one second model is created based on the first template, and the corresponding nodes of each level of the second model's modules are displayed in the model configuration interface of the second model. The modules at each level include the N first modules and the second modules other than the N first modules. The display parameters corresponding to the nodes of the first modules and the second modules are different. In response to the second input of the node corresponding to the target module among the N first modules displayed on the model configuration interface, the target module in the second model is updated based on the parameter information of the target Simulink model in the runtime dependency file corresponding to the target module, to obtain the updated second model, wherein the target Simulink model is a Simulink model that matches the target module.
2. The method according to claim 1, characterized in that, Before updating the target module in the second model, the method further includes: In response to the second input, the module configuration interface corresponding to the target module is displayed. In response to a third input to the module configuration interface, parameter information of the target Simulink model that matches the target module is obtained from the runtime dependency file corresponding to the target module.
3. The method according to claim 2, characterized in that, The third input includes the first sub-input and the second sub-input. In response to the third input to the module configuration interface, the parameter information of the target Simulink model matching the target module is obtained from the runtime dependency file corresponding to the target module, including: In response to the first sub-input to the module configuration interface, parameter information of the target module and at least one Simulink model in its corresponding runtime dependency file is obtained. By comparing the parameter information of the target module with that of the at least one Simulink model, candidate Simulink models that meet the first matching condition are selected from the at least one Simulink model. In response to selecting a second sub-input of the target candidate Simulink model from the candidate Simulink models, the target candidate Simulink model is determined to be the target Simulink model.
4. The method according to claim 1, characterized in that, The method further includes: In response to a second input to the node corresponding to the second module, the module configuration interface of the second module is displayed, the module configuration interface including the encapsulation parameters of the second module. In response to a fourth input to the encapsulation parameters, the encapsulation parameters of the second module are updated.
5. The method according to claim 1, characterized in that, The first input includes a third sub-input, a fourth sub-input, and a fifth sub-input. The step of obtaining the first model and editing the first model based on the first input includes: Obtain the first model, parse the first model, and obtain the parsing result. Based on the analysis results, the corresponding nodes of each level of modules of the first model are displayed in the template configuration interface. In response to a third sub-input to the node corresponding to the first module in each level of modules, the module editing interface of the first module is displayed. The module editing interface includes a first control and a second control. In response to a fourth sub-input to the first control, the first module is set to a replaceable state, in which the first module can be replaced. In response to the fifth sub-input of the second control, add the corresponding runtime dependency file for the first module.
6. The method according to claim 5, characterized in that, The analysis of the first model includes: In the case where subsystem modules are included in each level of the first model, the lower-level modules of the subsystem modules are parsed to obtain the submodules of the subsystem modules.
7. The method according to claim 1, characterized in that, The method further includes: When creating the second model, a preset template file is obtained. The preset template file includes template information for multiple templates, including a first template. Based on the template information of the multiple templates, preview the template descriptions and top-level screenshots of the multiple templates. In response to the selection operation of the first template among the plurality of templates, a second model is created based on the first template.
8. The method according to claim 1, characterized in that, After updating the target module in the second model to obtain the updated second model, the method further includes: The Simulink model inspector tool is invoked to perform a model interface check on the updated second model and generate an inspection report.
9. The method according to any one of claims 1-8, characterized in that, The parameter information includes input parameters, output parameters, and encapsulation parameters.
10. A model management device, characterized in that, The device includes: An editing module is used to obtain a first model, edit the first model based on a first input, and save the edited first model as a first template. The first input is used to set N first modules in each level of the first model to a replaceable state, and to add runtime dependency files corresponding to the N first modules. The runtime dependency files store parameter information for at least one Simulink model. The display module is used to create at least one second model based on the first template, and to display the corresponding nodes of each level of modules of the second model in the model configuration interface of the second model. The modules at each level include the N first modules and the second modules other than the N first modules. The display parameters corresponding to the nodes of the first modules and the second modules are different. An update module is used to respond to the second input of the node corresponding to the target module among the N first modules displayed on the model configuration interface, and update the target module in the second model based on the parameter information of the target Simulink model in the runtime dependency file corresponding to the target module, so as to obtain the updated second model, wherein the target Simulink model is a Simulink model that matches the target module.
Citation Information
Patent Citations
Combat simulation development method and system
CN114896026A
Process architecture modeling platform
US20210248278A1