Page rendering method and device, equipment and storage medium
By obtaining and using page components and logical functions in the target storage pool, the problem of poor page rendering reusability in the prior art is solved, efficient reusing of page components and logical functions is achieved, and the page rendering process is simplified.
Patent Information
- Application Number
- CN202310848930.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-11
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2043-07-11
AI Technical Summary
In existing page rendering technology, page components and logical functions need to be written for each active template, and the process is complex and difficult to reuse.
By obtaining the template definition file of the target activity template, obtaining the element definition file of the element to be rendered, and obtaining page components and logical functions from the target storage pool. Based on these components and functions, the page configuration page is rendered, and multiple page types and pipeline functions are supported. Implementation of .
Improve the reusability of page components and logical functions, simplify the page rendering process, and improve development efficiency and maintainability.
Smart Images

Figure CN119311980A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a page rendering method, device, equipment and storage medium. Background Art
[0002] In the front-end development process, page rendering is an indispensable technology. For example, when a user visits a new page or jumps from the current page to a new page, the components required for page display need to be rendered to the new page.
[0003] In current page rendering technology, for each active template, it is necessary to write corresponding page components and logic functions, and the writing process is relatively complicated and difficult to reuse. Therefore, how to significantly improve the reusability of page components and logic functions is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In order to solve the above technical problems, an embodiment of the present disclosure provides a page rendering method.
[0005] In a first aspect, the present disclosure provides a page rendering method, the method comprising:
[0006] In response to a page rendering request for a target active template, obtaining a template definition file corresponding to the target active template; wherein the template definition file defines elements to be rendered;
[0007] Obtaining an element definition file corresponding to the element to be rendered in the template definition file; wherein the element to be rendered is composed of a page component and a logic function, and the page component and the logic function corresponding to the element to be rendered are defined in the element definition file;
[0008] Obtaining the page component and logic function corresponding to the element to be rendered from the target storage pool;
[0009] Based on the page components and logic functions corresponding to the elements to be rendered, the activity configuration page corresponding to the target activity template is rendered.
[0010] In an optional implementation manner, the element definition file defines page components and logic functions corresponding to multiple page types of the element to be rendered, the page rendering request carries the target page type, and obtaining the page components and logic functions corresponding to the element to be rendered from the target storage pool includes:
[0011] From the target storage pool, the page components and logic functions corresponding to the elements to be rendered are obtained for the target page type.
[0012] In an optional implementation manner, the template definition file further defines an active template route, and the method further includes:
[0013] Based on the activity template routing, generating routings of activity configuration pages of multiple page types corresponding to the target activity template;
[0014] Correspondingly, after rendering the activity configuration page corresponding to the target activity template based on the page component and logic function corresponding to the element to be rendered, the method further includes:
[0015] Registering the route of the activity configuration page to a front-end routing module; wherein the front-end routing module is used to control the display of the multiple types of activity configuration pages based on the route.
[0016] In an optional implementation manner, the method further includes:
[0017] Storing the pre-built page component carrying the component identifier in the target storage pool;
[0018] And / or, storing the logic function carrying the function identifier in the target storage pool.
[0019] In an optional implementation manner, the element definition file defines a component identifier and a function identifier corresponding to the element to be rendered, and the step of obtaining the page component and the logic function corresponding to the element to be rendered from the target storage pool includes:
[0020] According to the component identifier and function identifier corresponding to the element to be rendered defined in the element definition file, the page component and logic function corresponding to the element to be rendered are acquired from the target storage pool.
[0021] In an optional implementation, the first logic function in the target storage pool is implemented based on a pipeline function, the pipeline function includes a synchronous pipeline function or an asynchronous pipeline function, and the first logic function includes a data verification function, a data conversion function and / or a linkage verification function.
[0022] In an optional implementation manner, different elements to be rendered defined in the template definition file belong to the same or different workflow modules, and the workflow modules are abstracted based on the activity configuration process.
[0023] In a second aspect, the present disclosure provides a page rendering device, the device comprising:
[0024] A first acquisition module is used to obtain a template definition file corresponding to a target active template in response to a page rendering request for the target active template; wherein the template definition file defines elements to be rendered;
[0025] A second acquisition module is used to acquire an element definition file corresponding to the element to be rendered in the template definition file; wherein the element to be rendered is composed of a page component and a logic function, and the page component and the logic function corresponding to the element to be rendered are defined in the element definition file;
[0026] A third acquisition module is used to acquire the page component and logic function corresponding to the element to be rendered from the target storage pool;
[0027] The rendering module is used to render the activity configuration page corresponding to the target activity template based on the page components and logic functions corresponding to the elements to be rendered.
[0028] In a third aspect, the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device implements the above method.
[0029] In a fourth aspect, the present disclosure provides a page rendering device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.
[0030] In a fifth aspect, the present disclosure provides a computer program product, wherein the computer program product comprises a computer program / instructions, and the computer program / instructions implement the above method when executed by a processor.
[0031] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has at least the following advantages:
[0032] The disclosed embodiment provides a page rendering method, which, in response to a page rendering request for a target active template, obtains a template definition file corresponding to the target active template, wherein the template definition file defines an element to be rendered; obtains an element definition file corresponding to the element to be rendered in the template definition file; obtains page components and logic functions corresponding to the element to be rendered from a target storage pool, and renders an active configuration page corresponding to the target active template based on the page components and logic functions corresponding to the element to be rendered, wherein the element definition file defines the page components and logic functions corresponding to the element to be rendered. It can be seen that the disclosed embodiment can obtain page components and logic functions corresponding to the element to be rendered from the target storage pool based on the element to be rendered defined in the template definition file, thereby improving the reusability of page components and logic functions. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0035] Figure 1 A flow chart of a page rendering method provided by an embodiment of the present disclosure;
[0036] Figure 2 A schematic diagram of a target storage pool provided in an embodiment of the present disclosure;
[0037] Figure 3 A schematic diagram of a pipeline function provided in an embodiment of the present disclosure;
[0038] Figure 4 A form submission flow chart provided for an embodiment of the present disclosure;
[0039] Figure 5 A front-end architecture diagram provided for an embodiment of the present disclosure;
[0040] Figure 6 A schematic diagram of the structure of a page rendering device provided in an embodiment of the present disclosure;
[0041] Figure 7 A schematic diagram of the structure of a page rendering device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0042] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0043] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0044] In the front-end development process, page rendering is an indispensable technology. For example, when a user visits a new page or jumps from the current page to a new page, the components required for page display need to be rendered to the new page.
[0045] In current page rendering technology, for each activity configuration page, it is necessary to write corresponding page components and logic functions, and the writing process is relatively complicated and difficult to reuse. Therefore, how to significantly improve the reusability of page components and logic functions is a technical problem that needs to be solved urgently.
[0046] To this end, the embodiment of the present disclosure provides a page rendering method, which, in response to a page rendering request for a target active template, obtains a template definition file corresponding to the target active template, wherein the template definition file defines an element to be rendered; obtains an element definition file corresponding to the element to be rendered in the template definition file; obtains page components and logic functions corresponding to the element to be rendered from a target storage pool, and renders an activity configuration page corresponding to the target active template based on the page components and logic functions corresponding to the element to be rendered, wherein the element definition file defines the page components and logic functions corresponding to the element to be rendered. It can be seen that the embodiment of the present disclosure can obtain page components and logic functions corresponding to the element to be rendered from the target storage pool based on the element to be rendered defined in the template definition file, thereby improving the reusability of page components and logic functions.
[0047] Based on this, the present disclosure provides a page rendering method, referring to Figure 1 , is a flow chart of a page rendering method provided by an embodiment of the present disclosure, the method specifically comprising:
[0048] S101: In response to a page rendering request for a target active template, a template definition file corresponding to the target active template is obtained.
[0049] The template definition file defines elements to be rendered.
[0050] The page rendering method provided by the embodiments of the present disclosure may be applied to a client, for example, the client may include a client deployed on a smart phone, a client deployed on a tablet computer, etc.
[0051] In the disclosed embodiment, the target activity template may be a standardized template created in advance based on the activity information required to be configured for the target activity. The user may configure the activity information required for the target activity based on the target activity template, wherein the target activity may, for example, be an international e-commerce marketing activity, such as a coupon activity, discount activity, etc., and the activity information may, for example, be the activity time, activity scope, activity rules, etc. corresponding to the target activity.
[0052] In actual applications, when a user browses multiple activity templates displayed on the current page, a selection operation can be performed on a target activity template from the multiple activity templates. For example, when a coupon activity template is selected, a page rendering request for the target activity template is triggered to be sent to the user's client, where the target activity template can be any one of the multiple activity templates.
[0053] In the disclosed embodiment, when the client receives a page rendering request for a target activity, it can obtain the template definition file corresponding to the target activity template from local storage, or obtain the template definition file corresponding to the target activity template from cloud storage, wherein the template definition file can be used to describe the activity information required for the target activity corresponding to the target activity template.
[0054] In an optional implementation, the required activity information of the target activity corresponding to the target activity template can be described using a domain-specific language (DSL), wherein the DSL is a programming language or specification language that is easy for people to understand and can be interpreted and executed by computers, such as JSON, SQL, regular expressions, etc.
[0055] In the embodiment of the present disclosure, elements to be rendered may be defined in the template definition file corresponding to the target active template. Specifically, the elements to be rendered may be composed of page components and logic functions, wherein the page components refer to visual elements to be rendered and displayed, for example, they may include drop-down selection boxes, text input boxes, button controls, etc., and the logic functions may be used to describe the logical relationships and association relationships between multiple page components.
[0056] In an optional implementation, different elements to be rendered defined in the template definition file belong to the same or different workflow modules, wherein the workflow module can be abstracted based on the activity configuration process. For example, in the process of configuring a coupon activity, it is necessary to configure the name, time, scope, discount, etc. of the coupon activity.
[0057] Among them, the workflow module can include basic information of the activity, activity objects, activity scope, activity conditions, activity rules, activity display, etc.
[0058] S102: Obtain an element definition file corresponding to the element to be rendered in the template definition file.
[0059] The element to be rendered is composed of a page component and a logic function, and the page component and the logic function corresponding to the element to be rendered are defined in the element definition file.
[0060] In the disclosed embodiment, since the template definition file corresponding to the target active template defines the element to be rendered, during the process of running the template definition file, the element definition file corresponding to the element to be rendered can be obtained based on the element to be rendered defined in the template definition file.
[0061] In the embodiment of the present disclosure, the element definition file may be used to describe the display style or display relationship of the element to be rendered on the activity configuration page.
[0062] S103: Obtaining the page component and logic function corresponding to the element to be rendered from the target storage pool.
[0063] In the embodiment of the present disclosure, since the page components and logic functions corresponding to the elements to be rendered are defined in the element definition file, during the process of running the element definition file, the page components and logic functions corresponding to the elements to be rendered can be obtained from the target storage pool based on the page components and logic functions defined in the element definition file.
[0064] In an optional implementation, since the target storage pool can be used to store and read page components and logic functions corresponding to the elements to be rendered, in actual applications, the page components and / or logic functions can be stored in the target storage pool in advance, so that the page components and logic functions can be subsequently stored or read from the target storage pool based on the component identifier and function identifier. The specific storage or reading method will be described in detail in subsequent embodiments and will not be elaborated here.
[0065] In actual applications, the element definition file may also define page components and logic functions corresponding to various page types of the elements to be rendered. Therefore, based on the target page type carried in the page rendering request, the page components and logic functions corresponding to the elements to be rendered can be obtained from the target storage pool for the target page type. The page types may include list pages, form pages, detail pages and other page types.
[0066] For example, assuming that the target page type carried in the received page rendering request is a form page, the page components and logic functions corresponding to the form page type of the element to be rendered can be obtained from the target storage pool based on the form page type, so that the form page corresponding to the target active template can be rendered based on the page components and logic functions corresponding to the form page type.
[0067] S104: Rendering an activity configuration page corresponding to the target activity template based on the page components and logic functions corresponding to the elements to be rendered.
[0068] In the disclosed embodiment, the activity configuration page is used to configure the configuration information corresponding to the target activity template so that the target activity can be generated based on the configuration information later. The activity configuration page can be, for example, a form page, a list page, or a detail page.
[0069] In an optional implementation, after obtaining the page components and logic functions corresponding to the elements to be rendered, the activity configuration page corresponding to the target activity template may be rendered based on the template rendering engine.
[0070] In the page rendering method provided by the embodiment of the present disclosure, in response to a page rendering request for a target active template, a template definition file corresponding to the target active template is obtained, wherein the template definition file defines an element to be rendered; an element definition file corresponding to the element to be rendered in the template definition file is obtained; the page components and logic functions corresponding to the element to be rendered are obtained from the target storage pool, and based on the page components and logic functions corresponding to the element to be rendered, the active configuration page corresponding to the target active template is rendered, wherein the element definition file defines the page components and logic functions corresponding to the element to be rendered. It can be seen that the embodiment of the present disclosure can obtain the page components and logic functions corresponding to the element to be rendered from the target storage pool based on the element to be rendered defined in the template definition file, thereby improving the reusability of the page components and logic functions.
[0071] In an optional implementation, the element definition file may also define a component identifier and a function identifier corresponding to the element to be rendered, wherein the component identifier is a path that can read the corresponding page component, and the function identifier is a path that can read the corresponding logic function.
[0072] For example, assuming that the element definition file is named element, the element definition file element defines the component identifier corresponding to the element to be rendered, such as component, and the function identifier corresponding to the element to be rendered, such as effect; wherein the field component is used to describe the path corresponding to the page component (i.e., the component identifier), and the field effect is used to describe the path corresponding to the logic function (i.e., the function identifier).
[0073] In the embodiment of the present disclosure, the component identifier and function identifier corresponding to the element to be rendered are defined in the element definition file so that the page component corresponding to the component identifier can be obtained based on the component identifier, and the logical function corresponding to the function identifier can be obtained based on the function identifier.
[0074] In actual applications, after establishing the target storage pool, pre-built page components carrying component identifiers can also be stored in the target storage pool, and / or logic functions carrying function identifiers can be stored in the target storage pool, so that when the target active template is subsequently rendered, the page components and logic functions corresponding to the elements to be rendered can be directly obtained from the target storage pool, thereby improving the reusability of page components and logic functions.
[0075] like Figure 2As shown, it is a schematic diagram of a target storage pool provided by an embodiment of the present disclosure. In actual applications, the setExtemal function can be used to store page components or logic functions, wherein, when defining the setExtemal function, two parameters are declared in brackets, namely, the page component and the component identifier corresponding to the page component, or the logic function and the function identifier corresponding to the logic function, such as setExtemal("component identifier", page component).
[0076] In the disclosed embodiment, since the component identifier and logic function corresponding to the element to be rendered are defined in the element definition file, when the element definition file is run, the page component and logic function corresponding to the element to be rendered can be obtained from the target storage pool according to the component identifier and function identifier corresponding to the element to be rendered defined in the element definition file.
[0077] like Figure 2 As shown, the getExtemal function can be used to read the page component or logic function, wherein, when defining the getExtemal function, a parameter is declared in the brackets, namely, the component identifier or the function identifier, such as getExtemal("component identifier").
[0078] It can be seen that the embodiment of the present disclosure stores pre-built page components carrying component identifiers in the target storage pool, and / or stores logic functions carrying function identifiers in the target storage pool, so that when the element definition file corresponding to the element to be rendered in the template definition file is subsequently obtained, the page component and logic function corresponding to the element to be rendered can be obtained from the target storage pool according to the component identifier and function identifier corresponding to the element to be rendered defined in the element definition file, thereby solving the problem of difficult reuse of page components and logic functions in the page rendering process.
[0079] In practical applications, in order to further improve the reusability and testability of logic functions, the first logic function in the target storage pool can also be implemented based on the pipeline function, wherein the first logic function can be any logic function in the target storage pool.
[0080] Pipeline function is a common concept in functional programming. Pipeline function usually connects multiple functions in series, so as to pass a value as a parameter to the first function, and pass the return value of the first function as a parameter to the second function, and so on, to get a final return value. In the process of using functions to process parameters, if the return value of any function is an error, the execution of subsequent functions is terminated and an exception is thrown.
[0081] like Figure 3As shown, it is a schematic diagram of a pipeline function provided by an embodiment of the present disclosure. A specified parameter is input into the pipeline function. Function 1 first processes the parameter. If the return value 1 of function 1 is obtained, the return value 1 is passed to function 2. At this time, function 2 processes the return value 1. If the return value 2 of function 2 is obtained, the return value 2 is passed to function 3, and so on, to obtain the final return value, which is the output of the pipeline function.
[0082] The disclosed embodiment can utilize pipeline functions to connect multiple logic functions of the same type in series. Different logic functions can be configured for the differences between different tenants or effective regions, thereby achieving the effect of displaying different activity templates for different tenants or effective regions.
[0083] In the embodiment of the present disclosure, the pipeline function may include a synchronous pipeline function or an asynchronous pipeline function. The difference between the asynchronous pipeline function and the synchronous pipeline function is that the execution of each function in the asynchronous pipeline function is asynchronous.
[0084] In addition, the embodiment of the present disclosure utilizes a pipeline function to connect multiple logic functions in series, and when any logic function is added, deleted or replaced, the operation of other logic functions will not be affected.
[0085] In the disclosed embodiment, the first logic function may include a data verification function, a data conversion function and / or a linkage verification function; wherein the data verification function is used to verify the configuration information filled in on the activity configuration page, for example, to verify whether the basic information of the target activity, the activity object, etc. are empty, or to verify whether the activity range of the target activity is within the restricted range; the data conversion function is used to convert the currently filled in configuration information into information that meets the conditions, for example, to convert the filled in activity time into the target effective area, such as the corresponding time in Indonesia; the linkage verification function is used to verify the association between multiple configuration information, for example, after determining that the discount rate is 20%, when filling in the specific discount price, verify whether the specific discount price meets the above discount rate.
[0086] like Figure 4 As shown in the figure, it is a form submission flow chart based on pipeline function implementation provided by the embodiment of the present disclosure. Specifically, in the scenario where a form is submitted on the activity configuration page corresponding to the target activity template, the rendering engine automatically executes Figure 4 The process shown.
[0087] When the user clicks the Submit button, it is first determined whether the activity configuration page needs to be verified. If verification is required, each piece of information to be configured on the activity configuration page is verified, for example, whether the basic information of the target activity is empty, whether the scope of the target activity is within the restricted range, and if an error occurs in the information to be configured, an error prompt message is displayed on the activity configuration page to prompt the user to check or modify the information to be configured.
[0088] When the user clicks the Submit button, if it is determined that no verification is required, or no error occurs after the verification of the configuration information, data conversion can be performed based on pipeline function A and pipeline function B to achieve the function of obtaining the configuration information on the activity configuration page. Among them, pipeline function A can be used to pre-fill part of the configuration information into the activity configuration page. For example, when the user selects the tenant and the effective area, part of the information corresponding to the target activity can be pre-filled into the activity configuration page based on the context information injection method; pipeline function B can be used to receive the return value of pipeline function A, and receive the information filled in by the user for the activity configuration page.
[0089] It can be seen that the embodiment of the present disclosure can implement the first logic function in the target storage pool based on the pipeline function, thereby further improving the reusability and testability of the logic function. In addition, when adding, deleting or replacing any logic function, the impact on other logic functions can be reduced.
[0090] In actual applications, active template routes can also be defined in the template definition file. The active template routes are used to generate routes for active configuration pages of multiple page types corresponding to the target active template. For example, when a user triggers a display request for active configuration pages of multiple page types, routes for multiple types of active configuration pages corresponding to the target active template are generated based on the active template routes.
[0091] In the disclosed embodiment, routing refers to displaying different pages or contents according to different URL addresses. The task of corresponding different URL addresses to different contents or pages is completed by the front-end routing. Therefore, after rendering the activity configuration page corresponding to the target activity template based on the page components and logic functions corresponding to the elements to be rendered, the route of the activity configuration page also needs to be registered in the front-end routing module.
[0092] In the disclosed embodiment, the front-end routing module is used to control the display of multiple types of activity configuration pages based on the routing of the activity configuration page. That is, when receiving a user's switching operation between multiple pages corresponding to a target activity template, the front-end routing module can control the display of different types of activity configuration pages based on the routing of the activity configuration pages of multiple page types, for example, switching from a form page to a details page and displaying the details page.
[0093] It can be seen that the embodiment of the present disclosure can generate routes of activity configuration pages of multiple page types corresponding to the target activity based on the activity template routes defined in the template definition file, so that after the routes of the activity configuration pages are subsequently registered to the front-end routing module, the front-end routing module can control the display of multiple types of activity configuration pages based on the routes of the activity configuration pages.
[0094] Based on the above method embodiment, the present disclosure also provides a front-end architecture diagram for describing the process of rendering an activity configuration page corresponding to a target activity template based on a rendering element, such as Figure 5 As shown, it is an architecture diagram of the front end provided in the embodiment of the present disclosure.
[0095] The front-end architecture diagram includes a general layer, a bridge layer, a model layer, a business layer, and a presentation layer. The general layer includes multiple page components obtained based on page function classification, and multiple logic functions obtained based on function function classification.
[0096] The bridge layer is mainly used to bridge the general layer and the model layer. In practical applications, for example, based on the setExtemal function, the pre-built page components carrying component identifiers can be stored in the target storage pool, and / or the logic functions carrying function identifiers can be stored in the target storage pool, and based on the getExtemal function, the page components and logic functions corresponding to the elements to be rendered can be obtained from the target storage pool and passed to the model layer, thereby realizing the function of bridging the general layer and the model layer.
[0097] The model layer is mainly used to describe the template definition file corresponding to the target activity template, wherein the template definition file defines elements to be rendered, and different elements to be rendered belong to the same or different workflow modules. For example, under the basic information workflow module, the elements to be rendered include activity management, activity name and activity time.
[0098] The business layer is configured with multiple activity templates and rendering requests. For example, the activity templates may include coupon activity templates, subsidy activity templates, etc. The rendering engine is used to render the activity templates of the business layer to the presentation layer, which is the activity configuration page of the user's client.
[0099] It can be seen that the embodiments of the present disclosure can abstract the activity configuration process and redesign the front-end architecture, thereby providing a front-end architecture that is testable, highly maintainable, and easy to expand.
[0100] Based on the above method embodiment, the present disclosure also provides a page rendering device, referring to Figure 6 , is a schematic diagram of the structure of a page rendering device provided by an embodiment of the present disclosure, the device comprising:
[0101] The first acquisition module 601 is used to obtain a template definition file corresponding to the target active template in response to a page rendering request for the target active template; wherein the template definition file defines elements to be rendered;
[0102] The second acquisition module 602 is used to acquire an element definition file corresponding to the element to be rendered in the template definition file; wherein the element to be rendered is composed of a page component and a logic function, and the page component and the logic function corresponding to the element to be rendered are defined in the element definition file;
[0103] The third acquisition module 603 is used to acquire the page component and logic function corresponding to the element to be rendered from the target storage pool;
[0104] The rendering module 604 is used to render the activity configuration page corresponding to the target activity template based on the page components and logic functions corresponding to the elements to be rendered.
[0105] In an optional implementation manner, the element definition file defines page components and logic functions corresponding to a plurality of page types of the element to be rendered, the page rendering request carries the target page type, and the third acquisition module includes:
[0106] The first acquisition submodule is used to acquire, from the target storage pool, page components and logic functions corresponding to the elements to be rendered according to the target page type.
[0107] In an optional implementation manner, the template definition file further defines an active template route, and the device further includes:
[0108] A generating module, configured to generate, based on the activity template routing, routings of activity configuration pages of multiple page types corresponding to the target activity template;
[0109] A registration module is used to register the route of the activity configuration page to a front-end routing module; wherein the front-end routing module is used to control the display of the multiple types of activity configuration pages based on the route.
[0110] In an optional implementation, the device further includes:
[0111] A storage module, used for storing the pre-built page components carrying component identifiers into the target storage pool;
[0112] And / or, storing the logic function carrying the function identifier in the target storage pool.
[0113] In an optional implementation manner, the third acquisition module includes:
[0114] The second acquisition submodule is used to acquire the page component and logic function corresponding to the element to be rendered from the target storage pool according to the component identifier and function identifier corresponding to the element to be rendered defined in the element definition file.
[0115] In an optional implementation, the first logic function in the target storage pool is implemented based on a pipeline function, the pipeline function includes a synchronous pipeline function or an asynchronous pipeline function, and the first logic function includes a data verification function, a data conversion function and / or a linkage verification function.
[0116] In an optional implementation manner, different elements to be rendered defined in the template definition file belong to the same or different workflow modules, and the workflow modules are abstracted based on the activity configuration process.
[0117] In the page rendering device provided by the embodiment of the present disclosure, in response to a page rendering request for a target active template, a template definition file corresponding to the target active template is obtained, wherein the template definition file defines an element to be rendered; an element definition file corresponding to the element to be rendered in the template definition file is obtained; a page component and a logic function corresponding to the element to be rendered are obtained from a target storage pool, and based on the page component and the logic function corresponding to the element to be rendered, an activity configuration page corresponding to the target active template is rendered, wherein the element definition file defines the page component and the logic function corresponding to the element to be rendered. It can be seen that the embodiment of the present disclosure can obtain the page component and the logic function corresponding to the element to be rendered from the target storage pool based on the element to be rendered defined in the template definition file, thereby improving the reusability of the page component and the logic function.
[0118] In addition to the above-mentioned method and apparatus, the embodiments of the present disclosure further provide a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device implements the page rendering method described in the embodiments of the present disclosure.
[0119] The embodiment of the present disclosure further provides a computer program product, which includes a computer program / instruction. When the computer program / instruction is executed by a processor, the page rendering method described in the embodiment of the present disclosure is implemented.
[0120] In addition, the present disclosure also provides a page rendering device, see Figure 7 As shown, it may include:
[0121] Processor 701, memory 702, input device 703 and output device 704. The number of processors 701 in the page rendering device can be one or more. Figure 7In some embodiments of the present disclosure, the processor 701, the memory 702, the input device 703 and the output device 704 may be connected via a bus or other means, wherein: Figure 7 The example of connecting through bus is taken in the following.
[0122] The memory 702 can be used to store software programs and modules. The processor 701 executes various functional applications and data processing of the page rendering device by running the software programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The input device 703 may be used to receive input digital or character information, and to generate signal input related to user settings and function control of the page rendering device.
[0123] Specifically in this embodiment, the processor 701 will load the executable files corresponding to the processes of one or more applications into the memory 702 according to the following instructions, and the processor 701 will run the applications stored in the memory 702, thereby realizing various functions of the above-mentioned page rendering device.
[0124] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0125] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A page rendering method, characterized in that: The method comprises: In response to a page rendering request for a target active template, obtaining a template definition file corresponding to the target active template; wherein the template definition file defines elements to be rendered; Obtaining an element definition file corresponding to the element to be rendered in the template definition file; wherein the element to be rendered is composed of a page component and a logic function, and the page component and the logic function corresponding to the element to be rendered are defined in the element definition file; Obtaining the page component and logic function corresponding to the element to be rendered from the target storage pool; Based on the page components and logic functions corresponding to the elements to be rendered, the activity configuration page corresponding to the target activity template is rendered.
2. The method according to claim 1, characterized in that The element definition file defines page components and logic functions corresponding to multiple page types of the element to be rendered, the page rendering request carries the target page type, and the step of obtaining the page components and logic functions corresponding to the element to be rendered from the target storage pool includes: From the target storage pool, the page components and logic functions corresponding to the elements to be rendered are obtained for the target page type.
3. The method according to claim 1, characterized in that: The template definition file also defines an active template route, and the method further includes: Based on the activity template routing, generating routings of activity configuration pages of multiple page types corresponding to the target activity template; Correspondingly, after rendering the activity configuration page corresponding to the target activity template based on the page component and logic function corresponding to the element to be rendered, the method further includes: Registering the route of the activity configuration page to a front-end routing module; wherein the front-end routing module is used to control the display of the multiple types of activity configuration pages based on the route.
4. The method according to claim 1, characterized in that: The method further comprises: Storing the pre-built page component carrying the component identifier in the target storage pool; And / or, storing the logic function carrying the function identifier in the target storage pool.
5. The method according to claim 4, characterized in that The element definition file defines a component identifier and a function identifier corresponding to the element to be rendered, and the step of obtaining the page component and the logic function corresponding to the element to be rendered from the target storage pool includes: According to the component identifier and function identifier corresponding to the element to be rendered defined in the element definition file, the page component and logic function corresponding to the element to be rendered are acquired from the target storage pool.
6. The method according to claim 1, characterized in that The first logic function in the target storage pool is implemented based on a pipeline function, the pipeline function includes a synchronous pipeline function or an asynchronous pipeline function, and the first logic function includes a data verification function, a data conversion function and / or a linkage verification function.
7. The method according to claim 1, characterized in that Different elements to be rendered defined in the template definition file belong to the same or different workflow modules, and the workflow modules are abstracted based on the activity configuration process.
8. A page rendering device, characterized in that: The device comprises: A first acquisition module is used to obtain a template definition file corresponding to a target active template in response to a page rendering request for the target active template; wherein the template definition file defines elements to be rendered; A second acquisition module is used to acquire an element definition file corresponding to the element to be rendered in the template definition file; wherein the element to be rendered is composed of a page component and a logic function, and the page component and the logic function corresponding to the element to be rendered are defined in the element definition file; A third acquisition module is used to acquire the page component and logic function corresponding to the element to be rendered from the target storage pool; The rendering module is used to render the activity configuration page corresponding to the target activity template based on the page components and logic functions corresponding to the elements to be rendered.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device implements the method according to any one of claims 1 to 7.
10. A page rendering device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Page generation method and device, electronic equipment and storage medium
CN111124379A
Component access method, device and equipment
CN111475161A
Front-end page building method and device based on componentization, equipment and storage medium
CN113419729A
Form processing method and device, computer readable storage medium and electronic equipment
CN113742628A
Solution for customized UI of SAAS platform
CN114489614A