CN116578795A - Webpage generation method and device, storage medium and electronic equipment - Google Patents
Webpage generation method and device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN116578795A CN116578795A CN202310404821.0A CN202310404821A CN116578795A CN 116578795 A CN116578795 A CN 116578795A CN 202310404821 A CN202310404821 A CN 202310404821A CN 116578795 A CN116578795 A CN 116578795A
- Authority
- CN
- China
- Prior art keywords
- picture
- text
- link
- rendered
- source
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/9577—Optimising the visualization of content, e.g. distillation of HTML documents
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
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
本公开是关于一种网页页面的生成方法及装置、存储介质、电子设备,涉及计算机技术领域,该方法包括:获取富文本字符串,并对所述富文本字符串进行处理,得到所述富文本字符串中包括的源图片链接以及待渲染文本;对所述待渲染文本进行渲染,得到文本页面渲染结果,并确定与所述文本页面渲染结果对应的当前可视区域;确定所述当前可视区域中的待渲染图片标签,并从所述待渲染图片标签的第一数据源属性中获取与所述源图片链接对应的压缩图片链接;在当前可视区域中加载与所述压缩图片链接对应的压缩图像,以生成网页页面。本公开提高了网页页面的生成效率。
The present disclosure relates to a method and device for generating a web page, a storage medium, and electronic equipment, and relates to the field of computer technology. The method includes: obtaining a rich text string, and processing the rich text string to obtain the rich text string. The source image link included in the text string and the text to be rendered; rendering the text to be rendered to obtain a text page rendering result, and determining the current visible area corresponding to the text page rendering result; determining the currently available The image tag to be rendered in the visual area, and obtain the compressed image link corresponding to the source image link from the first data source attribute of the image tag to be rendered; load the compressed image link in the current viewable area Corresponding compressed images to generate web pages. The disclosure improves the generation efficiency of web pages.
Description
技术领域technical field
本公开实施例涉及计算机技术领域,具体而言,涉及一种网页页面的生成方法、网页页面的生成装置、计算机可读存储介质以及电子设备。Embodiments of the present disclosure relate to the field of computer technology, and in particular, relate to a method for generating a webpage, a device for generating a webpage, a computer-readable storage medium, and an electronic device.
背景技术Background technique
现有的网页页面的生成方法中,可以通过直接对富文本内容进行渲染进而得到相应的页面。但是,页面在渲染过程需要加载的数据量较大时,用户需要等待的时间较长;也即,直接对富文本内容进行渲染存在页面渲染效率低的问题。In the existing method for generating a webpage, the corresponding page can be obtained by directly rendering the rich text content. However, when the page needs to load a large amount of data during the rendering process, the user needs to wait for a long time; that is, directly rendering the rich text content has the problem of low page rendering efficiency.
需要说明的是,在上述背景技术部分发明的信息仅用于加强对本公开的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。It should be noted that the information disclosed in the above background section is only for enhancing the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to those of ordinary skill in the art.
发明内容Contents of the invention
本公开的目的在于提供一种网页页面的生成方法、网页页面的生成装置、计算机可读存储介质以及电子设备,进而至少在一定程度上克服由于相关技术的限制和缺陷而导致的页面渲染效率较低的问题。The purpose of the present disclosure is to provide a method for generating a web page, a device for generating a web page, a computer-readable storage medium, and an electronic device, so as to overcome at least to a certain extent the relatively low page rendering efficiency caused by the limitations and defects of related technologies. low problem.
根据本公开的一个方面,提供一种网页页面的生成方法,包括:According to one aspect of the present disclosure, a method for generating a web page is provided, including:
获取富文本字符串,并对所述富文本字符串进行处理,得到所述富文本字符串中包括的源图片链接以及待渲染文本;Obtain a rich text string, and process the rich text string to obtain the source image link included in the rich text string and the text to be rendered;
对所述待渲染文本进行渲染,得到文本页面渲染结果,并确定与所述文本页面渲染结果对应的当前可视区域;Render the text to be rendered to obtain a text page rendering result, and determine the current visible area corresponding to the text page rendering result;
确定所述当前可视区域中的待渲染图片标签,并从所述待渲染图片标签的第一数据源属性中获取与所述源图片链接对应的压缩图片链接;Determine the image tag to be rendered in the current visible area, and obtain the compressed image link corresponding to the source image link from the first data source attribute of the image tag to be rendered;
在当前可视区域中加载与所述压缩图片链接对应的压缩图像,以生成网页页面。The compressed image corresponding to the compressed image link is loaded in the current viewable area to generate a web page.
根据本公开的一个方面,提供一种网页页面的生成装置,包括:According to one aspect of the present disclosure, there is provided an apparatus for generating a web page, including:
字符串处理模块,用于获取富文本字符串,并对所述富文本字符串进行处理,得到所述富文本字符串中包括的源图片链接以及待渲染文本;A string processing module, configured to obtain a rich text string, and process the rich text string to obtain the source picture link and the text to be rendered included in the rich text string;
可视区域确定模块,用于对所述待渲染文本进行渲染,得到文本页面渲染结果,并确定与所述文本页面渲染结果对应的当前可视区域;A visible area determining module, configured to render the text to be rendered, obtain a text page rendering result, and determine a current visible area corresponding to the text page rendering result;
待渲染图片标签确定模块,用于确定所述当前可视区域中的待渲染图片标签,并从所述待渲染图片标签的第一数据源属性中获取与所述源图片链接对应的压缩图片链接;A to-be-rendered image tag determination module, configured to determine the to-be-rendered image tag in the current viewable area, and obtain a compressed image link corresponding to the source image link from the first data source attribute of the to-be-rendered image tag ;
网页页面生成模块,用于在当前可视区域中加载与所述压缩图片链接对应的压缩图像,以生成网页页面。The web page generation module is used to load the compressed image corresponding to the compressed image link in the current viewable area to generate a web page.
根据本公开的一个方面,提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任意一项所述的网页页面的生成方法。According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the method for generating a web page described in any one of the above-mentioned items is implemented.
根据本公开的一个方面,提供一种电子设备,包括:According to one aspect of the present disclosure, an electronic device is provided, comprising:
处理器;以及processor; and
存储器,用于存储所述处理器的可执行指令;a memory for storing executable instructions of the processor;
其中,所述处理器配置为经由执行所述可执行指令来执行上述任意一项所述的网页页面的生成方法。Wherein, the processor is configured to execute the method for generating a web page described in any one of the above by executing the executable instructions.
本公开实施例提供的一种网页页面的生成方法,一方面,通过获取富文本字符串,并对富文本字符串进行处理,得到富文本字符串中包括的源图片链接以及待渲染文本;然后对待渲染文本进行渲染,得到文本页面渲染结果,并确定与文本页面渲染结果对应的当前可视区域;进而确定当前可视区域中的待渲染图片标签,并从待渲染图片标签的第一数据源属性中获取与源图片链接对应的压缩图片链接;最后在当前可视区域中加载与压缩图片链接对应的压缩图像,以生成网页页面;由于可以先对文本进行渲染再对图像进行渲染,进而可以避免现有技术中由于直接进行渲染会存在空白页面等待的问题;另一方面,由于所渲染的图像为压缩图像,进而可以避免直接对富文本内容进行渲染存在页面渲染效率低的问题,提高网页页面的生成效率。In the method for generating a web page provided by an embodiment of the present disclosure, on the one hand, by obtaining a rich text string and processing the rich text string, the source picture link and the text to be rendered included in the rich text string are obtained; and then Render the text to be rendered, obtain the rendering result of the text page, and determine the current viewable area corresponding to the rendering result of the text page; then determine the tag of the image to be rendered in the current viewable area, and obtain the first data source of the image tag to be rendered Get the compressed image link corresponding to the source image link in the attribute; finally load the compressed image corresponding to the compressed image link in the current visible area to generate a web page; since the text can be rendered first and then the image can be rendered, and then can Avoid the problem of blank page waiting in the prior art due to direct rendering; on the other hand, since the rendered image is a compressed image, it can avoid the problem of low page rendering efficiency in the direct rendering of rich text content, and improve the efficiency of web pages. Page generation efficiency.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosure. Apparently, the drawings in the following description are only some embodiments of the present disclosure, and those skilled in the art can obtain other drawings according to these drawings without creative efforts.
图1示意性示出一种直接根据富文本字符串生成页面的原理示例图。Fig. 1 schematically shows an example diagram of the principle of generating a page directly according to a rich text string.
图2示意性示出根据本公开示例实施例的一种网页页面的生成方法的流程图。Fig. 2 schematically shows a flowchart of a method for generating a web page according to an exemplary embodiment of the present disclosure.
图3示意性示出根据本公开示例实施例的一种网页页面的生成方法的应用场景示例图。Fig. 3 schematically shows an example diagram of an application scenario of a method for generating a web page according to an exemplary embodiment of the present disclosure.
图4示意性示出根据本公开示例实施例的一种对所述源图片链接进行压缩处理,得到压缩图片链接的方法流程图。Fig. 4 schematically shows a flow chart of a method for compressing the source picture link to obtain a compressed picture link according to an example embodiment of the present disclosure.
图5示意性示出根据本公开示例实施例的一种文本页面渲染结果的界面示例图。Fig. 5 schematically shows an example interface of a rendering result of a text page according to an exemplary embodiment of the present disclosure.
图6示意性示出根据本公开示例实施例的一种可视区域的界面示例图。Fig. 6 schematically shows an example diagram of an interface of a visible area according to an exemplary embodiment of the present disclosure.
图7示意性示出根据本公开示例实施例的一种所生成的网页页面的界面示例图。Fig. 7 schematically shows an example diagram of an interface of a generated web page according to an exemplary embodiment of the present disclosure.
图8示意性示出根据本公开示例实施例的一种原始图像的加载过程的方法流程图。Fig. 8 schematically shows a method flowchart of an original image loading process according to an exemplary embodiment of the present disclosure.
图9示意性示出根据本公开示例实施例的一种原始图像的加载过程的原理示例图。Fig. 9 schematically shows a principle example diagram of an original image loading process according to an exemplary embodiment of the present disclosure.
图10示意性示出根据本公开示例实施例的一种加载得到的原始图像的显示界面图。Fig. 10 schematically shows a display interface diagram of a loaded original image according to an exemplary embodiment of the present disclosure.
图11示意性示出根据本公开示例实施例的一种网页页面的生成装置的框图。Fig. 11 schematically shows a block diagram of an apparatus for generating a web page according to an exemplary embodiment of the present disclosure.
图12示意性示出根据本公开示例实施例的一种用于实现上述网页页面的生成方法的电子设备。Fig. 12 schematically shows an electronic device for implementing the above method for generating a web page according to an exemplary embodiment of the present disclosure.
具体实施方式Detailed ways
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。在下面的描述中,提供许多具体细节从而给出对本公开的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而省略所述特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知技术方案以避免喧宾夺主而使得本公开的各方面变得模糊。Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided in order to give a thorough understanding of embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details being omitted, or other methods, components, devices, steps, etc. may be adopted. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus repeated descriptions thereof will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different network and/or processor means and/or microcontroller means.
富文本编辑器,Multi-function Text Editor,简称MTE,是一种可内嵌于浏览器,所见即所得的文本编辑器;同时,富文本是一种类似Word的文本,它具有普通文本的特性;富文本中可以包括插画以及对文字颜色等的定义,其还可以具有调整页面、文本布局、插入音视频、图片等的功能。在实际应用的过程中,富文本渲染在各大网站中占据着非常重要的位置,市面上大部分的系统都存在富文本渲染的功能。Rich text editor, Multi-function Text Editor, referred to as MTE, is a text editor that can be embedded in a browser, and what you see is what you get; at the same time, rich text is a text similar to Word, which has the features of ordinary text. Features; rich text can include illustrations and the definition of text color, etc., and it can also have the functions of adjusting page, text layout, inserting audio and video, pictures, etc. In the process of practical application, rich text rendering occupies a very important position in major websites, and most systems on the market have the function of rich text rendering.
在页面的生成过程中,用户可以通过富文本编辑器自行编辑内容,并最终生成HTML(HyperText Mark-up Language,超文本标记语言)代码;也即,在富文本编辑器的前提下,用户无需进行代码的开发,可以直接再富文本编辑器中填写所需要的页面内容即可生成用户想要的网页页面,该方法大大的降低了开发成本;但是,该方法也存在一定的弊端,具体的弊端为:假设富文本编写的内容较多,或者富文本内上传了一些大图片,那么就会导致富文本内容渲染较慢,造成了不好的用户体验。During the page generation process, users can edit the content by themselves through the rich text editor, and finally generate HTML (HyperText Mark-up Language, hypertext markup language) code; that is, under the premise of the rich text editor, the user does not need to For code development, you can directly fill in the required page content in the rich text editor to generate the web page that the user wants. This method greatly reduces the development cost; however, this method also has certain disadvantages. The disadvantage is: if there is a lot of content written in the rich text, or some large pictures are uploaded in the rich text, then the rendering of the rich text content will be slow, resulting in a bad user experience.
为了解决基于上述大图片导致富文本渲染慢的不好体验的问题,在一些技术方案中,可以通过懒加载的形式对富文本渲染进行优化;其中,具体的实现过程为:富文本渲染之前,将富文本内的图片链接的源(Source)属性进行清除,清除源属性是为了阻止富文本渲染的时候进行图片的加载,这样富文本渲染完成之后,再判断图片标签的位置,将在可视区域内的图片进行重新设置源属性,即可以进行渲染;通过该方法可以在一定程度上优化用户体验,虽然可以快速的显示了页面的内容,但是图片资源过大的情况下,用户仍需等待较长时间才能看到完整的页面。In order to solve the bad experience of slow rich text rendering based on the above-mentioned large images, in some technical solutions, rich text rendering can be optimized in the form of lazy loading; among them, the specific implementation process is: before rich text rendering, Clear the source (Source) attribute of the image link in the rich text. The purpose of clearing the source attribute is to prevent the loading of the image when the rich text is rendered, so that after the rich text is rendered, the position of the image tag will be judged in the visual The pictures in the area can be rendered by resetting the source attribute; this method can optimize the user experience to a certain extent, although the content of the page can be quickly displayed, but when the picture resource is too large, the user still needs to wait It takes a long time to see the complete page.
在一些技术方案中,在不对富文本内容进行任何处理,直接对富文本内容进而得到网页页面的具体实现方式可以图1所示;其中,在图1所示出的实现方式中,可以看出整个代码过程没有对富文本进行处理,直接使用innerHTML进行内容渲染;但是,该方案由于是直接将富文本渲染出来,不进行图片处理,因此当加载数据量比较大的时候,页面显示会比较慢。In some technical solutions, without any processing on the rich text content, the specific implementation method of directly obtaining the rich text content and then obtaining the web page can be shown in Figure 1; wherein, in the implementation mode shown in Figure 1, it can be seen that The entire code process does not process rich text, and directly uses innerHTML for content rendering; however, because this solution directly renders rich text without image processing, when the amount of loaded data is relatively large, the page display will be slower .
基于此,本示例实施方式中首先提供了一种网页页面的生成方法,该方法可以运行于终端设备;当然,本领域技术人员也可以根据需求在其他平台运行本公开的方法,本示例性实施例中对此不做特殊限定。具体的,参考图2所示,该网页页面的生成方法可以包括以下步骤:Based on this, a method for generating a web page is firstly provided in this example embodiment, which can be run on a terminal device; of course, those skilled in the art can also run the method of the present disclosure on other platforms according to requirements, this example implementation There is no special limitation on this in the example. Specifically, as shown in FIG. 2, the method for generating the web page may include the following steps:
步骤S210.获取富文本字符串,并对所述富文本字符串进行处理,得到所述富文本字符串中包括的源图片链接以及待渲染文本;Step S210. Obtain a rich text string, and process the rich text string to obtain the source picture link and the text to be rendered included in the rich text string;
步骤S220.对所述待渲染文本进行渲染,得到文本页面渲染结果,并确定与所述文本页面渲染结果对应的当前可视区域;Step S220. Render the text to be rendered to obtain a text page rendering result, and determine the current visible area corresponding to the text page rendering result;
步骤S230.确定所述当前可视区域中的待渲染图片标签,并从所述待渲染图片标签的第一数据源属性中获取与所述源图片链接对应的压缩图片链接;Step S230. Determine the image tag to be rendered in the current visible area, and obtain the compressed image link corresponding to the source image link from the first data source attribute of the image tag to be rendered;
步骤S240.在当前可视区域中加载与所述压缩图片链接对应的压缩图像,以生成网页页面。Step S240. Load the compressed image corresponding to the compressed image link in the current visible area to generate a web page.
上述网页页面的生成方法中,一方面,通过获取富文本字符串,并对富文本字符串进行处理,得到富文本字符串中包括的源图片链接以及待渲染文本;然后对待渲染文本进行渲染,得到文本页面渲染结果,并确定与文本页面渲染结果对应的当前可视区域;进而确定当前可视区域中的待渲染图片标签,并从待渲染图片标签的第一数据源属性中获取与源图片链接对应的压缩图片链接;最后在当前可视区域中加载与压缩图片链接对应的压缩图像,以生成网页页面;由于可以先对文本进行渲染再对图像进行渲染,进而可以避免现有技术中由于直接进行渲染会存在空白页面等待的问题;另一方面,由于所渲染的图像为压缩图像,进而可以避免直接对富文本内容进行渲染存在页面渲染效率低的问题,提高网页页面的生成效率。In the method for generating the above web page, on the one hand, by obtaining the rich text string and processing the rich text string, the source picture link and the text to be rendered included in the rich text string are obtained; and then the text to be rendered is rendered, Obtain the rendering result of the text page, and determine the current visible area corresponding to the rendering result of the text page; then determine the image tag to be rendered in the current visible area, and obtain the source image from the first data source attribute of the image tag to be rendered The compressed image link corresponding to the link; finally, the compressed image corresponding to the compressed image link is loaded in the current visible area to generate a web page; since the text can be rendered first and then the image is rendered, it can avoid Direct rendering will have the problem of waiting for blank pages; on the other hand, since the rendered image is a compressed image, it can avoid the problem of low page rendering efficiency caused by directly rendering rich text content, and improve the generation efficiency of web pages.
以下,将结合附图对本公开示例实施例所记载的网页页面的生成方法进行详细的解释以及说明。Hereinafter, the method for generating a web page described in an exemplary embodiment of the present disclosure will be explained and illustrated in detail with reference to the accompanying drawings.
首先,对本公开示例实施例的技术实现过程进行解释以及说明。具体的,本公开示例实施例所记载的网页页面的生成方法,可以实现在富文本渲染的过程中,进一步优化图片资源的加载速度;同时,通过将图片资源进行压缩或裁剪的方式,减少资源的大小,从而加载富文本的渲染速度,适用于任意浏览器。同时,在实际应用的过程中,用户可以在富文本编辑的过程中,将添加的图片上传至图片服务器(该图片服务器可以支持通过链接进行图片压缩能力);同时,在富文本渲染前,识别出富文本内的图片标签,将图片的源(Source)属性设置为空,并且将图片的原链接和压缩链接分别存储起来;页面渲染后,引入懒加载插件并初始化,则在可视区域的图片标签就会加载压缩链接;进一步地,可以添加图片预览功能,用户点击图片可以预览原图;通过上述实现方式,可以在一定程度上减少网络请求数量和页面加载资源,从而加快了页面渲染速度;并且,还可以通过图片预览的机制,保证了用户能够清晰的知道每一张图片的内容,不会因为图片被压缩,导致信息丢失。First, explain and illustrate the technical implementation process of the exemplary embodiment of the present disclosure. Specifically, the method for generating webpages described in the exemplary embodiments of the present disclosure can further optimize the loading speed of image resources in the process of rendering rich text; The size, thus loading the rendering speed of rich text, is suitable for any browser. At the same time, in the process of actual application, the user can upload the added picture to the picture server during the rich text editing process (the picture server can support picture compression through links); at the same time, before the rich text is rendered, identify For the image tag in the rich text, set the source attribute of the image to empty, and store the original link and the compressed link of the image separately; after the page is rendered, the lazy loading plug-in is introduced and initialized, and the The picture tag will load the compressed link; further, the picture preview function can be added, and the user can click the picture to preview the original picture; through the above implementation method, the number of network requests and page loading resources can be reduced to a certain extent, thereby speeding up the page rendering speed ; Moreover, the picture preview mechanism can also be used to ensure that the user can clearly know the content of each picture, and will not cause information loss due to the compression of the picture.
其次,对本公开示例实施例的网页页面的生成方法的应用场景进行解释以及说明。具体的,参考图3所示,本公开示例实施例所记载的网页页面的生成方法,可以应用于包括终端设备310以及图片服务器320的场景中;其中,该终端设备可以通过有线通信或者无线通信的方式与图片服务器通信连接;该终端设备310可以用于实现本公开示例实施例所记载的网页页面的生成方法,图片服务器320可以用于根据压缩参数对原始图片进行压缩,并生成相应的压缩图片链接反馈给终端设备。Secondly, the application scenario of the method for generating a web page according to the exemplary embodiment of the present disclosure is explained and illustrated. Specifically, as shown in FIG. 3 , the method for generating a web page described in an exemplary embodiment of the present disclosure can be applied to a scenario including a terminal device 310 and a picture server 320; wherein, the terminal device can communicate via wired or wireless communication connection with the picture server; the terminal device 310 can be used to implement the method for generating web pages described in the exemplary embodiment of the present disclosure, and the picture server 320 can be used to compress the original picture according to the compression parameters, and generate corresponding compressed The image link is fed back to the terminal device.
在一种可行的示例实施例中,此处所在的终端设备,可以包括但不限于固定终端(例如,台式机或者一体机等等)以及可移动终端(例如,个人电脑、平板电脑以及手机等等),本示例对此不做特殊限制。In a feasible exemplary embodiment, the terminal devices here may include but not limited to fixed terminals (for example, desktop computers or all-in-one computers, etc.) and mobile terminals (for example, personal computers, tablet computers, mobile phones, etc. etc.), this example does not impose special restrictions on this.
进一步的,对本公开示例实施例所记载的压缩图片链接的具体生成过程进行解释以及说明。具体的,本公开示例实施例所记载的压缩图片链接,可以通过如下方式生成:对所述源图片链接进行压缩处理,得到压缩图片链接;同时,在得到压缩图片链接以后,还需要将该压缩图片链接存储至原始图片标签中的第一数据源属性中,以便于在通过图片加载插件进行加载时,可以从第一数据源属性中获取他压缩图片链接并加载与该压缩图片链接对应的压缩图片。Further, the specific generation process of the compressed picture link recorded in the exemplary embodiment of the present disclosure is explained and described. Specifically, the compressed image link described in the exemplary embodiments of the present disclosure can be generated in the following manner: compress the source image link to obtain the compressed image link; at the same time, after obtaining the compressed image link, the compressed The image link is stored in the first data source attribute in the original image tag, so that when loading through the image loading plug-in, other compressed image links can be obtained from the first data source attribute and the compression corresponding to the compressed image link can be loaded picture.
图4示意性示出根据本公开示例实施例的一种对所述源图片链接进行压缩处理,得到压缩图片链接的方法流程图。具体的,参考图4所示,该压缩图片链接的具体生成过程,可以包括以下步骤:Fig. 4 schematically shows a flow chart of a method for compressing the source picture link to obtain a compressed picture link according to an example embodiment of the present disclosure. Specifically, as shown in FIG. 4, the specific generation process of the compressed picture link may include the following steps:
步骤S410,根据所述源图片链接所具有的原始数据量大小,确定对所述源图片链接进行压缩所需要的压缩参数;Step S410, according to the original data size of the source picture link, determine the compression parameters required for compressing the source picture link;
步骤S420,对所述源图片链接以及所述压缩参数进行拼接,得到拼接结果,并将所述拼接结果上传至图片服务器;Step S420, splicing the source image link and the compression parameters to obtain a splicing result, and uploading the splicing result to an image server;
步骤S430,接收所述图片服务器发送的根据所述压缩参数对所述源图片链接进行压缩所得到的压缩图片链接。Step S430, receiving the compressed picture link obtained by compressing the source picture link according to the compression parameters sent by the picture server.
在一种示例实施例中,所述压缩图片链接是所述图片服务器通过如下方式得到的:首先,对所述拼接结果进行解析,得到所述拼接结果中包括的压缩参数以及源图片链接;其中,所述压缩参数中包括长度压缩参数以及宽度压缩参数;其次,加载与所述源图片链接对应的原始图像,并基于所述宽度压缩参数以及宽度压缩参数所述原始图像进行等比例压缩,得到压缩图像;然后,生成与所述压缩图像对应的压缩图片链接。In an example embodiment, the compressed picture link is obtained by the picture server in the following manner: first, the splicing result is analyzed to obtain the compression parameters and the source picture link included in the splicing result; wherein , the compression parameters include a length compression parameter and a width compression parameter; secondly, load the original image corresponding to the source image link, and perform proportional compression based on the width compression parameter and the width compression parameter to obtain Compressing an image; then, generating a compressed picture link corresponding to the compressed image.
以下,将对步骤S410-步骤S430进行解释以及说明。具体的,当获取源图片链接以后,即可根据该源图片链接确定与该源图片链接对应的原始图像所具有的原始数据量大小,然后根据该原始数据量大小以及压缩后的目标数据量大小,确定对该原始图像进行压缩所需要的压缩参数;其中,此处所记载的压缩参数可以包括宽度压缩参数(Width)和/或高度压缩参数(Height);然后,对源图片链接以及压缩参数进行拼接进而得到拼接结果;例如,假设源图片链接为{url},则在该源图片链接后面拼接压缩参数,最终所得到的拼接结果可以是:{url/2/w/<Width>/h/<Height>},该拼接结果可以表示限定缩略图的宽最多为<Width>,高最多为<Height>,也即表示将与源图片链接{url}对应的原始图像的宽高限制在[Width,Height]范围内;然后再将该拼接结果上传至图片服务器。Hereinafter, step S410-step S430 will be explained and illustrated. Specifically, after the source picture link is obtained, the original data size of the original image corresponding to the source picture link can be determined according to the source picture link, and then according to the original data size and the compressed target data size , determine the compression parameters required for compressing the original image; wherein, the compression parameters recorded here may include width compression parameters (Width) and/or height compression parameters (Height); then, link the source picture and the compression parameters Stitching to obtain the stitching result; for example, assuming that the source image link is {url}, then splicing compression parameters after the source image link, the final stitching result can be: {url/2/w/<Width>/h/ <Height>}, the splicing result can indicate that the maximum width of the thumbnail is <Width>, and the maximum height is <Height>, which means that the width and height of the original image corresponding to the source image link {url} are limited to [Width] , Height]; and then upload the splicing result to the image server.
进一步的,当图片服务器接收到该拼接结果以后,即可根据该拼接结果中包括的源图片链接加载对应的原始图像,并根据拼接结果中包括的压缩参数对该原始图像进行压缩,进而得到压缩图像;同时,在得到压缩图像以后,即可生成与该压缩图像对应的压缩图片链接,在将该压缩图片链接反馈至终端设备。此处需要补充说明的是,此处所记载的图片服务器,是可以支持通过url拼接的形式,将原始按照指定格式进行缩放的图片服务器;同时,此处所记载的以根据宽度压缩参数以及宽度压缩参数对原始图像进行等比例缩放(等比例缩小)的方式来降低图片的数据量,可以在保持原始图片的信息完整性的基础上达到降低图片数据量的目的,避免了由于需要通过图片剪裁的方式降低图片数据量进而导致的图片信息丢失的问题。Further, when the image server receives the splicing result, it can load the corresponding original image according to the source picture link included in the splicing result, and compress the original image according to the compression parameters included in the splicing result, and then obtain compressed At the same time, after the compressed image is obtained, a compressed picture link corresponding to the compressed image can be generated, and the compressed picture link is fed back to the terminal device. What needs to be added here is that the picture server recorded here is a picture server that can support the image server to scale the original according to the specified format through url splicing; at the same time, the picture server recorded here is based on the width compression parameter and the width compression parameter The original image is proportionally scaled (proportionally reduced) to reduce the data volume of the picture, which can achieve the purpose of reducing the data volume of the picture on the basis of maintaining the information integrity of the original picture, and avoids the need to crop the picture The problem of image information loss caused by reducing the amount of image data.
更进一步的,当终端设备接收到压缩图片链接以后,还需要将该压缩图片链接存储对应的原始图片标签的第一数据源属性(data-src)中,进而便于在对压缩图片加载的过程中,可以从第一数据源属性中获取该压缩图片链接并加载与该压缩图片链接对应的压缩图片。Furthermore, when the terminal device receives the compressed picture link, it also needs to store the compressed picture link in the first data source attribute (data-src) of the corresponding original picture tag, so as to facilitate the process of loading the compressed picture , the compressed image link may be acquired from the first data source attribute and the compressed image corresponding to the compressed image link may be loaded.
以下,将结合图3以及图4对图2中所示出的网页页面的生成方法进行详细的解释以及说明。具体的:Hereinafter, the method for generating the web page shown in FIG. 2 will be explained and illustrated in detail with reference to FIG. 3 and FIG. 4 . specific:
在步骤S210中,获取富文本字符串,并对所述富文本字符串进行处理,得到所述富文本字符串中包括的源图片链接以及待渲染文本。In step S210, a rich text string is obtained, and the rich text string is processed to obtain the source picture link and the text to be rendered included in the rich text string.
在本示例实施例中,首先,用户可以在富文本编辑器中输入富文本字符串;其中,此处所记载的富文本字符串,可以包括但不限于字符、图像、视频以及音频等等;其中,图像、视频以及音频可以通过地址链接的方式进行呈现;进一步的,当需要生成网页页面时,浏览器可以从富文本编辑器中获取用户所输入的富文本字符串,进而对富文本字符串进行处理,得到源图片链接以及待渲染文本;具体的,可以通过如下方式实现:首先,基于预设的正则表达式从所述富文本字符串中匹配原始图片标签,并从所述原始图片标签的第二源属性中提取所述源图片链接;其次,将所述原始图片标签的第二源属性设置为空,以得到所述原始图片标签的目标属性,并根据所述目标属性以及所述富文本字符串中除开所述源图片链接以外的其他文本字符串,生成所述待渲染文本。In this example embodiment, firstly, the user can input a rich text string in the rich text editor; wherein, the rich text string recorded here may include but not limited to characters, images, video and audio, etc.; where , images, videos, and audios can be presented through address links; further, when a web page needs to be generated, the browser can obtain the rich text string entered by the user from the rich text editor, and then edit the rich text string process to obtain the source image link and the text to be rendered; specifically, it can be achieved in the following manner: first, match the original image tag from the rich text string based on a preset regular expression, and obtain the original image tag from the original image tag The source image link is extracted from the second source attribute of the original image tag; secondly, the second source attribute of the original image tag is set to be empty to obtain the target attribute of the original image tag, and according to the target attribute and the other text strings in the rich text string except the source image link to generate the text to be rendered.
也即,在实际应用的过程中,在浏览器端获取到富文本字符串以后,可以基于正则表达式对该富文本字符串进行正则表达式处理,从而从富文本字符串中匹配出原始图片(img,image)标签,然后从该原始图片标签的第二源属性中提取源图片链接;其中,此处所记载的第二源属性,也即Source(src)属性;然后,再将该原始图片标签的第二源属性设置为空,最终生成对应的待渲染为本。此处需要补充说明的是,此处之所需要将第二源属性设置为空,其目的是为了在进行文本渲染的过程中,先跳过图像渲染并直接对文本进行渲染,从而可以达到提高渲染效率的目的。That is to say, in the process of actual application, after the rich text string is obtained on the browser side, regular expression processing can be performed on the rich text string based on regular expressions, so as to match the original image from the rich text string (img, image) tag, and then extract the source image link from the second source attribute of the original image tag; wherein, the second source attribute described here is the Source (src) attribute; then, the original image The second source attribute of the label is set to be empty, and the corresponding object to be rendered is finally generated. What needs to be added here is that the second source attribute needs to be set to null here, the purpose is to skip image rendering and directly render text in the process of text rendering, so as to improve the The purpose of rendering efficiency.
进一步的,在得到源图片链接以后,该网页页面的生成方法还包括:将所述源图片链接存储到原始图片标签的第三数据原始属性中。也即,可以将源图片链接存储到第三数据原始属性data-origin中,进而便于在对压缩图像进行预览时,可以从data-origin中获取该源图片链接并加载与该源图片链接对应的原始图像。Further, after obtaining the source picture link, the method for generating the web page further includes: storing the source picture link in the third data original attribute of the original picture tag. That is, the source image link can be stored in the third data original attribute data-origin, so that when previewing the compressed image, the source image link can be obtained from data-origin and the corresponding source image link can be loaded. The original image.
在步骤S220中,对所述待渲染文本进行渲染,得到文本页面渲染结果,并确定与所述文本页面渲染结果对应的当前可视区域。In step S220, the text to be rendered is rendered to obtain a text page rendering result, and a current visible area corresponding to the text page rendering result is determined.
在本示例实施例中,首先,对待渲染文本进行渲染,得到文本页面渲染结果;具体的,在文本页面渲染结果可以通过如下方式得到:首先,对所述待渲染文本进行解析,得到与网页页面对应的页面对象模型;其中,此处所记载的但渲染文本,可以包括超文本标记语言文件以及层叠样式表文件等等;然后,根据页面对象模型生成页面渲染树,并基于页面渲染树计算网页页面的页面布局;最后,对页面布局进行渲染,得到文本页面渲染结果;其中,所得到的文本渲染结果,具体可参考图5所示;同时,基于图5所示出的文本渲染结果可以得知,该文本渲染结果中仅包括了文字部分,并对需要进行图像展示的部分保存了相应的位置以及空间。In this example embodiment, firstly, the text to be rendered is rendered to obtain the rendering result of the text page; specifically, the rendering result of the text page can be obtained in the following manner: first, the text to be rendered is parsed to obtain the result corresponding to the webpage The corresponding page object model; wherein, the rendered text described here may include hypertext markup language files and cascading style sheet files, etc.; then, generate a page rendering tree according to the page object model, and calculate the web page based on the page rendering tree page layout; finally, the page layout is rendered to obtain the text page rendering result; wherein, the obtained text rendering result can be specifically referred to as shown in Figure 5; at the same time, based on the text rendering result shown in Figure 5, it can be known , the text rendering result only includes the text part, and saves the corresponding position and space for the part that needs to be displayed as an image.
进一步的,在得到文本页面渲染结果以后,即可确定与该文本页面渲染结果对应的当前可视区域。其中,当前可视区域可以通过如下方式得到:首先,获取展示所述网页页面的终端设备所具有的屏幕分辨率,并根据所述屏幕分辨率确定所述终端设备的显示尺寸;其次,根据所述终端设备的显示尺寸、所述文本页面渲染结果的页面尺寸以及所述文本渲染结果中的页面滚动条的当前位置,确定所述当前可视区域。具体的,参考图6所示,在实际应用的过程中,可以根据终端设备的显示尺寸、文本页面渲染结果的页面尺寸以及页面滚动条的当前位置确定对应的可视区域;其中,可视区域可以如601所示;同时,此处所记载的页面滚动条的位置,可以根据页面滚动条距离文本页面渲染结果的最顶端或者最底端的距离来确定。Further, after the text page rendering result is obtained, the current visible area corresponding to the text page rendering result can be determined. Wherein, the current viewable area can be obtained in the following manner: firstly, obtain the screen resolution of the terminal device displaying the web page, and determine the display size of the terminal device according to the screen resolution; secondly, according to the The current visible area is determined based on the display size of the terminal device, the page size of the text page rendering result, and the current position of the page scroll bar in the text rendering result. Specifically, as shown in FIG. 6, in the actual application process, the corresponding visible area can be determined according to the display size of the terminal device, the page size of the text page rendering result, and the current position of the page scroll bar; wherein, the visible area It may be as shown in 601; meanwhile, the position of the page scroll bar recorded here may be determined according to the distance between the page scroll bar and the topmost or bottommost end of the text page rendering result.
在步骤S230中,确定所述当前可视区域中的待渲染图片标签,并从所述待渲染图片标签的第一数据源属性中获取与所述源图片链接对应的压缩图片链接。In step S230, determine the image tag to be rendered in the current visible area, and obtain the compressed image link corresponding to the source image link from the first data source attribute of the image tag to be rendered.
在本示例实施例中,首先,确定当前可视区域中的待渲染图片标签;具体的,可以通过如下方式实现:首先,调用预设的图片加载插件,并基于所述预设的图片加载插件遍历所述文本页面渲染结果中的超文本标记语言元素,得到所述文本页面渲染结果中包括的所有的原始图片标签;其次,根据所述原始图片标签在所述文本页面渲染结果中的第一当前页面位置以及所述当前可视区域在所述文本页面渲染结果中的第二当前页面位置,确定所述当前可视区域中需要渲染的待渲染图片标签。其中,此处所记载的预设的图片加载插件可以是懒加载插件;在实际应用的过程中,首先,可以调用懒加载插件并对懒加载插件进行初始化处理;然后,在基于初始化处理后的懒加载插件遍历文本页面渲染结果中的HTML(HyperText Mark-up Language,超文本标记语言)元素,进而得到原始图片标签;然后,从原始图片标签中确定待渲染图片标签。In this example embodiment, first, determine the image tag to be rendered in the current visible area; specifically, it can be implemented in the following manner: first, call a preset image loading plug-in, and load the plug-in based on the preset image traverse the hypertext markup language elements in the rendering result of the text page, and obtain all original picture tags included in the rendering result of the text page; secondly, according to the first The current page position and the second current page position of the current viewable area in the text page rendering result determine the image tags to be rendered that need to be rendered in the current viewable area. Among them, the preset image loading plug-in described here can be a lazy loading plug-in; in the process of actual application, first, the lazy loading plug-in can be called and initialized; The loading plug-in traverses the HTML (HyperText Mark-up Language, Hypertext Markup Language) elements in the rendering result of the text page, and then obtains the original image tag; then, determines the image tag to be rendered from the original image tag.
其次,当待渲染图片标签确定以后,即可从待渲染图片标签的第一数据源属性中获取对应的压缩图片链接,以执行后续的图片渲染过程。此处需要补充说明的是,本公开示例实施例中出现的如下概念:第二源属性(source),是原始图片标签本身具有的属性,该属性中存储了源图片链接(基于该源图片链接可以加载原始图像);第一数据源属性(data-source),是采用本公开示例实施例所记载的网页页面的生成方法生成相应的网页页面所增加的属性,第一数据源属性中存储有与源图片链接对应的压缩图片链接;第三数据原始属性(data-origin),也是采用本公开示例实施例所记载的网页页面的生成方法生成相应的网页页面所增加的属性,第三数据原始属性中存储有源图片链接。也即,在实际使用的过程中,首先,获取第二源属性中的源图片链接同时将该第二源属性设置为空,进而实现在文本渲染时不渲染相应的图片;其次,将获取到的源图片链接存储至第三数据原始属性,进而实现在需要进行图片预览时,可以基于该源图片链接加载原始图片;进一步的,将根据源图片链接得到的压缩图片链接存储至第一数据源属性中,进而实现在通过懒加载插件进行图片加载时,可以加载与压缩图片链接对应的压缩图片,从而达到提高网页页面的生成效率的目的。Secondly, after the image tag to be rendered is determined, the corresponding compressed image link can be obtained from the first data source attribute of the image tag to be rendered, so as to execute the subsequent image rendering process. What needs to be supplemented here is that the following concepts appear in the exemplary embodiments of the present disclosure: the second source attribute (source) is an attribute of the original image tag itself, and the source image link is stored in this attribute (based on the source image link The original image can be loaded); the first data source attribute (data-source) is an attribute added by using the method for generating a web page described in an exemplary embodiment of the present disclosure to generate a corresponding web page, and the first data source attribute stores The compressed picture link corresponding to the source picture link; the third data original attribute (data-origin), which is also an attribute added by using the method for generating a web page described in the exemplary embodiment of the present disclosure to generate a corresponding web page, the third data-origin The source image link is stored in the attribute. That is to say, in the actual use process, firstly, get the source image link in the second source attribute and set the second source attribute to empty, so that the corresponding image will not be rendered when the text is rendered; secondly, the obtained The link of the source picture is stored in the original attribute of the third data, so that when the picture preview is needed, the original picture can be loaded based on the link of the source picture; further, the link of the compressed picture obtained according to the link of the source picture is stored in the first data source property, and then realize that when the image is loaded through the lazy loading plug-in, the compressed image corresponding to the compressed image link can be loaded, so as to achieve the purpose of improving the generation efficiency of the web page.
在步骤S240中,在当前可视区域中加载与所述压缩图片链接对应的压缩图像,以生成网页页面。In step S240, the compressed image corresponding to the compressed image link is loaded in the current visible area to generate a web page.
具体的,当获取到对应的压缩图片链接以后,即可在相应的位置加载压缩图像以得到完整的网页页面;其中,所得到的完整的网页页面,具体可以参考图7所示。此处需要补充说明的是,由于在正常的网页页面的生成过程中,网页页面中所出现的图像均是以小图的形式出现的;因此,在正常的页面显示过程中,通过以压缩图像的方式对相应位置的图片进行显示,可以达到在提高页面生成效率的基础上不影响用户对页面的使用的目的;同时,当需要进行图片预览时,还可以对原始图像进行显示,以达到用户需要查看高清大图的目的。此处需要进一步补充说明的是,由于仅需要对可视区域内的压缩图片进行加载,对非可视区域内的图片则无需加载,进而进一步的提升了页面生成效率。Specifically, after obtaining the corresponding compressed image link, the compressed image can be loaded at the corresponding position to obtain a complete web page; wherein, the obtained complete web page can be specifically shown in FIG. 7 . What needs to be added here is that during the normal webpage generation process, the images that appear on the webpage are all in the form of small pictures; therefore, during the normal page display process, by compressing the image The way to display the pictures at the corresponding positions can achieve the purpose of improving the page generation efficiency without affecting the user's use of the page; at the same time, when the picture preview is required, the original image can also be displayed to achieve the user's The purpose of viewing high-resolution large images is required. What needs to be further supplemented here is that since only the compressed pictures in the visible area need to be loaded, the pictures in the non-visible area do not need to be loaded, thereby further improving the efficiency of page generation.
至此,网页页面的具体生成过程已经全部实现。同时,为了可以便于用户对网页页面中出现的压缩图像的高清大图进行查看,参考图8所示,该网页页面的生成方法还包括以下步骤:So far, the specific generation process of the web page has been fully realized. At the same time, in order to facilitate the user to view the high-definition large image of the compressed image appearing in the web page, as shown in Figure 8, the method for generating the web page also includes the following steps:
步骤S810,响应于针对所述网页页面的屏幕输入事件,触发与所述网页页面对应的根元素的绑定事件,并基于所述根元素的绑定事件确定所述屏幕输入事件所作用的事件元素的元素类别;Step S810, in response to the screen input event for the web page, trigger the binding event of the root element corresponding to the web page, and determine the event on which the screen input event acts based on the binding event of the root element the element class of the element;
步骤S820,在确定所述事件元素的元素类别为所述网页页面中的已渲染图片标签时,从所述已渲染图片标签的第三数据原始属性中获取待预览的源图片链接;Step S820, when it is determined that the element type of the event element is the rendered image tag in the web page, obtain the source image link to be previewed from the third data original attribute of the rendered image tag;
步骤S830,调用图片预览插件,并将所述待预览的源图片链接传递至所述图片预览插件,以在所述图片预览插件中加载与所述待预览的源图片链接对应的原始图像。Step S830, calling the image preview plug-in, and passing the link of the source image to be previewed to the image preview plug-in, so as to load the original image corresponding to the link of the source image to be previewed in the image preview plug-in.
在一种示例实施例中,触发与所述网页页面对应的根元素的绑定事件,并基于所述根元素的绑定事件确定所述屏幕输入事件所作用的事件元素,可以通过如下方式实现:首先,通过事件冒泡机制触发与所述网页页面对应的根元素的绑定事件;其次,基于所述根元素的绑定事件中的事件执行函数,确定所述屏幕输入事件所作用的事件元素的元素类别。In an example embodiment, triggering the binding event of the root element corresponding to the web page, and determining the event element on which the screen input event acts based on the binding event of the root element can be implemented in the following manner : firstly, trigger the binding event of the root element corresponding to the web page through the event bubbling mechanism; secondly, determine the event on which the screen input event acts based on the event execution function in the binding event of the root element The element class of the element.
以下,将对步骤S810-步骤S830进行解释以及说明。具体的,在对原始图像进行加载的过程中,可以利用原生事件委托机制来实现;也即,在实际应用的过程中,可以在富文本渲染的根元素中绑定点击事件,当用户点击图片的时候,会通过事件冒泡机制从而触发根元素上的绑定事件上,然后再根元素的事件执行函数上判断用户点击的元素所具有的元素类别,如果元素类别为图片标签,则调用图片预览功能,将图片标签上data-origin的值,提供给图片预览插件进行全屏预览;其中,具体的实现代码可以参考图9所示,具体所得到的全屏预览结果可以参考图10所示。并且,使用事件委托可以很大程度上减少内存的消耗,因为每个元素绑定点击事件都会占用内存,就会造成大量的内存消耗影响页面性能。Hereinafter, step S810-step S830 will be explained and illustrated. Specifically, in the process of loading the original image, it can be realized by using the native event delegation mechanism; that is, in the actual application process, the click event can be bound to the root element of rich text rendering, when the user clicks on the image , the binding event on the root element will be triggered through the event bubbling mechanism, and then the event execution function of the root element will determine the element category of the element clicked by the user. If the element category is an image tag, call the image The preview function provides the value of data-origin on the image tag to the image preview plug-in for full-screen preview; among them, the specific implementation code can refer to Figure 9, and the specific full-screen preview result can refer to Figure 10. Moreover, using event delegation can greatly reduce memory consumption, because each element binding click event will occupy memory, which will cause a large amount of memory consumption and affect page performance.
最后,本公开示例实施例还记载了在滚动条滚动的情况下的网页页面的生成方法。具体的,该网页页面的生成方法还包括:在检测到针对所述网页页面的页面滚动条的屏幕输入事件时,确定与当前可视区域对应的下一个可视区域;确定所述下一个可视区域中的待渲染图片标签,并从所述待渲染图片标签的第一数据源属性中获取与所述源图片链接对应的压缩图片链接;在下一个可视区域中加载与所述压缩图片链接对应的压缩图像,以生成网页页面。也即,在监听到页面滚动事件时,只要副本的内容出现在可视区域内,即可重复上述页面生成过程,得到新的网页页面。Finally, the exemplary embodiment of the present disclosure also records a method for generating a webpage when a scroll bar scrolls. Specifically, the method for generating a web page further includes: when detecting a screen input event for a page scroll bar of the web page, determining the next visible area corresponding to the current visible area; determining the next visible area The image tag to be rendered in the visual area, and obtain the compressed image link corresponding to the source image link from the first data source attribute of the image tag to be rendered; load the compressed image link in the next visible area Corresponding compressed images to generate web pages. That is, when the page scrolling event is detected, as long as the content of the copy appears in the visible area, the above page generation process can be repeated to obtain a new web page.
至此,本公开示例实施例所记载的网页页面的生成方法已经全部实现。基于前述记载的内容可以得知,本公开示例实施例所记载的网页页面的生成方法,使得用户在富文本编辑器进行内容的编辑时,进行插入图片到富文本编辑器的过程中,系统会将图片上传至具有裁剪(可通过链接拼接的形式进行裁剪)功能的服务器;同时,富文本内容渲染之前,使用正则表达式对图片链接进行处理,将图片资源和其他资源进行分离,首先渲染其他资源,然后通过懒加载插件进行内容初始化,这样就只会加载出现在可视区域内的图片;进一步的,为了保证用户的图片信息不丢失,通过事件委托的形式,给根元素绑定点击事件,用户点击图片调用图片预览组件即可预览原图;基于此,使得富文本在渲染的过程中,可以减少白屏的等待时间,页面能够快速的展示出来,提升了用户体验。So far, the methods for generating webpages described in the exemplary embodiments of the present disclosure have been fully implemented. Based on the content of the foregoing description, it can be known that the method for generating a web page described in the exemplary embodiment of the present disclosure enables the user to insert a picture into the rich text editor when the user edits the content in the rich text editor. Upload the image to a server with the function of clipping (can be clipped in the form of link splicing); at the same time, before rendering the rich text content, use regular expressions to process the image link, separate the image resource from other resources, and render other resources first. Resources, and then initialize the content through the lazy loading plug-in, so that only the pictures that appear in the visible area will be loaded; further, in order to ensure that the user's picture information is not lost, bind the click event to the root element in the form of event delegation , the user clicks on the picture to call the picture preview component to preview the original picture; based on this, the rich text can reduce the waiting time of the white screen during the rendering process, and the page can be displayed quickly, which improves the user experience.
本公开示例实施例还提供了一种网页页面的生成装置。具体的,参考图11所示,该网页页面的生成装置可以包括字符串处理模块1110、可视区域确定模块1120、待渲染图片标签确定模块1130以及第一网页页面生成模块1140。其中:The exemplary embodiment of the present disclosure also provides an apparatus for generating a web page. Specifically, referring to FIG. 11 , the apparatus for generating a webpage may include a character string processing module 1110 , a visible area determining module 1120 , a to-be-rendered image label determining module 1130 and a first webpage generating module 1140 . in:
字符串处理模块1110,可以用于获取富文本字符串,并对所述富文本字符串进行处理,得到所述富文本字符串中包括的源图片链接以及待渲染文本;The character string processing module 1110 may be used to acquire a rich text character string, and process the rich text character string to obtain the source picture link and the text to be rendered included in the rich text character string;
可视区域确定模块1120,可以用于对所述待渲染文本进行渲染,得到文本页面渲染结果,并确定与所述文本页面渲染结果对应的当前可视区域;The visible area determining module 1120 may be configured to render the text to be rendered, obtain a text page rendering result, and determine a current visible area corresponding to the text page rendering result;
待渲染图片标签确定模块1130,可以用于确定所述当前可视区域中的待渲染图片标签,并从所述待渲染图片标签的第一数据源属性中获取与所述源图片链接对应的压缩图片链接;The to-be-rendered image tag determining module 1130 may be configured to determine the to-be-rendered image tag in the current viewable area, and obtain the compressed data corresponding to the source image link from the first data source attribute of the to-be-rendered image tag. image link;
第一网页页面生成模块1140,可以用于在当前可视区域中加载与所述压缩图片链接对应的压缩图像,以生成网页页面。The first web page generating module 1140 may be configured to load the compressed image corresponding to the compressed image link in the current viewable area, so as to generate a web page.
在本公开的一种示例性实施例中,对所述富文本字符串进行处理,得到所述富文本字符串中包括的源图片链接以及待渲染文本,包括:基于预设的正则表达式从所述富文本字符串中匹配原始图片标签,并从所述原始图片标签的第二源属性中提取所述源图片链接;将所述原始图片标签的第二源属性设置为空,以得到所述原始图片标签的目标属性,并根据所述目标属性以及所述富文本字符串中除开所述源图片链接以外的其他文本字符串,生成所述待渲染文本。In an exemplary embodiment of the present disclosure, processing the rich text string to obtain the source picture link and the text to be rendered included in the rich text string includes: based on a preset regular expression from Match the original image tag in the rich text string, and extract the source image link from the second source attribute of the original image tag; set the second source attribute of the original image tag to empty to get the The target attribute of the original image tag, and generate the text to be rendered according to the target attribute and other text strings in the rich text string except the source image link.
在本公开的一种示例性实施例中,确定与所述文本页面渲染结果对应的当前可视区域,包括:获取展示所述网页页面的终端设备所具有的屏幕分辨率,并根据所述屏幕分辨率确定所述终端设备的显示尺寸;根据所述终端设备的显示尺寸、所述文本页面渲染结果的页面尺寸以及所述文本渲染结果中的页面滚动条的当前位置,确定所述当前可视区域。In an exemplary embodiment of the present disclosure, determining the current visible area corresponding to the rendering result of the text page includes: obtaining the screen resolution of the terminal device displaying the web page, and according to the screen The resolution determines the display size of the terminal device; according to the display size of the terminal device, the page size of the text page rendering result and the current position of the page scroll bar in the text rendering result, determine the current visible area.
在本公开的一种示例性实施例中,确定所述当前可视区域中的待渲染图片标签,包括:调用预设的图片加载插件,并基于所述预设的图片加载插件遍历所述文本页面渲染结果中的超文本标记语言元素,得到所述文本页面渲染结果中包括的所有的原始图片标签;根据所述原始图片标签在所述文本页面渲染结果中的第一当前页面位置以及所述当前可视区域在所述文本页面渲染结果中的第二当前页面位置,确定所述当前可视区域中需要渲染的待渲染图片标签。In an exemplary embodiment of the present disclosure, determining the image tag to be rendered in the current visible area includes: calling a preset image loading plug-in, and traversing the text based on the preset image loading plug-in The hypertext markup language element in the page rendering result obtains all original image tags included in the text page rendering result; according to the first current page position of the original image tag in the text page rendering result and the The second current page position of the current viewable area in the rendering result of the text page determines the image tag to be rendered that needs to be rendered in the current viewable area.
在本公开的一种示例性实施例中,所述网页页面的生成装置还包括:In an exemplary embodiment of the present disclosure, the generating device of the web page further includes:
压缩图片链接生成模块,可以用于对所述源图片链接进行压缩处理,得到压缩图片链接,并将所述压缩图片链接存储至原始图片标签中的第一数据源属性中。The compressed picture link generating module can be used to compress the source picture link to obtain the compressed picture link, and store the compressed picture link in the first data source attribute in the original picture tag.
在本公开的一种示例性实施例中,对所述源图片链接进行压缩处理,得到压缩图片链接,包括:根据所述源图片链接所具有的原始数据量大小,确定对所述源图片链接进行压缩所需要的压缩参数;对所述源图片链接以及所述压缩参数进行拼接,得到拼接结果,并将所述拼接结果上传至图片服务器;接收所述图片服务器发送的根据所述压缩参数对所述源图片链接进行压缩所得到的压缩图片链接。In an exemplary embodiment of the present disclosure, performing compression processing on the source picture link to obtain the compressed picture link includes: determining the source picture link according to the original data size of the source picture link Compression parameters required for compression; splicing the source picture link and the compression parameters to obtain a splicing result, and uploading the splicing result to the picture server; A compressed picture link obtained by compressing the source picture link.
在本公开的一种示例性实施例中,所述压缩图片链接是所述图片服务器通过如下方式得到的:对所述拼接结果进行解析,得到所述拼接结果中包括的压缩参数以及源图片链接;其中,所述压缩参数中包括长度压缩参数以及宽度压缩参数;加载与所述源图片链接对应的原始图像,并基于所述宽度压缩参数以及宽度压缩参数所述原始图像进行等比例压缩,得到压缩图像;生成与所述压缩图像对应的压缩图片链接。In an exemplary embodiment of the present disclosure, the compressed picture link is obtained by the picture server in the following manner: parsing the splicing result to obtain the compression parameters included in the splicing result and the source picture link ; Wherein, the compression parameters include length compression parameters and width compression parameters; load the original image corresponding to the source picture link, and perform proportional compression based on the width compression parameters and the original image of the width compression parameters, to obtain Compressing an image; generating a compressed picture link corresponding to the compressed image.
在本公开的一种示例性实施例中,所述网页页面的生成装置还包括:In an exemplary embodiment of the present disclosure, the generating device of the web page further includes:
源图片链接存储模块,可以用于将所述源图片链接存储到原始图片标签的第三数据原始属性中。The source picture link storage module can be used to store the source picture link in the third data original attribute of the original picture tag.
在本公开的一种示例性实施例中,所述网页页面的生成装置还包括:In an exemplary embodiment of the present disclosure, the generating device of the web page further includes:
元素类别确定模块,可以用于响应于针对所述网页页面的屏幕输入事件,触发与所述网页页面对应的根元素的绑定事件,并基于所述根元素的绑定事件确定所述屏幕输入事件所作用的事件元素的元素类别;The element category determination module may be configured to trigger a binding event of a root element corresponding to the web page in response to a screen input event for the web page, and determine the screen input based on the binding event of the root element the element class of the event element on which the event acts;
源图片链接获取模块,可以用于在确定所述事件元素的元素类别为所述网页页面中的已渲染图片标签时,从所述已渲染图片标签的第三数据原始属性中获取待预览的源图片链接;The source image link obtaining module can be used to obtain the source to be previewed from the third data original attribute of the rendered image tag when it is determined that the element category of the event element is the rendered image tag in the web page image link;
原始图像加载模块,可以用于调用图片预览插件,并将所述待预览的源图片链接传递至所述图片预览插件,以在所述图片预览插件中加载与所述待预览的源图片链接对应的原始图像。The original image loading module can be used to call the image preview plug-in, and transfer the link of the source image to be previewed to the image preview plug-in, so as to load the image corresponding to the link of the source image to be previewed in the image preview plug-in of the original image.
在本公开的一种示例性实施例中,触发与所述网页页面对应的根元素的绑定事件,并基于所述根元素的绑定事件确定所述屏幕输入事件所作用的事件元素,包括:通过事件冒泡机制触发与所述网页页面对应的根元素的绑定事件;基于所述根元素的绑定事件中的事件执行函数,确定所述屏幕输入事件所作用的事件元素的元素类别。In an exemplary embodiment of the present disclosure, triggering a binding event of a root element corresponding to the webpage, and determining the event element on which the screen input event acts based on the binding event of the root element, includes : Trigger the binding event of the root element corresponding to the web page through the event bubbling mechanism; determine the element category of the event element that the screen input event acts on based on the event execution function in the binding event of the root element .
在本公开的一种示例性实施例中,所述网页页面的生成装置还包括:In an exemplary embodiment of the present disclosure, the generating device of the web page further includes:
下一个可视区域确定模块,可以用于在检测到针对所述网页页面的页面滚动条的屏幕输入事件时,确定与当前可视区域对应的下一个可视区域;The next visible area determination module can be used to determine the next visible area corresponding to the current visible area when a screen input event for the page scroll bar of the web page is detected;
压缩图片链接获取模块,可以用于确定所述下一个可视区域中的待渲染图片标签,并从所述待渲染图片标签的第一数据源属性中获取与所述源图片链接对应的压缩图片链接;The compressed image link acquisition module can be used to determine the image tag to be rendered in the next visible area, and obtain the compressed image corresponding to the source image link from the first data source attribute of the image tag to be rendered Link;
第二网页页面生成模块,可以用于在下一个可视区域中加载与所述压缩图片链接对应的压缩图像,以生成网页页面。The second web page generation module can be used to load the compressed image corresponding to the compressed image link in the next visible area to generate a web page.
上述网页页面的生成装置中各模块的具体细节已经在对应的网页页面的生成方法中进行了详细的描述,因此此处不再赘述。The specific details of each module in the above-mentioned web page generation apparatus have been described in detail in the corresponding web page generation method, so details will not be repeated here.
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. Actually, according to the embodiment of the present disclosure, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided to be embodied by a plurality of modules or units.
此外,尽管在附图中以特定顺序描述了本公开中方法的各个步骤,但是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或是必须执行全部所示的步骤才能实现期望的结果。附加的或备选的,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。In addition, although steps of the methods of the present disclosure are depicted in the drawings in a particular order, there is no requirement or implication that the steps must be performed in that particular order, or that all illustrated steps must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step for execution, and/or one step may be decomposed into multiple steps for execution, etc.
在本公开的示例性实施例中,还提供了一种能够实现上述方法的电子设备。In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
所属技术领域的技术人员能够理解,本公开的各个方面可以实现为系统、方法或程序产品。因此,本公开的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。Those skilled in the art can understand that various aspects of the present disclosure can be implemented as a system, method or program product. Therefore, various aspects of the present disclosure can be embodied in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which can be collectively referred to herein as "circuit", "module" or "system".
下面参照图12来描述根据本公开的这种实施方式的电子设备1200。图12显示的电子设备1200仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。An electronic device 1200 according to this embodiment of the present disclosure is described below with reference to FIG. 12 . The electronic device 1200 shown in FIG. 12 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.
如图12所示,电子设备1200以通用计算设备的形式表现。电子设备1200的组件可以包括但不限于:上述至少一个处理单元1210、上述至少一个存储单元1220、连接不同系统组件(包括存储单元1220和处理单元1210)的总线1230以及显示单元1240。As shown in FIG. 12, electronic device 1200 takes the form of a general-purpose computing device. The components of the electronic device 1200 may include, but are not limited to: at least one processing unit 1210, at least one storage unit 1220, a bus 1230 connecting different system components (including the storage unit 1220 and the processing unit 1210), and a display unit 1240.
其中,所述存储单元存储有程序代码,所述程序代码可以被所述处理单元1210执行,使得所述处理单元1210执行本说明书上述“示例性方法”部分中描述的根据本公开各种示例性实施方式的步骤。例如,所述处理单元1210可以执行如图2中所示的步骤S210:获取富文本字符串,并对所述富文本字符串进行处理,得到所述富文本字符串中包括的源图片链接以及待渲染文本;步骤S220:对所述待渲染文本进行渲染,得到文本页面渲染结果,并确定与所述文本页面渲染结果对应的当前可视区域;步骤S230:确定所述当前可视区域中的待渲染图片标签,并从所述待渲染图片标签的第一数据源属性中获取与所述源图片链接对应的压缩图片链接;步骤S240:在当前可视区域中加载与所述压缩图片链接对应的压缩图像,以生成网页页面。Wherein, the storage unit stores program codes, and the program codes can be executed by the processing unit 1210, so that the processing unit 1210 executes various exemplary methods according to the present disclosure described in the "Exemplary Methods" section of this specification. Implementation steps. For example, the processing unit 1210 may execute step S210 as shown in FIG. 2: acquire a rich text string, and process the rich text string to obtain the source picture link included in the rich text string and Text to be rendered; Step S220: Render the text to be rendered to obtain a text page rendering result, and determine the current visible area corresponding to the text page rendering result; Step S230: Determine the The image tag to be rendered, and obtain the compressed image link corresponding to the source image link from the first data source attribute of the image tag to be rendered; Step S240: Load the image corresponding to the compressed image link in the current visible area Compressed images to generate web pages.
存储单元1220可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)12201和/或高速缓存存储单元12202,还可以进一步包括只读存储单元(ROM)12203。The storage unit 1220 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 12201 and/or a cache storage unit 12202 , and may further include a read-only storage unit (ROM) 12203 .
存储单元1220还可以包括具有一组(至少一个)程序模块12205的程序/实用工具12204,这样的程序模块12205包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。Storage unit 1220 may also include programs/utilities 12204 having a set (at least one) of program modules 12205, such program modules 12205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, Implementations of networked environments may be included in each or some combination of these examples.
总线1230可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。Bus 1230 may represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local area using any of a variety of bus structures. bus.
电子设备1200也可以与一个或多个外部设备1300(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备1200交互的设备通信,和/或与使得该电子设备1200能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口1250进行。并且,电子设备1200还可以通过网络适配器1260与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器1260通过总线1230与电子设备1200的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备1200使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The electronic device 1200 can also communicate with one or more external devices 1300 (such as keyboards, pointing devices, Bluetooth devices, etc.), and can also communicate with one or more devices that enable the user to interact with the electronic device 1200, and/or communicate with Any device (eg, router, modem, etc.) that enables the electronic device 1200 to communicate with one or more other computing devices. Such communication may occur through input/output (I/O) interface 1250 . Moreover, the electronic device 1200 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and/or a public network such as the Internet) through the network adapter 1260 . As shown, the network adapter 1260 communicates with other modules of the electronic device 1200 through the bus 1230 . It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、终端装置、或者网络设备等)执行根据本公开实施方式的方法。Through the description of the above implementations, those skilled in the art can easily understand that the example implementations described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of software products, and the software products can be stored in a non-volatile storage medium (which can be CD-ROM, U disk, mobile hard disk, etc.) or on the network , including several instructions to make a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) execute the method according to the embodiments of the present disclosure.
在本公开的示例性实施例中,还提供了一种计算机可读存储介质,其上存储有能够实现本说明书上述方法的程序产品。在一些可能的实施方式中,本公开的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在终端设备上运行时,所述程序代码用于使所述终端设备执行本说明书上述“示例性方法”部分中描述的根据本公开各种示例性实施方式的步骤。In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium on which a program product capable of implementing the above-mentioned method in this specification is stored. In some possible implementation manners, various aspects of the present disclosure may also be implemented in the form of a program product, which includes program code, and when the program product is run on a terminal device, the program code is used to make the The terminal device executes the steps according to various exemplary embodiments of the present disclosure described in the "Exemplary Method" section above in this specification.
根据本公开的实施方式的用于实现上述方法的程序产品,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,例如个人电脑上运行。然而,本公开的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。According to the program product for implementing the above method according to the embodiment of the present disclosure, it may adopt a portable compact disk read only memory (CD-ROM) and include program codes, and may run on a terminal device such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with an instruction execution system, apparatus or device.
所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The program product may reside on any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: electrical connection with one or more conductors, portable disk, hard disk, random access memory (RAM), read only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer readable signal medium may include a data signal carrying readable program code in baseband or as part of a carrier wave. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言的任意组合来编写用于执行本公开操作的程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural Programming language - such as "C" or a similar programming language. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server to execute. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (for example, using an Internet service provider). business to connect via the Internet).
此外,上述附图仅是根据本公开示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。In addition, the above-mentioned drawings are only schematic illustrations of processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not imply or limit the chronological order of these processes. In addition, it is also easy to understand that these processes may be executed synchronously or asynchronously in multiple modules, for example.
本领域技术人员在考虑说明书及实践这里发明的发明后,将容易想到本公开的其他实施例。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未发明的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。Other embodiments of the disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention invented herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not invented by the present disclosure . The specification and examples are to be considered exemplary only, with the true scope and spirit of the disclosure indicated by the appended claims.
Claims (14)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310404821.0A CN116578795A (en) | 2023-04-14 | 2023-04-14 | Webpage generation method and device, storage medium and electronic equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310404821.0A CN116578795A (en) | 2023-04-14 | 2023-04-14 | Webpage generation method and device, storage medium and electronic equipment |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116578795A true CN116578795A (en) | 2023-08-11 |
Family
ID=87533067
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310404821.0A Pending CN116578795A (en) | 2023-04-14 | 2023-04-14 | Webpage generation method and device, storage medium and electronic equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116578795A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117520691A (en) * | 2024-01-08 | 2024-02-06 | 成都安世赛斯特软件技术有限公司 | Method and device for displaying item data, storage medium and electronic equipment |
| CN118568282A (en) * | 2024-06-06 | 2024-08-30 | 成都阿加犀智能科技有限公司 | A method, device, equipment and medium for processing image data |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070271288A1 (en) * | 2006-05-03 | 2007-11-22 | Canon Kabushiki Kaisha | Compressing page descriptions while preserving high quality |
| CN101777066A (en) * | 2009-12-31 | 2010-07-14 | 优视科技有限公司 | Web page rendering and browsing system for mobile communication equipment terminals and application method thereof |
| CN103425699A (en) * | 2012-05-24 | 2013-12-04 | 腾讯科技(深圳)有限公司 | Method, equipment and system for acquiring web pages |
| CN110399581A (en) * | 2019-07-23 | 2019-11-01 | 中南民族大学 | Page rendering method, equipment, storage medium and device based on machine learning |
-
2023
- 2023-04-14 CN CN202310404821.0A patent/CN116578795A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070271288A1 (en) * | 2006-05-03 | 2007-11-22 | Canon Kabushiki Kaisha | Compressing page descriptions while preserving high quality |
| CN101777066A (en) * | 2009-12-31 | 2010-07-14 | 优视科技有限公司 | Web page rendering and browsing system for mobile communication equipment terminals and application method thereof |
| CN103425699A (en) * | 2012-05-24 | 2013-12-04 | 腾讯科技(深圳)有限公司 | Method, equipment and system for acquiring web pages |
| CN110399581A (en) * | 2019-07-23 | 2019-11-01 | 中南民族大学 | Page rendering method, equipment, storage medium and device based on machine learning |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117520691A (en) * | 2024-01-08 | 2024-02-06 | 成都安世赛斯特软件技术有限公司 | Method and device for displaying item data, storage medium and electronic equipment |
| CN117520691B (en) * | 2024-01-08 | 2024-04-02 | 成都安世赛斯特软件技术有限公司 | An itemized data display method, device, storage medium and electronic equipment |
| CN118568282A (en) * | 2024-06-06 | 2024-08-30 | 成都阿加犀智能科技有限公司 | A method, device, equipment and medium for processing image data |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9542501B2 (en) | System and method for presenting content in a client/server environment | |
| CN102819560B (en) | The display methods and device of picture in a kind of webpage | |
| CN102591954B (en) | A kind of browser data load method and device | |
| CN112954030A (en) | Web side picture compression method and device and electronic equipment | |
| CN113382083B (en) | Webpage screenshot method and device | |
| WO2014206072A1 (en) | Web page previewing method and system | |
| CN107247544B (en) | Optimize software application user interface performance using interactive graphics | |
| JP7538948B2 (en) | Image processing method and apparatus, and computer-readable storage medium | |
| CN101889444A (en) | Display control device, display control method, display control program, and storage medium | |
| CN107967344B (en) | Method, system, device and storage medium for realizing web page animation effect | |
| US20180239834A1 (en) | Data transmission method and device | |
| US10289747B2 (en) | Dynamic file concatenation | |
| CN116578795A (en) | Webpage generation method and device, storage medium and electronic equipment | |
| CN110347349A (en) | The method, apparatus and computer equipment of specified content are printed in browser | |
| JP2014532253A (en) | User terminal device and scroll method for supporting high-speed web scrolling of web documents | |
| CN110059278A (en) | Web page configuration method, server and computer readable storage medium | |
| CN111294395A (en) | Terminal page transmission method, device, medium and electronic equipment | |
| KR20120016333A (en) | Pre-caching method for web application and terminal device applying the same | |
| CN112487763A (en) | SVG-based OFD file online display method, server side and system | |
| CN107797837B (en) | Page display method, device, server and medium | |
| CN115495417A (en) | Content loading method, device, equipment, medium and program product | |
| CN112596732B (en) | Electronic teaching material manufacturing method and system | |
| CN102663137B (en) | A kind of method and system being applied in mobile terminal show webpage | |
| CN101753537A (en) | Server and web sending and displaying method | |
| CN107862035A (en) | Network reading method and device for conference record, intelligent tablet and storage medium |
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 |