A low-code platform operation method, system, electronic device and storage medium

By collecting the associated data of the code in a low-code platform and generating intermediate representations using graph neural networks and sequence models, the problem of insufficient understanding of code semantics, contexts and business logic in the prior art is solved, and a higher accuracy code is achieved Reuse and smart tips.

CN118963746BActive Publication Date: 2025-02-21DALIAN ZHUOYUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411459016.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-02-21
Estimated Expiration
2044-10-18

AI Technical Summary

Technical Problem

When processing code, the existing low-code platform mainly stays at the syntax level and lacks an in-depth understanding of code semantics, context and business logic, resulting in low quality and accuracy of intelligent prompts and optimization suggestions.

Method used

By collecting the associated data of the code, including source code abstract syntax tree (AST), program dependency graph, knowledge graph and document annotation information, and using graph neural network (GNN) and sequence models to generate comprehensive intermediate representations, comprehensive capture of the semantics of the code, comprehensively capture the code's semantics using graph neural network (GNN) and sequence models. Information, context, and business logic. Then, through the code matching module, the intermediate representation is used to match the code in the code base, reusable code snippets are found, and the existing code is adapted to the target scenario through domain offset technology to make it more in line with the target scenario.

Benefits of technology

Improves the accuracy of code reuse, providing smart tips and optimization suggestions for higher quality and accuracy by a more comprehensive understanding of the semantics, context and business logic of the code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963746B_ABST
    Figure CN118963746B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of software development technology, and discloses a low-code platform operation method, system, electronic device and storage medium, wherein the method comprises the following steps: collecting associated data of the code, the associated data comprising source code AST, program dependency graph, knowledge graph and document annotation information; inputting first graph structure data, second graph structure data, third graph structure data and sequence data into an intermediate representation generation model, wherein the intermediate representation generation model comprises a first generation model, a second generation model, a third generation model, a fourth generation model and a first output layer. The present invention collects associated data from multiple perspectives, generates intermediate representations using graph neural networks and sequence models, captures semantic information, context and business logic of the code, and adapts the intermediate representation of the existing code through domain offset technology in view of the differences between the target code and the existing code in the domain, so as to meet the target scenario and improve the accuracy of code reuse.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software development technology, and more specifically, to a low-code platform operation method, system, electronic device and storage medium. Background Art

[0002] ‌Low-Code Platform (LCDP) is a development tool that allows non-professional developers to quickly build applications through simplification and automation. It uses a visual approach, a drag-and-drop interface, predefined code snippets, and a rich component library to greatly reduce the technical threshold for software development and improve development efficiency and flexibility.

[0003] The main feature of the low-code platform is that it enables users to quickly build and deliver application software in a visual way with less coding, thereby reducing the cost of software development, configuration, deployment and training in all aspects.

[0004] Existing low-code platforms mainly stay at the syntax level when processing code and lack an in-depth understanding of code semantics, context, and business logic, which results in low quality and accuracy of intelligent prompts and optimization suggestions. Summary of the invention

[0005] The present invention provides a low-code platform operation method, system, electronic device and storage medium to solve the technical problem that when processing codes in the related technology, the code is mainly processed at the grammatical level and there is a lack of in-depth understanding of the code semantics, context and business logic.

[0006] The present invention provides a low-code platform operation method, comprising the following steps:

[0007] S100: Collecting code-related data, including source code AST, program dependency graph, knowledge graph, and document annotation information;

[0008] S200: inputting the first graph structure data, the second graph structure data, the third graph structure data and the sequence data into an intermediate representation generation model, wherein the intermediate representation generation model includes a first generation model, a second generation model, a third generation model, a fourth generation model and a first output layer;

[0009] The first graph structure data includes nodes in the source code AST and edges connecting the nodes in the source code AST; the second graph structure data includes nodes in the program dependency graph and edges connecting the nodes in the program dependency graph; the nodes in the third graph structure data represent entities in the knowledge graph and edges connecting entities in the knowledge graph; the sequence data is information encoded from document annotation information;

[0010] The first generation model, the second generation model, and the third generation model are all models based on GNN, the fourth generation model is a model based on RNN, and the intermediate representation generation model is a comprehensive model;

[0011] S300: inputting the first hidden state, the second hidden state, the third hidden state and the fourth hidden state into the first output layer, and the first output layer outputs the intermediate representation;

[0012] S400: Input the intermediate representation output by the current first output layer and the domain of the current code into the first linear layer. The first linear layer outputs a vector. The two components of the vector respectively represent the probability of whether the intermediate representation and the domain of the current code match. If the probability of matching is greater than 50%, it means that the current code matches the i-th code in the library.

[0013] S500: Input the intermediate representation of the i-th code in the library and the domain of the current code into the second linear layer, the output of the second linear layer is a vector, the two components of which respectively represent the probability of whether the intermediate representation of the i-th code in the library and the domain of the current code match. If the probability of matching is greater than 50%, it means that the current code matches the i-th code in the library;

[0014] S600: The output of the second linear layer and the output of the first linear layer are input to the second output layer, the second output layer outputs the domain offset of the intermediate representation of the i-th code in the library, then the i-th code is reused and combined with the current code.

[0015] Further, a node in the first generation model represents an AST node, the AST node includes a node type and a value, a directed edge is formed between a parent AST node and a child AST node in the source code AST, the graph structure data is input into a first generation model in the intermediate representation generation model, and then the first generation model outputs a first hidden state;

[0016] The first output layer of the intermediate representation generation model inputs the first hidden state and outputs the encoded source code AST.

[0017] Furthermore, in the second generative model, a node represents a class instance, and node features include class name, code fingerprint, and annotated metadata;

[0018] There is an edge between the node representing the class instance and its adjacent class instance node. The edge represents the call relationship between the class instances. The edge features include the call parameters and the return value type.

[0019] The second graph structure data is input into a second generation model in the intermediate representation generation model, and then the second generation model outputs a second hidden state;

[0020] The first output layer of the intermediate representation generation model inputs the second hidden state and outputs a structured program dependency graph.

[0021] Furthermore, in the third generation model, a node represents an entity node, and each entity is mapped to a unique node ID;

[0022] Map the relationship between entities into directed edges, where the edge type corresponds to the relationship type, and encode the attribute key-value pairs of the entities into attribute edges from entity nodes to text nodes, where the edge attributes are the attributes that assign type ID and weight to each edge;

[0023] The third graph structure data is input into a third generation model in the intermediate representation generation model, and then the third generation model outputs a third hidden state;

[0024] The first output layer of the intermediate representation generation model inputs the third hidden state and outputs the encoded knowledge graph.

[0025] Further, the document annotation information is encoded into sequence data, the nth sequence unit represents the document annotation information at the current moment, and the nsth sequence unit represents the document annotation information at the sth moment before the current moment;

[0026] Inputting the sequence data into a fourth generation model in the intermediate representation generation model, and outputting a fourth hidden state;

[0027] The first output layer of the intermediate representation generation model inputs the fourth hidden state and outputs the encoded document annotation information.

[0028] Furthermore, the expression of the first generative model is as follows:

[0029] ;

[0030] in Represents the hidden state of the AST node of the i-th node, represents the aggregation coefficient of the i-th node, represents the set of nodes that have edges with the i-th node, represents the S-type function, represents the state weight coefficient, Represents the node features of the jth node;

[0031] ;

[0032] ;

[0033] ;

[0034] in and Represent the node features of the i-th and j-th AST nodes respectively, represents the aggregation weight coefficient, represents the splicing weight coefficient, T represents transposition, represents an exponential function with a natural constant as the base, LeakyRelu represents a modified linear unit function, Represents the set of nodes that have edges with the i-th node;

[0035] The expression of the second generative model is as follows: ;

[0036] in Represents a structured program dependency graph, represents the vth hidden state, represents the concatenation of the hidden states of all nodes, N represents the set of all nodes, is the weight parameter, is the first bias parameter, represents the sigmoid function;

[0037] The expression of the third generative model is as follows: ;

[0038] in represents the encoded knowledge graph, represents the oth hidden state, Indicates the concatenation of the hidden states of all nodes. represents the set of all nodes, is the weight parameter, is the second bias parameter, represents the sigmoid function;

[0039] The expression of the fourth generative model is as follows: ;

[0040] in Represents the encoded document comment information, represents the last hidden state, n represents the total number of sequence units of the sequence data, is the weight parameter in the fourth generative model, is the third bias parameter, Represents a sigmoid function.

[0041] Furthermore, the calculation formula of the first output layer is as follows: ;

[0042] in, Indicates splicing, represents the intermediate representation of the output of the first output layer, where , , and Respectively represent the outputs of the first generation model, the second generation model, the third generation model and the fourth generation model in the intermediate representation generation model, is the weight parameter in the first output layer, represents a fourth bias parameter;

[0043] The calculation formula of the first linear layer is as follows:

[0044] ;

[0045] in Indicates splicing, represents the first mixed feature output by the first linear layer, where represents the output of the first output layer, where Indicates the current code field, is the weight parameter in the first linear layer, represents the fifth bias parameter;

[0046] The calculation formula of the second linear layer is as follows:

[0047] ;

[0048] in, Indicates splicing, represents the second mixed feature output by the second linear layer, where represents the intermediate representation of the i-th code in the library, where Indicates the current code field, is the weight parameter in the second linear layer, represents a sixth bias parameter;

[0049] The calculation formula of the second output layer is as follows:

[0050] ;

[0051] in, Indicates splicing, represents the third mixed feature output of the second linear layer, is the weight parameter in the second output layer, Represents the seventh bias parameter.

[0052] The present invention provides a low-code platform operating system, which is used in one or more steps of the aforementioned low-code platform operating method, including:

[0053] Data collection module: collects the associated data of the code, including source code AST, program dependency graph, knowledge graph and document annotation information;

[0054] Intermediate representation generation model: consists of multiple sub-models, including the first generation model, the second generation model, the third generation model, the fourth generation model and the first output layer;

[0055] Code matching module: The output of the linear layer is input to the output layer. The output layer outputs the domain offset of the intermediate representation of the i-th code in the library. The i-th code is reused and combined with the current code.

[0056] Code repository: stores the associated data of existing intermediate representations and codes.

[0057] The present invention provides a storage medium storing non-temporary computer-readable instructions for executing one or more steps in the aforementioned operating method of a low-code platform.

[0058] The present invention provides an electronic device, characterized in that it stores hardware resources for processing the above-mentioned low-code platform operation method, and is used for one or more steps in the aforementioned low-code platform operation method.

[0059] The beneficial effects of the present invention are:

[0060] The present invention collects related data from multiple perspectives and uses graph neural networks and sequence models to generate comprehensive intermediate representations, which can more comprehensively capture the semantic information, context and business logic of the code. By matching the intermediate representation of the target code with the existing code in the code library, reusable code snippets are discovered based on semantic similarity. In view of the differences in domains between the target code and the existing code, the intermediate representation of the existing code is adapted through domain offset technology to make it more suitable for the target scenario, thereby improving the accuracy of code reuse. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 It is a flow chart of a low-code platform operation method proposed by the present invention;

[0062] Figure 2 It is a structural block diagram of a low-code platform operating system proposed by the present invention;

[0063] Figure 3 It is a model structure diagram of the first part of the intermediate representation generation model proposed in the present invention;

[0064] Figure 4 It is a model structure diagram of the second part of the intermediate representation generation model proposed in the present invention.

[0065] In the figure: 101, data acquisition module; 102, intermediate representation generation model; 103, code matching module; 104, code library. DETAILED DESCRIPTION

[0066] The subject matter described herein will now be discussed with reference to example implementations. It should be understood that the discussion of these implementations is only to enable those skilled in the art to better understand and implement the subject matter described herein, and the functions and arrangements of the elements discussed may be changed without departing from the scope of protection of the present specification. Various examples may omit, replace, or add various processes or components as needed. In addition, the features described in some examples may also be combined in other examples.

[0067] At least one embodiment of the present invention discloses a low-code platform operation method, such as Figure 1-Figure 3 As shown, the following steps are included:

[0068] S100: Collecting code-related data, including source code AST, program dependency graph, knowledge graph, and document annotation information;

[0069] S200: inputting the first graph structure data, the second graph structure data, the third graph structure data and the sequence data into an intermediate representation generation model, wherein the intermediate representation generation model includes a first generation model, a second generation model, a third generation model, a fourth generation model and a first output layer;

[0070] The first generation model, the second generation model, and the third generation model input the first graph structure data, the second graph structure data, and the third graph structure data respectively, and then respectively generate the first hidden state, the second hidden state, and the third hidden state;

[0071] The sequence data is input into a fourth generation model, and a fourth hidden state is output;

[0072] S210: Encode first graph structure data, where the first graph structure data includes nodes in a source code AST (Abstract Syntax Tree) and edges connecting nodes in the source code AST, where one node represents an AST node, and the AST node includes a node type (such as a statement, expression, etc.) and a value (variable name, literal, etc.);

[0073] Among them, the parent AST node and the child AST node in the source code AST form a directed edge, and the child AST nodes of the same parent AST node can also form an undirected edge;

[0074] It should be noted that edges can carry attributes, such as the ordinal number of the parent-child edge (the position index of the child node in the parent node's child node list), and for semantic edges, the type of edge (data flow, control flow, etc.) can be annotated;

[0075] The graph structure data is input into a first generation model in the intermediate representation generation model, and then the first generation model outputs a first hidden state;

[0076] The first output layer of the intermediate representation generation model inputs the first hidden state and outputs the encoded source code AST;

[0077] S220: Encode second graph structure data, where the second graph structure data includes nodes in the program dependency graph and edges connecting the nodes in the program dependency graph, where one node represents a class instance, and node features include class name, code fingerprint, and annotated metadata;

[0078] There is an edge between the node representing the class instance and its adjacent class instance node. The edge can be represented as the call relationship between the class instances. It can be a directed edge (indicating the call direction) or an undirected edge (indicating only the existence of a call). The edge features include the call parameters and the return value type.

[0079] The second graph structure data is input into a second generation model in the intermediate representation generation model, and then the second generation model outputs a second hidden state;

[0080] The first output layer of the intermediate representation generation model inputs the second hidden state and outputs a structured program dependency graph;

[0081] S230: Encode third graph structure data, where nodes in the third graph structure data represent entities in the knowledge graph, and the graph structure data also includes edges connecting entities in the knowledge graph, where one node represents one entity node, and each entity is mapped to a unique node ID;

[0082] Map the relationship between entities into directed edges, where the edge type corresponds to the relationship type, and encode the attribute key-value pairs of the entities into attribute edges from the entity node to the text node, where the edge attributes assign type ID, weight and other attributes to each edge;

[0083] The third graph structure data is input into a third generation model in the intermediate representation generation model, and then the third generation model outputs a third hidden state;

[0084] The first output layer of the intermediate representation generation model inputs the third hidden state and outputs the encoded knowledge graph;

[0085] S240: Encode sequence data, encoding the document annotation information into sequence data, wherein the nth sequence unit represents the document annotation information at the current moment, and the nsth sequence unit represents the document annotation information at the sth moment before the current moment;

[0086] Inputting the sequence data into a fourth generation model in the intermediate representation generation model, and outputting a fourth hidden state;

[0087] The first output layer of the intermediate representation generation model inputs the fourth hidden state and outputs the encoded document annotation information;

[0088] The expression of the first generative model is as follows: ;

[0089] in Represents the hidden state of the AST node of the i-th node, represents the aggregation coefficient of the i-th node, represents the set of nodes that have edges with the i-th node, represents the S-type function, represents the state weight coefficient, Represents the node features of the jth node; ;

[0090] ;

[0091] ;

[0092] in and Represent the node features of the i-th and j-th AST nodes respectively, represents the aggregation weight coefficient, represents the splicing weight coefficient, T represents transposition, represents an exponential function with a natural constant as the base, LeakyRelu represents a modified linear unit function, Represents the set of nodes that have edges with the i-th node;

[0093] The expression of the second generative model is as follows:

[0094] ;

[0095] in Represents a structured program dependency graph, represents the vth hidden state, represents the concatenation of the hidden states of all nodes, N represents the set of all nodes, is the weight parameter, is the first bias parameter, represents the sigmoid function;

[0096] The expression of the third generative model is as follows:

[0097] ;

[0098] in represents the encoded knowledge graph, represents the oth hidden state, Indicates the concatenation of the hidden states of all nodes. represents the set of all nodes, is the weight parameter, is the second bias parameter, represents the sigmoid function;

[0099] The expression of the fourth generative model is as follows:

[0100] ;

[0101] in Represents the encoded document comment information, represents the last hidden state, n represents the total number of sequence units of the sequence data, is the weight parameter in the fourth generative model, is the third bias parameter, Represents a sigmoid function.

[0102] S300: inputting the first hidden state, the second hidden state, the third hidden state and the fourth hidden state into the first output layer, and the first output layer outputs the intermediate representation;

[0103] The calculation formula of the first output layer is as follows:

[0104] ;

[0105] Indicates splicing, represents the intermediate representation of the output of the first input layer, where , , and Respectively represent the outputs of the first generation model, the second generation model, the third generation model and the fourth generation model in the intermediate representation generation model, is the weight parameter in the first output layer, represents a fourth bias parameter;

[0106] In one embodiment of the present invention, Figure 4 As shown, a low-code platform operation method also includes the following steps:

[0107] The domain of the intermediate representation output by the current first output layer and the current code is input into the first linear layer. The first linear layer outputs the domain offset of the current intermediate representation, that is, outputs a vector. The two components of the vector respectively represent the probability of whether the domains of the intermediate representation and the current code match. If the matching probability is greater than 50%, it means that the current code matches the domain of the current code.

[0108] The intermediate representation of the i-th code in the library and the domain of the current code are input into the second linear layer. The output of the second linear layer is a vector. The two components of the vector respectively represent the probability of whether the intermediate representation of the i-th code in the library and the domain of the current code match. If the probability of matching is greater than 50%, it means that the i-th code in the library matches the domain of the current code.

[0109] The output of the second linear layer and the output of the first linear layer are input to the second output layer. The second output layer outputs the domain offset of the intermediate representation of the i-th code in the library, then the i-th code is reused and combined with the current code.

[0110] The calculation formula of the first linear layer is as follows:

[0111] ;

[0112] in Indicates splicing, represents the first mixed feature output by the first linear layer, where represents the output of the first output layer, where Indicates the current code field, is the weight parameter in the first linear layer, represents the fifth bias parameter;

[0113] For the code domain, build a code domain knowledge base, which includes various software development fields, such as Web development, mobile development, game development, system software, etc. Each field can be represented by a unique ID and one-hot encoding is used;

[0114] In one example of the present invention, the code domain knowledge base includes but is not limited to the following fields: 0-Web development, 1-mobile development, 2-game development, 3-system software, 4-scientific computing...;

[0115] Then for a given code, we can infer the field it belongs to by analyzing its syntax, API calls, etc., and then represent the ID of the field with one-hot encoding;

[0116] If the current code belongs to the field of web development, then its one-hot encoding is:

[0117] [1, 0, 0, 0, 0, …]

[0118] The first bit is 1 and the rest are 0. This encoding method is simple and effective, and can well input category information into the machine learning model;

[0119] The intermediate representation of the i-th code in the library and the domain of the current code are input into the second linear layer, the output of the second linear layer and the output of the first linear layer are input into the second output layer, and the second output layer outputs the domain offset of the intermediate representation of the i-th code in the library;

[0120] The calculation formula of the second linear layer is as follows:

[0121] ;

[0122] in, Indicates splicing, represents the second mixed feature output by the second linear layer, where represents the intermediate representation of the i-th code in the library, where Indicates the current code field, is the weight parameter in the second linear layer, represents a sixth bias parameter;

[0123] The calculation formula of the second output layer is as follows:

[0124] ;

[0125] in, Indicates splicing, represents the third mixed feature output of the second linear layer, is the weight parameter in the second output layer, represents the seventh bias parameter;

[0126] In one embodiment of the present invention, the step of training the intermediate representation generation model includes:

[0127] Step 101, constructing a target network, the target network copies the intermediate representation generation model;

[0128] Step 102, randomly obtain an experience from the experience pool, the experience includes the state at time t , the action performed at time t , the state at time t+1 , perform the action Rewards ;

[0129] The states at time t and t+1 represent the observation data at the tth and t+1th time points of the intermediate representation generation model input respectively;

[0130] Then calculate the state The output of the target network corresponds to The probability value ;

[0131] ;

[0132] express The maximum probability value of the target network output;

[0133] Step 103, according to and Calculate the loss value loss and update the intermediate representation generation model;

[0134] ;

[0135] express The following intermediate representation generates the model output corresponding to The probability value of

[0136] is the discount factor, a value between 0 and 1;

[0137] Step 104, updating the target network every fixed number of network updates so that its parameters are the same as those of the current intermediate representation generation model;

[0138] Step 105, until the number of collected experiences reaches a set threshold or the intermediate representation generation model converges, the step is terminated.

[0139] In one embodiment of the present invention, the experience is derived from the record of historical action execution.

[0140] In one embodiment of the present invention, the reward The calculation formula is as follows:

[0141] ;

[0142] The accuracy refers to the accuracy of the intermediate representation of the code generated by the method on a test set in a given field, which is calculated by comparing it with the manually annotated "gold standard" intermediate representation.

[0143] The generalization ability refers to the applicability and robustness of the method in new and unseen domains. It can be tested on datasets in some completely new domains to observe the degree of quality degradation of the intermediate representation. Good generalization ability means that the method is less affected by domain shift.

[0144] Efficiency includes two aspects: computational efficiency and annotation cost. Computational efficiency can be measured by the time and resources required to build the intermediate representation.

[0145] The labeling cost refers to the amount of data that needs to be manually labeled before the method can be used in a new field. Good efficiency is crucial for industrial applications.

[0146] in, , , is the weight coefficient of the three indicators, which can be adjusted according to specific needs. For example, if you pay more attention to generalization ability, you can appropriately increase The value of .

[0147] This reward function aims to comprehensively measure the practicality and versatility of a low-code platform operation method. The accuracy reflects the targetedness, the generalization ability reflects the domain adaptability, and the efficiency affects the engineering deployment. By optimizing this comprehensive reward function, an optimal method that achieves a reasonable trade-off between accuracy, generalization, and efficiency can be obtained.

[0148] At least one embodiment of the present disclosure provides an operating system of a low-code platform, including:

[0149] Data collection module 101: collects code-related data, including source code AST, program dependency graph, knowledge graph and document annotation information;

[0150] The intermediate representation generation model 102 is composed of multiple sub-models, including a first generation model, a second generation model, a third generation model, a fourth generation model and a first output layer;

[0151] Code matching module 103: The output of the linear layer is input to the output layer, and the output layer outputs the domain offset of the intermediate representation of the i-th code in the library, then the i-th code is reused and combined with the current code;

[0152] Code repository 104: stores the associated data of existing intermediate representations and codes.

[0153] At least one embodiment of the present disclosure provides a storage medium storing non-transitory computer-readable instructions for executing one or more steps in the aforementioned method for operating a low-code platform.

[0154] The computer program may be stored / distributed on a suitable medium, such as an optical storage medium or a solid-state medium supplied together with or as part of other hardware, but may also be distributed in other forms, such as via the Internet or other wired or wireless telecommunication systems. Any reference signs in the claims should not be construed as limiting the scope.

[0155] At least one embodiment of the present disclosure also provides an electronic device, which is a specific computer device that stores hardware resources for processing the above-mentioned low-code platform operation method. The above-mentioned low-code platform electronic device needs to comprehensively use multiple hardware resources such as CPU, GPU, memory, storage, network and IO to support its core code understanding, matching and assembly functions, and is used to execute one or more steps in the aforementioned low-code platform operation method.

[0156] The above describes an embodiment of the present invention, but this embodiment is not limited to the above-mentioned specific implementation mode. The above-mentioned specific implementation mode is merely illustrative and not restrictive. Under the guidance of this embodiment, ordinary technicians in this field can also make more forms of equivalent embodiments, all of which are within the protection of this embodiment.

Claims

1. A low-code platform operation method, characterized in that: The following steps are involved: S100: Collecting code-related data, including source code AST, program dependency graph, knowledge graph, and document annotation information; S200: inputting the first graph structure data, the second graph structure data, the third graph structure data and the sequence data into an intermediate representation generation model, wherein the intermediate representation generation model includes a first generation model, a second generation model, a third generation model, a fourth generation model and a first output layer; The first graph structure data includes nodes in the source code AST and edges connecting the nodes in the source code AST; the second graph structure data includes nodes in the program dependency graph and edges connecting the nodes in the program dependency graph; the nodes in the third graph structure data represent entities in the knowledge graph and edges connecting entities in the knowledge graph; the sequence data is information encoded from document annotation information; The first generation model, the second generation model, and the third generation model are all models based on GNN, the fourth generation model is a model based on RNN, and the intermediate representation generation model is a comprehensive model; A node in the first generation model represents an AST node, the AST node includes a node type and a value, a directed edge is formed between the parent AST node and the child AST node in the source code AST, the graph structure data is input into the first generation model in the intermediate representation generation model, and then the first generation model outputs a first hidden state; The first output layer of the intermediate representation generation model inputs the first hidden state and outputs the encoded source code AST; In the second generation model, a node represents a class instance, and node features include class name, code fingerprint, and annotation metadata; There is an edge between the node representing the class instance and its adjacent class instance node. The edge represents the call relationship between the class instances. The edge features include the call parameters and the return value type. The second graph structure data is input into a second generation model in the intermediate representation generation model, and then the second generation model outputs a second hidden state; The first output layer of the intermediate representation generation model inputs the second hidden state and outputs a structured program dependency graph; In the third generation model, a node represents an entity node, and each entity is mapped to a unique node ID; Map the relationship between entities into directed edges, where the edge type corresponds to the relationship type, and encode the attribute key-value pairs of the entities into attribute edges from entity nodes to text nodes, where the edge attributes are the attributes that assign type ID and weight to each edge; The third graph structure data is input into a third generation model in the intermediate representation generation model, and then the third generation model outputs a third hidden state; The first output layer of the intermediate representation generation model inputs the third hidden state and outputs the encoded knowledge graph; Encode the document annotation information into sequence data, where the nth sequence unit represents the document annotation information at the current moment, and the nsth sequence unit represents the document annotation information at the sth moment before the current moment; Inputting the sequence data into a fourth generation model in the intermediate representation generation model, and outputting a fourth hidden state; The first output layer of the intermediate representation generation model inputs the fourth hidden state and outputs the encoded document annotation information; ; in Represents the hidden state of the AST node of the i-th node, represents the aggregation coefficient of the i-th node, represents the set of nodes that have edges with the i-th node, represents the S-type function, represents the state weight coefficient, Represents the node features of the jth node; ; ; ; in and Represent the node features of the i-th and j-th AST nodes respectively, represents the aggregation weight coefficient, represents the splicing weight coefficient, T represents transposition, represents an exponential function with a natural constant as the base, LeakyRelu represents a modified linear unit function, Represents the set of nodes that have edges with the i-th node; The expression of the second generative model is as follows: ; in Represents a structured program dependency graph, represents the vth hidden state, represents the concatenation of the hidden states of all nodes, N represents the set of all nodes, is the weight parameter in the second generative model, is the first bias parameter, represents the sigmoid function; The expression of the third generative model is as follows: ; in represents the encoded knowledge graph, represents the oth hidden state, Indicates the concatenation of the hidden states of all nodes. represents the set of all nodes, is the weight parameter in the third generative model, is the second bias parameter, represents the sigmoid function; The expression of the fourth generative model is as follows: ; in Represents the encoded document comment information, represents the last hidden state, n represents the total number of sequence units of the sequence data, is the weight parameter in the fourth generative model, is the third bias parameter, represents the sigmoid function; The calculation formula of the first output layer is as follows: ; in, Indicates splicing, represents the intermediate representation of the output of the first output layer, where , , and Respectively represent the outputs of the first generation model, the second generation model, the third generation model and the fourth generation model in the intermediate representation generation model, is the weight parameter in the first output layer, represents a fourth bias parameter; The calculation formula of the first linear layer is as follows: ; in Indicates splicing, represents the first mixed feature output by the first linear layer, where represents the output of the first output layer, where Indicates the current code field, is the weight parameter in the first linear layer, represents the fifth bias parameter; The calculation formula of the second linear layer is as follows: ; in, Indicates splicing, represents the second mixed feature output by the second linear layer, where represents the intermediate representation of the i-th code in the library, where Indicates the current code field, is the weight parameter in the second linear layer, represents a sixth bias parameter; The calculation formula of the second output layer is as follows: ; in, Indicates splicing, represents the third mixed feature output of the second linear layer, is the weight parameter in the second output layer, represents the seventh bias parameter; S300: inputting the first hidden state, the second hidden state, the third hidden state and the fourth hidden state into the first output layer, and the first output layer outputs the intermediate representation; S400: Input the intermediate representation output by the current first output layer and the domain of the current code into the first linear layer. The first linear layer outputs a vector. The two components of the vector respectively represent the probability of whether the intermediate representation and the domain of the current code match. If the probability of matching is greater than 50%, it means that the current code matches the i-th code in the library. S500: Input the intermediate representation of the i-th code in the library and the domain of the current code into the second linear layer, the output of the second linear layer is a vector, the two components of which respectively represent the probability of whether the intermediate representation of the i-th code in the library and the domain of the current code match. If the probability of matching is greater than 50%, it means that the current code matches the i-th code in the library; The library is a code library that stores the associated data of existing intermediate representations and codes; S600: The output of the second linear layer and the output of the first linear layer are input to the second output layer, the second output layer outputs the domain offset of the intermediate representation of the i-th code in the library, then the i-th code is reused and combined with the current code.

2. A low-code platform operating system, characterized in that: One or more steps of a low-code platform operation method as described in claim 1, comprising: Data collection module (101): collects the associated data of the code, the associated data includes source code AST, program dependency graph, knowledge graph and document annotation information; The intermediate representation generation model (102) is composed of a plurality of sub-models, including a first generation model, a second generation model, a third generation model, a fourth generation model and a first output layer; Code matching module (103): the output of the linear layer is input to the output layer, the output layer outputs the domain offset of the intermediate representation of the i-th code in the library, then the i-th code is reused and combined with the current code; Code repository (104): stores the associated data of existing intermediate representations and codes.

3. A storage medium, characterized in that: Non-transitory computer-readable instructions are stored for executing one or more steps in a method for operating a low-code platform as described in claim 1.

4. An electronic device, characterized in that: Hardware resources for processing the above-mentioned low-code platform operation method are stored, and are used to execute one or more steps in a low-code platform operation method described in claim 1.

Citation Information

Patent Citations

  • Model and deep neural network combined code generation method

    CN118210486A

  • Method for generating source code

    US20230342115A1