Method for creating dynamic configuration custom model

By configuring parameter models and calculation templates, correlation and generation of computing instances are solved, the problem of low flexibility in the computing model in the prior art is achieved, dynamic configuration and flexibility are achieved, and computing efficiency and user demand response speed are improved.

CN119473259APending Publication Date: 2025-02-18CHINA HELICOPTER RES & DEV INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411440105.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

When the prior art faces complex calculation formulas and multiple calculation tasks, the flexibility of the calculation model is extremely low, modifying the calculation formula is time-consuming, the code maintenance cost is high, and it is impossible to dynamically adjust the calculation configuration according to user needs in real time.

Method used

By configuring the parameter model and calculation template, the parameter model and calculation template are associated, and the calculation examples are generated to realize dynamic addition of the calculation model, free configuration of parameters and algorithms, and flexible corrections at runtime.

Benefits of technology

It realizes dynamic configuration and flexibility of the computing model, reduces code maintenance costs, and improves computing efficiency and response speed of user requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473259A_ABST
    Figure CN119473259A_ABST
Patent Text Reader

Abstract

The invention provides a method for creating a dynamic configuration custom model. The method comprises the following steps: step 1, configuring a parameter model; 2, configuring a calculation template; 3, associating parameters in the parameter model with parameters in the calculation template, and completing association configuration of the parameter model and the calculation template to obtain a calculation model; step 4, generating a calculation instance based on the calculation model; wherein the calculation instance is used for calling calculation; according to the method, unified configuration management can be carried out on the calculation model, the calculation file is generated by editing the Exce l file, a calculation formula does not need to be written into an underlying code, a standardized calculation file template is provided, program maintenance is facilitated, and the time for modifying the code is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computers and engineering computing technology, and in particular relates to a method for creating a dynamically configured custom model. Background Art

[0002] In the engineering field, a large amount of precise calculations are often required to ensure the safety, stability and efficiency of the design; in the computer field, calculations are everywhere, from basic algorithm design to complex image processing and big data analysis, a large amount of calculations are required.

[0003] In order to realize the demand scenarios such as mathematical calculations and statistical analysis calculations based on complex formulas, application systems usually integrate different calculation methods into the system by writing code. Currently, most implementation methods are to write the calculation formula into the underlying code at a fixed location. When writing the code, the parameters involved in the calculation need to be known, and their data sources and parameter contents must be clear and written into the underlying code together with the calculation formula.

[0004] Based on this situation, the calculation flexibility is extremely low, modifying the calculation formula is time-consuming, the code maintenance cost is high, and more importantly, it is impossible to dynamically adjust the calculation configuration according to user needs in real time. Summary of the invention

[0005] Purpose of the invention: In view of the problems existing in the prior art, the present invention proposes a method for creating a dynamically configured custom model to solve the problem of dynamically adding calculation models, freely configuring parameters and algorithms, and flexibly modifying the calculation mode during runtime when facing complex calculation formulas and needing to carry out multiple calculation tasks at the same time, so as to further improve the calculation and maintenance efficiency.

[0006] The present application provides a method for creating a dynamically configured custom model, the method comprising:

[0007] Step 1: Configure parameter model;

[0008] Step 2: Configure the calculation template;

[0009] Step 3: Associating the parameters in the parameter model with the parameters in the calculation template, completing the association configuration of the parameter model and the calculation template, and obtaining the calculation model;

[0010] Step 4: Generate a computing instance based on the computing model; wherein the computing instance is used to call the computing.

[0011] Preferably, the step 1 comprises:

[0012] By entering the input parameter attributes required for calculation and the calculation result parameter attributes, the definition and construction of the parameter model are completed.

[0013] Preferably, step 2 comprises:

[0014] Write the input parameters and calculation result parameters required for calculation into the corresponding cells of the Excel file together with the calculation formula to generate a calculation file;

[0015] Upload the calculation file, the program receives and reads the content of each cell in the calculation file to generate a calculation template;

[0016] Identify and analyze the read content;

[0017] If it is recognized as an input parameter or a calculation result parameter, its parameter name, parameter type and unit are obtained;

[0018] If it is identified as a calculation formula, the computability of the calculation formula is judged. First, the calculation parameters in the calculation formula are extracted to determine whether they exist in the parameter list, and then whether the parameter types of the two are consistent. If both are correct, the calculation formula is obtained; wherein the parameter list is generated based on the parameter name, parameter type and unit;

[0019] Write the parsed input parameters, calculation result parameters and calculation formula into the prototype of the calculation template;

[0020] Establish an extensible general type library and write the rules into the calculation template. Now the calculation template is constructed.

[0021] Preferably, the step of writing the input parameters and calculation result parameters required for the calculation into corresponding cells of the Excel file in combination with the calculation formula, before generating the calculation file, further includes:

[0022] Create an Excel format file.

[0023] Preferably, the calculation template is used to store calculation logic information.

[0024] Preferably, the calculation logic information includes input parameters, calculation formulas, and calculation results.

[0025] Preferably, the types of parameters include numerical values, one-dimensional arrays, and two-dimensional arrays.

[0026] Preferably, the step of establishing an extensible general type library and writing calculation rules into calculation templates includes:

[0027] Different types of parameters are processed uniformly, by setting independent rules for each type, building an extensible general type library, and writing the calculation rules into the calculation template to achieve the reading and calculation of various types of parameters.

[0028] The beneficial effects of the present invention are as follows:

[0029] 1) The present invention can uniformly configure and manage the calculation model, generate the calculation file by editing the Excel file, and does not need to write the calculation formula into the underlying code. It provides a standardized calculation file template, which is beneficial to program maintenance and saves time for code modification.

[0030] 2) The present invention realizes the visual configuration function of the calculation model, and can intuitively operate and display the parameters and formulas involved in the calculation process through online configuration, making the configuration process clearer and more efficient.

[0031] 3) The present invention realizes the automatic verification function of the calculation file, and can judge and prompt situations such as format errors or empty values ​​in parameters and calculation formulas, so as to facilitate users to quickly locate errors and improve usage efficiency.

[0032] 4) The present invention establishes an extensible general type library to achieve pre-calculation conversion processing and calculation result analysis of different types of parameters, thereby meeting customized needs in a flexible manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a flowchart of a method for building a dynamically configured custom model provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] See also Figure 1 The present invention proposes a method for constructing a dynamically configured custom model. By creating a calculation model library, defining a parameter model, and writing calculation rules, the construction of different calculation models is completed. According to different calculation needs of users, the calculation model can be easily "adjusted and used". The obtained calculation results can be output to the parameter model according to certain reading rules, and the binding between the calculation results and the output parameters and the result parameter storage process are completed. After the result parameters are stored in the library, they can be flexibly called later.

[0035] The specific implementation steps of this method are as follows:

[0036] 1) Create a calculation model and automatically generate a prototype of the parameter model and a prototype of the calculation template.

[0037] 2) Complete the definition and construction of the parameter model by entering the input parameter attributes and calculation result parameter attributes required for the calculation.

[0038] 3) Create an Excel format file, write the input parameter attributes and calculation result parameter attributes entered in step 2) into the corresponding cells of the Excel format file together with the calculation formula to generate a calculation file.

[0039] 4) Upload the calculation file, the program receives and reads the content of each cell in the calculation file to generate a calculation template.

[0040] 5) Identify and parse the read content. If it is identified as an input parameter or a calculation result parameter, obtain its parameter name, parameter type and unit. If the acquisition is successful, proceed to the next step, otherwise return to step 3) to correct the calculation file.

[0041] 6) If it is identified as a calculation formula, the computability of the formula is judged. First, the calculation parameters in the formula are extracted to determine whether they exist in the parameter list obtained in step 5), and then whether the parameter types of the two are consistent. If both are correct, the next step is successfully entered, otherwise, it returns to step 3) to correct the calculation file; wherein, the parameter list is generated based on the input parameters, parameter names, parameter types and units of the calculation result parameters.

[0042] 7) Write the input parameters, calculation result parameters and calculation formula obtained by analysis into the prototype of the calculation template. The calculation template mainly stores the calculation logic information such as input parameters, calculation formula, calculation results, etc.

[0043] 8) The parameter type may be a number, a one-dimensional array, or a two-dimensional array. Therefore, parameters of different types need to be processed uniformly. This is done by creating independent rules for each type, building an extensible general type library, and writing the rules into the calculation template to achieve reading and calculation of parameters of various types. The calculation template is now complete.

[0044] 9) Then, the parameters in the parameter model are associated with the parameters in the calculation template until all parameter matching work is completed, that is, the association configuration between the parameter model and the calculation template is completed.

[0045] 10) At this point, all configuration work of the calculation model is completed, and a calculation instance can be generated for invoking calculations, and finally the calculation results can be parsed and read into the parameter model.

[0046] In other embodiments of the present application, taking the construction of a research and development platform by a research institute as an example, during the platform construction process, the development of multi-professional work nodes involves complex and diverse computing requirements. According to the method of the present invention, a computing management program that can meet various complex computing requirements is developed. By applying the method of the present invention, a computing mode of dynamic template addition, free configuration of parameters and algorithms, and runtime correction is realized. The specific implementation method is as follows:

[0047] 1) The administrator logs in to the backend and enters the calculation management module, creates and names a calculation model. After the model is created, the program will automatically generate and provide the parameter model and calculation template visual configuration interface of the model. Only after completing the relevant configuration content can a calculation model that can be called be generated.

[0048] 2) First, configure the parameter model, enter the parameter model visualization configuration interface, enter the input parameters required for the calculation, and the information related to the calculation result parameters, including: Chinese name, parameter name, data type, unit, default value, and whether it is a required item. After completing all parameter entry, click the Save button to complete the attribute definition and construction of the parameter model.

[0049] 3) Create a new Excel file locally, and write the input parameters, calculation result parameters, and calculation formulas required for related calculations into the corresponding cells of the Excel file. You can create a parameter table (write calculation parameters) and a calculation result table (write calculation result parameters and calculation formulas) by category. The parameters in the parameter table generally contain cell contents such as Chinese name, parameter name, parameter value, and unit, among which the Chinese name, parameter name, and unit need to be filled in; if the parameter value is a fixed value, it can be filled in directly. For example, if the parameter value is obtained through upstream circulation, online form entry, etc., you can only set the cell data type and keep the value empty. Later, before the calculation model is officially called to carry out the calculation, the data source related information can be configured to complete the association matching of the parameter value. The parameters in the calculation result table generally also contain cell contents such as Chinese name, parameter name, parameter value, and unit, among which the Chinese name, parameter name, and unit need to be filled in; the parameter value cell needs to be filled in with the calculation formula to build a calculation relationship with the parameters in the parameter table. After all information is entered, the final calculation file is generated.

[0050] 4) Upload the generated Excel calculation file to the calculation template visualization configuration interface in the background, and the program will read the cell content of each parameter in the file.

[0051] 5) Parse the input parameters and calculation result parameters, obtain all parameter names, parameter types, units and other basic attributes in the calculation file, and automatically perform verification and judgment. If there is a format error or the required value is empty, an error box will pop up on the interface, prompting you to modify the calculation file again and upload it.

[0052] 6) Parse and obtain the calculation formula, and judge the computability of the formula. First, extract the calculation parameters in the formula and determine whether they exist in the parameter list obtained in step 5), and then determine whether the parameter types of the two are consistent. If both are correct, proceed to the next step successfully. Otherwise, an error box will pop up on the interface, prompting you to modify the calculation file again and upload it.

[0053] 7) After two rounds of verification, the parameters and calculation formulas obtained through analysis are written into the calculation template, and the calculation template is displayed online on the web page through the visual configuration interface.

[0054] 8) Build a general type library, separate rules for parameter types such as numerical values, one-dimensional arrays, and two-dimensional arrays. By calling the relevant interfaces of the general type library, you can achieve unified processing of different types of parameters. The rules are written into the calculation template to realize the reading and calculation of various types of parameters. The calculation template is considered to be built only after this step is successfully executed.

[0055] 9) At this point, the parameter model and calculation template have been defined and constructed, but the association between them has not yet been formed. Therefore, it is necessary to associate the parameters in the parameter model with the parameters in the calculation template. For parameters that can only obtain values ​​through upstream circulation, form entry, etc., select such parameters in the parameter model list and bind them to the corresponding parameter value cells in the calculation template visualization configuration interface through the one-click binding function to build an association relationship. After all parameter bindings are completed, the association configuration between the parameter model and the calculation template is completed.

[0056] 10) The calculation model configuration work has been completed. The calculation instance can be generated as a sub-node of the platform workflow, obtain parameter data from the upstream, carry out relevant calculation work, and pass the generated calculation results to the downstream to form a data flow. The program provides an interface for its parameter model for each calculation instance, and can flexibly realize the reading and writing of parameter model source data by specifying database connection information and table field operation information.

[0057] It should be noted that:

[0058] 1) Unified configuration management of calculation models, support for the creation of multi-level model structure trees, and provide a visual configuration function interface for each calculation model, specifically: online editing of each calculation parameter and calculation result parameter field; and upload, display, and parameter association configuration of calculation templates.

[0059] 2) The reading and storage of the parameter data source of the calculation model supports common database types such as Oracle, MySQL, and SQL Server.

[0060] 3) When configuring the prototype of the calculation template, it supports the uploading and parsing of files with suffix formats of .xls and .xls, supports automatic verification of parameter formats, types and other attributes, judges and prompts when format errors or empty values ​​occur, and supports automatic verification of calculation formulas to judge whether the parameters involved in the calculation in the formula are consistent with the defined parameter information, and issues alarms for inconsistencies.

[0061] 4) Before calling the calculation model to carry out calculations, it is necessary to configure the input parameters required for the calculation. The relevant interfaces can be called flexibly according to actual needs to perform data source association operations by reading the database. The program provides an interface for the parameter model for each calculation instance. The database connection information and table field operation information must be specified to realize the reading and writing of the parameter model source data.

[0062] 5) When calling the calculation model to perform calculations, the parameter type may be a value or an array, and related complex calculations can be performed on one-dimensional arrays and two-dimensional arrays. By calling the established general type library interface, the preprocessing of a certain type of parameter value and the analysis of the calculation results can be realized. In addition, the general type library supports type extension. For special type parameters, customized development and expansion can be realized by calling the extension interface.

[0063] 6) When calling a calculation model to perform calculations, there is no limit on the number and frequency of calculation models that can be called simultaneously. A certain calculation model can be called multiple times and calculations can be performed at the same time. Multiple different calculation models can also be called to perform calculations simultaneously, and the parameters and results will not affect each other.

Claims

1. A method for creating a dynamically configured custom model, characterized in that: The method comprises: Step 1: Configure parameter model; Step 2: Configure the calculation template; Step 3: Associating the parameters in the parameter model with the parameters in the calculation template, completing the association configuration of the parameter model and the calculation template, and obtaining the calculation model; Step 4: Generate a computing instance based on the computing model; wherein the computing instance is used to call the computing.

2. The method according to claim 1, characterized in that The step 1 comprises: By entering the input parameter attributes required for calculation and the calculation result parameter attributes, the definition and construction of the parameter model are completed.

3. The method according to claim 2, characterized in that The step 2 comprises: Write the input parameters and calculation result parameters required for calculation into the corresponding cells of the Excel file together with the calculation formula to generate a calculation file; Upload the calculation file, the program receives and reads the content of each cell in the calculation file to generate a calculation template; Identify and analyze the read content; If it is recognized as an input parameter or a calculation result parameter, its parameter name, parameter type and unit are obtained; If it is identified as a calculation formula, the computability of the calculation formula is judged. First, the calculation parameters in the calculation formula are extracted to determine whether they exist in the parameter list, and then whether the parameter types of the two are consistent. If both are correct, the calculation formula is obtained; wherein the parameter list is generated based on the parameter name, parameter type and unit; Write the parsed input parameters, calculation result parameters and calculation formula into the prototype of the calculation template; Establish an extensible general type library and write the rules into the calculation template. Now the calculation template is constructed.

4. The method according to claim 3, characterized in that The input parameters and calculation result parameters required for the calculation are written into the corresponding cells of the Excel file together with the calculation formula. Before generating the calculation file, the following is also included: Create an Excel format file.

5. The method according to claim 4, characterized in that The calculation template is used to store calculation logic information.

6. The method according to claim 5, characterized in that The calculation logic information includes input parameters, calculation formulas, and calculation results.

7. The method according to claim 3, characterized in that The parameter types include numeric values, one-dimensional arrays, and two-dimensional arrays.

8. The method according to claim 7, characterized in that The method of establishing an extensible general type library and writing calculation rules into calculation templates includes: Different types of parameters are processed uniformly, by setting independent rules for each type, building an extensible general type library, and writing the calculation rules into the calculation template to achieve the reading and calculation of various types of parameters.