A low-code software development system
Through the project management, code generation, Jar package management, deployment management and method call modules in the low-code software development system, the large language model and Java reflection mechanism are used to solve the shortcomings of the existing low-code system in back-end business logic and project deployment, and efficient and stable Java project development and deployment are achieved.
Patent Information
- Application Number
- CN202510187249.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-02-20
AI Technical Summary
The existing low-code development systems lack flexible code generation mechanisms, effective external dependency management and efficient project deployment solutions in building back-end business logic and project deployment, resulting in developers still needing to manually perform a large amount of code corrections and optimizations, and performance and stability cannot be fully guaranteed when processing large-scale concurrent tasks.
It provides a low-code software development system, including project management module, code generation module, Jar package management module, deployment management module and method calling module. It uses a large language model to generate code, deploy it through independent class loaders and parent delegation mechanisms, and dynamically call Jar packages through Java reflection mechanisms to realize automated code generation and flexible deployment.
It significantly improves development efficiency, reduces development costs, ensures the scalability and stability of the system, and is suitable for rapid construction and deployment of Java projects.
Smart Images

Figure CN119668576B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular, to a low-code software development system. Background Art
[0002] With the increasing demand for software development, many problems have gradually emerged in the traditional software development model. The traditional development process usually relies on developers to manually write a large amount of code, which is not only time-consuming and laborious, but also prone to errors, reducing the development efficiency. Especially in projects using mainstream programming languages such as Java, developers often need to perform cumbersome operations such as interface definition, method writing, and dependency management. These repetitive tasks consume a large amount of development resources and it is difficult to ensure the quality and consistency of the code.
[0003] To solve these problems, low-code development platforms have emerged. Low-code development platforms help developers improve development efficiency and lower the technical threshold by simplifying the coding process, providing a visual design interface, and automatically generating code. However, most of the existing low-code development systems focus on the rapid construction of the front-end interface, and the support for aspects such as back-end business logic, interface management, and project deployment is still limited. Existing systems often lack a flexible code generation mechanism, effective external dependency management, and an efficient project deployment plan, resulting in developers still needing to manually perform a large amount of code correction and optimization.
[0004] In addition, some low-code platforms also have deficiencies in task scheduling, load balancing, fault tolerance handling, etc. Especially when dealing with large-scale concurrent tasks, performance and stability cannot be fully guaranteed. Therefore, while existing low-code platforms improve development efficiency, they still face the challenge of not being able to fully meet the requirements of complex projects. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a low-code software development system to eliminate or improve one or more defects existing in the prior art and solve the problem that the prior art cannot quickly build back-end services and perform project deployment.
[0006] One aspect of the present invention provides a low-code software development system, the system comprising:
[0007] A project management module for obtaining a user's creation requirements for a Java project, where the creation requirements include a creation form and a project requirement description; the creation form includes a source code mode and a Jar package mode; in the source code mode, the project requirement description includes a project function description, an interface definition, a method definition for interface invocation, the response parameter type of the method, and the required external dependencies; in the Jar package mode, the project requirement description annotates the interface names and descriptions required by the Java project, the method names and descriptions for interface invocation, parameter names, parameter types, and the external dependencies in the form of annotations.
[0008] A code generation module for, in the source code mode, using a preset large language model with the project requirement description as input to generate a target project file outline according to the example project file outline, and generating code and external dependency information for the required interfaces and methods according to the structure of the target project file outline; modifying and perfecting the code based on user verification of error codes and comments, and combining to generate content.
[0009] A Jar package management module for, in the Jar package mode, obtaining a shared Jar package shared by multiple Java projects, a project Jar package annotated with the project requirement description for the current Java project, and an extended Jar package marking external dependencies according to the example project to configure for the current Java project; in the source code mode, dividing the generated content corresponding to the current Java project into the shared Jar package, the project Jar package, and the extended Jar package shared by multiple Java projects for management.
[0010] A deployment management module for loading the classes in the Java project through a class loader with an independent namespace, creating a META-INF / services directory under the resource directory in both the source code mode and the Jar package mode, creating a file named after the full path of the interface, with the content being the fully qualified name of the interface implementation class, and deploying the generated content to complete the deployment of the Java project; loading the interface implementation classes in the shared Jar package, the project Jar package, and the extended Jar package based on the parent delegation mechanism and the independent class loader under the resource directory according to the preset path to complete the deployment of the JAVA project.
[0011] A method invocation module for dynamically loading the Jar packages in the Java project for invocation based on the reflection mechanism of Java.
[0012] In some embodiments, the system further includes: a Java project integrity verification module, configured to perform integrity review on the project function description, interface definition, method definition, response parameter types, and external dependencies of the deployed Java project according to the project requirement description, and generate a review result. When the integrity review fails, a prompt message is generated.
[0013] In some embodiments, the system further includes: a code generation verification module, configured to perform syntax correctness, logical correctness, and performance testing on the code generated by the code generation module, establish a code generation log to record the code generation process and record the test results; and incorporate the generated code into a version control system, recording the code version generated each time and the corresponding project requirements.
[0014] In some embodiments, the system further includes: a code security detection module, configured to provide a sandbox environment to isolate and test the security of the code, and establish a code security test log for saving the security test results.
[0015] In some embodiments, the code generation module combines Ftl templates to generate the code and a pom.xml file for defining the external dependencies.
[0016] In some embodiments, the deployment management module loads the shared Jar package in the resource directory based on the parent delegation mechanism and an independent class loader according to a preset path, including:
[0017] Create a shared loader directory, download the shared Jar package to the shared loader directory, and put the storage path of the shared Jar package into an array of path URLs;
[0018] Create a class loader instance ShareClassLoader, use AppClassLoader as the parent loader of ShareClassLoader, and load and initialize the interface implementation classes of the shared Jar package based on the parent delegation mechanism according to the storage paths recorded in the array of path URLs.
[0019] In some embodiments, the deployment management module loads the project Jar package and the extension Jar package in the resource directory based on the parent delegation mechanism and an independent class loader according to a preset path, including:
[0020] Create a project loader directory and establish sub-folders, and download the project Jar package and the extension Jar package to the project loader directory;
[0021] Create a custom class loader instance, MicroUdcClassLoader, which loads the interface implementation classes in the project Jar package and the extension Jar package according to the storage path based on the parent delegation mechanism, and use the class loader instance, ShareClassLoader, as the parent loader of the custom class loader instance, MicroUdcClassLoader.
[0022] In some embodiments, the system further includes:
[0023] A requirement mapping module, configured to load a preset large language model to convert the Java project requirements described by the user in natural language into the creation requirements in a standard format.
[0024] In some embodiments, the system further includes: a model management optimization module, configured to perform regular evaluation tests and update iterations on the large language model.
[0025] In some embodiments, the system further includes: an asynchronous task and distributed task management module, configured to convert long-running Java project development tasks into asynchronous tasks for asynchronous execution in the background, or divide the Java project development tasks into multiple subtasks and distribute them to multiple worker nodes for execution.
[0026] The beneficial effects of the present invention are at least:
[0027] In the low-code software development system of the present invention, the project management module is responsible for obtaining the user's creation requirements for the Java project, including the source code mode and the Jar package mode. The code generation module uses the large language model to generate code and external dependency information according to the requirements in the source code mode. The Jar package management module manages and invokes the shared Jar package, project Jar package, and extension Jar package according to the requirements in the Jar package mode. The deployment management module completes the deployment of the project through an independent class loader based on the parent delegation mechanism, and the method call module dynamically calls the loaded Jar package based on the Java reflection mechanism. This system significantly improves the development efficiency, reduces the development cost, while ensuring the scalability and stability of the system, and is suitable for quickly building and deploying Java projects.
[0028] The additional advantages, objects, and features of the present invention will be partially described below, and will become partially apparent to those of ordinary skill in the art after studying the following, or can be learned from the practice of the present invention. The objects and other advantages of the present invention can be realized and obtained by the structures specifically pointed out in the specification and the drawings.
[0029] Those skilled in the art will understand that the objectives and advantages achievable with the present invention are not limited to those specifically described above, and the above and other objectives achievable with the present invention will be more clearly understood based on the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The drawings described herein are used to provide a further understanding of the present invention, form a part of this application, and do not limit the present invention. In the drawings:
[0031] Figure 1 It is a schematic structural diagram of the low-code software development system according to an embodiment of the present invention.
[0032] Figure 2 It is a schematic application logic diagram of the low-code software development system according to an embodiment of the present invention.
[0033] Figure 3 It is a flowchart of generating code by the low-code software development system according to an embodiment of the present invention by referring to the chain of thought of the large language model in the source code mode.
[0034] Figure 4 It is a flowchart of generating project code by the low-code software development system according to an embodiment of the present invention.
[0035] Figure 5 It is a flowchart of the low-code software development system according to an embodiment of the present invention for loading shared Jar packages.
[0036] Figure 6 It is a flowchart of the low-code software development system according to an embodiment of the present invention for loading project Jar packages and extended Jar packages. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0037] To make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in conjunction with the embodiments and the drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but do not limit the present invention.
[0038] Here, it should also be noted that in order to avoid obscuring the present invention with unnecessary details, only the structures and / or processing steps closely related to the solution of the present invention are shown in the drawings, while other details less related to the present invention are omitted.
[0039] It should be emphasized that the term "including / comprising" when used herein refers to the presence of features, elements, steps, or components, but does not exclude the presence or addition of one or more other features, elements, steps, or components.
[0040] Here, it should also be noted that, without special instructions, the term "connection" in this article can not only refer to direct connection, but also indirect connection with intermediaries.
[0041] A low-code platform is a software development tool that allows developers to customize and develop applications through a graphical interface and model-driven logic, rather than relying entirely on traditional coding methods. Low-code platforms usually provide a series of prefabricated modules and components. Users can quickly build applications that include user interfaces, business logic, workflows, and data flow by dragging and dropping, thereby reducing the coding cost of software development in all aspects.
[0042] The workflow engine is the core component in a low-code platform, responsible for managing and executing the workflows of applications. It supports creating and configuring workflows in a visual manner, including operations such as task assignment and data processing. It can also track and monitor the execution status of workflows, providing operation logs and error handling mechanisms. Generally, different categories of workflow nodes are designed in a workflow, such as start nodes, calculation nodes, branch nodes, etc. The combination and orchestration of these nodes can achieve complex business processes, making the visualization of business processes possible. However, with the increase in the complexity of business logic, some limitations also arise. For example, the orchestration is complex. Currently, many low-code platform workflows can only rely on complex workflow orchestration when facing complex business logic. More complex orchestration also means longer testing time, continuously reducing efficiency, which instead goes against the original intention of using a low-code platform. Another example is poor scalability. Fixed workflow nodes limit the scalability of low-code platforms. When a new type of node is required for complex business processes, it can only be achieved by redeveloping new nodes. Current low-code platforms need more flexible expansion capabilities to meet the growing business needs.
[0043] The purpose of this application is to provide a low-code platform with user-defined code nodes (UserDesign Code) in the workflow. In the face of complex business requirements, users can develop Java projects through UDC. It should be noted that a Java project is a software project built based on the Java language, usually containing multiple modules and components to implement specific functions or services. In the present invention, this is the function that the user-defined code node needs to complete. For example, if the function to be completed by a certain node is to send a government WeChat message, a corresponding Java project is created. In a Java project, one or more interfaces can be provided. An interface is an abstract type used to define the specification of a set of methods without providing specific implementations. Separating the interface from the implementation facilitates maintenance and extension. A method is the specific operation logic defined in an interface or class. It receives input parameters (request parameters), performs a series of operations, and returns an output result (response parameter). A method is the specific implementation of the interface specification. An interface defines the specification of a set of methods, which are usually abstract methods without specific implementations. A class can inherit the declarations of these methods by implementing the interface and provide specific implementations. To sum up, a project is used to implement a large function. Multiple interfaces can be included under this project, each interface is used to define a small function, and multiple methods are included in each interface to specifically implement the function. That is, there is a dependency relationship where the project contains multiple interfaces and each interface contains multiple methods.
[0044] Dependency refers to the external libraries or modules that a project depends on during its operation or construction. These dependencies are usually codes written by other developers or organizations to implement specific functions, such as database connection, logging, network communication, etc. By introducing these dependencies, developers can avoid reinventing the wheel and focus on the development of core business logic.
[0045] In a Java project, dependencies are introduced in the form of jar files. A jar file is a special file format used to package and store codes and resources. We call this kind of file a Jar package. After a developer develops a tool or function, it can be packaged into a jar file and then shared with others. Others can directly use this jar file without having to rewrite the code.
[0046] In the present invention, the specific implementation of the methods in a project may use external dependencies. The definition of a Jar package used by a certain project alone is an extended Jar package. If multiple projects use this Jar package, it is defined as a shared Jar package. After the project in the present invention is packaged, the project itself will be packaged, that is, the project Jar package. Although the project itself uses external dependencies, this Jar package does not include the actual code resources of the external dependencies, that is, the extended Jar package or the shared Jar package. Therefore, all three of them need to be deployed to the Java virtual machine where the workflow system runs.
[0047] Specifically, the present invention provides a low-code software development system. As Figure 1 and 2 shown, the system includes: a project management module, a code generation module, a Jar package management module, a deployment management module, and a method call module.
[0048] The project management module is used to obtain the user's creation requirements for a Java project. The creation requirements include the creation form and the project requirement description. The creation form includes the source code mode and the Jar package mode. In the source code mode, the project requirement description includes the project function description, interface definition, method definition for interface call, response parameter type of the method, and required external dependencies. In the Jar package mode, the project requirement description annotates the interface names and descriptions, method names and descriptions for interface call, parameter names, parameter types, and external dependencies required by the Java project in the form of annotations.
[0049] The code generation module is used to, in the source code mode, use a preset large language model with the project requirement description as the input, generate a target project file outline according to the sample project file outline, and generate code and external dependency information for the required interfaces and methods according to the structure of the target project file outline; modify and improve the code based on the user's verification of error codes and comments, and combine to generate content.
[0050] A large language model refers to a language model trained on a large-scale text corpus and containing tens of billions of parameters or more. These models adopt a Transformer architecture and pre-training objectives similar to small models, such as language modeling. The main difference lies in the increase in model size, training data, and computing resources. The performance of large language models often follows the scaling law, that is, the increase in model scale will bring performance improvement. Large language models have a wide range of applications in the fields of natural language processing, text generation, and intelligent dialogue. They learn complex patterns and features through massive data training and exhibit strong generalization ability and prediction performance. Large language models are implemented based on the Chain-of-Thought (CoT). The Chain-of-Thought is a Prompt technology used to improve the performance of large models in complex reasoning tasks, such as mathematical problems, common sense reasoning, and symbolic reasoning. CoT decomposes complex problems into sub-problems and solves them step by step by requiring the large model to explicitly output the intermediate reasoning steps before outputting the final answer. These intermediate steps not only help the model gradually approach the correct answer but also improve the interpretability of the model's decision-making. The combination of large models and the Chain-of-Thought has the following advantages: improving development efficiency, the large model can directly generate a code framework based on sufficient prompts, which can greatly improve the development efficiency of project code. Enhancing code robustness, the large model can help developers make up for overlooked places and enhance the robustness of project code.
[0051] The code generation module is one of the core components in this low-code software development system, mainly responsible for automatically generating the code structure and content of a project according to the project requirement description provided by the user in the source code mode. Its work mainly includes the following steps:
[0052] Step S101: Input the project requirement description.
[0053] In the source code mode, the user needs to provide a detailed project requirement description, including but not limited to: project function description, the main functions and business logics of the project; interface definition, the interfaces (APIs) that the project needs to provide externally; method definition for interface calls, the specific method implementations inside the interfaces. The response parameter types of the methods, the data structures returned by the methods. External dependencies, the third-party libraries or frameworks required for the project to run. These requirement descriptions are the inputs of the code generation module, and the module will generate corresponding code based on this information.
[0054] Step S102: Generate the outline of the target project files.
[0055] The code generation module will first use a preset large language model (such as GPT, deepseek, etc.) to generate the file outline of the project. The file outline usually includes the basic files and directory structures of the project, for example: src / main / java, the Java source code directory of the project; src / main / resources, the resource file directory of the project (such as configuration files, template files, etc.); pom.xml (for Maven projects), the dependency management and build configuration file of the project.
[0056] Step S103: Generate code and external dependencies according to the outline.
[0057] After generating the file outline, the code generation module will generate specific code content according to the structure of the outline, including: interface code, generating interface classes according to the interface definition. Method code, generating the implementation of the methods according to the method definition. External dependency information, adding the externally specified dependencies (such as dependent libraries or frameworks) to the project's configuration file (such as pom.xml).
[0058] Step S104: Improve based on the code verified by the user.
[0059] There may be some problems or errors in the generated code, for example: error code, the generated code may not conform to the syntax specification or business logic. Error annotation, the generated annotation may not match the actual function of the code. Therefore, the code generation module will provide a mechanism for user verification, allowing the user to modify the error code and correct the errors in the generated code; improve the annotation, supplement or correct the annotation in the code to make it more accurately describe the function and logic of the code.
[0060] Step S105: Combine and generate content.
[0061] After the user completes the verification and modification, the code generation module combines the generated code and external dependency information into the complete project content. The final project content includes: complete source code, including interfaces, method implementations, etc.; configuration files, such as pom.xml, which contain all external dependencies of the project; and comments that accurately describe the functions of the code.
[0062] In some embodiments, the code generation module generates code and the pom.xml file for defining external dependencies in combination with the Ftl template.
[0063] The Jar package management module is used to obtain, in the Jar package mode, the shared Jar packages shared by multiple Java projects, the project Jar packages annotated with the project requirement descriptions for the current Java project, and the extended Jar packages marking external dependencies according to the example project, so as to configure them for the current Java project; in the source code mode, divide the generated content corresponding to the current Java project into the shared Jar packages, the project Jar packages, and the extended Jar packages shared by multiple Java projects for management. In the Jar package mode, the user does not need to define project and other information in the system, but only needs to code by imitating the example project, use the annotations provided by the system, and configure the resource files. The Jar packages will be parsed during deployment to obtain project, interface, and method information and save them to the database. For the generated content generated based on the source code mode, it is also divided and managed according to the shared Jar packages, project Jar packages, and extended Jar packages and deployed.
[0064] In this low-code software development system, the Jar package mode is an efficient and reusable development method that allows users to annotate project requirement descriptions in the form of annotations and encapsulate this information into Jar packages, thereby realizing code modularization and reuse. The main function of the Jar package management module is to generate and manage the shared Jar packages shared by multiple Java projects, the project Jar packages unique to the current Java project, and the extended Jar packages marking external dependencies according to the project requirement description annotations in the Jar package mode.
[0065] The shared Jar package is a reusable module that is shared among multiple Java projects and is mainly used to provide common functions or libraries. The project Jar package is the Jar package annotated with the project requirement descriptions for the current Java project and contains project-specific functions and implementations. The extended Jar package is an optional Jar package used to add dependencies on external libraries or function supports that the project may need.
[0066] The deployment management module is used to load classes in a Java project through a class loader with an independent namespace. In source code mode and Jar package mode, it creates a META-INF / services directory under the resource directory, creates a file named after the full path of the interface, and the content of the file is the fully qualified name of the interface implementation class, and then deploys the generated content to complete the deployment of the Java project; it loads the interface implementation classes in the shared Jar package, project Jar package, and extension Jar package based on the parent delegation mechanism and independent class loader under the resource directory according to the preset path to complete the deployment of the JAVA project. The difference is that in Jar package mode, users need to use annotations to mark information such as interfaces and methods by themselves, while in source code mode, it has been saved in the database in advance. The deployment of both modes is loaded through the parent delegation mechanism and independent class loader. Specifically, the deployment management module is the core module in the low-code software development system for the final deployment of Java projects. It realizes the dynamic loading and deployment of classes in Java projects in source code mode and Jar package mode through the class loader.
[0067] In source code mode and Jar package mode, the specific operations include: using a class loader with an independent namespace to load the classes of the project. Perform resource directory operations to create a directory named META-INF / services under the resource directory of the project. Create an interface full path file. Under this META-INF / services directory, create a file named after the full path of the interface. For example, if the full path of the interface is com.example.MyInterface, the created file name is com.example.MyInterface. Fill in the fully qualified name of the interface implementation class. The content of the file is the fully qualified name of the interface implementation class. For example, if the implementation class of the interface com.example.MyInterface is com.example.impl.MyInterfaceImpl, the file content is com.example.impl.MyInterfaceImpl. Deploy the generated content. After completing the above operations, deploy the synthesized project content to complete the deployment process of the Java project.
[0068] Use a class loader with an independent namespace and perform class loading based on the parent delegation mechanism. According to the preset path, three types of Jar packages are loaded under the resource directory, namely: shared Jar packages, project Jar packages, and extension Jar packages. Shared Jar packages are Jar packages of common functions or libraries shared by multiple Java projects. For example, Jar packages that provide common functions such as logging and utility functions. Project Jar packages are Jar packages specific to the current Java project and generated using project requirement description annotations. For example, Jar packages that contain specific business logic, interface implementations, etc. Extension Jar packages are Jar packages used to add external dependencies and mark the external dependencies required by the project. For example, Jar packages related to extension functions of third-party libraries or frameworks. Load the interface implementation classes. The class loader loads the interface implementation classes in the above-mentioned shared Jar packages, project Jar packages, and extension Jar packages, thus completing the deployment process of the Java project.
[0069] The method call module is used to dynamically load and call the Jar packages in the Java project based on the reflection mechanism of Java. The reflection mechanism of Java allows the program to inspect and operate on the characteristics and behaviors of classes, objects, methods, fields, etc. at runtime. Through reflection, the information of a class can be obtained at runtime, and its methods or constructors can be called. This dynamic nature enables interaction with classes without knowing the specific class name.
[0070] In some embodiments, the system further includes: a Java project integrity verification module, which is used to perform an integrity review on the project function description, interface definition, method definition, response parameter type, and external dependencies of the deployed Java project according to the project requirement description, and generate a review result. When the integrity review fails, a prompt message is generated.
[0071] Specifically, first, parse the project requirement description and extract the key information therein, such as project function description, interface definition, method definition, response parameter type, and external dependencies, etc.; then, scan the deployed Java project through the reflection mechanism or code parsing tool to obtain the actual functions, interfaces, methods, parameter types, and dependency information of the project; then, compare the extracted requirement information with the actual project information one by one to check whether there are any missing or mismatched situations; if integrity problems are found, generate a review result and provide a detailed prompt message indicating the specific problems (such as missing an interface, mismatched method parameter type, missing external dependency, etc.) for developers to repair.
[0072] In some embodiments, the system further includes: a code generation verification module, configured to perform syntax correctness, logical correctness, and performance testing on the code generated by the code generation module, establish a code generation log to record the code generation process and record the test results; and incorporate the generated code into a version control system, recording each generated code version and the corresponding project requirements.
[0073] Specifically, the implementation of the code generation verification module can be carried out through the following steps: 1) Syntax correctness verification: By calling the Java compiler API, taking the generated code file as input to check for syntax errors. For example, the javax.tools.JavaCompiler utility class can be used to compile the code, capture exceptions and error messages during compilation, record and report syntax issues. 2) Logical correctness verification: Design a series of unit test cases and use a unit test framework such as JUnit to verify the logic of the code. Define test scenarios according to the project requirements description, including normal inputs and boundary conditions, execute the tests and record the test results to ensure that the functionality of the code meets expectations. 3) Performance testing: For key methods and components in the code, use a performance analysis tool such as JProfiler or measure the code running time and resource consumption, set performance metrics (such as response time, throughput), run the performance tests, and record the test results to verify whether the code meets the performance requirements. 4) Logging: During the code generation process, use a logging framework such as Log4j or SLF4J to record the intermediate states, method calls, error messages, and test results of code generation. Write the log information to a file or database for subsequent auditing and problem tracking. 5) Version control integration: After the code is generated, through the API of the version control tool (such as the JGit library for Git), add the generated code to the version control system. Each generated code is a new commit, recording the version information and the corresponding project requirements description for version management and traceability.
[0074] In some embodiments, the system further includes: a code security detection module, configured to provide a sandbox environment to isolate and test the security of the code, and establish a code security test log for saving the security test results.
[0075] The implementation of the code security detection module can be carried out through the following steps: 1) Sandbox environment isolation test: Create a controlled sandbox environment and deploy the code to be tested into this environment. The sandbox environment can restrict the execution permissions of the code to prevent malicious code from causing harm to the system. For example, the Java SecurityManager class can be used to restrict the file access, network access, etc. permissions of the code. 2) Static code analysis: Use static code analysis tools (such as SonarQube, FindBugs, Checkmarx, and SpotBugs) to scan the code and detect potential security vulnerabilities and quality issues. These tools can detect common security problems such as SQL injection, cross-site scripting (XSS), command injection, etc. 3) Dynamic code analysis: Run the code in the sandbox environment, monitor its runtime behavior, and detect whether there are abnormal behaviors or security vulnerabilities. For example, the behaviors of file operations, network communications, memory usage, etc. of the code can be monitored to discover potential security problems. 4) Establish test logs: During the testing process, record all test results and relevant log information. The logs should include information such as test time, test results, discovered security problems, and the severity of the problems. Logging frameworks (such as Log4j or SLF4J) can be used to record the logs and save the logs to files or databases for subsequent analysis and tracking. 5) Generate test reports: Generate detailed test reports based on the test results. The reports should include test overviews, discovered security problems, detailed descriptions of the problems, and recommended repair measures. The test reports can be output in HTML, PDF, or other formats for easy viewing and analysis by developers and security teams.
[0076] In some embodiments, the deployment management module loads the shared Jar package based on the parent delegation mechanism and an independent class loader under the resource directory according to a preset path, including steps S201~S202:
[0077] Step S201: Create a shared loader directory, download the shared Jar package to the shared loader directory, and put the storage path of the shared Jar package into the path URL array.
[0078] Step S202: Create a class loader instance ShareClassLoader, use AppClassLoader as the parent loader of ShareClassLoader, and load and initialize the interface implementation classes of the shared Jar package based on the parent delegation mechanism according to the storage paths recorded in the path URL array.
[0079] In some embodiments, the deployment management module loads the project Jar package and the extension Jar package based on the parent delegation mechanism and an independent class loader under the resource directory according to a preset path, including steps S301~S302:
[0080] Step S301: Create a project loader directory and establish subfolders, and download the project Jar package and the extension Jar package to the project loader directory.
[0081] Step S302: Create an instance of the custom class loader MicroUdcClassLoader, and based on the parent delegation mechanism, load the interface implementation classes in the project Jar package and the extension Jar package according to the storage path, and use the class loader instance ShareClassLoader as the parent loader of the custom class loader instance MicroUdcClassLoader.
[0082] In some embodiments, the system further includes: a requirement mapping module for loading a preset large language model to convert the Java project requirements described by the user in natural language into creation requirements in a standard format.
[0083] Specifically, select a trained large language model suitable for the code generation function, such as GPT-3, GPT-4 or other similar models. These models have the ability to understand natural language and generate text in a standard format. Receive the Java project requirements described by the user in natural language, which may include information such as project function descriptions, interface definitions, method definitions, response parameter types, and external dependencies. Utilize the powerful semantic parsing ability of the large language model to accurately understand each part of the user input. For example, for the requirement "I want to develop an e-commerce platform where users can buy goods and view orders", the model needs to parse it into project function descriptions, interface definitions, etc. Based on the parsing results, convert the natural language description into a standard format that meets the system requirements. This may include creating a standardized template for the creation requirements, such as generating a requirement document in JSON format, which contains fields such as project function descriptions, interface definitions, and method definitions. If the requirements input by the user are vague or unclear, the model should be able to give prompts or ask the user for further clarification to ensure that the generated creation requirements are accurate. Verify the generated creation requirements in the standard format to ensure that their format is correct and the logic is clear. For example, check whether the interface definition conforms to the Java syntax specification, whether the method definition is complete and the parameter types are consistent, etc. If any errors or inaccuracies are found, allow the user to view and correct the conversion results to ensure that the final creation requirements fully meet the user's intentions. Establish a detailed log record to record the entire mapping process from the user input to the creation requirements in the standard format, including the user input, the model parsing process, the conversion results, and any user correction operations.
[0084] In some embodiments, the system further includes: an interface generation and visual design module for the user to build the display interface of the project in a drag-and-drop configuration manner and automatically generate the corresponding front-end code.
[0085] In some embodiments, the system further includes: an asynchronous task and distributed task management module, which is used to convert long-running Java project development tasks into asynchronous tasks for asynchronous execution in the background, or divide Java project development tasks into multiple subtasks and distribute them to multiple worker nodes for execution.
[0086] The present invention will be described below in conjunction with a specific embodiment:
[0087] This embodiment provides a method for implementing a user-defined code node (User DesignCode) in a workflow of a low-code platform. The following introduces the content of the invention.
[0088] First, the usage process of UDC is introduced, as Figure 2 shown. Facing complex business requirements, users can develop a project for the business requirements through two modes provided by UDC. After the project function development and testing are completed, it is packaged. Among them, the shared dependencies between projects are used as shared Jar packages, the project itself is used as a project Jar package, and the usage dependencies are used as extended Jar packages, all of which are uploaded to the file system. After the project is deployed through the Jar package, using the UDC node in the low-code platform workflow and configuring the corresponding project and interface method information can complete the business requirements.
[0089] Next, the functional architecture of UDC is described. Figure 1 shows the division of UDC functional modules.
[0090] UDC is mainly composed of five major modules, namely the project management module, the code generation module, the Jar package management module, the deployment management module, and the method call module. Among them, the project management module includes the management of projects, interfaces, methods, and parameters. The Jar package management module manages the management of shared Jar packages, project Jar packages, and project extension Jar packages.
[0091] The project concept proposed in this embodiment is a Java project. A project can correspond to multiple interfaces, and an interface can provide multiple methods. Each method can be configured and used in the workflow UDC node. At the same time, a method can configure request parameters and response parameters.
[0092] At the same time, to improve the scalability of UDC, this embodiment proposes two project modes: the source code mode and the Jar package mode.
[0093] A. Source code mode:
[0094] If the project type is the source code mode, the user needs to define the corresponding project, interface, and method information in the system. The system will generate a complete Java project based on this information. After downloading the project to the local, the project function can be improved in the local development environment.
[0095] As can be seen from the above content, the item codes defined by UDC all require a certain basic code framework, and large language models are very suitable for generating item codes based on the chain of thought on this framework.
[0096] Therefore, based on large language models (such as GPT4), the present invention can automatically generate item codes according to user requirements. After the user inputs a detailed description of the project, they can choose to add a detailed description of the interfaces and methods, or the large model can directly generate them automatically. After generating the basic project code, the user can modify and improve the code again through the large model by modifying the comments, thus improving the development efficiency of the project.
[0097] The present invention designs a chain of thought to generate item codes, as Figure 3 shown, including the following steps:
[0098] 1. The large model generates a project file outline based on the detailed project description.
[0099] 2. The large model generates a detailed function description of the method and detailed information of the request parameters and response parameters based on the detailed project description and the request parameters, response parameters, and method names generated in step 1.
[0100] 3. The large model generates the specific code of the method and the dependency information used based on the detailed method information generated in step 2.
[0101] 4. The user modifies the comments in the code, and the large model modifies the code according to the modification of the comments.
[0102] When the project type is the source code mode, UDC will construct a complete Java project according to the project, interface, method, and parameter information input by the user. The specific process is as Figure 4 shown.
[0103] First, it is necessary to obtain project-related information and check the integrity of the information. If there is no interface under the project or no method under the interface, etc., the generated project will be meaningless. Then, create a project code directory under the user directory according to the project name, and create the code directory and resource directory in the Java project in turn. Finally, according to the parameter, interface, etc. information, use the ftl template to create each specific code file and the pom.xml file.
[0104] At the same time, it is necessary to create a META-INF / services directory under the resource directory, and create a file named after the full path of the interface in it. The content of the file is the fully qualified name of the interface implementation class. This configuration file must be included in the project to be correctly loaded in the subsequent deployment process.
[0105] B. Jar package mode:
[0106] If the project type is the Jar package mode, there is no need to define project information in the system. Just imitate the coding of the example project, use the annotations provided by the system and configure the resource file. The Jar package will be parsed during deployment to obtain project, interface, and method information and saved to the database.
[0107] In the Jar package mode, it is necessary to configure project-related information in the global-config.json file under the resource directory. After uploading, the system automatically reads and stores the project information. The present invention proposes the following annotations to obtain interface, method, etc. information:
[0108] 1. @UdcField(name, type) is used to identify the parameter name and parameter type.
[0109] 2. @UdcInterface(value, name) is used to identify the interface name and description.
[0110] 3. @UdcMethod(value, name) is used to identify the method name and description.
[0111] Meanwhile, the present invention provides the @Dinjection annotation for both modes for dependency injection. If the interface implementation class declares a class in the system Jar package, this annotation can identify the member variable and implement its loading during the deployment phase.
[0112] According to the deployment mechanism of UDC, the deployment of the project takes the steps of first loading the shared Jar package and then loading the project Jar package and the extension package. Specifically, it is as follows:
[0113] First, the deployment environment needs to be initialized. For the source code mode and the Jar package mode, the specific deployment processes are similar. However, the Jar package mode obtains parameter, interface, and method information from the above-mentioned @UdcField, @UdcInterface, and @UdcMethod annotations, and obtains project information from the global-config.json file in the resource directory. While the source code mode directly obtains all project interface, method, etc. information using the project management module. These information will be stored in a suitable data structure for subsequent use.
[0114] After initializing the deployment environment, according to Figure 5The process shown loads the shared Jar packages. First, it is necessary to create the / udc / shared-loader folder under the user directory, download all the shared Jar packages to this path, and put the list of storage paths of all the shared Jar packages into an array of URL type. Create a new URLClassLoader instance, ShareClassLoader, with the AppClassLoader as the parent class loader of ShareClassLoader, and initialize it with the array of URL paths of the shared Jar packages. Thus, the loading of the shared Jar packages is completed.
[0115] After the shared Jar packages are loaded, deploy the project Jar packages and extension Jar packages. The specific process is as Figure 6 shown:
[0116] Under the user directory, first create a folder named / udc / udc-loader, and then further create sub-folders according to the project name and version information and download the project Jar packages and extension Jar packages. Create an instance of the MicroUdcClassLoader custom class loader for each project. This loader takes the paths of the project Jar packages and extension Jar packages as its loading paths and uses the previously created ShareClassLoader as its parent class loader.
[0117] Subsequently, traverse the list of fully qualified names of all interfaces under the project and load each interface. Use the loadClass method of the class loader for loading. Once the interface class is successfully loaded, use the load method provided by java.util.ServiceLoader to load the implementation classes of the interface.
[0118] After the interface implementation classes are successfully loaded, obtain the member variables of the interface implementation classes. If the member variables are marked with the @DInjection annotation, obtain the corresponding dependencies from the Spring application context and inject the Bean instances into the fields of the interface implementation classes. Finally, obtain and save the method request parameters and return parameter information in the interface implementation classes. Thus, the loading process of the project Jar packages and extension Jar packages is completed.
[0119] C. Deployment mechanism:
[0120] In Java, class version control and isolation are mainly achieved through the ClassLoader. Each class loader has its own namespace, which means that classes loaded by different class loaders, even if they are exactly the same, will be regarded as different classes. This mechanism is based on the Java Parent Delegation Model. The following are two key points for Java to achieve class version control and isolation:
[0121] 1. Parent Delegation Mechanism
[0122] In the parent delegation mechanism, when a class loader receives a class loading request, it does not immediately attempt to load the class itself. Instead, it first delegates the task to its parent class loader for an attempt. This is the case for each level of class loader. Therefore, all class loading requests are passed to the top-level Bootstrap ClassLoader. Only when the parent loader reports that it cannot complete the loading will the child loader attempt to load the class itself. This ensures that classes in the Java core library are not reloaded and also provides a mechanism for child class loaders to override classes in the parent class loader.
[0123] 2. Independent Class Loaders
[0124] By providing independent class loaders for different versions or different plugins, it can be ensured that these classes are isolated in the JVM. Each class loader has its own class path, so the classes it loads will not conflict with those loaded by other class loaders.
[0125] Therefore, the present invention designs the following solutions for implementing class version control and isolation between different projects:
[0126] First, to ensure that classes in the shared package are not repeatedly loaded by class loaders, the parent delegation mechanism is adopted. The AppClassLoader is used as the parent loader of the shared package class loader ShareClassLoader. The ShareClassLoader loads all the shared Jar packages of the projects, and the project class loader MicroUdcClassLoader takes the ShareClassLoader as its parent loader.
[0127] At the same time, to ensure that there are no conflicts in class loading for different projects and different versions, each project will have its own independent loader for isolation. Each MicroUdcClassLoader is responsible for loading its own project Jar packages and project extension Jar packages.
[0128] D. Implementation Method of UDC Method Calls:
[0129] After the project is successfully deployed, users can test all the methods of the project. In the workflow, different interfaces and methods in different projects can also be selected for invocation. And this way of dynamically loading Jar packages for invocation is mainly based on the Java reflection mechanism. The reflection-related APIs provide a series of classes and interfaces to operate on Class objects, mainly as follows:
[0130] 1. java.lang.Class: Represents an object of a class and provides methods to obtain fields, methods, constructors, etc. of the class.
[0131] 2. java.lang.reflect.Field: Represents a class's attribute and provides the ability to access and modify fields.
[0132] 3. java.lang.reflect.Method: Represents a class's method and provides the ability to call methods.
[0133] 4. java.lang.reflect.Constructor: Represents a class's constructor and provides the ability to create objects.
[0134] Based on the above reflection mechanism, the invocation of methods in the UDC can be completed. Obtain the java.lang.reflect.Method class obtained during deployment according to the project, interface, and method information provided by the workflow node.
[0135] Then, according to the parameter information during the call, use java.lang.reflect.Constructor and java.lang.reflect.Field to construct the request parameters. For different request parameters such as JSON types, different library functions need to be called for construction. After construction, add this class to the method parameter list.
[0136] Finally, by calling the invoke method provided by java.lang.reflect.Method, the execution result of the method can be obtained.
[0137] Corresponding to the above method, the present invention also provides a device / system. The device / system includes a computer device, the computer device includes a processor and a memory, computer instructions are stored in the memory, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device / system implements the steps of the method described above.
[0138] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the foregoing edge computing server deployment method. The computer-readable storage medium may be a tangible storage medium, such as a random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, floppy disk, hard disk, removable storage disk, CD-ROM, or any other form of storage medium well-known in the technical field.
[0139] In summary, in the low-code software development system of the present invention, the project management module is responsible for obtaining the user's creation requirements for Java projects, including the source code mode and the Jar package mode. The code generation module uses a large language model to generate code and external dependency information according to the requirements in the source code mode. The Jar package management module manages and invokes shared Jar packages, project Jar packages, and extension Jar packages according to the requirements in the Jar package mode. The deployment management module completes the deployment of the project through an independent class loader based on the parent delegation mechanism, and the method call module dynamically calls the loaded Jar packages based on the Java reflection mechanism. Through the automated code generation and flexible deployment mechanism, this system significantly improves the development efficiency, reduces the development cost, and at the same time ensures the scalability and stability of the system, and is suitable for quickly building and deploying Java projects.
[0140] Those of ordinary skill in the art should understand that the various exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Specifically, whether to execute in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, and so on. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium or transmitted through a data signal carried in a carrier wave on a transmission medium or a communication link.
[0141] It should be clear that the present invention is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, the detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present invention is not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions, or change the order between steps after understanding the spirit of the present invention.
[0142] In the present invention, the features described and / or illustrated for one embodiment can be used in the same way or in a similar way in one or more other embodiments, and / or combined with the features of other embodiments or replace the features of other embodiments.
[0143] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A low-code software development system, characterized in that, The system includes: A project management module, which is used to obtain the user's creation requirements for a Java project. The creation requirements include the creation form and the project requirement description. The creation form includes the source code mode and the Jar package mode. In the source code mode, the project requirement description includes the project function description, interface definition, method definition for interface call, response parameter type of the method, and required external dependencies. In the Jar package mode, the project requirement description annotates the interface names and descriptions, method names and descriptions for interface call, parameter names, parameter types, and the external dependencies required by the Java project in the form of annotations; A code generation module, which is used to, in the source code mode, use a preset large language model with the project requirement description as input to generate a target project file outline according to the sample project file outline, and generate code and external dependency information for the required interfaces and methods according to the structure of the target project file outline; improve the code based on the user's verification of the modification of error codes and comments, and combine the generated content; A Jar package management module, which is used to, in the Jar package mode, obtain the shared Jar packages shared by multiple Java projects, the project Jar packages annotated with the project requirement description for the current Java project, and the extended Jar packages marking external dependencies according to the sample project, and configure them for the current Java project; in the source code mode, divide the generated content corresponding to the current Java project into the shared Jar packages, the project Jar packages, and the extended Jar packages shared by multiple Java projects for management; A deployment management module, which is used to load the classes in the Java project through a class loader with an independent namespace. In both the source code mode and the Jar package mode, create a META-INF / services directory under the resource directory, create a file named after the full path of the interface, and the content of the file is the fully qualified name of the interface implementation class, and deploy the generated content to complete the deployment of the Java project; load the interface implementation classes in the shared Jar packages, the project Jar packages, and the extended Jar packages based on the parent delegation mechanism and the independent class loader under the resource directory according to the preset path to complete the deployment of the Java project; A method call module, which is used to dynamically load the Jar packages in the Java project for call based on the reflection mechanism of Java; The system further includes: a Java project integrity verification module, which is used to perform an integrity review on the project function description, the interface definition, the method definition, the response parameter type, and the external dependencies of the deployed Java project according to the project requirement description, and generate a review result. When the integrity review fails, a prompt message is generated; The system further includes: a code generation verification module, which is used to perform syntax correctness, logical correctness, and performance tests on the code generated by the code generation module, establish a code generation log to record the code generation process and record the test results; and incorporate the generated code into a version control system to record the code version generated each time and the corresponding project requirements.
2. The low-code software development system according to claim 1, wherein The system further includes: a code security detection module, which is used to provide a sandbox environment to isolate and test the security of the code, and establish a code security test log for saving the security test results.
3. The low-code software development system according to claim 1, wherein The code generation module generates the code in combination with an Ftl template and a pom.xml file for defining the external dependencies.
4. The low-code software development system according to claim 1, characterized in that The deployment management module loads the shared Jar package based on the parent delegation mechanism and an independent class loader in the resource directory according to a preset path, including: Creating a shared loader directory, downloading the shared Jar package to the shared loader directory, and putting the storage path of the shared Jar package into an array of path URLs; Creating a class loader instance ShareClassLoader, using AppClassLoader as the parent loader of ShareClassLoader, and loading and initializing the interface implementation classes of the shared Jar package based on the parent delegation mechanism according to the storage path recorded in the array of path URLs.
5. The low-code software development system according to claim 4, characterized in that, The deployment management module loads the project Jar package and the extension Jar package based on the parent delegation mechanism and an independent class loader in the resource directory according to a preset path, including: Creating a project loader directory and establishing sub-folders, and downloading the project Jar package and the extension Jar package to the project loader directory; Creating a custom class loader instance MicroUdcClassLoader, loading the interface implementation classes in the project Jar package and the extension Jar package based on the parent delegation mechanism according to the storage path, and using the class loader instance ShareClassLoader as the parent loader of the custom class loader instance MicroUdcClassLoader.
6. The low-code software development system according to claim 1, wherein The system further includes: A requirement mapping module, which is used to load a preset large language model to convert the Java project requirements described by the user in natural language into the creation requirements in a standard format.
7. The low-code software development system according to claim 1, wherein The system further includes: a model management optimization module, which is used to perform regular evaluation tests and update iterations on the large language model.
8. The low-code software development system according to claim 1, wherein, The system further includes: An asynchronous task and distributed task management module, which is used to convert long-running Java project development tasks into asynchronous tasks for asynchronous execution in the background, or divide the Java project development tasks into multiple subtasks and distribute them to multiple worker nodes for execution.
Citation Information
Patent Citations
Code generation method and device
CN113791763A
Project code generation method and device for low-code platform, equipment and medium
CN116974579A