Code generation method and device based on model low-code application and medium
Through the low-code platform, the application model is built and version verification is performed, the front-end and back-end code is generated, and the automation process of the GitLab warehouse solves the problems of technical locking of the low-code platform and the low-coding efficiency, achieving efficient and flexible code generation and rapid iteration.
Patent Information
- Application Number
- CN202510350905.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-07-08
AI Technical Summary
Applications generated by existing low-code platforms are highly dependent on specific platforms, resulting in technology lockdown, and traditional coding methods are difficult to meet the needs of rapid iteration and personalization, and the existing technology fails to effectively balance development efficiency and system flexibility.
Build an application model through a low-code platform, perform version verification and analysis, generate front-end and back-end code, and use GitLab warehouse to configure automated processes to achieve automated code generation operations.
It improves development efficiency and code stability, enhances application flexibility and adaptability, meets the needs of rapid iteration and personalization, reduces manual intervention, and improves the accuracy and efficiency of code generation.
Smart Images

Figure CN120276723A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of software development, and in particular, to a code generation method, device, and medium based on model low-code applications. Background Art
[0002] Currently, with the accelerating advancement of digital transformation, enterprises are facing an urgent need for agility and rapid response capabilities in business system development. Low-code development platforms, with their visual and component-based development models, have significantly reduced the threshold for application construction, enabling non-professional developers to quickly build business application prototypes through drag-and-drop operations to verify the feasibility of market demands, and have become an important technical direction in the field of software development in recent years.
[0003] However, existing low-code technologies still have significant shortcomings in practical applications. On the one hand, the application programs generated by mainstream low-code platforms often highly depend on the native operating environment, resulting in the finished applications being strictly restricted to run within a specific platform ecosystem, forming a technology lock-in effect. On the other hand, when the business complexity increases or personalized requirements emerge, it is still necessary to revert to the traditional manual coding method, and the coding cycle of the traditional development process is long and the iteration cost is high, making it difficult to cope with rapidly changing business needs.
[0004] Although low-code platforms ensure development efficiency, they sacrifice the scalability and adaptability of the system due to platform limitations; while traditional coding can achieve flexible customization, it is difficult to achieve the rapid trial-and-error and continuous iteration efficiency required by the modern business environment. Existing code generation technologies have not been able to effectively balance the rapid development ability driven by models and the open flexibility of the system architecture, resulting in enterprises often being caught in a dilemma between development efficiency and technological autonomy when upgrading business systems. Summary of the Invention
[0005] Embodiments of this application provide a code generation method, device, and medium based on model low-code applications to solve the above technical problems.
[0006] On the one hand, embodiments of this application provide a code generation method based on model low-code applications, including:
[0007] Based on a low-code platform and through menus, web pages, and forms, construct a corresponding application model, and upload the compressed application model to a remote object storage service; the menu represents a grouping of web pages, forms, processes, and data visualization components;
[0008] Perform version verification on the target model determined in the application model, and parse the target model after passing the verification to generate the front-end and back-end code corresponding to the target model; the version verification includes: EDR model integrity verification, form component mapping verification, and conflict verification;
[0009] Push the front-end and back-end codes to the GitLab repository, and configure the automated process corresponding to the back-end code based on the pipeline in the GitLab repository to achieve automated code generation operations.
[0010] In an implementation manner of this application, based on a low-code platform and through menus, web pages, and forms, construct corresponding application models, specifically including:
[0011] Based on the low-code platform, define the menu sorting and menu styles of the menu model in the form of key-value pairs, and store the key-value pairs as a JSON file to construct the application model corresponding to the menu;
[0012] Write the static resources and custom components of the web page model in the web page designer as static resources into the web page model to construct the application model corresponding to the web page;
[0013] Define the front-end component types and attributes of the form to obtain the front-end model, and generate an ERD model according to the form component mapping to obtain the back-end model, so as to construct the application model corresponding to the form based on front-back end separation modeling.
[0014] In an implementation manner of this application, after defining the front-end component types and attributes of the form to obtain the front-end model, and generating an ERD model according to the form component mapping to obtain the back-end model, and constructing the application model corresponding to the form based on front-back end separation modeling, the method further includes:
[0015] Determine the association relationship between the main form and each sub-form through the single foreign key recorded in the sub-form, and generate cascading query logic at the back end;
[0016] Determine the association relationship between the associated forms, and generate an intermediate table entity and an associated service method to achieve many-to-many queries;
[0017] Reference other form components through the associated form, and record the association relationship between the foreign keys in the form model.
[0018] In an implementation manner of this application, perform version verification on the target model determined in the application model, specifically including:
[0019] Through the remote object storage service client, download the model version to be generated, and decompress the model version through a decompression tool;
[0020] Perform ERD model integrity verification on the decompressed model version to verify whether the entity attributes and form relationships are legal; the entity attributes include field types and primary-foreign key constraints, and the form relationships include one-to-many, many-to-one, and many-to-many;
[0021] Perform form component mapping verification on the model version after passing the integrity verification to determine that the form front-end components match the back-end entity field types;
[0022] Perform conflict detection on the model version that has passed the integrity and form component mapping verifications, and generate corresponding error reports; the conflict detection includes foreign key circular dependency detection and field naming conflict detection.
[0023] In an implementation manner of this application, parse the target model after passing the verification to generate front-end and back-end codes, specifically including:
[0024] For the back-end, generate back-end entity classes according to the ERD model, add field annotations when generating the back-end entity classes, and generate data access layer interfaces and XML files for CRUD operations and associated queries;
[0025] Generate service layer logic classes to generate CRUD methods with transaction management annotations based on the service layer logic classes, and generate REST API controllers based on Spring MVC to provide interfaces for adding, deleting, modifying, and querying form data;
[0026] Create intermediate table entities and associated query logic to generate service layer methods for many-to-many relationships, and generate foreign key constraint statements in the Flyway database migration script.
[0027] In an implementation manner of this application, parse the target model after passing the verification to generate front-end and back-end codes, specifically including:
[0028] For the front-end, generate front-end route configurations according to the menu JSON, and convert the form DSL into front-end dynamic rendering components for form verification or data binding;
[0029] Embed the static resource files generated by the web designer into the front-end project directory to integrate the front-end project directory.
[0030] In an implementation manner of this application, upload the compressed application model to a remote object storage service, specifically including:
[0031] Compress the application model by specifying a compression tool, and upload the compressed application model to the remote object storage service through the remote object storage service client; the application model at least includes the ERD model and the menu model;
[0032] Record the version information corresponding to each application model and persist the version information; the version information includes: creator, creation time, description, and storage address;
[0033] Through the permission service of the low-code platform, corresponding operation permissions are configured for each application model version to achieve collaborative permission control; the operation permissions include: viewing, downloading, and deleting.
[0034] In one implementation manner of the present application, the front-end and back-end codes are pushed to the GitLab repository, and an automated process corresponding to the back-end code is configured based on the pipeline in the GitLab repository to realize automated operations for code generation, specifically including:
[0035] Call the GitLab API to dynamically create a new repository and generate a corresponding unique repository identifier according to the application name;
[0036] Push the front-end and back-end codes to the local Git repository through the JGit library, and push the local Git repository to the remote GitLab repository based on token authentication;
[0037] Configure a multi-stage automated process based on the GitLab CI / CD pipeline; the multi-stage automated process includes: code compilation, testing, Docker image building and pushing, and Kubernetes deployment.
[0038] On the other hand, an embodiment of the present application also provides a code generation device for a model-based low-code application, and the device includes:
[0039] At least one processor;
[0040] And a memory communicatively connected to the at least one processor;
[0041] Wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a code generation method for a model-based low-code application as described above.
[0042] On the other hand, an embodiment of the present application also provides a non-volatile computer storage medium storing computer-executable instructions, and when the computer-executable instructions are executed, a code generation method for a model-based low-code application as described above is implemented.
[0043] The embodiments of the present application provide a code generation method, device, and medium for a model-based low-code application, which at least include the following beneficial effects:
[0044] Through a low-code platform, application models are constructed using menus, web pages, forms, etc., greatly simplifying the application development process. Developers do not need to write a large amount of code from scratch, but can quickly build applications through a graphical interface and drag-and-drop operations, significantly improving development efficiency. As a grouping of web pages, forms, processes, and data visualization components, the menu makes the application structure clearer, facilitating management and maintenance. At the same time, this grouping method also enhances the flexibility of the application, enabling developers to quickly adjust and optimize according to business requirements. Model version verification effectively ensures the quality and consistency of the generated code. Through the verification mechanism, errors and conflicts in the model can be detected and corrected in a timely manner, preventing these errors from being introduced during the code generation stage, thereby improving the stability and reliability of the code. Pushing the front-end and back-end code to the GitLab repository and configuring the corresponding automated process for the back-end code realizes the automated operation of code generation. The automated process includes various links such as code compilation, testing, and deployment, greatly reducing manual intervention, improving the efficiency and accuracy of code generation. At the same time, the automated process can also be customized and optimized according to business requirements to meet different development scenarios and needs. Description of the Drawings
[0045] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:
[0046] Figure 1 It is a flowchart showing a code generation method for a model-based low-code application provided by an embodiment of the present application;
[0047] Figure 2 It is an internal structure diagram of a code generation device for a model-based low-code application provided by an embodiment of the present application. Detailed Embodiments
[0048] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0049] The following will detail the technical solutions provided by each embodiment of the present application in conjunction with the drawings.
[0050] Figure 1 It is a flowchart showing a code generation method for a model-based low-code application provided by an embodiment of the present application.
[0051] The implementation of the analysis method involved in the embodiments of this application can be a terminal device or a server, and this application does not impose special restrictions on this. For the convenience of understanding and description, the following embodiments will be described in detail taking the server as an example.
[0052] It should be noted that the server can be a single device or a system composed of multiple devices, that is, a distributed server, and this application does not make specific limitations on this.
[0053] As Figure 1 shown, a code generation method based on model low-code applications provided by the embodiments of this application includes:
[0054] 101. Based on a low-code platform and through menus, web pages, and forms, construct corresponding application models, and upload the compressed application models to a remote object storage service.
[0055] It should be noted that the menu in the embodiments of this application represents a grouping of web pages, forms, processes, and data visualization components.
[0056] Specifically, in an embodiment of this application, the low-code platform application consists of menus, web pages, forms, processes, data visualization, etc. The form is a mapping of real-world business on the low-code platform and is the main carrier of user data.
[0057] The menu is a grouping of web pages, forms, processes, and data visualization, mainly including menu sorting and styles, and is written into a JSON file in the form of key-value pairs. The web page comes from a web page designer and contains static resource custom components, DSL modules, and is written directly into the model as static resources.
[0058] The form is processed separately for the front end and the back end. The front end records information such as component types and basic attributes. The back end will store the components that can store users, and create entities of an ERD model through the combination of target user data types and names.
[0059] In one embodiment, compared with an ordinary form, a sub-form has an additional foreign key pointing to the main form. Through the single foreign key recorded in the sub-form, the 1:M association relationship between the main form and the sub-form can be determined. The associated form is a special type of form. It has its own components and can also reference the components of other forms. When abstracted, the associated form will have multiple foreign key records to record the association relationship with other forms, which is a 1:N association relationship. At the same time, it allows the associated forms to be associated with each other to form an N:M relationship.
[0060] In one embodiment, for different business development cycles, there are different application contents. This application provides a model version management method, including model version storage, version management, and collaboration permission control.
[0061] For template storage, the application model includes multiple files such as ERD models, menu models, and static resources. In this application, the above files are compressed through the file compression tool Apache common-compress, and then uploaded to the remote object storage service Minio through the Minio client of the remote object storage service.
[0062] After the upload is successful, record the version information corresponding to the uploaded application model, such as: creator, creation time, description, storage address, etc., and persist the records of these version information. In addition, the version creator can also grant "view", "download", and "delete" operation permissions to other users of the platform through the low-code platform permission service.
[0063] 102. Perform version verification on the target model determined in the application model, and parse the target model after the verification passes to generate the front-end and back-end code corresponding to the target model.
[0064] It should be noted that the version verification in the embodiments of this application includes: EDR model integrity verification, form component mapping verification, and conflict verification.
[0065] Specifically, in an embodiment of this application, the code generation engine is the core of this application, and its main function is to generate the front-end and back-end code projects corresponding to the target application according to the model.
[0066] This application needs to parse the model, download the model version to be generated through the Minio client, decompress the version through the decompression tool Apache common-compress, and then perform data format verification and content integrity verification on the decompressed model version.
[0067] First, when performing EDR model integrity verification, it is to verify whether the entity attributes and form relationships are legal. It should be noted that the entity attribute field types, primary and foreign key constraints, and form relationships in the embodiments of this application include one-to-many, many-to-one, and many-to-many. Verifying whether the entity attributes are legal is to check whether the field types conform to the convention, whether the primary and foreign key constraints are reasonable, and whether the logic is correct. Verifying whether the form relationship is legal is to check whether the corresponding relationship logic between the main form and the sub-form, the sub-form and the main form, and the associated forms is correct.
[0068] When performing form component mapping verification, it is to ensure that the form front-end components match the back-end entity field types. Form front-end components, such as input boxes and drop-down lists, and back-end entity field types, such as String, Integer, Date. Conflict detection is to check for problems such as foreign key circular dependencies and field naming conflicts (such as reserved words and special symbols), and then generate an error report for the user to refer to when making corrections.
[0069] In one embodiment, the present application generates front-end and back-end code projects according to a target model. It should be noted that the server-side technology stack in the embodiments of the present application is Spring Boot and Mybatis plus.
[0070] For the back-end project, first, the present application generates Java back-end entity classes according to the ERD model, and adds field annotations such as @Table and @Column to the back-end entity classes. The present application also generates the data access layer MyBatis Mapper interfaces and XML files to support CRUD operations and association queries, such as the cascading query of the main form and the sub-form.
[0071] After that, the present application generates service layer logic classes, and generates CRUD methods with transaction management annotations according to the service layer logic classes. At the same time, the present application also generates REST API controllers based on Spring MVC to provide interfaces for adding, deleting, modifying, and querying form data.
[0072] The database script includes the association relationships between forms. Among them, according to the 1:M relationship between the main form and the sub-form, Java objects associated with the parent and child entities can be generated, and in the MyBatis XML through <collection>The label realizes cascading query. Based on the N:M relationship between associated forms, intermediate table entities and associated query logic are automatically created, and service layer Service methods for many-to-many relationships are generated. Foreign key constraints generate foreign key constraint statements in the Flyway database migration script.
[0073] In one embodiment, for the front-end project, the back-end code generation logic is the same. The system-prepared FreeMarker template is adopted, and the front-end code project is filled according to the content of the published application template.
[0074] First, generate the front-end route configuration according to the menu JSON, such as Vue Router or React Router. Then, convert the form DSL into front-end components, such as Vue / React components, to support form validation and data binding.
[0075] Moreover, this application also embeds the HTML / CSS / JavaScript files generated by the web designer into the front-end project directory to integrate the front-end project directory.
[0076] 103. Push the front-end and back-end codes to the GitLab repository, and based on the pipeline in the GitLab repository, configure the automated process corresponding to the back-end code to achieve automated code generation operations.
[0077] Specifically, in one embodiment of this application, the generated complete project code is pushed to the GitLab repository through an automated process to achieve code version control and team collaboration. First, a new repository is dynamically created by calling the GitLab API, and a unique repository identifier is generated according to the application name. Secondly, through the JGit library, that is, the gitlab java client library, the generated code project is committed to the local Git repository, and the initial commit message is "Feat: Project initialization". Finally, the local repository is pushed to the remote GitLab repository by using SSH key or OAuth2 token authentication.
[0078] This application realizes the full automation process of code compilation, testing, containerization construction and Kubernetes deployment through the GitLab CI / CD pipeline. Among them, the most important thing is to configure.gitlab-ci.yml. The configuration is divided into 4 stages, which respectively represent compilation, testing, Docker image building and pushing, and Kubernetes deployment.
[0079] It should be noted that in the embodiments of the present application, the respective compilations are based on the Maven command clean package and the npm commands npminstall && npm run build to compile the backend and frontend projects respectively. The tests are carried out through the maven command mvn test and npm run test. The Docker image building and pushing are based on the docker build and docker push commands, and the Kubernetes deployment is based on the kubectl commands kubectl apply and kubectl rollout.
[0080] The above is the method embodiment proposed by the present application. Based on the same inventive concept, the embodiments of the present application also provide a code generation device for a model-based low-code application, and its structure is as Figure 2 shown.
[0081] Figure 2 It is a schematic internal structure diagram of a code generation device for a model-based low-code application provided by the embodiments of the present application. As Figure 2 shown, the device includes:
[0082] At least one processor;
[0083] And a memory communicatively connected to at least one processor;
[0084] Wherein, the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor to enable at least one processor to:
[0085] Based on a low-code platform and through menus, web pages, and forms, construct corresponding application models, and upload the compressed application models to a remote object storage service; a menu represents a grouping of web pages, forms, processes, and data visualization components;
[0086] Perform version verification on the target model determined in the application model, and parse the target model after passing the verification to generate front-end and back-end codes corresponding to the target model; the version verification includes: EDR model integrity verification, form component mapping verification, and conflict verification;
[0087] Push the front-end and back-end codes to a GitLab repository, and based on the pipeline in the GitLab repository, configure the automation process corresponding to the back-end code to achieve automated code generation operations.
[0088] The embodiments of the present application also provide a non-volatile computer storage medium storing computer-executable instructions that, when executed, are capable of:
[0089] Based on a low-code platform, construct the corresponding application model through menus, web pages, and forms, and upload the compressed application model to a remote object storage service; a menu represents a grouping of web pages, forms, processes, and data visualization components;
[0090] Perform version verification on the target model determined in the application model, and parse the target model after passing the verification to generate front-end and back-end code corresponding to the target model; version verification includes: EDR model integrity verification, form component mapping verification, and conflict verification;
[0091] Push the front-end and back-end code to a GitLab repository, and based on the pipeline in the GitLab repository, configure the automated process for the back-end code to achieve automated code generation operations.
[0092] Each embodiment in this application is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. The key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments.
[0093] The devices and media provided in the embodiments of this application correspond one by one to the methods. Therefore, the devices and media also have beneficial technical effects similar to those of their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be elaborated here.
[0094] Those skilled in the art should understand that the embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0095] This application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of this application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate for implementing in the process Figure 1 one process or multiple processes and / or blocks Figure 1 a device for the functions specified in one or more boxes
[0096] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device that implements the functions specified in one Figure 1 one or more processes and / or boxes Figure 1 a box or multiple boxes
[0097] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one Figure 1 one or more processes and / or boxes Figure 1 a box or multiple boxes
[0098] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0099] Memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM) and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
[0100] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology for information storage. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.
[0101] It should also be noted that the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent in such process, method, commodity or device. Without further limitation, an element defined by the statement "including one..." does not exclude the presence of additional identical elements in the process, method, commodity or device including the element.
[0102] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.< / collection>
Claims
1. A code generation method for model-based low-code applications, characterized in that, The method includes: Based on a low-code platform and through menus, web pages, and forms, construct corresponding application models, and upload the compressed application models to a remote object storage service; the menu represents a grouping of web pages, forms, processes, and data visualization components; Perform version verification on the target model determined in the application model, and parse the target model after passing the verification to generate front-end and back-end code corresponding to the target model; the version verification includes: EDR model integrity verification, form component mapping verification, and conflict verification; Push the front-end and back-end code to a GitLab repository, and configure an automated process corresponding to the back-end code based on the pipeline in the GitLab repository to achieve automated code generation operations.
2. The code generation method based on model low-code application according to claim 1, characterized in that, Based on a low-code platform and through menus, web pages, and forms, construct corresponding application models, specifically including: Based on the low-code platform, define the menu sorting and menu styles of the menu model in the form of key-value pairs, and store the key-value pairs as a JSON file to construct the application model corresponding to the menu; Write the static resources and custom components of the web page model in the web page designer as static resources into the web page model to construct the application model corresponding to the web page; Define the front-end component types and attributes of the form to obtain a front-end model, and generate an ERD model according to the form component mapping to obtain a back-end model, so as to construct the application model corresponding to the form based on front-end and back-end separation modeling.
3. A code generation method for a model-based low-code application according to claim 2, characterized in that After defining the front-end component types and attributes of the form to obtain a front-end model, and generating an ERD model according to the form component mapping to obtain a back-end model, so as to construct the application model corresponding to the form based on front-end and back-end separation modeling, the method further includes: Determine the association relationship between the main form and each sub-form through the single foreign key recorded in the sub-form, and generate cascade query logic at the back end; Determine the association relationship between associated forms, and generate an intermediate table entity and an associated service method to achieve many-to-many queries; Reference other form components through the associated form, and record the association relationship between foreign keys in the form model.
4. A code generation method based on model low-code applications according to claim 1, characterized in that Perform version verification on the target model determined in the application model, specifically including: Through the remote object storage service client, download the model version to be generated, and decompress the model version through a decompression tool; Perform EDR model integrity verification on the decompressed model version to verify whether the entity attributes and form relationships are legal; the entity attributes include field types and primary and foreign key constraints, and the form relationships include one-to-many, many-to-one, and many-to-many; Perform form component mapping verification on the model version that has passed the integrity verification to determine that the form front-end components match the back-end entity field types; Perform conflict detection on the model version that has passed the integrity and form component mapping verification, and generate a corresponding error report; the conflict detection includes foreign key circular dependency detection and field naming conflict detection.
5. A code generation method for a model-based low-code application according to claim 1, characterized in that Parse the target model after passing the verification to generate front-end and back-end code, specifically including: For the backend, generate backend entity classes according to the ERD model, add field annotations when generating the backend entity classes, and generate data access layer interfaces and XML files for CRUD operations and associated queries; Generate service layer logic classes to generate CRUD methods with transaction management annotations based on the service layer logic classes, and generate REST API controllers based on Spring MVC to provide interfaces for adding, deleting, modifying, and querying form data; Create intermediate table entities and associated query logic to generate service layer methods for many-to-many relationships, and generate foreign key constraint statements in the Flyway database migration script.
6. A code generation method for a model-based low-code application according to claim 1, characterized in that Parse the target model after passing the verification and generate front-end and back-end code, specifically including: For the front end, generate front-end route configurations according to the menu JSON, and convert the form DSL into dynamic rendering components for the front end for form verification or data binding; Embed the static resource files generated by the web designer into the front-end project directory to integrate the front-end project directory.
7. A code generation method for a model-based low-code application according to claim 1, characterized in that Compress the application model and upload it to the remote object storage service, specifically including: Compress the application model by specifying a compression tool, and upload the compressed application model to the remote object storage service through the remote object storage service client; the application model at least includes the ERD model and the menu model; Record the version information corresponding to each application model and persist the version information; the version information includes: creator, creation time, description, and storage address; Configure corresponding operation permissions for each application model version through the permission service of the low-code platform to achieve collaborative permission control; the operation permissions include: view, download, and delete.
8. A code generation method for a model-based low-code application according to claim 1, characterized in that Push the front-end and back-end code to the GitLab repository, and configure the automated process corresponding to the back-end code based on the pipeline in the GitLab repository to achieve automated code generation operations, specifically including: Call the GitLab API to dynamically create a new repository and generate a unique repository identifier according to the application name; Push the front-end and back-end code to the local Git repository through the JGit library, and push the local Git repository to the remote GitLab repository based on token authentication; Configure a multi-stage automated process based on the GitLab CI / CD pipeline; the multi-stage automated process includes: code compilation, testing, Docker image building and pushing, and Kubernetes deployment.
9. A code generation device for model-based low-code applications, characterized in that, The device includes: At least one processor; And a memory communicatively connected to the at least one processor; Wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute a code generation method for a model-based low-code application according to any one of claims 1-8.
10. A non-volatile computer storage medium stores computer-executable instructions, characterized in that, When the computer-executable instructions are executed, a code generation method for a model-based low-code application according to any one of claims 1-8 is implemented.
Citation Information
Cited By
Automatic delivery system and method for application products
CN121349529A
An automated delivery system and method for application products
CN121349529B
Large model application computing power-model-application break-through method
CN121809710A