Low-code model application generation method, device and medium based on process configuration
By encapsulating the basic models of different fields into process nodes and generating flow charts, the problem of difficult models in different fields is solved, and efficient generation and development efficiency of model applications are achieved.
Patent Information
- Application Number
- CN202211000281.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2042-08-19
AI Technical Summary
During the generation process of traditional low-code models, there are barriers between different fields, making it difficult to combine basic models, resulting in low development efficiency.
By determining multiple basic models in different fields, encapsulating them into process nodes, including process attributes and model attributes, generating flow charts based on user operations, converting them into process expressions, analyzing and generating corresponding class tree structures, and finally generating model application code based on search results.
The collation and unified packaging of models in different fields is realized, allowing developers in different fields to easily use models in other fields, reducing the communication costs between developers and the utilization of models, improving development efficiency, and reducing the cost of model application migration and modification.
Smart Images

Figure CN115328467B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and specifically to a method, device and medium for generating a low-code model application based on process configuration. Background Art
[0002] With the development of technology, the application of low-code is becoming more and more widespread. For example, the low-code development platform (LCDP) provides developers with a development environment for creating application software. Unlike traditional code IDEs, low-code development platforms provide a higher-dimensional and easy-to-use visual IDE. In most cases, developers do not need to use traditional handwritten code to program, but can complete development work through more efficient methods such as graphical drag and drop and parameter configuration.
[0003] However, in the traditional low-code model generation process, there are barriers between different fields, and it is difficult to combine basic models between different fields, which leads to low efficiency of model application development. Summary of the invention
[0004] In order to solve the above problems, this application proposes a low-code model application generation method based on process configuration, including:
[0005] Identify multiple base models belonging to different domains;
[0006] Encapsulating the multiple basic models into process nodes respectively, wherein the process nodes include process attributes and model attributes;
[0007] Based on the user's operation, determine the flowchart generated according to the multiple process nodes;
[0008] Convert the flowchart into a data structure required for searching, so as to generate a process expression corresponding to the flowchart according to the data structure;
[0009] The process expression is parsed to obtain a corresponding class tree structure, and the flowchart is searched according to the class tree structure to generate corresponding codes according to the basic model encapsulated into process nodes appearing in the search results, thereby realizing the generation of model application.
[0010] In one example, the basic model includes at least a plurality of a data acquisition basic model, a data processing basic model, a data merging basic model, a machine learning basic model, and a business-related basic model.
[0011] In one example, the process attribute refers to the attribute of the process node in the flowchart and when the corresponding code is generated, and the process attribute includes: the variable name of the dataframe type data output after the basic model receives and processes, the column where the data to be processed is located, and the column where the processed result is stored;
[0012] The model data refers to the properties of the basic model itself.
[0013] In one example, converting the flowchart into a data structure required for searching, and generating a process expression corresponding to the flowchart according to the data structure specifically includes:
[0014] For each of the process nodes, convert it into a data structure required for the search, and include a nodeMap in the data structure corresponding to the process node, which is used to store the successor nodes of the process node and to mark the initial node of the process expression; and set the branch flag to false, mark initNode as the only node without predecessor, and mark endNode as empty;
[0015] Add initNode to the process expression. If the successor node of the process node does not contain endNode and the branch flag is false, then end.
[0016] If initNode has only one successor node, mark initNode as the successor node and jump to the step corresponding to adding initNode to the process expression;
[0017] If initNode has multiple successor nodes, set flag to true and search each branch to endNode to save the path of the non-jump-back branch;
[0018] Assign the first common node in all paths to endNode;
[0019] For each branch, mark initNode as the branch initial node, add the branch start marker to the process expression, and jump to the step corresponding to adding initNode to the process expression;
[0020] After adding all non-jump back branches to the process expression, set flag to false, assign the successor node of endNode to initNode, and assign endNode to empty.
[0021] In one example, the process expression is parsed to obtain a corresponding tree-like structure, and the process diagram is searched according to the tree-like structure, specifically including:
[0022] Parse the process expression to obtain the nodeMap corresponding to each process node, and obtain the corresponding class tree structure according to the nodeMap;
[0023] A depth-first search is performed on the flow chart according to the tree-like structure, starting from the marked initial node.
[0024] In one example, the corresponding code is generated according to the basic model encapsulated as a process node appearing in the search results, specifically including:
[0025] If the current node is an initial node, then generate the initialization code corresponding to the basic model, the initialization code includes introducing the basic model package and defining the model application name;
[0026] If the current node is a merge node and has not been recorded, the current node is recorded and the backward search is stopped until the current node is searched again, then the code corresponding to the merge node is generated and the backward search is performed;
[0027] If the current node is the model node corresponding to the basic model, the code corresponding to the model node is directly generated;
[0028] If the successor node of the current node is empty, code generation ends.
[0029] In one example, the generated corresponding code includes: a parameter dict and a model calling code; the parameter dict includes the model attributes of the process node, and the model calling code can use the model attributes.
[0030] In one example, based on the user's operation, determining a flowchart generated according to multiple process nodes specifically includes:
[0031] A visual operation interface is displayed to the user, and a corresponding flow chart is generated based on the user's dragging operation on the process node in the visual operation interface.
[0032] On the other hand, the present application also proposes a low-code model application generation device based on process configuration, including:
[0033] at least one processor; and,
[0034] a memory communicatively connected to the at least one processor; wherein,
[0035] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform, for example:
[0036] Identify multiple base models belonging to different domains;
[0037] Encapsulating the multiple basic models into process nodes respectively, wherein the process nodes include process attributes and model attributes;
[0038] Based on the user's operation, determine the flowchart generated according to the multiple process nodes;
[0039] Convert the flowchart into a data structure required for searching, so as to generate a process expression corresponding to the flowchart according to the data structure;
[0040] The process expression is parsed to obtain a corresponding class tree structure, and the flowchart is searched according to the class tree structure to generate corresponding codes according to the basic model encapsulated into process nodes appearing in the search results, thereby realizing the generation of model application.
[0041] On the other hand, the embodiment of the present application further proposes a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:
[0042] Identify multiple base models belonging to different domains;
[0043] Encapsulating the multiple basic models into process nodes respectively, wherein the process nodes include process attributes and model attributes;
[0044] Based on the user's operation, determine the flowchart generated according to the multiple process nodes;
[0045] Convert the flowchart into a data structure required for searching, so as to generate a process expression corresponding to the flowchart according to the data structure;
[0046] The process expression is parsed to obtain a corresponding class tree structure, and the flowchart is searched according to the class tree structure to generate corresponding codes according to the basic model encapsulated into process nodes appearing in the search results, thereby realizing the generation of model application.
[0047] The method proposed in this application can bring the following beneficial effects:
[0048] By organizing and uniformly packaging different models, developers in different fields can easily use models in other fields, reducing communication costs between developers and model utilization, reducing duplicate development, and improving development efficiency.
[0049] Using process expressions to represent and generate model application processes reduces the cost of subsequent model application migration and modification, and directly generates Python code for model applications, facilitating direct operation and deployment of applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0051] Figure 1 A flowchart of a method for generating a low-code model application based on process configuration in an embodiment of the present application;
[0052] Figure 2 This is a schematic diagram of the basic model packaging in the embodiment of this application;
[0053] Figure 3 A schematic diagram of generating a flow expression in an embodiment of the present application;
[0054] Figure 4 This is a schematic diagram of a low-code model application generation device based on process configuration in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0056] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0057] like Figure 1 As shown, the embodiment of the present application provides a method for generating a low-code model application based on process configuration, including:
[0058] S101: Determine a plurality of basic models belonging to different fields.
[0059] like Figure 2 As shown, the basic model may include a data acquisition basic model, a data processing basic model, a data merging basic model, a machine learning basic model, a business-related basic model, etc. Figure 2 Different shapes are used to represent different types of base models.
[0060] S102: Encapsulate the multiple basic models into process nodes respectively, where the process nodes include process attributes and model attributes.
[0061] like Figure 2As shown in the figure, process attributes refer to the attributes of process nodes in the flowchart and when the corresponding code is generated. The process attributes include: input_var, output_var, input_column, and output_column. Input_var and output_column respectively represent the variable names of the dataframe type data received and processed by the basic model; input_column and output_column respectively represent the columns where the data to be processed is located and the columns where the processed results are stored; if input_column is empty, it means that all columns need to be processed. Model data refers to the attributes of the basic model itself, such as the data processing mode or the model hyperparameters of machine learning.
[0062] S103: Based on the user's operation, determine a flowchart generated according to multiple process nodes.
[0063] The visual operation interface can be displayed to users, and the process nodes are displayed in the form of modules. Based on the user's dragging operation on the process nodes in the visual operation interface, the corresponding flowchart is generated. Generating model applications by visual dragging reduces the amount of code, improves the application development efficiency, and enhances readability.
[0064] S104: Convert the flowchart into a data structure required for search, so as to generate a process expression corresponding to the flowchart according to the data structure.
[0065] like Figure 3 As shown, for each process node, it is converted into the data structure required for the search, and the data structure corresponding to the process node contains nodeMap, which is used to store the successor nodes of the process node and to mark the initial node of the process expression; and the branch flag is set to false, initNode is marked as the only node without predecessor, and endNode is marked as empty;
[0066] Add initNode to the process expression. If the successor node of the process node does not contain endNode and the branch flag is false, then end.
[0067] If initNode has only one successor node, mark initNode as the successor node and jump to the step corresponding to adding initNode to the process expression;
[0068] If initNode has multiple successor nodes, set flag to true and search each branch to endNode to save the path of the non-jump-back branch;
[0069] Assign the first common node in all paths to endNode;
[0070] For each branch, mark initNode as the branch initial node, add the branch start marker to the process expression, and jump to the step corresponding to adding initNode to the process expression;
[0071] After adding all non-jump back branches to the process expression, set flag to false, assign the successor node of endNode to initNode, and assign endNode to empty.
[0072] S105: Parse the process expression to obtain a corresponding class tree structure, and search the flowchart according to the class tree structure to generate corresponding code (for example, Python code) according to the basic model encapsulated into process nodes appearing in the search results, thereby realizing the generation of model application.
[0073] Specifically, the process expression is parsed to obtain the nodeMap corresponding to each process node, and the corresponding tree-like structure is obtained according to the nodeMap; the tree-like structure is used to perform a depth-first search on the flow chart starting from the marked initial node.
[0074] Furthermore, when searching, if the current node is the initial node, the initialization code corresponding to the basic model is generated. The initialization code includes processes such as introducing the basic model package and defining the model application name. If the current node is a merge node and has not been recorded, the current node is recorded and the backward search is stopped until the current node is searched again, and the code corresponding to the merge node is generated and searched backward. If the current node is a model node corresponding to the basic model, the code corresponding to the model node is directly generated. If the successor node of the current node is empty, the code generation ends.
[0075] The generated corresponding code may specifically include: parameter dict, including the model attributes of the process node, such as: kmeans_dict = {"n_clusters": "2"}; model calling code, which can use the model attributes, such as:
[0076] #{output_var}=
[0077] kmeans(#{input_var},#{input_column},#{output_column},**kmeans_dict)
[0078] Where #{} represents the process attribute value of the corresponding process node.
[0079] Since the models are encapsulated in a standardized manner and the input and output of the encapsulated models are both dataframe data types, it is guaranteed that any models can be freely combined and connected.
[0080] By organizing and uniformly packaging different models, developers in different fields can easily use models in other fields, reducing communication costs between developers and model utilization, reducing duplicate development, and improving development efficiency.
[0081] Using process expressions to represent and generate model application processes reduces the cost of subsequent model application migration and modification, and directly generates Python code for model applications, facilitating direct operation and deployment of applications.
[0082] like Figure 4 As shown, the embodiment of the present application also provides a low-code model application generation device based on process configuration, including:
[0083] at least one processor; and,
[0084] a memory communicatively connected to the at least one processor; wherein,
[0085] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform, for example:
[0086] Identify multiple base models belonging to different domains;
[0087] Encapsulating the multiple basic models into process nodes respectively, wherein the process nodes include process attributes and model attributes;
[0088] Based on the user's operation, determine the flowchart generated according to the multiple process nodes;
[0089] Convert the flowchart into a data structure required for searching, so as to generate a process expression corresponding to the flowchart according to the data structure;
[0090] The process expression is parsed to obtain a corresponding class tree structure, and the flowchart is searched according to the class tree structure to generate corresponding codes according to the basic model encapsulated into process nodes appearing in the search results, thereby realizing the generation of model application.
[0091] The embodiment of the present application further provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:
[0092] Identify multiple base models belonging to different domains;
[0093] Encapsulating the multiple basic models into process nodes respectively, wherein the process nodes include process attributes and model attributes;
[0094] Based on the user's operation, determine the flowchart generated according to the multiple process nodes;
[0095] Convert the flowchart into a data structure required for searching, so as to generate a process expression corresponding to the flowchart according to the data structure;
[0096] The process expression is parsed to obtain a corresponding class tree structure, and the flowchart is searched according to the class tree structure to generate corresponding codes according to the basic model encapsulated into process nodes appearing in the search results, thereby realizing the generation of model application.
[0097] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0098] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0099] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0100] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.
[0101] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0102] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0103] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0104] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0105] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0106] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0107] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A low-code model application generation method based on process configuration, characterized in that: include: Identify multiple base models belonging to different domains; The basic models include data acquisition basic model, data processing basic model, data merging basic model, machine learning basic model, and business-related basic model; Encapsulating the multiple basic models into process nodes respectively, wherein the process nodes include process attributes and model attributes; Based on the user's operation, determine the flowchart generated according to the multiple process nodes; The process attribute refers to the attribute of the process node in the flowchart and when the corresponding code is generated, and the process attribute includes: the variable name of the dataframe type data output after the basic model receives and processes, the column where the data to be processed is located, and the column where the processed result is stored; the model attribute refers to the attribute of the basic model itself; The flowchart is converted into a data structure required for search, so as to generate a process expression corresponding to the flowchart according to the data structure, specifically including: for each process node, converting it into a data structure required for search, and including a nodeMap in the data structure corresponding to the process node, which is used to store the successor nodes of the process node and to mark the initial node of the process expression; and setting the branch flag to false, marking initNode as the only node without predecessor, and marking endNode as empty; adding initNode to the process expression, and ending if the successor node of the process node does not contain endNode and the branch flag is false; if initNode has only one successor node, then adding in itNode is marked as a successor node, and the process jumps to the step where initNode is added to the process expression. If initNode has multiple successor nodes, set flag to true, and search each branch to endNode to save the path of the non-jump-back branch. Assign the first common node in all paths to endNode. For each branch, mark initNode as the initial node of the branch, add the branch start marker to the process expression, and jump to the step where initNode is added to the process expression. After all non-jump-back branches are added to the process expression, set flag to false, assign the successor node of endNode to initNode, and assign endNode to null. The process expression is parsed to obtain a corresponding class tree structure, and the flowchart is searched according to the class tree structure to generate corresponding codes according to the basic model encapsulated into process nodes appearing in the search results, thereby realizing the generation of model application.
2. The method according to claim 1, characterized in that The process expression is parsed to obtain a corresponding class tree structure, and the process diagram is searched according to the class tree structure, specifically including: Parse the process expression to obtain the nodeMap corresponding to each process node, and obtain the corresponding class tree structure according to the nodeMap; A depth-first search is performed on the flow chart according to the tree-like structure, starting from the marked initial node.
3. The method according to claim 2, characterized in that Generate the corresponding code based on the basic model encapsulated as a process node that appears in the search results, including: If the current node is an initial node, then generate the initialization code corresponding to the basic model, the initialization code includes introducing the basic model package and defining the model application name; If the current node is a merge node and has not been recorded, the current node is recorded and the backward search is stopped until the current node is searched again, then the code corresponding to the merge node is generated and the backward search is performed; If the current node is the model node corresponding to the basic model, the code corresponding to the model node is directly generated; If the successor node of the current node is empty, code generation ends.
4. The method according to claim 1, characterized in that The generated corresponding code includes: a parameter dict and a model calling code; the parameter dict includes the model attributes of the process node, and the model calling code can use the model attributes.
5. The method according to claim 1, characterized in that Based on the user's operation, determine the flowchart generated according to multiple process nodes, including: A visual operation interface is displayed to the user, and a corresponding flow chart is generated based on the user's dragging operation on the process node in the visual operation interface.
6. A low-code model application generation device based on process configuration, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the low-code model application generation method based on process configuration as described in claim 1.
7. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are set to: the low-code model application generation method based on process configuration as described in claim 1.
Citation Information
Patent Citations
Software development method and system for executing model drive structure
CN101256492A
System and method for searching a distributed node-sharded graph
CN105022772A