A method and system for dynamically generating a client native page
Through a tree structure, the page layout and resources are stored, combined with Redis cache, and the client native pages are dynamically generated, which solves the problems of redundancy and difficulty in page configuration, and realizes flexible page display and efficient service performance.
Patent Information
- Application Number
- CN202211196654.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-09-29
AI Technical Summary
In the prior art, the back-end configuration of the page module cannot be iterated quickly, resulting in the problem of redundancy and difficulty in expanding the page configuration. Especially when different page structures are similar but differentiated, dynamic display and flexible configuration cannot be achieved.
The page layout and resources are stored in a tree structure, the hot data is cached through Redis cache, the configuration granularity is refined to the row level, and the client native page is dynamically generated using page layout rules, resource information tables and display rules tables, and differentiated displays are performed based on user status and channel information.
It realizes flexibility and editability of page configuration, reduces the number of page configurations, improves service performance, and supports rapid iteration and expansion.
Smart Images

Figure CN115495077B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of client native page generation, and in particular to a method and system for dynamically generating client native pages. Background Art
[0002] For the implementation solutions that support backend configuration for some page modules, if it is necessary to modify the parts of the page that do not support configuration, it is necessary to rely on the front-end release, which is not conducive to rapid iteration. In addition, for the pages completely generated by backend configuration, in the case where different page structures are the same but there are some differences in content, multiple sets of templates or even multiple pages are configured to implement, resulting in problems such as many configured pages, redundant configuration, and cumbersome operations for operators. With the increase in the number of subdivided pages in business scenarios, new page configurations need to be added, and there will be problems with difficult expansion.
[0003] In daily business systems, some systems only support backend configuration for the parts that often change, and other parts rely on front-end generation. Most systems configure the overall page through the backend. If there are multiple pages, usually multiple pages are configured. However, for multiple pages with roughly the same structure and some differences, it is impossible to achieve differential configuration and dynamic display of multiple pages with a single page configuration template. Summary of the Invention
[0004] To solve the deficiencies of the prior art, the present invention proposes a method and system for dynamically generating client native pages, which can dynamically generate app pages, use Redis cache to cache hot data, and improve service performance.
[0005] To achieve the above objectives, the technical solutions adopted by the present invention include:
[0006] A method for dynamically generating client native pages, characterized by including:
[0007] S1. Establish page layout rules according to page types;
[0008] S2. Decompose the page layout into several page components according to the page layout rules, and decompose the page components into several display rows; define the overall structure of the page layout through a tree structure, generate a first-level sub-node for each page component, generate a second-level sub-node for each display row, and configure a page layout table; the page layout table includes: node encoding; the node encoding includes a first-level node encoding and a second-level node encoding;
[0009] Configure a resource information table according to preset resource information; the resource information table includes: resource encoding and resource content;
[0010] Configure the node resource relationship table according to the mapping relationship between nodes and resources; the node resource relationship table includes: resource encoding and node encoding;
[0011] Configure the resource display rule table, including resource encoding and rule expression;
[0012] S3. Obtain the request message, which includes: page type, user status information, and user channel information;
[0013] S4. According to the correspondence between the page type and the page layout rule, find the page layout table corresponding to the page type;
[0014] S5. Find all the nodes of the page according to the page layout table and obtain the node encoding; S6. Through the node resource relationship table, find the resource encoding corresponding to the node;
[0015] S7. Find the rule expression of the resource display rule table through the resource encoding;
[0016] S8. Determine whether the user status information and the user channel information conform to the rule expression;
[0017] S9. If it conforms to the rule expression, then according to the correspondence between the resource encoding and the resource content, find the resource content in the resource information table;
[0018] S10. Display the resource content corresponding to the secondary node in the page component, and display the resource content corresponding to the primary node in the page layout to generate a page.
[0019] Further, the page layout table further includes: node name, resource type, and maximum number of mounted resources.
[0020] Further, the resource information table includes: resource type, resource title, jump address, and picture address.
[0021] The present invention also relates to a system for dynamically generating a client native page, characterized in that it includes:
[0022] A page layout rule establishment module for establishing page layout rules according to the page type;
[0023] A configuration module for decomposing the page layout into several page components according to the page layout rules, decomposing the page components into several display rows; defining the overall structure of the page layout through a tree structure, generating a primary sub-node for each page component, generating a secondary sub-node for each display row, and configuring the page layout table; the page layout table includes: node encoding;
[0024] Configure the resource information table according to the preset resource information; the resource information table includes: resource encoding and resource content;
[0025] Configure a node resource relationship table according to the mapping relationship between nodes and resources; the node resource relationship table includes: resource codes and node codes;
[0026] Configure a resource display rule table, including resource codes and rule expressions;
[0027] A request message acquisition module, configured to acquire a request message, where the request message includes: page type, user status information, and user channel information;
[0028] A search module, configured to search for a page layout table corresponding to the page type according to the correspondence between the page type and the page layout rule;
[0029] Search for all nodes of the page according to the page layout table, and obtain node codes; the node codes include primary node codes and secondary node codes;
[0030] Search for the resource code corresponding to the node through the node resource relationship table;
[0031] Search for the rule expression of the resource display rule table through the resource code;
[0032] If it conforms to the rule expression, search for the resource content in the resource information table according to the correspondence between the resource code and the resource content;
[0033] A judgment module, configured to judge whether the user status information and the user channel information conform to the rule expression;
[0034] A page generation module, configured to display the resource content corresponding to the secondary node in the page component part, and display the resource content corresponding to the primary node in the page layout to generate a page.
[0035] The present invention also relates to a computer-readable storage medium, characterized in that a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method for dynamically generating a client native page described above is implemented.
[0036] The present invention also relates to an electronic device, characterized in that it includes a processor and a memory;
[0037] The memory is used to store the page layout table, the resource information table, the node resource relationship table, and the resource display rule table;
[0038] The processor is configured to execute the method for dynamically generating a client native page described above by calling the page layout table, the resource information table, the node resource relationship table, and the resource display rule table.
[0039] The present invention also relates to a computer program product, including a computer program and / or instructions, characterized in that when the computer program and / or instructions are executed by a processor, the steps of the method for dynamically generating a client native page described above are implemented.
[0040] The beneficial effects of the present invention are as follows:
[0041] By adopting the method and system for dynamically generating a client native page according to the present invention, page configuration can be achieved through backend configuration, the configuration granularity can be refined to the row level and below, multiple pages with partial differences can be summarized into one page configuration, and the differences are combined through rules, reducing page configuration, facilitating future expansion and maintenance, and reducing the app release. The method and system for dynamically generating a client native page according to the present invention can dynamically generate app pages, use Redis cache for caching hot data, and improve service performance. The app page layout and resources are stored in a tree structure, and the configuration granularity is refined to the row level and below, which is extremely flexible and editable. Description of the Drawings
[0042] Figure 1 It is a schematic flowchart of the method for dynamically generating a client native page according to the present invention.
[0043] Figure 2 It is a schematic structural diagram of the system for dynamically generating a client native page according to the present invention. Detailed Embodiments
[0044] For a clearer understanding of the content of the present invention, it will be described in detail in conjunction with the drawings and embodiments.
[0045] The method steps of the first aspect of the present invention for dynamically generating a client native page are as Figure 1 shown in the method, including:
[0046] The page is divided into multiple page components according to the structure, abstracted into layout and resources. The page layout is stored in a tree structure. Resources are the elements of each row of the page to be displayed. There is a one-to-many mapping between the nodes of the layout and the resources. According to different conditions such as status and channel, a resource display rule table is configured, and the resources are screened according to the resource rules to obtain the node display resources that meet the conditions. The data configuration includes a page layout rule table, a page layout table, a node resource relationship table, a resource information table, and a resource rule table.
[0047] S1. Establish a page layout rule according to the page type;
[0048] In this embodiment, the page type is the home page, and the page layout rule is to decompose the page layout into four page components, namely, notification, card, grid, and carousel.
[0049] The display logic of the page components is relatively complex and is related to the user status and channels. Depending on the user status, channels, etc., there are subtle differences in copywriting, jumps, number of lines, etc. in the page card area.
[0050] S2. Decompose the page layout into several page components according to the page layout rules, and decompose the page components into several display lines; define the overall structure of the page layout through a tree structure, generate a first-level sub-node for each page component, generate a second-level sub-node for each display line, and configure the page layout table; the page layout table includes: node code;
[0051] Configure the resource information table according to the preset resource information; the resource information table includes: resource code and resource content;
[0052] Configure the node-resource relationship table according to the mapping relationship between nodes and resources; the node-resource relationship table includes: resource code and node code;
[0053] Configure the resource display rule table, including resource code and rule expression;
[0054] Decompose the notification page component into one display line; set the maximum mount number to one; decompose the card page component into five display lines; set the maximum mount number to one; decompose the grid page component into one display line; set the maximum mount number to two; decompose the carousel page component into one display line; set the maximum mount number to two.
[0055] Define the overall structure of the page layout through a tree structure, generate a first-level sub-node for each page component, and generate a second-level sub-node for each display line.
[0056] The four page components of notification, card, grid, and carousel are respectively first-level sub-nodes. The notification first-level sub-node has one second-level sub-node; the card first-level sub-node has five second-level sub-nodes; the grid first-level sub-node has one second-level sub-node; the carousel first-level sub-node has one second-level sub-node.
[0057] Configure the page layout table; the page layout table includes: node code, node name, resource type, first-level sub-node code, second-level sub-node code, maximum number of mounted resources.
[0058] Page layout table: Define the tree structure node information of the layout, as well as the parent node and right sibling node ids and the number of resources mounted on the node. As shown in the following figure, the overall page structure is a tree structure, and some configurations are omitted.
[0059] Configure the resource information table according to the preset resource information; the resource information table includes: resource code, resource content, resource type, resource title, jump address, and image address.
[0060] Resource Information Table: Defines the title, content, corner mark, jump address, image address, supported version number, extended information, etc. of the resources displayed in each row. card-Line1_1, card-Line1_2, card-Line1_3, and card-Line1_4 are the configurations of the first row of the card module in different states. According to different user states, the first row displayed is one of the four configurations.
[0061] Configure the node-resource relationship table according to the mapping relationship between nodes and resources; the node-resource relationship table includes: resource code and node code;
[0062] Node-Resource Relationship Table: Defines the one-to-many relationship between nodes and resources, and the priority display order of the resources under the nodes.
[0063] Configure the resource display rule table, including resource code and rule expression;
[0064] Resource Display Rule Table: Defines the resource display rule table, and determines whether the resource is displayed according to different conditions. The rule uses the el expression, which is convenient for future page subdivision and page condition expansion.
[0065] S3. Obtain the request message, and the request message includes: page type, user status information, and user channel information;
[0066] User status has multiple situations such as new user, breakpoint user, credit failure in the confinement period, credit failure after the confinement period, credit success with normal quota status user, quota expired user, credit confinement period user, overdue user, etc.
[0067] Depending on the status and source channel of the user, the content of the card page copywriting, whether the button is displayed, the button copywriting, the tip prompt, etc. are all different.
[0068] S4. According to the corresponding relationship between the page type and the page layout rule, find the page layout table corresponding to the page type;
[0069] S5. Find all the nodes of the page according to the page layout table, and obtain the node code; the node code includes the first-level node code and the second-level node code;
[0070] S6. Through the node-resource relationship table, find the resource code corresponding to the node;
[0071] S7. Find the rule expression of the resource display rule table through the resource code;
[0072] S8. Determine whether the user status information and the user channel information conform to the rule expression;
[0073] S9. If it conforms to the regular expression, look up the resource content in the resource information table according to the correspondence between the resource code and the resource content;
[0074] S10. Display the resource content corresponding to the secondary node in the page components, and display the resource content corresponding to the primary node in the page layout to generate a page.
[0075] Match different layouts according to different front-end requested page identifiers, traverse each node of the layout tree, query the resources corresponding to the node and sort them according to the priority, and filter and screen according to the front-end uploaded conditions (user status, channel, etc.) through the resource rules to match the resources that meet the rules and do not exceed the maximum node mounting capacity under the node.
[0076] That is, combine different user conditions (status, channel source, etc.) with each other, configure the corresponding row resource rules using the resource rule el expression (such as (#status=1||#status=2)&channel=2) to achieve the purpose of screening out row resources. Combine the resources into a json format page template according to the layout tree structure and output it to the front-end, and replace the template variables with the user data pre-query by the front-end and perform page rendering.
[0077] That is, when the App enters the native page, first display the skeleton diagram by default, then call the server interface to obtain user-related information and business status, then call the server page dynamic generation interface to obtain the content to be displayed, the server matches the page layout according to the page identifier, traverses the layout structure, searches for row resource configurations according to the layout nodes, and filters the resources according to the user conditions, combines the resources according to the layout, dynamically generates the page content, returns it to the front-end, and the front-end then replaces the user information variables and performs page rendering according to the content returned by the server.
[0078] Use redis cache to cache hot data such as layout, resources, node resource mapping, resource rules, and page layout rules to improve service performance.
[0079] Another aspect of the present invention also relates to a system for dynamically generating a client native page, the structure of which is as Figure 2 shown, including:
[0080] A page layout rule establishment module for establishing page layout rules according to the page type;
[0081] A configuration module for decomposing the page layout into several page components according to the page layout rules, and decomposing the page components into several display rows; defining the overall structure of the page layout through a tree structure, generating a primary sub-node for each page component, generating a secondary sub-node for each display row, and configuring the page layout table; the page layout table includes: node code;
[0082] Configure a resource information table according to preset resource information; the resource information table includes: a resource code and resource content;
[0083] Configure a node-resource relationship table according to the mapping relationship between nodes and resources; the node-resource relationship table includes: a resource code and a node code;
[0084] Configure a resource display rule, including a resource code and a rule expression;
[0085] A request message acquisition module, configured to acquire a request message, where the request message includes: a page type, user status information, and user channel information;
[0086] A search module, configured to search for a page layout table corresponding to a page type according to the correspondence between the page type and the page layout rule;
[0087] Search for all nodes of a page according to the page layout table, and obtain node codes; the node codes include a primary node code and a secondary node code;
[0088] Search for a resource code corresponding to a node through the node-resource relationship table;
[0089] Search for a rule expression of a resource display rule through the resource code;
[0090] If the rule expression is met, search for resource content in the resource information table according to the correspondence between the resource code and the resource content;
[0091] A judgment module, configured to judge whether the user status information and the user channel information meet the rule expression;
[0092] A page generation module, configured to display the resource content corresponding to the secondary node in the page component, and display the resource content corresponding to the primary node in the page layout to generate a page.
[0093] By using this system, the above arithmetic processing method can be executed and the corresponding technical effects can be achieved.
[0094] An embodiment of the present invention further provides a computer-readable storage medium capable of implementing all steps in the method in the above embodiment. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, all steps in the method in the above embodiment are implemented.
[0095] An embodiment of the present invention further provides an electronic device for executing the above method. As an implementation device of the method, the electronic device at least includes a processor and a memory. In particular, the memory stores data and related computer programs required for executing the method, such as a page layout table, a resource information table, a node resource relationship table, and a resource display rule, etc. And all steps of the method are implemented by the processor calling the data and programs in the memory, and corresponding technical effects are obtained.
[0096] Preferably, the electronic device may include a bus architecture. The bus may include any number of interconnected buses and bridges, and the bus links various circuits including one or more processors and memories together. The bus may also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, etc. These are well known in the art, so they will not be further described herein. The bus interface provides an interface between the bus and the receiver and the transmitter. The receiver and the transmitter may be the same element, i.e., a transceiver, which provides a unit for communicating with various other systems on the transmission medium. The processor is responsible for managing the bus and general processing, and the memory may be used to store data used by the processor when executing operations.
[0097] Additionally, the electronic device may further include components such as a communication module, an input unit, an audio processor, a display, a power supply, etc. The processor (or controller, operation control) employed therein may include a microprocessor or other processor devices and / or logic devices, which receives inputs and controls the operations of various components of the electronic device; the memory may be one or more of a buffer, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices, capable of storing the above-mentioned relevant data information, and may also store programs for executing relevant information, and the processor may execute the programs stored in the memory to achieve information storage or processing, etc.; the input unit is used to provide inputs to the processor, for example, it may be a key or a touch input device; the power supply is used to supply power to the electronic device; the display is used to display display objects such as images and texts, for example, it may be an LCD display. The communication module is a transmitter / receiver that transmits and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal. Based on different communication technologies, multiple communication modules may be provided in the same electronic device, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module, etc. The communication module (transmitter / receiver) is also coupled to the speaker and the microphone via the audio processor to provide audio output via the speaker and receive audio input from the microphone, thereby implementing the usual telecommunication functions. The audio processor may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor is also coupled to the central processor, so that recording can be performed on the local machine through the microphone, and the sound stored on the local machine can be played through the speaker.
[0098] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.
[0099] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device generate a system for implementing the functions specified in one or more of the flows Figure 1 one or more flows and / or blocks Figure 1 or a plurality of blocks.
[0100] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction system that implements the functions specified in one or more of the flows Figure 1 one or more flows and / or blocks Figure 1 or a plurality of blocks.
[0101] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more of the flows Figure 1 one or more flows and / or blocks Figure 1 or a plurality of blocks. Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be construed to include the preferred embodiments and all changes and modifications falling within the scope of the present invention.
[0102] The above is only the preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A method for dynamically generating a client native page, characterized in that, Including: S1. Establish page layout rules according to the page type; S2. Decompose the page layout into several page components according to the page layout rules, and decompose the page components into several display rows; Define the overall structure of the page layout through a tree structure, generate a first-level child node for each page component, generate a second-level child node for each display row, and configure the page layout table; The page layout table includes: node encoding; The node encoding includes a first-level node encoding and a second-level node encoding; Configure the resource information table according to the preset resource information; The resource information table includes: resource encoding and resource content; Configure the node-resource relationship table according to the mapping relationship between nodes and resources; The node-resource relationship table includes: resource encoding and node encoding; Configure the resource display rule table, including resource encoding and rule expression; S3. Obtain a request message, which includes: page type, user status information, and user channel information; S4. According to the correspondence between the page type and the page layout rules, find the page layout table corresponding to the page type; S5. Find all nodes of the page according to the page layout table and obtain the node encoding; S6. Through the node-resource relationship table, find the resource encoding corresponding to the node; S7. Find the rule expression of the resource display rule table through the resource encoding; S8. Determine whether the user status information and the user channel information conform to the rule expression; S9. If it conforms to the rule expression, then according to the correspondence between the resource encoding and the resource content, find the resource content in the resource information table; S10. Display the resource content corresponding to the second-level node in the page component, and display the resource content corresponding to the first-level node in the page layout to generate a page.
2. The method according to claim 1, characterized in that, The page layout table further includes: node name, resource type, and maximum number of mounted resources.
3. The method according to claim 1, characterized in that The resource information table includes: resource type, resource title, jump address, and picture address.
4. A system for dynamically generating a client native page, characterized in that, Including: A page layout rule establishment module for establishing page layout rules according to the page type; A configuration module for decomposing the page layout into several page components according to the page layout rules, and decomposing the page components into several display rows; Define the overall structure of the page layout through a tree structure, generate a first-level child node for each page component, generate a second-level child node for each display row, and configure the page layout table; The page layout table includes: node encoding; The node encoding includes a first-level node encoding and a second-level node encoding; Configure the resource information table according to the preset resource information; The resource information table includes: resource encoding and resource content; Configure the node-resource relationship table according to the mapping relationship between nodes and resources; The node-resource relationship table includes: resource encoding and node encoding; Configure the resource display rule table, including resource encoding and rule expression; A request message acquisition module for acquiring a request message, which includes: page type, user status information, and user channel information; A search module for finding the page layout table corresponding to the page type according to the correspondence between the page type and the page layout rules; Find all nodes of a page according to the page layout table and obtain the node codes; find the resource codes corresponding to the nodes through the node-resource relationship table; Find the rule expression of the resource display rule table through the resource codes; If it conforms to the rule expression, find the resource content in the resource information table according to the corresponding relationship between the resource codes and the resource content; A judgment module for judging whether the user status information and the user channel information conform to the rule expression; A page generation module for displaying the resource content corresponding to the secondary nodes in the page components and displaying the resource content corresponding to the primary nodes in the page layout to generate a page.
5. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and when the computer program is executed by a processor, it implements the method for dynamically generating a client native page according to any one of claims 1 to 3.
6. An electronic device, characterized in that, Comprising a processor and a memory; The memory is used for storing the page layout table, the resource information table, the node-resource relationship table and the resource display rule table; The processor is used for executing the method for dynamically generating a client native page according to any one of claims 1 to 3 by calling the page layout table, the resource information table, the node-resource relationship table and the resource display rule table.
7. A computer program product comprising a computer program and / or instructions, characterized in that, When the computer program and / or instruction is executed by the processor, it implements the steps of the method for dynamically generating a client native page according to any one of claims 1 to 3.
Citation Information
Patent Citations
Page monitoring method and device, page restoration method and device, equipment and medium
CN109710354A
Page content display method and device and electronic equipment
CN113268261A