A code generation method and system based on a low-code platform
By integrating business logic, label and data model drivers in low-code platforms, and using pre-built code evaluation models to evaluate the back-end logic orchestration effect, the problem of the inability to evaluate logical orchestration when generating code on low-code platforms is solved, and code quality and system performance are improved.
Patent Information
- Application Number
- CN202510201599.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-02-24
AI Technical Summary
The existing low-code platform cannot evaluate the logical orchestration effect 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 it is impossible to ensure that the generated code meets the quality requirements in logical orchestration.
By analyzing the code, the code configuration resource set is integrated and generated based on the cosine similarity feedback of the business logic, business labels, business priorities and data model drivers associated with the model nodes, and the pre-built code evaluation model is used to solve the orchestration effect of the backend logic, to determine whether it meets the preset threshold, and output the backend logic that meets the threshold for deployment.
Improve code quality, reduce potential errors and defects, ensure that the generated code meets quality requirements in logical arrangement, and improves the performance and efficiency of the system.
Smart Images

Figure CN119987757B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of low-code, and particularly 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 R & D process. Users can build and deliver application software more quickly with less coding in a visual way, comprehensively reducing the costs of software development, configuration, deployment, and training. As a new type of application development tool, the Low-Code Platform greatly reduces the development threshold of application programs and improves the development efficiency of application programs with its graphical interface and configuration-based development method.
[0003] Chinese Patent CN116431106A discloses a low-code platform code generation method, device, equipment, and low-code platform. First, it receives the basic configuration and page and list configurations 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, it directly generates the backend code according to the basic configuration and page and list configurations; when the code generation selection is to generate the frontend code or generate both the frontend code and the backend code simultaneously, it obtains the reconfiguration information. Finally, it generates the frontend code according to the basic configuration, page and list configurations, and reconfiguration information, or generates both the frontend code and the backend code simultaneously, and submits them to the local repository for convenient code version control; however, the existing method cannot evaluate the logical arrangement effect of the code when the code generation selection is to generate the frontend code and the backend code, it is difficult to discover potential logical errors in the initial stage of development, and it cannot ensure that the generated code meets the quality requirements in terms of logical arrangement. To solve 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 provide a code generation method and system based on a low-code platform for the deficiencies of the existing technology, and solve the problems that the existing method cannot evaluate the logical arrangement effect of the code when the code generation selection is to generate the frontend code and the backend code, it is difficult to discover potential logical errors in the initial stage of development, and it 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 includes:
[0006] In response to a code generation instruction, parse the code generation instruction, and trigger a model node call instruction based on the 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 feeds back the business logic, business tags, business priorities, and data model driving associated with the model node based on the cosine similarity, and integrate the business logic, business tags, business priorities, and data model driving into a code configuration resource set;
[0008] Obtain the code configuration resource set, perform clustering evaluation on the code configuration resource set, generate at least one set of backend logic, solve the logical orchestration effect of the backend logic using a pre-built code evaluation model, 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 the backend logic that meets the preset effect threshold, index the low-code platform based on the backend logic, and the low-code platform deploys the application program code.
[0010] Preferably, the method for triggering the model node call instruction based on the model node type corresponding to the code generation instruction specifically includes:
[0011] Parse the code generation instruction and determine the model node configuration information based on the code generation instruction;
[0012] In response to the model node configuration information, input the model node configuration information into the low-code platform engine rule tool, and the engine rule tool generates a node index stream;
[0013] Load the node index stream, and the node index stream is extended from the high-level form logic of the low-code platform based on the breadth-first algorithm AGM, and uses a bottom-up method to index at least one set of candidate index rule streams, where the candidate index rule streams include code rules and model nodes;
[0014] Perform standardized coding on the candidate index rule streams, each set of the candidate index rule streams corresponds to a standardized identification code, and perform node path extension within the low-code platform based on the standardized identification code, and discard non-associated model node types to 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 analytic hierarchy process;
[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 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, represent the maximum value and the minimum value of the j-th column in the normalized decision matrix respectively;
[0020] Calculate the distances between the normalized decision matrix and the positive ideal solution and the negative ideal solution, and determine the optimal call instruction corresponding to the model node type based on the optimal distances 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, and 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 is based on the method of cosine similarity feedback and business logic, business labels, business priorities, and data model driving associated with the model node, 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 logical association matrix, and calculate the business priority associated with the model node based on the label call matrix and the logical association matrix;
[0026] Obtain the label call matrix, the logical association matrix, and the business priority, and perform a weighted combination of the label call matrix, the logical association matrix, and the business priority based on the cosine similarity measurement method to obtain a data model-driven similarity set;
[0027] Load the data model-driven similarity set, calculate the eigenvalues of the data model-driven similarity set based on the Laplace algorithm, and extract the first m data model drivings in descending order;
[0028] Integrate the business logic, business labels, business priorities, and data model driving into a code configuration resource set;
[0029] The business 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 are the label call matrix and the logical association matrix respectively, C j represents the in-degree centrality of model node i driven by the corresponding data model of the low-code platform, m represents the data model drive associated with model node i, KP i , KP l are the set of model nodes i and the set of data model drives associated with the low-code platform respectively;
[0033] Among them, the data model drive 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 are the label call matrix and the logical association matrix respectively, KP i , KP l are the set of model nodes i and the set of data model drives associated with the low-code platform respectively, and α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 sub-cluster centers, and obtain A sub-cluster centers;
[0038] Load the A sub-cluster centers, calculate the distance between the business logic in the code configuration resource set and the sub-cluster centers, determine the sub-cluster center to which the business logic belongs based on the distance between the business logic and the sub-cluster centers, and iteratively 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 the low-code platform for the A sub-cluster centers, construct a similarity matrix between the sub-cluster centers and the backend logic, construct a Laplacian matrix based on the similarity matrix, calculate the first B largest eigenvalues and eigenvectors of the Laplacian matrix, and construct a logical response space based on the first B largest eigenvalues and eigenvectors;
[0040] Load the logical response space, and use the K-means clustering algorithm to convert the logical response space into clustering backend logics with the number of clusters being C, and generate at least one set of backend logics.
[0041] Preferably, the method for constructing the code evaluation model specifically includes:
[0042] Taking a convolutional neural network 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 the trial-and-error method;
[0043] 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;
[0044] Traverse the open-source evaluation set, the internal data evaluation set, and the crowdsourcing evaluation dataset, and divide the open-source evaluation set, the internal data evaluation set, and the crowdsourcing evaluation dataset into a training set and a test set according to a distribution ratio of 3:1. The training set and the test set include code text features, syntax structure features, code backend logic, and function features;
[0045] Preset the loss function, activation function, training error target, and maximum number of training rounds of the code evaluation model, and use the Bayesian regularization algorithm to iteratively train the initial model with the training set until convergence;
[0046] Load the test set, use the test set as the input, execute the code evaluation model, and obtain the execution result of the test set;
[0047] Determine the logical orchestration effect of the test set based on the execution result of the test set, and judge whether the logical orchestration effect meets the preset effect threshold;
[0048] If the logical orchestration effect meets the preset effect threshold, output the converged code evaluation model.
[0049] Preferably, the method for solving the logical orchestration effect of the backend logic by using the pre-constructed code evaluation model specifically includes:
[0050] Load at least one set of backend logic, and the input layer of the code evaluation model constructs a multi-dimensional syntax tree based on the backend logic and the code text features, syntax structure features, code backend logic, and function features of the backend logic;
[0051] Obtain the multi-dimensional syntax tree corresponding to the backend logic, read the code text features, syntax structure features, code backend logic, and function features through the multi-dimensional syntax tree, and the hidden layer extracts the code execution feature vector;
[0052] Load the code execution feature vector, and the weighted bidirectional feature pyramid network weights and fuses the code execution feature vector to obtain a weighted fusion set. Combine the weighted fusion set with the code text features, syntax structure features, code backend logic, and function features to obtain a combined feature set;
[0053] Extract features from the combined feature set based on the extreme learning machine and the CBAM convolutional attention module to extract the optimal feature set;
[0054] Load the optimal feature set, normalize the optimal feature set, and calculate the logic arrangement effect of the backend logic based on the activation kernel function of the extreme learning machine;
[0055] Among them, the logic 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, w o , F o are the connection weight matrix between the hidden layer and the output layer, the input representation of the optimal feature set respectively, b o is the bias term of the activation kernel function, β o is the connection weight between the input layer and the hidden layer, D is the number of multi-dimensional syntax tree symbol nodes, and λ represents the decay parameter of the activation kernel function.
[0058] On the other hand, the present invention also provides a code generation system based on a low-code platform. The code generation system based on the low-code platform specifically includes:
[0059] An instruction parsing module, which responds to a code generation instruction, parses the code generation instruction, and triggers a model node call instruction based on the model node type corresponding to the code generation instruction;
[0060] A resource integration module, which is used to load the model node call instruction, traverse the low-code platform based on the model node call instruction. The low-code platform feeds back the business logic, business labels, business priorities, and data model drivers associated with the model node based on the cosine similarity, and integrates the business logic, business labels, business priorities, and data model drivers into a code configuration resource set;
[0061] A backend logic generation module, which is used to obtain the code configuration resource set, perform clustering evaluation on the code configuration resource set, generate at least one set of backend logic, solve the logic arrangement effect of the backend logic using a pre-built code evaluation model, and determine whether the logic arrangement effect of the backend logic meets a preset effect threshold. If the logic arrangement effect of the backend logic meets the preset effect threshold, output the current backend logic;
[0062] A code deployment module, in response to backend logic that meets a preset effect threshold, indexes a low-code platform based on the backend logic, and the low-code platform deploys application program code.
[0063] Preferably, the resource integration module includes:
[0064] An association matrix generation unit, in response to a model node call instruction, the low-code platform generates a label call matrix based on the service label corresponding to the model node call instruction, and forms a logical association matrix based on the relationship between the service label and the service logic;
[0065] A priority calculation unit, loads the label call matrix and the logical association matrix, and calculates the service priority associated with the model node based on the label call matrix and the logical association matrix;
[0066] A similarity set generation unit, obtains the label call matrix, the logical association matrix, and the service priority, and performs a weighted combination of the label call matrix, the logical association matrix, and the service priority based on the cosine similarity measurement method to obtain a data model-driven similarity set;
[0067] A resource set configuration unit, loads the data model-driven similarity set, calculates the eigenvalues of the data model-driven similarity set based on the Laplace algorithm, extracts the top m data model-drivens in descending order, and integrates the service logic, service label, service priority, and data model-driven into a code configuration resource set.
[0068] Compared with the prior art, the embodiments of the present application mainly have the following beneficial effects:
[0069] In the embodiments of the present invention, the low-code platform feeds back the service logic, service label, service priority, and data model-driven associated with the model node based on the cosine similarity, and at the same time performs a clustering evaluation on the code configuration resource set to generate at least one set of backend logic, and uses a pre-built code evaluation model to solve the logical orchestration effect of the backend logic, so as to intuitively compare the advantages and disadvantages of different backend logics in terms of performance, scalability, maintainability, etc., thereby helping developers select a better logical orchestration method, and being able to ensure that the generated code meets the quality requirements in terms of logical orchestration, thereby improving the code quality of the entire system and reducing potential errors and defects. It overcomes the problem that the existing methods cannot evaluate the logical orchestration effect of the code when generating front-end code and back-end code, it is difficult to discover potential logical errors in the initial stage of development, and it cannot ensure that the generated code meets the quality requirements in terms of logical orchestration.
[0070] In the embodiments of the present invention, when triggering the model node call instruction based on the model node type corresponding to the code generation instruction, a node index stream is generated by means of an engine rule tool, thereby ensuring the efficient triggering of the model node call instruction. And based on the optimal distances between the normalized decision matrix and the positive ideal solution and the negative ideal solution to determine the optimal call instruction corresponding to the model node type, the obtained optimal call instruction is more objective and accurate, and can truly reflect the advantages and disadvantages of each model node type under the comprehensive consideration of multiple attributes, which helps to improve the performance and efficiency of the entire system and better meet the requirements of actual applications.
[0071] In the embodiments of the present invention, by calculating the cosine similarity between the business logic, business tags, business priorities, and data model driving, 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 requirements 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 development difficulty and cost. At the same time, it improves the accuracy and adaptability of the data model, and further ensures the efficient and accurate integration of the code configuration resource set.
[0072] In the embodiments of the present invention, when clustering and evaluating the code configuration resource set, the backend logic associated with the low-code platform is determined based on the full connection method to construct a similarity matrix between the sub-cluster centers and the backend logic. And 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 the embodiments of the present invention, a code evaluation model and its training method are provided. The code evaluation model is based on a convolutional neural network, and a weighted bidirectional feature pyramid network, an extreme learning machine, and a CBAM convolutional attention module are introduced. When processing complex programming statements, it can not only understand the meaning of individual variables or operators, but also grasp the function of the entire code block, so as to more accurately evaluate 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 have better performance in different code scenarios, improving the accuracy and reliability of the evaluation of the code logic arrangement effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 is a schematic flowchart of the implementation of the code generation method based on the low-code platform provided by the present invention.
[0075] Figure 2 shows a schematic flowchart of the implementation of the method for triggering the model node call instruction based on the model node type corresponding to the code generation instruction.
[0076] Figure 3 The figure shows a schematic implementation process diagram of the business logic, business tags, business priorities, and data model-driven methods associated with model nodes by the low-code platform based on cosine similarity feedback.
[0077] Figure 4 The figure shows a schematic implementation process diagram of the clustering evaluation method for the code configuration resource set.
[0078] Figure 5 The figure shows a schematic implementation process diagram of the method for constructing a code evaluation model.
[0079] Figure 6 The figure shows a schematic implementation process diagram of the method for solving the logical orchestration effect of the backend logic using a pre-constructed code evaluation model.
[0080] Figure 7 It is a schematic structural diagram of the code generation system based on the low-code platform provided by the present invention. Detailed implementation manners
[0081] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs; the terms used in the specification of this application 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 drawings are intended to cover non-exclusive inclusion. The terms "first", "second", etc. in the specification and claims of this application or the above drawings are used to distinguish different objects and are not used to describe a specific order.
[0082] Referring to "embodiments" herein means that the specific features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of this application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0083] Existing methods for generating code cannot evaluate the logical orchestration effect of the code when generating front-end code and back-end code. It is difficult to discover potential logical errors in the initial stage of development and cannot ensure that the generated code meets the quality requirements in terms of logical orchestration. 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 a code generation instruction, triggers a model node call instruction based on the model node type corresponding to the code generation instruction. The low-code platform obtains a code configuration resource set based on the cosine similarity feedback of the business logic, business tags, business priorities, and data model drive associated with the model node, performs clustering evaluation on the code configuration resource set, generates at least one set of back-end logic, uses a pre-built code evaluation model to solve the logical orchestration effect of the back-end logic, and determines whether the logical orchestration effect of the back-end logic meets the preset effect threshold. If the logical orchestration effect of the back-end logic meets the preset effect threshold, the current back-end logic is output. In the embodiments of the present invention, the low-code platform obtains a code configuration resource set based on the cosine similarity feedback of the business logic, business tags, business priorities, and data model drive associated with the model node, performs clustering evaluation on 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 logical 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., thereby helping developers select a better logical orchestration method and ensuring that the generated code meets the quality requirements in terms of logical orchestration, thereby improving the code quality of the entire system and reducing potential errors and defects. It overcomes the problems that existing methods for generating code cannot evaluate the logical orchestration effect of the code when generating front-end code and back-end code, it is difficult to discover potential logical errors in the initial stage of development, and cannot ensure that the generated code meets the quality requirements in terms of logical orchestration.
[0084] An embodiment of the present invention provides a code generation method based on a low-code platform. Figure 1 The implementation process schematic diagram of the code generation method based on the low-code platform is shown. The code generation method based on the low-code platform specifically includes:
[0085] Step S10, in response to a code generation instruction, parse the code generation instruction, and trigger a model node call instruction based on the model node type corresponding to the code generation instruction;
[0086] It should be noted that the code generation instruction can be generated from a user command line interface, inside an application program, or an HTTP server request.
[0087] Step S20: Load the model node call instruction, traverse the low-code platform based on the model node call instruction, and the low-code platform feeds back the business logic, business labels, business priorities, and data model drivers associated with the model node based on cosine similarity, and integrates the business logic, business labels, business priorities, and data model drivers into a code configuration resource set;
[0088] Step S30: Obtain the code configuration resource set, perform clustering evaluation on the code configuration resource set to generate at least one set of backend logics, and use a pre-constructed code evaluation model to solve the logical orchestration effect of the backend logics;
[0089] In the embodiment of the present invention, when performing clustering evaluation on the code configuration resource set to generate at least one set of backend logics, the number of backend logics can be 10-20 groups, and 10-20 groups are taken as a batch, thus ensuring the efficient evaluation of the logical orchestration effect.
[0090] Step S40: Determine whether the logical orchestration effect of the backend logics meets a preset effect threshold. In this embodiment, the effect threshold can be set to 0.8-0.85;
[0091] Step S50: If the logical orchestration effect of the backend logics meets the preset effect threshold, output the current backend logics.
[0092] If the logical orchestration effect of the backend logics does not meet the preset effect threshold, return to Step S20 and continue to obtain the code configuration resource set.
[0093] Step S60: In response to the backend logics that meet the preset effect threshold, index the low-code platform based on the backend logics, and the low-code platform deploys the application program code.
[0094] In the embodiment of the present invention, the low-code platform feeds back the business logic, business labels, business priorities, and data model drivers associated with the model node based on cosine similarity, and at the same time performs clustering evaluation on the code configuration resource set to generate at least one set of backend logics, and uses a pre-constructed code evaluation model to solve the logical orchestration effect of the backend logics, so as to intuitively compare the advantages and disadvantages of different backend logics in terms of performance, scalability, maintainability, etc., thereby helping developers select a better logical orchestration method, and being able to ensure that the generated code meets the quality requirements in terms of logical orchestration, thereby improving the code quality of the entire system and reducing potential errors and defects. It overcomes the problem that the existing methods cannot evaluate the logical orchestration effect of the code when generating front-end code and backend code, it is difficult to discover potential logical errors in the initial stage of development, and it cannot ensure that the generated code meets the quality requirements in terms of logical orchestration.
[0095] The embodiment of the present invention provides a method for triggering a model node call instruction based on the model node type corresponding to a code generation instruction. Figure 2The figure shows a schematic implementation flow diagram of a method for triggering a model node call instruction based on the model node type corresponding to a code generation instruction. The method for triggering a model node call instruction based on the model node type corresponding to a code generation instruction specifically includes:
[0096] Step S101, parse the code generation instruction and determine the model node configuration information based on the code generation instruction;
[0097] In an embodiment of the present invention, when determining the model node configuration information based on the code generation instruction, the user is supported to define custom attributes for the model node. These attributes can be read during code generation, and the node configuration is determined according to the attribute values.
[0098] Step S102, in response to the model node configuration information, input 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 tool includes, but is not limited to, the open-source rule engine LiteFlow, the JVS rule engine, and the LsqParserEngine rule engine. The model node configuration information can be model type, node type, input configuration, output format, advanced parameter configuration, variable configuration, task flow scheduling information.
[0100] Step S103, load the node index stream. The node index stream is extended from the low-code platform advanced form logic based on the breadth-first algorithm AGM, and at least one group of candidate index rule streams is indexed in a bottom-up manner, where the candidate index rule stream includes code rules and model nodes;
[0101] In an embodiment of the present invention, the node index stream is an important technical concept in the low-code platform. It allows users to quickly design and customize various forms, processes, and logics through a graphical interface without writing code. When the node index stream is extended from the low-code platform advanced form logic 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 a part of the target index rule stream, whether it meets the business logic requirements, etc. If the conditions are met, it is marked as a candidate index node.
[0102] Step S104, perform standardized encoding on the candidate index rule stream. Each group of the candidate index rule streams corresponds to a standardized identification code, and node path extension is performed within 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: 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 by combining the analytic hierarchy process.
[0104] It should be noted that when constructing the normalized decision matrix, since the dimensions and numerical ranges of each index may be different, it is necessary to standardize the original data to eliminate the influence of these differences on the results. Common standardization methods include range standardization method, maximum value standardization method, mean standardization method, etc. In this embodiment, the min-max normalization method is selected.
[0105] Step S106: 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.
[0106] Among them, the positive ideal solution and negative ideal solution are expressed as:
[0107]
[0108] Among them, C + , C - represent the positive ideal solution set and negative ideal solution set respectively, represent the maximum value and minimum value of the j-th column in the normalized decision matrix respectively.
[0109] Step S107: Calculate the distances between the normalized decision matrix and the positive ideal solution and negative ideal solution, and determine the optimal call instruction corresponding to the model node type based on the optimal distances between the normalized decision matrix and the positive ideal solution and negative ideal solution, and use 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 negative ideal solution respectively, and C i represents the optimal distance between the normalized decision matrix and the positive ideal solution and negative ideal solution.
[0112] In this embodiment, the comprehensive evaluation index is calculated according to the TOPSIS method. The larger the comprehensive evaluation index, 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. Compare the comprehensive evaluation indexes of each model node type, and select the call instruction corresponding to the model node type with the largest comprehensive evaluation index as the optimal call instruction.
[0113] In the embodiments of the present invention, when triggering a model node call instruction based on the model node type corresponding to the code generation instruction, a node index stream is generated by means of an engine rule tool, thus ensuring the 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 distances 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 the comprehensive consideration of multiple attributes, which helps to improve the performance and efficiency of the entire system and better meet the requirements of actual applications.
[0114] The embodiments of the present invention provide a method for a low-code platform to drive business logic, business tags, business priorities, and data models based on cosine similarity feedback and model node association. Figure 3 The figure shows a schematic implementation flow diagram of a method for a low-code platform to drive business logic, business tags, business priorities, and data models based on cosine similarity feedback and model node association. The method for a low-code platform to drive business logic, business tags, business priorities, and data models based on cosine similarity feedback and model node association specifically includes:
[0115] Step S201, in response to a model node call instruction, the low-code platform generates a tag call matrix based on the business tag corresponding to the model node call instruction, and forms a logical association matrix based on the relationship between the business tag and the business logic.
[0116] In this embodiment, when generating the tag call matrix, a set of two-dimensional tables are created. The rows of the two-dimensional table represent model nodes, and the columns represent business tags, forming the framework of the tag call matrix. Then, according to the functions of the model nodes and the meanings of the business tags, association rules are formulated to determine the corresponding relationship between the model nodes and the business tags, and the corresponding relationship between the model nodes and the business tags is filled into the corresponding positions of the matrix with specific identifiers (such as numbers, letters, or symbols).
[0117] Step S202, load the tag call matrix and the logical association matrix, and calculate the business priority associated with the model node based on the tag call matrix and the logical association matrix.
[0118] In the embodiments of the present invention, by analyzing the tag call matrix and the logical association matrix, the sequence and dependency relationships 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 each tag field. By calculating the business priority associated with the model node, the low-code platform can clarify which businesses are core businesses and which are secondary businesses, so as to invest more resources in the businesses with higher priorities, improving the response speed of the low-code platform.
[0119] In this embodiment, the business 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 are the label call matrix and the logical association matrix respectively, C j represents the in-degree centrality of model node i driven by the corresponding data model of the low-code platform, m represents the data model drive associated with model node i, KP i , KP l are the set of model nodes i and the set of data model drives associated with the low-code platform respectively.
[0122] It should be noted that in-degree centrality is a concept in graph theory used to measure the importance or influence of nodes in a graph. In a directed graph, the in-degree of a node refers to the number of edges pointing to that node. The higher the in-degree centrality of a node, the more edges point to it, usually indicating that the node has a more important position or stronger connectivity in the graph. In this embodiment, introducing in-degree centrality can measure the relevance between model node i and the corresponding data model drive of the low-code platform.
[0123] Step S203: Obtain the label call matrix, the logical association matrix, and the business priority, and based on the cosine similarity measurement method, perform a weighted combination of the label call matrix, the logical association matrix, and the business priority to obtain a data model drive similarity set;
[0124] In this embodiment, the data model drive 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 are the label call matrix and the logical association matrix respectively, KP i , KP l are the set of model nodes i and the set of data model drives associated with the low-code platform respectively, α1, α2, α3 are the first similarity coefficient, the second similarity coefficient, and the third similarity coefficient respectively. In this embodiment, the value ranges of the first similarity coefficient, the second similarity coefficient, and the third similarity coefficient are 0.1 - 0.8, and the magnitudes of the first similarity coefficient, the second similarity coefficient, and the third similarity coefficient increase in sequence.
[0127] Step S204: Load the data model-driven similarity set, calculate the eigenvalues of the data model-driven similarity set based on the Laplace algorithm, and extract the top m data model-drivens in descending order;
[0128] Step S205: Integrate the business logic, business tags, business priorities, and data model-drivens into a code configuration resource set.
[0129] In this embodiment, by calculating the cosine similarity between the business logic, business tags, business priorities, and data model-drivens, 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 requirements, 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 development difficulty and cost. At the same time, it improves the accuracy and adaptability of the data model, 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 which shows the implementation process schematic diagram of the method for clustering and evaluating a code configuration resource set. The method for clustering and evaluating a code configuration resource set specifically includes:
[0131] Step S301: Load the code configuration resource set, select A samples from the code configuration resource set as sub-cluster centers, and obtain A sub-cluster centers;
[0132] Step S302: Load the A sub-cluster centers, calculate the distance between the business logic in the code configuration resource set and the sub-cluster centers, determine the sub-cluster center to which the business logic belongs based on the distance between the business logic and the sub-cluster centers, and iteratively update 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 low-code platform for the A sub-cluster centers, 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 largest eigenvalues and eigenvectors of the Laplace matrix, and construct a logical response space based on the first B largest eigenvalues and eigenvectors;
[0134] Step S304: Load the logical response space, use the K-means clustering algorithm to convert the logical response space into a clustering backend logic with the number of clusters being C, generate at least one set of backend logics, and use the K-means clustering algorithm to process the logical response space. The clustering result can be used as a basis for feature selection and extraction of the backend logic from the low-code platform, helping to select important backend logics related to the clustering target and removing irrelevant backend logics.
[0135] In this embodiment, when clustering and evaluating the code configuration resource set, the backend logic associated with the A sub-cluster centers is determined based on the fully connected method, a similarity matrix between the sub-cluster centers and the backend logic is constructed, and combined with the K-means clustering algorithm, the complex logic 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 implementation process schematic diagram of the code evaluation model construction method is shown. The code evaluation model construction method specifically includes:
[0137] Step S401: Use a convolutional neural network 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 the trial-and-error method.
[0138] In the embodiment of the present invention, the number of neurons can be between 1 and 10, the number of layers of the hidden layer can be between 1 and 4, and the transfer function between the input layer and the hidden layer can be the tansig function.
[0139] Step S402: Introduce 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: Traverse the open-source evaluation set, internal data evaluation set, and crowdsourcing evaluation dataset, and divide the open-source evaluation set, internal data evaluation set, and crowdsourcing evaluation dataset into a training set and a test set according to a distribution ratio of 3:1. The training set and the test set include code text features, syntax structure features, code backend logic, and function features.
[0141] Step S404: Preset the loss function, activation function, training error target, and maximum number of training rounds of the code evaluation model, and use the Bayesian regularization algorithm to iteratively train the initial model with the training set 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 , and the maximum number of training rounds is 200 - 220 times.
[0143] Step S405: Load the test set, use the test set as the input, execute the code evaluation model, and obtain the execution result of the test set.
[0144] Step S406: Determine the logical orchestration effect of the test set based on the execution results of the test set;
[0145] Step S407: Determine whether the logical orchestration effect meets the preset effect threshold, and the preset effect threshold can be 0.8 - 0.85;
[0146] Step S408: If the logical orchestration effect meets the preset effect threshold, output the converged code evaluation model.
[0147] If the logical orchestration effect does not meet the preset effect threshold, return to Step S404.
[0148] In the embodiments of the present invention, a code evaluation model and its training method 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 not only understand the meaning of individual variables or operators, but also grasp the function of the entire code block, so as to more accurately evaluate the effect of code logical orchestration. 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 have better performance in different code scenarios, improving the accuracy and reliability of the evaluation of the code logical orchestration effect.
[0149] The embodiments of the present invention provide a method for solving the logical orchestration effect of backend logic using a pre - constructed code evaluation model. Figure 6 The schematic diagram of the implementation process of the method for solving the logical orchestration effect of backend logic using a pre - constructed code evaluation model is shown. The method for solving the logical orchestration effect of backend logic using a pre - constructed code evaluation model specifically includes:
[0150] Step S501: Load at least one set of backend logic. The input layer of the code evaluation model constructs a multi - dimensional syntax tree based on the backend logic, the code text features, syntax 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 implement specific business functions. By analyzing the code, the business logic rules and methods therein are extracted. These business logics are used as nodes or attributes of the multi - dimensional syntax tree, combined with the structure and syntax features of the code. When constructing the multi - dimensional syntax tree, corresponding nodes and branches are added for each exception situation and boundary condition to comprehensively reflect the integrity and robustness of the backend logic.
[0152] Step S502: Obtain the multi - dimensional syntax tree corresponding to the backend logic, read the code text features, syntax structure features, code backend logic, and function features through the multi - dimensional syntax tree, and the hidden layer extracts the code execution feature vector;
[0153] Step S503: Load the code execution feature vector. The weighted bidirectional feature pyramid network performs weighted fusion on the code execution feature vector to obtain a weighted fusion set, and merges the weighted fusion set with the code text features, syntax structure features, code backend logic, and function features to obtain a merged feature set;
[0154] Step S504: Extract features from 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: Load the optimal feature set, perform normalization processing on the optimal feature set, and calculate the logic arrangement effect of the backend logic based on the activation kernel function of the extreme learning machine;
[0156] Among them, the logic 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, w o , F o are the connection weight matrix between the hidden layer and the output layer and the input representation of the optimal feature set respectively, b o is the bias term of the activation kernel function, β o is the connection weight between the input layer and the hidden layer, D is the number of multi-dimensional syntax tree symbol nodes, which can be 10 - 40, λ represents the decay parameter of the activation kernel function. In this embodiment, the decay parameter is set to 0.002 - 0.02, and o represents the current multi-dimensional syntax tree symbol node.
[0159] In this embodiment, the activation kernel function of the extreme learning machine can effectively process non-linear data. However, 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 activation kernel function can be better exerted, and the evaluation accuracy of the model for 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 which shows a schematic structural diagram of the code generation system based on the low-code platform. The code generation system based on the low-code platform specifically includes:
[0161] An instruction parsing module 100, in response to a code generation instruction, parses the code generation instruction, and triggers a model node call instruction based on the model node type corresponding to the code generation instruction;
[0162] A resource integration module 200, configured to load a model node call instruction, traverse a low-code platform based on the model node call instruction, and the low-code platform feeds back business logic, business tags, business priorities, and data model drivers associated with the model node, and integrates the business logic, business tags, business priorities, and data model drivers into a code configuration resource set;
[0163] A backend logic generation module 300, configured to obtain the code configuration resource set, perform clustering evaluation on the code configuration resource set, generate at least one set of backend logic, solve the logic orchestration effect of the backend logic by using a pre-built code evaluation model, and determine whether the logic orchestration effect of the backend logic meets a preset effect threshold. If the logic orchestration effect of the backend logic meets the preset effect threshold, output the current backend logic;
[0164] A code deployment module 400, in response 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 application program code.
[0165] In an embodiment of the present invention, the instruction parsing module 100, the resource integration module 200, the backend logic generation module 300, and the code deployment module 400 are communicatively connected by using DTU or Bluetooth. Moreover, the code generation system based on the low-code platform provided in the embodiment of the present invention corresponds to the above-mentioned code generation method based on the low-code platform. For the explanations, examples, beneficial effects, etc. of relevant contents, reference can be made to the corresponding contents in the code generation method based on the low-code platform, which will not be elaborated here.
[0166] In this embodiment, the resource integration module 200 includes:
[0167] An association matrix generation unit 210, in response to a model node call instruction, the low-code platform generates a tag call matrix based on the business tags corresponding to the model node call instruction, and forms a logic association matrix based on the relationship between the business tags and the business logic;
[0168] A priority calculation unit 220, loads the tag call matrix and the logic association matrix, and calculates the business priorities associated with the model node based on the tag call matrix and the logic association matrix;
[0169] A similarity set generation unit 230, obtains the tag call matrix, the logic association matrix, and the business priorities, and performs weighted combination on the tag call matrix, the logic association matrix, and the business priorities by using a cosine similarity metric method to obtain a data model driver similarity set;
[0170] The resource set configuration unit 240 loads the data model-driven similarity set, calculates the eigenvalues of the data model-driven similarity set based on the Laplace algorithm, extracts the top m data model-drivens in descending order, and integrates business logic, business tags, business priorities, and data model-drivens into the code configuration resource set.
[0171] In summary, the present invention provides a code generation method and system based on a low-code platform. In the embodiments of the present invention, the low-code platform is based on the business logic, business tags, business priorities, and data model-drivens associated with the cosine similarity feedback and model nodes, and at the same time performs clustering evaluation on the code configuration resource set to generate at least one set of backend logics, and uses a pre-constructed code evaluation model to solve the logical orchestration effect of the backend logics, so as to intuitively compare the advantages and disadvantages of different backend logics in terms of performance, scalability, maintainability, etc., thereby helping developers select a better logical orchestration method, and being able to ensure that the generated code meets the quality requirements in terms of logical orchestration, thereby improving the code quality of the entire system and reducing potential errors and defects. It overcomes the problems of the existing methods that when generating front-end code and backend code, they cannot evaluate the logical orchestration effect of the code, it is difficult to discover potential logical errors in the initial stage of development, and they cannot ensure that the generated code meets the quality requirements in terms of logical 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 a code generation instruction, parse the code generation instruction, and trigger a model node call instruction based on the 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 feeds back the business logic, business labels, business priorities, and data model drivers associated with the model node based on cosine similarity, and integrate the business logic, business labels, business priorities, and data model drivers into a code configuration resource set; Obtain the code configuration resource set, perform clustering evaluation on the code configuration resource set, generate at least one set of backend logics, solve the logical orchestration effect of the backend logics using a pre-built code evaluation model, and determine whether the logical orchestration effect of the backend logics meets a preset effect threshold. If the logical orchestration effect of the backend logics meets the preset effect threshold, output the current backend logic; The method for triggering a model node call instruction based on the model node type corresponding to the code generation instruction specifically includes: Parse the code generation instruction and determine the model node configuration information based on the code generation instruction; In response to the model node configuration information, input the model node configuration information into the engine rule tool of the low-code platform, and the engine rule tool generates a node index stream; Load the node index stream, and the node index stream extends from the high-level form logic of the low-code platform based on the breadth-first algorithm AGM, and indexes at least one set of candidate index rule streams in a bottom-up manner, where the candidate index rule streams include code rules and model nodes; Perform standardized encoding on the candidate index rule streams, and each set of the candidate index rule streams corresponds to a standardized identification code. Based on the standardized identification code, perform node path extension within the low-code platform, 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 analytic hierarchy process; 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 negative ideal solution are expressed as: (1) Among them, represent the positive ideal solution set and the negative ideal solution set respectively, respectively represent the maximum value and the minimum value of the th column in the normalized decision matrix; Calculate the distances between the normalized decision matrix and the positive ideal solution and negative ideal solution, and determine the optimal call instruction corresponding to the model node type based on the optimal distances between the normalized decision matrix and the positive ideal solution and negative ideal solution, and use the optimal call instruction as the model node call instruction; (2) (3) (4) They are the distances between the normalized decision matrix and the positive ideal solution and the negative ideal solution respectively, indicating the optimal distances between the normalized decision matrix and the positive ideal solution and the negative ideal solution.
2. The code generation method based on a low-code platform according to claim 1, wherein: The code generation method based on the low-code platform further includes: In response to the backend logic that meets the preset effect threshold, index the low-code platform based on the backend logic, and the low-code platform deploys the application program code.
3. The code generation method based on a low-code platform according to claim 2, characterized in that: The method for the low-code platform to feed back the business logic, business labels, business priorities, and data model drivers associated with the model node based on cosine similarity specifically includes: 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 tag call matrix and the logical association matrix, and calculate the business priorities associated with the model nodes based on the tag call matrix and the logical association matrix; Obtain the tag call matrix, the logical association matrix, and the business priorities, and perform a weighted combination of the tag call matrix, the logical association matrix, and the business priorities based on the cosine similarity measurement method to obtain a data model-driven similarity set; Load the data model-driven similarity set, calculate the eigenvalues of the data model-driven similarity set based on the Laplace algorithm, and extract the top m data model drivers in descending order; Integrate the business logic, business tags, business priorities, and data model drivers into a code configuration resource set.
4. The code generation method based on a low-code platform according to claim 3, wherein: The business priority is calculated by the following formula: (5) (6) Among them, represents the business priority associated with the model node , represents the weight of the model node . They are respectively the label call matrix and the logical association matrix. represents the in-degree centrality of the model node driven by the corresponding data model of the low-code platform, represents the data model drive associated with the model node , They are respectively the set of model nodes and the set of data model drives associated with the low-code platform; Among them, the data model-driven similarity set is calculated by the following formula: (7) Among them, represents the business priority associated with the model node and represents the weight of the model node . They are respectively the label call matrix and the logical association matrix which are respectively the set of model nodes and the low-code platform associated data model-driven set and are respectively the first similarity coefficient, the second similarity coefficient, and the third similarity coefficient.
5. The code generation method based on a low-code platform according to claim 4, characterized in that: The method for clustering and evaluating the code configuration resource set specifically includes: Load the code configuration resource set, select A samples from the code configuration resource set as sub-cluster centers, and obtain A sub-cluster centers; Load the A sub-cluster centers, calculate the distance between the business logic in the code configuration resource set and the sub-cluster centers, determine the sub-cluster center to which the business logic belongs based on the distance between the business logic and the sub-cluster centers, and iteratively update the A sub-cluster centers until the A sub-cluster centers reach the maximum number of iterations; Determine the backend logic associated with the low-code platform for the A sub-cluster centers based on the fully connected method, 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 largest eigenvalues and eigenvectors of the Laplace matrix, and construct a logical response space based on the first B largest eigenvalues and eigenvectors; Load the logical response space, and use the K-means clustering algorithm to convert the logical response space into clustering backend logics with the number of clusters being C, and generate at least one set of backend logics.
6. The code generation method based on a low-code platform according to claim 2, wherein: The method for constructing the code evaluation model specifically includes: Use a convolutional neural network 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 the trial-and-error method; Introduce 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; Traverse the open-source evaluation set, the internal data evaluation set, and the crowdsourcing dataset, and divide the open-source evaluation set, the internal data evaluation set, and the crowdsourcing dataset into a training set and a test set according to the allocation ratio of 3:
1. The training set and the test set include code text features, syntax structure features, code backend logics, and function features; Preset the loss function, activation function, training error target, and maximum number of training epochs of the code evaluation model, and use the Bayesian regularization algorithm to iteratively train the initial model with the training set until convergence; Load the test set, use the test set as the input, execute the code evaluation model, and obtain the execution result of the test set; Determine the logical orchestration effect of the test set based on the execution result of the test set, and judge whether the logical orchestration effect meets the preset effect threshold; If the logical orchestration effect meets the preset effect threshold, output a converged code evaluation model.
7. The code generation method based on a low-code platform according to claim 6, wherein: The method for solving the logical orchestration effect of the backend logic using a pre-constructed code evaluation model specifically includes: Load at least one set of backend logic. The input layer of the code evaluation model constructs a multi-dimensional syntax tree based on the backend logic, the code text features, syntax structure features, code backend logic, and function features of the backend logic. Obtain the multi-dimensional syntax tree corresponding to the backend logic. Read the code text features, syntax structure features, code backend logic, and function features through the multi-dimensional syntax tree, and the hidden layer extracts the code execution feature vector. Load the code execution feature vector. The weighted bidirectional feature pyramid network weights and fuses the code execution feature vector to obtain a weighted fusion set, and merges the weighted fusion set with the code text features, syntax structure features, code backend logic, and function features to obtain a merged feature set. Extract features from the merged feature set based on the extreme learning machine and the CBAM convolutional attention module to extract the optimal feature set. Load the optimal feature set, normalize the optimal feature set, and calculate the logical orchestration effect of the backend logic based on the activation kernel function of the extreme learning machine. Among them, the logical orchestration effect of the backend logic is calculated by the following formula: (8) Among them, represents the logical arrangement effect value of the backend logic, is the activation kernel function of the extreme learning machine, are the connection weight matrix between the hidden layer and the output layer, and the input representation of the optimal feature set respectively, is the bias term of the activation kernel function, is the connection weight between the input layer and the hidden layer, is the number of multi-dimensional syntax tree symbol nodes, represents the decay parameter of the activation kernel function, represents the current multi-dimensional syntax tree symbol node.
8. A code generation system based on a low-code platform for implementing the code generation method based on a low-code platform according to any one of claims 1-7, characterized in that: The code generation system based on the low-code platform specifically includes: The instruction parsing module, in response to the code generation instruction, parses the code generation instruction and triggers the model node call 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 instruction, traverse the low-code platform based on the model node call instruction. The low-code platform feeds back the business logic, business labels, business priorities, and data model drivers associated with the model node based on the cosine similarity, and integrates the business logic, business labels, business priorities, and data model drivers into a code configuration resource set. The backend logic generation module is used to obtain the code configuration resource set, perform clustering evaluation on the code configuration resource set to generate at least one set of backend logic, solve the logical orchestration effect of the backend logic using a pre-constructed code evaluation model, 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. The code deployment module, in response 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 program code.
9. The code generation system based on a low-code platform according to claim 8, wherein: 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. The priority calculation unit loads the label call matrix and the logical association matrix, and calculates the business priority associated with the model node based on the label call matrix and the logical association matrix. The similarity set generation unit obtains the label call matrix, the logical association matrix, and the business priority, and performs a weighted combination of the label call matrix, the logical association matrix, and the business priority based on the cosine similarity measurement method to obtain a data model-driven similarity set. Resource set configuration unit, load the data model-driven similarity set, calculate the eigenvalues of the data model-driven similarity set based on the Laplace algorithm, extract the top m data model-drivens in descending order, and integrate business logic, business tags, business priorities, and data model-drivens into the code configuration resource set.
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