Code generation method and system based on low-code platform
By analyzing code generation instructions on a low-code platform, integrating business logic and data model drivers, generating back-end logic and evaluating its logical arrangement effect, the problem of inability to evaluate the code logic arrangement effect in the existing technology is solved, and higher quality code generation is achieved.
Patent Information
- Application Number
- CN202510201599.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-02-24
AI Technical Summary
Existing low-code platforms cannot evaluate the logical arrangement effect of the code when generating front-end code and back-end code, and it is difficult to find potential logical errors in the early stage of development, and cannot ensure that the generated code meets the quality requirements in logical arrangement.
By analyzing the code, the model node calls the command, and based on the cosine similarity feedback, the business logic, label, priority and data model driver associated with the model node are integrated into the code configuration resource set, cluster evaluation, and back-end logic are generated. The pre-built code evaluation model solves the logical arrangement effect of the back-end logic to determine whether it meets the preset effect threshold.
It realizes the evaluation of the generated code logic orchestration effect, helps developers choose better logic orchestration methods, ensures code quality, and reduces potential errors and defects.
Smart Images

Figure CN119987757A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of low-code technology, and specifically relates to a code generation method and system based on a low-code platform. Background Art
[0002] With the continuous development of computer software engineering technology, the low-code platform is an efficient development method that can accelerate the software development process. Users can build and deliver application software faster with less coding in a visual way, thereby reducing the cost of software development, configuration, deployment and training in all aspects. As a new type of application development tool, the low-code platform (Low-Code Platform) has greatly reduced the application development threshold and improved the application development efficiency with its graphical interface and configurable development method.
[0003] Chinese patent CN116431106A discloses a low-code platform code generation method, device, equipment and low-code platform, which first receives the basic configuration and page and list configuration respectively input by the user in the visual interface, and then obtains the user's code generation selection; when the code generation selection is to generate only the backend code, the backend code is directly generated according to the basic configuration and the page and list configuration; when the code generation selection is to generate the front-end code or to generate the front-end code and the back-end code at the same time, the reconfiguration information is obtained. Finally, the front-end code is generated according to the basic configuration, page and list configuration and reconfiguration information, or the front-end code and the back-end code are generated at the same time, and submitted to the local warehouse to facilitate code version control; however, when the existing method generates code and chooses to generate the front-end code and the back-end code, it is impossible to evaluate the logical arrangement effect of the code, and it is difficult to find potential logical errors in the early stage of development, and it is impossible to ensure that the generated code meets the quality requirements in terms of logical arrangement. In response to the above problems, we propose a code generation method and system based on a low-code platform. Summary of the invention
[0004] The purpose of the present invention is to address the shortcomings of the prior art and provide a code generation method and system based on a low-code platform, which solves the problem that the existing method of generating code cannot evaluate the logical arrangement effect of the code when selecting to generate front-end code and back-end code, makes it difficult to discover potential logical errors in the early stages of development, and cannot ensure that the generated code meets the quality requirements in terms of logical arrangement.
[0005] The present invention is implemented as follows: a code generation method based on a low-code platform, the code generation method based on a low-code platform comprising:
[0006] In response to the code generation instruction, the code generation instruction is parsed, and a model node call instruction is triggered based on a model node type corresponding to the code generation instruction;
[0007] Load the model node call instruction, traverse the low-code platform based on the model node call instruction, and the low-code platform feedbacks the business logic, business label, business priority and data model driver associated with the model node based on the cosine similarity, and integrates the business logic, business label, business priority and data model driver into a code configuration resource set;
[0008] Obtain a code configuration resource set, perform cluster evaluation on the code configuration resource set, generate at least one set of backend logic, use a pre-built code evaluation model to solve the logical orchestration effect of the backend logic, and determine whether the logical orchestration effect of the backend logic meets the preset effect threshold. If the logical orchestration effect of the backend logic meets the preset effect threshold, output the current backend logic.
[0009] In response to backend logic meeting a preset effect threshold, the low-code platform deploys application code based on the backend logic index.
[0010] Preferably, the method for triggering a model node call instruction based on a model node type corresponding to a code generation instruction specifically includes:
[0011] Parsing code generation instructions, and determining model node configuration information based on the code generation instructions;
[0012] In response to the model node configuration information, the model node configuration information is input into the low-code platform engine rule tool, and the engine rule tool generates a node index stream;
[0013] Loading the node index flow, which is based on the breadth-first algorithm AGM and is extended from the advanced form logic of the low-code platform, and uses a bottom-up approach to index at least one set of candidate index rule flows, where the candidate index rule flows include code rules and model nodes;
[0014] Standardize the candidate index rule flow, each group of candidate index rule flows corresponds to a standardized identification code, and perform node path expansion in the low-code platform based on the standardized identification code, discard non-associated model node types, and obtain the model node type corresponding to the code generation instruction;
[0015] Identify the model node type, obtain the normalized decision matrix corresponding to the model node type based on the min-max normalization method, and determine the weight vector corresponding to the node in combination with the hierarchical analysis method;
[0016] Load the normalized decision matrix and weight vector corresponding to the model node type, and determine the positive ideal solution and negative ideal solution corresponding to the model node type;
[0017] Among them, the positive ideal solution and the negative ideal solution are expressed as:
[0018]
[0019] Among them, C + , C - represent the positive ideal solution set and the negative ideal solution set respectively, Respectively represent the maximum and minimum values of the jth column in the normalized decision matrix;
[0020] Calculate the distance between the normalized decision matrix and the positive ideal solution and the negative ideal solution, determine the optimal call instruction corresponding to the model node type based on the optimal distance between the normalized decision matrix and the positive ideal solution and the negative ideal solution, and use the optimal call instruction as the model node call instruction;
[0021]
[0022] are the distances between the normalized decision matrix and the positive ideal solution and the negative ideal solution, respectively, C i represents the optimal distance between the normalized decision matrix and the positive ideal solution and the negative ideal solution.
[0023] Preferably, the low-code platform feedbacks the business logic, business tags, business priorities and data model-driven methods associated with the model nodes based on cosine similarity, specifically including:
[0024] In response to the model node call instruction, the low-code platform generates a label call matrix based on the business label corresponding to the model node call instruction, and forms a logical association matrix based on the relationship between the business label and the business logic;
[0025] Load the label call matrix and the logic association matrix, and calculate the business priority associated with the model node based on the label call matrix and the logic association matrix;
[0026] Obtain the label call matrix, logical association matrix, and business priority, and perform weighted combination of the label call matrix, logical association matrix, and business priority based on the cosine similarity measurement method to obtain a data model driven similarity set;
[0027] Load the data model driver similarity set, calculate the eigenvalues of the data model driver similarity set based on the Laplace algorithm, and extract the first m data model drivers in descending order;
[0028] Integrate business logic, business tags, business priorities, and data model drivers to configure resource sets for code;
[0029] The service priority is calculated by the following formula:
[0030]
[0031]
[0032] Among them, ykp b,l represents the business priority associated with model node i, q i represents the weight of model node i, B i , L i They are label call matrix and logical association matrix, C j represents the in-degree centrality between the model node i and the data model driver corresponding to the low-code platform, m represents the data model driver associated with the model node i, KP i , K.P. l They are respectively the model node i set and the low-code platform associated data model driver set;
[0033] The data model driven similarity set is calculated by the following formula:
[0034]
[0035] Among them, ykp b,l represents the business priority associated with model node i, q i represents the weight of model node i, B i , L i They are label call matrix, logical association matrix, KP i , K.P. l They are respectively the set of model nodes i and the set of low-code platform associated data model drivers. α1, α2, and α3 are the first similarity coefficient, the second similarity coefficient, and the third similarity coefficient, respectively.
[0036] Preferably, the method for clustering and evaluating the code configuration resource set specifically includes:
[0037] Load the code configuration resource set, select A samples from the code configuration resource set as subcluster centers, and obtain A subcluster centers;
[0038] Load A sub-cluster centers, calculate the distance between the business logic and the sub-cluster center in the code configuration resource set, determine the sub-cluster center to which the business logic belongs based on the distance between the business logic and the sub-cluster center, and iterate and update the A sub-cluster centers until the A sub-cluster centers reach the maximum number of iterations;
[0039] Based on the full connection method, determine the backend logic associated with A sub-cluster centers and the low-code platform, build a similarity matrix between the sub-cluster centers and the backend logic, build a Laplace matrix based on the similarity matrix, calculate the first B maximum eigenvalues and eigenvectors of the Laplace matrix, and build a logical response space based on the first B maximum eigenvalues and eigenvectors;
[0040] The logical response space is loaded, and the K-means clustering algorithm is used to convert the logical response space into a clustering backend logic with C clusters, generating at least one set of backend logic.
[0041] Preferably, the code evaluation model construction method specifically includes:
[0042] The convolutional neural network is used as the initial model of the code evaluation model. The initial model includes an input layer, a hidden layer, and an output layer. The input layer and the hidden layer are connected by neurons, and the hidden layer and the output layer are connected by neurons. The number of neurons is determined by trial and error.
[0043] A weighted bidirectional feature pyramid network is introduced into the initial model. The weighted bidirectional feature pyramid network is set between the hidden layer and the output layer. The extreme learning machine and CBAM convolutional attention module are introduced into the output layer to complete the pre-construction of the code evaluation model.
[0044] Traverse the open source evaluation set, internal data evaluation set, and crowd-testing data set, and divide them into training set and test set according to the distribution ratio of 3:1. The training set and test set include code text features, grammatical structure features, code backend logic, and function features.
[0045] The preset code evaluates the model's loss function, activation function, training error target, and maximum training rounds. The initial model is iteratively trained until convergence using the Bayesian regularization algorithm combined with the training set.
[0046] Load the test set, use the test set as input, execute the code evaluation model, and obtain the execution result of the test set;
[0047] Determine the logic arrangement effect of the test set based on the execution result of the test set, and judge whether the logic arrangement effect meets the preset effect threshold;
[0048] If the logic arrangement effect meets the preset effect threshold, a converged code evaluation model is output.
[0049] Preferably, the method of using a pre-built code evaluation model to solve the logic arrangement effect of the backend logic specifically includes:
[0050] At least one set of backend logic is loaded, and the code evaluation model input layer constructs a multidimensional syntax tree based on the backend logic and the code text features, grammatical structure features, code backend logic, and function features of the backend logic;
[0051] Obtain the multidimensional syntax tree corresponding to the backend logic, read the code text features, syntax structure features, code backend logic, function features through the multidimensional syntax tree, and extract the code execution feature vector in the hidden layer;
[0052] Load the code execution feature vector, use the weighted bidirectional feature pyramid network to weightedly fuse the code execution feature vector to obtain a weighted fusion set, and merge the weighted fusion set with the code text features, grammatical structure features, code backend logic, and function features to obtain a merged feature set;
[0053] Extract the features of the merged feature set based on the extreme learning machine and CBAM convolutional attention module to extract the optimal feature set;
[0054] Load the optimal feature set, normalize the optimal feature set, and calculate the logical arrangement effect of the backend logic based on the excitation kernel function of the extreme learning machine;
[0055] The logical arrangement effect of the backend logic is calculated by the following formula:
[0056]
[0057] Among them, p d represents the logic arrangement effect value of the backend logic, g(·) is the activation kernel function of the extreme learning machine, and w o , F o are the connection weight matrix between the hidden layer and the output layer, the optimal feature set input representation, and b o is the bias term of the excitation kernel function, β o is the connection weight between the input layer and the hidden layer, D is the number of symbolic nodes in the multidimensional syntax tree, and λ represents the attenuation parameter of the excitation kernel function.
[0058] On the other hand, the present invention also provides a code generation system based on a low-code platform, and the code generation system based on a low-code platform specifically includes:
[0059] An instruction parsing module, in response to the code generation instruction, parses the code generation instruction, and triggers the model node calling instruction based on the model node type corresponding to the code generation instruction;
[0060] The resource integration module is used to load the model node call instructions, traverse the low-code platform based on the model node call instructions, and the low-code platform feedbacks the business logic, business tags, business priorities and data model drivers associated with the model nodes based on cosine similarity, and integrates the business logic, business tags, business priorities and data model drivers into a code configuration resource set;
[0061] A backend logic generation module is used to obtain a code configuration resource set, perform cluster evaluation on the code configuration resource set, generate at least one set of backend logic, use a pre-built code evaluation model to solve the logic arrangement effect of the backend logic, and determine whether the logic arrangement effect of the backend logic meets the preset effect threshold. If the logic arrangement effect of the backend logic meets the preset effect threshold, output the current backend logic;
[0062] The code deployment module responds to the backend logic that meets the preset effect threshold, indexes the low-code platform based on the backend logic, and the low-code platform deploys the application code.
[0063] Preferably, the resource integration module includes:
[0064] The association matrix generation unit, in response to the model node call instruction, the low-code platform generates a label call matrix based on the business label corresponding to the model node call instruction, and forms a logical association matrix based on the relationship between the business label and the business logic;
[0065] A priority calculation unit loads a label call matrix and a logic association matrix, and calculates the business priority associated with the model node based on the label call matrix and the logic association matrix;
[0066] A similarity set generation unit obtains a label call matrix, a logic association matrix, and a business priority, and performs a weighted combination of the label call matrix, the logic association matrix, and the business priority based on a cosine similarity measurement method to obtain a data model driven similarity set;
[0067] The resource set configuration unit loads the data model driver similarity set, calculates the eigenvalues of the data model driver similarity set based on the Laplace algorithm, extracts the first m data model drivers in descending order, and integrates business logic, business tags, business priorities, and data model drivers into code configuration resource sets.
[0068] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0069] In an embodiment of the present invention, the low-code platform feedbacks the business logic, business tags, business priorities, and data model drivers associated with the model nodes based on cosine similarity, and clusters and evaluates the code configuration resource set at the same time, generates at least one set of back-end logic, and uses a pre-built code evaluation model to solve the logic orchestration effect of the back-end logic, thereby intuitively comparing the advantages and disadvantages of different back-end logics in terms of performance, scalability, maintainability, etc., thereby helping developers to choose a better logic orchestration method, and ensuring that the generated code meets the quality requirements in terms of logic orchestration, thereby improving the code quality of the entire system and reducing potential errors and defects. It overcomes the problem that the existing method of generating code cannot evaluate the logic orchestration effect of the code when selecting to generate front-end code and back-end code, making it difficult to discover potential logic errors in the early stages of development, and cannot ensure that the generated code meets the quality requirements in terms of logic orchestration.
[0070] In an embodiment of the present invention, when a model node call instruction is triggered based on the model node type corresponding to the code generation instruction, a node index stream is generated with the help of an engine rule tool, thereby ensuring efficient triggering of the model node call instruction, and the optimal call instruction corresponding to the model node type is determined based on the optimal distance between the normalized decision matrix and the positive ideal solution and the negative ideal solution. The obtained optimal call instruction is more objective and accurate, and can truly reflect the advantages and disadvantages of each model node type under comprehensive consideration of multiple attributes, which helps to improve the performance and efficiency of the entire system and better meet the needs of actual applications.
[0071] In the embodiment of the present invention, by calculating the cosine similarity between business logic, business tags, business priorities and data model drivers, the low-code platform can more accurately determine the code configuration resources associated with the model nodes, and based on the cosine similarity feedback, the low-code platform can automatically generate a data model that matches the business needs and automatically adjust the model parameters according to the changes in the actual business data. There is no need for users to manually write complex data model codes, which reduces the difficulty and cost of development, while improving the accuracy and adaptability of the data model, and further ensuring the efficient and accurate integration of the code configuration resource set.
[0072] In an embodiment of the present invention, when performing clustering evaluation on the code configuration resource set, the back-end logic associated with A sub-cluster centers and the low-code platform is determined based on the full connection method, and a similarity matrix between the sub-cluster centers and the back-end logic is constructed. In combination with the K-means clustering algorithm, the complex logical response space is converted into multiple relatively simple clusters, reducing the dimension and complexity of the data.
[0073] In an embodiment of the present invention, a code evaluation model and a training method thereof are provided. The code evaluation model is based on a convolutional neural network and introduces a weighted bidirectional feature pyramid network, an extreme learning machine, and a CBAM convolutional attention module. When processing complex programming statements, it can understand the meaning of a single variable or operator and grasp the function of the entire code block, thereby more accurately evaluating the effect of code logic arrangement. At the same time, due to the diversity of different projects and code styles, the available training data may be relatively limited. The generalization ability of the extreme learning machine can enable the model to perform well in different code scenarios, improving the accuracy and reliability of the evaluation of the effect of code logic arrangement. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 It is a schematic diagram of the implementation flow of the code generation method based on the low-code platform provided by the present invention.
[0075] Figure 2 A schematic diagram of the implementation flow of triggering a model node calling instruction method based on a model node type corresponding to a code generation instruction is shown.
[0076] Figure 3 A schematic diagram of the implementation process of the low-code platform's business logic, business tags, business priorities, and data model-driven method associated with model nodes based on cosine similarity feedback is shown.
[0077] Figure 4 A schematic diagram of the implementation process of a clustering evaluation method for code configuration resource sets is shown.
[0078] Figure 5 A schematic diagram of the implementation process of the code evaluation model construction method is shown.
[0079] Figure 6 A schematic diagram of the implementation process of a method for solving the logic orchestration effect of backend logic using a pre-built code evaluation model is shown.
[0080] Figure 7 It is a structural diagram of the code generation system based on the low-code platform provided by the present invention. DETAILED DESCRIPTION
[0081] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of this application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0082] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0083] Existing methods for generating code cannot evaluate the logical arrangement effect of the code when selecting to generate front-end code and back-end code. It is difficult to discover potential logical errors in the early stages of development, and it is impossible to ensure that the generated code meets the quality requirements in terms of logical arrangement. To address the above problems, we propose a code generation method and system based on a low-code platform. When the method is implemented, it first responds to the code generation instruction, and triggers the model node call instruction based on the model node type corresponding to the code generation instruction. The low-code platform feedbacks the business logic, business tags, business priorities and data model drivers associated with the model node based on cosine similarity, obtains the code configuration resource set, performs clustering evaluation on the code configuration resource set, generates at least one set of back-end logic, and uses a pre-built code evaluation model to solve the logical arrangement effect of the back-end logic, and determines whether the logical arrangement effect of the back-end logic meets the preset effect threshold. If the logical arrangement effect of the back-end logic meets the preset effect threshold, the current back-end logic is output. In an embodiment of the present invention, the low-code platform feedbacks the business logic, business tags, business priorities, and data model drivers associated with the model nodes based on cosine similarity, and clusters and evaluates the code configuration resource set at the same time, generates at least one set of back-end logic, and uses a pre-built code evaluation model to solve the logic orchestration effect of the back-end logic, thereby intuitively comparing the advantages and disadvantages of different back-end logics in terms of performance, scalability, maintainability, etc., thereby helping developers to choose a better logic orchestration method, and ensuring that the generated code meets the quality requirements in terms of logic orchestration, thereby improving the code quality of the entire system and reducing potential errors and defects. It overcomes the problem that the existing method of generating code cannot evaluate the logic orchestration effect of the code when selecting to generate front-end code and back-end code, making it difficult to discover potential logic errors in the early stages of development, and cannot ensure that the generated code meets the quality requirements in terms of logic orchestration.
[0084] The embodiment of the present invention provides a code generation method based on a low-code platform. Figure 1 A schematic diagram of the implementation process of a code generation method based on a low-code platform is shown, and the code generation method based on a low-code platform specifically includes:
[0085] Step S10, in response to the code generation instruction, parsing the code generation instruction, and triggering the model node calling instruction based on the model node type corresponding to the code generation instruction;
[0086] It should be noted that the code generation instructions can be generated from a user command line interface, within an application, or through an HTTP server request.
[0087] Step S20, loading the model node call instruction, traversing the low-code platform based on the model node call instruction, the low-code platform feedbacks the business logic, business label, business priority and data model driver associated with the model node based on the cosine similarity, and integrates the business logic, business label, business priority and data model driver into a code configuration resource set;
[0088] Step S30, obtaining a code configuration resource set, performing cluster evaluation on the code configuration resource set, generating at least one set of backend logic, and using a pre-built code evaluation model to solve the logic arrangement effect of the backend logic;
[0089] In an embodiment of the present invention, when clustering and evaluating the code configuration resource set to generate at least one group of backend logic, the backend logic may be 10-20 groups, with 10-20 groups as a batch, thereby ensuring efficient evaluation of the logic orchestration effect.
[0090] Step S40, determining whether the logic arrangement effect of the backend logic meets a preset effect threshold. In this embodiment, the effect threshold can be set to 0.8-0.85;
[0091] Step S50: if the logic arrangement effect of the backend logic meets the preset effect threshold, the current backend logic is output.
[0092] If the logic arrangement effect of the backend logic does not meet the preset effect threshold, return to step S20 to continue to obtain the code configuration resource set.
[0093] Step S60, in response to the backend logic that meets the preset effect threshold, the low-code platform is indexed based on the backend logic, and the low-code platform deploys the application code.
[0094] In an embodiment of the present invention, the low-code platform feedbacks the business logic, business tags, business priorities, and data model drivers associated with the model nodes based on cosine similarity, and clusters and evaluates the code configuration resource set at the same time, generates at least one set of back-end logic, and uses a pre-built code evaluation model to solve the logic orchestration effect of the back-end logic, thereby intuitively comparing the advantages and disadvantages of different back-end logics in terms of performance, scalability, maintainability, etc., thereby helping developers to choose a better logic orchestration method, and ensuring that the generated code meets the quality requirements in terms of logic orchestration, thereby improving the code quality of the entire system and reducing potential errors and defects. It overcomes the problem that the existing method of generating code cannot evaluate the logic orchestration effect of the code when selecting to generate front-end code and back-end code, making it difficult to discover potential logic errors in the early stages of development, and cannot ensure that the generated code meets the quality requirements in terms of logic orchestration.
[0095] The embodiment of the present invention provides a method for triggering a model node call instruction based on a model node type corresponding to a code generation instruction. Figure 2The schematic diagram of the implementation flow of triggering a model node calling instruction method based on a model node type corresponding to a code generation instruction is shown. The method of triggering a model node calling instruction based on a model node type corresponding to a code generation instruction specifically includes:
[0096] Step S101, parsing the code generation instruction, and determining the model node configuration information based on the code generation instruction;
[0097] In the embodiment of the present invention, when determining the model node configuration information based on the code generation instruction, it supports the user to define custom attributes for the model node. These attributes can be read when the code is generated, and the configuration of the node is determined according to the attribute value.
[0098] Step S102, in response to the model node configuration information, inputting the model node configuration information into the low-code platform engine rule tool, and the engine rule tool generates a node index stream;
[0099] It should be noted that the low-code platform engine rule tools include but are not limited to the open source rule engine LiteFlow, JVS rule engine, and LsqParserEngine rule engine. The model node configuration information can be model type, node type, input configuration, output format, advanced parameter configuration, variable configuration, and task flow scheduling information.
[0100] Step S103, loading a node index flow, where the node index flow is extended from the advanced form logic of the low-code platform based on the breadth-first algorithm AGM, and indexes at least one set of candidate index rule flows in a bottom-up manner, wherein the candidate index rule flows include code rules and model nodes;
[0101] In the embodiment of the present invention, the node index flow is an important technical concept in the low-code platform, which allows users to quickly design and customize various forms, processes and logics through a graphical interface without writing code. When the node index flow is extended from the advanced form logic of the low-code platform based on the breadth-first algorithm AGM, for each adjacent node, check whether it meets specific conditions or rules, such as whether it belongs to part of the target index rule flow, whether it meets the business logic requirements, etc. If the conditions are met, it is marked as a candidate index node.
[0102] Step S104, standardize the candidate index rule flow, each group of the candidate index rule flow corresponds to a standardized identification code, and node path expansion is performed in the low-code platform based on the standardized identification code, and non-associated model node types are discarded to obtain the model node type corresponding to the code generation instruction;
[0103] Step S105, identifying the model node type, obtaining the normalized decision matrix corresponding to the model node type based on the min-max normalization method, and determining the weight vector corresponding to the node in combination with the hierarchical analysis method;
[0104] It should be noted that when constructing a normalized decision matrix, since the dimensions and numerical ranges of the indicators may be different, the original data needs to be standardized to eliminate the impact of these differences on the results. Commonly used standardization methods include range standardization, maximum standardization, mean standardization, etc. In this embodiment, the min-max standardization method is selected.
[0105] Step S106, loading the normalized decision matrix and weight vector corresponding to the model node type, and determining the positive ideal solution and the negative ideal solution corresponding to the model node type;
[0106] Among them, the positive ideal solution and the negative ideal solution are expressed as:
[0107]
[0108] Among them, C + , C - represent the positive ideal solution set and the negative ideal solution set respectively, Respectively represent the maximum and minimum values of the jth column in the normalized decision matrix;
[0109] Step S107, calculating the distance between the normalized decision matrix and the positive ideal solution and the negative ideal solution, determining the optimal call instruction corresponding to the model node type based on the optimal distance between the normalized decision matrix and the positive ideal solution and the negative ideal solution, and using the optimal call instruction as the model node call instruction;
[0110]
[0111] are the distances between the normalized decision matrix and the positive ideal solution and the negative ideal solution, respectively, C i represents the optimal distance between the normalized decision matrix and the positive ideal solution and the negative ideal solution.
[0112] In this embodiment, the comprehensive evaluation index is calculated according to the TOPSIS method. The larger the comprehensive evaluation index is, the closer the model node type is to the positive ideal solution and the farther it is from the negative ideal solution, that is, the better the performance is. The comprehensive evaluation indexes of each model node type are compared, and the call instruction corresponding to the model node type with the largest comprehensive evaluation index is selected as the optimal call instruction.
[0113] In an embodiment of the present invention, when a model node call instruction is triggered based on the model node type corresponding to the code generation instruction, a node index stream is generated with the help of an engine rule tool, thereby ensuring efficient triggering of the model node call instruction, and the optimal call instruction corresponding to the model node type is determined based on the optimal distance between the normalized decision matrix and the positive ideal solution and the negative ideal solution. The obtained optimal call instruction is more objective and accurate, and can truly reflect the advantages and disadvantages of each model node type under comprehensive consideration of multiple attributes, which helps to improve the performance and efficiency of the entire system and better meet the needs of actual applications.
[0114] The embodiment of the present invention provides a method for driving a low-code platform based on cosine similarity feedback and business logic, business tags, business priorities and data models associated with model nodes. Figure 3 The following is a schematic diagram of the implementation process of the business logic, business tags, business priorities and data model-driven method associated with the model nodes based on the cosine similarity feedback of the low-code platform. The business logic, business tags, business priorities and data model-driven method associated with the model nodes based on the cosine similarity feedback of the low-code platform specifically include:
[0115] Step S201, in response to the model node call instruction, the low-code platform generates a label call matrix based on the business label corresponding to the model node call instruction, and forms a logical association matrix based on the relationship between the business label and the business logic;
[0116] In this embodiment, a set of two-dimensional tables is created when the label call matrix is generated. The rows of the two-dimensional tables represent model nodes and the columns represent business labels, forming the framework of the label call matrix. Then, according to the functions of the model nodes and the meanings of the business labels, association rules are formulated to determine the correspondence between the model nodes and the business labels. The correspondence between the model nodes and the business labels is filled in the corresponding positions of the matrix with specific identifiers (such as numbers, letters or symbols).
[0117] Step S202, loading a label call matrix and a logic association matrix, and calculating the business priority associated with the model node based on the label call matrix and the logic association matrix;
[0118] In the embodiment of the present invention, by analyzing the label call matrix and the logical association matrix, the order and dependency between different businesses can be clearly understood. Considering that the resources of the low-code platform are limited, they need to be reasonably allocated to various label fields. By calculating the business priority associated with the model node, the low-code platform can clearly identify which businesses are core businesses and which are secondary businesses, thereby investing more resources in higher-priority businesses and improving the response speed of the low-code platform.
[0119] In this embodiment, the service priority is calculated by the following formula:
[0120]
[0121] Among them, ykp b,l represents the business priority associated with model node i, q i represents the weight of model node i, B i , L i They are label call matrix and logical association matrix, C j represents the in-degree centrality between the model node i and the data model driver corresponding to the low-code platform, m represents the data model driver associated with the model node i, KP i , K.P. l They are respectively the model node i set and the low-code platform associated data model driver set.
[0122] It should be noted that in-degree centrality is a concept in graph theory that is used to measure the importance or influence of nodes in a graph. In a directed graph, the in-degree of a node refers to how many edges point to the node. A node with a higher in-degree centrality means that there are more edges pointing to it, which usually means that the node has a more important position or stronger connectivity in the graph. In this embodiment, the introduction of in-degree centrality can measure the correlation between the model node i and the corresponding data model driver of the low-code platform.
[0123] Step S203, obtaining a label call matrix, a logic association matrix, and a business priority, and weighting and combining the label call matrix, the logic association matrix, and the business priority based on a cosine similarity measurement method to obtain a data model driven similarity set;
[0124] In this embodiment, the data model driven similarity set is calculated by the following formula:
[0125]
[0126] Among them, ykp b,l represents the business priority associated with model node i, q i represents the weight of model node i, B i , L i They are label call matrix, logical association matrix, KP i , K.P. l They are respectively the model node i set and the low-code platform associated data model driver set, α1, α2, and α3 are respectively the first similarity coefficient, the second similarity coefficient, and the third similarity coefficient. In this embodiment, the first similarity coefficient, the second similarity coefficient, and the third similarity coefficient are in the range of 0.1-0.8, and the first similarity coefficient, the second similarity coefficient, and the third similarity coefficient increase in sequence.
[0127] Step S204, loading the data model driver similarity set, calculating the characteristic value of the data model driver similarity set based on the Laplace algorithm, and extracting the first m data model drivers in descending order;
[0128] Step S205 , integrating business logic, business tags, business priorities, and data model drivers into a code configuration resource set.
[0129] In this embodiment, by calculating the cosine similarity between business logic, business tags, business priorities, and data model drivers, the low-code platform can more accurately determine the code configuration resources associated with the model nodes, and based on the cosine similarity feedback, the low-code platform can automatically generate a data model that matches the business needs and automatically adjust the model parameters according to the changes in the actual business data. There is no need for users to manually write complex data model codes, which reduces the difficulty and cost of development, while improving the accuracy and adaptability of the data model, and further ensuring the efficient and accurate integration of the code configuration resource set.
[0130] The embodiment of the present invention provides a method for clustering and evaluating a code configuration resource set. Figure 4 A schematic diagram of the implementation process of a method for clustering and evaluating a code configuration resource set is shown. The method for clustering and evaluating a code configuration resource set specifically includes:
[0131] Step S301, loading a code configuration resource set, selecting A samples from the code configuration resource set as subcluster centers, and obtaining A subcluster centers;
[0132] Step S302, loading A sub-cluster centers, calculating the distance between the business logic in the code configuration resource set and the sub-cluster center, determining the sub-cluster center to which the business logic belongs based on the distance between the business logic and the sub-cluster center, and iteratively updating the A sub-cluster centers until the A sub-cluster centers reach the maximum number of iterations;
[0133] Step S303, based on the full connection method, determine the backend logic associated with the A sub-cluster centers and the low-code platform, construct a similarity matrix between the sub-cluster centers and the backend logic, construct a Laplace matrix based on the similarity matrix, calculate the first B maximum eigenvalues and eigenvectors of the Laplace matrix, and construct a logical response space based on the first B maximum eigenvalues and eigenvectors;
[0134] Step S304, load the logical response space, use the K-means clustering algorithm to convert the logical response space into clustered backend logic with C clusters, generate at least one group of backend logic, and use the K-means clustering algorithm to process the logical response space. The clustering result can be used as the basis for feature selection and extraction of backend logic from the low-code platform, help select important backend logic related to the clustering target, and remove irrelevant backend logic.
[0135] In this embodiment, when performing clustering evaluation on the code configuration resource set, the back-end logic associated with A sub-cluster centers and the low-code platform is determined based on the full connection method, and a similarity matrix between the sub-cluster centers and the back-end logic is constructed. Combined with the K-means clustering algorithm, the complex logical response space is converted into multiple relatively simple clusters, reducing the dimension and complexity of the data.
[0136] The embodiment of the present invention provides a method for constructing a code evaluation model. Figure 5 The following is a schematic diagram of the implementation process of the code evaluation model construction method, which specifically includes:
[0137] Step S401, using a convolutional neural network as an initial model of a code evaluation model, the initial model includes an input layer, a hidden layer, and an output layer, the input layer and the hidden layer are connected by neurons, the hidden layer and the output layer are connected by neurons, and the number of neurons is determined by trial and error method;
[0138] In the embodiment of the present invention, the number of neurons may be between 1 and 10, the number of hidden layers may be between 1 and 4, and the transfer function between the input layer and the hidden layer may be a tans ig function.
[0139] Step S402, introducing a weighted bidirectional feature pyramid network into the initial model, the weighted bidirectional feature pyramid network is set between the hidden layer and the output layer, and an extreme learning machine and a CBAM convolutional attention module are introduced into the output layer to complete the pre-construction of the code evaluation model;
[0140] Step S403, traversing the open source evaluation set, the internal data evaluation set, and the crowd-testing data set, and dividing the open source evaluation set, the internal data evaluation set, and the crowd-testing data set into a training set and a test set according to a distribution ratio of 3:1, wherein the training set and the test set include code text features, grammatical structure features, code backend logic, and function features;
[0141] Step S404, presetting the loss function, activation function, training error target and maximum training rounds of the code evaluation model, and using the Bayesian regularization algorithm combined with the training set to iteratively train the initial model until convergence;
[0142] It should be noted that the loss function of the code evaluation model can be the cross entropy loss function, the activation function is the hard threshold function, and the training error target is 10 -4 , the maximum number of training rounds is 200-220.
[0143] Step S405, loading the test set, taking the test set as input, executing the code evaluation model, and obtaining the execution result of the test set;
[0144] Step S406, determining the logical arrangement effect of the test set based on the execution result of the test set;
[0145] Step S407, determining whether the logic arrangement effect meets a preset effect threshold, where the preset effect threshold may be 0.8-0.85;
[0146] Step S408: if the logic arrangement effect meets the preset effect threshold, output a converged code evaluation model.
[0147] If the logic arrangement effect does not meet the preset effect threshold, return to step S404.
[0148] In an embodiment of the present invention, a code evaluation model and a training method thereof are provided. The code evaluation model is based on a convolutional neural network and introduces a weighted bidirectional feature pyramid network, an extreme learning machine, and a CBAM convolutional attention module. When processing complex programming statements, it can understand the meaning of a single variable or operator and grasp the function of the entire code block, thereby more accurately evaluating the effect of code logic arrangement. At the same time, due to the diversity of different projects and code styles, the available training data may be relatively limited. The generalization ability of the extreme learning machine can enable the model to perform well in different code scenarios, improving the accuracy and reliability of the evaluation of the effect of code logic arrangement.
[0149] The embodiment of the present invention provides a method for solving the logic arrangement effect of backend logic by using a pre-built code evaluation model. Figure 6 The following is a schematic diagram of the implementation process of a method for solving the logical arrangement effect of backend logic by using a pre-built code evaluation model. The method for solving the logical arrangement effect of backend logic by using a pre-built code evaluation model specifically includes:
[0150] Step S501, at least one set of backend logic is loaded, and the code evaluation model input layer constructs a multidimensional syntax tree based on the backend logic and the code text features, grammatical structure features, code backend logic, and function features of the backend logic;
[0151] It should be noted that the core of the code backend logic is to realize specific business functions. By analyzing the code, the business logic rules and methods are extracted. These business logics are used as nodes or attributes of the multidimensional syntax tree and combined with the structure and syntax features of the code. When constructing the multidimensional syntax tree, corresponding nodes and branches are added for each abnormal situation and boundary condition to fully reflect the integrity and robustness of the backend logic.
[0152] Step S502, obtaining a multidimensional syntax tree corresponding to the backend logic, reading code text features, syntax structure features, code backend logic, and function features through the multidimensional syntax tree, and extracting a code execution feature vector in the hidden layer;
[0153] Step S503, loading the code execution feature vector, weightedly fusing the code execution feature vector using a weighted bidirectional feature pyramid network to obtain a weighted fusion set, and merging the weighted fusion set with the code text feature, grammatical structure feature, code backend logic, and function feature to obtain a merged feature set;
[0154] Step S504, extracting features of the merged feature set based on the extreme learning machine and the CBAM convolutional attention module to extract the optimal feature set;
[0155] Step S505, loading the optimal feature set, normalizing the optimal feature set, and calculating the logic arrangement effect of the backend logic based on the excitation kernel function of the extreme learning machine;
[0156] The logical arrangement effect of the backend logic is calculated by the following formula:
[0157]
[0158] Among them, p d represents the logic arrangement effect value of the backend logic, g(·) is the activation kernel function of the extreme learning machine, and w o , F o are the connection weight matrix between the hidden layer and the output layer, the optimal feature set input representation, and b o is the bias term of the excitation kernel function, β o is the connection weight between the input layer and the hidden layer, D is the number of symbolic nodes in the multidimensional syntax tree, which can be 10-40, λ represents the attenuation parameter of the excitation kernel function, and in this embodiment, the attenuation parameter is set to 0.002-0.02, and o represents the current multidimensional syntax tree symbolic node.
[0159] In this embodiment, the excitation kernel function of the extreme learning machine can effectively process nonlinear data, but when processing unnormalized data, it may be affected by the feature dimension and numerical range, resulting in inaccurate or unstable calculation of the kernel function. After normalizing the optimal feature set, the advantages of the excitation kernel function can be better utilized, and the model's evaluation accuracy of the code logic arrangement effect can be improved.
[0160] The embodiment of the present invention provides a code generation system based on a low-code platform. Figure 7 A schematic diagram of the structure of a code generation system based on a low-code platform is shown, and the code generation system based on a low-code platform specifically includes:
[0161] The instruction parsing module 100 , in response to the code generation instruction, parses the code generation instruction and triggers the model node calling instruction based on the model node type corresponding to the code generation instruction;
[0162] The resource integration module 200 is used to load the model node call instruction, traverse the low-code platform based on the model node call instruction, and the low-code platform integrates the business logic, business label, business priority and data model driver associated with the model node based on the cosine similarity feedback into a code configuration resource set;
[0163] The backend logic generation module 300 is used to obtain a code configuration resource set, perform cluster evaluation on the code configuration resource set, generate at least one set of backend logic, use a pre-built code evaluation model to solve the logic arrangement effect of the backend logic, and determine whether the logic arrangement effect of the backend logic meets the preset effect threshold. If the logic arrangement effect of the backend logic meets the preset effect threshold, output the current backend logic;
[0164] The code deployment module 400 responds to the backend logic that meets the preset effect threshold, indexes the low-code platform based on the backend logic, and the low-code platform deploys the application code.
[0165] In an embodiment of the present invention, the instruction parsing module 100, the resource integration module 200, the back-end logic generation module 300, and the code deployment module 400 are connected by DTU or Bluetooth communication, and the code generation system based on the low-code platform provided in an embodiment of the present invention corresponds to the above-mentioned code generation method based on the low-code platform. The explanations, examples, beneficial effects, etc. of the relevant contents can refer to the corresponding contents in the code generation method based on the low-code platform, and will not be repeated here.
[0166] In this embodiment, the resource integration module 200 includes:
[0167] The association matrix generation unit 210, in response to the model node call instruction, generates a label call matrix based on the business label corresponding to the model node call instruction, and forms a logical association matrix based on the relationship between the business label and the business logic;
[0168] The priority calculation unit 220 loads the label call matrix and the logic association matrix, and calculates the service priority associated with the model node based on the label call matrix and the logic association matrix;
[0169] The similarity set generation unit 230 obtains a label call matrix, a logic association matrix, and a business priority, and performs a weighted combination of the label call matrix, the logic association matrix, and the business priority based on a cosine similarity measurement method to obtain a data model driven similarity set;
[0170] The resource set configuration unit 240 loads the data model driver similarity set, calculates the eigenvalues of the data model driver similarity set based on the Laplace algorithm, extracts the first m data model drivers in descending order, and integrates business logic, business tags, business priorities and data model drivers into a code configuration resource set.
[0171] In summary, the present invention provides a code generation method and system based on a low-code platform. In an embodiment of the present invention, the low-code platform feedbacks the business logic, business tags, business priorities and data model drivers associated with the model nodes based on cosine similarity, and clusters and evaluates the code configuration resource set at the same time, generates at least one set of back-end logic, and uses a pre-built code evaluation model to solve the logic orchestration effect of the back-end logic, so as to intuitively compare the advantages and disadvantages of different back-end logics in terms of performance, scalability, maintainability, etc., so as to help developers choose a better logic orchestration method, and ensure that the generated code meets the quality requirements in terms of logic orchestration, thereby improving the code quality of the entire system and reducing potential errors and defects. It overcomes the problem that the existing method of generating code cannot evaluate the logic orchestration effect of the code when selecting to generate front-end code and back-end code, it is difficult to find potential logic errors in the early stages of development, and it is impossible to ensure that the generated code meets the quality requirements in terms of logic orchestration.
Claims
1. A code generation method based on a low-code platform, characterized in that: The code generation method based on the low-code platform includes: In response to the code generation instruction, the code generation instruction is parsed, and a model node call instruction is triggered based on a model node type corresponding to the code generation instruction; Load the model node call instruction, traverse the low-code platform based on the model node call instruction, and the low-code platform feedbacks the business logic, business label, business priority and data model driver associated with the model node based on the cosine similarity, and integrates the business logic, business label, business priority and data model driver into a code configuration resource set; Obtain a code configuration resource set, perform cluster evaluation on the code configuration resource set, generate at least one set of backend logic, use a pre-built code evaluation model to solve the logical orchestration effect of the backend logic, and determine whether the logical orchestration effect of the backend logic meets the preset effect threshold. If the logical orchestration effect of the backend logic meets the preset effect threshold, output the current backend logic.
2. The code generation method based on the low-code platform according to claim 1, characterized in that: The code generation method based on the low-code platform also includes: In response to backend logic meeting a preset effect threshold, the low-code platform deploys application code based on the backend logic index.
3. The code generation method based on the low-code platform according to claim 1, characterized in that: The method for triggering a model node call instruction based on a model node type corresponding to a code generation instruction specifically includes: Parsing code generation instructions, and determining model node configuration information based on the code generation instructions; In response to the model node configuration information, the model node configuration information is input into the low-code platform engine rule tool, and the engine rule tool generates a node index stream; Loading the node index flow, which is based on the breadth-first algorithm AGM and is extended from the advanced form logic of the low-code platform, and uses a bottom-up approach to index at least one set of candidate index rule flows, where the candidate index rule flows include code rules and model nodes; Standardize the candidate index rule flow, each group of candidate index rule flows corresponds to a standardized identification code, and perform node path expansion in the low-code platform based on the standardized identification code, discard non-associated model node types, and obtain the model node type corresponding to the code generation instruction; Identify the model node type, obtain the normalized decision matrix corresponding to the model node type based on the min-max normalization method, and determine the weight vector corresponding to the node in combination with the hierarchical analysis method; Load the normalized decision matrix and weight vector corresponding to the model node type, and determine the positive ideal solution and negative ideal solution corresponding to the model node type; Among them, the positive ideal solution and the negative ideal solution are expressed as: Among them, C + , C - denote the positive ideal solution set and the negative ideal solution set respectively, Respectively represent the maximum and minimum values of the jth column in the normalized decision matrix; Calculate the distance between the normalized decision matrix and the positive ideal solution and the negative ideal solution, determine the optimal call instruction corresponding to the model node type based on the optimal distance between the normalized decision matrix and the positive ideal solution and the negative ideal solution, and use the optimal call instruction as the model node call instruction; are the distances between the normalized decision matrix and the positive ideal solution and the negative ideal solution, respectively, C i represents the optimal distance between the normalized decision matrix and the positive ideal solution and the negative ideal solution.
4. The code generation method based on the low-code platform as claimed in claim 3, characterized in that: The low-code platform feedbacks the business logic, business tags, business priorities and data model-driven methods associated with the model nodes based on cosine similarity, specifically including: In response to the model node call instruction, the low-code platform generates a label call matrix based on the business label corresponding to the model node call instruction, and forms a logical association matrix based on the relationship between the business label and the business logic; Load the label call matrix and the logic association matrix, and calculate the business priority associated with the model node based on the label call matrix and the logic association matrix; Obtain the label call matrix, logical association matrix, and business priority, and perform weighted combination of the label call matrix, logical association matrix, and business priority based on the cosine similarity measurement method to obtain a data model driven similarity set; Load the data model driver similarity set, calculate the eigenvalues of the data model driver similarity set based on the Laplace algorithm, and extract the first m data model drivers in descending order; Integrate business logic, business tags, business priorities, and data model drivers to configure resource sets for code.
5. The code generation method based on the low-code platform according to claim 4, characterized in that: The service priority is calculated by the following formula: Among them, ykp b,l represents the business priority associated with model node i, q i represents the weight of model node i, B i , L i They are label call matrix and logical association matrix, C j represents the in-degree centrality between the model node i and the data model driver corresponding to the low-code platform, m represents the data model driver associated with the model node i, KP i , K.P. l They are respectively the model node i set and the low-code platform associated data model driver set; The data model driven similarity set is calculated by the following formula: Among them, ykp b,l represents the business priority associated with model node i, q i represents the weight of model node i, B i , L i They are label call matrix, logical association matrix, KP i , K.P. l They are respectively the set of model nodes i and the set of low-code platform associated data model drivers. α1, α2, and α3 are the first similarity coefficient, the second similarity coefficient, and the third similarity coefficient, respectively.
6. The code generation method based on the low-code platform according to claim 5, characterized in that: The method for clustering and evaluating a code configuration resource set specifically includes: Load the code configuration resource set, select A samples from the code configuration resource set as subcluster centers, and obtain A subcluster centers; Load A sub-cluster centers, calculate the distance between the business logic and the sub-cluster center in the code configuration resource set, determine the sub-cluster center to which the business logic belongs based on the distance between the business logic and the sub-cluster center, and iterate and update the A sub-cluster centers until the A sub-cluster centers reach the maximum number of iterations; Based on the full connection method, determine the backend logic associated with A sub-cluster centers and the low-code platform, build a similarity matrix between the sub-cluster centers and the backend logic, build a Laplace matrix based on the similarity matrix, calculate the first B maximum eigenvalues and eigenvectors of the Laplace matrix, and build a logical response space based on the first B maximum eigenvalues and eigenvectors; The logical response space is loaded, and the K-means clustering algorithm is used to convert the logical response space into a clustering backend logic with C clusters, generating at least one set of backend logic.
7. The code generation method based on the low-code platform according to claim 2, characterized in that: The code evaluation model construction method specifically includes: The convolutional neural network is used as the initial model of the code evaluation model. The initial model includes an input layer, a hidden layer, and an output layer. The input layer and the hidden layer are connected by neurons, and the hidden layer and the output layer are connected by neurons. The number of neurons is determined by trial and error. A weighted bidirectional feature pyramid network is introduced into the initial model. The weighted bidirectional feature pyramid network is set between the hidden layer and the output layer. The extreme learning machine and CBAM convolutional attention module are introduced into the output layer to complete the pre-construction of the code evaluation model. Traverse the open source evaluation set, internal data evaluation set, and crowd-testing data set, and divide them into training set and test set according to the distribution ratio of 3:
1. The training set and test set include code text features, grammatical structure features, code backend logic, and function features. The preset code evaluates the model's loss function, activation function, training error target, and maximum training rounds. The initial model is iteratively trained until convergence using the Bayesian regularization algorithm combined with the training set. Load the test set, use the test set as input, execute the code evaluation model, and obtain the execution result of the test set; Determine the logic arrangement effect of the test set based on the execution result of the test set, and judge whether the logic arrangement effect meets the preset effect threshold; If the logic arrangement effect meets the preset effect threshold, a converged code evaluation model is output.
8. The code generation method based on the low-code platform according to claim 7, characterized in that: The method of using a pre-built code evaluation model to solve the logic arrangement effect of the backend logic specifically includes: At least one set of backend logic is loaded, and the code evaluation model input layer constructs a multidimensional syntax tree based on the backend logic and the code text features, grammatical structure features, code backend logic, and function features of the backend logic; Obtain the multidimensional syntax tree corresponding to the backend logic, read the code text features, syntax structure features, code backend logic, function features through the multidimensional syntax tree, and extract the code execution feature vector in the hidden layer; Load the code execution feature vector, use the weighted bidirectional feature pyramid network to weightedly fuse the code execution feature vector to obtain a weighted fusion set, and merge the weighted fusion set with the code text features, grammatical structure features, code backend logic, and function features to obtain a merged feature set; Extract the features of the merged feature set based on the extreme learning machine and CBAM convolutional attention module to extract the optimal feature set; Load the optimal feature set, normalize the optimal feature set, and calculate the logical arrangement effect of the backend logic based on the excitation kernel function of the extreme learning machine; The logical arrangement effect of the backend logic is calculated by the following formula: Among them, p d represents the logic arrangement effect value of the backend logic, g(·) is the activation kernel function of the extreme learning machine, and w o , F o are the connection weight matrix between the hidden layer and the output layer, the optimal feature set input representation, and b o is the bias term of the excitation kernel function, β o is the connection weight between the input layer and the hidden layer, D is the number of symbolic nodes in the multidimensional syntax tree, λ represents the attenuation parameter of the excitation kernel function, and o represents the current symbolic node in the multidimensional syntax tree.
9. A code generation system based on a low-code platform, used to implement the code generation method based on a low-code platform as described in any one of claims 1 to 8, characterized in that: The code generation system based on the low-code platform specifically includes: An instruction parsing module, in response to the code generation instruction, parses the code generation instruction, and triggers the model node calling instruction based on the model node type corresponding to the code generation instruction; The resource integration module is used to load the model node call instructions, traverse the low-code platform based on the model node call instructions, and the low-code platform feedbacks the business logic, business tags, business priorities and data model drivers associated with the model nodes based on cosine similarity, and integrates the business logic, business tags, business priorities and data model drivers into a code configuration resource set; A backend logic generation module is used to obtain a code configuration resource set, perform cluster evaluation on the code configuration resource set, generate at least one set of backend logic, use a pre-built code evaluation model to solve the logic arrangement effect of the backend logic, and determine whether the logic arrangement effect of the backend logic meets the preset effect threshold. If the logic arrangement effect of the backend logic meets the preset effect threshold, output the current backend logic; The code deployment module responds to the backend logic that meets the preset effect threshold, indexes the low-code platform based on the backend logic, and the low-code platform deploys the application code.
10. The code generation system based on the low-code platform according to claim 9, characterized in that: The resource integration module includes: The association matrix generation unit, in response to the model node call instruction, the low-code platform generates a label call matrix based on the business label corresponding to the model node call instruction, and forms a logical association matrix based on the relationship between the business label and the business logic; A priority calculation unit loads a label call matrix and a logic association matrix, and calculates the business priority associated with the model node based on the label call matrix and the logic association matrix; A similarity set generation unit obtains a label call matrix, a logic association matrix, and a business priority, and performs a weighted combination of the label call matrix, the logic association matrix, and the business priority based on a cosine similarity measurement method to obtain a data model driven similarity set; The resource set configuration unit loads the data model driver similarity set, calculates the eigenvalues of the data model driver similarity set based on the Laplace algorithm, extracts the first m data model drivers in descending order, and integrates business logic, business tags, business priorities, and data model drivers into code configuration resource sets.
Citation Information
Patent Citations
Low-code platform code generation method, device and equipment and low-code platform
CN116431106A
Code representation generation method and device, storage medium and electronic equipment
CN116661805A
Low-code development method and system based on natural language processing and storage medium
CN118012403A
Method and system for generating a processing logic
WO2024033364A1
Cited By
Low-code intelligent arrangement method and system based on event driving
CN120469678A