Method and device for template rendering

A template and operation method technology, applied in the network field, can solve the problems of garbage collection, reduce system execution efficiency, frequent, etc., and achieve the effect of reducing garbage collection, increasing the number of queries, and improving performance

Active Publication Date: 2013-06-19
ALIBABA GRP HLDG LTD
View PDF3 Cites 12 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, when the number of visits to the system reaches hundreds of millions, if the Velocity template uses the Java reflection mechanism to render Java objects to generate HTML web pages, the rendering operation will take up a large part of the entire RT (Response Time, response time) of the system. part, so that the rendering of the Velocity template becomes an execution bottleneck of system performance, because the execution of the rendering of the Velocity template will lead to frequent GC (Java virtual machine garbage collection) of the system, which will seriously reduce the execution efficiency of the system

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
  • Method and device for template rendering
  • Method and device for template rendering
  • Method and device for template rendering

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0020] In order to improve the rendering efficiency of the template, in the embodiment of this application, when rendering the template according to the web browsing request sent by the user, try to avoid using the Java reflection mechanism, but use the Java direct call method to convert the template into the corresponding Java class file , and execute the Java class file to generate the web page required by the user, thereby improving the execution efficiency of the code.

[0021] Wherein, the so-called Velocity template (also referred to as vm template for short) refers to a webpage code file written according to Velocity syntax, that is, the source code of a webpage. The browser cannot directly parse the source code of the webpage, and needs to convert the source code of the webpage into the corresponding HTML webpage through rendering operation; therefore, the so-called rendering of the Velocity template means rendering the webpage code file written in Velocity syntax A co...

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 discloses a method and a device for template rendering. The method includes the following steps: acquiring a corresponding template and generating a corresponding Java-type file according to a web page browsing request of a user, and calling a confirmed variable type and / or a confirmed variable operation method in the template by using a Java direct calling method; and then, executing the Java-type file to generate a corresponding web page, and returning the wed page to the user. Thus, code execution efficiency in template switching can be effectively improved, the number of query per second of a service platform can be improved, response time is shortened, and therefore garbage recovery of a Java virtual machine of a system can be reduced, then performance of a whole application system can be improved, and performance bottlenecks caused by the template rendering can be avoided.

Description

technical field [0001] The present application relates to the field of network technologies, in particular to a template rendering method and device. Background technique [0002] Velocity is a Java-based template engine (template engine), a dynamic template programming language that allows anyone to simply use the template language (template language) to refer to objects defined by Java code. [0003] Velocity is mainly applied to the front-end display of web pages, that is, an HTML web page is generated according to the rendering of Java objects at the back end, wherein the rendering of Java objects (eg, web page source code) is actually realized through the Java reflection mechanism. The so-called Java reflection mechanism is that in the running state, for any class, you can know all the properties and methods of this class; for any object, you can call any of its methods and properties; that is, to perform detailed code on Java objects Explanation. The Java reflection ...

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 Applications(China)
IPC IPC(8): G06F9/44G06F17/30
Inventor 许令波沈金堤
Owner ALIBABA GRP HLDG 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