CN112860268A - Template hot deployment method and device - Google Patents

Template hot deployment method and device Download PDF

Info

Publication number
CN112860268A
CN112860268A CN201911182828.2A CN201911182828A CN112860268A CN 112860268 A CN112860268 A CN 112860268A CN 201911182828 A CN201911182828 A CN 201911182828A CN 112860268 A CN112860268 A CN 112860268A
Authority
CN
China
Prior art keywords
template file
page type
file
exist
template
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.)
Granted
Application number
CN201911182828.2A
Other languages
Chinese (zh)
Other versions
CN112860268B (en
Inventor
丁鹏程
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201911182828.2A priority Critical patent/CN112860268B/en
Publication of CN112860268A publication Critical patent/CN112860268A/en
Application granted granted Critical
Publication of CN112860268B publication Critical patent/CN112860268B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a template hot deployment method and a template hot deployment device, and relates to the technical field of computers. One embodiment of the method comprises: receiving an updating request of a user, and analyzing a page type corresponding to the updating request; inquiring whether a target template file corresponding to the page type exists or not; and if so, dynamically analyzing and loading the target template file. The implementation method can enable the Velocity template to be changed to take effect on line under the condition that the whole application is not on line, realizes hot deployment, and avoids various problems caused by the fact that the whole application needs to be packaged to be on line.

Description

Template hot deployment method and device
Technical Field
The invention relates to the technical field of computers, in particular to a template hot deployment method and device.
Background
Velocity is a Java-based template engine (template engine) that generates a standard HTML (HyperText Markup Language) document. The Velocity template file is generally suffixed with vm, and is usually deployed under the WEB-INF/directory of the Web container. Each time the template changes, the entire application needs to be re-threaded.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
when only the front-end page style and the back-end service code are changed in the iterative development, the existing template deployment scheme still needs to pack the whole application for online, and the whole application comprises a template file, a back-end service code and the like, so that the back-end service is unnecessarily online, the front-end and back-end communication cost is increased, the workload of back-end personnel is increased, and meanwhile, the problems of different authority and responsibility are caused.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for template hot deployment, which can implement that a Velocity template is changed to take effect online without online whole application, implement hot deployment, and avoid various problems caused by packaging the whole application to be online.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a template hot deployment method, including:
receiving an updating request of a user, and analyzing a page type corresponding to the updating request;
inquiring whether a target template file corresponding to the page type exists or not;
and if so, dynamically analyzing and loading the target template file.
Optionally, the state of each template file includes a gray state and an online state; inquiring whether a target template file corresponding to the page type exists or not, wherein the inquiring includes:
inquiring whether a template file of a gray state corresponding to the page type exists or not;
if the template file exists, taking the template file in the gray state as the target template file;
otherwise, inquiring whether a template file of an online state corresponding to the page type exists or not; if the template file exists, the template file in the online state is used as the target template file, otherwise, the target template file corresponding to the page type does not exist.
Optionally, querying whether a template file of a gray level state corresponding to the page type exists includes:
inquiring a template file of a gray state corresponding to the page type in a local cache; if the local cache does not exist, inquiring a template file in a gray state corresponding to the page type from a database; if the data base does not exist, judging that the template file of the gray state corresponding to the page type does not exist;
inquiring whether a template file of an online state corresponding to the page type exists or not, wherein the inquiring comprises the following steps:
inquiring a template file of an online state corresponding to the page type in a local cache; if the local cache does not exist, inquiring a template file in an online state corresponding to the page type from a database; and if the target template file does not exist in the database, judging that the target template file corresponding to the page type does not exist.
Optionally, before querying a template file of a grayscale state corresponding to the page type in a database, the method further includes: confirming that first empty data corresponding to the page type does not exist in a local buffer; if the template file exists, judging that the template file of the gray state corresponding to the page type does not exist; after the template file of the gray state corresponding to the page type is inquired in a database, the method further comprises the following steps: and if the data base does not exist, setting first empty data corresponding to the page type in a local buffer.
Optionally, before querying a template file of an online status corresponding to the page type in a database, the method further includes: confirming that second empty data corresponding to the page type does not exist in a local buffer; if the template file exists, judging that the template file of the online state corresponding to the page type does not exist; after the template file of the online state corresponding to the page type is inquired in the database, the method further comprises the following steps: and if the data base does not exist, setting second empty data corresponding to the page type in the local buffer.
Optionally, before the template file in the grayscale state is taken as the target template file, the method further includes: confirming that the user exists in a preset gray level list; and if the user does not exist in the preset gray list, jumping to a step of inquiring whether a template file of an online state corresponding to the page type exists or not.
Optionally, the method of the embodiment of the present invention further includes: and responding to a state change instruction, and changing the state of the template file from a gray state to an online state.
Optionally, the method of the embodiment of the present invention further includes: and responding to the template modification instruction, and modifying the file content of the template file in the gray state.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for template hot deployment, including: the file configuration module and the file analysis module; wherein the content of the first and second substances,
the file configuration module is used for configuring a template file;
the file analysis module receives an update request of a user and analyzes a page type corresponding to the update request; inquiring whether a target template file corresponding to the page type exists or not; and if so, dynamically analyzing and loading the target template file.
Optionally, the state of each template file includes a gray state and an online state;
the file analysis module inquires whether a target template file corresponding to the page type exists or not, and the method comprises the following steps:
inquiring whether a template file of a gray state corresponding to the page type exists or not;
if the template file exists, taking the template file in the gray state as the target template file;
otherwise, inquiring whether a template file of an online state corresponding to the page type exists or not; if the template file exists, the template file in the online state is used as the target template file, otherwise, the target template file corresponding to the page type does not exist.
Optionally, the querying, by the file parsing module, whether a template file of a gray level state corresponding to the page type exists includes:
inquiring a template file of a gray state corresponding to the page type in a local cache; if the local cache does not exist, inquiring a template file in a gray state corresponding to the page type from a database; if the data base does not exist, judging that the template file of the gray state corresponding to the page type does not exist;
inquiring whether a template file of an online state corresponding to the page type exists or not, wherein the inquiring comprises the following steps:
inquiring a template file of an online state corresponding to the page type in a local cache; if the local cache does not exist, inquiring a template file in an online state corresponding to the page type from a database; and if the target template file does not exist in the database, judging that the target template file corresponding to the page type does not exist.
Optionally, the file parsing module is further configured to: before a template file of a gray state corresponding to the page type is inquired in a database, confirming that first empty data corresponding to the page type does not exist in a local buffer; if the template file exists, judging that the template file of the gray state corresponding to the page type does not exist; and after the template file of the gray state corresponding to the page type is inquired in the database, if the template file does not exist in the database, setting first empty data corresponding to the page type in a local buffer.
Optionally, the file parsing module is further configured to: before a template file of an online state corresponding to the page type is inquired in a database, confirming that second empty data corresponding to the page type does not exist in a local buffer; if the template file exists, judging that the template file of the online state corresponding to the page type does not exist; and after the template file of the online state corresponding to the page type is inquired in the database, if the template file does not exist in the database, second empty data corresponding to the page type is set in the local buffer.
Optionally, the file parsing module is further configured to: before the template file in the gray state is taken as the target template file, confirming that the user exists in a preset gray list; and if the user does not exist in the preset gray list, jumping to a step of inquiring whether a template file of an online state corresponding to the page type exists or not.
Optionally, the file configuration module is further configured to: and responding to a state change instruction, and changing the state of the template file from a gray state to an online state.
Optionally, the file configuration module is further configured to: and responding to the template modification instruction, and modifying the file content of the template file in the gray state.
According to a third aspect of embodiments of the present invention, there is provided a template hot-deployment electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method provided by the first aspect of the embodiments of the present invention.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method provided by the first aspect of embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: by configuring the template file according to the page type in advance, searching the target template file according to the page type corresponding to the updating request, dynamically analyzing and loading, the fact that the Velocity template is changed and takes effect on line under the condition that the whole application is not on line can be achieved, hot deployment is achieved, and various problems caused by the fact that the whole application needs to be packaged and is on line are avoided.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic main flow chart of a method for template hot deployment according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a method for template hot deployment according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of the main flow of a method of template hot deployment in an alternative embodiment of the invention;
FIG. 4 is a schematic diagram of the main modules of a template hot-deploy apparatus according to an embodiment of the invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 6 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
So-called hot-deployment is to update software while an application is running, without restarting the application. In the invention, the configuration of the template file is firstly realized, and then the content of the template file is dynamically analyzed, so that the thermal deployment of the Velocity template is realized.
According to an aspect of an embodiment of the present invention, a method of template hot deployment is provided.
Fig. 1 is a schematic main flow diagram of a template hot deployment method according to an embodiment of the present invention, and as shown in fig. 1, the template hot deployment method includes: step S101, step S102, and step S103.
Step S101, receiving an updating request of a user, and analyzing a page type corresponding to the updating request.
In the invention, each template file is configured in advance according to the page type. The page type division mode can be selectively set according to the actual situation, such as a home page, a channel page, and the like.
The developer can pre-configure and store the template file to be issued, and the state of the template file can be only one, and can also comprise the states of gray scale, online, offline and the like. The initial state of the newly-built template file is a gray state. The template file in the gray state supports modification, deletion and online operation, and facilitates random strain of a publisher according to the publishing condition. The template file of the online state only supports viewing, and does not allow any operation of changing the template file, so as to ensure the stability of the online environment.
Optionally, in order to facilitate accurate locking of the publishing object of the template file in the grayscale state, a grayscale list may be set for the template file in the grayscale state, and the grayscale list is used to indicate a list of users capable of loading the template file in the grayscale state. Each user in the user list may be identified by its PIN (Personal Identification Number) or by its IP (Internet Protocol), which is the device used by the user.
And S102, inquiring whether a target template file corresponding to the page type exists or not.
Because the template file is configured according to the page type, when the template file is searched, the template file corresponding to the page type can be searched through the page type corresponding to the updating request.
In order to implement gray scale online, optionally, the state of each template file includes a gray scale state and an online state; inquiring whether a target template file corresponding to the page type exists or not, wherein the inquiring includes:
inquiring whether a template file of a gray state corresponding to the page type exists or not;
if the template file exists, taking the template file in the gray state as the target template file;
otherwise, inquiring whether a template file of an online state corresponding to the page type exists or not; if the template file exists, the template file in the online state is used as the target template file, otherwise, the target template file corresponding to the page type does not exist.
In this example, the template file in the gray state is preferentially adopted for loading to realize gray release, so that the release quality of the Velocity template can be ensured.
Optionally, querying whether a template file of a gray level state corresponding to the page type exists includes:
inquiring a template file of a gray state corresponding to the page type in a local cache; if the local cache does not exist, inquiring a template file in a gray state corresponding to the page type from a database; if the data base does not exist, judging that the template file of the gray state corresponding to the page type does not exist;
inquiring whether a template file of an online state corresponding to the page type exists or not, wherein the inquiring comprises the following steps:
inquiring a template file of an online state corresponding to the page type in a local cache; if the local cache does not exist, inquiring a template file in an online state corresponding to the page type from a database; and if the target template file does not exist in the database, judging that the target template file corresponding to the page type does not exist.
FIG. 2 is a schematic diagram of the method of template hot deployment in this example. In general, the page access frequency is high, and in this example, the template is released in cooperation with the local cache, so that the file reading efficiency can be improved.
Optionally, before querying a template file of a grayscale state corresponding to the page type in a database, the method further includes: confirming that first empty data corresponding to the page type does not exist in a local buffer; if the template file exists, judging that the template file of the gray state corresponding to the page type does not exist; after the template file of the gray state corresponding to the page type is inquired in a database, the method further comprises the following steps: and if the data base does not exist, setting first empty data corresponding to the page type in a local buffer.
By setting the null data, cache penetration can be avoided, so that the condition that the database service is overloaded due to excessive query requests for the database under the high concurrency condition is avoided.
Optionally, before querying a template file of an online status corresponding to the page type in a database, the method further includes: confirming that second empty data corresponding to the page type does not exist in a local buffer; if the template file exists, judging that the template file of the online state corresponding to the page type does not exist; after the template file of the online state corresponding to the page type is inquired in the database, the method further comprises the following steps: and if the data base does not exist, setting second empty data corresponding to the page type in the local buffer.
By setting the null data, cache penetration can be avoided, so that the condition that the database service is overloaded due to excessive query requests for the database under the high concurrency condition is avoided.
Optionally, before the template file in the grayscale state is taken as the target template file, the method further includes: confirming that the user exists in a preset gray level list; and if the user does not exist in the preset gray list, jumping to a step of inquiring whether a template file of an online state corresponding to the page type exists or not.
In this example, a gray level list is provided for the template file in the gray level state, and the gray level list is used for indicating a user list capable of loading the template file in the gray level state. By setting the gray level list, the issuing object of the template file in the gray level state can be conveniently and accurately locked.
And S103, if the target template file exists, dynamically analyzing and loading the target template file.
In general, the evaluate instruction in Velocity may be used to dynamically analyze the content of the target template file, so as to complete the loading of the target template file. The page is returned to the user after being dynamically rendered.
Optionally, the method of the embodiment of the present invention further includes: and responding to a state change instruction, and changing the state of the template file from a gray state to an online state. For example, the release condition of the template file in the gray state is obtained, and when the release effect meets the online requirement, the state of the template file can be modified from the gray state to the online state, so that the template file is formally online.
Optionally, the method of the embodiment of the present invention further includes: and responding to the template modification instruction, and modifying the file content of the template file in the gray state. And acquiring the release condition of the template file in the gray state, and when partial problems are found in the release process and the template needs to be modified, modifying the file content of the template file until the requirements are met.
In the prior art, a Velocity template file is usually deployed in a WEB-INF/directory of a Web container, and the whole application needs to be online again every time a template is changed. When only the front-end page style and the back-end service code are changed in the iterative development, the existing template deployment scheme still needs to pack the whole application for online, and the whole application comprises a template file, a back-end service code and the like, so that the back-end service is unnecessarily online, the front-end and back-end communication cost is increased, the workload of back-end personnel is increased, and meanwhile, the problems of different authority and responsibility are caused. According to the invention, the template file is configured according to the page type in advance, then the target template file is searched according to the page type corresponding to the updating request, and dynamic analysis and loading are carried out, so that the purpose that the Velocity template is changed to take effect on line under the condition that the whole application is not on line can be realized, hot deployment is realized, and various problems caused by the fact that the whole application needs to be packaged to be on line are avoided.
In the actual application process, if the target template file corresponding to the page type does not exist, the original issuing mode of the application is used for updating, for example, the template file under the WEB-INF/directory is analyzed, so that the page is ensured to be normally displayed.
FIG. 3 is a schematic diagram of the main flow of a method of template hot-deployment according to an alternative embodiment of the present invention. The evaluate instruction in Velocity may implement dynamic resolution of attributes. In the embodiment shown in fig. 3, the method for template hot deployment uses evaluate instruction to parse the configured template file, and mainly includes the following steps:
step S301, judging whether a configuration switch is turned on or not; if yes, jumping to step S302; otherwise, jumping to step S311;
step S302, judging whether a template file cache in a gray state exists or not; if yes, jumping to step S307; otherwise, jumping to step S303;
step S303, inquiring a template file of a gray state from a database, and then jumping to step S304;
step S304, judging whether the data is empty, namely judging whether the database has the template file of the gray state; if the status is empty, jumping to step S305; otherwise, jumping to step S306;
s305, setting null data in a local cache, and then jumping to S309;
s306, loading the inquired template file in the gray state to a local cache, and then jumping to the S302;
step S307, judging whether the user exists in the gray level list or not; if yes, jumping to step S308; otherwise, jumping to step S309;
step S308, dynamically analyzing and loading the template file in the gray state, and then jumping to step S310;
s309, acquiring a template file in an online state, dynamically analyzing and loading the template file in the online state, and then jumping to the S310; the obtaining mode of the template file of the online state refers to the related description, and is not described herein again;
step S310, judging whether the deployment is successful; if yes, ending the process; otherwise, jumping to step S311;
step S311, an update operation is performed by using the original publishing manner, for example, a template file under the WEB-INF/directory is parsed, and the process is ended after the operation is completed.
In the embodiment, the template file is configured in advance according to the page type, the target template file is searched according to the page type corresponding to the updating request, and dynamic analysis and loading are carried out, so that the purpose that the Velocity template is changed and becomes effective on line under the condition that the whole application is not on line can be realized, hot deployment is realized, and various problems caused by the fact that the whole application needs to be packaged and is on line are avoided.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for implementing the above method.
Fig. 4 is a schematic diagram of main modules of a template hot-deployment apparatus according to an embodiment of the present invention, and as shown in fig. 4, the template hot-deployment apparatus 400 includes: a file configuration module 401 and a file parsing module 402; wherein the content of the first and second substances,
the file configuration module 401 is configured to configure a template file;
the file analysis module 402 receives an update request of a user, and analyzes a page type corresponding to the update request; inquiring whether a target template file corresponding to the page type exists or not; and if so, dynamically analyzing and loading the target template file.
Optionally, the state of each template file includes a gray state and an online state;
the file analysis module inquires whether a target template file corresponding to the page type exists or not, and the method comprises the following steps:
inquiring whether a template file of a gray state corresponding to the page type exists or not;
if the template file exists, taking the template file in the gray state as the target template file;
otherwise, inquiring whether a template file of an online state corresponding to the page type exists or not; if the template file exists, the template file in the online state is used as the target template file, otherwise, the target template file corresponding to the page type does not exist.
Optionally, the querying, by the file parsing module, whether a template file of a gray level state corresponding to the page type exists includes:
inquiring a template file of a gray state corresponding to the page type in a local cache; if the local cache does not exist, inquiring a template file in a gray state corresponding to the page type from a database; if the data base does not exist, judging that the template file of the gray state corresponding to the page type does not exist;
inquiring whether a template file of an online state corresponding to the page type exists or not, wherein the inquiring comprises the following steps:
inquiring a template file of an online state corresponding to the page type in a local cache; if the local cache does not exist, inquiring a template file in an online state corresponding to the page type from a database; and if the target template file does not exist in the database, judging that the target template file corresponding to the page type does not exist.
Optionally, the file parsing module is further configured to: before a template file of a gray state corresponding to the page type is inquired in a database, confirming that first empty data corresponding to the page type does not exist in a local buffer; if the template file exists, judging that the template file of the gray state corresponding to the page type does not exist; and after the template file of the gray state corresponding to the page type is inquired in the database, if the template file does not exist in the database, setting first empty data corresponding to the page type in a local buffer.
Optionally, the file parsing module is further configured to: before a template file of an online state corresponding to the page type is inquired in a database, confirming that second empty data corresponding to the page type does not exist in a local buffer; if the template file exists, judging that the template file of the online state corresponding to the page type does not exist; and after the template file of the online state corresponding to the page type is inquired in the database, if the template file does not exist in the database, second empty data corresponding to the page type is set in the local buffer.
Optionally, the file parsing module is further configured to: before the template file in the gray state is taken as the target template file, confirming that the user exists in a preset gray list; and if the user does not exist in the preset gray list, jumping to a step of inquiring whether a template file of an online state corresponding to the page type exists or not.
Optionally, the file configuration module is further configured to: and responding to a state change instruction, and changing the state of the template file from a gray state to an online state.
Optionally, the file configuration module is further configured to: and modifying the template file of the gray state in response to the template modification instruction.
According to a third aspect of embodiments of the present invention, there is provided a template hot-deployment electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method provided by the first aspect of the embodiments of the present invention.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method provided by the first aspect of embodiments of the present invention.
Fig. 5 illustrates an exemplary system architecture 500 of a template hot-deployment method or apparatus to which embodiments of the invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 501, 502, 503. The background management server can analyze and process the received data such as the update request and the like, and update the application in the terminal equipment.
It should be noted that the method for template hot deployment provided by the embodiment of the present invention is generally performed by the server 505, and accordingly, the apparatus for template hot deployment is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprising: the file configuration module is used for configuring a template file; the file analysis module receives an update request of a user and analyzes a page type corresponding to the update request; inquiring whether a target template file corresponding to the page type exists or not; and if so, dynamically analyzing and loading the target template file. The names of these modules do not in some cases form a limitation on the modules themselves, for example, the file configuration module may also be described as a "module that dynamically parses and loads the target template file".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: receiving an updating request of a user, and analyzing a page type corresponding to the updating request; inquiring whether a target template file corresponding to the page type exists or not; and if so, dynamically analyzing and loading the target template file.
According to the technical scheme of the embodiment of the invention, the method has the following advantages or beneficial effects: by configuring the template file according to the page type in advance, searching the target template file according to the page type corresponding to the updating request, dynamically analyzing and loading, the fact that the Velocity template is changed and takes effect on line under the condition that the whole application is not on line can be achieved, hot deployment is achieved, and various problems caused by the fact that the whole application needs to be packaged and is on line are avoided.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A method of template hot deployment, comprising:
receiving an updating request of a user, and analyzing a page type corresponding to the updating request;
inquiring whether a target template file corresponding to the page type exists or not;
and if so, dynamically analyzing and loading the target template file.
2. The method of claim 1, wherein the state of each template file includes a grayscale state and an on-line state; inquiring whether a target template file corresponding to the page type exists or not, wherein the inquiring includes:
inquiring whether a template file of a gray state corresponding to the page type exists or not;
if the template file exists, taking the template file in the gray state as the target template file;
otherwise, inquiring whether a template file of an online state corresponding to the page type exists or not; if the template file exists, the template file in the online state is used as the target template file, otherwise, the target template file corresponding to the page type does not exist.
3. The method of claim 2, wherein querying whether a template file of gray states corresponding to the page type exists comprises:
inquiring a template file of a gray state corresponding to the page type in a local cache; if the local cache does not exist, inquiring a template file of the gray state corresponding to the page type in a database; if the data base does not exist, judging that the template file of the gray state corresponding to the page type does not exist;
inquiring whether a template file of an online state corresponding to the page type exists or not, wherein the inquiring comprises the following steps:
inquiring a template file of an online state corresponding to the page type in a local cache; if the local cache does not exist, inquiring a template file of an online state corresponding to the page type in a database; and if the target template file does not exist in the database, judging that the target template file corresponding to the page type does not exist.
4. The method of claim 3, prior to querying a database for a template file of gray states corresponding to the page type, further comprising: confirming that first empty data corresponding to the page type does not exist in a local buffer; if the template file exists, judging that the template file of the gray state corresponding to the page type does not exist; after the template file of the gray state corresponding to the page type is inquired in a database, the method further comprises the following steps: and if the data base does not exist, setting first empty data corresponding to the page type in a local buffer.
5. The method of claim 3, wherein before querying a database for a template file of online status corresponding to the page type, further comprising: confirming that second empty data corresponding to the page type does not exist in a local buffer; if the template file exists, judging that the template file of the online state corresponding to the page type does not exist; after the template file of the online state corresponding to the page type is inquired in the database, the method further comprises the following steps: and if the data base does not exist, setting second empty data corresponding to the page type in the local buffer.
6. The method of claim 2, wherein before taking the template file of the gray state as the target template file, further comprising: confirming that the user exists in a preset gray level list; and if the user does not exist in the preset gray list, skipping to the step of inquiring whether the template file of the online state corresponding to the page type exists or not.
7. The method of claim 2, further comprising: and responding to a state change instruction, and changing the state of the template file from a gray state to an online state.
8. The method of claim 2, further comprising: and responding to the template modification instruction, and modifying the file content of the template file in the gray state.
9. An apparatus for template thermal deployment, comprising: the file configuration module and the file analysis module; wherein the content of the first and second substances,
the file configuration module is used for configuring a template file;
the file analysis module receives an update request of a user and analyzes a page type corresponding to the update request; inquiring whether a target template file corresponding to the page type exists or not; and if so, dynamically analyzing and loading the target template file.
10. A template hot-deploy electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
11. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN201911182828.2A 2019-11-27 2019-11-27 Method and device for hot deployment of templates Active CN112860268B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911182828.2A CN112860268B (en) 2019-11-27 2019-11-27 Method and device for hot deployment of templates

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911182828.2A CN112860268B (en) 2019-11-27 2019-11-27 Method and device for hot deployment of templates

Publications (2)

Publication Number Publication Date
CN112860268A true CN112860268A (en) 2021-05-28
CN112860268B CN112860268B (en) 2024-04-05

Family

ID=75985683

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911182828.2A Active CN112860268B (en) 2019-11-27 2019-11-27 Method and device for hot deployment of templates

Country Status (1)

Country Link
CN (1) CN112860268B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7117436B1 (en) * 2000-08-31 2006-10-03 Oracle Corporation Generating a Web page by replacing identifiers in a preconstructed Web page
CN105827733A (en) * 2016-05-12 2016-08-03 北京金山安全软件有限公司 Data pushing method and device and electronic equipment
CN106469076A (en) * 2015-08-20 2017-03-01 阿里巴巴集团控股有限公司 A kind of gray scale dissemination method and device
CN106528129A (en) * 2016-10-27 2017-03-22 南京南瑞继保电气有限公司 Web application interface generation system and method
CN107291940A (en) * 2017-07-07 2017-10-24 腾讯科技(深圳)有限公司 Content of pages management method, device and associated server
CN108008954A (en) * 2017-12-01 2018-05-08 深圳乐信软件技术有限公司 Page configuration method, apparatus, server and medium
CN108958796A (en) * 2017-05-23 2018-12-07 阿里巴巴集团控股有限公司 service request processing method and device, service request processing system
CN110275727A (en) * 2019-06-27 2019-09-24 江苏满运软件科技有限公司 Mobile terminal application program updating method, system, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7117436B1 (en) * 2000-08-31 2006-10-03 Oracle Corporation Generating a Web page by replacing identifiers in a preconstructed Web page
CN106469076A (en) * 2015-08-20 2017-03-01 阿里巴巴集团控股有限公司 A kind of gray scale dissemination method and device
CN105827733A (en) * 2016-05-12 2016-08-03 北京金山安全软件有限公司 Data pushing method and device and electronic equipment
CN106528129A (en) * 2016-10-27 2017-03-22 南京南瑞继保电气有限公司 Web application interface generation system and method
CN108958796A (en) * 2017-05-23 2018-12-07 阿里巴巴集团控股有限公司 service request processing method and device, service request processing system
CN107291940A (en) * 2017-07-07 2017-10-24 腾讯科技(深圳)有限公司 Content of pages management method, device and associated server
CN108008954A (en) * 2017-12-01 2018-05-08 深圳乐信软件技术有限公司 Page configuration method, apparatus, server and medium
CN110275727A (en) * 2019-06-27 2019-09-24 江苏满运软件科技有限公司 Mobile terminal application program updating method, system, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
姬一文;吴庆波;杨沙洲;: "一种服务器端模板引擎的改进与实现", 计算机应用研究, no. 03 *
张正风;: "一种网站门户系统的防篡改策略实现", 福建电脑, no. 09 *

Also Published As

Publication number Publication date
CN112860268B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
CN110019350B (en) Data query method and device based on configuration information
CN107844324B (en) Client page jump processing method and device
CN109766082B (en) Method and device for application program page jump
CN110262807B (en) Cluster creation progress log acquisition system, method and device
CN109683998A (en) Internationalize implementation method, device and system
CN110020329B (en) Method, device and system for generating webpage
CN108259533B (en) Data transmission method and device
CN111125107A (en) Data processing method, device, electronic equipment and medium
CN112579928A (en) Page jump method, page jump device, computer equipment and computer readable storage medium
CN110399459B (en) Online document searching method, device, terminal, server and storage medium
CN113761428A (en) Page rendering method, device and system, storage medium and electronic equipment
CN109902726B (en) Resume information processing method and device
CN111338944A (en) Remote Procedure Call (RPC) interface test method, device, medium and equipment
CN111107133A (en) Generation method of difference packet, data updating method, device and storage medium
CN111783005B (en) Method, device and system for displaying web page, computer system and medium
CN110647327B (en) Method and device for dynamic control of user interface based on card
CN113378346A (en) Method and device for model simulation
CN113452733A (en) File downloading method and device
CN112948138A (en) Method and device for processing message
CN112486482A (en) Page display method and device
CN111338928A (en) Chrome-based browser testing method and device
CN112860268B (en) Method and device for hot deployment of templates
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN112784195A (en) Page data publishing method and system
CN113407339A (en) Resource request feedback method and device, readable storage medium and electronic equipment

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
GR01 Patent grant
GR01 Patent grant