An open script-driven data model dynamic matching method

Through the open script-driven data model dynamic matching method, the problem of scientific research data not being managed in a unified manner is solved, online unified management and flexible processing of data are achieved, and data management efficiency and design efficiency are improved.

CN119473495BActive Publication Date: 2025-10-24CHINA HELICOPTER RES & DEV INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411440103.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-10-24
Estimated Expiration
2044-10-15

AI Technical Summary

Technical Problem

In existing technologies, scientific research data is not managed in a unified manner, has poor applicability, cannot flexibly respond to complex data processing needs, and requires a large workload for code modification, resulting in inefficient data management and reduced platform operation efficiency.

Method used

An open script-driven data model dynamic matching method is adopted. By designing configurable data model templates and open script program templates, data parameterization and dynamic matching are realized. The Python language is used for parameter conversion and calculation. The front and back ends are separated, and designers operate on a visual platform.

Benefits of technology

It realizes the unified online management and flexible processing of scientific research data, improves data management efficiency, simplifies design operations, and improves the flexibility and security of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473495B_ABST
    Figure CN119473495B_ABST
Patent Text Reader

Abstract

The application provides an open script-driven data model dynamic matching method, which comprises the following steps: according to a calculation requirement, performing data input on part of parameters in a parameter model, clicking calculation, calling a script running program, filling the input parameter data into an input module, then reading a latest script program file, compiling code, executing a main function, obtaining a calculation result, and returning a response object in a dictionary form; obtaining a response result, analyzing response content, judging whether the calculation is successful according to an execution state in the result; if the calculation is successful, locating each parameter according to a parameter dictionary primary key, using new data obtained by processing to replace old data or directly assigning values, simultaneously performing object type conversion, mapping the parameter dictionary back to an initial parameter object, and performing overall output.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of software integrated calling and processing, and particularly relates to a method for dynamically matching an open script-driven data model. BACKGROUND

[0002] In the process of engineering design, mathematical application, AI model processing, etc., due to strong subject specialization, part of the data is not uniformly managed online, and the designers manage and pass to others in the form of an Excel table locally. In addition, the data unit conversion, data extraction, type conversion, etc. are generally fixed in the code of the application platform and cannot be changed, or the correlation between data is realized through the configuration of a calculation formula. This form of data storage management and processing is mostly simple and targeted, and is suitable for a certain situation. In the face of complex data processing, frequent adjustment, structure customization and reorganization, etc., the original code needs to be modified on a large scale or even redeveloped to realize directional adjustment of data.

[0003] This method has the following problems: a) part of the scientific research data is isolated and scattered in the hands of each designer in the form of an Excel table, which is not uniformly managed and cannot form a system, which is easy to cause the loss of research and development data; b) the application platform is limited to data in a certain application scenario, and the processing method is fixed in the current project code, which has poor portability and is mostly suitable for simple data processing, and cannot meet the more complex data processing needs; c) the code development of the application platform for data processing is generally for the current stage needs, and cannot flexibly cope with future data processing needs, cannot be dynamically adjusted at any time, has the risk of large code modification workload, and even increases the complexity of the overall design of the platform and reduces the running efficiency of the platform. SUMMARY

[0004] The application provides an open script-driven data model dynamic matching method, which can improve the management and processing of scientific research data in related application fields, simplify the operation of designers, improve design efficiency, and ensure data security.

[0005] The application provides an open script-driven data model dynamic matching method, which comprises the following steps:

[0006] A script checking program is called to compile the script program file and check whether the customized script calculation module has a syntax error;

[0007] If correct, a parameter code conversion program is called to convert each parameter of the parameter model defined by the back-end language into a format conforming to the Python language specification, and fill the converted Python code into the input module of the script program to complete code updating, saving, and displaying the complete code of the current script program;

[0008] According to the calculation requirement, data entry is performed on part of the parameters in the parameter model, a calculation is clicked, a script running program is called, the program fills the entered parameter data to the input module, then reads the latest script program file, compiles the code, executes the main function, obtains the calculation result, and returns the response object in the form of a dictionary;

[0009] The response result is obtained, the response content is parsed, and whether the calculation is successful is judged according to the execution state in the result;

[0010] If successful, each parameter is located according to the parameter dictionary primary key, the old data is overwritten with the new data obtained by processing or directly assigned, and object type conversion is performed, the parameter dictionary is mapped back to the initial parameter object, and the whole is output, at this time the target parameter model with data is obtained, and the model dynamic adjustment and matching are completed.

[0011] Preferably, the calling script checking program further comprises, before the script program file is compiled and it is checked whether the customized script calculation module exists syntax error:

[0012] A configurable data model template is designed, data is parameterized through the data model template, the format and data structure of the parameter object in the data model are standardized, and the user sets the properties of the parameter object according to the requirement;

[0013] Based on the designed data model template, a target parameter model is created, each parameter model created is given a unique ID identifier, model positioning and finding are realized, data interconnection and intercommunication between the parameter models are realized, then, according to the parameter calculation requirement, each parameter object is added to the created parameter model;

[0014] A parameter conversion program is called to adjust the data structure of the parameter object, and the properties thereof are expanded and reorganized to obtain a standardized data structure;

[0015] Based on the standardized data structure, each parameter object in the current parameter model is mapped to a parameter dictionary supported by Python, and if part of the parameters in the parameter model do not exist, the parameter data of other existing models needs to be read.

[0016] Preferably, after the standardized data structure is used to map each parameter object in the current parameter model to a parameter dictionary supported by Python, and if part of the parameters in the parameter model do not exist, the parameter data of other existing models needs to be read, the method further comprises:

[0017] A script program template is designed to complete the calculation and adjustment of part of the parameters in the parameter model, and a program entry main function is specified in the script program template;

[0018] The input module takes an empty set as the program input as a whole; in the customized script calculation module, according to the parameter data processing requirements, the code logic is written based on the Python language, and the entire program is saved.

[0019] Preferably, the attribute of the parameter object comprises a parameter name, an identifier, a value type, a unit and a type.

[0020] Preferably, the data model has basic addition, deletion and modification function items.

[0021] Preferably, the method further comprises:

[0022] If there are some parameters in the parameter model that need to read the parameter data of other existing models, the parameter unique identifier is obtained.

[0023] Preferably, the script program is composed of an input module and a customized script calculation module, and the entire script program template is stored in a specified path in the form of.py.

[0024] Preferably, the format conforming to the Python language specification is in the form of a parameter dictionary.

[0025] The beneficial effects of the present application are as follows:

[0026] The data model template is designed to be flexible and configurable, the data table is parameterized, the online unified management of data tables and data is realized in the form of a parameter model (i.e., a data model), and the data interaction between multiple models (i.e., multiple data tables) is realized, in addition, the open script program template is used to complete the positioning search of the parameter model and the customized processing of the parameter data, so as to realize the dynamic matching and adjustment of the data model, and effectively improve the data management efficiency.

[0027] After the backend developer embeds the method into the application platform, no further subsequent adjustment and operation is needed, the designer only needs to perform model creation, script program customization editing, data entry, click saving, click calculation and other operations in the visual application platform, without needing to care about the backend running status, and the front end and the back end are separated and independent. BRIEF DESCRIPTION OF DRAWINGS

[0028] Figure 1 It is a flowchart of an open script driven data model dynamic matching method. DETAILED DESCRIPTION

[0029] Please refer to Figure 1 The present application provides an open script driven data model dynamic matching method, which comprises the following steps:

[0030] Based on the data table, the user parameterizes the data, designs a flexible and configurable data model template, and the data model is composed of various parameter objects, also known as parameter model. According to the requirements, the target parameter model is created, the parameter objects in the model are mapped to the general parameter dictionary structure through the parameter conversion program, the customized script calculation module code is edited based on the unified data format and script program template, the data conversion, extraction, calculation and other processing of the current parameter model are realized, and finally the program inspection, running, obtaining the processing result and mapping back to the original parameter object are completed through the script driving program. The processed target parameter model is output, and finally the model positioning, dynamic adjustment and matching are completed. The specific implementation process includes the following steps:

[0031] Firstly, a configurable data model template is designed to parameterize the data, and the format and data structure of the parameter objects in the data model are standardized. The user sets the parameter name, identifier, value type, unit, type and other attributes of the parameter object according to the requirements, and the data model has basic functions such as addition, deletion and modification.

[0032] Secondly, based on the designed data model template, the target parameter model is created, each parameter model is given a unique ID identifier, the model positioning and searching are realized, the data interconnection between the parameter models is realized, and then the parameter objects are added to the created parameter model according to the parameter calculation requirements.

[0033] Thirdly, the parameter conversion program is called to adjust the data structure of the parameter object, and the attributes are expanded and reorganized to obtain the standardized data structure.

[0034] Fourthly, based on the standardized data structure, the parameter objects in the current parameter model are mapped to the parameter dictionary supported by Python. If there are some parameters in the parameter model that need to read the parameter data of other existing models, the parameter unique identifier is obtained, otherwise, go to the fifth step.

[0035] Fifthly, the script program template is designed to complete the calculation and adjustment of part of the parameters in the parameter model. The script program mainly consists of an input module and a customized script calculation module. The entire script program template is stored in a specified path in the form of.py, and the program entry main function also needs to be specified in the template.

[0036] Sixthly, the input module takes an empty set as the program input. In the customized script calculation module, the code logic is written based on Python according to the parameter data processing requirements, and the entire program is saved.

[0037] Seventhly, the script inspection program is called to compile the script program file, check whether there is a syntax error in the customized script calculation module, if the compilation fails, go back to the sixth step for correction, otherwise, go to the eighth step.

[0038] The eighth step is to call the parameter code conversion program to convert the parameters of the parameter model defined in the back-end language into the Python definition format, and the format is the parameter dictionary of the fourth step, and fill the converted Python code into the input module of the script program, complete the code update, save and display the complete code of the current script program.

[0039] The ninth step is to enter data into part of the parameters in the parameter model according to the calculation requirement, click to calculate, call the script running program, the script program fills the entered parameter data into the input module, then reads the latest script program file, compiles the code, executes the main function, obtains the calculation result, and returns the response object in the form of a dictionary.

[0040] The tenth step is to obtain the response result, parse the response content, and determine whether the calculation is successful according to the execution state in the result. If it fails, go back to the eighth step to check whether there is a logic problem in the code, otherwise, go to the eleventh step.

[0041] The eleventh step is to locate each parameter according to the parameter dictionary primary key, overwrite the old data with the new data obtained by processing or directly assign values, and at the same time, perform object type conversion, map the parameter dictionary back to the initial parameter object, and output the whole, at this time, the target parameter model with data is obtained, and the model dynamic adjustment and matching are completed.

[0042] In other embodiments of the present application, the user creates a target parameter model at the data model template of the application according to the data table and adds parameter objects to the model, the application automatically completes the conversion between data formats according to the parameter conversion program, then according to the data processing requirement, the code logic editing and parameter data entry are completed at the script model of the application, click to save and calculate, the script driving program and the script checking program will automatically complete the code update, file compilation, calculation result obtaining, mapping back to the parameter object and model output, the specific process is divided into the following steps:

[0043] The first step is to adjust the data model template according to each data information in the data table, and the data classification, attribute, type and other information can be added, deleted or modified, and the data model data table design is completed.

[0044] The second step is to embed the data model template into the web application design, the user creates a target parameter model at the data model template, and adds corresponding parameter objects according to each data type in the data table.

[0045] The third step is to add the parameter conversion program to the application, so that the conversion program is bound to the "save" component of the application, click to save, the system allocates a unique identification ID for the parameter model, a unique identification KEY value for the parameter object, converts the parameter object into a parameter dictionary format, and stores the related information in the database.

[0046] Fourthly, the parameter conversion program adds "Model ID + parameter KEY" positioning search to realize the interconnection and intercommunication between data models, and maps each parameter object in the current parameter model to a parameter dictionary supported by Python, so as to realize the unified conversion of the parameter model to online management.

[0047] Fifthly, the script program template is integrated into the application system parameter model management, based on Python language, and the input module, customized script calculation module, program entry and other information are specified.

[0048] Sixthly, the user only needs to complete parameter positioning, reading according to the identification KEY of each parameter in the main program area of the customized script calculation module of the script program template, and complete code processing logic editing according to data processing requirements, without any operation on the input module.

[0049] Seventhly, the script checking program is stored in the specified path of the server where the application system is located, and its basic information is configured in the application project. The subsequent driving service realizes the execution of the checking program according to the configuration information, and then realizes the compilation of the script program file to check whether there is a syntax error in the customized script calculation module. If the compilation fails, go back to the sixth step to correct it. Otherwise, go to the eighth step.

[0050] Eighthly, the parameter code conversion program is added to the application project, which can convert each parameter of the parameter model defined in C# or Java or C++ into Python definition format, fill the converted Python code into the input module of the script program, and store the entire script program calculation file in the specified path of the server, and configure its basic information in the application project.

[0051] Ninthly, based on Python language, the script driving program integrates script checking and script program calculation; the script driving program is deployed in the server where the application runs, the script driving program is published in the server, so that the driving service is always in running state, ready to drive the execution of the script program calculation file; the script driving program is bound with the application system, and its execution path and IP address and other related information are configured in the application project; the script program is bound with the "calculation" component in the application, the user only needs to complete data entry in the application according to parameter data entry requirements and click "calculation", which can call the parameter code conversion program in the eighth step to automatically fill the data into the input module, complete code update, and establish connection with the script driving program according to the configured communication information, trigger the driving service, realize script program checking, main function execution, obtain calculation result, and return response object in the form of dictionary.

[0052] The tenth step is to analyze the returned response result, judge whether the calculation is successful according to the execution state in the result, if not, return to the sixth step to check whether the code has logical problems, otherwise, go to the tenth step.

[0053] The eleventh step is to assign new data according to the unique identifier KEY of the parameter, and simultaneously perform object type conversion, map the parameter dictionary back to the initial parameter object, and finally obtain the parameter model of the target data.

[0054] In a feasible implementation, taking a rotor system research and development platform developed by a research institute as an example, in order to solve the problem that the existing rotor design system research and development mode completes professional data processing and circulation in the form of a data table, and to unify the management of scientific research data, the rotor system research and development platform is deployed and constructed, and the mainstream Web framework Flash and Python language are used to embed the method into the rotor system research and development platform according to the implementation scheme steps in the application, and provide it for model master, project leader and designer to use. The implementation process of the application is illustrated by taking this scene as an example:

[0055] The first step is that the model master determines the data model template information according to the rotor design work mode and the scientific research data circulation profile, divides the scientific research data into two categories of professional parameters (designer input) and reference parameters (upstream parameters), and further divides the professional parameters into input parameters and output parameters, wherein the output parameters are generally used as reference parameters for mutual reading of data between models, and it is specified that each parameter should include parameter name, identifier, value type, unit, parameter type, mandatory item and other attributes, so that the configurable data model template becomes concrete and customized.

[0056] The second step is that the back-end developer designs the corresponding parameter model data table in the database according to the data model template information, stores the parameter model information and each parameter object, and embeds the interface design code of the data model template into the application system, so that the data model template becomes visual and operable. The designer completes the creation of the target parameter model and the addition of the parameter object based on the visual data model template.

[0057] The third step is that the back-end developer adds the parameter conversion program to the project code structure of the platform, adjusts the IOParm of the general basic type according to the determined parameter object attributes, maps the parameter object to the parameter dictionary, and the ID attribute corresponds to the parameter model identifier and the KEY attribute corresponds to the parameter object identifier.

[0058] Fourth, based on the IOParm data type of Value, Original Value, KEY and ID four attributes of the existing model data acquisition and assignment, in addition, the conversion program and the application of the front-end Button component to be bound. Designers in the parameter model creation click "Save" button, trigger the parameter conversion program, to achieve its series of functions.

[0059] Fifth, the back-end developers will integrate the script program template into the application system parameter model management front-end interface, can be viewed at any time parameter model parameters object information.

[0060] Sixth, based on Python language, only in the customized script calculation module of the script program template main program area according to the identification of each parameter KEY, complete parameter positioning, reading, and according to the data processing requirements, complete code processing logic editing, and the entire data model parameter object with result set output, without any operation on the input module inputs set.

[0061] Seventh, the back-end developers will be stored in the application server in the specified path of the script checking program, the checking program related information added into the application project web.conf i g file.

[0062] Eighth, the back-end developers will add parameter code conversion program in the platform project code structure, parameter code conversion program covers a variety of language to Python definition format, the platform parameter model is defined by C# language, conversion program can be according to the C# language code ID to the corresponding Python format conversion, and the conversion of Python definition of each parameter object added to the script program input module inputs set in the parameter model, in addition, also need to store the entire script program calculation file (.py file) in the server's specified path, and its basic information in the application project web.conf i g file configuration.

[0063] The ninth step is that the back-end developer deploys the script driver (which has integrated script checking and script program calculation) in the server where the application runs, publishes the script driver in the server as a web service, keeps the driver service running, configures the execution path of the driver and its IP address and other related information in the application project in an enumeration manner, completes the binding of the script driver and the application system, then creates an HttpWeb request based on the HttpWebRequest class, transmits the service path of the script driver, establishes the connection between the script program and the script driver, and binds the script program edited in the sixth step and the front-end "calculation" Button component. The designer only needs to complete data entry in the application according to the parameter data entry requirement and click the "calculation" button, so as to realize automatic filling of data to the input module of the script program, complete code updating, establish a connection with the script driver according to the configured communication information, trigger the driver service, realize script program checking, main function execution, calculation result acquisition, and return a response object in the form of a dictionary.

[0064] The tenth step is to use the JsonConvert.DeserializeObject() function encapsulated by the ServiceMessage class to deserialize the response content, and then obtain the execution status and calculation result, and complete the parsing.

[0065] The eleventh step is that based on the parameter conversion program that has been set, the system automatically assigns new data according to the unique identifier KEY of the parameter, and completes the conversion of the parameter type, and finally obtains the parameter model with target data.

[0066] It should be noted that:

[0067] The data model template is designed to be flexible and configurable, the data table is parameterized, the online unified management of data tables and data is realized in the form of a parameter model (i.e., a data model), and the data interaction between multiple models (i.e., multiple data tables) is realized. In addition, an open script program template is used to complete the positioning search and parameter data customization of the parameter model, so as to realize dynamic matching and adjustment of the data model, and effectively improve the data management efficiency.

[0068] After the back-end developer embeds the method into the application platform, no further adjustment and operation is needed, the designer only needs to perform model creation, script program customization editing, data entry, click to save, click to calculate and other operations in the visual application platform, without worrying about the back-end running status, and the front-end and back-end are separated and independent.

[0069] The open script-driven data model dynamic matching method of the application has the characteristics of strong portability, large reuse degree, easy modification, lightweight, etc., is suitable for multiple application scenarios such as spacecraft development, rotor design, calculus processing, dynamics engineering calculation, can be flexibly embedded in various application system platforms, optimizes the data processing mode of the application system, the data model designed in the method converts the locally managed data tables into online unified storage and management, forms a system, and realizes scientific digital management; the parameter code conversion program designed in the method matches the data model defined in multiple languages, can be adjusted according to the actual situation, and realizes code conversion between different languages; the data flow speed and accuracy of the open script program embedded in the application platform in the method are effectively improved, a large number of manual operations are simplified, the data can be dynamically processed for multiple rounds, a large amount of valuable data information is obtained, and the implementation effect of the application system platform is improved.

Claims

1. An open script driven data model dynamic matching method, characterized in that, The method comprises: calling a script checking program to compile the script program file and check whether the customized script calculation module has syntax errors; if correct, calling a parameter code conversion program to convert each parameter of the parameter model defined by the back-end language into a format conforming to the Python language specification, and filling the converted Python code into the input module of the script program to complete code updating, saving, and displaying the complete code of the current script program; according to the calculation requirement, performing data entry on part of the parameters in the parameter model, clicking calculation, calling a script running program, which fills the entered parameter data into the input module, then reads the latest script program file, compiles the code, executes the main function, obtains the calculation result, and returns a response object in the form of a dictionary; obtaining the response result, analyzing the response content, and judging whether the calculation is successful according to the execution status in the result; if successful, locating each parameter according to the parameter dictionary primary key, using the obtained new data to overwrite the old data or directly assigning values, simultaneously performing object type conversion, mapping the parameter dictionary back to the initial parameter object, and performing overall output, thus obtaining the target parameter model with data, and completing model dynamic adjustment and matching.

2. The method of claim 1, wherein, Before the calling of the script checking program to compile the script program file and check whether the customized script calculation module has syntax errors, the method further comprises: designing a configurable data model template, parameterizing data through the data model template, standardizing the format and data structure of the parameter object in the data model, and setting the attributes of the parameter object according to the requirement; based on the designed data model template, creating a target parameter model, giving each parameter model a unique ID for model positioning and searching, enabling data interconnection between the parameter models, and then adding each parameter object to the created parameter model according to the parameter calculation requirement; calling a parameter conversion program to adjust the data structure of the parameter object, expand and reorganize its attributes, and obtain a standardized data structure; based on the standardized data structure, mapping each parameter object in the current parameter model to a parameter dictionary supported by Python, and if part of the parameters in the parameter model need to read the parameter data of other existing models.

3. The method of claim 2, wherein, After the mapping of each parameter object in the current parameter model to a parameter dictionary supported by Python based on the standardized data structure, if part of the parameters in the parameter model need to read the parameter data of other existing models, the method further comprises: designing a script program template to complete the calculation and adjustment of part of the parameters in the parameter model, and simultaneously specifying the program entry main function in the script program template; the input module takes an empty set as the program input; in the customized script calculation module, code logic is written based on the Python language according to the parameter data processing requirement, and the entire program is saved.

4. The method of claim 3, wherein, The attributes of the parameter object include parameter name, ID, value type, unit, and type.

5. The method of claim 3, wherein, The data model has basic add, delete, and modify function items.

6. The method of claim 3, wherein, The method further comprises: if part of the parameters in the parameter model need to read the parameter data of other existing models, the parameter unique ID is obtained.

7. The method of claim 3, wherein, The script program is composed of an input module and a customized script calculation module, and the whole script program template is stored in a specified path in the.py format.

8. The method of claim 3, wherein, The format in line with the Python language specification is in the form of a parameter dictionary.

Citation Information

Patent Citations

  • Business script rendering method and device, storage medium and electronic equipment

    CN117873463A

  • Tailored language sets for business level scripting

    US20140282376A1