A low-code engine page rendering method and system running on a browser
By parsing page metadata and designing and compiling UI components on the browser side, combined with the slot system and Service Worker technology, the problem of low-code engine rendering requiring high computing power on the server side is solved, and more efficient page rendering and Development experience, reducing server burden and network dependence.
Patent Information
- Application Number
- CN202311648275.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-01
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2043-12-01
AI Technical Summary
The existing low-code engine rendering method has high requirements on server-side computing power, which leads to a large demand for server-side computing resources when the number of users increases or the application page is complex, which may lead to slow response or crash.
The browser is used for page metadata analysis and UI component design and compilation. The slot system is used to manage the design state and running behavior of UI components, and Service Worker is used to implement client data resource caching and offline rendering.
It reduces server costs, improves page loading speed and user experience, supports offline work, reduces network burden, and accelerates the development iteration process.
Smart Images

Figure CN117539490B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of code development technology, and specifically relates to a low-code engine page rendering method and system running on a browser. Background Art
[0002] Traditional low-code engines use server-side rendering, which requires high server-side computing power. The performance of modern terminal devices including PCs, mobile phones, tablets, etc. is already relatively high.
[0003] Modern browsers can already make relatively full use of terminal resources, so the computing power required for low-code rendering can be transferred from the server to the browser, saving server costs and improving user experience.
[0004] The existing page rendering method uses server-side rendering. Its disadvantage is that when the number of users increases or the application page is more complex, the demand for server-side computing resources is large. At the same time, during business peak hours, since the business logic code and page rendering work are running on the server, it usually causes the overall application response to slow down or even crash. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the low-code engine page rendering method running on the browser side provided by the present invention solves the problem that the existing low-code engine rendering has high requirements on the computing power of the server side.
[0006] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: a low-code engine page rendering method running on a browser side, comprising the following steps:
[0007] S1. Obtain page metadata and parse it into internal data structures for page rendering on the browser side;
[0008] S2. Design and compile UI components on the browser side;
[0009] Wherein, the UI component manages its design state behavior and running state behavior through the slot system;
[0010] S3. Based on the internal data structure, the compiled UI components are used to perform dynamic step-by-step rendering to obtain a rendered complete page.
[0011] Furthermore, the step S1 is specifically as follows:
[0012] S11, receiving page metadata: obtaining page meta code from the server through the browser;
[0013] S12, parsing page metadata: parsing the page source code through the browser to extract the page metadata;
[0014] S13, processing page metadata: processing the extracted page metadata;
[0015] S14. Generate internal data structure: convert the processed page metadata into an internal data structure for page rendering.
[0016] Furthermore, in step S2, the method of designing and compiling the UI component is specifically as follows:
[0017] S21. Build the user interface required by the UI component design tool integrated in the browser;
[0018] S22, converting the operations involved in building the interface into executable codes, and generating descriptive information of UI components related to the interface;
[0019] S23, running the compiled executable code on the browser side, and dynamically rendering related UI components to generate visual UI components;
[0020] S24. Adjust and confirm the visual UI components to complete the UI component design;
[0021] S25. Compile the designed UI component into a single component, generate a component HASH value and cache it.
[0022] Further, in step S2, the slot system is used to define, configure and manage the behavior of UI components in a universal and consistent way;
[0023] Wherein, defining refers to defining available slots in the UI component, wherein the slots allow users to insert content or components;
[0024] Configuration refers to providing configurable properties or options for a slot, so that users can define the behavior of the slot according to them;
[0025] Management refers to dynamically rendering slots in the UI component's slots based on user-provided content or components.
[0026] Furthermore, the slot system authorizes the user to perform the following operations in the process of managing the behavior of the UI component:
[0027] Define the event and data properties of the slot to implement event and data communication between the slot and the parent component;
[0028] Define and use multiple slots in the same component according to page rendering requirements;
[0029] Dynamically bind data to UI components placed in slots based on slot properties or data binding;
[0030] Bind events for each component in the slot and pass the context into the event parameters.
[0031] Furthermore, the step S3 is specifically as follows:
[0032] S31, dividing the page metadata parsed into internal data structures into different DOMs;
[0033] S32. Use the slot system to manage the relationship between different DOMs;
[0034] S33, starting from the bottom DOM, extracting metadata including each DOM page element and style information layer by layer;
[0035] S34. Based on the extracted metadata, the compiled components are used to render level by level and merge the rendering results of each DOM to obtain a rendered complete page and display it on the browser screen level by level.
[0036] Furthermore, during the page rendering process, client data resource caching and offline rendering are achieved through Service Worker.
[0037] A low-code engine page rendering system, comprising:
[0038] Page metadata parsing module: used to obtain and parse page metadata from the server and convert it into the internal data structure of the browser;
[0039] UI component design and compilation module: used to design and compile required UI components on the browser side according to page rendering requirements;
[0040] Slot system: A common and consistent way to define, configure and manage the behavior of UI components during the design and compilation process;
[0041] Step-by-step rendering module: It is used to render and display the page step by step based on the page metadata of the internal data structure using the compiled UI components, so as to obtain the rendered complete page.
[0042] Furthermore, the system also includes a client cache and offline rendering module based on Service Worker.
[0043] Furthermore, the slot system includes a slot definition module, a slot configuration module and a slot management module:
[0044] The slot definition module is used to define available slots in a component, wherein the slots allow users to insert content or components, and multiple slots can be defined and used in the same component;
[0045] Slot configuration module: used to provide configurable properties or options for slots, so that users can define the behavior of slots according to them;
[0046] Slot management module: used to dynamically render slots in the slots of UI components based on the content or components provided by the user.
[0047] The beneficial effects of the present invention are:
[0048] The trend of sinking low-code rendering computing power to modern browsers in this invention stems from the improvement of modern terminal device performance and the full utilization of browser resources. This innovation can reduce server costs, speed up page loading, provide a better user experience, support offline work, reduce network burden, achieve cross-platform compatibility, and accelerate the development iteration process; specifically, it is reflected in the following aspects:
[0049] (1) The parsing of page metadata is transferred to the browser: In traditional low-code platforms, page metadata parsing is performed on the server side, while in the present invention, the parsing of page metadata is transferred to the browser side, so that the browser can directly process and render the page metadata. This improvement greatly improves the loading speed and performance of the page and reduces the burden on the server side.
[0050] (2) Downscaling the design and compilation of UI components to the browser: Unlike traditional server-side rendering, this invention downscaling the design and compilation of UI components to the browser, giving the browser more control. The server only retains the compiled code, which means that users can see their design results in real time without having to wait for the code to be compiled and generated. This innovation greatly improves user experience and development efficiency.
[0051] (3) Design a unified slot to manage the design-state behavior and runtime behavior of UI components: This invention introduces a unified slot system to manage the design-state behavior and runtime behavior of UI components. This means that developers can more easily control the interaction and dynamic behavior of components without in-depth programming. This innovation simplifies the development process, lowers the technical threshold, and makes development faster and more flexible.
[0052] (4) Dynamic component step-by-step rendering: The dynamic component step-by-step rendering method allows page element data to be directly converted into a WEB page, eliminating the intermediate code generation process. This means that users can see their design results in real time without having to wait for code compilation and generation. This innovation greatly improves user experience and development efficiency.
[0053] (5) Client caching and offline rendering: Combine client caching, offline rendering, and Service Worker technologies to implement client caching and offline rendering functions so that the application can continue to run when there is no network connection and load faster under limited bandwidth conditions. This is especially useful for mobile devices and low network quality environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A flow chart of the low-code engine page rendering method running on the browser side provided by the present invention. DETAILED DESCRIPTION
[0055] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0056] Embodiment 1:
[0057] The embodiment of the present invention provides a low-code engine page rendering method running on a browser side, such as Figure 1 As shown, the following steps are included:
[0058] S1. Obtain page metadata and parse it into internal data structures for page rendering on the browser side;
[0059] S2. Design and compile UI components on the browser side;
[0060] Wherein, the UI component manages its design state behavior and running state behavior through the slot system;
[0061] S3. Based on the internal data structure, the compiled UI components are used to perform dynamic step-by-step rendering to obtain a rendered complete page.
[0062] In step S1 of the embodiment of the present invention, the parsing of page metadata refers to the process of extracting the metadata of the page, including data in the format of structure, style, event, data definition, etc., from the original source code and interpreting it as an internal data structure that can be understood and rendered by the computer. This innovation in the present embodiment improves the loading speed and performance of the page, because the user can see the page content immediately without waiting for the server's response. At the same time, this also reduces the burden on the server and reduces the server operation and maintenance costs. The process of page metadata parsing includes receiving, parsing, processing and generating internal data structures, which are then used to dynamically render the page, providing a more efficient and real-time user experience.
[0063] Based on this, step S1 of the embodiment of the present invention is specifically:
[0064] S11, receiving page metadata: obtaining page meta code from the server through the browser;
[0065] S12, parsing page metadata: parsing the page source code through the browser to extract the page metadata;
[0066] S13, processing page metadata: processing the extracted page metadata;
[0067] S14. Generate internal data structure: convert the processed page metadata into an internal data structure for page rendering.
[0068] Specifically, in step S11 of this embodiment, the browser downloads the page source code from the server or cache, including the metadata of the page. The metadata exists in JSON format and includes the page component logical structure, component events, property settings, and style setting data.
[0069] In step S12 of this embodiment, when parsing the page metadata, the browser needs to parse the downloaded page source code, extract the metadata therein, and convert it into a metadata object. This process includes parsing the component structure tree, event list, attribute list, and style list.
[0070] In step S13 of this embodiment, after parsing the metadata of the page, the browser needs to process these data in order to subsequently generate an internal data structure; the processing process includes: merging style rules with the same name, parsing JavaScript events, and processing dynamically loaded resources.
[0071] In step S14 of this embodiment, the browser converts the processed page metadata into internal data structures that can be understood and rendered by a computer; the internal data structures include DOM (browser's document object model), CSSOM (CSS object model), and event handlers.
[0072] In step S2 of the embodiment of the present invention, the design and compilation of the UI components are moved to the user's browser, so that the user can design and compile the UI components in the browser in real time and view the results immediately without waiting for code generation. This innovation in the present embodiment improves development efficiency because users can experiment and improve more quickly, and improves user experience because they can immediately see their design results, so as to achieve the goal of real-time design and editing of UI components.
[0073] Based on this, step S2 of the embodiment of the present invention is specifically:
[0074] S21. Build the user interface required by the UI component design tool integrated in the browser;
[0075] S22, converting the operations involved in building the interface into executable codes, and generating descriptive information of UI components related to the interface;
[0076] S23, running the compiled executable code on the browser side, and dynamically rendering related UI components to generate visual UI components;
[0077] S24. Adjust and confirm the visual UI components to complete the UI component design;
[0078] S25. Compile the designed UI component into a single component, generate a component HASH value and cache it.
[0079] Specifically, in step S21 of this embodiment, the user interactively designs the interface through a Web application or a specific UI component design tool integrated into the browser. The user can drag, drop, and customize components from the available UI component library to build the desired user interface. The user can adjust the properties, style, and layout of the component to meet their design requirements, and these adjustments are made through a visual interface without writing code.
[0080] In step S22 of this embodiment, when the user completes the design of the UI component in the interactive design tool, the tool will convert the user's operation into executable code or data structure; at the same time, it will parse the user's design and generate descriptive information of the UI component in JSON data format. This information includes the structure, properties, and style of the component; the tool will use a compiler or converter to convert the descriptive information into executable front-end code, such as HTML, CSS, and JavaScript. These codes will be responsible for rendering the UI component designed by the user.
[0081] In step S23 of this embodiment, the generated front-end code will run in the user's browser, and the browser will execute the generated code to dynamically render the UI components, instantly displaying the user's design results, and the user can instantly view and interact with the UI components they designed in the browser. They can check the appearance and behavior of the UI components to ensure that they meet their needs.
[0082] In step S24 of this embodiment, the user can return to edit and improve at any time through the UI component design tool. Any adjustments to the UI component will be reflected in the real-time rendering, and the user can see the results immediately. This real-time feedback enables the user to experiment and adjust quickly without waiting for code generation or reloading the page.
[0083] In step S25 of this embodiment, after the design of the UI component is completed, it is compiled into a single component and a component HASH value is generated, which is cached locally in the browser when the user accesses it. When the component is modified, a hash comparison is used to decide whether to update the local cache, thereby reducing network interaction during the page rendering process and achieving better rendering efficiency.
[0084] In step S2 of the embodiment of the present invention, a unified slot system is designed to manage the design state behavior and the running state behavior of the UI components, so that developers can more easily control the interaction and dynamic behavior of the components without in-depth programming. The slot system in this embodiment is used to define, configure and manage the behavior of UI components in a common and consistent way.
[0085] Based on the designed slot system, developers can bind specific functions or interactions to components through unified slots, whether at design time or runtime, and then configure and manage them in actual applications. This simplifies the development process, lowers the technical threshold, and makes development faster and more flexible. The unified slot process includes defining slots, configuring slot behaviors, and managing component behaviors at runtime, providing users with more flexible control and interaction capabilities.
[0086] Wherein, defining refers to defining available slots in the UI component, wherein the slots allow users to insert content or components;
[0087] Specifically, define a unified slot named jw-slot, and use special tags or placeholders in the component template to identify the slot, which is similar to Vue.js's <slot>Elements, React's children attribute, etc.
[0088] Configuration refers to providing configurable properties or options for the slot so that users can define the behavior of the slot based on them; specifically, configuration is achieved through the props or other configuration options of the component.
[0089] Management refers to dynamically rendering slots in the UI component's slots based on user-provided content or components.
[0090] Furthermore, in the process of managing the behavior of UI components, the slot system in the embodiment of the present invention authorizes the user to perform the following operations:
[0091] Define the event and data attributes of the slot to realize the event and data communication between the slot and the parent component; specifically, it uses custom events or props to pass data. Among them, the UI component is a tree structure, each component contains 0-1 parent components and 0-n child components.
[0092] Define and use multiple slots in the same component according to page rendering requirements; specifically, configure multiple slots for the component and specify a name for each slot. Users can use multiple slots in the component as needed. Each slot corresponds to a named slot, and each slot is independent of each other.
[0093] Dynamically bind data to UI components placed in slots based on slot properties or data binding;
[0094] Specifically, through slot attributes or data binding, users are allowed to pass dynamic data or dynamic styles to the slot to affect the presentation of the slot content.
[0095] Bind events for each component in the slot and pass the context into the event parameters.
[0096] In this embodiment, component behaviors (styles, events, properties) are uniformly encapsulated in a unified slot, which means that developers can define and configure component behaviors in a centralized location without having to set them up in different code segments. This unified encapsulation method makes it more efficient and consistent to manage and modify component behaviors without having to delve into the internal implementation details of each component.
[0097] At runtime, these slots can be dynamically applied to components to enable the configuration of component styles, events, and properties. This approach not only simplifies the development process, but also improves the maintainability of the code, because developers can more easily manage and update component behavior without having to deeply modify the component's source code; this unified encapsulation processing method helps improve development efficiency and provides developers with greater flexibility to meet the needs of different application scenarios.
[0098] In step S3 of the embodiment of the present invention, dynamic step-by-step rendering is a method of rendering page elements. It directly converts page data into the effect of a WEB page by step-by-step rendering, eliminating the coding process of the intermediate code. The core of this innovation in the present embodiment is to present the page metadata in a step-by-step manner, starting from the most basic elements, and gradually building up complete visual content. This process is different from traditional one-time rendering. It allows users to see part of the content instantly while loading the page, without having to wait for the entire page to be rendered.
[0099] In the dynamic step-by-step rendering process, the page metadata is divided into multiple rendering levels, each of which contains a portion of the page elements and style information; the browser starts from the bottom layer, renders each level step by step, adds it to the page, and finally builds a complete page.
[0100] Based on this, step S3 of the embodiment of the present invention is specifically as follows:
[0101] S31, dividing the page metadata parsed into internal data structures into different DOMs;
[0102] S32. Use the slot system to manage the relationship between different DOMs;
[0103] S33, starting from the bottom DOM, extracting metadata including each DOM page element and style information layer by layer;
[0104] S34. Based on the extracted metadata, the compiled components are used to render level by level and merge the rendering results of each DOM to obtain a rendered complete page and display it on the browser screen level by level.
[0105] Specifically, in step S31 of this embodiment, page metadata (including HTML elements and style information) is divided into multiple levels according to the complexity of document structure and style rules; these levels can be regarded as different "DOMs", each DOM containing a portion of page elements and related style information.
[0106] In step S32 of this embodiment, the browser uses a unified slot mechanism to manage the relationship between the various levels. The unified slot is a container for combining the contents of different DOMs together for rendering level by level.
[0107] In step S33 of this embodiment, the browser starts from the bottom-level DOM and extracts the elements and style information of the DOM; the extracted elements and style information are calculated, including the exact position, size, and color of the elements, which involves applying CSS styles, layout, and drawing.
[0108] In step S34 of this embodiment, the browser renders and merges the rendering results of each DOM level by level. This means that the content of the bottom DOM is added to the top DOM, and the complete page content is gradually constructed. The final rendering result is drawn to the screen, and the user can see the content of the page. This process is gradual, that is, different parts of the page will be displayed level by level, instead of waiting for the entire page to be fully rendered.
[0109] The dynamic step-by-step rendering process in step S3 of this embodiment helps improve the user experience because it allows the browser to gradually display the content while building the page. This is particularly helpful for large and complex web pages because users can interact with the page more quickly; this method also helps reduce memory usage because there is no need to store the rendering data of the entire page at the same time; the dynamic step-by-step rendering process in this embodiment not only improves the user experience because the user can quickly see part of the content of the page, but also reduces the burden on the server and browser because the intermediate code generation and transmission process is omitted.
[0110] In an embodiment of the present invention, during the page rendering process, client data resource caching and offline rendering are implemented through Service Worker.
[0111] In this embodiment, client caching, offline rendering, and Service Worker technologies are combined, which allows the application to cache resources in the local storage of the user's device. At the same time, with the help of Service Worker, these resources can be dynamically loaded and provided in an offline state.
[0112] The Service Worker in this embodiment is an independent background thread that can intercept network requests and responses and provide access to the cache. Through Service Worker, the application can define which resources need to be cached on the user's device so that they can be accessed offline when the Internet is not connected. When the user is online, Service Worker can also obtain resources from the server and update them to the local cache to keep the latest version of the resources.
[0113] The process of client caching and offline rendering includes resource downloading and storage, resource loading, and application running. When combined with Service Worker, it can more powerfully manage resource caching and provide offline access. The specific implementation process is as follows:
[0114] Resource download and caching process:
[0115] 1. Service Worker registration: When the application is loaded for the first time, the browser will register a ServiceWorker; Service Worker is a separate script that intercepts and manages network requests in order to cache resources and provide offline access.
[0116] 2. Resource download: When the application starts or the page is loaded, Service Worker can intercept network requests to the server. This includes HTML, CSS, JavaScript files and other resources such as images and fonts.
[0117] 3. Resource caching: Service Worker caches the resources obtained from network requests to local storage, which is actually the browser's cache storage area. In this way, the resources can be obtained from the local cache in subsequent requests without having to download them from the server again.
[0118] Resource usage process:
[0119] 1. Network priority strategy: When the application needs to load resources, the Service Worker first checks whether there is a local cached copy. If there is a local cache, the Service Worker gets the resource from the cache and uses it in the application. This is a network priority strategy because it still tries to get the latest resources from the network.
[0120] 2. Offline access: If the resource is not available in the local cache (for example, the user is offline), ServiceWorker can provide offline access. It will provide previously downloaded resources from the cache to ensure that the application continues to run even without a network connection.
[0121] Based on the above process, the client cache and offline rendering process combined with Service Worker in this embodiment can realize the functions of resource download, storage, loading and cache update by registering Service Worker and intercepting network requests. This enables applications to manage resources more efficiently and continue to provide access in offline situations. Not only does it improve performance, it also provides a better user experience because users can continue to use the application offline without worrying about network connection issues.
[0122] Embodiment 2:
[0123] The embodiment of the present invention provides a low-code engine page rendering system corresponding to the low-code engine page rendering method in Embodiment 1, including:
[0124] Page metadata parsing module: used to obtain and parse page metadata from the server and convert it into the internal data structure of the browser;
[0125] UI component design and compilation module: used to design and compile required UI components on the browser side according to page rendering requirements;
[0126] Slot system: A common and consistent way to define, configure and manage the behavior of UI components during the design and compilation process;
[0127] Step-by-step rendering module: It is used to render and display the page step by step based on the page metadata of the internal data structure using the compiled UI components, so as to obtain the rendered complete page.
[0128] In the page metadata parsing module in the embodiment of the present invention, the parsing work of the page metadata is transferred to the browser side, so that the browser can directly process and render the page metadata, which greatly improves the loading speed and performance of the page and reduces the burden on the server side.
[0129] In the UI component design and compilation module in the embodiment of the present invention, the design and compilation of UI components are transferred to the browser, so that the browser has more control; the server only retains the compiled code, which means that users can see their design results in real time without having to wait for the compilation and generation of the code, greatly improving the user experience and development efficiency.
[0130] The slot system in the embodiment of the present invention includes a slot definition module, a slot configuration module and a slot management module:
[0131] The slot definition module is used to define available slots in a component, wherein the slots allow users to insert content or components, and multiple slots can be defined and used in the same component;
[0132] Slot configuration module: used to provide configurable properties or options for slots, so that users can define the behavior of slots according to them;
[0133] Slot management module: used to dynamically render slots in the slots of UI components based on the content or components provided by the user.
[0134] In the embodiment of the present invention, a slot system is introduced to manage the design state behavior and the running state behavior of the UI component. This means that developers can more easily control the interaction and dynamic behavior of the components without in-depth programming, simplifying the development process, lowering the technical threshold, and making development faster and more flexible.
[0135] In the step-by-step rendering module in the embodiment of the present invention, a dynamic component step-by-step rendering method is adopted, which allows the page element data to be directly converted into a WEB page, eliminating the intermediate code generation process. This means that users can see their design results in real time without having to wait for the compilation and generation of the code, which greatly improves the user experience and development efficiency.
[0136] The system of the present invention also includes a client caching and offline rendering module based on Service Worker. Client caching and offline rendering functions are implemented to enable the application to continue running when there is no network connection and load faster under limited bandwidth conditions. This is particularly useful for mobile devices and low network quality environments.
[0137] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
[0138] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.< / slot>
Claims
1. A low-code engine page rendering method running on a browser, characterized in that: The following steps are involved: S1. Obtain page metadata and parse it into internal data structures for page rendering on the browser side; S2. Design and compile UI components on the browser side; Wherein, the UI component manages its design state behavior and running state behavior through the slot system; S3. Based on the internal data structure, the compiled UI components are used to perform dynamic step-by-step rendering to obtain a rendered complete page; In step S2, the slot system is used to define, configure and manage the behavior of UI components in a universal and consistent way; Wherein, defining refers to defining an available slot in a UI component, wherein the slot allows a user to insert content or a component; Configuration refers to providing configurable properties or options for a slot, so that users can define the behavior of the slot according to them; Management refers to dynamically rendering slots in the UI component’s slots based on user-provided content or components; The slot system authorizes users to perform the following operations in the process of managing the behavior of UI components: Define the event and data properties of the slot to implement event and data communication between the slot and the parent component; Define and use multiple slots in the same component according to page rendering requirements; Dynamically bind data to UI components placed in slots based on slot properties or data binding; Bind events for each component in the slot and pass the context content to the event parameters; The step S3 is specifically as follows: S31, dividing the page metadata parsed into internal data structures into different DOMs; S32. Use the slot system to manage the relationship between different DOMs; S33, starting from the bottom DOM, extracting metadata including each DOM page element and style information layer by layer; S34. Based on the extracted metadata, the compiled components are used to render level by level and merge the rendering results of each DOM to obtain a rendered complete page and display it on the browser screen level by level.
2. The low-code engine page rendering method running on the browser side according to claim 1 is characterized in that: The step S1 is specifically as follows: S11, receiving page metadata: obtaining page meta code from the server through the browser; S12, parsing page metadata: parsing the page source code through the browser to extract the page metadata; S13, processing page metadata: processing the extracted page metadata; S14. Generate internal data structure: convert the processed page metadata into an internal data structure for page rendering.
3. The low-code engine page rendering method running on the browser side according to claim 1 is characterized in that: In step S2, the method for designing and compiling the UI component is specifically as follows: S21. Build the user interface required by the UI component design tool integrated in the browser; S22, converting the operations involved in building the interface into executable codes, and generating descriptive information of UI components related to the interface; S23, running the compiled executable code on the browser side, and dynamically rendering related UI components to generate visual UI components; S24. Adjust and confirm the visual UI components to complete the UI component design; S25. Compile the designed UI component into a single component, generate a component HASH value and cache it.
4. The low-code engine page rendering method running on the browser side according to claim 1 is characterized in that: During the page rendering process, Service Worker is used to implement client data resource caching and offline rendering.
5. A low-code engine page rendering system based on the low-code engine page rendering method running on the browser side as described in any one of claims 1 to 4, characterized in that: include: Page metadata parsing module: used to obtain and parse page metadata from the server and convert it into the internal data structure of the browser; UI component design and compilation module: used to design and compile required UI components on the browser side according to page rendering requirements; Slot system: A common and consistent way to define, configure and manage the behavior of UI components during the design and compilation process; Step-by-step rendering module: It is used to render and display the page step by step based on the page metadata of the internal data structure using the compiled UI components, so as to obtain the rendered complete page.
6. The low-code engine page rendering system according to claim 5, characterized in that: The system also includes a client caching and offline rendering module based on Service Worker.
7. The low-code engine page rendering system according to claim 5, characterized in that: The slot system includes a slot definition module, a slot configuration module and a slot management module: The slot definition module is used to define available slots in a component, wherein the slots allow users to insert content or components, and multiple slots can be defined and used in the same component; Slot configuration module: used to provide configurable properties or options for slots, so that users can define the behavior of slots according to them; Slot management module: used to dynamically render slots in the slots of UI components based on the content or components provided by the user.
Citation Information
Patent Citations
Graphical programming method and device, electronic equipment and storage medium
CN112416330A
Application construction method, device and equipment and computer readable storage medium
CN114510231A
Page design method and device based on low-code visual component
CN114721632A
Method and device for developing modularized UI interaction component based on Web technology
CN115658046A
Front-end application construction method and device, medium and computing equipment
CN116431155A
