Low-code system supporting full-output code function and development method thereof
Technical Field
The invention relates to the technical field of software development, in particular to a low-code system supporting a full-output code function and a development method thereof.
Background
With the development of low-code platforms, developers and non-developers can quickly create and iterate applications through visualized development environments and pre-built components, so that the development threshold is reduced. Although the low-code platform provides the advantage of rapid development, in an actual use scenario, the customization needs are more, and the common low-code platform cannot meet the diversified customization needs of clients.
At present, the industry has a mature scheme for front end code output of a low-code platform, but no solution exists for rear end code output and front-rear end integrated total code output.
In order to realize a full-quantity code output scheme integrating a rear end code output and a front end and a rear end, the invention provides a low-code system supporting a full-quantity code output function and a development method thereof.
Disclosure of Invention
The invention provides a simple and efficient low-code system supporting a full-output code function and a development method thereof, which are used for overcoming the defects of the prior art.
The invention is realized by the following technical scheme:
A low code system supporting full-volume code output function, supporting micro-service architecture and modularized design, decoupling design state and running state into independent micro-service; the system comprises a design center, an operation center and an operation host;
The design center is responsible for realizing design development, releasing application versions and realizing code functions by utilizing an abstract syntax tree AST (Abstract Syntax Tree); the code output function and the application version release function share a set of data mode Schema to realize total code output;
The operation center is responsible for defining deployment configuration files and environment variables by using a template system, so that the same set of codes can be flexibly deployed in different environments; meanwhile, exporting the dependent components, menus and view data when the dependent components, menus and view data are released through the design application;
The running host is responsible for managing the Kubernetes application program by using an application management package Helm technology aiming at a cloud environment, and creating and starting a running state micro-service; by setting static configuration required by running state in advance, the running state is independently run in a container form or on an independent virtual machine after basic configuration information is obtained.
A development method of a low-code system supporting a total output code function comprises the following steps:
Step S1, an independent operation center is built, an environment of an operation state service is configured, and meanwhile, dependent components, menus and view data are exported when being released through a design state application;
Step S2, managing a Kubernetes application program by using an application management package Helm technology aiming at a cloud environment, and creating and starting an running state micro-service;
by setting static configuration required by running state operation in advance, the running state independently operates in a container form or on an independent virtual machine after basic configuration information is obtained;
and step S3, newly adding a code output function on the basis of an independently deployed system, wherein the code output function and a version release function of a design center share one set of data mode Schema so as to realize total code output.
In the step S1, an operation center uses a template system to define deployment configuration, and supports automatic generation of configuration files of different environments;
The development design of the application to be released is completed in a design state, and corresponding application information is released to generate a release application package; uploading the generated release application package in the operation center and deploying the release application package on a corresponding operation host;
Configuration files or environment variables are used for managing the configuration of different deployment environments (such as development, test and production), so that the same set of codes can be flexibly deployed in different environments;
corresponding export information is stored via the persistent file including, but not limited to, application information, form information, and dictionary information.
In the step S2, the design state and the running state are decoupled into independent micro services, and the function separation is realized through the micro service architecture, so that the independent deployment and maintenance of each service are realized;
when the running states independently run in the form of containers, the applications and dependencies are packaged into containers (such as an application container engine Docker) to ensure consistency and portability in different environments; the use of Kubernetes container orchestration tools to manage the deployment, expansion, and operation of containers to improve the reliability and scalability of the system;
For containerization and arrangement, an application management package Helm is adopted to start service, a designed application is issued and mirrored and stored, then a template file is written through an infrastructure template HELM CHART (namely a Helm chart) managed by the application management package Helm, and a running state service mirror name required to be deployed is transmitted, and the service is started through an application management package Helm installation HELM INSTALL command.
In the step S2, when the running state runs independently in the form of an independent virtual machine, the remote virtual machine is automatically started or the running state application service is deployed by using a Ansible tool to automatically run and maintain, so that independent deployment is supported;
firstly, configuring a Ansible environment and a control node of a foundation in an operation deployment center; creating Ansible Playbook script files for management, and creating a virtual machine starting module for managing virtual machines; the file host information is dynamically adjusted according to the configuration center parameters;
Then, the application service is deployed for the low-code independent service, middleware (MariaDB, minio, nginx, nacos) and application service module information for the low-code platform are written, and finally, a Ansible Inventory manifest file is configured and Ansible Playbook script files are run, so that the deployment service is automatically started.
In step S3, in order to ensure that the basic information of the release version function and the code output function of the meter has the same data structure, the release version release application package and the code output function of the design center share a set of data pattern Schema, and extract the data pattern Schema into a unified JSON pattern Schema (JSON pattern, a standard for defining JSON (JavaScript Object Notation) data structures), and the root node is an application identifier ID, and the content includes forms, menus, static resources, labels, and roles, positions and dictionary information in the application.
Wherein each item of content in turn consists of a respective different content.
The root node of the form is a form identifier ID, and continuously decomposes the content downwards, wherein the content comprises components, rules and printing information; the component continues to decompose downwards, and comprises component identifier ID, component attribute and associated dictionary information, so that the logical structure and physical storage of the data are separated, a code-out code and an application release application package are formed by extracting the logical structure of the data, and then the management and operation of the data are imported by analyzing the logical structure.
In the step S3, the specific form and application information of the custom design are exported to the application package, and meanwhile, the data are written into the code-out template to generate the full front and rear end code-out;
And performing variable replacement by using a module technology, and generating a new code output file according to the provided source code module combination.
In the step S3, the front end code output adopts a low code Engine Lowcode-Engine technology, and the rear end code output adopts a mature template technology in the market, such as a template Engine FREEMARKER and a template Engine vector; and replacing the variable in the JSON mode Schema by using a module technology, and generating a new code output file by combining according to the provided source code module.
A computing device, comprising:
One or more processors, one or more memories, and one or more programs, wherein the one or more programs are stored in the one or more memories and configured to be executed by the one or more processors, the one or more programs comprising instructions for performing any of the methods described above.
A readable storage medium, characterized by: the readable storage medium has stored thereon a computer program which, when executed by a processor, implements a method as described above.
The beneficial effects of the invention are as follows: according to the low-code system supporting the total output code function and the development method thereof, separation and independent operation of a design state and an operation state are realized, so that not only can the quick creation and iterative application be realized, the development threshold is reduced, but also the various customization demands of customers can be met.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a development method architecture of a low-code system supporting a full-scale code output function according to the present invention.
Detailed Description
In order to enable those skilled in the art to better understand the technical solution of the present invention, the following description will make clear and complete description of the technical solution of the present invention in combination with the embodiments of the present invention. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
The low-code platform is divided into a design state and an operation state, and the operation of the operation state depends on the data of the design state, including component information, authority, rules, configuration and the like, and is seriously coupled. Therefore, in order to realize total output, separation and independent operation of the design state and the operation state are needed to be realized, and most importantly, the operation state can be independently deployed and operated after the design is completed. And the running state independent deployment is realized, and common content and difference content required by running different applications in the running state are required to be extracted. Obviously, the common content is the function of the program itself, and can support the running state service running; the difference content contains configuration information and environment information which are relied on when the program is started.
The low-code system supporting the total output code function supports a micro-service architecture and a modularized design, and decouples a design state and an operation state into independent micro-services; the system comprises a design center, an operation center and an operation host;
The design center is responsible for realizing design development, releasing application versions and realizing code functions by utilizing an abstract syntax tree AST (Abstract Syntax Tree); the code output function and the application version release function share a set of data mode Schema to realize total code output;
The operation center is responsible for defining deployment configuration files and environment variables by using a template system, so that the same set of codes can be flexibly deployed in different environments; meanwhile, exporting the dependent components, menus and view data when the dependent components, menus and view data are released through the design application;
The running host is responsible for managing the Kubernetes application program by using an application management package Helm technology aiming at a cloud environment, and creating and starting a running state micro-service; by setting static configuration required by running state in advance, the running state is independently run in a container form or on an independent virtual machine after basic configuration information is obtained.
The development method of the low-code system supporting the total output code function comprises the following steps:
Step S1, an independent operation center is built, an environment of an operation state service is configured, and meanwhile, dependent components, menus and view data are exported when being released through a design state application;
Step S2, managing a Kubernetes application program by using an application management package Helm technology aiming at a cloud environment, and creating and starting an running state micro-service;
by setting static configuration required by running state operation in advance, the running state independently operates in a container form or on an independent virtual machine after basic configuration information is obtained;
and step S3, newly adding a code output function on the basis of an independently deployed system, wherein the code output function and a version release function of a design center share one set of data mode Schema so as to realize total code output.
In the step S1, an operation center uses a template system to define deployment configuration, and supports automatic generation of configuration files of different environments;
The development design of the application to be released is completed in a design state, and corresponding application information is released to generate a release application package; uploading the generated release application package in the operation center and deploying the release application package on a corresponding operation host;
Configuration files or environment variables are used for managing the configuration of different deployment environments (such as development, test and production), so that the same set of codes can be flexibly deployed in different environments;
corresponding export information is stored via the persistent file including, but not limited to, application information, form information, and dictionary information.
In the step S2, the design state and the running state are decoupled into independent micro services, and the function separation is realized through the micro service architecture, so that the independent deployment and maintenance of each service are realized;
when the running states independently run in the form of containers, the applications and dependencies are packaged into containers (such as an application container engine Docker) to ensure consistency and portability in different environments; the use of Kubernetes container orchestration tools to manage the deployment, expansion, and operation of containers to improve the reliability and scalability of the system;
For containerization and arrangement, an application management package Helm is adopted to start service, a designed application is issued and mirrored and stored, then a template file is written through an infrastructure template HELM CHART (namely a Helm chart) managed by the application management package Helm, and a running state service mirror name required to be deployed is transmitted, and the service is started through an application management package Helm installation HELM INSTALL command.
In the step S2, when the running state runs independently in the form of an independent virtual machine, the remote virtual machine is automatically started or the running state application service is deployed by using a Ansible tool to automatically run and maintain, so that independent deployment is supported;
firstly, configuring a Ansible environment and a control node of a foundation in an operation deployment center; creating Ansible Playbook script files for management, and creating a virtual machine starting module for managing virtual machines; the file host information is dynamically adjusted according to the configuration center parameters;
Then, the application service is deployed for the low-code independent service, middleware (MariaDB, minio, nginx, nacos) and application service module information for the low-code platform are written, and finally, a Ansible Inventory manifest file is configured and Ansible Playbook script files are run, so that the deployment service is automatically started.
In this design, schema plays a central role, and data schema is a description of the logical structure and characteristics of data, which defines data items, security and integrity rules.
In step S3, in order to ensure that the basic information of the release version function and the code output function of the meter has the same data structure, the release version release application package and the code output function of the design center share a set of data pattern Schema, and extract the data pattern Schema into a unified JSON pattern Schema (JSON pattern, a standard for defining JSON (JavaScript Object Notation) data structures), and the root node is an application identifier ID, and the content includes forms, menus, static resources, labels, and roles, positions and dictionary information in the application.
Wherein each item of content in turn consists of a respective different content.
The root node of the form is a form identifier ID, and continuously decomposes the content downwards, wherein the content comprises components, rules and printing information; the component continues to decompose downwards, and comprises component identifier ID, component attribute and associated dictionary information, so that the logical structure and physical storage of the data are separated, a code-out code and an application release application package are formed by extracting the logical structure of the data, and then the management and operation of the data are imported by analyzing the logical structure.
In the step S3, the specific form and application information of the custom design are exported to the application package, and meanwhile, the data are written into the code-out template to generate the full front and rear end code-out;
And performing variable replacement by using a module technology, and generating a new code output file according to the provided source code module combination.
In the step S3, the front end code output adopts a low code Engine Lowcode-Engine technology, and the rear end code output adopts a mature template technology in the market, such as a template Engine FREEMARKER, a template Engine vector and the like; and replacing the variable in the JSON mode Schema by using a module technology, and generating a new code output file by combining according to the provided source code module.
The computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a computing device, cause the computing device to perform any of the methods described above.
The computing device includes:
One or more processors, one or more memories, and one or more programs, wherein the one or more programs are stored in the one or more memories and configured to be executed by the one or more processors, the one or more programs comprising instructions for performing any of the methods described above.
The above examples are only one of the specific embodiments of the present invention, and the ordinary changes and substitutions made by those skilled in the art within the scope of the technical solution of the present invention should be included in the scope of the present invention.