Methods for converting JSON Schema-based page DSL formats and generating front-end source code

By converting the proprietary page DSL of low-code platforms into the UIDL standard format, the problems of low efficiency and poor versatility in generating Vue or React source code are solved, achieving efficient and flexible source code generation, eliminating vendor lock-in, and supporting multi-framework compatibility.

CN117632142BActive Publication Date: 2026-12-01CHINA TELECOM DIGITAL INTELLIGENCE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311679271.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2026-12-01
Estimated Expiration
2043-12-08

AI Technical Summary

Technical Problem

Existing low-code platforms are inefficient and lack versatility in generating Vue or React source code, leading to user vendor lock-in and difficulty in flexible migration.

Method used

By converting proprietary page DSLs to the UIDL standard format and leveraging existing code generation tools to generate front-end source code, including creating UIDL templates for each low-code form component, maintaining a variable pool, processing components, and generating an abstract syntax tree, the final Vue or React source code is generated.

Benefits of technology

It enables efficient generation of Vue or React source code, eliminates vendor lock-in concerns, improves development efficiency and flexibility, supports multi-framework compatibility, and ensures consistency and standardization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117632142B_ABST
    Figure CN117632142B_ABST
Patent Text Reader

Abstract

This invention relates to a method for converting a JSON Schema-based page DSL to a UIDL format and generating front-end source code, belonging to the field of computer software development technology. The method includes the following steps: establishing a UIDL template for each low-code form component and defining template parameters; maintaining a variable pool during form generation; generating a UIDL description for the data component if the child component is a data component, and generating a UIDL description for the layout component if the child component is a layout component; converting the proprietary DSL to the UIDL standard format; and generating the corresponding front-end page source code using existing code generation tools. The method provided by this invention converts proprietary JSON Schema-based page DSLs to the UIDL standard format and can generate front-end source code compatible with Vue or React frameworks, improving development efficiency: by utilizing existing tools and code generation mechanisms for the UIDL format, page source code generation is achieved with lower investment, saving development time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer software development technology, and in particular relates to a method for converting the format of a page DSL based on JSON Schema and generating front-end source code. Background Technology

[0002] In modern software development, the use of low-code technology has become a trend to improve development efficiency, leading to the emergence of various low-code development platforms. A primary characteristic of low-code technology is visual development, especially for front-end pages, allowing users to quickly build forms and other pages through drag-and-drop. To achieve rapid visual page construction, low-code platforms typically rely on predefined page components and use a page designer to generate a JSON Schema-based DSL model describing the parameters of page components and their relationships. The page engine then renders the page at runtime based on this DSL model.

[0003] The page designers, page engines, and JSON Schema-based DSLs mentioned above are proprietary technologies of low-code platforms. Different low-code platforms implement them differently, and there is no unified industry standard. This means vendor lock-in for users, limiting their freedom to migrate applications and becoming an obstacle to the promotion of low-code platforms. To break free from the limitations of specific low-code platforms, users require that the page designers of low-code platforms can generate Vue or React (two currently popular front-end development technologies) source code for flexible secondary development. Low-code platforms have different solutions to this need. Some low-code platforms do not support page source code generation, while others have implemented their own generation schemes based on proprietary DSLs.

[0004] Generating Vue or React source code based on a proprietary Page DSL is a complex task requiring significant investment. This is why some low-code platforms do not support source code generation. Furthermore, source code generation solutions based on proprietary DSLs lack universality, and users may still have concerns about vendor lock-in. Summary of the Invention

[0005] In view of the shortcomings of the existing technology, the purpose of the invention is to provide a method for format conversion of page DSL based on JSON Schema and generation of front-end source code, and to provide a new approach to page source code generation on a low-code platform, which can generate Vue or React source code based on page DSL more quickly, while providing users with a universal page description method and eliminating concerns about vendor lock-in.

[0006] This invention provides a method for converting the format of a page DSL based on JSON Schema and generating front-end source code, comprising the following steps:

[0007] S1. Create a UIDL template for each low-code form component and define the template parameters;

[0008] S2. Maintain a variable pool during form generation;

[0009] S3. Read the required parameters from the variable pool and then pass the required parameters into the UIDL template of the form's top-level component;

[0010] S4. Process the child components of the top-level form component in sequence, with each different type of child component corresponding to a different UIDL template;

[0011] S5. If the child component is a data component, proceed to step S6; if the child component is a layout component, proceed to step S7.

[0012] S6. Using the UIDL template of the corresponding form component, pass in the required parameters read from the variable pool, generate the UIDL description of the form component, and add it to the children list of the parent component's UIDL description;

[0013] S7. Using the UIDL template of the corresponding layout component, pass in the required parameters read from the variable pool, generate the UIDL description of the layout component, and add it to the children list of the parent component's UIDL description;

[0014] S8. Repeat S4 to S7 for the child components of the layout component, convert the proprietary DSL into the UIDL standard format, and use existing code generation tools to generate the corresponding front-end page source code from the UIDL description.

[0015] Furthermore, the low-code form component is implemented based on Vue components.

[0016] Furthermore, the form component includes a layout component and a data component.

[0017] Furthermore, the layout component is used to arrange the display positions of other components, including grids, tables, cards, and tabs.

[0018] Furthermore, the data components are used for entering or displaying data, including text boxes, drop-down lists, radio buttons, check boxes, and date selection.

[0019] Furthermore, the variable pool contains externally passed global parameters and stores the relevant configurations from the top-level component of the form to the current component in a hierarchical manner.

[0020] Furthermore, the form UIDL in S3 does not contain child components.

[0021] Furthermore, in S8, the source code includes the rendering logic of UI components, data binding, and event handling.

[0022] Furthermore, in step S8, generating the corresponding front-end page source code from the UIDL description using existing code generation tools specifically includes the following steps:

[0023] S9. Verify the validity of the component's UIDL description;

[0024] S10. Parse the general UIDL definition into content for a specific language framework, and use different language framework mappings to parse the UIDL into components for different language frameworks;

[0025] S11. Generate basic components, represented in the form of an abstract syntax tree;

[0026] S12. Based on the abstract syntax tree of the basic components, operations are performed through plugins, including passing in parameter definitions, styles, and extracting styles to CSS files;

[0027] S13. Merge all results and return a standard format code.

[0028] Furthermore, the components of the language framework include Vue, React, and HTML.

[0029] The beneficial effects of this invention are as follows:

[0030] The method provided by this invention converts proprietary JSON Schema-based page DSLs into the UIDL standard format and generates front-end source code compatible with Vue or React frameworks, improving development efficiency. It utilizes existing tools and code generation mechanisms for the UIDL format to generate page source code with lower investment, saving development time and promoting standardization. By using UIDL as a standard page description language, it provides a universal page abstraction layer for low-code platform users, independent of low-code platform-specific implementations, eliminating user concerns about vendor lock-in. It offers flexibility and scalability, converting proprietary JSON Schema page DSLs to UIDL. The flexibility and scalability of UIDL can meet the needs of different projects. Besides Vue and React, it can generate more types of front-end source code while ensuring consistency. By using the UIDL standard format as an intermediate representation, it ensures that the generated source code has a consistent structure and specifications with existing Vue or React frameworks. Attached Figure Description

[0031] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. It is obvious that the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings.

[0032] Figure 1 This is a flowchart of an embodiment of the present invention;

[0033] Figure 2 This is a low-code page design system diagram according to an embodiment of the present invention;

[0034] Figure 3 This is a flowchart illustrating the conversion of a proprietary page DSL to a UIDL according to an embodiment of the present invention;

[0035] Figure 4 This is a component classification diagram of the low-code proprietary page DSL in an embodiment of the present invention. Detailed Implementation

[0036] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. It should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0037] Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts disclosed in this invention.

[0038] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of methods and systems consistent with some aspects of the invention as detailed in the appended claims.

[0039] This invention proposes a method for converting the format of a page DSL based on JSON Schema and generating front-end source code. This method addresses the lack of universality of proprietary page DSLs and the low efficiency of generating source code from proprietary DSLs. By converting proprietary DSLs to UIDL, the problems of page description standardization and source code generation can be solved simultaneously.

[0040] Method Implementation Examples

[0041] This invention provides a method for converting a JSON Schema-based page DSL into the UIDL standard format and generating Vue or React front-end source code based on this standard format.

[0042] The JSON Schema-based DSL is generated by a low-code page designer that allows drag-and-drop construction of forms or other pages. The page DSL includes the hierarchy of UI components, layout information, styles, and more.

[0043] Converting a JSON Schema-based page DSL to the UIDL standard format involves mapping various components and elements of the page DSL to their corresponding components and elements defined in the UIDL, ensuring that the generated UIDL description fully contains the information from the original DSL.

[0044] JSON Schema: A specification for describing and validating JSON data structures, which can be used to ensure the validity, consistency and integrity of data.

[0045] DSL (Domain Specific Language): refers to a computer language that focuses on a specific application domain, also known as a domain-specific language.

[0046] UIDL (User Interface Description Language): User interface description language

[0047] This paper provides a method for converting the format of a page DSL based on JSON Schema and generating front-end source code, including the following steps:

[0048] S1. Create a UIDL template for each low-code form component and define template parameters. For example, if the form components in the low-code page designer are based on Vue components, the Vue components used in the low-code can continue to be used in the UIDL. UIDL supports defining external dependencies for components, but in this case, UIDL can only be used to generate source code. To generate React or other types of source code, basic standard components must be used in the UIDL.

[0049] S2. Maintain a variable pool during form generation;

[0050] S3. Read the required parameters from the variable pool and then pass the required parameters to the UIDL template of the form's top-level component. The form UIDL does not contain child components.

[0051] S4. Process the child components of the top-level form component sequentially. Each different type of child component corresponds to a different UIDL template. Child components can be data components or layout components. Data components do not contain child components, while layout components contain one or more lists of child components (e.g., a card component contains one list of child components, and a tab component with two tabs contains two lists of child components). Layout components require recursive processing.

[0052] S5. If the child component is a data component, proceed to step S6; if the child component is a layout component, proceed to step S7.

[0053] S6. Using the UIDL template of the corresponding form component, pass in the required parameters read from the variable pool, generate the UIDL description of the form component, and add it to the children list of the parent component's UIDL description;

[0054] S7. Using the UIDL template of the corresponding layout component, pass in the required parameters read from the variable pool, generate the UIDL description of the layout component, and add it to the children list of the parent component's UIDL description;

[0055] S8. Repeat S4-S7 for the child components of the layout component. Note that each layout component may contain multiple child component lists. Convert the proprietary DSL into the UIDL standard format. Use existing code generation tools to generate the corresponding front-end page source code from the UIDL description. The source code includes the rendering logic of the UI components, data binding, and event handling. UIDL also supports front-end project definition. Furthermore, a front-end project UIDL description can be defined to generate a complete front-end project.

[0056] S9. Verify the validity of the component's UIDL description;

[0057] S10. Parse the general UIDL definition into content for a specific language framework. Use different language framework mappings to parse the UIDL into components for different language frameworks. The components of the language frameworks include Vue, React, and HTML.

[0058] S11. Generate basic components, represented in the form of an abstract syntax tree;

[0059] S12. Based on the abstract syntax tree of the basic components, operations are performed through plugins, including passing in parameter definitions, styles, and extracting styles to CSS files;

[0060] S13. Merge all results and return a standard format code.

[0061] Furthermore, in this invention, the aforementioned low-code form component is implemented based on Vue components.

[0062] Furthermore, regarding form components, form components include layout components and data components.

[0063] In this invention, regarding the above-mentioned layout component, the layout component is used to arrange the display positions of other components, including grids, tables, cards, and tabs.

[0064] Additionally, regarding data components, these are used to input or display data and include text boxes, drop-down lists, radio buttons, check boxes, and date pickers.

[0065] Regarding the variable pool mentioned above, the variable pool contains global parameters passed in from outside and stores the relevant configurations from the top-level component of the form to the current component in a hierarchical manner.

[0066] Device Examples

[0067] See Figure 2 The image shows a low-code page design system using the method provided by this invention. The system's page designer still generates proprietary DSL page models, but achieves the purpose of generating Vue source code by converting them to UIDL.

[0068] The conversion process includes the following modules:

[0069] DSL parsing module: Parses the proprietary page DSL model, generates a page component tree, and stores it in memory for use in the next step.

[0070] Component UIDL template: Each component in a proprietary DSL model has a corresponding UIDL template containing specific parameters.

[0071] The conversion module converts the proprietary page DSL model into UIDL. The input to the conversion module consists of three parts: the page component tree, the component's UIDL template, and a variable pool. During its operation, the conversion module reads the parameters required by the component's UIDL template from the variable pool and simultaneously stores the relevant configuration of the current component into the variable pool.

[0072] Page source code generator: Generates page source code based on page UIDL.

[0073] Front-end project generator: Generates a front-end project based on the page source code and the front-end project UIDL description.

[0074] Based on the same inventive concept, another embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus.

[0075] Memory, used to store computer programs;

[0076] A processor, when executing a program stored in memory, implements the method of converting the format of the JSON Schema-based page DSL of the present invention and generating front-end source code.

[0077] The communication bus mentioned in the aforementioned electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. The communication interface is used for communication between the terminal and other devices. The memory can include Random Access Memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory can also be at least one storage system located remotely from the aforementioned processor.

[0078] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0079] Furthermore, to achieve the above objectives, embodiments of the present invention also propose a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method of converting the format of the JSON Schema-based page DSL of the present invention and generating front-end source code.

[0080] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable vehicles (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0081] The embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A system that specifies functions in one or more boxes.

[0082] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including an instruction set implemented in a process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0083] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0084] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. "And / or" indicates that either one or both can be chosen. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes the element.

[0085] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the protection scope of the present invention.

Claims

1. A method for format conversion of a JSON Schema-based page DSL and generation of front-end source code, characterized in that, Includes the following steps: S1. Create a UIDL template for each low-code form component and define the template parameters; S2. Maintain a variable pool during form generation; S3. Read the required parameters from the variable pool and then pass the required parameters into the UIDL template of the form's top-level component; S4. Process the child components of the top-level form component in sequence, with each different type of child component corresponding to a different UIDL template; S5. If the child component is a data component, proceed to step S6; if the child component is a layout component, proceed to step S7. S6. Using the UIDL template of the corresponding form component, pass in the required parameters read from the variable pool, generate the UIDL description of the form component, and add it to the children list of the parent component's UIDL description; S7. Using the UIDL template of the corresponding layout component, pass in the required parameters read from the variable pool, generate the UIDL description of the layout component, and add it to the children list of the parent component's UIDL description; S8. Repeat S4 to S7 for the child components of the layout component, convert the proprietary DSL into the UIDL standard format, and use the existing code generation tool to generate the corresponding front-end page source code from the UIDL description; In step S8, generating the corresponding front-end page source code from the UIDL description using existing code generation tools specifically includes the following steps: S9. Verify the validity of the component's UIDL description; S10. Parse the general UIDL definition into content for a specific language framework, and use different language framework mappings to parse the UIDL into components for different language frameworks; S11. Generate basic components, represented in the form of an abstract syntax tree; S12. Based on the abstract syntax tree of the basic components, operations are performed through plugins, including passing in parameter definitions, styles, and extracting styles to CSS files; S13. Merge all results and return a standard format code.

2. The method for JSON Schema-based page DSL format conversion and front-end source code generation according to claim 1, wherein, The low-code form component is implemented based on Vue components.

3. The method for JSON Schema-based page DSL format conversion and front-end source code generation according to claim 1, wherein, The form components include layout components and data components.

4. The method for JSON Schema-based page DSL format conversion and front-end source code generation according to claim 3, wherein, The layout component is used to arrange the display positions of other components, including grids, tables, cards, and tabs.

5. The method for JSON Schema-based page DSL format conversion and front-end source code generation according to claim 3, wherein, The data components are used to input or display data, including text boxes, drop-down lists, radio buttons, check boxes, and date selection.

6. The method for format conversion and front-end source code generation of the JSON Schema-based page DSL according to claim 2, characterized in that, The variable pool contains externally passed global parameters and stores the relevant configurations from the top-level form component to the current component in a hierarchical manner.

7. The method for format conversion and front-end source code generation of the JSON Schema-based page DSL according to claim 1, characterized in that, The form UIDL in S3 does not contain child components.

8. The method for format conversion and front-end source code generation of the JSON Schema-based page DSL according to claim 1, characterized in that, In S8, the source code includes the rendering logic of UI components, data binding, and event handling.

9. The method for format conversion and front-end source code generation of the JSON Schema-based page DSL according to claim 1, characterized in that, The components of the language framework include Vue, React, and HTML.

Citation Information

Patent Citations

  • Customizable low-code front-end development framework and method based on visual dragging

    CN113849165A

  • Low-code page building system and method and computer readable storage medium

    CN115617327A