Page generation method and device, electronic equipment and storage medium

By acquiring the operating environment information of the terminal device, static page data is pre-generated and sent to the terminal device for rendering, solving the problem of slow page loading speed on different terminal devices and achieving fast response and efficient page loading.

CN118964764APending Publication Date: 2024-11-15BEIJING ZITIAO NETWORK TECH CO LTD

Patent Information

Application Number
CN202411088261.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In existing technologies, page loading speed is slow due to changes in terminal devices, especially since page loading requests from different terminal devices are difficult to meet their needs.

Method used

By acquiring the operating environment information of the terminal device, static page data matching the environment information is generated in advance and sent to the terminal device for rendering, avoiding changes in dynamic content and improving page loading speed.

Benefits of technology

It enables fast response times for page loading on different terminal devices, improves page loading speed, reduces the server load on generating target page data, lowers rendering latency and data update costs, and enhances system flexibility and maintainability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964764A_ABST
    Figure CN118964764A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a page generation method and device, electronic equipment and a storage medium, and the method comprises the steps that a page loading request of first terminal equipment is obtained, and the page loading request carries a page identifier of a first page requested to be loaded and operation environment information of the first terminal equipment; if it is determined that target page data, matched with the operation environment information, of the first page is generated in advance according to the page identifier and the operation environment information, the target page data is obtained; the target page data is generated according to static page content, matched with the running environment information, of the first page; the static page content is the content which is not changed along with the change of the user attribute in the first page; and sending the target page data to the first terminal equipment, and after the target page data is rendered, displaying static page contents, matched with the running environment information, of the first page. According to the embodiment, page loading requests of different terminal devices can be met, and the page loading speed of the terminal devices is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a page generation method, device, electronic device, and storage medium. Background Art

[0002] In the prior art, when users browse web pages, the page generation method typically uses a terminal device to send a page loading request to a server based on the user's operation. The server returns the corresponding page data to the terminal device based on the page loading request, and the terminal device renders the page data and displays the corresponding page. Currently, the page content in a page may change depending on the terminal device. For example, the page content in a page may change depending on the terminal device's language or operating system. Based on this, how to meet the page loading requests of different terminal devices and improve the page loading speed of terminal devices has become one of the most urgent problems to be solved. Summary of the Invention

[0003] The embodiments of the present disclosure provide a page generation method, apparatus, electronic device, and storage medium, which can meet page loading requests of different terminal devices and improve the page loading speed of the terminal devices.

[0004] In a first aspect, an embodiment of the present disclosure provides a page generation method, comprising:

[0005] Obtaining a page loading request from a first terminal device, where the page loading request carries a page identifier of a first page requested to be loaded and operating environment information of the first terminal device;

[0006] If it is determined, based on the page identifier and the operating environment information, that target page data of the first page that matches the operating environment information is pre-generated, then the target page data is acquired; the target page data is generated based on static page content of the first page that matches the operating environment information; the static page content is content in the first page that remains unchanged as user attributes change;

[0007] The target page data is sent to the first terminal device, and after the target page data is rendered, static page content of the first page that matches the operating environment information is displayed.

[0008] In a second aspect, an embodiment of the present disclosure provides a page generation method, including:

[0009] Sending a page loading request to the server, wherein the page loading request carries a page identifier of the first page requested to be loaded by the user and operating environment information of the first terminal device;

[0010] Obtaining pre-generated target page data returned by the server based on the page identifier and the operating environment information; the target page data is page data of the first page that matches the operating environment information; the target page data is generated based on static page content of the first page that matches the operating environment information; the static page content is content in the first page that remains unchanged as user attributes change;

[0011] The target page data is rendered, and static page content of the first page that matches the operating environment information is displayed according to the rendering result.

[0012] In a third aspect, an embodiment of the present disclosure provides a page generation device, including:

[0013] a request acquiring unit, configured to acquire a page loading request from a first terminal device, wherein the page loading request carries a page identifier of a first page requested to be loaded and operating environment information of the first terminal device;

[0014] a first data acquisition unit configured to acquire, if it is determined based on the page identifier and the operating environment information that target page data matching the operating environment information for the first page is pre-generated, the target page data being generated based on static page content of the first page matching the operating environment information; the static page content being content of the first page that remains unchanged as user attributes change;

[0015] A data sending unit is used to send the target page data to the first terminal device, and after the target page data is rendered, the static page content of the first page that matches the operating environment information is displayed.

[0016] In a fourth aspect, an embodiment of the present disclosure provides a page generation device, including:

[0017] A request sending unit, configured to send a page loading request to the server, wherein the page loading request carries a page identifier of a first page requested to be loaded by the user and operating environment information of the first terminal device;

[0018] a second data acquisition unit, configured to acquire pre-generated target page data returned by the server based on the page identifier and the operating environment information; the target page data being page data of the first page that matches the operating environment information; the target page data being generated based on static page content of the first page that matches the operating environment information; the static page content being content of the first page that remains unchanged as user attributes change;

[0019] A content display unit is used to render the target page data and display the static page content of the first page that matches the operating environment information according to the rendering result.

[0020] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor; and a memory configured to store computer-executable instructions, wherein the computer-executable instructions, when executed, enable the processor to implement the steps of the method described in the first or second aspect above.

[0021] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, which is used to store computer-executable instructions. When the computer-executable instructions are executed by a processor, the steps of the method described in the first or second aspect above are implemented.

[0022] In a seventh aspect, an embodiment of the present disclosure provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the method described in the first aspect or the second aspect above.

[0023] In one or more embodiments of the present disclosure, first, a page loading request of a first terminal device is obtained, the page loading request carries a page identifier of the first page requested to be loaded and the operating environment information of the first terminal device, then, if it is determined based on the page identifier and the operating environment information that target page data of the first page that matches the operating environment information of the first terminal device is pre-generated, the target page data is obtained, the target page data is generated based on static page content of the first page that matches the operating environment information of the first terminal device, the static page content is the content in the first page that does not change with changes in user attributes, finally, the target page data is sent to the first terminal device, and after the target page data is rendered, the static page content of the first page that matches the operating environment information of the first terminal device is displayed. It can be seen that through this embodiment, based on the characteristic that the static page content of the first page remains unchanged as the user attributes change, target page data of the first page that matches the operating environment information of the first terminal device can be generated in advance according to the static page content. When the first terminal device requests to load the first page, the pre-generated target page data is sent to the first terminal device, so that the first terminal device can quickly display the static page content of the first page that matches the operating environment information of the first terminal device, meet the page loading requests of different terminal devices, and improve the page loading speed of the terminal device. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate one or more embodiments of the present disclosure or technical solutions in the prior art, the following briefly introduces the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings described below are only some embodiments described in the present disclosure. Those skilled in the art can derive other drawings based on these drawings without inventive effort.

[0025] Figure 1 A schematic diagram of a flow chart of a page generation method provided in one embodiment of the present disclosure;

[0026] Figure 2 A flowchart of a page generation method provided in yet another embodiment of the present disclosure;

[0027] Figure 3 A schematic diagram of a flow chart of a page generation method provided in another embodiment of the present disclosure;

[0028] Figure 4 A schematic diagram of the structure of a page generating device provided in one embodiment of the present disclosure;

[0029] Figure 5 A schematic structural diagram of a page generating device provided in another embodiment of the present disclosure;

[0030] Figure 6 A schematic structural diagram of an electronic device provided in one embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of the present disclosure, the technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in one or more embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on one or more embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present disclosure.

[0032] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0033] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.

[0034] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0035] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0036] The disclosed embodiment provides a page generation method that can meet page loading requests of different terminal devices and improve the page loading speed of the terminal devices. To facilitate understanding of the method in this embodiment, the technical terms involved in this embodiment are explained here.

[0037] Static page content: When generating a page, developers first need to determine the content to be displayed. Page content is categorized as static and dynamic. Static page content refers to content on a page that does not change with user attributes, such as user ID or permissions. When different users browse the same page, static page content is the same content that each user sees. Examples of static page content include text, tables, and images.

[0038] Dynamic page content: Dynamic page content refers to content on a page that changes as user attributes, such as user ID and permissions, change. Different users viewing the same page will see different dynamic page content. Examples of dynamic page content include user avatars and user names.

[0039] Let me briefly introduce the page generation process. When generating a page, the server needs to generate an HTML (HyperText Markup Language) file and a CSS (Cascading Style Sheets) file based on the page content to be displayed in the page designed by the developer. The HTML file is used to represent the various page elements in the page and the structure of each page element, such as which page elements need to be displayed, the hierarchical relationship between each page element, etc. The CSS file is used to represent the style of each page element in the page, such as the color of each page element, etc. Among them, the page elements can be determined according to the page content to be displayed. The page elements can be exemplified by text, buttons, input boxes, etc. in the page. The server sends the HTML file and CSS file to the terminal device, and the terminal device renders the HTML file and CSS file, and displays the page according to the rendering result. The page includes the above-mentioned various page elements.

[0040] Figure 1 A flow chart of a page generation method provided by an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the process includes:

[0041] Step S102: Obtain a page loading request from the first terminal device, where the page loading request carries a page identifier of the first page requested to be loaded and operating environment information of the first terminal device;

[0042] Step S104: If it is determined that target page data of the first page that matches the operating environment information of the first terminal device has been pre-generated based on the page identifier and the operating environment information, the target page data is obtained. The target page data is generated based on static page content of the first page that matches the operating environment information of the first terminal device. The static page content is content in the first page that remains unchanged as the user attributes change.

[0043] Step S106: sending the target page data to the first terminal device. After the target page data is rendered, static page content of the first page that matches the operating environment information of the first terminal device is displayed.

[0044] In this embodiment, first, a page load request is obtained from a first terminal device, the page load request carrying a page identifier of the first page requested to be loaded and the operating environment information of the first terminal device. Then, if it is determined that target page data matching the operating environment information of the first terminal device has been pre-generated based on the page identifier and the operating environment information, the target page data is obtained. The target page data is generated based on static page content of the first page that matches the operating environment information of the first terminal device, where the static page content is content that remains unchanged as the user attributes change. Finally, the target page data is sent to the first terminal device. After the target page data is rendered, the static page content of the first page that matches the operating environment information of the first terminal device is displayed. It can be seen that through this embodiment, based on the characteristic that the static page content of the first page remains unchanged as the user attributes change, target page data matching the operating environment information of the first terminal device can be pre-generated based on the static page content. When the first terminal device requests to load the first page, the pre-generated target page data is sent to the first terminal device, so that the first terminal device can quickly display the static page content of the first page that matches the operating environment information of the first terminal device, thereby satisfying page load requests from different terminal devices and improving the page loading speed of the terminal device.

[0045] Figure 1 The method flow can be executed by a server, which can be a single server or a server cluster. In the above step S102, the server obtains a page loading request from the first terminal device, which carries the page identifier of the first page requested to be loaded and the operating environment information of the first terminal device.

[0046] In this embodiment, the first terminal device includes but is not limited to electronic products such as mobile phones, computers, tablet computers, laptops, car computers, wearable devices, etc. The first terminal device generates a page loading request under the triggering of the user, for example, according to the operation of the user clicking a page link, and sends the page loading request to the server. The page loading request carries the page identifier of the first page requested to be loaded and the operating environment information of the first terminal device. The page identifier of the first page can be obtained through the URL (Uniform Resource Locator) of the first page. )This means that for the same page, the page identifiers carried in page load requests issued by terminal devices with different operating environments can be the same. The operating environment information of the first terminal device includes, but is not limited to, any one of the following: the language of the first terminal device, the device type, the operating system, and the application that displays the first page. Examples of languages ​​include any common language such as Chinese and English, device types include any mobile terminal or PC terminal, and operating systems include any common systems such as Android and iOS.

[0047] In step S104, the server determines whether target page data matching the operating environment information of the first terminal device and the first page identifier in the page load request is pre-generated. The target page data is generated based on static page content of the first page that matches the operating environment information of the first terminal device. The static page content is content in the first page that remains unchanged despite changes in user attributes.

[0048] As mentioned above, static page content refers to the content in the page that does not change with changes in user attributes such as user identification and permissions. Therefore, the static page content of the first page is the content in the first page that does not change with changes in user attributes. When the developer designs the first page, the static page content in the first page can be determined. For different terminal devices, when the operating environment information is different, the static page content of the first page may be different. For example, for a terminal device using Chinese, the language of the static page content of the first page is also Chinese. For a terminal device using English, the language of the static page content of the first page is also English. For another example, for a terminal device whose operating system is Android, the static page content of the first page needs to meet the requirements of the Android system. For a terminal device whose operating system is IOS, the static page content of the first page needs to meet the requirements of the IOS system.

[0049] Based on this, static page content of the first page that matches the operating environment information of the first terminal device can be pre-acquired, and target page data can be generated based on the static page content. Therefore, the target page data is the page data of the first page that matches the operating environment information of the first terminal device. When a page load request is received from the first terminal device, it is determined whether target page data of the first page that matches the operating environment information of the first terminal device has been pre-generated. If so, the pre-generated target page data is directly acquired.

[0050] In step S106, the acquired target page data is sent to the first terminal device. It is understood that since the target page data is generated based on the static page content of the first page that matches the operating environment information of the first terminal device, the target page data can be rendered by the first terminal device to display the static page content of the first page that matches the operating environment information of the first terminal device, thereby enabling the first terminal device to quickly display the static page content of the first page that matches the operating environment information of the first terminal device, thereby satisfying page loading requests of different terminal devices and improving the page loading speed of the terminal device.

[0051] In one embodiment, the above method further includes:

[0052] Generate a target unique character string for representing a page identifier of the first page and operating environment information of the first terminal device;

[0053] According to the mapping relationship between the unique string and the page data, searching whether the page data corresponding to the target unique string is stored;

[0054] If so, it is determined that target page data matching the operating environment information of the first terminal device and having the first page pre-generated is used, and the page data corresponding to the target unique character string is the target page data.

[0055] In this embodiment, the terminal devices can be classified in advance according to the operating environment information of the terminal devices. For example, the terminal devices can be divided into categories such as Chinese Android, English Android, Chinese IOS, English IOS, etc. For each category of terminal devices, the static page content of the first page that matches the operating environment information of the terminal devices of that category is obtained, and based on the obtained static page content, the page data of the first page that matches the operating environment information of the terminal devices of that category is generated.

[0056] In addition, for each category of terminal devices, a unique string is generated to represent the page identifier of the first page and the operating environment information of the terminal device of this category, such as performing a hash operation on the page identifier of the first page and the operating environment information of the terminal device of this category to obtain a unique string, and the unique string is associated with the page data of the terminal device of this category and stored, thereby achieving the effect of storing the page data of the first page corresponding to each category of terminal devices.

[0057] Based on this, Figure 1In the process, a target unique string can be generated to represent the page identifier of the first page and the operating environment information of the first terminal device. For example, a hash operation is performed on the page identifier of the first page and the operating environment information of the first terminal device to obtain the target unique string. According to the mapping relationship between the above-mentioned pre-stored unique string and the page data, it is searched whether page data corresponding to the target unique string is stored. If so, it is determined that target page data matching the operating environment information of the first terminal device is pre-generated for the first page, and the page data corresponding to the target unique string is the target page data. If not, it is determined that target page data matching the operating environment information of the first terminal device is not pre-generated for the first page.

[0058] It can be seen that through this embodiment, a target unique string for representing the page identifier of the first page and the operating environment information of the first terminal device can be generated. According to the mapping relationship between the unique string and the page data, it is possible to find out whether page data corresponding to the target unique string is stored. Therefore, when a page loading request for the first page arrives from the first terminal device, it is possible to quickly determine whether target page data of the first page that matches the operating environment information of the first terminal device has been pre-generated, thereby improving the response speed of the page loading request and the page loading speed.

[0059] In one embodiment, the above method further includes:

[0060] If it is determined, based on the page identifier of the first page and the operating environment information of the first terminal device, that target page data of the first page that matches the operating environment information of the first terminal device is not pre-generated, then obtaining static page content of the first page that matches the operating environment information of the first terminal device;

[0061] Target page data is generated according to the acquired static page content, and the generated target page data is sent to the first terminal device.

[0062] In this embodiment, if it is determined based on the page identifier of the first page and the operating environment information of the first terminal device that target page data matching the operating environment information of the first terminal device has not been pre-generated for the first page, if the page data corresponding to the target unique string is not found, the static page content of the first page matching the operating environment information of the first terminal device is obtained, the target page data is generated based on the obtained static page content, and the generated target page data is sent to the first terminal device.

[0063] It can be seen that through this embodiment, when the target page data of the first page that matches the operating environment information of the first terminal device is not generated in advance, the target page data can be generated according to the static page content of the first page that matches the operating environment information of the first terminal device and sent to the first terminal device, so that the first terminal device can quickly display the static page content of the first page that matches the operating environment information of the first terminal device.

[0064] In one embodiment, after generating target page data according to the acquired static page content, the method further includes:

[0065] Generate a target unique character string for representing a page identifier of the first page and operating environment information of the first terminal device;

[0066] A mapping relationship between the target unique character string and the generated target page data is established, and the generated target unique character string and the target page data are associated and stored.

[0067] As previously described, terminal devices can be pre-classified based on their operating environment information. For each category of terminal devices, static page content of the first page that matches the operating environment information of the terminal devices in that category is obtained. Based on the obtained static page content, page data of the first page that matches the operating environment information of the terminal devices in that category is generated. Furthermore, for each category of terminal devices, a unique string representing a page identifier of the first page and the operating environment information of the terminal devices in that category is generated. This unique string is associated and stored with the page data of the terminal devices in that category, thereby achieving the effect of storing the page data of the first page corresponding to each category of terminal devices.

[0068] Based on this, when it is determined that the target page data that matches the operating environment information of the first terminal device and the first page has not been pre-generated, after the target page data is generated, a target unique string can be generated to represent the page identifier of the first page and the operating environment information of the first terminal device, such as performing a hash operation on the page identifier of the first page and the operating environment information of the first terminal device to obtain a unique string, establishing a mapping relationship between the target unique string and the generated target page data, and storing the generated target unique string and the target page data in association, so that when a terminal device with the same operating environment information, that is, a terminal device of the same category, requests the first page subsequently, the target page data can be quickly obtained.

[0069] It can be seen that through this embodiment, it is also possible to generate a target unique string for representing the page identifier of the first page and the operating environment information of the first terminal device, establish a mapping relationship between the target unique string and the generated target page data, and store the generated target unique string and the target page data in association, so that when a terminal device with the same operating environment information, that is, a terminal device of the same category, requests the first page subsequently, the target page data can be quickly obtained.

[0070] Generate target page data based on the acquired static page content, including:

[0071] Generate Cascading Style Sheet (CSS) files and Hypertext Markup Language (HTML) files based on the acquired static page content;

[0072] Get the style information of page elements in HTML files based on CSS files;

[0073] The acquired style information is inlined into the HTML file; the target page data at least includes the inlined HTML file.

[0074] In this embodiment, after obtaining static page content of the first page that matches the operating environment information of the first terminal device, a CSS file and an HTML file are generated based on the obtained static page content. The HTML file is used to represent each page element and its structure, such as which page elements are to be displayed and the hierarchical relationship between the page elements. The CSS file is used to represent the style of each page element, such as the color of each page element. The page elements can be determined based on the obtained static page content, and examples of page elements include text, buttons, input boxes, etc.

[0075] Next, the style information of the page elements in the HTML file is obtained based on the CSS file. It can be understood that the page elements in the HTML file are the page elements that need to be displayed. Finally, the obtained style information is inlined into the HTML file. In one example, the obtained style information is inlined into the HTML header file through the style tag. The target page data includes at least the inlined HTML file, and the target page data may also include the above-mentioned CSS file. The first terminal device can render the inlined HTML file and display the static page content of the first page that matches the operating environment information of the first terminal device according to the rendering result.

[0076] It can be seen that through this embodiment, a CSS file and an HTML file can be generated based on the acquired static page content, the style information of the page elements in the HTML file can be acquired based on the CSS file, and the acquired style information can be inlined into the HTML file, and the target page data at least includes the inlined HTML file. Since the style information of the page elements in the HTML file is directly inlined into the HTML file, on the one hand, when rendering the HTML file, the first terminal device no longer needs to download the required style information through a link, which improves the page rendering and loading speed. On the other hand, there is no redundant style information in the HTML file, which reduces the data volume of the HTML file while improving the page rendering and loading speed, and greatly reduces the first content drawing time. Among them, the first content drawing (FCP, First Contentful Paint) time is a measure of the time from the start of page loading to the time the user sees the first block of content such as text or image. This indicator is crucial for evaluating the loading performance of the page.

[0077] In one embodiment, obtaining style information of page elements in an HTML file based on a CSS file includes:

[0078] Generate a style rule file based on the CSS file; the style rule file records the element identifier of the first page element, the style information of the first page element, and the position index of the style information of the first page element in the style rule file; the first page element is a page element with style information selected by a specified selector in the CSS file;

[0079] Get the style information of the page elements in the HTML file based on the style rule file.

[0080] In this embodiment, a style rule file is generated based on a CSS file. The style rule file can be a JavaScript object. The style rule file records the element identifier of the first page element, the style information of the first page element, and the position index of the style information of the first page element in the style rule file. The first page element is a page element with style information selected by a specified selector in the CSS file.

[0081] It should be noted that selectors are an important part of CSS files. They are used to select page elements that need to be styled and determine which page elements will be applied with specific styles. Selectors can be divided into several types, including at least:

[0082] 1. Tag selector: selects elements by their tag names. For example, p{color:red} will select all elements and set their color to red;

[0083] 2. Class selector: selects elements by their class attribute. Class selectors are represented by a period (.) before the class attribute value. For example, className{font-size:14px} will select all elements that contain className in their class attribute and set their font size to 14 pixels.

[0084] 3. ID selector: Selects an element by its ID attribute. An ID selector is represented by a pound sign (#) before the ID attribute value. For example, #elementId{background-color:yellow} selects the element with the ID elementId and sets its background color to yellow.

[0085] In addition, selectors also include descendant selectors, child selectors, intersection selectors, pseudo-class selectors, pseudo-element selectors, etc., which will not be described here.

[0086] In this embodiment, the designated selector may be a class selector, and the first page element is a page element having style information selected by the class selector in the CSS file. The style rule file records the element identifier of the first page element, the style information of the first page element, and the position index of the style information of the first page element in the style rule file.

[0087] In an example, the style rule file can be as follows:

[0088] {

[0089] pageRuleList:['.a{}','.ab{}','.c:after{}','#id.d{}'],

[0090] pageRuleMap:{

[0091] 'a':[0],

[0092] 'b':[1],

[0093] 'c':[2],

[0094] 'd':[3],

[0095] }

[0096] In this example, there are four first page elements, identified by element identifiers a, b, c, and d. The pageRuleList records the style information for each first page element, and the pageRuleMap records the position index of each first page element's style information in the style rule file. For example, 'a':[0] indicates that the style information for the first page element a is located in the 0th array in the style rule file.

[0097] Next, in this embodiment, based on the style rule file, the style information of the page elements in the HTML file is obtained.

[0098] It can be seen that through this embodiment, a style rule file can be generated based on the CSS file, and the characteristics of the style rule file recording the element identifier of the first page element, the style information of the first page element and the position index of the style information of the first page element in the style rule file are utilized. Based on the style rule file, the style information of the page elements in the HTML file can be quickly obtained, thereby improving the efficiency of obtaining style information.

[0099] In one embodiment, obtaining style information of page elements in an HTML file based on a style rule file includes:

[0100] Determine in the HTML file a page element having style information selected by a specified selector as a second page element, and determine in the style rule file a first page element having the same element identifier as the second page element;

[0101] According to the position index of the determined style information of the first page element in the style rule file, the determined style information of the first page element is obtained from the style rule file, and the determined style information of the first page element is used as the style information of the second page element.

[0102] In this embodiment, first, a page element with style information selected by a specified selector such as a class selector in the HTML file is determined as a second page element, and a first page element having the same element identifier as the second page element is determined in the style rule file.

[0103] Then, according to the position index of the style information of the determined first page element in the style rule file, the style information of the determined first page element is obtained in the style rule file. Since the element identifier of the determined first page element is the same as the element identifier of the second page element, that is, the two are the same page elements, the style information of the determined first page element is used as the style information of the second page element.

[0104] Referring to the previous example of the style rule file, suppose a class of 'a' is obtained from the HTML file, and then pageRuleMap['a'] is taken out from the previous JavaScript object, and [0] is obtained. Then, this number 0 is used as the array subscript to get pageRuleList[0], and the style information of .a{} is obtained.

[0105] In other examples, the style rule file also records the element identifier of the third page element and the style information of the third page element. The third page element is a page element with style information selected by a selector other than the specified selector in the CSS file. The style information of each third page element can also be inlined into the HTML file. The above-mentioned target page data includes at least an HTML file with inline style information of the second page element and style information of the third page element, and may also include the above-mentioned CSS file.

[0106] It can be seen that through this embodiment, it is possible to determine that the page element with style information selected by the specified selector in the HTML file is the second page element, determine the first page element with the same element identifier as the second page element in the style rule file, obtain the style information of the determined first page element in the style rule file according to the position index of the style information of the determined first page element, and use the style information of the determined first page element as the style information of the second page element, thereby efficiently and quickly determining the style information of the page element in the HTML file.

[0107] In summary, through the above method flow applied to the server, it is possible to generate target page data of the first page that matches the operating environment information of the first terminal device in advance based on the static page content, based on the characteristic that the static page content of the first page remains unchanged as the user attributes change. When the first terminal device requests to load the first page, the pre-generated target page data is sent to the first terminal device, so that the first terminal device can quickly display the static page content of the first page that matches the operating environment information of the first terminal device, meet the page loading requests of different terminal devices, and improve the page loading speed of the terminal device.

[0108] The following describes the method flow applied to the first terminal device side. Figure 2 A flow chart of a page generation method provided in another embodiment of the present disclosure is shown as follows: Figure 2 As shown, the process includes:

[0109] Step S202: Send a page loading request to the server, where the page loading request carries a page identifier of the first page requested to be loaded by the user and operating environment information of the first terminal device;

[0110] Step S204: obtaining pre-generated target page data returned by the server based on the page identifier and the operating environment information; the target page data is page data of the first page that matches the operating environment information of the first terminal device; the target page data is generated based on static page content of the first page that matches the operating environment information of the first terminal device; the static page content is content in the first page that remains unchanged as the user attributes change;

[0111] Step S206 : Render the target page data, and display the static page content of the first page that matches the operating environment information of the first terminal device according to the rendering result.

[0112] In this embodiment, first, a page loading request is sent to the server, the page loading request carrying the page identifier of the first page requested by the user and the operating environment information of the first terminal device. Then, the server obtains pre-generated target page data returned based on the page identifier and the operating environment information. The target page data is page data of the first page that matches the operating environment information of the first terminal device. The target page data is generated based on the static page content of the first page that matches the operating environment information of the first terminal device. The static page content is the content of the first page that remains unchanged as the user attributes change. Finally, the target page data is rendered, and the static page content of the first page that matches the operating environment information of the first terminal device is displayed based on the rendering result. It can be seen that through this embodiment, when the first terminal device requests to load the first page, the pre-generated target page data can be sent to the first terminal device, so that the first terminal device can quickly display the static page content of the first page that matches the operating environment information of the first terminal device, thereby satisfying the page loading requests of different terminal devices and improving the page loading speed of the terminal device.

[0113] In the above step S202, the first terminal device includes but is not limited to electronic products such as mobile phones, computers, tablet computers, laptops, car computers, wearable devices, etc. The first terminal device generates a page loading request under the triggering of the user, for example, according to the operation of the user clicking on the page link, and sends the page loading request to the server. The page loading request carries the page identifier of the first page requested to be loaded and the operating environment information of the first terminal device. The page identifier of the first page can be represented by the URL of the first page. For the same page, the page identifiers carried in the page loading requests issued by terminal devices with different operating environments can be the same. The operating environment information of the first terminal device is not limited to any one of the language of the first terminal device, the device type, the operating system, and the application that displays the first page. Among them, examples of languages ​​include any one of common languages ​​such as Chinese and English, the device type includes any one of mobile terminals and PC terminals, and the operating system includes any one of common systems such as Android and IOS.

[0114] For the specific content of the above step S204, please refer to the previous Figure 1 It is understood that, in the case where the server does not generate the target page data in advance, the server can also generate the target page data in response to the page load request and send it to the first terminal device.

[0115] In the above step S206 , the first terminal device renders the target page data, and displays the static page content of the first page that matches the operating environment information of the first terminal device according to the rendering result.

[0116] In one embodiment, after displaying the static page content of the first page that matches the operating environment information of the first terminal device according to the rendering result, the method further includes:

[0117] Obtaining dynamic page content of the first page that matches the operating environment information of the first terminal device; the dynamic page content is content in the first page that changes as user attributes change;

[0118] Display the acquired dynamic page content in the displayed page.

[0119] As mentioned above, dynamic page content refers to the content in the page that changes with changes in user attributes such as user identification and permissions. Examples of dynamic page content include user avatars, user names, etc. In this embodiment, after displaying the static page content of the first page that matches the operating environment information of the first terminal device according to the rendering result, the first terminal device obtains the dynamic page content of the first page that matches the operating environment information of the first terminal device. For example, if the language of the first terminal device is Chinese, the Chinese user name is obtained. For another example, if the language of the first terminal device is Android, the user avatar that meets the requirements of the Android system is obtained, and then the obtained dynamic page content is displayed in the displayed page. The static page content of the first page that matches the operating environment information of the first terminal device is displayed in the displayed page.

[0120] In one example, the DOM (Document Object Model) of the displayed page may be modified according to the dynamic page content, and the acquired dynamic page content may be displayed in addition to the static page content.

[0121] It can be seen that through this embodiment, the first terminal device can also obtain the dynamic page content of the first page that matches the operating environment information of the first terminal device, and display the obtained dynamic page content in the displayed page, thereby meeting the user's needs for browsing the first page and improving the user's page browsing experience.

[0122] Figure 3 A flow chart of a page generation method provided by another embodiment of the present disclosure is shown as follows: Figure 3 As shown, the process includes:

[0123] Step S302: The server classifies the terminal devices according to the operating environment information of the terminal devices;

[0124] Step S304: The server obtains, for each category of terminal devices, static page content of the first page that matches the operating environment information of the terminal devices of that category, and generates page data of the first page that matches the operating environment information of the terminal devices of that category based on the obtained static page content;

[0125] Step S306: The server generates, for each category of terminal devices, a unique string representing a page identifier of the first page and operating environment information of the terminal device of that category;

[0126] Step S308: The server associates and stores the unique string with the page data of the terminal device of the category;

[0127] Step S310: The first terminal device sends a page loading request to the server, where the page loading request carries a page identifier of the first page requested to be loaded and operating environment information of the first terminal device;

[0128] Step S312: The server generates a target unique string for representing the page identifier and the operating environment information;

[0129] Step S314: The server searches for target page data corresponding to the target unique string based on the mapping relationship between the unique string and the page data.

[0130] If so, execute step S316; otherwise, execute steps S318-S324.

[0131] Step S316: The server obtains the stored target page data and sends the stored target page data to the first terminal device;

[0132] Step S318: The server obtains static page content of the first page that matches the operating environment information, and generates target page data based on the static page content;

[0133] Step S320: the server sends the generated target page data to the first terminal device;

[0134] Step S322: The server generates a target unique string for representing the page identifier of the first page and the operating environment information of the first terminal device;

[0135] Step S324, storing the generated target unique character string and the generated target page data in association with each other;

[0136] Step S326: The first terminal device renders the target page data and displays static page content of the first page that matches the operating environment information according to the rendering result;

[0137] Step S328: The first terminal device obtains dynamic page content of the first page that matches the operating environment information;

[0138] Step S330: The first terminal device adds dynamic page content to the displayed page.

[0139] In this embodiment, the server can cache the target page data in the redis cache cluster.

[0140] pass Figure 3 The process in it can generate target page data of the first page that matches the operating environment information of the first terminal device in advance based on the static page content, based on the characteristic that the static page content of the first page remains unchanged as the user attributes change. When the first terminal device requests to load the first page, the pre-generated target page data is sent to the first terminal device, so that the first terminal device can quickly display the static page content of the first page that matches the operating environment information of the first terminal device, meet the page loading requests of different terminal devices, and improve the page loading speed of the terminal device.

[0141] In summary, the above embodiments have at least the following technical effects:

[0142] 1. By pre-caching the target page data, the server load for generating the target page data each time can be reduced, rendering delay can be reduced, and server performance and user experience can be improved;

[0143] 2. Ability to output corresponding target page data for terminal devices with different operating environment information, meeting the needs of different terminal devices for the first page;

[0144] 3. By pre-caching the target page data, when the static page content remains unchanged but the dynamic page content changes, there is no need to update the target page data, which reduces the cost and time of data update;

[0145] 4. By inlining style information into HTML files, serial loading of CSS files is avoided, reducing the first content painting FCP time;

[0146] 5. By pre-caching the target page data, the complexity of page compilation is avoided and the flexibility and maintainability of the system are enhanced.

[0147] Figure 4 A schematic diagram of the structure of a page generation device provided by an embodiment of the present disclosure is shown in FIG. Figure 4 Said device comprises:

[0148] A request acquiring unit 41 is configured to acquire a page loading request from a first terminal device, wherein the page loading request carries a page identifier of a first page requested to be loaded and operating environment information of the first terminal device;

[0149] A first data acquisition unit 42 is configured to acquire, if it is determined based on the page identifier and the operating environment information that target page data matching the operating environment information for the first page is pre-generated, the target page data being generated based on static page content of the first page matching the operating environment information; the static page content being content of the first page that remains unchanged as user attributes change;

[0150] The data sending unit 43 is configured to send the target page data to the first terminal device. After the target page data is rendered, the static page content of the first page that matches the operating environment information is displayed.

[0151] Optionally, it also includes a judgment unit, which is used to: generate a target unique string for representing the page identifier and the operating environment information; search whether page data corresponding to the target unique string is stored based on the mapping relationship between the unique string and the page data; if so, determine that target page data matching the operating environment information of the first page is pre-generated, and the page data corresponding to the target unique string is the target page data.

[0152] Optionally, it also includes a generation unit, which is used to: if it is determined based on the page identifier and the operating environment information that target page data matching the operating environment information of the first page has not been pre-generated, then obtain the static page content of the first page matching the operating environment information; generate the target page data based on the static page content, and send the generated target page data to the first terminal device.

[0153] Optionally, the generation unit is specifically used to: generate a cascading style sheet CSS file and a hypertext markup language HTML file based on the static page content; obtain style information of the page elements in the HTML file based on the CSS file; inline the obtained style information into the HTML file; the target page data at least includes the inlined HTML file.

[0154] Optionally, the generation unit is further specifically used to: generate a style rule file based on the CSS file; record the element identifier of the first page element, the style information of the first page element and the position index of the style information of the first page element in the style rule file in the style rule file; the first page element is a page element with style information selected by a specified selector in the CSS file; and obtain the style information of the page element in the HTML file based on the style rule file.

[0155] Optionally, the generation unit is further specifically used to: determine that the page element with style information selected by the specified selector in the HTML file is the second page element, and determine the first page element with the same element identifier as the second page element in the style rule file; obtain the style information of the first page element in the style rule file according to the position index of the style information of the first page element, and use the style information of the first page element as the style information of the second page element.

[0156] Optionally, it also includes a storage unit for: after generating the target page data based on the static page content, generating a target unique string for representing the page identifier and the operating environment information; establishing a mapping relationship between the target unique string and the target page data, and storing the generated target unique string and the target page data in association with each other.

[0157] The page generation device in the embodiment of the present disclosure can implement each process of the above-mentioned embodiment of the page generation method applied to the server side and achieve the same effects and functions, which will not be repeated here.

[0158] Figure 5 This is a structural diagram of a page generation device provided by another embodiment of the present disclosure, such as Figure 5 Said device comprises:

[0159] A request sending unit 51 is configured to send a page loading request to a server, wherein the page loading request carries a page identifier of a first page requested to be loaded by a user and operating environment information of a first terminal device;

[0160] A second data acquisition unit 52 is configured to acquire pre-generated target page data returned by the server based on the page identifier and the operating environment information; the target page data is page data of the first page that matches the operating environment information; the target page data is generated based on static page content of the first page that matches the operating environment information; the static page content is content in the first page that remains unchanged as user attributes change;

[0161] The content display unit 53 is configured to render the target page data and display the static page content of the first page that matches the operating environment information according to the rendering result.

[0162] Optionally, a display unit is added, which is used to: after displaying the static page content of the first page that matches the operating environment information according to the rendering result, obtain the dynamic page content of the first page that matches the operating environment information; the dynamic page content is the content in the first page that changes with the user attributes; and display the dynamic page content in the displayed page.

[0163] The page generation device in the embodiment of the present disclosure can implement each process of the above-mentioned page generation method embodiment applied to the first terminal device side and achieve the same effects and functions, which will not be repeated here.

[0164] An embodiment of the present disclosure further provides an electronic device, Figure 6 A schematic diagram of the structure of an electronic device provided in one embodiment of the present disclosure is shown in FIG. Figure 6 As shown, electronic devices may have relatively large differences due to different configurations or performances, and may include one or more processors 601 and memory 602, and the memory 602 may store one or more applications or data. Among them, the memory 602 can be a temporary storage or a persistent storage. The application stored in the memory 602 may include one or more modules (not shown in the figure), each module may include a series of computer-executable instructions in the electronic device. Furthermore, the processor 601 can be configured to communicate with the memory 602 to execute a series of computer-executable instructions in the memory 602 on the electronic device. The electronic device may also include one or more power supplies 603, one or more wired or wireless network interfaces 604, one or more input or output interfaces 605, one or more keyboards 606, etc.

[0165] In a specific embodiment, the electronic device includes a processor; and a memory configured to store computer-executable instructions, wherein when the computer-executable instructions are executed, the processor implements the following process:

[0166] Obtaining a page loading request from a first terminal device, where the page loading request carries a page identifier of a first page requested to be loaded and operating environment information of the first terminal device;

[0167] If it is determined, based on the page identifier and the operating environment information, that target page data of the first page that matches the operating environment information is pre-generated, then the target page data is acquired; the target page data is generated based on static page content of the first page that matches the operating environment information; the static page content is content in the first page that remains unchanged as user attributes change;

[0168] The target page data is sent to the first terminal device, and after the target page data is rendered, static page content of the first page that matches the operating environment information is displayed.

[0169] The electronic device in the embodiment of the present disclosure can implement each process of the above-mentioned embodiment of the page generation method applied to the server side and achieve the same effects and functions, which will not be repeated here.

[0170] In another specific embodiment, an electronic device includes a processor; and a memory configured to store computer-executable instructions, wherein when the computer-executable instructions are executed, the processor implements the following process:

[0171] Sending a page loading request to the server, wherein the page loading request carries a page identifier of the first page requested to be loaded by the user and operating environment information of the first terminal device;

[0172] Obtaining pre-generated target page data returned by the server based on the page identifier and the operating environment information; the target page data is page data of the first page that matches the operating environment information; the target page data is generated based on static page content of the first page that matches the operating environment information; the static page content is content in the first page that remains unchanged as user attributes change;

[0173] The target page data is rendered, and static page content of the first page that matches the operating environment information is displayed according to the rendering result.

[0174] The electronic device in the embodiment of the present disclosure can implement the various processes of the above-mentioned page generation method embodiment applied to the first terminal device side and achieve the same effects and functions, which will not be repeated here.

[0175] Another embodiment of the present disclosure further provides a computer-readable storage medium for storing computer-executable instructions. When the computer-executable instructions are executed by a processor, the following process is implemented:

[0176] Obtaining a page loading request from a first terminal device, where the page loading request carries a page identifier of a first page requested to be loaded and operating environment information of the first terminal device;

[0177] If it is determined, based on the page identifier and the operating environment information, that target page data of the first page that matches the operating environment information is pre-generated, then the target page data is acquired; the target page data is generated based on static page content of the first page that matches the operating environment information; the static page content is content in the first page that remains unchanged as user attributes change;

[0178] The target page data is sent to the first terminal device, and after the target page data is rendered, static page content of the first page that matches the operating environment information is displayed.

[0179] The storage medium in the embodiment of the present disclosure can implement each process of the above-mentioned embodiment of the page generation method applied to the server side and achieve the same effects and functions, which will not be repeated here.

[0180] Another embodiment of the present disclosure further provides a computer-readable storage medium for storing computer-executable instructions. When the computer-executable instructions are executed by a processor, the following process is implemented:

[0181] Sending a page loading request to the server, wherein the page loading request carries a page identifier of the first page requested to be loaded by the user and operating environment information of the first terminal device;

[0182] Obtaining pre-generated target page data returned by the server based on the page identifier and the operating environment information; the target page data is page data of the first page that matches the operating environment information; the target page data is generated based on static page content of the first page that matches the operating environment information; the static page content is content in the first page that remains unchanged as user attributes change;

[0183] The target page data is rendered, and static page content of the first page that matches the operating environment information is displayed according to the rendering result.

[0184] The storage medium in the embodiment of the present disclosure can implement each process of the above-mentioned embodiment of the page generation method applied to the first terminal device side and achieve the same effects and functions, which will not be repeated here.

[0185] Another embodiment of the present disclosure further provides a computer program product, the computer program product including a computer program, which implements the following process when executed by a processor:

[0186] Obtaining a page loading request from a first terminal device, where the page loading request carries a page identifier of a first page requested to be loaded and operating environment information of the first terminal device;

[0187] If it is determined, based on the page identifier and the operating environment information, that target page data of the first page that matches the operating environment information is pre-generated, then the target page data is acquired; the target page data is generated based on static page content of the first page that matches the operating environment information; the static page content is content in the first page that remains unchanged as user attributes change;

[0188] The target page data is sent to the first terminal device, and after the target page data is rendered, static page content of the first page that matches the operating environment information is displayed.

[0189] The computer program product in the embodiment of the present disclosure can implement each process of the above-mentioned embodiment of the page generation method applied to the server side and achieve the same effects and functions, which will not be repeated here.

[0190] Another embodiment of the present disclosure further provides a computer program product, the computer program product including a computer program, which implements the following process when executed by a processor:

[0191] Sending a page loading request to the server, wherein the page loading request carries a page identifier of the first page requested to be loaded by the user and operating environment information of the first terminal device;

[0192] Obtaining pre-generated target page data returned by the server based on the page identifier and the operating environment information; the target page data is page data of the first page that matches the operating environment information; the target page data is generated based on static page content of the first page that matches the operating environment information; the static page content is content in the first page that remains unchanged as user attributes change;

[0193] The target page data is rendered, and static page content of the first page that matches the operating environment information is displayed according to the rendering result.

[0194] The computer program product in the embodiment of the present disclosure can implement each process of the above-mentioned page generation method embodiment applied to the first terminal device side and achieve the same effects and functions, which will not be repeated here.

[0195] In various embodiments of the present disclosure, the computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0196] In the 1990s, technological improvements could be clearly distinguished as either hardware improvements (for example, improvements to circuit structures like diodes, transistors, and switches) or software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using a hardware module. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system onto a PLD by programming it themselves, without having to hire a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly performed using "logic compiler" software. This is similar to the software compilers used during program development. Before compilation, the original code must be written in a specific programming language, called a hardware description language (HDL). There are not just one HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also understand that by simply programming the method flow in one of these hardware description languages ​​and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.

[0197] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code format, the controller can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules that implement the method and structures within the hardware component.

[0198] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0199] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing the embodiments of the present disclosure, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0200] Those skilled in the art will appreciate that one or more embodiments of the present disclosure may be provided as a method, system, or computer program product. Therefore, one or more embodiments of the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, one or more embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0201] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. 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.

[0202] These computer program instructions may 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, 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 The function specified in one or more boxes.

[0203] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0204] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a..." does not preclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0205] One or more embodiments of the present disclosure may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. One or more embodiments of the present disclosure may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0206] The various embodiments of this disclosure are described in a progressive manner. Similar portions between the various embodiments can be referenced to each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so their description is relatively simple. For relevant portions, refer to the description of the method embodiments.

[0207] The foregoing is merely an embodiment of the present disclosure and is not intended to limit the present disclosure. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure are intended to be included within the scope of the claims of the present disclosure.

Claims

1. A page generation method, It is characterized in that include: Obtaining a page loading request of a first terminal device, wherein the page loading request carries a page identifier of a first page requested to be loaded and operating environment information of the first terminal device; If it is determined that target page data of the first page matching the operating environment information is pre-generated according to the page identifier and the operating environment information, the target page data is acquired; the target page data is generated according to static page content of the first page matching the operating environment information; the static page content is content in the first page that remains unchanged as user attributes change; The target page data is sent to the first terminal device, and after the target page data is rendered, static page content of the first page matching the operating environment information is displayed.

2. The method according to claim 1, It is characterized in that Also includes: Generate a target unique string for representing the page identifier and the operating environment information; According to the mapping relationship between the unique string and the page data, searching whether the page data corresponding to the target unique string is stored; If so, it is determined that target page data matching the operating environment information of the first page is pre-generated, and the page data corresponding to the target unique string is the target page data.

3. The method according to claim 1, It is characterized in that Also includes: If it is determined, based on the page identifier and the operating environment information, that target page data of the first page matching the operating environment information is not pre-generated, then obtaining static page content of the first page matching the operating environment information; The target page data is generated according to the static page content, and the generated target page data is sent to the first terminal device.

4. The method according to claim 3, It is characterized in that The generating the target page data according to the static page content includes: Generate a Cascading Style Sheet (CSS) file and a Hypertext Markup Language (HTML) file according to the static page content; Acquire style information of page elements in the HTML file based on the CSS file; The acquired style information is inlined into the HTML file; the target page data at least includes the inlined HTML file.

5. The method according to claim 4, It is characterized in that The acquiring the style information of the page elements in the HTML file based on the CSS file includes: Generate a style rule file based on the CSS file; the style rule file records the element identifier of the first page element, the style information of the first page element and the position index of the style information of the first page element in the style rule file; the first page element is a page element with style information selected by a specified selector in the CSS file; Based on the style rule file, style information of the page elements in the HTML file is obtained.

6. The method according to claim 5, It is characterized in that The acquiring, based on the style rule file, style information of the page elements in the HTML file comprises: Determine that the page element with style information selected by the designated selector in the HTML file is a second page element, and determine in the style rule file the first page element having the same element identifier as the second page element; According to the position index of the determined style information of the first page element in the style rule file, the determined style information of the first page element is obtained in the style rule file, and the determined style information of the first page element is used as the style information of the second page element.

7. The method according to claim 3, It is characterized in that After generating the target page data according to the static page content, the method further includes: Generate a target unique string for representing the page identifier and the operating environment information; A mapping relationship between the target unique character string and the target page data is established, and the generated target unique character string and the target page data are associated and stored.

8. A page generation method, It is characterized in that include: Sending a page loading request to the server, wherein the page loading request carries a page identifier of a first page requested to be loaded by the user and operating environment information of the first terminal device; Acquire the pre-generated target page data returned by the server according to the page identifier and the operating environment information; the target page data is the page data of the first page that matches the operating environment information; the target page data is generated according to the static page content of the first page that matches the operating environment information; the static page content is the content of the first page that remains unchanged as the user attributes change; The target page data is rendered, and static page content of the first page that matches the operating environment information is displayed according to the rendering result.

9. The method according to claim 8, It is characterized in that After displaying the static page content of the first page matching the operating environment information according to the rendering result, the method further includes: Acquire dynamic page content of the first page that matches the operating environment information; the dynamic page content is content in the first page that changes as user attributes change; The dynamic page content is displayed in the displayed page.

10. A page generating device, It is characterized in that include: A request acquisition unit, configured to acquire a page loading request of a first terminal device, wherein the page loading request carries a page identifier of a first page requested to be loaded and operating environment information of the first terminal device; A first data acquisition unit is configured to acquire the target page data if it is determined that target page data matching the operating environment information of the first page is pre-generated according to the page identifier and the operating environment information; the target page data is generated according to static page content matching the operating environment information of the first page; the static page content is content in the first page that remains unchanged as user attributes change; A data sending unit is used to send the target page data to the first terminal device, and after the target page data is rendered, the static page content of the first page matching the operating environment information is displayed.

11. A page generating device, It is characterized in that include: A request sending unit, used to send a page loading request to the server, wherein the page loading request carries a page identifier of a first page requested to be loaded by a user and operating environment information of a first terminal device; A second data acquisition unit is used to acquire pre-generated target page data returned by the server according to the page identifier and the operating environment information; the target page data is page data of the first page that matches the operating environment information; the target page data is generated according to static page content of the first page that matches the operating environment information; the static page content is content in the first page that remains unchanged as user attributes change; A content display unit is used to render the target page data and display the static page content of the first page that matches the operating environment information according to the rendering result.

12. An electronic device, It is characterized in that include: processor; as well as, A memory configured to store computer executable instructions, wherein the computer executable instructions, when executed, cause the processor to implement the steps of the method described in any one of claims 1 to 7 above, or implement the steps of the method described in any one of claims 8 or 9 above.

13. A computer-readable storage medium, It is characterized in that The computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the method described in any one of claims 1 to 7 above are implemented, or the steps of the method described in any one of claims 8 or 9 above are implemented.

14. A computer program product, It is characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the method described in any one of claims 1 to 7, or implements the steps of the method described in any one of claims 8 or 9.

Citation Information

Patent Citations

  • Page loading method, device and equipment

    CN109614545A

  • Page resource loading method and device, computer equipment and storage medium

    CN110647700A

  • Sub-application program starting method and device, terminal and computer storage medium

    CN111198730A

  • Page rendering method and device, electronic equipment and storage medium

    CN113010827A

  • Page generation method and device, computer readable medium and electronic equipment

    CN115373656A

Cited By

  • Self-adaptive shunting rule generation method and system and medium

    CN119941298A