Page rendering method and device based on template engine

A template engine and template technology, applied in the Internet field, can solve problems such as thread blocking, page freeze, and page unresponsiveness, and achieve the effect of accelerating rendering and improving rendering performance

Active Publication Date: 2020-03-24
PING AN TECH (SHENZHEN) CO LTD
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In the traditional way, the template engine compiles the template file through the template syntax, and uses the data to generate the final HTML document. This process is executed serially. When it is necessary to generate an HTML document with a complex structure, it takes a long time to compile In this process, the page cannot respond to the user's operation, and thread blocking occurs, which makes the efficiency of page display lower and the page freezes.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Page rendering method and device based on template engine
  • Page rendering method and device based on template engine
  • Page rendering method and device based on template engine

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0055] In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

[0056] Such as figure 1 As shown, a page rendering method based on a template engine includes the following steps:

[0057] Step S110, monitor the message sent by the main thread of the template engine through the worker thread.

[0058] Specifically, a thread, sometimes called a lightweight process (Lightweight Process, LWP), is the smallest unit of program execution flow. The user accesses the page through the URL (Uniform Resource Locator, Uniform Resource Locator) on the client side. After the client obtains the template file and data related to the page from the server, it can use the templa...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to a page rendering method and device based on a template engine. The method comprises the following steps of monitoring a message sent by a main thread of the template engine through a working thread monitoring template; receiving the message through the working thread and parsing the message to obtain a pass parameter; making the working thread generate an HTML character string according to the pass parameter; and sending the HTML character string to the main thread of the template engine through the working thread in order to make the main thread of the template enginedisplay the page according to the HTML character string. According to the page rendering method and device based on the template engine, the rendering of the page can be accelerated, the rendering performance of the page can be improved and the condition of lag of the page can be avoided.

Description

technical field [0001] The invention relates to the technical field of the Internet, in particular to a page rendering method and device based on a template engine. Background technique [0002] With the development of Internet technology, front-end applications have become more and more complex. Template engines, as the most important part of the separation of data and interfaces, are favored by more and more front-end developers. Rendering refers to the process of generating an image from a model. The template engine can generate an HTML (HyperText Markup Language, HyperText Markup Language) document from a template file and data, so as to realize the rendering of a web page. In the traditional way, the template engine compiles the template file through the template syntax, and uses the data to generate the final HTML document. This process is executed serially. When it is necessary to generate an HTML document with a complex structure, it takes a long time to compile In ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F8/20G06F8/38G06F16/958
Inventor 向洋君
Owner PING AN TECH (SHENZHEN) CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products