CN110297999A - A kind of web page template generation method and device, webpage loading method and front-end server and Website server - Google Patents
A kind of web page template generation method and device, webpage loading method and front-end server and Website server Download PDFInfo
- Publication number
- CN110297999A CN110297999A CN201910385316.XA CN201910385316A CN110297999A CN 110297999 A CN110297999 A CN 110297999A CN 201910385316 A CN201910385316 A CN 201910385316A CN 110297999 A CN110297999 A CN 110297999A
- Authority
- CN
- China
- Prior art keywords
- template
- information
- self
- web page
- file
- 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; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F16/986—Document structures and storage, e.g. HTML extensions
Abstract
The present invention discloses a kind of web page template generation method and device, webpage loading method and front-end server and Website server, is related to web development technologies field, to simplify webpage information loading procedure, and effectively mitigates the data processing pressure of back-end server.The web page template generation method includes: to be packaged self-defined template engine file, obtains self-defined template engine package file;Self-defined template engine package file is imported into html file;According to html file, the web page template for being used for loading page data is obtained, the web page template contains label attribute information, template identification information and self-defined template engine package file.The front-end server is for executing above-mentioned web page template generation method.Web page template generation method provided by the invention and device, webpage loading method and front-end server and Website server are in webpage development.
Description
Technical field
The present invention relates to web development technologies fields more particularly to a kind of web page template generation method and device, webpage to add
Support method and front-end server and Website server.
Background technique
Currently, most of webpage development is all divided into front end exploitation and two parts are developed in rear end, front end exploitation is mainly done
It is that the front end that user can see shows interface, it is that user is sightless that rear end exploitation is main to do is to modules such as logic functions.
When existing webpage development process, front-end server is transmitted to background server, background service for web page template is created
The webpage informations such as character string and concatenation information are inserted into the hypertext markup language (HyperText that web page template contains by device
Markup Language, is abbreviated as html) label;When back-end server receives the request message of front-end server transmission,
Web page template is transmitted to front-end server by back-end server, and is loaded using front-end server, thus at the beginning of realizing webpage
Beginningization.Although this mode may be implemented webpage and normally show, but this method is more complicated, and the number of back-end server
It is big according to processing pressure, it is unfavorable for providing webpage development efficiency.
Summary of the invention
The purpose of the present invention is to provide a kind of web page template generation method and devices, webpage loading method and front end services
Device and Website server to simplify webpage information loading procedure, and effectively mitigate the data processing pressure of back-end server.
To achieve the goals above, the present invention provides a kind of web page template generation method, the web page template generation method packet
It includes:
Self-defined template engine file is packaged, self-defined template engine package file is obtained;
The self-defined template engine package file is imported into html file;
According to the html file, the web page template for being used for loading page data is obtained, the web page template contains label
Attribute information, template identification information and self-defined template engine package file.
Compared with prior art, in web page template generation method provided by the invention, by self-defined template engine file into
Row encapsulation, and self-defined template engine package file obtained is directed into html file;On this basis, according to html
File obtains web page template, contains label attribute information, template identification information and self-defined template engine in web page template at this time
Package file need to only utilize label attribute information will be customized it is not necessary that web page template generated is transmitted to background server
Customized label information possessed by template engine package file is defined as template label information;Using template replacement function according to
Template identification information loads webpage information in the template label information that the self-defined template engine package file contains, in this way
Webpage information loading procedure can be simplified, and effectively mitigate the data processing pressure of back-end server.
The present invention also provides a kind of web page template generating means, which includes:
Document encapsulation module obtains the encapsulation of self-defined template engine for self-defined template engine file to be packaged
File;
File import modul obtains customized for the self-defined template engine package file to be imported html file
Html file;
Data definition module, it is described for obtaining the web page template for being used for loading page data according to the html file
Web page template contains label attribute information, template identification information and self-defined template engine package file.
Compared with prior art, the beneficial effect of web page template generating means provided by the invention and above-mentioned web page template are raw
Identical at the beneficial effect of method, this will not be repeated here.
The present invention also provides a kind of webpage loading method, which includes:
Webpage information is received, according to template identification information searching label attribute information;Web page template includes tag attributes letter
Breath, template identification information and self-defined template engine package file;
Customized label possessed by the self-defined template engine package file is believed using the label attribute information
Breath is defined as template label information;
The mould contained according to template identification information in the self-defined template engine package file using template replacement function
Webpage information is loaded in plate label information.
Compared with prior art, the beneficial effect of webpage loading method provided by the invention and above-mentioned web page template generation side
The beneficial effect of method is identical, and this will not be repeated here.
The present invention also provides a kind of front-end server, which includes:
Receiving module, for receiving webpage information.
Signal load unit, for according to template identification information searching label attribute information;It will using label attribute information
Customized label information possessed by self-defined template engine package file is defined as template label information;Letter is replaced using template
Number loads webpage information in the template label information that self-defined template engine package file contains according to template identification information;Net
Page template includes label attribute information, template identification information and self-defined template engine package file.
Compared with prior art, the beneficial effect of front-end server provided by the invention and above-mentioned web page template generation method
Beneficial effect it is identical, this will not be repeated here.
The present invention also provides a kind of computer storage medium, instruction is stored in the computer storage medium, it is described
When instruction is run, above-mentioned web page template generation method or above-mentioned webpage loading method are realized.
Compared with prior art, the beneficial effect of computer storage medium provided by the invention and above-mentioned web page template generate
The beneficial effect of method is identical, and this will not be repeated here.
The present invention also provides a kind of Website server, which includes above-mentioned front-end server.With existing skill
Art is compared, and the beneficial effect of Website server provided by the invention is identical as the beneficial effect of above-mentioned web page template generation method,
This will not be repeated here.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes a part of the invention, this hair
Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is the structural block diagram of server architecture provided in an embodiment of the present invention;
Fig. 2 is the information exchange figure of server architecture provided in an embodiment of the present invention;
Fig. 3 is the flow chart one of web page template loading method provided in an embodiment of the present invention;
Fig. 4 is the flowchart 2 of web page template loading method provided in an embodiment of the present invention;
Fig. 5 is the flow chart 3 of web page template loading method provided in an embodiment of the present invention;
Fig. 6 be front-end server provided in an embodiment of the present invention, back-end server, client connection block diagram;
Fig. 7 is the flow chart of web page template generation method provided in an embodiment of the present invention;
Fig. 8 connect block diagram with signal load unit for web page template generating means provided in an embodiment of the present invention;
Fig. 9 is the hardware realization structure chart of the network terminal provided in an embodiment of the present invention.
Appended drawing reference:
100- Website server, 110- front-end server;
111- transceiver module, 112- template generation module;
1121- Document encapsulation module, 1122- file import modul;
1123- data definition module, 113- signal load unit;
120- back-end server, 200- client;
The 300- network terminal, 310- processor;
320- memory, 330- transceiver;
340- bus.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Before introducing the application relevant information, the related terms being related to first to the application specific embodiment do as follows
It explains.
Front end refers to webpage front-end, that is, the thing that user visible can touch in page application.Including page
The interaction of face structure, Page Views visual performance and page level is realized.
Rear end is interacted with database to handle the part of corresponding service logic, requires consideration for how to realize function
Energy, data access, the stability of platform and performance etc..
Hypertext markup language (HyperText Markup Language, be abbreviated as html or HTML) is that one kind is used for
Create the standard markup language of webpage.Wherein, " hypertext ", which just refers in the page, may include picture, link or even music, journey
The non-legible element such as sequence.The structure of hypertext markup language include " head " part (English: Head) and " main body " part (English:
Body), wherein " head " portion provides the information about webpage, " main body " part provides the particular content of webpage.
The Chinese of DOM (Document Object Model, be abbreviated as DOM) is DOM Document Object Model, it is ten thousand dimensions
Net the standard of alliance.DOM defines the standard of access HTML and XML document, DOM be in stand on the interface of platform and language, it
Program and script is allowed dynamically to access and update the content of document, structure and style.
XML (Extensible Markup Language, be abbreviated as XML) is also known as expansible identifiable language, expansible
Markup language, the subset of standard generalized markup language is a kind of for marking electronic document to make it have structural label language
Speech.
Primary JavaScrip language is a kind of javascript language for following ECMAscript standard, is different from Microsoft
Jscript also not dependent on any frame, rely on the scripting language of browser standard engine.JavaScript language is also known as
Literal translation formula scripting language is a kind of regime type, weak type, the language based on prototype, built-in support type.
ECMAScript is that a kind of by Ecma, international (predecessor is European Computer Manufacture's Association, and English name is
European Computer Manufacturers Association) pass through the standardized shell script design of ECMA-262
Language.
Jscript is the active script language developed by Microsoft, is the realization that Microsoft standardizes ECMAScript.
Smarty language is a kind of template engine language write out using PHP, separates logical code and external interior
Hold, provide a kind of method for being easily managed and using, is used to divide with HTML code PHP code logic mixed in together originally
From.
PHP is a kind of language that HTML is embedded, is English supertext pretreatment language (PHP:Hypertext
Preprocessor abbreviation).PHP and the ASP (Active Server Page, be abbreviated as ASP) of Microsoft are quite similar in a measure,
It is all a kind of scripting language of insertion html document executed in server end, the style of language has similar to C language (The C
Programming Language), it is widely used by many website programming personnels now.
JSP (Java Server Pages, be abbreviated as JSP) language is exactly Java language, and only it is one special
Java language, joined a special engine, this engine initializes some objects of HTTPServlet class automatically
User is allowed to use well, and user does not have to the work for going to worry about front again.This engine introduces < jsp:*, < %@etc. one again simultaneously
The special grammer of series, some specific operations are carried out using these grammers, as reference document, URL are turned to, JavaBean draws
With equal such operation, these are all the work for helping you to complete initialization automatically by engine.The request method of HTTP includes
DELETE, GET, OPTIONS, POST, PUT and TRACE each provide corresponding method of servicing in HttpServlet class,
They are doDelete (), doGet (), doOptions (), doPost (), doPut () and doTrace ().
API (Application Programming Interface, be abbreviated as API) interface refers to encapsulation template file
Leave the calling interface of developer for, developer can be by the api interface to the relevant parameter in encapsulation template file
It is configured.
Self-defined template engine refers to that one kind oneself independent of third square bearer individual packages definition template engine, belongs to
PHP template engine in oneself is never fixed and invariable, and can be needed according to project for its is customized.
J2ee (Java 2Platform Enterprise Edition, be abbreviated as J2ee) is a set of entirely different in biography
It unites the Technical Architecture of application and development, includes many components, can mainly simplify and the exploitation and deployment of specification application system, Jin Erti
High portable, safety with again with being worth.J2ee core is one group of technical specification and guide, included in various components,
Service architecture and the hierarchy of skill have common standard and specification, allow between the various different platforms for following J2ee framework, exist
Good compatibility, solving the information products that enterprise backend uses in the past can not be compatible with each other, enterprises or external difficult
With the awkward situation of intercommunication.
The relevant technologies disclose a kind of method for showing foreground GRID data form data using JavaScrip template, packet
Include: Front End Server writes web page template using JavaScrip technology, and the web page template is then sent to background server,
Background server will show that information, the data such as J2ee label import web page template, then background server will containing display information,
The web page template of the data such as J2ee label is transmitted to front-end server and is shown again.However require that web page template is transferred to
Background server increases the data processing pressure of background server.
The present embodiments relate to a kind of web page template generation method and device, webpage loading method and front-end server and
Website server to simplify webpage information loading procedure, and effectively mitigates the data processing pressure of back-end server 120.
The embodiment of the present invention describes a kind of server architecture, which is to more clearly illustrate this hair
The technical solution of bright embodiment does not constitute the restriction for technical solution provided in an embodiment of the present invention, the common skill in this field
Art personnel are it is found that with the differentiation of server architecture and the appearance of new business scene, technical solution provided in an embodiment of the present invention
It is equally applicable for similar technical problem.
Fig. 1 shows a kind of server architecture, the server architecture include Website server 100 and with the website service
A client 200 communication that device 100 communicates;But in actual scene, which can also be multiple client 200.
It is browsed web sites content provided by server 100 using browser entrained by client 200, which can be intelligence
Energy mobile phone, tablet computer, desktop computer etc., but it is not limited only to this, as long as the terminal that can be networked can be used as client 200.Visitor
The operating system at family end 200 can be window operating system, (SuSE) Linux OS etc., but be not limited only to this;Browser can be with
For browsers such as 360 browsers, *** browser, sogou browsers.The Website server 100 can be applied to various websites
In, comprising: government website, enterprise web site, business website, education and scientific research organization web, personal website, but it is only limitted to this.
As shown in Figure 1, Website server 100 provided in an embodiment of the present invention includes the front-end server 110 of communication connection
With back-end server 120, front-end server 110 and client 200 are communicated to connect.Front-end server 110 is for receiving rear end clothes
The display information that business device 120 is sent, and utilize web page template loaded and displayed information.
It is illustrated below with reference to information interactive process of the Fig. 2 to server architecture provided in an embodiment of the present invention.
Step S100: 200 forward end server 110 of client sends triggering message;
Step S200: front-end server 110 sends solicited message according to triggering message rear end server.
Step S300: back-end server sends display information according to solicited message forward end server 110.
Step S400: front-end server 110 loads the display information using web page template.
Step S500: the web page template for being loaded with display information is sent to client 200 by front-end server 110.
Step S600: client 200 shows webpage according to the web page template for being loaded with display information in a browser, thus
Realize webpage initialization.
Therefore above-mentioned front-end server 110 need rear end server 120 to send solicited message, to transfer rear end
The transmission of server 120 shows information such as character string, is then believed using the web page template loaded and displayed in front-end server 110
Breath (assembling process that this process is also web page template and display information), sends web page template without front-end server 110
To back-end server 120, which not only simplifies page initialization procedures, and alleviate the data processing of back-end server 120
Pressure.
Fig. 3 shows a kind of web page template loading method, can be applied to above-mentioned front-end server 110.As shown in figure 3,
The webpage loading method includes:
Step S420: according to template identification information searching label attribute information.It should be understood that when template identification information determines,
So subtemplate determined by the template identification information also determines that, label attribute information possessed by the subtemplate is also just simultaneously
It determines.Web page template includes label attribute information, template identification information and self-defined template engine package file.The template mark
Knowing information is in web page template development process, after needing a web page template splitting into multiple subtemplates according to exploitation, so
Multiple subtemplates are identified afterwards, (Identification is abbreviated as the identity information of the referred to as corresponding subtemplate of the mark
ID it can be) Arabic numerals, be also possible to spcial character, exist in digital form as long as multiple subtemplates can be distinguished,
Can also exist in the form of spcial character.
Step S430: customized label possessed by self-defined template engine package file is believed using label attribute information
Breath is defined as template label information.
Step S440: contained according to template identification information in self-defined template engine package file using template replacement function
Template label information in load webpage information.
Above-mentioned web page template can pre-generate, and can also generate every time, but in view of above-mentioned Web page module contains label
Attribute information, template identification information and self-defined template engine package file.So that only needing after once generating web page template, i.e.,
The Web page module can be called when loading any webpage.Based on this, as shown in figure 3, above-mentioned web page template loading method
Further include: step S410: web page template is generated using web page template generation method.
Fig. 3 shows webpage information and receives before step S410, as long as it is to be understood that webpage information is in step herein
It is received before S440, i.e., before step S410, above-mentioned web page template loading method further include: step S405: receives webpage
Information.Content shown in Fig. 3 is not used to limit its protection scope.
Above-mentioned self-defined template engine package file has unalterable feature and customized property, so that utilizing web page template
When loading any webpage, the self-defined template engine package file can be called, and utilize label attribute information and template identification
Information is defined the customized label information contained by self-defined template engine package file, carries out webpage information load,
So that web page template web page template generated provided in an embodiment of the present invention has universality.
Above-mentioned template identification information is for searching template label information position, to determine the template of replacement needed for webpage information
Label position.Such as: in html webpage template<body>label with</body>there are multiple subtemplate files between label,
One of subtemplate file includes template identification and the tag attributes using template identification label, the table of the subtemplate file
It is as follows up to content:
<script id=" tpl " type=" type/template ">
<h2onclick="alert ( this.innerHTML ) ">{ { name } }</h2>
<a href="https://www.***.com">{ { name } } { { age } }</a>
<p>
<span data-if="age>15 ">{ { age } }</span>
<span data-if="score>30 ">{ { score } }</span>
</p>
</script>
Above-mentioned<script id=" tpl " type=" type/template ">indicates template identification " tpl ".
It is above-mentioned<span data-if="age>15 ">{ { age } }</span>indicate age tag attributes.
It is above-mentioned<span data-if="score>30 ">{ { score } }</span>indicate score tag attributes.
When using label attribute information by customized label information possessed by the self-defined template engine package file
After being defined as template label information, when using the cross-talk template loaded and displayed information, if showing, information is included older
In 15 years old, then age in { { age } } is replaced with into the age information for being greater than 15 years old that display information is included.If showing information institute
The score for including is greater than 30 points, then score in { { score } } is replaced with the score greater than 30 points that display information is included and believed
Breath.
Some data needs that the display information that above-mentioned back-end server 120 is sent contains are set to keep display, some
Data demand is hidden, some data demands circulation is shown, there are also some other requirements certainly, does not enumerate herein.Herein
The display strategy for keeping the modes such as display, hiding or circulation display to be defined as display information the data shown contained by information,
The display information that these display strategies can be the transmission of back-end server 120 is subsidiary, is also possible to front-end server 110 and sets
It is fixed.
Such as: when the display strategy of display information is the setting of front-end server 110, in order to enable the final shown page
Information meets data display and requires, and the display strategy of the following two kinds implementation setting display information can be used.
Under the first implementation, as shown in figure 4, above-mentioned made by oneself using template replacement function according to template identification information
Webpage information is loaded in the template label information that adopted template engine package file contains includes:
Step S441A: target template label information is determined according to template identification information and display information;
Step S442A: the display strategy of setting target template label information.
Step S443A: target template label information is substituted for webpage information using template replacement function.
Such as: the display strategy of target template label information can use following expression content:
<span data-hide="age>15 ">{ { age } }</span>
<div
Data-show=" showbool ">8888</div>
It is above-mentioned<span data-hide="age>15 ">{ { age } }</span>indicate the age that display information is included
When greater than 15 years old, the age for being greater than 15 years old that display information is included is hidden.
Under second of implementation, as shown in figure 5, above-mentioned utilize template replacement function according to template identification information certainly
Webpage information is loaded in the template label information that definition template engine package file contains includes:
Step S441B: target template label information is determined according to template identification information and display information;
Step S442B: target template label information is substituted for webpage information using template replacement function.
Step S443B: the display strategy of webpage information is set.
Under above two implementation, if the data of display information are relatively more, target is set using the first implementation
The display strategy of template label information can be relieved data processing pressure brought by the directly display strategy of setting display information.
If showing, the data of information are fewer, set display strategy using the first implementation or second of implementation.
As shown in Figure 3 and Figure 6, the embodiment of the invention also provides a kind of front-end servers 110, to execute above-mentioned webpage
Loading method, the front-end server 110 include:
The transceiver module 111 communicated to connect with client 200 and background server, for receiving webpage information.
The signal load unit 113 communicated to connect with web page template generation module 112 and transceiver module 111 is used for root
According to template identification information searching label attribute information;The self-defined template engine is encapsulated into text using the label attribute information
Customized label information possessed by part is defined as template label information;Existed using template replacement function according to template identification information
Webpage information is loaded in the template label information that the self-defined template engine package file contains;Web page template includes label category
Property information, template identification information and self-defined template engine package file.
Compared with prior art, the beneficial effect of front-end server 110 provided in an embodiment of the present invention adds with above-mentioned webpage
The beneficial effect of support method is identical, and this will not be repeated here.
It should be understood that, above-mentioned front-end server 110 should include also template generation module 112, for utilizing web page template
Generation method generates web page template.
In some implementations, if display strategy is the setting of front-end server 110, as shown in Figure 4 and Figure 6, above-mentioned letter
Breath loading module 113 is specifically used for determining target template label according to template identification information and display information;Set target template
The display strategy of label;Using the template replacement function by target template tag replacement at webpage information.
It is as shown in Figure 5 and Figure 6, above-mentioned if display strategy is the setting of front-end server 110 in other implementations
Signal load unit 113 is specifically used for determining target template label according to template identification information and display information;Utilize the mould
Plate replacement function is by target template tag replacement at webpage information;Set the display strategy of webpage information.
The embodiment of the invention also provides a kind of web page template generation method, which produces above-mentioned
Web page template.As shown in fig. 7, the web page template generation method includes:
Step S411: self-defined template engine file is packaged, and obtains self-defined template engine package file, so that
Self-defined template engine package file can not be changed arbitrarily.The self-defined template engine file can draw for php self-defined template
Hold up class file, or other self-defined template engine files.It should be understood that the self-defined template engine package file externally mentions
For unified api interface, data exporting function can be supported, such as: self-defined template can be called by the api interface
Self-defined template engine file contained by engine package file, to the customized mark contained by the self-defined template engine file
Label attribute is defined, naturally it is also possible to be configured to other configurations parameter.
Step S412: self-defined template engine package file is imported into html file.The self-defined template engine file
Type is relatively more, can select according to actual needs,
Step S413: according to html file, the web page template for being used for loading page data is obtained, which contains mark
Sign attribute information, template identification information and self-defined template engine package file.
Such as: self-defined template engine package file is imported in the head of html file structure, following expression can be used
Content:
<!doctype html>
<html lang=" en ">
<head>
<meta charset=" UTF-8 ">
<title>template</title>
<script src="template.js"></script>
</head>
It is above-mentioned<script src="template.js"></script>represent the self-defined template engine encapsulation imported
File is made of JavaScript language encapsulation.
It should be understood that the above-mentioned mode for obtaining web page template according to html file is varied, and such as: do not changing html text
Under the premise of part structure, label attribute information and template identification information can be added in html file.Label attribute information and
Template identification information is generally added at the main body of html file structure.Such as: label attribute information can be added in Dom node
Place.Such as: the subtemplate file included by a Page Template file is expressed using following content:
By above-mentioned web page template generation method detailed process it is found that under the premise of not changing html file structure,
Increase the customized label (with character string forms) in tag attributes replacement self-defined template engine file in html file structure,
To be defined to the customized label contained by self-defined template engine file;Moreover, being assembled into page mould in display information
When plate, the display information that back-end server 120 is sent need to be only filled into pair according to label attribute information and template identification information
Label position is answered, front end data processing pressure is reduced.Specifically, self-defined template engine file is packaged, and
Self-defined template engine package file obtained is directed into html file;On this basis, it is obtained according to html file
Web page template contains label attribute information, template identification information and self-defined template engine package file at this time in web page template,
It is not necessary that web page template generated is transmitted to background server, self-defined template engine need to only be sealed using label attribute information
Customized label information possessed by dress file is defined as template label information;Believed using template replacement function according to template identification
Breath loads webpage information in the template label information that the self-defined template engine package file contains, and this makes it possible to simplification
Webpage information loading procedure, and effectively mitigate the data processing pressure of back-end server 120.
Meanwhile being packaged that can guarantee to import self-defined template engine file can not be with to self-defined template engine file
Meaning change, this makes it possible to packaged by when load any webpage, can calling at web page template engine so that the present invention is real
Example web page template generated is applied with dynamic changeability, therefore, web page template generation method institute provided in an embodiment of the present invention
The web page template of generation has universality, can load various webpage informations, also facilitate developer's unification component in this way, using very
Few api interface realizes a variety of customization appellative functions, to improve team development efficiency and convenient for unified maintenance, avoids a variety of
Template types component exists, and effectively increases webpage initialization speed.
In some implementations, above-mentioned to be packaged self-defined template engine file, obtain self-defined template engine
Package file includes:
Self-defined template engine file is packaged using Web wrapper language, obtains self-defined template engine encapsulation text
Part.
Above-mentioned webpage, which becomes language, to be local pattern plate programming language or third party's pattern plate programming language, in general sheet
Ground pattern plate programming language.
When using third party's pattern plate programming language encapsulation self-defined template engine file, third party's pattern plate programming language is fixed
Property processed is poor, is unable to satisfy webpage development individual demand, so that customized using different third party's pattern plate programming language encapsulation
When template engine file, need to cause api interface more complicated using different api interfaces;Third party's pattern plate programming language simultaneously
The problems such as speech is because of edition upgrading, maintainable and safety are poor.Moreover, third party's pattern plate programming language is generally all
It is by the language of further programmed process, Documents Comparison is big, influences page loading velocity and initialization speed.
When using local pattern plate programming language encapsulation self-defined template engine file, webpage provided in an embodiment of the present invention
Template generation method needs not rely on any frame of third party and library, so that web page template Documents Comparison generated is small, therefore,
Be conducive to improve webpage loading velocity and refresh rate, also avoid providing api interface to third party, be connect to reduce API
The quantity of mouth, facilitates developer to use.Meanwhile according to the addition that business needs to customize or mark can be reduced in web page template
Attribute information is signed, therefore, web page template generation method web page template generated provided in an embodiment of the present invention customizes degree
It is relatively high.
The type of above-mentioned Web wrapper language can be primary JavaScript language, Smarty language or JSP language, but
It is not limited only to this.
Such as: when above-mentioned Web wrapper language can be primary JavaScript language, at this time using primary
JavaScript language encapsulates self-defined template engine file, is handled without importing rear end, so that generating in web page template
Ensure that front and rear end separates in the process, above-mentioned self-defined template engine package file obtained and html file melt
Conjunction property is good, after front end where ensure that the web page template of generation does not have to request Back end data, carries out the splicing of complex characters string, only
It needs front end directly to receive display information from rear end to be loaded, ensures that front-end and back-end decouple in this way, so also certain
Reduce web page template in degree to the api interface of rear end.
As shown in Figure 7 and Figure 8, the embodiment of the invention also provides a kind of web page template generating means, the web page template is raw
Include: at device
Document encapsulation module 1121 obtains self-defined template engine for self-defined template engine file to be packaged
Package file;
File import modul 1122 obtains customized for self-defined template engine package file to be imported html file
Html file;
The data definition module 1123 communicated to connect with signal load unit 113, for being used for according to html file
The web page template of loading page data, the web page template contain label attribute information, template identification information and self-defined template
Engine package file.
Compared with prior art, the beneficial effect of web page template generating means provided in an embodiment of the present invention and above-mentioned webpage
The beneficial effect of template generation method is identical, and this will not be repeated here.
In some implementations, above-mentioned Document encapsulation module 1121 is specifically used for using Web wrapper language to customized
Template engine file is packaged, and obtains self-defined template engine package file.
Above-mentioned Web wrapper language includes local pattern plate programming language or third party's pattern plate programming language;Further, above-mentioned
Web wrapper language includes primary JavaScript language, Smarty language or JSP language.
The embodiment of the invention also provides a kind of computer storage medium, it is stored with instruction in the computer storage medium,
When described instruction is run, above-mentioned web page template generation method or above-mentioned webpage loading method are realized.
Above-mentioned computer storage medium can be read-only memory (read-only memory, ROM) or can store static state
The other kinds of static storage device of information and instruction, random access memory (random access memory, RAM) or
Person can store the other kinds of dynamic memory of information and instruction, be also possible to Electrically Erasable Programmable Read-Only Memory
(electrically erasable programmable read-only memory, EEPROM), CD-ROM (compact
Disc read-only memory, CD-ROM) or other optical disc storages, optical disc storage (including compression optical disc, laser disc, light
Dish, Digital Versatile Disc, Blu-ray Disc etc.), magnetic disk storage medium or other magnetic storage apparatus or can be used in carry or
Store have instruction or data structure form desired program code and can by any other medium of computer access, but
It is without being limited thereto.Memory, which can be, to be individually present, and is connected by communication line with processor.
The embodiment of the invention also provides a kind of computer program products, including one or more computer instructions.It is counting
On calculation machine when load and computer instructions, the process or function according to the embodiment of the present application are entirely or partly generated.Meter
Calculation machine can be general purpose computer, special purpose computer, computer network or other programmable devices.
Above-mentioned computer instruction may be stored in a computer readable storage medium, or from a computer-readable storage
Medium is transmitted to another computer readable storage medium, for example, computer instruction can be from web-site, computer, a clothes
It is engaged in device or data center by wired (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wirelessly (such as infrared, nothing
Line, microwave etc.) mode transmitted to another web-site, computer, server or data center.Computer-readable storage
Medium can be any usable medium that computer can store or include the integrated service of one or more usable mediums
The data storage devices such as device, data center.Usable medium can be magnetic medium, (for example, floppy disk, hard disk, tape), optical medium
(for example, DVD) or semiconductor medium (such as solid state hard disk Solid State Disk, SSD) etc..
As shown in figure 9, the embodiment of the present invention has been also provided to a kind of network terminal 300, which includes processing
Device 310, memory 320, transceiver 330 and bus 340;Processor 310, memory 320 and transceiver 330 pass through bus each other
Communication.For storing computer instruction, which executes above-mentioned the memory 320 for running the computer instruction
Step S100, at least one of step S200, step S300, step S400, step S500, step S600, and/or for executing
At least one of above-mentioned steps S405, step S410, step S420, step S430, step S440, and/or it is above-mentioned for executing
Step S411, at least one of step S412, step S413, and/or for executing above-mentioned steps S441A, step S442A, step
At least one of at least one of rapid S443A, S441B, step S442B, step S443B.
Wherein, processor 310 described in the embodiment of the present invention can be a processor, be also possible to multiple processing elements
General designation.For example, the processor 310 can be central processing unit (Central Processing Unit, abbreviation CPU), it can also
To be specific integrated circuit (Application Specific Integrated Circuit, abbreviation ASIC), or matched
The one or more integrated circuits for implementing the embodiment of the present invention are set to, such as: one or more microprocessors (digital
Signal processor, abbreviation DSP), or, one or more field programmable gate array (Field Programmable
Gate Array, abbreviation FPGA).
Memory 320 can be a storage device, be also possible to the general designation of multiple memory elements, and for storing and can hold
Line program code etc..And memory 320 may include random access memory (RAM), also may include nonvolatile memory (non-
Volatile memory), for example, magnetic disk storage, flash memory (Flash) etc..
It is total that bus 340 can be industry standard architecture (Industry Standard Architecture, ISA)
Line, external equipment interconnection (Peripheral Component, PCI) bus or extended industry-standard architecture (Extended
Industry Standard Architecture, EISA) bus etc..The bus can be divided into address bus, data/address bus, control
Bus processed etc..Only to be indicated with a thick line in Fig. 9, it is not intended that an only bus or a type of convenient for indicating
Bus.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for equipment reality
For applying example, since it is substantially similar to the method embodiment, so describing fairly simple, related place is referring to embodiment of the method
Part explanation.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain
Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.
Claims (14)
1. a kind of web page template generation method characterized by comprising
Self-defined template engine file is packaged, self-defined template engine package file is obtained;
The self-defined template engine package file is imported into html file;
According to the html file, the web page template for being used for loading page data is obtained, the web page template contains tag attributes
Information, template identification information and self-defined template engine package file.
2. web page template generation method according to claim 1, which is characterized in that described by self-defined template engine file
It is packaged, obtaining self-defined template engine package file includes:
Self-defined template engine file is packaged using Web wrapper language, obtains self-defined template engine package file.
3. web page template generation method according to claim 2, which is characterized in that
The Web wrapper language includes local pattern plate programming language or third party's pattern plate programming language;
And/or
The Web wrapper language includes primary JavaScript language, Smarty language or JSP language.
4. a kind of web page template generating means characterized by comprising
Document encapsulation module obtains self-defined template engine package file for self-defined template engine file to be packaged;
File import modul obtains customized html for the self-defined template engine package file to be imported html file
File;
Data definition module, for obtaining the web page template for being used for loading page data, the webpage according to the html file
Template contains label attribute information, template identification information and self-defined template engine package file.
5. web page template generating means according to claim 4, which is characterized in that the Document encapsulation module is specifically used for
Self-defined template engine file is packaged using Web wrapper language, obtains self-defined template engine package file.
6. web page template generating means according to claim 5, which is characterized in that the Web wrapper language includes local
Pattern plate programming language or third party's pattern plate programming language;
And/or
The Web wrapper language includes primary JavaScript language, Smarty language or JSP language.
7. a kind of webpage loading method characterized by comprising
Webpage information is received, according to template identification information searching label attribute information;Web page template includes label attribute information, mould
Panel sign information and self-defined template engine package file;
Customized label information possessed by the self-defined template engine package file is defined as using label attribute information
Template label information;
The template mark contained according to template identification information in the self-defined template engine package file using template replacement function
Webpage information is loaded in label information.
8. webpage loading method according to claim 7, which is characterized in that described to utilize template replacement function according to template
Identification information loads webpage information in the template label information that the self-defined template engine package file contains
Target template label information is determined according to template identification information and display information;
Set the display strategy of target template label information;
Target template label information is substituted for webpage information using the template replacement function.
9. webpage loading method according to claim 7, which is characterized in that described to utilize template replacement function according to template
Identification information loads webpage information in the template label information that the self-defined template engine package file contains
Target template label information is determined according to template identification information and display information;
Target template label information is substituted for webpage information using template replacement function;
Set the display strategy of webpage information.
10. a kind of front-end server characterized by comprising
Transceiver module, for receiving webpage information;
Signal load unit, for according to template identification information searching label attribute information;It will be made by oneself using label attribute information
Customized label information possessed by adopted template engine package file is defined as template label information;It is pressed using template replacement function
Webpage information, webpage mould are loaded in the template label information that self-defined template engine package file contains according to template identification information
Plate includes label attribute information, template identification information and self-defined template engine package file.
11. front-end server according to claim 10, which is characterized in that the signal load unit be specifically used for according to
Template identification information and display information determine target template label;Set the display strategy of target template label;Utilize the mould
Plate replacement function is by target template tag replacement at webpage information.
12. front-end server according to claim 10, which is characterized in that the signal load unit be specifically used for according to
Template identification information and display information determine target template label;Using the template replacement function by target template tag replacement
At webpage information;Set the display strategy of webpage information.
13. a kind of computer storage medium, which is characterized in that be stored with instruction, described instruction in the computer storage medium
When being run, any one of any one of the claims 1 to 3 web page template generation method or claim 7~9 net are realized
Page loading method.
14. a kind of Website server, which is characterized in that including any one of claim 10~12 front-end server.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910385316.XA CN110297999A (en) | 2019-05-09 | 2019-05-09 | A kind of web page template generation method and device, webpage loading method and front-end server and Website server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910385316.XA CN110297999A (en) | 2019-05-09 | 2019-05-09 | A kind of web page template generation method and device, webpage loading method and front-end server and Website server |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110297999A true CN110297999A (en) | 2019-10-01 |
Family
ID=68026763
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910385316.XA Pending CN110297999A (en) | 2019-05-09 | 2019-05-09 | A kind of web page template generation method and device, webpage loading method and front-end server and Website server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110297999A (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110825374A (en) * | 2019-11-04 | 2020-02-21 | 泰康保险集团股份有限公司 | Page generation method and device based on component, electronic equipment and storage medium |
CN111273964A (en) * | 2020-02-14 | 2020-06-12 | 北京字节跳动网络技术有限公司 | Data loading method and device |
CN111310005A (en) * | 2020-02-07 | 2020-06-19 | 北京达佳互联信息技术有限公司 | Network request processing method and device, server and storage medium |
CN111443909A (en) * | 2020-03-23 | 2020-07-24 | 北京百度网讯科技有限公司 | Method and device for generating page |
CN112351094A (en) * | 2020-11-02 | 2021-02-09 | 深圳市安软科技股份有限公司 | Webpage pushing method and device, electronic equipment and storage medium |
CN112363732A (en) * | 2020-10-15 | 2021-02-12 | 深圳市明源云科技有限公司 | Website packaging method and device, terminal equipment and computer readable storage medium |
CN112947915A (en) * | 2019-12-11 | 2021-06-11 | 顺丰科技有限公司 | Method, device and storage medium for self-defining page |
CN114911534A (en) * | 2021-02-09 | 2022-08-16 | 浙江宇视科技有限公司 | Page information extraction method, setting method, device, electronic equipment and medium |
CN116227455A (en) * | 2023-04-25 | 2023-06-06 | 深圳代码兄弟技术有限公司 | File generation method and system and electronic equipment |
CN116542776A (en) * | 2023-05-12 | 2023-08-04 | 上海汉朔信息科技有限公司 | Account fund business process supervision method, device, equipment and medium |
CN116880826A (en) * | 2023-09-07 | 2023-10-13 | 厦门畅享信息技术有限公司 | Code template based on function mark and visualized code generation method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104216926A (en) * | 2013-06-05 | 2014-12-17 | 上海缪思信息科技有限公司 | Page generating method, template engine and processor |
CN104714982A (en) * | 2013-12-17 | 2015-06-17 | 阿里巴巴集团控股有限公司 | Method and system for loading webpage |
CN105955759A (en) * | 2016-05-26 | 2016-09-21 | 浪潮(苏州)金融技术服务有限公司 | Template engine realization method used for Web development |
CN108664247A (en) * | 2018-04-26 | 2018-10-16 | 微梦创科网络科技(中国)有限公司 | A kind of method and device of Page Template data interaction |
-
2019
- 2019-05-09 CN CN201910385316.XA patent/CN110297999A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104216926A (en) * | 2013-06-05 | 2014-12-17 | 上海缪思信息科技有限公司 | Page generating method, template engine and processor |
CN104714982A (en) * | 2013-12-17 | 2015-06-17 | 阿里巴巴集团控股有限公司 | Method and system for loading webpage |
CN105955759A (en) * | 2016-05-26 | 2016-09-21 | 浪潮(苏州)金融技术服务有限公司 | Template engine realization method used for Web development |
CN108664247A (en) * | 2018-04-26 | 2018-10-16 | 微梦创科网络科技(中国)有限公司 | A kind of method and device of Page Template data interaction |
Non-Patent Citations (1)
Title |
---|
LARS KAPPERT: "《模板,从服务端到客户端》", 《HTTPS://KB.CNBLOGS.COM/PAGE/210862/》 * |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110825374A (en) * | 2019-11-04 | 2020-02-21 | 泰康保险集团股份有限公司 | Page generation method and device based on component, electronic equipment and storage medium |
CN112947915A (en) * | 2019-12-11 | 2021-06-11 | 顺丰科技有限公司 | Method, device and storage medium for self-defining page |
CN111310005A (en) * | 2020-02-07 | 2020-06-19 | 北京达佳互联信息技术有限公司 | Network request processing method and device, server and storage medium |
CN111273964A (en) * | 2020-02-14 | 2020-06-12 | 北京字节跳动网络技术有限公司 | Data loading method and device |
CN111273964B (en) * | 2020-02-14 | 2024-03-08 | 抖音视界有限公司 | Data loading method and device |
CN111443909A (en) * | 2020-03-23 | 2020-07-24 | 北京百度网讯科技有限公司 | Method and device for generating page |
CN111443909B (en) * | 2020-03-23 | 2023-09-29 | 北京百度网讯科技有限公司 | Method and device for generating page |
CN112363732A (en) * | 2020-10-15 | 2021-02-12 | 深圳市明源云科技有限公司 | Website packaging method and device, terminal equipment and computer readable storage medium |
CN112351094A (en) * | 2020-11-02 | 2021-02-09 | 深圳市安软科技股份有限公司 | Webpage pushing method and device, electronic equipment and storage medium |
CN112351094B (en) * | 2020-11-02 | 2023-10-03 | 深圳市安软科技股份有限公司 | Webpage pushing method and device, electronic equipment and storage medium |
CN114911534B (en) * | 2021-02-09 | 2024-02-20 | 浙江宇视科技有限公司 | Page information extraction method, setting method, device, electronic equipment and medium |
CN114911534A (en) * | 2021-02-09 | 2022-08-16 | 浙江宇视科技有限公司 | Page information extraction method, setting method, device, electronic equipment and medium |
CN116227455A (en) * | 2023-04-25 | 2023-06-06 | 深圳代码兄弟技术有限公司 | File generation method and system and electronic equipment |
CN116542776A (en) * | 2023-05-12 | 2023-08-04 | 上海汉朔信息科技有限公司 | Account fund business process supervision method, device, equipment and medium |
CN116880826B (en) * | 2023-09-07 | 2023-12-08 | 厦门畅享信息技术有限公司 | Visualized code generation method |
CN116880826A (en) * | 2023-09-07 | 2023-10-13 | 厦门畅享信息技术有限公司 | Code template based on function mark and visualized code generation method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110297999A (en) | A kind of web page template generation method and device, webpage loading method and front-end server and Website server | |
CN109597661B (en) | Service function configuration method and device | |
ES2280283T3 (en) | CONTROL OBJECTS OF THE SERVER SIDE FOR THE PROCESSING OF ELEMENTS OF THE USER INTERFACE OF THE CLIENT SIDE. | |
CN110806863A (en) | Interface document generation method and device, electronic equipment and storage medium | |
CN110825362A (en) | Low-code application software development system and method | |
EP3047372B1 (en) | Computer-aided development of native mobile application code | |
CN102495735A (en) | Web end UI (user interface) component application frame system | |
CN105872083A (en) | Method and system supporting server access by different types of clients as well as server | |
CN104375858B (en) | Many browser platforms perform the method and device of javascript scripts | |
WO2008099393A2 (en) | Service provisioning system | |
CN102141991A (en) | Method and system for web server | |
CN107995153A (en) | Form data verification method and form data verification device | |
CN112615759B (en) | Full link voltage measurement assembly, full link voltage measurement method and device | |
CN111880813B (en) | Method for realizing android card UI (user interface) and storage medium | |
CN113010827A (en) | Page rendering method and device, electronic equipment and storage medium | |
CN103530338A (en) | Frame for carrying out page rendering on calculation equipment and page generation method | |
CN110020358A (en) | Method and apparatus for generating dynamic page | |
US20090037829A1 (en) | Framework to integrate web services with on-premise software | |
US7996764B2 (en) | Apparatus, program and method for accepting a request from a client computer via a network and executing a web application | |
JP5039946B2 (en) | Technology for relaying communication between client devices and server devices | |
CN109669678A (en) | Template engine integration method, device, electronic equipment and storage medium | |
CN113778897A (en) | Automatic test method, device, equipment and storage medium of interface | |
CN113821565A (en) | Method for synchronizing data of multiple data sources | |
CN103885988B (en) | Export method and device, the content output system of content | |
Haller et al. | RaUL: RDFa User Interface Language–A data processing model for web applications |
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 |