CN110647699A - Web page rendering method, apparatus, computer equipment and storage medium - Google Patents
Web page rendering method, apparatus, computer equipment and storage medium Download PDFInfo
- Publication number
- CN110647699A CN110647699A CN201910744587.XA CN201910744587A CN110647699A CN 110647699 A CN110647699 A CN 110647699A CN 201910744587 A CN201910744587 A CN 201910744587A CN 110647699 A CN110647699 A CN 110647699A
- Authority
- CN
- China
- Prior art keywords
- page
- file
- rendering
- style
- optimized
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000009877 rendering Methods 0.000 title claims abstract description 187
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000003860 storage Methods 0.000 title claims abstract description 13
- 238000005457 optimization Methods 0.000 claims description 27
- 238000004590 computer program Methods 0.000 claims description 15
- 230000001960 triggered effect Effects 0.000 claims description 13
- 230000008676 import Effects 0.000 description 11
- 230000008569 process Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000011161 development Methods 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000008447 perception Effects 0.000 description 3
- 230000009191 jumping Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
技术领域technical field
本申请涉及计算机技术领域,特别是涉及一种Web页面的渲染方法、装置、计算机设备和存储介质。The present application relates to the field of computer technology, and in particular, to a method, apparatus, computer device and storage medium for rendering a Web page.
背景技术Background technique
Web页面渲染机制主要是先基于HTML(Hyper Text Markup Language,超文本标记语言)文件解析构建DOM(Document Object Model,文档对象模型)树和CSSOM(CSS ObjectModel,CSS对象模型)树,然后通过对DOM树和CSSOM树进行合并渲染得到Web页面。其中,CSSOM树基于HTML文件中的链接引入的外部CSS样式文件渲染得到,从而在页面渲染之前需要下载全部CSS样式文件,使得页面渲染效率降低,进而造成Web页面加载缓慢的现象。The Web page rendering mechanism is mainly based on HTML (Hyper Text Markup Language, hypertext markup language) file parsing to build a DOM (Document Object Model, Document Object Model) tree and CSSOM (CSS ObjectModel, CSS Object Model) tree, and then pass the DOM (Document Object Model, CSS Object Model) tree. The tree and CSSOM tree are combined and rendered to obtain a Web page. The CSSOM tree is rendered based on the external CSS style file introduced by the link in the HTML file, so all CSS style files need to be downloaded before page rendering, which reduces the page rendering efficiency and causes the slow loading of the Web page.
发明内容SUMMARY OF THE INVENTION
基于此,有必要针对上述技术问题,提供一种能够缓解页面加载缓慢的现象的Web页面的渲染方法、装置、计算机设备和存储介质。Based on this, it is necessary to provide a rendering method, apparatus, computer device and storage medium for a Web page that can alleviate the phenomenon of slow page loading, aiming at the above technical problems.
一种Web页面的渲染方法,所述方法包括:获取初始的页面渲染文件;所述页面渲染文件包括HTML文件和CSS文件;识别所述HTML文件中包含首页标签的样式引入语句;获取所述首页标签对应的样式类名;在所述CSS文件中识别每个样式类名对应的样式描述语句;基于所述样式描述语句填充替换所述HTML文件中相应的样式引入语句,得到优化后的页面渲染文件;当发生页面浏览操作时,基于所述优化后的页面渲染文件进行页面渲染。A method for rendering a Web page, the method comprising: obtaining an initial page rendering file; the page rendering file includes an HTML file and a CSS file; identifying a style import statement including a home page tag in the HTML file; obtaining the home page The style class name corresponding to the label; identifying the style description statement corresponding to each style class name in the CSS file; filling and replacing the corresponding style import statement in the HTML file based on the style description statement to obtain optimized page rendering file; when a page browsing operation occurs, page rendering is performed based on the optimized page rendering file.
在一个实施例中,基于所述样式描述语句填充替换所述HTML文件中相应的样式引入语句,得到优化后的页面渲染文件,包括:确定初始的所述CSS文件适用的基准尺寸;获取预置的多种目标尺寸分别对应的样式调整信息;根据所述样式调整信息对适用于所述基准尺寸的CSS文件中的样式参数进行调整,得到每种所述目标尺寸分别对应的目标CSS文件;基于从每种目标CSS文件中获取的样式描述语句填充替换所述HTML文件中相应的样式引入语句,得到每种目标尺寸对应的优化后的页面渲染文件。In one embodiment, filling and replacing the corresponding style introduction statement in the HTML file based on the style description statement, to obtain an optimized page rendering file, includes: determining an initial applicable reference size of the CSS file; obtaining a preset The style adjustment information corresponding to the various target sizes respectively; according to the style adjustment information, the style parameters in the CSS file applicable to the reference size are adjusted to obtain the target CSS file corresponding to each of the target sizes; based on The style description sentences obtained from each target CSS file fill in and replace the corresponding style introduction sentences in the HTML file, so as to obtain an optimized page rendering file corresponding to each target size.
在一个实施例中,所述当发生页面浏览操作时,基于所述优化后的页面渲染文件进行页面渲染,包括:确定发生页面浏览操作的终端的屏幕尺寸;基于所述屏幕尺寸对应的优化后的页面渲染文件进行页面渲染。In one embodiment, performing page rendering based on the optimized page rendering file when a page browsing operation occurs includes: determining the screen size of the terminal where the page browsing operation occurs; The page rendering file for page rendering.
在一个实施例中,所述当发生页面浏览操作时,基于所述优化后的页面渲染文件进行页面渲染,包括:当发生首页浏览操作时,获取所述优化后的页面渲染文件;对所述优化后的页面渲染文件进行解析,构建DOM树;基于所述DOM树渲染得到所述首页浏览操作所指向的Web首页。In one embodiment, the performing page rendering based on the optimized page rendering file when a page browsing operation occurs includes: when a home page browsing operation occurs, acquiring the optimized page rendering file; The optimized page rendering file is parsed to construct a DOM tree; the Web home page pointed to by the home page browsing operation is obtained by rendering based on the DOM tree.
在一个实施例中,所述当发生页面浏览操作时,基于所述优化后的页面渲染文件进行页面渲染,包括:当发生非首页浏览操作时,确定发生非首页浏览操作的终端的屏幕尺寸;获取所述屏幕尺寸对应的目标CSS文件;对获取的目标CSS文件及优化后的HTML文件分别进行解析,构建DOM树和CSSOM树;基于所述DOM树及所述CSSOM树渲染得到所述非首页浏览操作所指向的Web页面。In one embodiment, when a page browsing operation occurs, performing page rendering based on the optimized page rendering file includes: when a non-home page browsing operation occurs, determining the screen size of the terminal where the non-home page browsing operation occurs; Obtain the target CSS file corresponding to the screen size; parse the obtained target CSS file and the optimized HTML file respectively to construct a DOM tree and a CSSOM tree; render the non-home page based on the DOM tree and the CSSOM tree Browse the web page to which the action is directed.
在一个实施例中,所述基于所述优化后的页面渲染文件进行页面渲染之前,所述方法还包括:拦截基于目标应用触发的页面浏览操作;确定所述目标应用对应运行环境的环境标识;根据所述目标应用及所述环境标识获取对应的路由配置信息;生成所述页面浏览操作对应的页面加载请求;根据所述路由配置信息将所述页面加载请求分流发送至服务器或缓存;接收从所述服务器或缓存拉取的页面资源;所述页面资源包括优化后的页面渲染文件。In one embodiment, before the page rendering is performed based on the optimized page rendering file, the method further includes: intercepting a page browsing operation triggered by a target application; determining an environment identifier of the operating environment corresponding to the target application; Acquire corresponding routing configuration information according to the target application and the environment identifier; generate a page loading request corresponding to the page browsing operation; distribute the page loading request to the server or cache according to the routing configuration information; The page resource pulled by the server or the cache; the page resource includes the optimized page rendering file.
一种Web页面的渲染装置,所述装置包括:渲染文件获取模块,用于获取初始的页面渲染文件;所述页面渲染文件包括HTML文件和CSS文件;渲染文件优化模块,用于识别所述HTML文件中包含首页标签的样式引入语句;获取所述首页标签对应的样式类名;在所述CSS文件中识别每个样式类名对应的样式描述语句;基于所述样式描述语句填充替换所述HTML文件中相应的样式引入语句,得到优化后的页面渲染文件;页面渲染模块,用于当发生页面浏览操作时,基于所述优化后的页面渲染文件进行页面渲染。A rendering device for a Web page, the device comprising: a rendering file acquisition module for acquiring an initial page rendering file; the page rendering file includes an HTML file and a CSS file; a rendering file optimization module for identifying the HTML file The file contains the style introduction statement of the homepage label; obtains the style class name corresponding to the homepage label; identifies the style description statement corresponding to each style class name in the CSS file; fills and replaces the HTML based on the style description statement The corresponding style introduction statement in the file is used to obtain an optimized page rendering file; the page rendering module is used to perform page rendering based on the optimized page rendering file when a page browsing operation occurs.
在一个实施例中,所述渲染文件优化模块还用于确定初始的所述CSS文件适用的基准尺寸;获取预置的多种目标尺寸分别对应的样式调整信息;根据所述样式调整信息对适用于所述基准尺寸的CSS文件中的样式参数进行调整,得到每种所述目标尺寸分别对应的目标CSS文件;基于从每种目标CSS文件中获取的样式描述语句填充替换所述HTML文件中相应的样式引入语句,得到每种目标尺寸对应的优化后的页面渲染文件。In one embodiment, the rendering file optimization module is further configured to determine the initial applicable benchmark size of the CSS file; obtain style adjustment information corresponding to multiple preset target sizes; Adjust the style parameters in the CSS file of the reference size to obtain a target CSS file corresponding to each of the target sizes; fill and replace the corresponding HTML file based on the style description statement obtained from each target CSS file. style import statement to get the optimized page rendering file corresponding to each target size.
一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现本申请任意一个实施例中提供的Web页面的渲染方法的步骤。A computer device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the processor implements the steps of the Web page rendering method provided in any one of the embodiments of the present application.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现本申请任意一个实施例中提供的Web页面的渲染方法的步骤。A computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of the Web page rendering method provided in any one of the embodiments of this application.
上述Web页面的渲染方法、装置、计算机设备和存储介质,首页需要的CSS样式信息已经记录在优化后的HTML文件中,无需下载外部的CSS文件即可实现首页快速渲染;同时在快速渲染首页的过程中,终端在用户无感知的情况下持续下载其他页面的CSS文件,给予CSS文件更充裕的下载时间,从而可以缓解页面加载缓慢的现象。For the rendering method, device, computer equipment and storage medium of the above-mentioned Web page, the CSS style information required by the home page has been recorded in the optimized HTML file, and the home page can be quickly rendered without downloading an external CSS file; During the process, the terminal continues to download the CSS files of other pages without the user's perception, giving the CSS files more sufficient download time, thereby alleviating the phenomenon of slow page loading.
附图说明Description of drawings
图1为一个实施例中Web页面的渲染方法的应用场景图;Fig. 1 is the application scene diagram of the rendering method of Web page in one embodiment;
图2为一个实施例中Web页面的渲染方法的流程示意图;2 is a schematic flowchart of a method for rendering a Web page in one embodiment;
图3为一个实施例中Web页面的渲染装置的结构框图;3 is a structural block diagram of an apparatus for rendering a Web page in one embodiment;
图4为一个实施例中计算机设备的内部结构图。FIG. 4 is a diagram of the internal structure of a computer device in one embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
本申请提供的Web页面的渲染方法,可以应用于如图1所示的应用环境中。其中,终端102与服务器104通过网络进行通信。其中,终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。终端102上运行了目标应用。目标应用可以是单页Web应用、也可以是混合应用。终端102上还运行了渲染优化工具。渲染优化工具可以作为目标应用的运行插件。渲染优化工具也可以作为独立工具,与目标应用运行在不同的终端上。The rendering method for a Web page provided by the present application can be applied to the application environment shown in FIG. 1 . The
渲染优化工具用于对不同目标应用初始的页面渲染文件进行优化。具体地,渲染优化工具获取初始的页面渲染文件。页面渲染文件包括HTML文件和CSS文件。渲染优化工具识别HTML文件中包含首页标签的样式引入语句,并获取首页标签对应的一个或多个样式类名。渲染优化工具在CSS文件中识别每个样式类名对应的样式描述语句。渲染优化组件利用样式描述语句填充替换HTML文件中相应的样式引入语句,从而完成对页面渲染文件的优化。渲染优化工具将优化后的页面渲染文件存储至为目标应用提供服务的服务器104。容易理解,对初始的页面渲染文件的优化处理可以在服务器104进行,对此不作限制。终端102中部署了存放目标应用对应页面渲染文件的缓存。当终端102发生对目标应用的启动操作时,终端102将从服务器104拉取优化后的页面渲染文件存储至缓存。当终端102发生基于目标应用页面浏览操作时,终端102基于优化后的页面渲染文件进行页面渲染。上述Web页面的渲染过程,首先渲染的页面(以下简称首页)需要的CSS样式信息已经记录在优化后的HTML文件中,无需下载外部的CSS文件即可实现首页快速渲染;同时在快速渲染首页的过程中,终端在用户无感知的情况下持续下载其他页面的CSS文件,给予CSS文件更充裕的下载时间,从而可以缓解页面加载缓慢的现象。The rendering optimization tool is used to optimize the initial page rendering file for different target applications. Specifically, the rendering optimization tool obtains the initial page rendering file. Page rendering files include HTML files and CSS files. The rendering optimization tool recognizes the style import statement containing the home page tag in the HTML file, and obtains one or more style class names corresponding to the home page tag. The rendering optimization tool identifies the style description statement corresponding to each style class name in the CSS file. The rendering optimization component fills and replaces the corresponding style introduction statement in the HTML file with the style description statement, thereby completing the optimization of the page rendering file. The rendering optimization tool stores the optimized page rendering file to the
在一个实施例中,如图2所示,提供了一种Web页面的渲染方法,以该方法应用于图1中的终端为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 2 , a method for rendering a Web page is provided, and the method is applied to the terminal in FIG. 1 as an example for description, including the following steps:
步骤202,获取初始的页面渲染文件;页面渲染文件包括HTML文件和CSS文件。Step 202: Obtain an initial page rendering file; the page rendering file includes an HTML file and a CSS file.
初始的页面渲染文件包括HTML文件(记作初始HTML文件)以及基于初始HTML文件引入的外部文件,如JS文件、CSS文件等。初始的页面渲染文件还包括初始HTML文件内涉及的图片或多媒体资源等。其中,HTML文件是由HTML命令组成的描述性文本,HTML命令可以说明文字、图形、动画、声音、表格、链接等页面元素。JS文件用于对HTML文件中的页面元素进行操作,使Web页面产生动态效果;CSS文件用于对页面元素以不同的样式(如字体、字号、颜色等)呈现。The initial page rendering file includes an HTML file (referred to as an initial HTML file) and external files introduced based on the initial HTML file, such as a JS file, a CSS file, and the like. The initial page rendering file also includes pictures or multimedia resources involved in the initial HTML file. Among them, the HTML file is a descriptive text composed of HTML commands, and the HTML commands can describe page elements such as text, graphics, animation, sound, tables, and links. The JS file is used to operate the page elements in the HTML file to produce dynamic effects on the Web page; the CSS file is used to render the page elements in different styles (such as font, font size, color, etc.).
步骤204,识别HTML文件中包含首页标签的样式引入语句。
步骤206,获取首页标签对应的样式类名。Step 206: Obtain the style class name corresponding to the homepage label.
目标应用可以展示多个页面。HMTL文件记录了目标应用中每个页面对应的相关属性语句,如样式属性语句。相关属性语句包括HTML标签及class属性。HTML标签是HTML语言中最基本的单位,是由尖括号包围的关键词,比如<html>、<div>等。目标应用可以展示多个页面。首页标签是指目标应用首个页面对应的HTML标签。不同HTML标签后面会带有不同class属性,如样式属性、计算属性、事件监听属性等。属性信息可以基于外部其他文件进行记载。例如,用于记录样式属性的外部CSS文件是通过在<head>标签内使用<link>标签链接到HTML文件内,如<link href="base.css"rel="stylesheet"type="text/css"/>。其中,base.css为CSS文件名称。The target application can display multiple pages. The HMTL file records relevant attribute statements corresponding to each page in the target application, such as style attribute statements. Relevant attribute statements include HTML tags and class attributes. HTML tags are the most basic units in the HTML language, and are keywords surrounded by angle brackets, such as <html>, <div>, etc. The target application can display multiple pages. The home page tag refers to the HTML tag corresponding to the first page of the target application. Different HTML tags will be followed by different class attributes, such as style attributes, computed attributes, event listener attributes, etc. Attribute information can be recorded based on other external files. For example, an external CSS file for recording style properties is linked to the HTML file by using a <link> tag within the <head> tag, such as <link href="base.css" rel="stylesheet" type="text/ css"/>. Among them, base.css is the CSS file name.
样式属性语句可以是样式引入语句,也可以是样式描述语句。其中,样式描述语句为HTML文件中用于记录具体的字体、字号或颜色等样式信息的语句。样式引入语句是指HTML文件中用于引入外部CSS文件的语句。样式引入语句采用异步注入CSS文件的方式,即动态创建link元素,设置href为CSS文件地址,插入到HTML文件的head头部中,实现异步加载CSS文件。包含首页标签的样式引入语句是指用于目标应用首个页面对应的样式引入语句。A style attribute statement can be a style introduction statement or a style description statement. The style description statement is a statement used to record specific style information such as font, font size or color in the HTML file. A style import statement refers to a statement in an HTML file that is used to import an external CSS file. The style introduction statement adopts the method of asynchronously injecting the CSS file, that is, dynamically creating the link element, setting the href as the address of the CSS file, and inserting it into the head header of the HTML file to realize the asynchronous loading of the CSS file. The style import statement containing the home page tag refers to the style import statement corresponding to the first page of the target application.
步骤208,在CSS文件中识别每个样式类名对应的样式描述语句。Step 208: Identify the style description statement corresponding to each style class name in the CSS file.
当需要对目标应用的页面效率进行优化时,可以通过渲染优化工具对目标应用对应的页面渲染文件进行优化处理。具体地,样式引入语句包括查找构建DOM树所依赖的样式类名。CSS文件也包括相同的样式类名。渲染优化工具在CSS文件中查找首页标签对应的样式类名,提取查找到的每个样式类名对应的样式描述语句。When the page efficiency of the target application needs to be optimized, a rendering optimization tool can be used to optimize the page rendering file corresponding to the target application. Specifically, the style import statement includes looking up the style class name upon which the DOM tree is built. The CSS file also includes the same style class name. The rendering optimization tool searches the CSS file for the style class name corresponding to the home page tag, and extracts the style description statement corresponding to each style class name found.
步骤210,基于样式描述语句填充替换HTML文件中相应的样式引入语句,得到优化后的页面渲染文件。
渲染优化工具将样式引入语句从HTML文件中移除,变更为相应的样式描述语句。渲染优化工具对替换后的HTML文件(记作目标HTML文件)、CSS文件等进行打包,得到优化后的页面渲染文件。The rendering optimization tool removes the style import statement from the HTML file and changes it to the corresponding style description statement. The rendering optimization tool packages the replaced HTML files (referred to as target HTML files), CSS files, etc., to obtain optimized page rendering files.
步骤212,当发生页面浏览操作时,基于优化后的页面渲染文件进行页面渲染。
终端获取到用户在目标应用触发的页面浏览操作时,加载优化后的页面渲染文件,基于优化后的页面渲染文件进行页面渲染。When the terminal acquires the page browsing operation triggered by the target application, the terminal loads the optimized page rendering file, and performs page rendering based on the optimized page rendering file.
需要说明的是,也可以根据需求按照上述方式将目标应用初始的多个页面的加载速度进行优化。当应当综合考虑优化后页面渲染文件的结构清晰性,避免因将页面对应的样式引入语句替换为样式描述语句,使得HTML文件结构杂乱无章。It should be noted that the loading speed of the initial multiple pages of the target application can also be optimized according to the requirements in the above manner. When comprehensive consideration should be given to the clarity of the structure of the page rendering file after optimization, it should be avoided that the HTML file structure is disorganized by replacing the style introduction statement corresponding to the page with the style description statement.
本实施例中,通过识别HTML文件中包含首页标签的样式引入语句,可以获取首页标签对应的样式类名;通过在CSS文件中识别每个样式类名对应的样式描述语句,并基于样式描述语句填充替换HTML文件中相应的样式引入语句,即可实现对页面渲染文件的优化;后续当发生页面浏览操作时,即可基于优化后的页面渲染文件进行页面渲染。由于首页需要的CSS样式信息采用样式内联的方式,已经直接记录在优化后的HTML文件中,无需下载外部的CSS文件即可实现首页快速渲染;同时在快速渲染首页的过程中,终端在用户无感知的情况下持续下载其他页面的CSS文件,给予CSS文件更充裕的下载时间,从而可以缓解页面加载缓慢的现象。In this embodiment, the style class name corresponding to the home page label can be obtained by identifying the style introduction statement containing the home page label in the HTML file; by identifying the style description statement corresponding to each style class name in the CSS file, and based on the style description statement By filling in and replacing the corresponding style introduction statement in the HTML file, the page rendering file can be optimized; when subsequent page browsing operations occur, page rendering can be performed based on the optimized page rendering file. Since the CSS style information required by the home page adopts the style inline method, it has been directly recorded in the optimized HTML file, and the home page can be quickly rendered without downloading an external CSS file. Continuously download CSS files of other pages without perception, giving CSS files more time to download, which can alleviate the phenomenon of slow page loading.
在一个实施例中,基于样式描述语句填充替换HTML文件中相应的样式引入语句,得到优化后的页面渲染文件,包括:确定初始的CSS文件适用的基准尺寸;获取预置的多种目标尺寸分别对应的样式调整信息;根据样式调整信息对适用于基准尺寸的CSS文件中的样式参数进行调整,得到每种目标尺寸分别对应的目标CSS文件;基于从每种目标CSS文件中获取的样式描述语句填充替换HTML文件中相应的样式引入语句,得到每种目标尺寸对应的优化后的页面渲染文件。In one embodiment, filling and replacing corresponding style introduction statements in the HTML file based on the style description statements, to obtain an optimized page rendering file, includes: determining the applicable reference size of the initial CSS file; obtaining preset multiple target sizes respectively Corresponding style adjustment information; adjust the style parameters in the CSS file applicable to the reference size according to the style adjustment information, and obtain the target CSS file corresponding to each target size; based on the style description statement obtained from each target CSS file Fill in and replace the corresponding style introduction statement in the HTML file to obtain the optimized page rendering file corresponding to each target size.
初始的页面渲染文件中CSS文件(记作初始CSS文件)记录了某种屏幕尺寸(记作基准尺寸)适用的CSS样式。比如,CSS文件适用于屏幕尺寸为960px的终端,960px即为该CSS文件对应的基准尺寸。若以基准尺寸的展示样式为准,在其他尺寸的终端屏幕上可能有部分页面内容看不到,或者有部分页面内容空余。The CSS file (referred to as the initial CSS file) in the initial page rendering file records the CSS style applicable to a certain screen size (referred to as the reference size). For example, the CSS file is suitable for a terminal with a screen size of 960px, and 960px is the reference size corresponding to the CSS file. If the display style of the reference size prevails, some page content may not be visible on terminal screens of other sizes, or some page content may be empty.
渲染优化工具还用于将适用于不同尺寸终端的CSS文件进行分离。具体地,渲染优化工具中预置了多种目标尺寸分别对应的样式调整信息。样式调整信息包括对CSS文件中的样式参数增大或减小的比例信息。渲染优化工具根据样式调整信息对适用于基准尺寸的CSS文件中的样式参数进行调整,得到每种目标尺寸分别对应的目标CSS文件。将不同尺寸终端适用的样式信息分开记录在不同目标CSS文件中,使用link的媒体查询属性,可以减少CSS文件加载所需时间。Render optimization tools are also used to separate CSS files for different sized terminals. Specifically, the rendering optimization tool is preset with style adjustment information corresponding to various target sizes. The style adjustment information includes proportional information for increasing or decreasing style parameters in the CSS file. The rendering optimization tool adjusts the style parameters in the CSS file applicable to the reference size according to the style adjustment information, and obtains the target CSS file corresponding to each target size. The style information applicable to terminals of different sizes is separately recorded in different target CSS files, and the media query property of link can be used to reduce the time required for loading CSS files.
在一个实施例中,当发生页面浏览操作时,基于优化后的页面渲染文件进行页面渲染,包括:确定发生页面浏览操作的终端的屏幕尺寸;基于屏幕尺寸对应的优化后的页面渲染文件进行页面渲染。In one embodiment, when a page browsing operation occurs, performing page rendering based on the optimized page rendering file includes: determining the screen size of the terminal where the page browsing operation occurs; performing page rendering based on the optimized page rendering file corresponding to the screen size render.
渲染优化工具通过匹配不同尺寸的屏幕的样式,将适用于不同目标尺寸终端的目标HTML文件和目标CSS文件等进行打包,得到每种目标尺寸对应的优化后的页面渲染文件。终端获取到用户在目标应用触发的页面浏览操作时,只需拉取该终端对应屏幕尺寸的优化后的页面渲染文件进行页面渲染即可。The rendering optimization tool packages the target HTML files and target CSS files suitable for terminals of different target sizes by matching the styles of screens of different sizes, and obtains optimized page rendering files corresponding to each target size. When the terminal acquires the page browsing operation triggered by the user in the target application, it only needs to pull the optimized page rendering file corresponding to the screen size of the terminal to perform page rendering.
本实施例中,预先针对不同目标尺寸分别构建对应的CSS文件,当需要基于运行在不同尺寸终端上的目标应用加载页面时只需调取相应的CSS文件构建DOM树即可,自适应终端尺寸变更页面样式,避免了传统方式每次加载页面均需动态调整样式参数的繁琐,一劳永逸,也可以提高页面加载速度。In this embodiment, corresponding CSS files are built for different target sizes in advance. When pages need to be loaded based on target applications running on terminals of different sizes, it is only necessary to call the corresponding CSS files to build a DOM tree, and adapt to the terminal size Changing the page style avoids the tediousness of dynamically adjusting the style parameters every time the page is loaded in the traditional method, once and for all, and can also improve the page loading speed.
在一个实施例中,当发生页面浏览操作时,基于优化后的页面渲染文件进行页面渲染,包括:当发生首页浏览操作时,获取优化后的页面渲染文件;对优化后的页面渲染文件进行解析,构建DOM树;基于DOM树渲染得到首页浏览操作所指向的Web首页。In one embodiment, when a page browsing operation occurs, page rendering is performed based on an optimized page rendering file, including: when a home page browsing operation occurs, obtaining an optimized page rendering file; parsing the optimized page rendering file , build a DOM tree; render based on the DOM tree to obtain the Web home page pointed to by the home page browsing operation.
首页浏览操作是指用户请求加载目标应用的首页的操作。当用户通过终端访问目标应用首页时,DNS(Domain Name System,DNS)服务器根据用户基于首页浏览操作提供的域名查找对应的IP地址。DNS服务器向对应IP地址的网络服务器发送http(Hyper TextTransfer Protocol,超文本传输协议)请求。网络服务器解析http请求,并发送http请求给数据库服务器。数据库服务器将http请求对应的优化后的页面渲染文件返回给网络服务器。网络服务器基于优化后的页面渲染文件生成http响应,将http响应返回给目标应用。目标应用解析http响应,下载优化后的页面渲染文件。The home page browsing operation refers to an operation that the user requests to load the home page of the target application. When the user accesses the home page of the target application through the terminal, the DNS (Domain Name System, DNS) server searches for the corresponding IP address according to the domain name provided by the user based on the home page browsing operation. The DNS server sends an http (Hyper TextTransfer Protocol, hypertext transfer protocol) request to the network server corresponding to the IP address. The web server parses the http request and sends the http request to the database server. The database server returns the optimized page rendering file corresponding to the http request to the web server. The web server generates an http response based on the optimized page rendering file, and returns the http response to the target application. The target application parses the http response and downloads the optimized page rendering file.
目标应用对优化后的页面渲染文件中的字节流解码得到字符流,通过词法分析器奖字符流解释成词语,基于得到的词语构建成节点,最后利用这些节点构建得到一颗DOM树。DOM树为多叉树结构,包括文档节点、元素(Element)节点、属性节点、Entity节点、注释(Comment)节点等。The target application decodes the byte stream in the optimized page rendering file to obtain a character stream, interprets the character stream into words through a lexical analyzer, builds nodes based on the obtained words, and finally uses these nodes to build a DOM tree. The DOM tree is a multi-fork tree structure, including a document node, an element (Element) node, an attribute node, an Entity node, a comment (Comment) node, and the like.
值得注意的是,本实施例适用于多种目标应用,如单页web应用、多页Web应用等。若目标应用为多页Web应用,该实施例的技术优势将更加明显,可以使多页Web应用中每个Web页面均可只依赖DOM树即可渲染得到,进而提高每个Web页面的加载速度。而对于单页Web应用,则可以提高首页的加载速度。It is worth noting that this embodiment is applicable to various target applications, such as a single-page web application, a multi-page web application, and the like. If the target application is a multi-page web application, the technical advantages of this embodiment will be more obvious, and each web page in the multi-page web application can be rendered only by relying on the DOM tree, thereby improving the loading speed of each web page . For single-page web applications, it can improve the loading speed of the home page.
本实施例中,通过渲染优化工具抽取CSS文件中首屏所需的样式,并将抽取的目标样式内联至HTML文件,实现Web首屏渲染时只需依赖DOM树即可,而无需等待全部CSS文件加载完毕才能进行首页渲染,只需进行目标Html文件的加载即可进行首页渲染,减少首屏加载时间,提高首页加载速度。In this embodiment, the rendering optimization tool is used to extract the styles required for the first screen in the CSS file, and the extracted target styles are inlined into the HTML file, so that the rendering of the first screen of the Web only needs to rely on the DOM tree without waiting for all the The home page can be rendered only after the CSS file is loaded, and the home page can be rendered only by loading the target Html file, reducing the loading time of the first screen and improving the loading speed of the home page.
在一个实施例中,当发生页面浏览操作时,基于优化后的页面渲染文件进行页面渲染,包括:当发生非首页浏览操作时,确定发生非首页浏览操作的终端的屏幕尺寸;获取屏幕尺寸对应的目标CSS文件;对获取的目标CSS文件及优化后的HTML文件分别进行解析,构建DOM树和CSSOM树;基于DOM树及CSSOM树渲染得到非首页浏览操作所指向的Web页面。In one embodiment, when a page browsing operation occurs, performing page rendering based on the optimized page rendering file includes: when a non-home page browsing operation occurs, determining the screen size of the terminal where the non-home page browsing operation occurs; obtaining the corresponding screen size The target CSS file is obtained; the obtained target CSS file and the optimized HTML file are parsed respectively to construct a DOM tree and a CSSOM tree; based on the DOM tree and CSSOM tree rendering, the Web page pointed to by the non-home page browsing operation is obtained.
非首页浏览操作是指用户请求加载目标应用除首页之外的其他页面的操作。对于除首页之外的其他页面的渲染,仍需下载外部目标CSS文件,并对目标CSS文件解析构建CSSOM树。基于DOM树及CSSOM树才能渲染得到其他页面。A non-home page browsing operation refers to an operation in which a user requests to load pages other than the home page of the target application. For the rendering of other pages except the home page, it is still necessary to download the external target CSS file, and parse the target CSS file to build the CSSOM tree. Other pages can only be rendered based on the DOM tree and CSSOM tree.
目标应用根据触发的非首页浏览操作,动态获取当前屏幕尺寸。目标应用根据当前屏幕尺寸,通过link的media媒体查询拉取相匹配的目标HTML文件及目标CSS文件。目标应用对目标Html文件及目标CSS文件分别进行解析,构建DOM树及CSSOM树。此时渲染的CSSOM树中可以不再包含首页的样式信息。目标应用基于DOM树及CSSOM树渲染得到web页面,展示Web页面。The target application dynamically obtains the current screen size according to the triggered non-home page browsing operation. The target application pulls the matching target HTML file and target CSS file through the media media query of the link according to the current screen size. The target application parses the target Html file and the target CSS file respectively, and constructs a DOM tree and a CSSOM tree. At this time, the rendered CSSOM tree may no longer contain the style information of the home page. The target application renders the web page based on the DOM tree and the CSSOM tree, and displays the web page.
本实施例中,基于预设的多种CSS文件,可以使页面渲染可以更好的适应不同尺寸的终端屏幕。In this embodiment, based on multiple preset CSS files, page rendering can be better adapted to terminal screens of different sizes.
在一个实施例中,基于优化后的页面渲染文件进行页面渲染之前,方法还包括:拦截基于目标应用触发的页面浏览操作;确定目标应用对应运行环境的环境标识;根据目标应用及环境标识获取对应的路由配置信息;生成页面浏览操作对应的页面加载请求;根据路由配置信息将页面加载请求分流发送至服务器或缓存;接收从服务器或缓存拉取的页面资源;页面资源包括优化后的页面渲染文件。In one embodiment, before page rendering is performed based on the optimized page rendering file, the method further includes: intercepting a page browsing operation triggered by the target application; determining the environment identifier of the operating environment corresponding to the target application; obtaining the corresponding environment identifier according to the target application and the environment identifier generate the page loading request corresponding to the page browsing operation; send the page loading request to the server or cache according to the routing configuration information; receive page resources pulled from the server or cache; page resources include optimized page rendering files .
目标应用中集成了页面加载组件。页面加载组件作为一种反向代理,用于通过调用目标应用暴露的API(Application Programming Interface,应用程序编程接口)监听并拦截用户基于目标应用触发的页面浏览操作。页面浏览操作可以是基于网址链接或者搜索条目触发的跳入目标网站的操作,或者基于网络页面中某个控件触发的页面跳转的操作等。The page loading component is integrated in the target application. As a reverse proxy, the page loading component is used to monitor and intercept page browsing operations triggered by the user based on the target application by calling an API (Application Programming Interface, application programming interface) exposed by the target application. The page browsing operation may be an operation of jumping to a target website triggered by a URL link or a search entry, or an operation of jumping to a page triggered by a control in a web page, and the like.
当发生页面浏览操作时,页面加载组件确定目标应用对应运行环境的环境标识。其中,运行环境包括开发环境、测试环境和生成环境。页面加载组件提供每种运行环境分别对应的环境选项。通过选定不同的环境选项可以触发页面加载组件处于不同的工作模式,支持用户预先针对不同的目标应用在不同运行环境下的路由信息进行配置(以下称路由配置信息)。When a page browsing operation occurs, the page loading component determines the environment identifier of the operating environment corresponding to the target application. The running environment includes a development environment, a test environment and a production environment. The page loading component provides environment options corresponding to each running environment. By selecting different environment options, the page loading component can be triggered to be in different working modes, and the user can pre-configure the routing information for different target applications in different operating environments (hereinafter referred to as routing configuration information).
页面加载组件根据目标应用及环境标识获取对应的路由配置信息。路由配置信息用于指定资源获取请求对应的资源获取类型。资源获取类型基于服务器拉取和基于缓存拉取两种。换言之,路由配置信息用于指定哪些资源获取请求需要从服务器拉取页面资源,哪些资源获取请求从本地缓存中拉取页面资源。路由配置信息包括页面资源的资源标识以及对应的访问路由。其中,访问路由可以是访问域名、协议、端口、URL(Uniform ResourceLocator,同一资源定位符)、路径或正则匹配中的至少一项。换言之,页面加载组件支持用户灵活的通过访问域名、协议、端口、URL、路径或正则匹配等多种形式进行路由配置。The page loading component obtains the corresponding routing configuration information according to the target application and the environment identifier. The routing configuration information is used to specify the resource acquisition type corresponding to the resource acquisition request. There are two types of resource acquisition: server-based pull and cache-based pull. In other words, the routing configuration information is used to specify which resource acquisition requests need to pull page resources from the server, and which resource acquisition requests pull page resources from the local cache. The routing configuration information includes resource identifiers of page resources and corresponding access routes. The access route may be at least one of access domain name, protocol, port, URL (Uniform ResourceLocator, the same resource locator), path or regular matching. In other words, the page loading component supports users to flexibly configure routing by accessing domain names, protocols, ports, URLs, paths, or regular matching.
不同目标应用对应的访问域名不同,从而不同目标应用对应的路由配置信息不同。不同环境选项对应的路由配置信息也不相同。比如,在开发环境,为了便于测试,开发人员期望每修改一行代码都能实时的查看页面效果,此时可以配置全部的资源获取请求从服务器拉取页面资源。而对于生产环境,为了兼顾页面加载效率,可以仅配置部分资源获取请求从服务器拉取页面资源,或者全部资源获取请求从缓存中拉取页面资源。The access domain names corresponding to different target applications are different, so the routing configuration information corresponding to different target applications is different. The routing configuration information corresponding to different environment options is also different. For example, in the development environment, in order to facilitate testing, developers expect that each line of code can be modified to view the page effect in real time. At this time, all resource acquisition requests can be configured to pull page resources from the server. For the production environment, in order to take into account the page loading efficiency, you can configure only some resource acquisition requests to pull page resources from the server, or all resource acquisition requests to pull page resources from the cache.
目标应用根据用户触发的页面浏览操作,生成相应的资源获取请求。完成某个网络页面的加载可能需要拉取多种页面资源。页面资源包括上述页面渲染文件,以及html文件内涉及的图片或多媒体资源等。The target application generates a corresponding resource acquisition request according to the page browsing operation triggered by the user. Completing the loading of a web page may require pulling multiple page resources. The page resources include the above-mentioned page rendering files, as well as pictures or multimedia resources involved in the html file.
页面加载组件根据路由配置信息将资源获取请求分流发送至服务器或缓存。具体地,页面加载组件确定页面浏览操作所指向的目标页面,以及渲染目标页面所需的一种或多种页面资源,记作目标资源。页面加载组件根据路由配置信息,查询每个目标资源的访问路由。根据目标资源的访问路由可以确定目标资源对应的资源获取类型。比如,若访问路由为第一路由,则资源获取类型为“基于服务器拉取”,页面加载组件将相应目标资源的资源获取请求发送至服务器。若访问路由为第二路由,则资源获取类型为“基于缓存拉取”,页面加载组件将相应目标资源的资源获取请求发送至本地缓存。The page loading component offloads the resource acquisition request to the server or cache according to the routing configuration information. Specifically, the page loading component determines the target page pointed to by the page browsing operation, and one or more page resources required for rendering the target page, which are recorded as target resources. The page loading component queries the access route of each target resource according to the routing configuration information. The resource acquisition type corresponding to the target resource can be determined according to the access route of the target resource. For example, if the access route is the first route, the resource acquisition type is "server-based pull", and the page loading component sends the resource acquisition request of the corresponding target resource to the server. If the access route is the second route, the resource acquisition type is "cache-based pull", and the page loading component sends the resource acquisition request of the corresponding target resource to the local cache.
终端根据拉取到的页面资源渲染页面浏览操作所指向的页面,通过目标应用展示渲染得到的当前页面。The terminal renders the page pointed to by the page browsing operation according to the pulled page resource, and displays the rendered current page through the target application.
本实施例中,通过对基于目标应用触发的页面浏览操作监听并拦截,可以对不同的页面浏览操作采取不同的响应方式;根据预置的不同目标应用在不同运行环境下的路由配置信息,可以确定当前的页面浏览操作对应的路由配置信息;根据路由配置信息,可以将页面浏览操作对应页面加载请求分流发送至服务器或缓存,实现一种缓存开关的效果,相比传统的通过侵入目标应用在其URL中添加页面资源版本号的方式,可以在无需对目标应用程序代码做任何修改的情况下实现页面及时更新。此外,基于预置的路由配置信息,可以兼顾页面更新及时性以及页面加载效率,也可以满足用户在目标应用不同开发环节的开发需求。In this embodiment, by monitoring and intercepting page browsing operations triggered by target applications, different response modes can be adopted for different page browsing operations; Determine the routing configuration information corresponding to the current page browsing operation; according to the routing configuration information, the page loading request corresponding to the page browsing operation can be offloaded and sent to the server or cache to achieve the effect of a cache switch. By adding the page resource version number to its URL, the page can be updated in time without any modification to the target application code. In addition, based on the preset routing configuration information, the timeliness of page update and page loading efficiency can be taken into account, and it can also meet the development needs of users in different development links of the target application.
应该理解的是,虽然图2的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flowchart of FIG. 2 are shown in sequence according to the arrows, these steps are not necessarily executed in the sequence shown by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order, and these steps may be performed in other orders. Moreover, at least a part of the steps in FIG. 2 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed and completed at the same time, but may be executed at different times. The execution of these sub-steps or stages The sequence is also not necessarily sequential, but may be performed alternately or alternately with other steps or sub-steps of other steps or at least a portion of a phase.
在一个实施例中,如图3所示,提供了一种Web页面的渲染装置,包括:渲染文件获取模块302、渲染文件获取模块302和页面渲染模块306,其中:In one embodiment, as shown in FIG. 3, a rendering apparatus for a Web page is provided, including: a rendering
渲染文件获取模块302,用于获取初始的页面渲染文件;页面渲染文件包括HTML文件和CSS文件。The rendering
渲染文件优化模块304,用于识别HTML文件中包含首页标签的样式引入语句;获取首页标签对应的样式类名;在CSS文件中识别每个样式类名对应的样式描述语句;基于样式描述语句填充替换HTML文件中相应的样式引入语句,得到优化后的页面渲染文件。The rendering
页面渲染模块306,用于当发生页面浏览操作时,基于优化后的页面渲染文件进行页面渲染。The
在一个实施例中,渲染文件优化模块304还用于确定初始的CSS文件适用的基准尺寸;获取预置的多种目标尺寸分别对应的样式调整信息;根据样式调整信息对适用于基准尺寸的CSS文件中的样式参数进行调整,得到每种目标尺寸分别对应的目标CSS文件;基于从每种目标CSS文件中获取的样式描述语句填充替换HTML文件中相应的样式引入语句,得到每种目标尺寸对应的优化后的页面渲染文件。In one embodiment, the rendering
在一个实施例中,页面渲染模块306还用于确定发生页面浏览操作的终端的屏幕尺寸;基于屏幕尺寸对应的优化后的页面渲染文件进行页面渲染。In one embodiment, the
在一个实施例中,页面渲染模块306还用于当发生首页浏览操作时,获取优化后的页面渲染文件;对优化后的页面渲染文件进行解析,构建DOM树;基于DOM树渲染得到首页浏览操作所指向的Web首页。In one embodiment, the
在一个实施例中,页面渲染模块306还用于当发生非首页浏览操作时,确定发生非首页浏览操作的终端的屏幕尺寸;获取屏幕尺寸对应的目标CSS文件;对获取的目标CSS文件及优化后的HTML文件分别进行解析,构建DOM树和CSSOM树;基于DOM树及CSSOM树渲染得到非首页浏览操作所指向的Web页面。In one embodiment, the
在一个实施例中,上述装置还包括页面分流加载模块308,用于拦截基于目标应用触发的页面浏览操作;确定目标应用对应运行环境的环境标识;根据目标应用及环境标识获取对应的路由配置信息;生成页面浏览操作对应的页面加载请求;根据路由配置信息将页面加载请求分流发送至服务器或缓存;接收从服务器或缓存拉取的页面资源;页面资源包括优化后的页面渲染文件。In one embodiment, the above-mentioned apparatus further includes a page
关于Web页面的渲染装置的具体限定可以参见上文中对于Web页面的渲染方法的限定,在此不再赘述。上述Web页面的渲染装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the rendering apparatus of the Web page, reference may be made to the limitation of the rendering method of the Web page above, which will not be repeated here. Each module in the above-mentioned Web page rendering apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图4所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种Web页面的渲染方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided, and the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 4 . The computer equipment includes a processor, memory, a network interface, a display screen, and an input device connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium, an internal memory. The nonvolatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for rendering a Web page is implemented. The display screen of the computer equipment may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment may be a touch layer covered on the display screen, or a button, a trackball or a touchpad set on the shell of the computer equipment , or an external keyboard, trackpad, or mouse.
本领域技术人员可以理解,图3中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 3 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现本申请任意一个实施例中提供的Web页面的渲染方法的步骤。A computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of the Web page rendering method provided in any one of the embodiments of this application.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those skilled in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium , when the computer program is executed, it may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other medium used in the various embodiments provided in this application may include non-volatile and/or volatile memory. Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features It is considered to be the range described in this specification.
以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above examples only represent several embodiments of the present application, and the descriptions thereof are relatively specific and detailed, but should not be construed as a limitation on the scope of the invention patent. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the scope of protection of the patent of the present application shall be subject to the appended claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910744587.XA CN110647699A (en) | 2019-08-13 | 2019-08-13 | Web page rendering method, apparatus, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910744587.XA CN110647699A (en) | 2019-08-13 | 2019-08-13 | Web page rendering method, apparatus, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110647699A true CN110647699A (en) | 2020-01-03 |
Family
ID=69009547
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910744587.XA Pending CN110647699A (en) | 2019-08-13 | 2019-08-13 | Web page rendering method, apparatus, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110647699A (en) |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111258675A (en) * | 2020-01-15 | 2020-06-09 | 平安银行股份有限公司 | Rendering method, device, device and storage medium for sharing front-end components |
CN111259636A (en) * | 2020-02-07 | 2020-06-09 | 北京字节跳动网络技术有限公司 | Document rendering method and device and electronic equipment |
CN111399834A (en) * | 2020-03-13 | 2020-07-10 | 深圳前海环融联易信息科技服务有限公司 | Form style self-defining method and device, computer equipment and storage medium |
CN111427645A (en) * | 2020-03-20 | 2020-07-17 | 青岛聚好联科技有限公司 | H5-based cross-terminal adaptive display method and device |
CN111428170A (en) * | 2020-03-20 | 2020-07-17 | 湖南快乐阳光互动娱乐传媒有限公司 | Web page rendering method and device |
CN111580815A (en) * | 2020-05-08 | 2020-08-25 | 上海泛微网络科技股份有限公司 | Editing method of page elements and related equipment |
CN112287255A (en) * | 2020-07-13 | 2021-01-29 | 上海柯林布瑞信息技术有限公司 | Page construction method and device, computing equipment and computer readable storage medium |
CN112667330A (en) * | 2020-12-18 | 2021-04-16 | 中国平安人寿保险股份有限公司 | Page display method and computer equipment |
CN112818143A (en) * | 2021-01-30 | 2021-05-18 | 北京达佳互联信息技术有限公司 | Page display method and device, electronic equipment and storage medium |
CN113496000A (en) * | 2020-03-19 | 2021-10-12 | 腾讯科技(深圳)有限公司 | Page file processing method and device, computer storage medium and computer equipment |
CN114296809A (en) * | 2021-12-24 | 2022-04-08 | 深圳航天科技创新研究院 | An operating system-based object model construction method and its system call interface |
CN114398138A (en) * | 2022-01-19 | 2022-04-26 | 平安国际智慧城市科技股份有限公司 | Interface generation method and device, computer equipment and storage medium |
WO2022268191A1 (en) * | 2021-06-25 | 2022-12-29 | 贵州白山云科技股份有限公司 | Page loading method and apparatus, electronic device, and storage medium |
CN118035587A (en) * | 2023-12-13 | 2024-05-14 | 天翼云科技有限公司 | Browser rendering method, device and system |
US12243344B2 (en) | 2021-03-30 | 2025-03-04 | Wuhan China Star Optoelectronics Technology Co., Ltd. | Display panel and display device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170103140A1 (en) * | 2014-06-27 | 2017-04-13 | Huawei Technologies Co., Ltd. | Device and method for optimizing web page |
CN110007992A (en) * | 2019-02-27 | 2019-07-12 | 努比亚技术有限公司 | A kind of page display method, terminal and computer readable storage medium |
-
2019
- 2019-08-13 CN CN201910744587.XA patent/CN110647699A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170103140A1 (en) * | 2014-06-27 | 2017-04-13 | Huawei Technologies Co., Ltd. | Device and method for optimizing web page |
CN110007992A (en) * | 2019-02-27 | 2019-07-12 | 努比亚技术有限公司 | A kind of page display method, terminal and computer readable storage medium |
Cited By (24)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111258675A (en) * | 2020-01-15 | 2020-06-09 | 平安银行股份有限公司 | Rendering method, device, device and storage medium for sharing front-end components |
CN111259636A (en) * | 2020-02-07 | 2020-06-09 | 北京字节跳动网络技术有限公司 | Document rendering method and device and electronic equipment |
CN111259636B (en) * | 2020-02-07 | 2023-10-13 | 北京字节跳动网络技术有限公司 | Document rendering method and device and electronic equipment |
CN111399834B (en) * | 2020-03-13 | 2024-03-01 | 深圳前海环融联易信息科技服务有限公司 | Form style self-defining method, device, computer equipment and storage medium |
CN111399834A (en) * | 2020-03-13 | 2020-07-10 | 深圳前海环融联易信息科技服务有限公司 | Form style self-defining method and device, computer equipment and storage medium |
CN113496000A (en) * | 2020-03-19 | 2021-10-12 | 腾讯科技(深圳)有限公司 | Page file processing method and device, computer storage medium and computer equipment |
CN111427645A (en) * | 2020-03-20 | 2020-07-17 | 青岛聚好联科技有限公司 | H5-based cross-terminal adaptive display method and device |
CN111428170A (en) * | 2020-03-20 | 2020-07-17 | 湖南快乐阳光互动娱乐传媒有限公司 | Web page rendering method and device |
CN111428170B (en) * | 2020-03-20 | 2023-04-21 | 湖南快乐阳光互动娱乐传媒有限公司 | Web page rendering method and device |
CN111580815A (en) * | 2020-05-08 | 2020-08-25 | 上海泛微网络科技股份有限公司 | Editing method of page elements and related equipment |
CN111580815B (en) * | 2020-05-08 | 2023-07-28 | 上海泛微网络科技股份有限公司 | Page element editing method and related equipment |
CN112287255A (en) * | 2020-07-13 | 2021-01-29 | 上海柯林布瑞信息技术有限公司 | Page construction method and device, computing equipment and computer readable storage medium |
CN112287255B (en) * | 2020-07-13 | 2024-02-09 | 上海柯林布瑞信息技术有限公司 | Page construction method and device, computing equipment and computer readable storage medium |
CN112667330B (en) * | 2020-12-18 | 2024-02-09 | 中国平安人寿保险股份有限公司 | Page display method and computer equipment |
CN112667330A (en) * | 2020-12-18 | 2021-04-16 | 中国平安人寿保险股份有限公司 | Page display method and computer equipment |
CN112818143B (en) * | 2021-01-30 | 2022-03-25 | 北京达佳互联信息技术有限公司 | Page display method and device, electronic equipment and storage medium |
CN112818143A (en) * | 2021-01-30 | 2021-05-18 | 北京达佳互联信息技术有限公司 | Page display method and device, electronic equipment and storage medium |
US12243344B2 (en) | 2021-03-30 | 2025-03-04 | Wuhan China Star Optoelectronics Technology Co., Ltd. | Display panel and display device |
WO2022268191A1 (en) * | 2021-06-25 | 2022-12-29 | 贵州白山云科技股份有限公司 | Page loading method and apparatus, electronic device, and storage medium |
CN114296809B (en) * | 2021-12-24 | 2023-05-05 | 深圳航天科技创新研究院 | Object model construction method based on operating system and system call interface thereof |
CN114296809A (en) * | 2021-12-24 | 2022-04-08 | 深圳航天科技创新研究院 | An operating system-based object model construction method and its system call interface |
CN114398138A (en) * | 2022-01-19 | 2022-04-26 | 平安国际智慧城市科技股份有限公司 | Interface generation method and device, computer equipment and storage medium |
CN114398138B (en) * | 2022-01-19 | 2024-09-20 | 平安国际智慧城市科技股份有限公司 | Interface generation method, device, computer equipment and storage medium |
CN118035587A (en) * | 2023-12-13 | 2024-05-14 | 天翼云科技有限公司 | Browser rendering method, device and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110647699A (en) | Web page rendering method, apparatus, computer equipment and storage medium | |
CN110647700A (en) | Page resource loading method and device, computer equipment and storage medium | |
US9361345B2 (en) | Method and system for automated analysis and transformation of web pages | |
KR101824222B1 (en) | Fast rendering of websites containing dynamic content and stale content | |
US9641591B1 (en) | Modifying web content at a client | |
US9077681B2 (en) | Page loading optimization using page-maintained cache | |
US8856263B2 (en) | Systems and methods thereto for acceleration of web pages access using next page optimization, caching and pre-fetching techniques | |
US9509764B1 (en) | Updating cached web content | |
US9460222B2 (en) | System for rewriting dynamically generated uniform resource locators in proxied hyper text markup language content in accordance with proxy server rules | |
US8660976B2 (en) | Web content rewriting, including responses | |
CA2839006C (en) | Methods for making ajax web applications bookmarkable and crawlable and devices thereof | |
US9401949B1 (en) | Client web content cache purge | |
JP6203374B2 (en) | Web page style address integration | |
US10178147B1 (en) | Client-side location address translation | |
CN110221871B (en) | Webpage acquisition method and device, computer equipment and storage medium | |
CN105095280A (en) | Caching method and apparatus for browser | |
CN103581232B (en) | Web page transmission, web page display device and comprise the system of this device | |
CN105528369B (en) | Webpage code-transferring method, device and server | |
CN113836451A (en) | Web page access method, apparatus, computer equipment and storage medium | |
CN111723314B (en) | Webpage display method and device, electronic equipment and computer readable storage medium | |
CN104468740A (en) | Intelligent webpage transmission processing system and method | |
JP2013073464A (en) | Communication device, communication method, and program | |
CN105867953B (en) | Application upgrade package generation method, application upgrade method and corresponding device | |
CN107357897A (en) | A kind of method, apparatus and computer-readable storage medium for realizing user access control | |
Hellerøy | A Server-Side Feature Detection System for an Enterprise Web CMS |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20200103 |