Method and device for generating front-end page
Through the low-code engine to identify and respond to variable changes, high-code components are notified to make changes, and data interoperability between low-code and high-code components is achieved, solving the problem of poor compatibility between low-code and high-code in the existing technology, and improving the front-end page flexibility.
Patent Information
- Application Number
- CN202411191013.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-06
AI Technical Summary
The existing protocol architecture for low-code engine parsing only supports simple high-code types, resulting in poor compatibility between low-code and high-code components, difficulty in responding to variable changes, and insufficient flexibility of front-end pages.
The low-code components in the front-end page are parsed through the low-code engine, identify changes in response variables, notify relevant high-code components to make changes, and render components through preset rendering modes to achieve data response interoperability between low-code and high-code, improving the front-end Page flexibility.
It realizes linkage between low-code and high-code components, improves the coding flexibility of front-end pages, solves the limitations of low-code and the technical isolation of high-code systems, and allows functional linkage between high- and low-code components.
Smart Images

Figure CN119088387A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of software development technology, and in particular to a method and device for generating a front-end page. Background Art
[0002] The existing code writing methods in web front-end development can be divided into two categories: high code, that is, pure coding mode to implement page functions, the advantage is very strong flexibility, but a large amount of coding; low code, that is, configuration to implement page functions, usually understood as configuring a page protocol architecture (schema), the advantage is less actual coding, but poor flexibility.
[0003] In existing software system engineering, the protocol architecture (schema) parsed by the low-code engine usually only supports simple high-code types (strings, numbers, Boolean types, etc.). When the variables under the low-code change, the logic related to the low-code in the high-code is difficult to respond, so the compatibility between the high and low code parts is very poor. Summary of the invention
[0004] The embodiments of the present application provide a method and device for generating a front-end page, which are used to integrate low-code components and high-code components in the front-end page, thereby improving the flexibility of generating the front-end page.
[0005] In a first aspect, an embodiment of the present application provides a method for generating a front-end page, comprising:
[0006] Parsing the first low-code component included in the first front-end page through the low-code engine to obtain a low-code response variable;
[0007] If the low-code engine identifies that the low-code response variable has changed, the high-code component in the first front-end page that has a dependency relationship with the low-code response variable is notified, so that the high-code response variable in the high-code component is changed; the dependency relationship is the dependency between the low-code response variable and the high-code response variable;
[0008] The changed first low-code component is rendered by the low-code engine, and the changed high-code component is rendered by a preset high-code rendering mode to obtain the changed first front-end page.
[0009] The response variable of the change in the low-code component is obtained through the parsing engine, and the high-code component that has a dependent relationship with the response variable is also changed, which opens up the intercommunication of low-code and high-code data responses and improves the flexibility of front-end page coding. It solves the limitations of low-code. It avoids the technical isolation brought to the high-code system by the traditional low-code component that must use string variable expressions.
[0010] If the low-code engine identifies that the high-code response variable has changed, the first low-code component is notified, thereby changing the low-code response variable;
[0011] The changed first low-code component is rendered by the low-code engine, and the changed high-code component is rendered by a preset high-code rendering mode to obtain the changed first front-end page.
[0012] The response variables of high code can directly affect the changes of low code components, better combine high code and low code, and achieve functional linkage between high code components and low code components. Therefore, whether it is an existing page written in high code or an undeveloped page, it is relatively easy to use the configuration capability to form a front-end page.
[0013] Optionally, parsing the first low-code component contained in the first front-end page by the low-code engine includes:
[0014] Obtain a first low-code definition file of a first low-code component included in the first front-end page;
[0015] The first low-code definition file is parsed by a parser in a low-code engine, and it is determined that conditional attribute parameters are set in the first low-code definition file; the conditional attribute parameters are used to indicate whether to render and display the first low-code component.
[0016] Optionally, parsing the first low-code definition file by a parser in the low-code engine includes:
[0017] The first low-code definition file is parsed by a parser in a low-code engine to obtain a parameter value of a type attribute parameter; the parameter value of the type attribute parameter includes any one of a string or a component;
[0018] The parameter value of the type attribute parameter is passed to the renderer in the low-code engine; the renderer is used to render the first low-code component.
[0019] Optionally, the first low-code definition file also includes slot attribute parameters;
[0020] The parsing of the first low-code definition file by a parser in the low-code engine includes:
[0021] If the format of the slot attribute parameter is a virtual node or a string, the slot attribute parameter is used as the parsing result;
[0022] If the format of the slot attribute parameter is a code definition type, the parameter value of the slot attribute parameter continues to be parsed until the format of the slot attribute parameter is a virtual node or a string.
[0023] Optionally, the parser in the low-code engine parses the first low-code definition file to obtain a low-code response variable, including:
[0024] The first low-code definition file is parsed by a parser in the low-code engine to obtain binding attribute parameters;
[0025] Through the template definition information in the first low-code definition file, determine whether there is a low-code response variable in the binding attribute parameter.
[0026] Optionally, a second low-code definition file is set in the second front-end page, and the first low-code component is referenced in the second low-code definition file.
[0027] Low-code components can be reused by calling them across front-end pages.
[0028] In a second aspect, an embodiment of the present application provides a front-end page generation device, including:
[0029] An acquisition module, used for parsing a first low-code component contained in a first front-end page through a low-code engine to obtain a low-code response variable;
[0030] A transfer module, for notifying a high-code component in the first front-end page that has a dependency relationship with the low-code response variable if the low-code engine identifies that the low-code response variable has changed, thereby changing the high-code response variable in the high-code component; the dependency relationship is the dependency between the low-code response variable and the high-code response variable;
[0031] A rendering module is used to render the changed first low-code component through the low-code engine, and to render the changed high-code component through a preset high-code rendering mode to obtain the changed first front-end page.
[0032] The response variable of the change in the low-code component is obtained through the parsing engine, and the high-code component that has a dependent relationship with the response variable is also changed, which opens up the intercommunication of low-code and high-code data responses and improves the flexibility of front-end page coding. It solves the limitations of low-code. It avoids the technical isolation brought to the high-code system by the traditional low-code component that must use string variable expressions.
[0033] Optionally, the rendering module is specifically used for:
[0034] If the low-code engine identifies that the high-code response variable has changed, the first low-code component is notified, thereby changing the low-code response variable;
[0035] The changed first low-code component is rendered by the low-code engine, and the changed high-code component is rendered by a preset high-code rendering mode to obtain the changed first front-end page.
[0036] The response variables of high code can directly affect the changes of low code components, better combine high code and low code, and achieve functional linkage between high code components and low code components. Therefore, whether it is an existing page written in high code or an undeveloped page, it is relatively easy to use the configuration capability to form a front-end page.
[0037] Optionally, the acquisition module is specifically used for:
[0038] Obtain a first low-code definition file of a first low-code component included in the first front-end page;
[0039] The first low-code definition file is parsed by a parser in a low-code engine, and it is determined that conditional attribute parameters are set in the first low-code definition file; the conditional attribute parameters are used to indicate whether to render and display the first low-code component.
[0040] Optionally, the acquisition module is specifically used for:
[0041] The first low-code definition file is parsed by a parser in a low-code engine to obtain a parameter value of a type attribute parameter; the parameter value of the type attribute parameter includes any one of a string or a component;
[0042] The parameter value of the type attribute parameter is passed to the renderer in the low-code engine; the renderer is used to render the first low-code component.
[0043] Optionally, the acquisition module is specifically used for:
[0044] The first low-code definition file also includes slot attribute parameters;
[0045] The parsing of the first low-code definition file by a parser in the low-code engine includes:
[0046] If the format of the slot attribute parameter is a virtual node or a string, the slot attribute parameter is used as the parsing result;
[0047] If the format of the slot attribute parameter is a code definition type, the parameter value of the slot attribute parameter continues to be parsed until the format of the slot attribute parameter is a virtual node or a string.
[0048] Optionally, the acquisition module is specifically used for:
[0049] The first low-code definition file is parsed by a parser in the low-code engine to obtain binding attribute parameters;
[0050] Through the template definition information in the first low-code definition file, determine whether there is a low-code response variable in the binding attribute parameter.
[0051] Optionally, the transmission module is specifically used for:
[0052] A second low-code definition file is set in the second front-end page, and the first low-code component is referenced in the second low-code definition file.
[0053] In a third aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes any of the front-end page generation methods described in the first aspect above.
[0054] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program executable by a computer device. When the program runs on the computer device, the computer device executes any method for generating a front-end page described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0056] Figure 1 A schematic diagram of a flow chart of a method for generating a front-end page provided in an embodiment of the present application;
[0057] Figure 2 A schematic diagram of a first front-end page provided in an embodiment of the present application;
[0058] Figure 3 A schematic diagram of a process for parsing slot attribute parameters (slots) provided in an embodiment of the present application;
[0059] Figure 4AA schematic diagram of a first front-end page A provided in an embodiment of the present application;
[0060] Figure 4B A schematic diagram of a second front-end page B provided in an embodiment of the present application;
[0061] Figure 5 A schematic diagram of a low-code engine architecture diagram provided for an embodiment of the present application;
[0062] Figure 6 A parsing flow chart of a low-code definition file parsed by a parser provided in an embodiment of the present application;
[0063] Figure 7 A schematic diagram of the structure of a device for generating a front-end page provided in an embodiment of the present application;
[0064] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solution and beneficial effects of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0066] For ease of understanding, the terms appearing in this application are explained below.
[0067] Schema: In this article, it is called a low-code definition file. The first and second are not specifically limited. Low-code definition files usually refer to the structural definition in the database, which defines the format and type of data storage, such as table columns, data types, indexes, etc. In more general software development, Schema can also refer to the specification of a data model or application programming interface (API), which defines the structure of data and the rules of interaction.
[0068] Component: It is an abstract data type of view + interaction logic, including HyperTextMarkup Language (HTML), Cascading Style Sheets (CSS) and JavaScript (JS) logic code snippets. Modern front-end pages are often composed of many components (such as list components, input box components, drop-down box components, etc.). The componentization of front-end code is conducive to the realization of cross-page function reuse.
[0069] Low-Code: is a software development methodology that allows developers to create applications using graphical interfaces, drag-and-drop components, model-driven logic, and pre-built templates without writing a lot of traditional code. The goal of this approach is to speed up the development process, lower the technical threshold, and enable non-professional developers to participate in application development.
[0070] Low-code components: Low-code components are pre-built modules for rapid application development with less coding effort. Low-code components can include user interface elements, business logic, data management, integration services, and more.
[0071] High-Code: A concept relative to "Low-Code". In the field of software development, high-code refers to the traditional manual coding method, that is, developers need to write a lot of code to implement the functions and logic of the application.
[0072] like Figure 1 The method for generating a front-end page provided by the present application is shown, which specifically includes the following steps:
[0073] Step S101: parse the first low-code component contained in the first front-end page through the low-code engine to obtain a low-code response variable.
[0074] Specifically, the first front-end page includes at least one first low-code component, and each first low-code component can define one or more low-code response variables. In the present application, the low-code engine supports response variables defined in different frameworks under any computer programming language (Javascript, abbreviated as JS). For example, the response variables under the Vue3 framework. It should be noted that the low-code engine of the present application is encapsulated in a RenderKit component. This makes the low-code engine lightweight and can be accessed with almost no modification, which can effectively reduce the probability of introducing low-code bugs.
[0075] Step S102: If the low-code engine identifies that a low-code response variable has changed, the high-code component in the first front-end page that has a dependency relationship with the low-code response variable is notified, thereby changing the high-code response variable in the high-code component; the dependency relationship is the dependency between the low-code response variable and the high-code response variable.
[0076] Specifically, the first front-end page may include a high-code component, in which a high-code response variable may be defined, and the high-code response variable may have a dependency relationship with one or more low-code response variables. The dependency relationship means that the value of the high-code response variable and the value of the low-code response variable can be transmitted and affect each other, thereby affecting the rendered content of the high-code component and the low-code component. The low-code engine monitors all low-code response variables of the first low-code component in the first front-end page. If any low-code response variable changes, the high-code response variable that has a dependency relationship with the low-code response variable is changed.
[0077] For example, if Figure 2 The first front-end page shown contains a low-code component (name input box) and a high-code component (button). There are dependent response variables in the low-code component and the high-code component. The input box after the name in the low-code component is defined as the response variable, and the response variable in the high-code is the button that controls the "Submit" response variable that has a dependent relationship with the low-code input box. When the input box is empty, that is, the value of the response variable is zero, the "Submit" button in the high-code component is disabled. When characters are entered into the input box, that is, the value of the response variable changes, the response variable in the low-code is non-empty, and the "Submit" button in the high-code component is activated and can be clicked.
[0078] Step S103, rendering the changed first low-code component through the low-code engine, and rendering the changed high-code component through the preset high-code rendering mode to obtain the changed first front-end page.
[0079] The response variable of the change in the low-code component is obtained through the parsing engine, and the high-code component that has a dependent relationship with the response variable is also changed, which opens up the intercommunication of low-code and high-code data responses and improves the flexibility of front-end page coding. It solves the limitations of low-code. It avoids the technical isolation brought to the high-code system by the traditional low-code component that must use string variable expressions.
[0080] Optionally, if the response variable in the high code is changed, the low-code component with the low-code response variable that has a dependency relationship with the high-code response variable will also be changed accordingly. If the low-code engine identifies that the high-code response variable has changed, the first low-code component is notified, so that the low-code response variable is changed; the changed first low-code component is rendered by the low-code engine, and the changed high-code component is rendered by the preset high-code rendering mode to obtain the changed first front-end page.
[0081] Specifically, Figure 2In the first front-end page shown, when the button corresponding to the response variable in the high-code component is prohibited from operation, the input box corresponding to the response variable in the low-code component is also prohibited, and input of content is prohibited. The low-code engine renders according to the changed first low-code component and high-code component to obtain the changed first front-end page. At this time, the input box of the low-code component in the first front-end page is inoperable, and the "Submit" button on the high-code component is gray, that is, in an inoperable state.
[0082] The response variables of high code can directly affect the changes of low code components, better combine high code and low code, and achieve the linkage of functions between high code components and low code components. Therefore, whether it is an existing page written in high code or an undeveloped page, it is relatively easy to use the configuration capability to form a front-end page.
[0083] In the above step S101, parsing the first low-code component contained in the first front-end page through the low-code engine includes: obtaining the first low-code definition file of the first low-code component contained in the first front-end page; parsing the first low-code definition file through the parser in the low-code engine, and determining that conditional attribute parameters are set in the first low-code definition file; the conditional attribute parameters are used to indicate whether to render and display the first low-code component.
[0084] Specifically, the first low-code definition file is a structural definition in the database, which defines the format and type of data storage. It can also refer to the specification of the data model or the Application Programming Interface (API), which defines the structure of the data and the rules of interaction. Therefore, some necessary attribute parameters and optional attribute parameters are configured in the first code definition file. The necessary attribute parameters are the attribute parameters that must be present to generate the first front-end page, and the optional attribute parameters are the attribute parameters for personalized display of the first front-end page.
[0085] In this embodiment, at least one low-code component is defined in the first low-code definition file. After these first low-code components are rendered, a first front-end page can be formed. The low-code engine parses and obtains the first low-code definition file, and parses the first low-code definition file. If the first low-code definition file includes conditional attribute parameters, the conditional attribute parameters can be expressed as if, which means that the first low-code component corresponding to the currently parsed level is rendered. Among them, it can be set that if the value of the conditional attribute parameter is a Boolean value (Booleans), the first low-code component corresponding to the currently parsed level is rendered.
[0086] If the first low-code definition file is parsed by the parser in the low-code engine, the parameter value of the type attribute parameter is obtained; the parameter value of the type attribute parameter includes any one of a string or a component; the parameter value of the type attribute parameter is passed to the renderer in the low-code engine; the renderer is used to render the first low-code component.
[0087] Specifically, if the first low-code definition file contains a type attribute parameter, the type attribute parameter can be recorded as type, and the first low-code component corresponding to the parameter value of the type attribute parameter can be passed to the renderer in the low-code engine to render the content corresponding to the type attribute parameter value. Among them, the type attribute parameter value includes the form of a string and a component. If the type attribute parameter value is a string, it means that the first low-code component is a native Hypertext Markup Language (HTML) tag or a component that is globally registered by the upper-level business code or a built-in component. Then, when the type attribute parameter value is a string, the parsing priority of the low-code parsing engine is as follows: the global component registered by the business system has the highest priority, the built-in component has a lower priority than the global component registered by the business system, and the component of the HTML native tag has a lower priority than the built-in component. If the type attribute parameter value is a component, it means that the component is a reference class component, which can be a call to a component in the first front-end page or a call to a component in other front-end pages on the system.
[0088] In order to solve the problem of nesting between components, the first low-code definition file also includes slot attribute parameters, which can be recorded as slots; if the format of the slot attribute parameters is a virtual node or a string, the slot attribute parameters are used as the parsing result; if the format of the slot attribute parameters is a code definition type, the parameter value of the slot attribute parameters continues to be parsed until the format of the slot attribute parameters is a virtual node or a string.
[0089] Specifically, Figure 3As shown, it is a flow chart of the parser in the low-code engine parsing the slot attribute parameters (slots) from the first low-code definition file (schema), judging the attributes of the slot attribute parameters, if the slot attribute parameter (slots) attribute is an array, then calling the slot parsing engine to continue parsing each item of the array, otherwise, directly use the parsed content of the current layer as the slot part of the component and pass it to the slot (slot) parsing engine. The slot attribute parameter received by the slot parsing engine needs to be a key-value pair, the key is a string, and the value can be: string, vnode, schema (that is, the schema structure required in this application), function (if the value of the slot attribute parameter is a function, the function will be executed first to obtain the return value). Therefore, before parsing, the slot parsing engine will determine whether the received content is a function. If it is a function, it is necessary to execute the function first to obtain the execution result. The slot parsing engine parses the execution result. If it is not a function, the slot parsing engine directly parses the obtained content. If the value of the slot attribute parameter is a virtual node (VNode) or a string, the value of the slot attribute parameter is directly returned and used as the content of the component; if the value of the slot attribute parameter is a schema, the slot parsing engine will pass the schema to the parser in the low-code engine for recursive parsing.
[0090] Optionally, the first low-code definition file also includes binding attribute parameters. The first low-code definition file is parsed by the parser in the low-code engine to obtain the binding attribute parameters, and the binding attribute parameters are recorded as bind; through the template definition information in the first low-code definition file, it is determined whether there are low-code response variables in the binding attribute parameters.
[0091] Specifically, when the parser in the low-code engine parses the first low-code definition file with binding attribute parameters, it will activate the internal responsive hijacking capability in the low-code engine, and the responsive hijacking capability will obtain each incoming low-code response variable from the template definition information in the first low-code definition file. If the low-code response variable has a high-code component with a dependency, the low-code response variable will collect the results of the high-code under the influence of the low-code response variable during the parsing phase of the parser, and also collect the results of the low-code under the influence of the low-code response variable. If the low-code response variable changes, the code components that depend on this variable in the high-code and low-code will be updated accordingly.
[0092] Optionally, the low-code component can be called across front-end pages to achieve the reuse of the low-code component. A second low-code definition file is set in the second front-end page, and the first low-code component is referenced in the second low-code definition file. Figure 4AThe first front-end page A is shown, which includes a first low-code component A, a first low-code component B, and a first high-code component C. Among them, the first low-code component A and the first low-code component B are arranged left and right in the first front-end page A.
[0093] like Figure 4B The second front-end page B shown, after calling the first low-code component A and the first low-code component B in the second low-code definition file corresponding to the second front-end page B, generates the second front-end page B in combination with the second high-code component D, and in the second front-end page B, the first low-code component A and the first low-code component B are arranged in the upper and lower positions on the left.
[0094] Optional, such as Figure 5 The low-code engine architecture diagram shown includes a low-code engine core (renderkit-core) and a low-code engine renderer (renderkit-render). The low-code engine core provides a parser, a response variable hijacker, and a component instance collector. Among them, the parser is used to parse the low-code definition file; the response variable hijacker is used to monitor the response variables and high-code response variables in the low-code component; the component instance collector is used to obtain the component content corresponding to each attribute parameter obtained after the parser is used to parse the low-code definition file. The component instance collector receives the content of at least one attribute parameter, and the component instance collector passes the content corresponding to these attribute parameters to the low-code renderer for rendering to obtain the corresponding component. Among them, if you want to update the component or combine high and low codes, the high code can be passed into the low-code engine in the form of a code definition file or in the form of traditional code, and parsed by the parser in the low-code engine. The process after parsing is the same as above, and will not be described in detail here.
[0095] Compared with traditional low-code engines, the low-code engine of this application allows the existing old system engineering to gradually introduce low-code capabilities at the granularity of components. In addition, the low-code engine of this application is encapsulated in a RenderKit component, which is lightweight and can be connected without almost any modification, which can effectively reduce the probability of bugs caused by the introduction of low-code.
[0096] In a possible embodiment, Figure 6The flowchart of the parser in the low-code engine parsing the low-code definition file shown is a schematic diagram, in which the low-code definition file specifically includes: conditional attribute parameter (if), binding attribute parameter (bind), type attribute parameter (type), function listening attribute parameter (on), slot attribute parameter (slots), and object attribute parameter (ref). In this embodiment, it is determined that the parser in the low-code engine parses the low-code definition file containing the conditional attribute parameter (if), which means that the first low-code component corresponding to the currently parsed level is rendered. The contents parsed by the parser in the low-code engine for the function listening attribute parameter (on), slot attribute parameter (slots), and object attribute parameter (ref) are respectively passed to the component corresponding to the type attribute parameter (type), and finally the low-code engine renderer is used to render the component corresponding to each type attribute parameter (type) to obtain the front-end page. It is also necessary to explain that during the parsing process of the binding attribute parameters (bind), it is also necessary to determine in the low-code definition file whether there is a response variable in the binding attribute parameters. If there is a response variable, obtain the definition fields of the get function and set function of the template definition information (customerRef). The get function definition field will collect the effect of the corresponding data that has a dependency relationship with the response variable, and the set function definition field will trigger the effect collected by the get function.
[0097] It should be noted that the type attribute parameter (type) is a required attribute parameter in each low-code definition file, and other attribute parameters are optional attribute parameters in each low-code definition file. In some other application scenarios, other attribute parameters can be added to the low-code definition file according to actual needs. This will not be repeated in this application.
[0098] The present application embodiment provides a front-end page generation device, the structure diagram of which is as follows: Figure 7 As shown, the device 700 includes:
[0099] An acquisition module 701 is used to parse the first low-code component contained in the first front-end page through a low-code engine to obtain a low-code response variable;
[0100] The transmission module 702 is used for notifying the high-code component in the first front-end page that has a dependency relationship with the low-code response variable if the low-code engine recognizes that the low-code response variable has changed, thereby changing the high-code response variable in the high-code component; the dependency relationship is the dependency between the low-code response variable and the high-code response variable;
[0101] The rendering module 703 is used to render the changed first low-code component through the low-code engine, and to render the changed high-code component through a preset high-code rendering mode to obtain the changed first front-end page.
[0102] The response variable of the change in the low-code component is obtained through the parsing engine, and the high-code component that has a dependent relationship with the response variable is also changed, which opens up the intercommunication of low-code and high-code data responses and improves the flexibility of front-end page coding. It solves the limitations of low-code. It avoids the technical isolation brought to the high-code system by the traditional low-code component that must use string variable expressions.
[0103] Optionally, the rendering module 703 is specifically used for:
[0104] If the low-code engine identifies that the high-code response variable has changed, the first low-code component is notified, thereby changing the low-code response variable;
[0105] The changed first low-code component is rendered by the low-code engine, and the changed high-code component is rendered by a preset high-code rendering mode to obtain the changed first front-end page.
[0106] Optionally, the acquisition module 701 is specifically used for:
[0107] Obtain a first low-code definition file of a first low-code component included in the first front-end page;
[0108] The first low-code definition file is parsed by a parser in a low-code engine, and it is determined that conditional attribute parameters are set in the first low-code definition file; the conditional attribute parameters are used to indicate whether to render and display the first low-code component.
[0109] Optionally, the acquisition module 701 is specifically used for:
[0110] The first low-code definition file is parsed by a parser in a low-code engine to obtain a parameter value of a type attribute parameter; the parameter value of the type attribute parameter includes any one of a string or a component;
[0111] The parameter value of the type attribute parameter is passed to the renderer in the low-code engine; the renderer is used to render the first low-code component.
[0112] Optionally, the acquisition module 701 is specifically used for:
[0113] The first low-code definition file also includes slot attribute parameters;
[0114] The parsing of the first low-code definition file by a parser in the low-code engine includes:
[0115] If the format of the slot attribute parameter is a virtual node or a string, the slot attribute parameter is used as the parsing result;
[0116] If the format of the slot attribute parameter is a code definition type, the parameter value of the slot attribute parameter continues to be parsed until the format of the slot attribute parameter is a virtual node or a string.
[0117] Optionally, the acquisition module 701 is specifically used for:
[0118] The first low-code definition file is parsed by a parser in the low-code engine to obtain binding attribute parameters;
[0119] Through the template definition information in the first low-code definition file, determine whether there is a low-code response variable in the binding attribute parameter.
[0120] Optionally, the transmission module 702 is specifically used for:
[0121] A second low-code definition file is set in the second front-end page, and the first low-code component is referenced in the second low-code definition file.
[0122] Based on the same technical concept, the embodiment of the present application provides a computer device, such as Figure 8 As shown, it includes at least one processor 801 and a memory 802 connected to the at least one processor. The specific connection medium between the processor 801 and the memory 802 is not limited in the embodiment of the present application. Figure 8 For example, the processor 801 and the memory 802 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0123] In the embodiment of the present application, the memory 802 stores instructions that can be executed by at least one processor 801, and the at least one processor 801 can execute the steps of the above-mentioned front-end page generation method by executing the instructions stored in the memory 802.
[0124] Among them, the processor 801 is the control center of the computer device, and various interfaces and lines can be used to connect various parts of the computer device. By running or executing instructions stored in the memory 802 and calling data stored in the memory 802, the changed first low-code component is rendered to obtain the changed first front-end page. Optionally, the processor 801 may include one or more processing units, and the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application program, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801. In some embodiments, the processor 801 and the memory 802 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.
[0125] Processor 801 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.
[0126] The memory 802 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 802 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (RandomAccess Memory, RAM), a static random access memory (Static RandomAccess Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 802 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer device, but is not limited thereto. The memory 802 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0127] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program that can be executed by a computer device. When the program runs on the computer device, the computer device executes the steps of the above-mentioned front-end page generation method.
[0128] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0129] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0130] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0131] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0132] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0133] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for generating a front-end page, characterized in that: include: Parsing the first low-code component included in the first front-end page through the low-code engine to obtain a low-code response variable; If the low-code engine identifies that the low-code response variable has changed, the high-code component in the first front-end page that has a dependency on the low-code response variable is notified, thereby changing the high-code response variable in the high-code component; The dependency relationship is the dependency between the low-code response variable and the high-code response variable; The changed first low-code component is rendered by the low-code engine, and the changed high-code component is rendered by a preset high-code rendering mode to obtain the changed first front-end page.
2. The method according to claim 1, characterized in that The method further comprises: If the low-code engine identifies that the high-code response variable has changed, the first low-code component is notified, thereby changing the low-code response variable; The changed first low-code component is rendered by the low-code engine, and the changed high-code component is rendered by a preset high-code rendering mode to obtain the changed first front-end page.
3. The method according to claim 1, characterized in that The step of parsing the first low-code component contained in the first front-end page by using the low-code engine includes: Obtain a first low-code definition file of a first low-code component included in the first front-end page; The first low-code definition file is parsed by a parser in a low-code engine, and it is determined that conditional attribute parameters are set in the first low-code definition file; the conditional attribute parameters are used to indicate whether to render and display the first low-code component.
4. The method according to claim 3, characterized in that The parsing of the first low-code definition file by a parser in the low-code engine includes: The first low-code definition file is parsed by a parser in a low-code engine to obtain a parameter value of a type attribute parameter; the parameter value of the type attribute parameter includes any one of a string or a component; The parameter value of the type attribute parameter is passed to the renderer in the low-code engine; the renderer is used to render the first low-code component.
5. The method according to claim 3, characterized in that The first low-code definition file also includes slot attribute parameters; The parsing of the first low-code definition file by a parser in the low-code engine includes: If the format of the slot attribute parameter is a virtual node or a string, the slot attribute parameter is used as the parsing result; If the format of the slot attribute parameter is a code definition type, the parameter value of the slot attribute parameter continues to be parsed until the format of the slot attribute parameter is a virtual node or a string.
6. The method according to claim 3, characterized in that The parser in the low-code engine parses the first low-code definition file to obtain a low-code response variable, including: The first low-code definition file is parsed by a parser in the low-code engine to obtain binding attribute parameters; Through the template definition information in the first low-code definition file, determine whether there is a low-code response variable in the binding attribute parameter.
7. The method according to any one of claims 3 to 6, characterized in that: Also includes: A second low-code definition file is set in the second front-end page, and the first low-code component is referenced in the second low-code definition file.
8. A front-end page generation device, characterized in that: include: An acquisition module, used for parsing a first low-code component contained in a first front-end page through a low-code engine to obtain a low-code response variable; A transmission module, for notifying a high-code component in the first front-end page that has a dependency relationship with the low-code response variable if the low-code engine identifies that the low-code response variable has changed, thereby changing the high-code response variable in the high-code component; The dependency relationship is the dependency between the low-code response variable and the high-code response variable; A rendering module is used to render the changed first low-code component through the low-code engine, and to render the changed high-code component through a preset high-code rendering mode to obtain the changed first front-end page.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of any one of the methods of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: It stores a computer program executable by a computer device. When the program is run on the computer device, the computer device executes the steps of any method described in claims 1 to 7.
