CN112860268B - Method and device for hot deployment of templates - Google Patents

Method and device for hot deployment of templates Download PDF

Info

Publication number
CN112860268B
CN112860268B CN201911182828.2A CN201911182828A CN112860268B CN 112860268 B CN112860268 B CN 112860268B CN 201911182828 A CN201911182828 A CN 201911182828A CN 112860268 B CN112860268 B CN 112860268B
Authority
CN
China
Prior art keywords
template file
page type
exist
file
inquiring
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.)
Active
Application number
CN201911182828.2A
Other languages
Chinese (zh)
Other versions
CN112860268A (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

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 method and a device for hot deployment of a template, and relates to the technical field of computers. One embodiment of the method comprises the following steps: receiving an update request of a user, and analyzing a page type corresponding to the update request; inquiring whether a target template file corresponding to the page type exists or not; and if the target template file exists, dynamically analyzing and loading the target template file. According to the embodiment, the change of the Velocity template can be enabled to take effect on line under the condition that the whole application is not on line, so that hot deployment is realized, and various problems caused by the fact that the whole application is required to be packaged for on line are avoided.

Description

Method and device for hot deployment of templates
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for hot deployment of templates.
Background
The vector is a Java-based template engine (template engine) that generates a standard HTML (HyperText Markup Language ) document. The vector template file is typically prefixed with. Vm, and typically, the file is deployed under the Web-INF/directory of the Web container. The entire application needs to be re-online every time the template is changed.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
when only the page style of the front end and the back end service code are changed in the iterative development, the existing template deployment scheme still needs to package the whole application to be on line, including template files, back end service codes and the like, so that the back end service is unnecessarily on line, the front end and back end communication cost is increased, the workload of back end personnel is increased, and meanwhile, the problem of different responsibilities is caused.
Disclosure of Invention
In view of this, the embodiments of the present invention provide a method and an apparatus for hot deployment of a template, which can enable a change of a mobility template to take effect online without online application, so as to implement hot deployment, and avoid various problems caused by the need to package the entire application to perform online.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method for hot deployment of a template, including:
receiving an update request of a user, and analyzing a page type corresponding to the update request;
inquiring whether a target template file corresponding to the page type exists or not;
and if the target template file exists, dynamically analyzing and loading the target template file.
Optionally, the state of each template file includes a gray state and an online state; querying whether a target template file corresponding to the page type exists or not comprises:
inquiring whether a template file of a gray state corresponding to the page type exists or not;
if the target template file exists, the template file in the gray state is used as the target template file;
otherwise, inquiring whether a template file of an online state corresponding to the page type exists; if so, taking the template file with the upper line as the target template file, otherwise, judging that the target template file corresponding to the page type does not exist.
Optionally, querying whether a template file of a gray 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 template file does not exist in the database, 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 comprises the following steps:
inquiring a template file of an online state corresponding to the page type in a local cache; if the page type does not exist in the local cache, inquiring a template file in an online state corresponding to the page type from a database; 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 the template file of the gray state corresponding to the page type in the database, the method further comprises: confirming that first null data corresponding to the page type does not exist in a local buffer; if so, judging that the template file of the gray state corresponding to the page type does not exist; after inquiring the template file of the gray state corresponding to the page type in the database, the method further comprises the following steps: and if the first empty data does not exist in the database, setting the first empty data corresponding to the page type in the local buffer.
Optionally, before querying the template file of the online state corresponding to the page type in the database, the method further includes: confirming that second null data corresponding to the page type does not exist in the local buffer; if so, judging that the template file of the online state corresponding to the page type does not exist; after inquiring the template file of the online state corresponding to the page type in the database, the method further comprises the following steps: and if the second empty data does not exist in the database, setting second empty data corresponding to the page type in the local buffer.
Optionally, before taking the template file in the gray state 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 level list, jumping to a step of inquiring whether a template file in an online state corresponding to the page type exists.
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 an embodiment of the present invention, there is provided an apparatus for hot deployment of a template, including: the file configuration module and the file analysis module; wherein,
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 the target template file exists, 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 queries whether a target template file corresponding to the page type exists or not, and comprises the following steps:
inquiring whether a template file of a gray state corresponding to the page type exists or not;
if the target template file exists, the template file in the gray state is used as the target template file;
otherwise, inquiring whether a template file of an online state corresponding to the page type exists; if so, taking the template file with the upper line as the target template file, otherwise, judging that the target template file corresponding to the page type does not exist.
Optionally, the file parsing module queries whether a template file with a gray state corresponding to the page type exists, including:
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 template file does not exist in the database, 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 comprises the following steps:
inquiring a template file of an online state corresponding to the page type in a local cache; if the page type does not exist in the local cache, inquiring a template file in an online state corresponding to the page type from a database; 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 inquiring a template file of a gray state corresponding to the page type in a database, confirming that first blank data corresponding to the page type does not exist in a local buffer; if so, judging that the template file of the gray state corresponding to the page type does not exist; after a template file of a gray state corresponding to the page type is queried in a 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 inquiring a template file of an online state corresponding to the page type in a database, confirming that second empty data corresponding to the page type does not exist in a local buffer; if so, 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 queried in the database, if the template file does not exist in the database, setting second empty data corresponding to the page type in the local buffer.
Optionally, the file parsing module is further configured to: before taking the template file in the gray state 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 level list, jumping to a step of inquiring whether a template file in an online state corresponding to the page type exists.
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 an embodiment of the present invention, there is provided an electronic device for template hot deployment, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors 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 having stored thereon a computer program 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 in advance according to the page type, searching the target template file according to the page type corresponding to the update request and carrying out dynamic analysis and loading, the change of the mobility template can be enabled to take effect on line under the condition that the whole application is not on line, the hot deployment is realized, and various problems caused by the fact that the whole application is required to be packaged for on line are avoided.
Further effects of the above-described non-conventional alternatives are 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 flow diagram of a method of template hot deployment according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a method of template thermal deployment in accordance with an embodiment of the present invention;
FIG. 3 is a schematic diagram of the main flow of a method of hot deployment of a template in an alternative embodiment of the invention;
FIG. 4 is a schematic diagram of the major modules of an apparatus for template hot deployment according to an embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 6 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered 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.
The hot deployment is to update software while the application is running, without restarting the application. In the invention, the configuration of the template file is realized firstly, and then the dynamic analysis is carried out on the content of the template file, so as to realize the hot deployment of the Velocity template.
According to one aspect of an embodiment of the present invention, a method of hot deployment of a template is provided.
Fig. 1 is a main flow diagram of a method for template hot deployment according to an embodiment of the present invention, as shown in fig. 1, the method for template hot deployment includes: step S101, step S102, and step S103.
Step S101, receiving an update request of a user, and analyzing a page type corresponding to the update request.
In the invention, each template file is configured in advance according to the page type. The page type dividing mode can be selectively set according to actual conditions, such as a first page, a channel page and the like.
The developer can pre-configure and store the template file to be released, and the state of the template file can be only one or can comprise gray scale, online, offline and other states. 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 is convenient for a publisher to randomly strain according to the publication condition. The template file in the online state only supports viewing, and any operation for changing the template file is not allowed, so that the stability of the online environment is ensured.
Alternatively, in order to facilitate the exact locking of the distribution object of the template file of the gradation state, a gradation list for indicating a list of users who can load the template file of the gradation state may be set for the template file of the gradation state. Illustratively, each user in the list of users may be identified by his PIN (Personal Identification Number ) or by the device IP (Internet Protocol, protocol of interconnection between networks) that he uses.
Step S102, inquiring whether a target template file corresponding to the page type exists.
Because the template files are configured according to the page types, when the template files are searched, the template files corresponding to the page types can be searched through updating the page types corresponding to the requests.
In order to realize gray level online, optionally, the state of each template file comprises gray level state and online state; querying whether a target template file corresponding to the page type exists or not comprises:
inquiring whether a template file of a gray state corresponding to the page type exists or not;
if the target template file exists, the template file in the gray state is used as the target template file;
otherwise, inquiring whether a template file of an online state corresponding to the page type exists; if so, taking the template file with the upper line as the target template file, otherwise, judging that the target template file corresponding to the page type does not exist.
In the embodiment, the template file in the gray state is preferentially adopted to load to realize gray release, so that the release quality of the Vecity template can be ensured.
Optionally, querying whether a template file of a gray 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 template file does not exist in the database, 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 comprises the following steps:
inquiring a template file of an online state corresponding to the page type in a local cache; if the page type does not exist in the local cache, inquiring a template file in an online state corresponding to the page type from a database; 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 a method of thermal deployment of a module in this example. In general, the page access frequency is higher, and in the embodiment, the template release is performed by matching with the local cache, so that the file reading efficiency can be improved.
Optionally, before querying the template file of the gray state corresponding to the page type in the database, the method further comprises: confirming that first null data corresponding to the page type does not exist in a local buffer; if so, judging that the template file of the gray state corresponding to the page type does not exist; after inquiring the template file of the gray state corresponding to the page type in the database, the method further comprises the following steps: and if the first empty data does not exist in the database, setting the first empty data corresponding to the page type in the local buffer.
By setting the empty data, cache penetration can be avoided, and thus overload of database services caused by excessive requests to query the database under high concurrency can be avoided.
Optionally, before querying the template file of the online state corresponding to the page type in the database, the method further includes: confirming that second null data corresponding to the page type does not exist in the local buffer; if so, judging that the template file of the online state corresponding to the page type does not exist; after inquiring the template file of the online state corresponding to the page type in the database, the method further comprises the following steps: and if the second empty data does not exist in the database, setting second empty data corresponding to the page type in the local buffer.
By setting the empty data, cache penetration can be avoided, and thus overload of database services caused by excessive requests to query the database under high concurrency can be avoided.
Optionally, before taking the template file in the gray state 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 level list, jumping to a step of inquiring whether a template file in an online state corresponding to the page type exists.
In this example, a gray list is set for the template file in the gray state, and the gray list is used for indicating a user list capable of loading the template file in the gray state. By setting the gray list, the release object of the template file in the gray state can be accurately locked.
And step S103, if the target template file exists, carrying out dynamic analysis and loading on the target template file.
In general, the content of the target template file can be dynamically analyzed by using an evaluation instruction in the vector to finish loading the target template file. The page is dynamically rendered and then returned to the user.
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 publishing condition of the template file in the gray state is obtained, and when the publishing effect meets the online requirement, the state of the template file can be changed from the gray state to the online state, so that the formal online of the template file is realized.
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 part of problems are found in the release process and the template needs to be modified, modifying the file content of the template file until the requirement is met.
In the prior art, the vector template file is usually deployed under the WEB-INF/directory of the Web container, and the whole application needs to be re-online every time the template is changed. When only the page style of the front end and the back end service code are changed in the iterative development, the existing template deployment scheme still needs to package the whole application to be on line, including template files, back end service codes and the like, so that the back end service is unnecessarily on line, the front end and back end communication cost is increased, the workload of back end personnel is increased, and meanwhile, the problem of different responsibilities is caused. According to the method and the device, the template file is configured in advance according to the page type, then the target template file is searched according to the page type corresponding to the update request, and the target template file is analyzed and loaded dynamically, so that the change of the Velocity template can be enabled to be effective on line under the condition that the whole application is not on line, the heat deployment is realized, and various problems caused by the fact that the whole application is required to be packaged for on line are avoided.
In the actual application process, if the target template file corresponding to the page type does not exist, the original release mode of the application is used for updating operation, for example, the template file under the WEB-INF/directory is analyzed to ensure that the page is normally displayed.
FIG. 3 is a schematic diagram of the main flow of a method of template hot deployment of an alternative embodiment of the present invention. The evaluation instruction in the vector may implement dynamic resolution of attributes. In the embodiment shown in fig. 3, the method for hot deployment of a template uses an evaluation instruction to parse a configured template file, and mainly includes the following steps:
step S301, judging whether a configuration switch is turned on; if yes, jump to step S302; otherwise, jump to step S311;
step S302, judging whether a template file cache in a gray state exists or not; if yes, go to step S307; otherwise, jump to step S303;
step S303, inquiring a template file of the gray state from a database, and then jumping to step S304;
step S304, judging whether the data is empty, namely judging whether a database has a template file in the gray state; if the signal is empty, the process goes to step S305; otherwise, jump to step S306;
step S305, setting blank data in the local cache, and then jumping to step S309;
step S306, loading the template file of the queried gray state to a local cache, and then jumping to step S302;
step S307, judging whether the user exists in the gray list; if yes, go to step S308; otherwise, jump to step S309;
step S308, dynamically analyzing and loading the template file in the gray state, and then jumping to step S310;
step S309, obtaining a template file in an online state, then dynamically analyzing and loading the template file in the online state, and then jumping to step S310; the method for obtaining the template file in the online state is referred to the related description, and is not repeated here;
step S310, judging whether deployment is successful; if yes, ending the flow; otherwise, jump to step S311;
step S311, performing an update operation by using the original publishing mode of the application, for example, analyzing the WEB-INF/directory lower template file, and ending the flow after the operation is completed.
According to the method, the device and the system, the target template file is searched in advance according to the page type configuration template file and the page type corresponding to the update request, and the target template file is dynamically analyzed and loaded, so that the change of the vehicle template can be enabled to be effective on line under the condition that the whole application is not on line, hot deployment is realized, and various problems caused by the fact that the whole application is required to be packaged for on line are avoided.
According to a second aspect of an embodiment of the present invention, there is provided an apparatus for implementing the above method.
Fig. 4 is a schematic diagram of main modules of an apparatus for template hot deployment according to an embodiment of the present invention, and as shown in fig. 4, an apparatus 400 for template hot deployment includes: a file configuration module 401 and a file parsing module 402; wherein,
the file configuration module 401 is configured to configure a template file;
the file parsing module 402 receives an update request from a user and parses a page type corresponding to the update request; inquiring whether a target template file corresponding to the page type exists or not; and if the target template file exists, 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 queries whether a target template file corresponding to the page type exists or not, and comprises the following steps:
inquiring whether a template file of a gray state corresponding to the page type exists or not;
if the target template file exists, the template file in the gray state is used as the target template file;
otherwise, inquiring whether a template file of an online state corresponding to the page type exists; if so, taking the template file with the upper line as the target template file, otherwise, judging that the target template file corresponding to the page type does not exist.
Optionally, the file parsing module queries whether a template file with a gray state corresponding to the page type exists, including:
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 template file does not exist in the database, 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 comprises the following steps:
inquiring a template file of an online state corresponding to the page type in a local cache; if the page type does not exist in the local cache, inquiring a template file in an online state corresponding to the page type from a database; 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 inquiring a template file of a gray state corresponding to the page type in a database, confirming that first blank data corresponding to the page type does not exist in a local buffer; if so, judging that the template file of the gray state corresponding to the page type does not exist; after a template file of a gray state corresponding to the page type is queried in a 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 inquiring a template file of an online state corresponding to the page type in a database, confirming that second empty data corresponding to the page type does not exist in a local buffer; if so, 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 queried in the database, if the template file does not exist in the database, setting second empty data corresponding to the page type in the local buffer.
Optionally, the file parsing module is further configured to: before taking the template file in the gray state 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 level list, jumping to a step of inquiring whether a template file in an online state corresponding to the page type exists.
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 an embodiment of the present invention, there is provided an electronic device for template hot deployment, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors 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 having stored thereon a computer program 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 method of template hot deployment or apparatus of template hot deployment to which embodiments of the present 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 is used as a medium to provide communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 505 via the network 504 using the terminal devices 501, 502, 503 to receive or send messages or the like. Various communication client applications may be installed on the terminal devices 501, 502, 503, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using the terminal devices 501, 502, 503. The background management server may analyze and process the received data such as the update request, and update the application in the terminal device.
It should be noted that, the method for hot deployment of a template provided in the embodiment of the present invention is generally executed by the server 505, and accordingly, the device for hot deployment of a template 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, there is illustrated a schematic diagram of a computer system 600 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 6 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601, which 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 required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through 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, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; 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 drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
In particular, according to embodiments of the present disclosure, the processes described above with reference to 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 shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 601.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 context of this document, 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, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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 flowcharts 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 involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, 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 the target template file exists, dynamically analyzing and loading the target template file. The names of these modules do not in some cases limit the module itself, for example, a 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 present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: receiving an update request of a user, and analyzing a page type corresponding to the update request; inquiring whether a target template file corresponding to the page type exists or not; and if the target template file exists, dynamically analyzing and loading the target template file.
According to the technical scheme provided by the embodiment of the invention, the method has the following advantages or beneficial effects: by configuring the template file in advance according to the page type, searching the target template file according to the page type corresponding to the update request and carrying out dynamic analysis and loading, the change of the mobility template can be enabled to take effect on line under the condition that the whole application is not on line, the hot deployment is realized, and various problems caused by the fact that the whole application is required to be packaged for on line are avoided.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (8)

1. A method of hot deployment of a template, comprising:
receiving an update request of a user, and analyzing a page type corresponding to the update request;
inquiring whether a target template file corresponding to the page type exists or not;
if the target template file exists, dynamically analyzing and loading the target template file;
the state of each template file comprises a gray state and an up state; querying whether a target template file corresponding to the page type exists or not comprises: inquiring whether a template file of a gray state corresponding to the page type exists or not; if the target template file exists, the template file in the gray state is used as the target template file; otherwise, inquiring whether a template file in an online state corresponding to the page type exists, if so, taking the template file in the online state as the target template file, otherwise, judging that the target template file corresponding to the page type does not exist;
querying whether a template file of gray state corresponding to the page type exists or not includes: inquiring a template file of a gray state corresponding to the page type in a local cache; if the page type does not exist in the local cache, inquiring a template file of the gray state corresponding to the page type in a database; if the template file does not exist in the database, 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 comprises the following steps: inquiring a template file of an online state corresponding to the page type in a local cache; if the page type does not exist in the local cache, inquiring a template file of an online state corresponding to the page type in a database; 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;
before inquiring the template file of the gray state corresponding to the page type in the database, the method further comprises the following steps: confirming that first null data corresponding to the page type does not exist in a local buffer; if so, judging that the template file of the gray state corresponding to the page type does not exist; after inquiring the template file of the gray state corresponding to the page type in the database, the method further comprises the following steps: and if the first empty data does not exist in the database, setting the first empty data corresponding to the page type in the local buffer.
2. The method of claim 1, further comprising, prior to querying a database for a template file of an online status corresponding to the page type: confirming that second null data corresponding to the page type does not exist in the local buffer; if so, judging that the template file of the online state corresponding to the page type does not exist; after inquiring the template file of the online state corresponding to the page type in the database, the method further comprises the following steps: and if the second empty data does not exist in the database, setting second empty data corresponding to the page type in the local buffer.
3. The method of claim 1, further comprising, prior to taking the gray state template file as the target template file: confirming that the user exists in a preset gray level list; if the user does not exist in the preset gray level list, jumping to a step of inquiring whether a template file in an online state corresponding to the page type exists.
4. The method as recited in claim 1, 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.
5. The method as recited in claim 1, further comprising: and responding to the template modification instruction, and modifying the file content of the template file in the gray state.
6. An apparatus for hot deployment of a template, comprising: the file configuration module and the file analysis module; wherein,
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; if the target template file exists, dynamically analyzing and loading the target template file;
the state of each template file comprises a gray state and an up state; the file analysis module queries whether a target template file corresponding to the page type exists or not, and comprises the following steps: inquiring whether a template file of a gray state corresponding to the page type exists or not; if the target template file exists, the template file in the gray state is used as the target template file; otherwise, inquiring whether a template file in an online state corresponding to the page type exists, if so, taking the template file in the online state as the target template file, otherwise, judging that the target template file corresponding to the page type does not exist;
the file analysis module queries whether a template file with a gray state corresponding to the page type exists or not, and comprises the following steps: inquiring a template file of a gray state corresponding to the page type in a local cache; if the page type does not exist in the local cache, inquiring a template file of the gray state corresponding to the page type in a database; if the template file does not exist in the database, judging that the template file of the gray state corresponding to the page type does not exist;
the file analysis module queries whether a template file of an online state corresponding to the page type exists or not, and comprises the following steps: inquiring a template file of an online state corresponding to the page type in a local cache; if the page type does not exist in the local cache, inquiring a template file of an online state corresponding to the page type in a database; 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;
the file parsing module is further configured to: before inquiring a template file of a gray state corresponding to the page type in a database, confirming that first blank data corresponding to the page type does not exist in a local buffer; if so, judging that the template file of the gray state corresponding to the page type does not exist; after inquiring the template file of the gray state corresponding to the page type in the database, the method further comprises the following steps: and if the first empty data does not exist in the database, setting the first empty data corresponding to the page type in the local buffer.
7. A template-hot-deployed electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-5.
8. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-5.
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 CN112860268A (en) 2021-05-28
CN112860268B true 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
一种服务器端模板引擎的改进与实现;姬一文;吴庆波;杨沙洲;;计算机应用研究(03);全文 *
一种网站门户系统的防篡改策略实现;张正风;;福建电脑(09);全文 *

Also Published As

Publication number Publication date
CN112860268A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN107844324B (en) Client page jump processing method and device
US20170109371A1 (en) Method and Apparatus for Processing File in a Distributed System
CN109194714B (en) File pushing method and device, terminal device and storage medium
US20140095579A1 (en) System and method for increasing web site serving performance
CN111125107A (en) Data processing method, device, electronic equipment and medium
CN110874227A (en) Shunting method and system for realizing gray scale release of API gateway and electronic equipment
CN112579928A (en) Page jump method, page jump device, computer equipment and computer readable storage medium
CN110795649A (en) Target page display method, device and system and electronic equipment
CN107809470B (en) Method and device for automatically deploying application program
CN107347093B (en) Configuration method and device for distributed server system
CN110399459B (en) Online document searching method, device, terminal, server and storage medium
CN107918617B (en) Data query method and device
CN109992719B (en) Method and apparatus for determining push priority information
CN111338944A (en) Remote Procedure Call (RPC) interface test method, device, medium and equipment
CN107330087B (en) Page file generation method and device
CN110647327B (en) Method and device for dynamic control of user interface based on card
CN111783005A (en) Method, apparatus and system for displaying web page, computer system and medium
CN112860268B (en) Method and device for hot deployment of templates
CN111338928A (en) Chrome-based browser testing method and device
CN107656985B (en) Webpage query method and system
CN112784187A (en) Page display method and device
CN110858240A (en) Front-end module loading method and device
CN112784195A (en) Page data publishing method and system
US8527580B2 (en) Saving multiple data items using partial-order planning
CN112311843A (en) Data loading method and device

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