WO2016066048A1 - Method, apparatus and system for updating web application - Google Patents
Method, apparatus and system for updating web application Download PDFInfo
- Publication number
- WO2016066048A1 WO2016066048A1 PCT/CN2015/092516 CN2015092516W WO2016066048A1 WO 2016066048 A1 WO2016066048 A1 WO 2016066048A1 CN 2015092516 W CN2015092516 W CN 2015092516W WO 2016066048 A1 WO2016066048 A1 WO 2016066048A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- resource
- update file
- resource update
- file
- layer
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Definitions
- the present application relates to the field of network technologies, and in particular, to a method for updating a web application, an update device for a web application, and an update system for a web application.
- Web applications are more and more widely used as the basis for the implementation of dynamic websites.
- Web applications can be Java (an object-oriented programming language), PHP (Hypertext Preprocessor, hypertext pre-preparation). Processing languages), Python (an object-oriented, literal translation computer programming language) and many other language implementations, providing web services such as web browsing for browser-based client users.
- the layering generally includes a view layer, which can be an interface that the user sees and interacts with.
- a view layer which can be an interface that the user sees and interacts with.
- the Internet industry often adjusts the displayed content, changes user interaction, copywriting, etc. to enhance the user experience or release new functions.
- the cluster release process requires very complicated operations such as stopping traffic, redeploying, and enabling traffic.
- the technical problem to be solved by the embodiments of the present application is to provide a method for updating a web application, which is used to reduce the release process, reduce the consumption of network resources, reduce risks, and improve stability.
- the embodiment of the present application further provides an update device for a web application, which is used to ensure implementation and application of the foregoing method.
- the present application discloses a method for updating a web application, including:
- the presentation layer has a resource file, the resource file has a load time, and the resource update file has a modification time;
- the presentation layer is used to load an interaction interface in a web application
- the display layer includes at least one of the following resource files:
- Web documents template files, images, cascading style sheets, script objects.
- the resource update file is an incremental file that is updated for resource files in the presentation layer.
- the step of receiving a resource update file for a separate presentation layer in the web application comprises:
- the resource update file for the independent presentation layer in the web application is stored in the corresponding directory
- the modification time is configured for the resource update file.
- the step of loading the resource update file in the display layer comprises:
- the template update engine loads the resource update file in the directory.
- the web application further includes an application layer, the presentation layer and the application layer are independent of each other, and the presentation layer runs in the same web container as the application layer.
- the embodiment of the present application further discloses an update device for a web application, including:
- a resource update file receiving module configured to receive a resource update file for an independent presentation layer in the web application;
- the display layer has a resource file, the resource file has a loading time, and the resource update file has a modification time;
- a time judging module configured to determine whether the modification time is greater than or equal to a previous loading time; if yes, calling a resource update file loading module;
- a resource update file loading module configured to load the resource update file in the presentation layer.
- the presentation layer is used to load an interaction interface in a web application
- the display layer includes at least one of the following resource files:
- Web documents template files, images, cascading style sheets, script objects.
- the resource update file receiving module includes:
- a storage submodule configured to store a resource update file for a separate presentation layer in the web application into a corresponding directory
- the configuration submodule is configured to configure a modification time for the resource update file.
- the resource update file loading module includes:
- a sub-module configured to start a template engine corresponding to the display layer
- the embodiment of the present application further discloses an update system for a web application, where the system includes a publishing platform and one or more servers;
- the publishing platform includes:
- a resource update file publishing module configured to issue a resource update file for an independent presentation layer in the web application
- the server includes:
- a resource update file receiving module configured to receive a resource update file for an independent presentation layer in the web application;
- the display layer has a resource file, the resource file has a loading time, and the resource update file has a modification time;
- a time judging module configured to determine whether the modification time is greater than or equal to a previous loading time; if yes, calling a resource update file loading module;
- a resource update file loading module configured to load the resource update file in the presentation layer.
- the presentation layer is used to load an interaction interface in a web application
- the display layer includes at least one of the following resource files:
- Web documents template files, images, cascading style sheets, script objects.
- the resource update file receiving module includes:
- a storage submodule configured to store a resource update file for a separate presentation layer in the web application into a corresponding directory
- the configuration submodule is configured to configure a modification time for the resource update file.
- the resource update file loading module includes:
- a sub-module configured to start a template engine corresponding to the display layer
- the embodiments of the present application include the following advantages:
- the display layer is independently managed, and when the display layer is updated, the display layer can be directly modified, and the resource update file is released, and the update of the back-end code can be avoided, and the code is not merged, compiled, and packaged.
- Such complex traditional publishing process greatly reduces the release process and speeds up the release time. At the same time, it reduces the risk of updating, improves the stability of the display layer, and greatly improves the update efficiency.
- the embodiment of the present application updates the display layer by means of hot loading, and does not need to restart the web container.
- a complicated publishing process such as stopping traffic, restarting the web container, and opening the traffic is not required, thereby greatly improving the simplicity of operation and further improving. Updated efficiency.
- the embodiment of the present application issues an incremental file, and does not need to issue a full amount of the distribution package, which greatly reduces the network resource consumption in the publishing process.
- Figure 1 is a conventional code merge is an example diagram
- FIG. 2 is a diagram showing an example of a release of a conventional distribution package
- FIG. 3 is a flow chart of steps of an embodiment of an update method of a web application according to the present application.
- FIG. 4 is a diagram showing an example of publishing a resource update package of the present application.
- FIG. 5 is a structural block diagram of an embodiment of an apparatus for updating a web application according to the present application.
- FIG. 6 is a structural block diagram of an embodiment of an update system for a web application according to the present application.
- MVC Model View Controller
- Controller controls the separation using a business logic, data, and interface.
- the method organizes the code so that a web application can be divided into three layers - the model layer, the view layer, and the control layer.
- View represents the user interface.
- HTML Hypertext Markup Language
- XHTML The Extensible Hyper Text Markup Language
- XML Extensible Markup Language
- Applet application
- a web application may have many different views.
- the processing of the view by the MVC design pattern is limited to the collection and processing of data on the view, as well as the user's request, and does not include the processing of the business process on the view.
- the processing of the business process is handed over to the Model process. For example, a view of an order only accepts data from the model and displays it to the user, as well as passing input data and requests from the user interface to the control and model.
- Model It is the processing of business processes/states and the formulation of business rules.
- the processing of the business process is a black box operation for other layers, the model accepts the data requested by the view, and returns the final processing result.
- the design of the business model can be said to be the main core of MVC.
- Another important model of the business model is the data model.
- the data model mainly refers to the data preservation (persistence) of the entity object. For example, save an order to the database, get the order from the database, and can list the model separately, all operations related to the database are limited to the model.
- the controller can be understood as receiving a user request, matching the model with the view, and jointly completing the user's request.
- the role of the division control layer is also obvious, clearly indicating that it is a distributor, what kind of model to choose, what kind of view to choose, what kind of user request can be completed.
- the control layer does not do any data processing. For example, when a user clicks on a connection, the control layer does not process the business information after accepting the request. It passes the user's information to the model, tells the model what to do, and selects the view that meets the requirements to return to the user. Therefore, one model may correspond to multiple views, and one view may correspond to multiple models.
- MVC aggregates business logic into a single component, eliminating the need to rewrite business logic while improving and personalizing the interface and user interaction.
- MVC has been uniquely developed to map traditional input, processing and output functions in the structure of a logical graphical user interface.
- MVC tiering also simplifies group development, allowing different developers to develop views, controller logic, and business logic at the same time.
- the developer applies for the branch of the code version management tool (such as subversion, SVN) trunk, modifies the code, and passes the development test process to ensure that the function is correct.
- the code version management tool such as subversion, SVN
- the trunk can be a relatively stable version of the code
- the branch can be a means of isolating the project.
- Multiple points can be developed in parallel, and the code is eventually merged into the backbone.
- version management tools such as SVN can include trunks, branches, and tags.
- the usage can be as follows:
- Trunk Can be used for the development of the main direction of the web application. For the development of a new module, you can use trunk. When the module is developed, you need to modify it. You can use branch.
- Branch can be used for parallel development, where parallelism refers to comparison with trunk.
- Tag is used to make a mark, whether it is a release version, but it is a usable version.
- the 3.0 version of a web application is developed. At this time, you can make a tag, tag_release_3_0, and then publish based on this tag, such as the installer. Trunk into the 3.1 version of the development, but the 3.0 version found a bug, then you need to do a branch based on tag_release_3_0, branch_bugfix_3_0, based on this branch to modify the vulnerability, wait until the vulnerability is modified, make a tag, tag_release_3_0_1, and then, depending on the need to decide branch_bugfix_3_0 Whether to merge into the trunk.
- branch 1 when the project development test in branch 1 is completed, after reaching a stable state, branch 1 is merged into the trunk;
- the backbone performs integration testing, confirming that a copy of the code from the trunk to the tag is released after the normal release, so the latest branch under the tag is the online stable version of the web application;
- the project can be branched from a stable version of the tag, such as branch 2, for development.
- branch 2 is merged into the trunk.
- the compiled file, configuration file, and view code are grouped into a release package to be released.
- the release package generally includes an ear package (ie, App.ear) and Htdocs (host documents).
- the ear package is the code of the model layer and the control layer, including files such as Java and XML.
- Htdocs is a folder name, mainly used to put the view layer files, including HTML, vm (template files) and other files.
- the distribution platform publishes the released distribution package to each server in the cluster.
- each server such as jetty, jboss, etc.
- all resource files are reloaded, and the modified code is posted online, and applied to the web applications of each server, such as Web application 1, Web application 2 ...web application n.
- each update requires a full release of the web application (ear package and Htdocs), and the publishing process occupies a large amount of network resources.
- the cluster release process needs to stop traffic, redeploy, and open traffic with very complicated operations. Since this process does not distinguish whether the business logic is modified or not, the business logic of modifying the Java code is very risky. Each time the redeployment loads all the resource files, including the view layer files and the Java files, the risk of each release is uncontrollable. Stability also has potential risks.
- one of the core concepts of the embodiments of the present application is creatively proposed, and a new layered publishing idea is proposed, and the back-end code and the presentation layer code are separately released. Since the presentation layer code is light and thin, the changes are frequent, and the online can be released at any time.
- FIG. 3 a flow chart of steps of an embodiment of an update method of a web application according to the present application is shown, which may specifically include the following steps:
- Step 301 Receive a resource update file for an independent presentation layer in the web application.
- the web application can be layered based on the layered design idea.
- the layered design is a common architectural idea in the program development. Since the program code is frequently changed, the layering of the code can simplify the decomposition of the complex problem. Each layer is responsible for its own implementation, and provides a good interface between the service layer and the layer. When changing, only need to care about the changes of one layer, you can not care about other layers.
- a web application may be divided into at least two layers, where one layer may be a display layer and another layer may be an application layer.
- the presentation layer can be used to load the interactive interface in the web application, ie the interface that the user sees and interacts with.
- a web application may have many different presentation layers.
- the presentation layer in the embodiment of the present application may be used for collecting and processing data on a view, and processing a user's request, but may not include processing of a business process on the presentation layer. The processing of the business process is handed over to the application layer for processing.
- the Internet industry often adjusts the presentation layer content, changes user interactions, copywriting, etc. to enhance the user experience or release new functions. Due to the fast industry characteristics of Internet products, there is a very urgent need for the release cycle.
- the display layer may include at least one of the following resource files:
- Web document HTML Web document HTML, template file vm, image, cascading style sheet CSS (Cascading Style Sheet), script object JS (JavaScript, scripting language) and so on.
- the web page document HTML can mark various parts in the web page to be displayed by using a mark symbol.
- the web page file itself is a text file. By adding a tag to the text file, you can tell the client (such as a browser) how to display the content (such as how to handle the text, how the screen is arranged, how the image is displayed, etc.).
- the template file vm can be a template for developing web applications.
- the cascading style sheet CSS can perform pixel-level precise control on the position layout of objects in the webpage, supports almost all font size styles, has the ability to edit webpage objects and model styles, and can perform preliminary interaction design.
- the script object JS can be used on an HTML web page to add dynamic functionality to the HTML web page, for example in response to various user actions.
- the source code does not need to be compiled before being sent to the client (such as a browser). Instead, the text code is sent to the client (such as a browser) and interpreted by the client (such as a browser).
- the resource file can be loaded to display the loading time of the interface.
- the resource file can have a loading time (that is, a time when the resource file is loaded).
- the application layer can be a collection of code in the web application other than the presentation layer, that is, the back-end code in the web application.
- the application layer can be further divided into a model layer and a control layer.
- the model layer can be used for the processing of business processes/states and the formulation of business rules.
- the layer requests the data and returns the final processing result.
- the model may include one or more data models, which mainly refer to data preservation (persistence) of the entity objects.
- the control layer can receive the request and match the model layer with the presentation layer to complete the request.
- the control layer clarifies that it is a distributor, what data model to choose, what display layer to choose, and what kind of user request can be completed.
- the application layer may be further divided into other layers, which is not limited by the embodiment of the present application.
- the presentation layer may be independent of the application layer.
- the version management tool (such as SVN) can be used for independent development.
- the display layer and the application layer can each have an independent trunk.
- the display layer and the application layer are managed in isolation.
- the display layer is relatively thin and light, and can be responsible for simple display logic processing, and the speed is faster; the application layer needs to deal with enterprise-level development, the structure is complex, involving many external resources, transaction-intensive, large amount of data, large number of users, and strong security. Sexual considerations.
- the presentation layer and the application layer can run in the same web container.
- the web container can be a service program, which can be implemented by a web server, and provides a running environment for the web server (such as a JSP server, a servlet server, etc.), so that the web server directly interacts with the environment variable interface in the container, without paying attention to other systems. problem.
- a service program which can be implemented by a web server, and provides a running environment for the web server (such as a JSP server, a servlet server, etc.), so that the web server directly interacts with the environment variable interface in the container, without paying attention to other systems. problem.
- the web container can be IIS or PWS including Tomcat in Java, ASP (Active Server Page), and so on.
- Traditional view layers typically include partial code for the presentation and application layers. Take the java language as an example, the view layer will have a part of the view processing java code, if this part of the code has to be changed, it is necessary to compile and restart to take effect.
- the configuration management strategy of the presentation layer can be trunk development and trunk release.
- Htdocs An update file that can have a modification time to identify when the resource update file was modified.
- the resource update file may be an incremental file that is updated for the resource file in the display layer, and may specifically include at least one of the following resource files:
- cascading style sheet CSS CSS
- script object JS JavaScript, scripting language
- the display layer is independently managed, and when the display layer is updated, the display layer can be directly modified, and the resource update file is released, and the update of the back-end code can be avoided, and the code is not merged, compiled, and packaged.
- Such complex traditional publishing process greatly reduces the release process and speeds up the release time. At the same time, it reduces the risk of updating, improves the stability of the display layer, and greatly improves the update efficiency.
- the embodiment of the present application issues an incremental file, and does not need to issue a full amount of distribution packages (ear packets and Htdocs), which greatly reduces the network resource consumption in the publishing process.
- the developer can distribute the resource update file to one or more servers through the publishing platform to perform the update of the web application display layer installed in the server.
- the one or more servers may be cluster servers based on a distributed architecture, and the publishing platform may distribute the resource update files to one or more servers through a distributed version control system (eg, Git).
- Git distributed version control system
- step 302 may include the following sub-steps:
- Sub-step S11 storing the resource update file for the independent display layer in the web application into the corresponding directory
- the presentation layer may divide each module according to functions according to the convention, and the resource files in each module are stored in respective corresponding directories.
- the directory structure of its resource files can be as follows Show:
- the display layer can be divided into three modules in a template file according to functions, namely user (user module), trade (transaction module), and consumeure (transaction record module), and each module has its own corresponding directory.
- user user module
- trade transaction module
- consumeure transaction record module
- each module has its own corresponding directory.
- user user module
- trade transaction module
- consumeure transaction record module
- each module has its own corresponding directory.
- user user module
- trade can be used to load transaction-related interfaces, such as payment, etc.
- consumerecord The transaction record module
- the transaction record module can be used to load the interface of the transaction record.
- the server receives the resource update file of the presentation layer, the resource update file needs to be stored in the specified directory, and the original resource file is replaced, so as to perform normal loading and update the display layer.
- Sub-step S12 configuring a modification time for the resource update file.
- the resource update file generally has a modification time to indicate that the resource update file is last modified. Change the time.
- the modification time may be a time when the server receives the resource update file.
- Step 302 it is determined whether the modification time is greater than or equal to the last load time; if yes, step 303 is performed;
- the last load time (ie, the last load time) of each resource file can be stored in the memory of the server.
- the embodiment of the present application may modify the framework of the web application, so that the server may scan the resource file periodically or irregularly. If the modification time is greater than or equal to the previous loading time, the version of the resource update file may be considered to be the version of the resource file. To be new, you need to update the resource file.
- the modification time and the loading time can be converted into seconds to compare the sizes.
- the modification time is 17:35 on September 29, 2014
- the loading time is 23:42 on September 28, 2014. This time information is larger than the load time.
- Step 303 Load the resource update file in the display layer.
- the resource files are loaded at runtime and placed in memory, they must be reloaded when these resource files are changed.
- the modification time of the resource update file is greater than or equal to the loading time of the last resource file, the resource update file is loaded, and hot loading is implemented.
- step 303 can include the following sub-steps:
- Sub-step S21 starting a template engine corresponding to the display layer
- the presentation layer can be compiled in a fixed template language, and there are many template languages, such as Velocity, JSP (JavaServer Pages), FreeMaker, and so on.
- Velocity's template engine can start with Velocity.init() or create a new VelocityEngine class, call the init method in the RuntimeInstance class, and initialize the template engine with the template engine properties set.
- Sub-step S22 using the template engine to load a resource update file in the directory.
- the template resource attribute resourceLoaderPath can be configured in the application to tell the template engine which directory to search for the template file and resource update file of the display layer, such as Config.xml, css.vm, js.vm files.
- the web application loads the resource update file distributed to the server, and the modified presentation layer is released online.
- the embodiment of the present application updates the display layer by means of hot loading, and does not need to restart the web container.
- a complicated publishing process such as stopping traffic, restarting the web container, and opening the traffic is not required, thereby greatly improving the simplicity of operation and further improving. Updated efficiency.
- the developer needs to modify the independent display layer in the web application, and needs to add a copy reminder in the payment tool interface of an e-commerce website: “recharge the red envelope”.
- the technician can add the copy reminder and provide the code in the web application's resource file i.vm.
- a resource update file (Htdocs, ie i.vm) is generated.
- the technician finds the release list in the publishing platform and determines that only i.vm in a certain directory needs to be released.
- the distribution platform distributes resource update files (Htdocs, ie, i.vm) to each server through Git, and includes independent applications in web applications (such as Web application 1, Web application 2, ... Web application n) in each server.
- the layer (App.ear) and the display layer (Htdocs) load the resource update file (Htdocs, i.vm) in the display layer by hot loading, so that the modified presentation layer is released online.
- FIG. 5 a structural block diagram of an embodiment of an update apparatus for a web application according to the present application is shown. Specifically, the following modules may be included:
- the resource update file receiving module 501 is configured to receive a resource update file for an independent display layer in the web application; the display layer has a resource file, the resource file has a load time, and the resource update file has a modification time;
- the time judging module 502 is configured to determine whether the modification time is greater than or equal to the last loading time; if yes, the resource update file loading module 503 is invoked;
- the resource update file loading module 503 is configured to load the resource update file in the display layer.
- the presentation layer can be used to load an interaction interface in a web application
- the display layer includes at least one of the following resource files:
- Web documents template files, images, cascading style sheets, script objects.
- the resource update file is an incremental file that is updated for resource files in the presentation layer.
- the resource update file receiving module 501 may include the following sub-modules:
- a storage submodule configured to store a resource update file for a separate presentation layer in the web application into a corresponding directory
- the configuration submodule is configured to configure a modification time for the resource update file.
- the resource update file loading module 503 may include the following sub-modules:
- a sub-module configured to start a template engine corresponding to the display layer
- the web application further includes an application layer
- the presentation layer is independent of the application layer
- the presentation layer runs in the same web container as the application layer.
- FIG. 6 a structural block diagram of an embodiment of an update system for a web application according to the present application is shown, and the system may include a publishing platform 610 and one or more servers 620;
- the publishing platform 610 can include the following modules:
- a resource update file publishing module 611 configured to issue a resource update file for an independent presentation layer in the web application
- the server 620 can include the following modules:
- a resource update file receiving module 621 configured to receive a resource update file for an independent display layer in the web application; the display layer has a resource file, the resource file has a load time, and the resource update file has a modification time;
- the time judging module 622 is configured to determine whether the modification time is greater than or equal to the last loading time; if yes, the resource update file loading module 623 is invoked;
- the resource update file loading module 623 is configured to load the resource update file in the display layer.
- the presentation layer can be used to load an interaction interface in a web application
- the display layer includes at least one of the following resource files:
- Web documents template files, images, cascading style sheets, script objects.
- the resource update file is an incremental file that is updated for resource files in the presentation layer.
- the resource update file receiving module 621 may include the following sub-modules:
- a storage submodule configured to store a resource update file for a separate presentation layer in the web application into a corresponding directory
- the configuration submodule is configured to configure a modification time for the resource update file.
- the resource update file loading module 623 may include the following sub-modules:
- a sub-module configured to start a template engine corresponding to the display layer
- the web application further includes an application layer
- the presentation layer is independent of the application layer
- the presentation layer runs in the same web container as the application layer.
- embodiments of the embodiments of the present application can be provided as a method, apparatus, or computer program product. Therefore, the embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, embodiments of the present application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
- RAM random access memory
- ROM read only memory
- Memory is an example of a computer readable medium.
- Computer readable media includes both permanent and non-persistent, removable and non-removable media.
- Information storage can be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
- computer readable media does not include non-persistent computer readable media, such as modulated data signals and carrier waves.
- the embodiments of the present application refer to a method, a terminal device (system), and a meter according to an embodiment of the present application.
- a flowchart and/or block diagram of a computer program product is described. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
- These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing terminal device
- Means are provided for implementing the functions specified in one or more of the flow or in one or more blocks of the flow chart.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the instruction device implements the functions specified in one or more blocks of the flowchart or in a flow or block of the flowchart.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Information Transfer Between Computers (AREA)
- Stored Programmes (AREA)
Abstract
Description
本申请涉及网络技术领域,特别是涉及一种Web应用的更新方法、一种Web应用的更新装置和一种Web应用的更新系统。The present application relates to the field of network technologies, and in particular, to a method for updating a web application, an update device for a web application, and an update system for a web application.
随着互联网技术的发展,Web(网络)应用程序作为动态网站的实现基础越来越广泛应用,Web应用程序可以由Java(一种面向对象的程序设计语言)、PHP(Hypertext Preprocessor,超文本预处理语言)、Python(一种面向对象、直译式计算机程序设计语言)等诸多语言实现,为基于浏览器的客户端用户提供网页浏览等Web服务。With the development of Internet technology, Web (web) applications are more and more widely used as the basis for the implementation of dynamic websites. Web applications can be Java (an object-oriented programming language), PHP (Hypertext Preprocessor, hypertext pre-preparation). Processing languages), Python (an object-oriented, literal translation computer programming language) and many other language implementations, providing web services such as web browsing for browser-based client users.
对于Web应用,为了便于开发、维护等要求,需要对Web应用逻辑划分层次,使得不同的开发人员可同时对更层进行开发。For Web applications, in order to facilitate development and maintenance requirements, it is necessary to divide the level of Web application logic so that different developers can simultaneously develop layers.
其中,分层中一般会包括视图层,可以是用户看到并与之交互的界面,互联网行业经常调整展现的内容,改变用户交互、文案等以提升用户体验或者发布新功能。Among them, the layering generally includes a view layer, which can be an interface that the user sees and interacts with. The Internet industry often adjusts the displayed content, changes user interaction, copywriting, etc. to enhance the user experience or release new functions.
在传统的发布过程中,所有代码(包括视图层)的修改,都使用统一的发布过程:修改代码→代码合并→编译→打包→代码分发→部署。In the traditional publishing process, all code (including view layer) modifications use a unified publishing process: modify code → code merge → compile → package → code distribution → deployment.
可以看到整个过程中,修改视图层需要经过复杂的发布过程,更新时间十分长。并且,每次更新都需要发布Web应用的全量的发布包,发布过程占用大量的网络资源。It can be seen that in the whole process, modifying the view layer requires a complicated release process, and the update time is very long. Moreover, each update requires a full release of the web application, and the publishing process occupies a large amount of network resources.
在发布过程中,由于应用容器需要重启,无法对外提供服务。所以集群的发布过程需要经过停流量、重新部署、开启流量非常复杂的操作。During the release process, the application container cannot be serviced because it needs to be restarted. Therefore, the cluster release process requires very complicated operations such as stopping traffic, redeploying, and enabling traffic.
上述发布过程修改代码的业务逻辑风险非常高,每次重新部署会加载所有的资源文件,包括视图文件以及后端逻辑文件,造成每次发布的风险不可控,稳定性也有潜在的风险。The business logic risk of modifying the code in the above release process is very high. Each time the redeployment loads all resource files, including view files and back-end logical files, the risk of each release is uncontrollable and the stability is potentially risky.
因此,目前需要本领域技术人员迫切解决的一个技术问题就是:如何提出一种Web应用的更新方法,用以减少发布流程,减少网络资源的耗费, 减少风险,提高稳定性。Therefore, a technical problem that needs to be solved urgently by those skilled in the art is how to propose a method for updating a web application, which is used to reduce the release process and reduce the consumption of network resources. Reduce risk and increase stability.
发明内容Summary of the invention
本申请实施例所要解决的技术问题是提供一种Web应用的更新方法,用以减少发布流程,减少网络资源的耗费,减少风险,提高稳定性。The technical problem to be solved by the embodiments of the present application is to provide a method for updating a web application, which is used to reduce the release process, reduce the consumption of network resources, reduce risks, and improve stability.
相应的,本申请实施例还提供了一种Web应用的更新装置,用以保证上述方法的实现及应用。Correspondingly, the embodiment of the present application further provides an update device for a web application, which is used to ensure implementation and application of the foregoing method.
为了解决上述问题,本申请公开了一种Web应用的更新方法,包括:In order to solve the above problem, the present application discloses a method for updating a web application, including:
接收针对Web应用中独立的展示层的资源更新文件;所述展示层中具有资源文件,所述资源文件具有加载时间,所述资源更新文件具有修改时间;Receiving a resource update file for a separate presentation layer in the web application; the presentation layer has a resource file, the resource file has a load time, and the resource update file has a modification time;
判断所述修改时间是否大于或等于上一次的加载时间;若是,则在所述展示层中加载所述资源更新文件。Determining whether the modification time is greater than or equal to the last load time; if yes, loading the resource update file in the display layer.
优选地,所述展示层用于加载Web应用中的交互界面;Preferably, the presentation layer is used to load an interaction interface in a web application;
所述展示层中包括以下至少一种资源文件:The display layer includes at least one of the following resource files:
网页文档、模板文件、图片、级联样式表、脚本对象。Web documents, template files, images, cascading style sheets, script objects.
优选地,所述资源更新文件为针对所述展示层中的资源文件进行更新的增量文件。Preferably, the resource update file is an incremental file that is updated for resource files in the presentation layer.
优选地,所述接收针对Web应用中独立的展示层的资源更新文件的步骤包括:Preferably, the step of receiving a resource update file for a separate presentation layer in the web application comprises:
将针对Web应用中独立的展示层的资源更新文件存储至对应的目录中;The resource update file for the independent presentation layer in the web application is stored in the corresponding directory;
对所述资源更新文件配置修改时间。The modification time is configured for the resource update file.
优选地,所述在所述展示层中加载所述资源更新文件的步骤包括:Preferably, the step of loading the resource update file in the display layer comprises:
启动所述展示层对应的模板引擎;Starting a template engine corresponding to the display layer;
采用所述模板引擎加载所述目录中的资源更新文件。The template update engine loads the resource update file in the directory.
优选地,所述Web应用还包括应用层,所述展示层与所述应用层相互独立,所述展示层与所述应用层在同一个Web容器中运行。Preferably, the web application further includes an application layer, the presentation layer and the application layer are independent of each other, and the presentation layer runs in the same web container as the application layer.
本申请实施例还公开了一种Web应用的更新装置,包括: The embodiment of the present application further discloses an update device for a web application, including:
资源更新文件接收模块,用于接收针对Web应用中独立的展示层的资源更新文件;所述展示层中具有资源文件,所述资源文件具有加载时间,所述资源更新文件具有修改时间;a resource update file receiving module, configured to receive a resource update file for an independent presentation layer in the web application; the display layer has a resource file, the resource file has a loading time, and the resource update file has a modification time;
时间判断模块,用于判断所述修改时间是否大于或等于上一次的加载时间;若是,则调用资源更新文件加载模块;a time judging module, configured to determine whether the modification time is greater than or equal to a previous loading time; if yes, calling a resource update file loading module;
资源更新文件加载模块,用于在所述展示层中加载所述资源更新文件。a resource update file loading module, configured to load the resource update file in the presentation layer.
优选地,所述展示层用于加载Web应用中的交互界面;Preferably, the presentation layer is used to load an interaction interface in a web application;
所述展示层中包括以下至少一种资源文件:The display layer includes at least one of the following resource files:
网页文档、模板文件、图片、级联样式表、脚本对象。Web documents, template files, images, cascading style sheets, script objects.
优选地,所述资源更新文件接收模块包括:Preferably, the resource update file receiving module includes:
存储子模块,用于将针对Web应用中独立的展示层的资源更新文件存储至对应的目录中;a storage submodule, configured to store a resource update file for a separate presentation layer in the web application into a corresponding directory;
配置子模块,用于对所述资源更新文件配置修改时间。The configuration submodule is configured to configure a modification time for the resource update file.
优选地,所述资源更新文件加载模块包括:Preferably, the resource update file loading module includes:
启动子模块,用于启动所述展示层对应的模板引擎;a sub-module, configured to start a template engine corresponding to the display layer;
加载子模块,用于采用所述模板引擎加载所述目录中的资源更新文件。Loading a sub-module for loading a resource update file in the directory by using the template engine.
本申请实施例还公开了一种Web应用的更新系统,所述系统包括发布平台和一个或多个服务器;The embodiment of the present application further discloses an update system for a web application, where the system includes a publishing platform and one or more servers;
其中,所述发布平台包括:The publishing platform includes:
资源更新文件发布模块,用于发布针对Web应用中独立的展示层的资源更新文件;a resource update file publishing module, configured to issue a resource update file for an independent presentation layer in the web application;
所述服务器包括:The server includes:
资源更新文件接收模块,用于接收针对Web应用中独立的展示层的资源更新文件;所述展示层中具有资源文件,所述资源文件具有加载时间,所述资源更新文件具有修改时间;a resource update file receiving module, configured to receive a resource update file for an independent presentation layer in the web application; the display layer has a resource file, the resource file has a loading time, and the resource update file has a modification time;
时间判断模块,用于判断所述修改时间是否大于或等于上一次的加载时间;若是,则调用资源更新文件加载模块; a time judging module, configured to determine whether the modification time is greater than or equal to a previous loading time; if yes, calling a resource update file loading module;
资源更新文件加载模块,用于在所述展示层中加载所述资源更新文件。a resource update file loading module, configured to load the resource update file in the presentation layer.
优选地,所述展示层用于加载Web应用中的交互界面;Preferably, the presentation layer is used to load an interaction interface in a web application;
所述展示层中包括以下至少一种资源文件:The display layer includes at least one of the following resource files:
网页文档、模板文件、图片、级联样式表、脚本对象。Web documents, template files, images, cascading style sheets, script objects.
优选地,所述资源更新文件接收模块包括:Preferably, the resource update file receiving module includes:
存储子模块,用于将针对Web应用中独立的展示层的资源更新文件存储至对应的目录中;a storage submodule, configured to store a resource update file for a separate presentation layer in the web application into a corresponding directory;
配置子模块,用于对所述资源更新文件配置修改时间。The configuration submodule is configured to configure a modification time for the resource update file.
优选地,所述资源更新文件加载模块包括:Preferably, the resource update file loading module includes:
启动子模块,用于启动所述展示层对应的模板引擎;a sub-module, configured to start a template engine corresponding to the display layer;
加载子模块,用于采用所述模板引擎加载所述目录中的资源更新文件。Loading a sub-module for loading a resource update file in the directory by using the template engine.
与背景技术相比,本申请实施例包括以下优点:Compared with the background art, the embodiments of the present application include the following advantages:
本申请实施例通过将展示层进行独立管理,在对展示层进行更新时,可以直接在展示层进行修改,发布资源更新文件,可以不用关心后端代码的更新,无需通过代码合并、编译、打包等复杂的传统发布过程,大大减少了发布的流程,加快了发布时间,同时,减少了更新的风险、提高了展示层的稳定性,大大提高了更新效率。In the embodiment of the present application, the display layer is independently managed, and when the display layer is updated, the display layer can be directly modified, and the resource update file is released, and the update of the back-end code can be avoided, and the code is not merged, compiled, and packaged. Such complex traditional publishing process greatly reduces the release process and speeds up the release time. At the same time, it reduces the risk of updating, improves the stability of the display layer, and greatly improves the update efficiency.
本申请实施例通过热加载的方式更新展示层,无需重启Web容器,在集群部署过程中无需进行停流量、重启Web容器、开启流量这样复杂的发布过程,大大提高了操作的简便性,进一步提高了更新效率。The embodiment of the present application updates the display layer by means of hot loading, and does not need to restart the web container. In the cluster deployment process, a complicated publishing process such as stopping traffic, restarting the web container, and opening the traffic is not required, thereby greatly improving the simplicity of operation and further improving. Updated efficiency.
本申请实施例在更新展示层时,发布增量文件,无需发布全量的发布包,大大减少了在发布过程的网络资源消耗。When updating the presentation layer, the embodiment of the present application issues an incremental file, and does not need to issue a full amount of the distribution package, which greatly reduces the network resource consumption in the publishing process.
图1是一种传统的代码合并是示例图;Figure 1 is a conventional code merge is an example diagram;
图2是一种传统的发布包的发布示例图;2 is a diagram showing an example of a release of a conventional distribution package;
图3本申请的一种Web应用的更新方法实施例的步骤流程图;3 is a flow chart of steps of an embodiment of an update method of a web application according to the present application;
图4本申请的一种资源更新包的发布示例图; FIG. 4 is a diagram showing an example of publishing a resource update package of the present application; FIG.
图5是本申请的一种Web应用的更新装置实施例的结构框图;FIG. 5 is a structural block diagram of an embodiment of an apparatus for updating a web application according to the present application; FIG.
图6是本申请的一种Web应用的更新系统实施例的结构框图。FIG. 6 is a structural block diagram of an embodiment of an update system for a web application according to the present application.
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。The above described objects, features and advantages of the present application will become more apparent and understood.
对于Web应用,为了便于开发、维护等要求,需要对Web应用逻辑划分层次。For web applications, in order to facilitate development, maintenance, etc., it is necessary to divide the level of web application logic.
一般都采用经典的MVC框架来划分层次。MVC(Model View Controller)把一个Web应用的输入、处理、输出流程按照模型(Model)-视图(View)-控制器(Controller)的方式进行分离,用一种业务逻辑、数据、界面显示分离的方法组织代码,这样一个Web应用可以被分成三个层——模型层、视图层、控制层。The classic MVC framework is generally used to divide the hierarchy. MVC (Model View Controller) separates the input, processing, and output processes of a web application according to the model-view-controller (Controller), and displays the separation using a business logic, data, and interface. The method organizes the code so that a web application can be divided into three layers - the model layer, the view layer, and the control layer.
视图(View)代表用户交互界面,对于Web应用来说,可以概括为HTML(Hypertext Markup Language,超文本标记语言)界面,但有可能为XHTML(The Extensible Hyper Text Markup Language,可扩展超文本标识语言)、XML(Extensible Markup Language,可扩展标记语言)和Applet(小应用程序)。一个Web应用可能有很多不同的视图,MVC设计模式对于视图的处理仅限于视图上数据的采集和处理,以及用户的请求,而不包括在视图上的业务流程的处理。业务流程的处理交予模型(Model)处理。比如一个订单的视图只接受来自模型的数据并显示给用户,以及将用户界面的输入数据和请求传递给控制和模型。View (View) represents the user interface. For web applications, it can be summarized as HTML (Hypertext Markup Language) interface, but it may be XHTML (The Extensible Hyper Text Markup Language). ), XML (Extensible Markup Language) and Applet (applet). A web application may have many different views. The processing of the view by the MVC design pattern is limited to the collection and processing of data on the view, as well as the user's request, and does not include the processing of the business process on the view. The processing of the business process is handed over to the Model process. For example, a view of an order only accepts data from the model and displays it to the user, as well as passing input data and requests from the user interface to the control and model.
模型(Model):就是业务流程/状态的处理以及业务规则的制定。业务流程的处理过程对其它层来说是黑箱操作,模型接受视图请求的数据,并返回最终的处理结果。业务模型的设计可以说是MVC最主要的核心。业务模型还有一个很重要的模型那就是数据模型。数据模型主要指实体对象的数据保存(持续化)。比如将一张订单保存到数据库,从数据库获取订单,并可以将这个模型单独列出,所有有关数据库的操作只限制在该模型中。 Model: It is the processing of business processes/states and the formulation of business rules. The processing of the business process is a black box operation for other layers, the model accepts the data requested by the view, and returns the final processing result. The design of the business model can be said to be the main core of MVC. Another important model of the business model is the data model. The data model mainly refers to the data preservation (persistence) of the entity object. For example, save an order to the database, get the order from the database, and can list the model separately, all operations related to the database are limited to the model.
控制(Controller)可以理解为接收用户请求,将模型与视图匹配在一起,共同完成用户的请求。划分控制层的作用也很明显,清楚地说明其是一个分发器,选择什么样的模型,选择什么样的视图,可以完成什么样的用户请求。控制层并不做任何的数据处理。例如,用户点击一个连接,控制层接受请求后,并不处理业务信息,它把用户的信息传递给模型,告诉模型做什么,选择符合要求的视图返回给用户。因此,一个模型可能对应多个视图,一个视图可能对应多个模型。The controller can be understood as receiving a user request, matching the model with the view, and jointly completing the user's request. The role of the division control layer is also obvious, clearly indicating that it is a distributor, what kind of model to choose, what kind of view to choose, what kind of user request can be completed. The control layer does not do any data processing. For example, when a user clicks on a connection, the control layer does not process the business information after accepting the request. It passes the user's information to the model, tells the model what to do, and selects the view that meets the requirements to return to the user. Therefore, one model may correspond to multiple views, and one view may correspond to multiple models.
MVC将业务逻辑聚集到一个部件里面,在改进和个性化定制界面及用户交互的同时,不需要重新编写业务逻辑。MVC被独特的发展起来用于映射传统的输入、处理和输出功能在一个逻辑的图形化用户界面的结构中。MVC分层同时也简化了分组开发,使得不同的开发人员可同时开发视图、控制器逻辑和业务逻辑。MVC aggregates business logic into a single component, eliminating the need to rewrite business logic while improving and personalizing the interface and user interaction. MVC has been uniquely developed to map traditional input, processing and output functions in the structure of a logical graphical user interface. MVC tiering also simplifies group development, allowing different developers to develop views, controller logic, and business logic at the same time.
而由于互联网产品发布快的行业特点,尤其是经常修改视图层,对于发布的周期有着非常紧迫的需求。Due to the fast industry characteristics of Internet products, especially the view layer is often modified, there is a very urgent need for the release cycle.
在传统的发布过程中,所有代码的修改,不区分是否修改视图层还是模型层和控制层,都使用如下统一的发布过程:In the traditional publishing process, all code modifications, regardless of whether to modify the view layer or the model layer and the control layer, use the following unified publishing process:
1、修改代码1, modify the code
开发人员申请代码版本管理工具(如subversion,SVN)主干(trunk)的分支(branch),修改代码,经过开发测试过程,确保功能正确。The developer applies for the branch of the code version management tool (such as subversion, SVN) trunk, modifies the code, and passes the development test process to ensure that the function is correct.
其中,主干可以是相对稳定版本的代码,分支可以是一种隔离项目的手段。多个分之可以并行开发,把代码最终都合并到主干上来。Among them, the trunk can be a relatively stable version of the code, and the branch can be a means of isolating the project. Multiple points can be developed in parallel, and the code is eventually merged into the backbone.
改动较大的项目可以要在分支上进行,这样如果该项目有问题,不影响其他分支的开发,也不影响主干的运行,有问题的分支可以延期、甚至废弃。Larger changes to the project can be carried out on the branch, so if the project has problems, does not affect the development of other branches, does not affect the operation of the trunk, the problematic branch can be postponed or even abandoned.
一般情况下,诸如SVN等版本管理工具,可以包括主干(trunk)、分支(branch)和标记(tag),使用方法可以如下:In general, version management tools such as SVN can include trunks, branches, and tags. The usage can be as follows:
trunk:可以用于Web应用主方向的开发。对于一个新模块的开发,可以采用trunk,当模块开发完成后,需要修改,可以采用branch。Trunk: Can be used for the development of the main direction of the web application. For the development of a new module, you can use trunk. When the module is developed, you need to modify it. You can use branch.
branch:可以用于并行的开发,这里的并行是指和trunk进行比较。 Branch: can be used for parallel development, where parallelism refers to comparison with trunk.
tag:是用来做一个标记的,不管是不是发布版本,但都是一个可用的版本。Tag: is used to make a mark, whether it is a release version, but it is a usable version.
例如,某个Web应用的3.0版本开发完成,这个时候可以做一个tag,tag_release_3_0,然后基于这个tag做发布,比如安装程序等。trunk进入3.1版本的开发,但是3.0版本发现了漏洞bug,那么就需要基于tag_release_3_0做一个branch,branch_bugfix_3_0,基于这个branch进行漏洞修改,等到漏洞修改结束,做一个tag,tag_release_3_0_1,然后,根据需要决定branch_bugfix_3_0是否并入trunk。For example, the 3.0 version of a web application is developed. At this time, you can make a tag, tag_release_3_0, and then publish based on this tag, such as the installer. Trunk into the 3.1 version of the development, but the 3.0 version found a bug, then you need to do a branch based on tag_release_3_0, branch_bugfix_3_0, based on this branch to modify the vulnerability, wait until the vulnerability is modified, make a tag, tag_release_3_0_1, and then, depending on the need to decide branch_bugfix_3_0 Whether to merge into the trunk.
2、代码合并2, code merge
将分支的代码合并到主干,回归测试。Combine the code of the branch into the trunk and regression test.
例如,如图1所示,当分支1中的项目开发测试完成,达到一个稳定的状态后,将分支1合并到主干;For example, as shown in FIG. 1, when the project development test in branch 1 is completed, after reaching a stable state, branch 1 is merged into the trunk;
主干进行集成测试,确认正常发布后从主干拷贝一份代码到tag下,因此tag下面的最新的分支即为线上稳定版本的Web应用;The backbone performs integration testing, confirming that a copy of the code from the trunk to the tag is released after the normal release, so the latest branch under the tag is the online stable version of the web application;
此时,若有项目需要分支,该项目可以从tag的稳定版本打出分支,如分支2,进行开发。当分支2中的项目开发测试完成,达到一个稳定的状态后,将分支2合并到主干。At this point, if a project needs a branch, the project can be branched from a stable version of the tag, such as branch 2, for development. When the project development test in branch 2 is completed and a stable state is reached, branch 2 is merged into the trunk.
3、编译3, compile
由于后端逻辑的代码(如Java)要编译,因此,需要将修改过后的主干编译代码。Since the code of the back-end logic (such as Java) is to be compiled, it is necessary to compile the code after the modified trunk.
4、打包4, packaging
将编译好的文件、配置文件及视图代码打成一个待发布的发布包,如图2所示,发布包一般包括ear包(即App.ear)和Htdocs(host documents)。The compiled file, configuration file, and view code are grouped into a release package to be released. As shown in FIG. 2, the release package generally includes an ear package (ie, App.ear) and Htdocs (host documents).
其中,ear包中为模型层和控制层的代码,包括Java、XML等文件。Among them, the ear package is the code of the model layer and the control layer, including files such as Java and XML.
Htdocs是一个文件夹的命名,主要用来放视图层的文件,包括HTML、vm(模板文件)等文件。Htdocs is a folder name, mainly used to put the view layer files, including HTML, vm (template files) and other files.
5、分发5, distribution
如图2所示,分发平台将打好的发布包发布到集群中的每一台服务器上。 As shown in Figure 2, the distribution platform publishes the released distribution package to each server in the cluster.
6、部署6, deployment
如图2所示,各服务器的应用容器(如jetty、jboss等)重启,重新加载所有的资源文件,修改过后的代码发布上线,应用在各服务器的Web应用,如Web应用1、Web应用2……Web应用n。As shown in Figure 2, the application containers of each server (such as jetty, jboss, etc.) are restarted, all resource files are reloaded, and the modified code is posted online, and applied to the web applications of each server, such as Web application 1, Web application 2 ...web application n.
可以看到整个发布过程中,由于模型、视图、控制在开发和运行都是一个整体,无论修改什么代码,哪怕就是修改一个文案中的错别字,都要经过复杂的研发流程,这完全不符合互联网时代的发布时间要求。It can be seen that during the entire publishing process, since the model, view, and control are both developed and run as a whole, no matter what code is modified, even if the typo in a copy is modified, it must go through a complicated R&D process, which is completely incompatible with the Internet. The release time requirements of the era.
并且,每次更新都需要发布Web应用的全量的发布包(ear包和Htdocs),发布过程占用大量的网络资源。Moreover, each update requires a full release of the web application (ear package and Htdocs), and the publishing process occupies a large amount of network resources.
在发布过程中,由于应用容器重启,无法对外提供服务。所以集群的发布过程需要停流量、重新部署、开启流量非常复杂的操作。这个过程由于不区分是否修改了业务逻辑,修改Java代码的业务逻辑风险非常高,每次重新部署会加载所有的资源文件,包括视图层的文件以及Java文件,造成每次发布的风险不可控,稳定性也有潜在的风险。During the release process, the application container could not be serviced due to the restart of the application container. Therefore, the cluster release process needs to stop traffic, redeploy, and open traffic with very complicated operations. Since this process does not distinguish whether the business logic is modified or not, the business logic of modifying the Java code is very risky. Each time the redeployment loads all the resource files, including the view layer files and the Java files, the risk of each release is uncontrollable. Stability also has potential risks.
因此,创造性地提出了本申请实施例的核心构思之一,提出新的分层发布思路,单独发布后端代码和展现层代码,由于展现层代码轻薄,改动频繁,随时可以发布上线。Therefore, one of the core concepts of the embodiments of the present application is creatively proposed, and a new layered publishing idea is proposed, and the back-end code and the presentation layer code are separately released. Since the presentation layer code is light and thin, the changes are frequent, and the online can be released at any time.
参照图3,示出了本申请的一种Web应用的更新方法实施例的步骤流程图,具体可以包括如下步骤:Referring to FIG. 3, a flow chart of steps of an embodiment of an update method of a web application according to the present application is shown, which may specifically include the following steps:
步骤301,接收针对Web应用中独立的展示层的资源更新文件;Step 301: Receive a resource update file for an independent presentation layer in the web application.
应用本申请实施例,可以基于分层设计思想对Web应用进行分层,分层设计是程序开发中一种常见的架构思想,由于程序代码经常变更,将代码分层可以将复杂问题分解简单化,每一层负责自己的实现,并向外提供服务层与层之间约定好接口,改动的时候只需要关心其中一层的变化,可以不用去关心其它层。Applying the embodiments of the present application, the web application can be layered based on the layered design idea. The layered design is a common architectural idea in the program development. Since the program code is frequently changed, the layering of the code can simplify the decomposition of the complex problem. Each layer is responsible for its own implementation, and provides a good interface between the service layer and the layer. When changing, only need to care about the changes of one layer, you can not care about other layers.
本申请实施例中,一个Web应用可以划分为至少两层,其中一层可以为展示层,另一层可以为应用层。 In this embodiment of the present application, a web application may be divided into at least two layers, where one layer may be a display layer and another layer may be an application layer.
展示层可以用于加载Web应用中的交互界面,即用户看到并与之交互的界面。一个Web应用可能有很多不同的展示层,本申请实施例中的展示层可以用于视图上数据的采集和处理,以及处理用户的请求,而可以不包括在展示层上的业务流程的处理。业务流程的处理交予应用层处理。The presentation layer can be used to load the interactive interface in the web application, ie the interface that the user sees and interacts with. A web application may have many different presentation layers. The presentation layer in the embodiment of the present application may be used for collecting and processing data on a view, and processing a user's request, but may not include processing of a business process on the presentation layer. The processing of the business process is handed over to the application layer for processing.
互联网行业经常调整展现层内容,改变用户交互、文案等以提升用户体验或者发布新功能,由于互联网产品发布快的行业特点,对于发布的周期有着非常紧迫的需求。所述展示层中可以可以包括以下至少一种资源文件:The Internet industry often adjusts the presentation layer content, changes user interactions, copywriting, etc. to enhance the user experience or release new functions. Due to the fast industry characteristics of Internet products, there is a very urgent need for the release cycle. The display layer may include at least one of the following resource files:
网页文档HTML、模板文件vm、图片、级联样式表CSS(Cascading Style Sheet)、脚本对象JS(JavaScript,脚本语言)等等。Web document HTML, template file vm, image, cascading style sheet CSS (Cascading Style Sheet), script object JS (JavaScript, scripting language) and so on.
其中,网页文档HTML可以通过标记符号来标记要显示的网页中的各个部分。网页文件本身是一种文本文件,通过在文本文件中添加标记符,可以告诉客户端(如浏览器)如何显示其中的内容(如:文字如何处理,画面如何安排,图片如何显示等)。Among them, the web page document HTML can mark various parts in the web page to be displayed by using a mark symbol. The web page file itself is a text file. By adding a tag to the text file, you can tell the client (such as a browser) how to display the content (such as how to handle the text, how the screen is arranged, how the image is displayed, etc.).
模板文件vm可以为开发Web应用的模板。The template file vm can be a template for developing web applications.
级联样式表CSS可以对网页中的对象的位置排版进行像素级的精确控制,支持几乎所有的字体字号样式,拥有对网页对象和模型样式编辑的能力,并能够进行初步交互设计。The cascading style sheet CSS can perform pixel-level precise control on the position layout of objects in the webpage, supports almost all font size styles, has the ability to edit webpage objects and model styles, and can perform preliminary interaction design.
脚本对象JS可以在HTML网页上使用,用来给HTML网页增加动态功能,例如响应用户的各种操作。其源代码在发往客户端(如浏览器)运行之前不需经过编译,而是将文本格式的字符代码发送给客户端(如浏览器),由客户端(如浏览器)解释运行。The script object JS can be used on an HTML web page to add dynamic functionality to the HTML web page, for example in response to various user actions. The source code does not need to be compiled before being sent to the client (such as a browser). Instead, the text code is sent to the client (such as a browser) and interpreted by the client (such as a browser).
加载该资源文件可以实现界面的显示,而在加载时,本申请实施例可以对其记录加载时间,则所述资源文件可以具有加载时间(即加载该资源文件的时间)。The resource file can be loaded to display the loading time of the interface. When loading, the resource file can have a loading time (that is, a time when the resource file is loaded).
应用层可以为Web应用中除展示层外的代码集合,即Web应用中的后端代码。The application layer can be a collection of code in the web application other than the presentation layer, that is, the back-end code in the web application.
若应用MVC的分层理念,应用层可以进一步划分为模型层和控制层。If the layering concept of MVC is applied, the application layer can be further divided into a model layer and a control layer.
模型层可以为业务流程/状态的处理以及业务规则的制定,模型接受展示 层请求的数据,并返回最终的处理结果。模型中可以包括一个或多个数据模型,该数据模型主要指实体对象的数据保存(持续化)。The model layer can be used for the processing of business processes/states and the formulation of business rules. The layer requests the data and returns the final processing result. The model may include one or more data models, which mainly refer to data preservation (persistence) of the entity objects.
控制层可以接收请求,将模型层与展示层匹配在一起,共同完成请求。控制层明确其是一个分发器,选择什么样的数据模型,选择什么样的展示层,可以完成什么样的用户请求。The control layer can receive the request and match the model layer with the presentation layer to complete the request. The control layer clarifies that it is a distributor, what data model to choose, what display layer to choose, and what kind of user request can be completed.
若应用其他分层理念,应用层可以进一步划分为其他层次,本申请实施例对此不加以限制。If other layering concepts are applied, the application layer may be further divided into other layers, which is not limited by the embodiment of the present application.
在实际应用中,所述展示层可以与所述应用层相互独立。In practical applications, the presentation layer may be independent of the application layer.
具体而言,在开发展示层与应用层时,可以分别采用版本管理工具(如SVN)进行独立的开发,展示层和应用层各自可以具有独立的主干(trunk),本申请实施例中可以对展示层和应用层进行隔离管理。Specifically, in the development of the display layer and the application layer, the version management tool (such as SVN) can be used for independent development. The display layer and the application layer can each have an independent trunk. The display layer and the application layer are managed in isolation.
展示层比较轻薄,可以负责简单的显示逻辑处理,速度更快;应用层需要处理企业级开发,结构复杂,涉及的外部资源众多、事务密集、数据量大、用户数多,有较强的安全性考虑。The display layer is relatively thin and light, and can be responsible for simple display logic processing, and the speed is faster; the application layer needs to deal with enterprise-level development, the structure is complex, involving many external resources, transaction-intensive, large amount of data, large number of users, and strong security. Sexual considerations.
在运行时,所述展示层与所述应用层可以在同一个Web容器中运行。At runtime, the presentation layer and the application layer can run in the same web container.
Web容器可以是一种服务程序,可以由Web服务器来实现,为Web服务器(如JSP服务器,servlet服务器等)提供一个运行环境,使Web服务器直接跟容器中的环境变量接口交互,不必关注其他系统问题。The web container can be a service program, which can be implemented by a web server, and provides a running environment for the web server (such as a JSP server, a servlet server, etc.), so that the web server directly interacts with the environment variable interface in the container, without paying attention to other systems. problem.
web容器可以是包括Java中的Tomcat,ASP(Active Server Page,动态服务器页面)的IIS或PWS等等。The web container can be IIS or PWS including Tomcat in Java, ASP (Active Server Page), and so on.
传统的视图层一般包括展示层和应用层的部分代码。以java语言为例,视图层会有一部分视图处理的java代码,这部分代码如果要有变更,是要编译重启才能生效的。Traditional view layers typically include partial code for the presentation and application layers. Take the java language as an example, the view layer will have a part of the view processing java code, if this part of the code has to be changed, it is necessary to compile and restart to take effect.
在本申请实施例中,若开发人员基于业务需求对展示层进行修改,由于展现层代码比较轻薄,修改很简单,工作量小,所以可以在展示层的主干上修改代码,避免了代码合并的传统的发布过程。因此,展示层的配置管理策略可以是主干开发、主干发布。In the embodiment of the present application, if the developer modifies the display layer based on the business requirement, since the presentation layer code is relatively thin and light, the modification is simple, and the workload is small, the code can be modified on the trunk of the display layer to avoid code merge. The traditional release process. Therefore, the configuration management strategy of the presentation layer can be trunk development and trunk release.
开发人员在主干修改代码,经过开发、测试,保证功能正确,生成资源 更新文件(Htdocs),该资源更新文件可以具有修改时间,以标识该资源更新文件进行修改的时间。Developers modify the code in the trunk, after development, testing, to ensure that the function is correct, generate resources An update file (Htdocs) that can have a modification time to identify when the resource update file was modified.
所述资源更新文件可以为针对所述展示层中的资源文件进行更新的增量文件,具体可以包括以下至少一种资源文件:The resource update file may be an incremental file that is updated for the resource file in the display layer, and may specifically include at least one of the following resource files:
网页文档HTML、模板文件vm、图片、级联样式表CSS(Cascading Style Sheet)、脚本对象JS(JavaScript,脚本语言)等等,即修改哪个资源文件就发布对应的资源更新文件。Web document HTML, template file vm, picture, cascading style sheet CSS (Cascading Style Sheet), script object JS (JavaScript, scripting language), etc., that is, which resource file is modified to issue the corresponding resource update file.
由于后端代码也是独立管理,因此,在更新独立的展示层时,无需对资源更新文件进行编译、打包,可以直接发布资源更新文件。Since the back-end code is also managed independently, when updating the independent presentation layer, it is not necessary to compile and package the resource update file, and the resource update file can be directly published.
本申请实施例通过将展示层进行独立管理,在对展示层进行更新时,可以直接在展示层进行修改,发布资源更新文件,可以不用关心后端代码的更新,无需通过代码合并、编译、打包等复杂的传统发布过程,大大减少了发布的流程,加快了发布时间,同时,减少了更新的风险、提高了展示层的稳定性,大大提高了更新效率。In the embodiment of the present application, the display layer is independently managed, and when the display layer is updated, the display layer can be directly modified, and the resource update file is released, and the update of the back-end code can be avoided, and the code is not merged, compiled, and packaged. Such complex traditional publishing process greatly reduces the release process and speeds up the release time. At the same time, it reduces the risk of updating, improves the stability of the display layer, and greatly improves the update efficiency.
本申请实施例在更新展示层时,发布增量文件,无需发布全量的发布包(ear包和Htdocs),大大减少了在发布过程的网络资源消耗。When updating the presentation layer, the embodiment of the present application issues an incremental file, and does not need to issue a full amount of distribution packages (ear packets and Htdocs), which greatly reduces the network resource consumption in the publishing process.
开发人员在制作完成资源更新文件后,可以通过发布平台将该资源更新文件分发到一个或多个服务器中,以进行安装在该服务器中Web应用展示层的更新。After the developer completes the resource update file, the developer can distribute the resource update file to one or more servers through the publishing platform to perform the update of the web application display layer installed in the server.
需要说明的是,该一个或多个服务器可以为基于分布式架构的集群服务器,则发布平台可以通过分布式版本控制系统(例如Git)将该资源更新文件分发到一个或多个服务器中。It should be noted that the one or more servers may be cluster servers based on a distributed architecture, and the publishing platform may distribute the resource update files to one or more servers through a distributed version control system (eg, Git).
在本申请的一种优选实施例中,步骤302可以包括如下子步骤:In a preferred embodiment of the present application,
子步骤S11,将针对Web应用中独立的展示层的资源更新文件存储至对应的目录中;Sub-step S11, storing the resource update file for the independent display layer in the web application into the corresponding directory;
在实际应用中,展示层可以按照约定,在应用中按照功能划分各个模块,各个模块中的资源文件存储在各自对应的目录中。In practical applications, the presentation layer may divide each module according to functions according to the convention, and the resource files in each module are stored in respective corresponding directories.
例如,对于某个商务网站的展示层,其资源文件的目录结构可以如下所 示:For example, for the presentation layer of a business website, the directory structure of its resource files can be as follows Show:
其中,该展示层按照功能可以在模板文件(template)中划分为三个模块,分别为user(用户模块)、trade(交易模块)、consumerecord(交易记录模块),每个模块具有各自对应的目录。其中,user(用户模块)可以用于加载与用户相关的界面,如用户登录、用户注册、帮助等等;trade(交易模块)可以用于加载与交易相关的界面,如支付等等;consumerecord(交易记录模块)可以用于加载交易记录的界面。当服务器接收到展现层的资源更新文件时,需要将该资源更新文件存储在指定的目录中,替换原有的资源文件,以便进行正常的加载,更新展示层。The display layer can be divided into three modules in a template file according to functions, namely user (user module), trade (transaction module), and consumeure (transaction record module), and each module has its own corresponding directory. . Among them, user (user module) can be used to load user-related interfaces, such as user login, user registration, help, etc.; trade (transaction module) can be used to load transaction-related interfaces, such as payment, etc.; consumerecord ( The transaction record module) can be used to load the interface of the transaction record. When the server receives the resource update file of the presentation layer, the resource update file needs to be stored in the specified directory, and the original resource file is replaced, so as to perform normal loading and update the display layer.
子步骤S12,对所述资源更新文件配置修改时间。Sub-step S12, configuring a modification time for the resource update file.
资源更新文件一般具有修改时间,以表示对该资源更新文件进行最后修 改的时间。The resource update file generally has a modification time to indicate that the resource update file is last modified. Change the time.
在本申请实施例中,该修改时间可以为服务器接收到该资源更新文件的时间。In this embodiment of the present application, the modification time may be a time when the server receives the resource update file.
步骤302,判断所述修改时间是否大于或等于上一次的加载时间;若是,则执行步骤303;
本实际应用中,可以在服务器的内存中存储每一个资源文件的最后加载时间(即上一次的加载时间)。In this practical application, the last load time (ie, the last load time) of each resource file can be stored in the memory of the server.
本申请实施例可以对Web应用的框架进行修改,以使得服务器可以定时或不定时扫描资源文件,若修改时间大于或等于上一次的加载时间,则可以认为资源更新文件的版本比资源文件的版本要新,需要对资源文件进行更新。The embodiment of the present application may modify the framework of the web application, so that the server may scan the resource file periodically or irregularly. If the modification time is greater than or equal to the previous loading time, the version of the resource update file may be considered to be the version of the resource file. To be new, you need to update the resource file.
在具体实现中,修改时间和加载时间可以换算成秒数进行大小的比较,例如,修改时间为2014年9月29日17:35,加载时间为2014年9月28日23:42,此时该时间信息比加载时间大。In the specific implementation, the modification time and the loading time can be converted into seconds to compare the sizes. For example, the modification time is 17:35 on September 29, 2014, and the loading time is 23:42 on September 28, 2014. This time information is larger than the load time.
步骤303,在所述展示层中加载所述资源更新文件。Step 303: Load the resource update file in the display layer.
由于启动时加载了资源文件,放到了内存中,那么更改了这些资源文件时,必须要重新加载。本申请实施例若判断资源更新文件的修改时间大于或等于上一次资源文件的加载时间,则加载该资源更新文件,实现了热加载。Since the resource files are loaded at runtime and placed in memory, they must be reloaded when these resource files are changed. In the embodiment of the present application, if it is determined that the modification time of the resource update file is greater than or equal to the loading time of the last resource file, the resource update file is loaded, and hot loading is implemented.
在本申请的一种优选实施例中,步骤303可以包括如下子步骤:In a preferred embodiment of the present application,
子步骤S21,启动所述展示层对应的模板引擎;Sub-step S21, starting a template engine corresponding to the display layer;
展示层可以按照固定的模板语言进行编译,而模板语言可以有多种,例如,Velocity、JSP(JavaServer Pages)、FreeMaker等等。The presentation layer can be compiled in a fixed template language, and there are many template languages, such as Velocity, JSP (JavaServer Pages), FreeMaker, and so on.
以Velocity为例,Velocity的模板引擎在启动时,可以采用Velocity.init()或者新建VelocityEngine类的方式,调用RuntimeInstance类中的init方法,通过设置的模板引擎属性初始化模板引擎。In the case of Velocity, Velocity's template engine can start with Velocity.init() or create a new VelocityEngine class, call the init method in the RuntimeInstance class, and initialize the template engine with the template engine properties set.
子步骤S22,采用所述模板引擎加载所述目录中的资源更新文件。Sub-step S22, using the template engine to load a resource update file in the directory.
在具体实现中,在应用中可以配置模板引擎的属性resourceLoaderPath告诉模板引擎到哪个目录寻找展示层的模板文件及资源更新文件,如 config.xml、css.vm、js.vm文件。In a specific implementation, the template resource attribute resourceLoaderPath can be configured in the application to tell the template engine which directory to search for the template file and resource update file of the display layer, such as Config.xml, css.vm, js.vm files.
Web应用加载了被分发到服务器上的资源更新文件,实现修改过后的展现层发布上线。The web application loads the resource update file distributed to the server, and the modified presentation layer is released online.
本申请实施例通过热加载的方式更新展示层,无需重启Web容器,在集群部署过程中无需进行停流量、重启Web容器、开启流量这样复杂的发布过程,大大提高了操作的简便性,进一步提高了更新效率。The embodiment of the present application updates the display layer by means of hot loading, and does not need to restart the web container. In the cluster deployment process, a complicated publishing process such as stopping traffic, restarting the web container, and opening the traffic is not required, thereby greatly improving the simplicity of operation and further improving. Updated efficiency.
为使本领域技术人员更好地理解本申请实施例,以下通过具体的示例来说明本申请实施例中Web应用的更新方法。In order to enable a person skilled in the art to better understand the embodiments of the present application, the method for updating the web application in the embodiment of the present application is described below by using specific examples.
如图4所示,根据业务需求,开发人员对Web应用中独立的展示层进行修改,需要在某个电子商务网站的支付工具界面中增加一段文案提醒:“充值送红包”。As shown in FIG. 4, according to the business requirement, the developer needs to modify the independent display layer in the web application, and needs to add a copy reminder in the payment tool interface of an e-commerce website: “recharge the red envelope”.
技术人员可以在Web应用的资源文件i.vm中增加该文案提醒,并提供代码。该代码经测试通过后,生成资源更新文件(Htdocs,即i.vm),技术人员在发布平台中查找发布单,确定只需要发布某个目录下的i.vm。在发布平台通过Git将资源更新文件(Htdocs,即i.vm)分发到各个服务器中,在各个服务器中的Web应用(如Web应用1、Web应用2……Web应用n)中包括独立的应用层(App.ear)和展示层(Htdocs),在展示层中通过热加载的方式加载资源更新文件(Htdocs,即i.vm),实现修改过后的展现层发布上线。The technician can add the copy reminder and provide the code in the web application's resource file i.vm. After the code is tested, a resource update file (Htdocs, ie i.vm) is generated. The technician finds the release list in the publishing platform and determines that only i.vm in a certain directory needs to be released. The distribution platform distributes resource update files (Htdocs, ie, i.vm) to each server through Git, and includes independent applications in web applications (such as Web application 1, Web application 2, ... Web application n) in each server. The layer (App.ear) and the display layer (Htdocs) load the resource update file (Htdocs, i.vm) in the display layer by hot loading, so that the modified presentation layer is released online.
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请实施例所必须的。It should be noted that, for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should understand that the embodiments of the present application are not limited by the described action sequence, because In accordance with embodiments of the present application, certain steps may be performed in other sequences or concurrently. In the following, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required in the embodiments of the present application.
参照图5,示出了本申请一种Web应用的更新装置实施例的结构框图, 具体可以包括如下模块:Referring to FIG. 5, a structural block diagram of an embodiment of an update apparatus for a web application according to the present application is shown. Specifically, the following modules may be included:
资源更新文件接收模块501,用于接收针对Web应用中独立的展示层的资源更新文件;所述展示层中具有资源文件,所述资源文件具有加载时间,所述资源更新文件具有修改时间;The resource update
时间判断模块502,用于判断所述修改时间是否大于或等于上一次的加载时间;若是,则调用资源更新文件加载模块503;The
资源更新文件加载模块503,用于在所述展示层中加载所述资源更新文件。The resource update
在具体实现中,所述展示层可以用于加载Web应用中的交互界面;In a specific implementation, the presentation layer can be used to load an interaction interface in a web application;
所述展示层中包括以下至少一种资源文件:The display layer includes at least one of the following resource files:
网页文档、模板文件、图片、级联样式表、脚本对象。Web documents, template files, images, cascading style sheets, script objects.
在实际应用中,所述资源更新文件为针对所述展示层中的资源文件进行更新的增量文件。In an actual application, the resource update file is an incremental file that is updated for resource files in the presentation layer.
在本申请的一种优选实施例中,所述资源更新文件接收模块501可以包括如下子模块:In a preferred embodiment of the present application, the resource update
存储子模块,用于将针对Web应用中独立的展示层的资源更新文件存储至对应的目录中;a storage submodule, configured to store a resource update file for a separate presentation layer in the web application into a corresponding directory;
配置子模块,用于对所述资源更新文件配置修改时间。The configuration submodule is configured to configure a modification time for the resource update file.
在本申请的一种优选实施例中,所述资源更新文件加载模块503可以包括如下子模块:In a preferred embodiment of the present application, the resource update
启动子模块,用于启动所述展示层对应的模板引擎;a sub-module, configured to start a template engine corresponding to the display layer;
加载子模块,用于采用所述模板引擎加载所述目录中的资源更新文件。Loading a sub-module for loading a resource update file in the directory by using the template engine.
在本申请的一种优选实施例中,所述Web应用还包括应用层,所述展示层与所述应用层相互独立,所述展示层与所述应用层在同一个Web容器中运行。In a preferred embodiment of the present application, the web application further includes an application layer, the presentation layer is independent of the application layer, and the presentation layer runs in the same web container as the application layer.
参照图6,示出了本申请一种Web应用的更新系统实施例的结构框图,所述系统可以包括发布平台610和一个或多个服务器620;
Referring to FIG. 6, a structural block diagram of an embodiment of an update system for a web application according to the present application is shown, and the system may include a
其中,所述发布平台610可以包括如下模块:The
资源更新文件发布模块611,用于发布针对Web应用中独立的展示层的资源更新文件;a resource update
所述服务器620可以包括如下模块:The
资源更新文件接收模块621,用于接收针对Web应用中独立的展示层的资源更新文件;所述展示层中具有资源文件,所述资源文件具有加载时间,所述资源更新文件具有修改时间;a resource update
时间判断模块622,用于判断所述修改时间是否大于或等于上一次的加载时间;若是,则调用资源更新文件加载模块623;The
资源更新文件加载模块623,用于在所述展示层中加载所述资源更新文件。The resource update
在具体实现中,所述展示层可以用于加载Web应用中的交互界面;In a specific implementation, the presentation layer can be used to load an interaction interface in a web application;
所述展示层中包括以下至少一种资源文件:The display layer includes at least one of the following resource files:
网页文档、模板文件、图片、级联样式表、脚本对象。Web documents, template files, images, cascading style sheets, script objects.
在实际应用中,所述资源更新文件为针对所述展示层中的资源文件进行更新的增量文件。In an actual application, the resource update file is an incremental file that is updated for resource files in the presentation layer.
在本申请的一种优选实施例中,所述资源更新文件接收模块621可以包括如下子模块:In a preferred embodiment of the present application, the resource update
存储子模块,用于将针对Web应用中独立的展示层的资源更新文件存储至对应的目录中;a storage submodule, configured to store a resource update file for a separate presentation layer in the web application into a corresponding directory;
配置子模块,用于对所述资源更新文件配置修改时间。The configuration submodule is configured to configure a modification time for the resource update file.
在本申请的一种优选实施例中,所述资源更新文件加载模块623可以包括如下子模块:In a preferred embodiment of the present application, the resource update
启动子模块,用于启动所述展示层对应的模板引擎;a sub-module, configured to start a template engine corresponding to the display layer;
加载子模块,用于采用所述模板引擎加载所述目录中的资源更新文件。Loading a sub-module for loading a resource update file in the directory by using the template engine.
在本申请的一种优选实施例中,所述Web应用还包括应用层,所述展示层与所述应用层相互独立,所述展示层与所述应用层在同一个Web容器中运行。 In a preferred embodiment of the present application, the web application further includes an application layer, the presentation layer is independent of the application layer, and the presentation layer runs in the same web container as the application layer.
对于装置、系统实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。For the device and the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。The various embodiments in the present specification are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same similar parts between the various embodiments can be referred to each other.
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the embodiments of the present application can be provided as a method, apparatus, or computer program product. Therefore, the embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, embodiments of the present application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
在一个典型的配置中,所述计算机设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非持续性的电脑可读媒体(transitory media),如调制的数据信号和载波。In a typical configuration, the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory. The memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory. Memory is an example of a computer readable medium. Computer readable media includes both permanent and non-persistent, removable and non-removable media. Information storage can be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-persistent computer readable media, such as modulated data signals and carrier waves.
本申请实施例是参照根据本申请实施例的方法、终端设备(系统)、和计 算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The embodiments of the present application refer to a method, a terminal device (system), and a meter according to an embodiment of the present application. A flowchart and/or block diagram of a computer program product is described. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing terminal device Means are provided for implementing the functions specified in one or more of the flow or in one or more blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The instruction device implements the functions specified in one or more blocks of the flowchart or in a flow or block of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device such that a series of operational steps are performed on the computer or other programmable terminal device to produce computer-implemented processing, such that the computer or other programmable terminal device The instructions executed above provide steps for implementing the functions specified in one or more blocks of the flowchart or in a block or blocks of the flowchart.
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。While a preferred embodiment of the embodiments of the present application has been described, those skilled in the art can make further changes and modifications to the embodiments once they are aware of the basic inventive concept. Therefore, the appended claims are intended to be interpreted as including all the modifications and the modifications
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终 端设备中还存在另外的相同要素。Finally, it should also be noted that in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities. There is any such actual relationship or order between operations. Furthermore, the terms "comprises" or "comprising" or "comprising" or any other variations are intended to encompass a non-exclusive inclusion, such that a process, method, article, or terminal device that includes a plurality of elements includes not only those elements but also Other elements that are included, or include elements inherent to such a process, method, article, or terminal device. In the absence of more restrictions, elements defined by the phrase "comprising a ..." are not excluded from the process, method, article, or There are additional identical elements in the end device.
以上对本申请所提供的一种Web应用的更新方法、一种Web应用的更新装置和一种Web应用的更新系统,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。 The method for updating a web application provided by the present application, a updating device for a web application, and a updating system for a web application are described in detail. In this paper, a specific example is applied to implement the principle and implementation manner of the present application. It is to be noted that the description of the above embodiments is only for helping to understand the method of the present application and its core ideas; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in specific embodiments and applications. In the above, the contents of the present specification should not be construed as limiting the present application.
Claims (11)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410602688.0A CN105630522B (en) | 2014-10-31 | 2014-10-31 | A kind of update method, the device and system of Web application |
| CN201410602688.0 | 2014-10-31 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2016066048A1 true WO2016066048A1 (en) | 2016-05-06 |
Family
ID=55856599
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2015/092516 Ceased WO2016066048A1 (en) | 2014-10-31 | 2015-10-22 | Method, apparatus and system for updating web application |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN105630522B (en) |
| WO (1) | WO2016066048A1 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106775821A (en) * | 2016-11-21 | 2017-05-31 | 上海斐讯数据通信技术有限公司 | A kind of method for upgrading system and device |
Families Citing this family (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106155750B (en) * | 2016-07-29 | 2018-09-07 | 腾讯科技(深圳)有限公司 | A kind of loading method and device of resource file |
| CN107800562B (en) * | 2017-02-16 | 2019-03-01 | 平安科技(深圳)有限公司 | A kind of method for configuring route and device of view file |
| CN108415976B (en) * | 2018-02-09 | 2021-11-09 | 西安博达软件股份有限公司 | Method for rapidly publishing website file based on CMS system |
| CN110955440B (en) * | 2018-09-25 | 2023-06-09 | 中兴通讯股份有限公司 | Screen locking application separation upgrading method, device, equipment and computer readable medium |
| CN110955474B (en) * | 2018-09-27 | 2023-09-05 | 杭州海康威视系统技术有限公司 | Method, device and equipment for adding and calling service in application system |
| CN111610982B (en) * | 2019-02-26 | 2023-05-16 | 阿里巴巴集团控股有限公司 | Application program development method, device and related system |
| CN110134432B (en) * | 2019-04-19 | 2024-09-17 | 平安科技(深圳)有限公司 | Bug repairing method and device for application and computer equipment |
| CN110990035B (en) * | 2019-11-01 | 2023-03-14 | 中国人民解放军63811部队 | Chain type software upgrading method based on Git |
| TWI773939B (en) | 2019-11-12 | 2022-08-11 | 緯創資通股份有限公司 | Version management system, version management method, and non-transitory computer readable storage medium for version management method |
| CN111767089A (en) * | 2020-06-28 | 2020-10-13 | 北京百度网讯科技有限公司 | Method, apparatus, device and storage medium for loading files |
| CN111880834B (en) * | 2020-07-07 | 2024-02-09 | 成都榕慧科技有限公司 | Code issuing method, device, electronic equipment and computer medium |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7277861B1 (en) * | 1999-08-27 | 2007-10-02 | Westport Insurance Corporation | Insurance policy renewal method and system |
| CN102087664A (en) * | 2011-01-27 | 2011-06-08 | 深圳市五巨科技有限公司 | Optimizing method of mobile terminal access network, system and mobile terminal |
| CN102495730A (en) * | 2011-12-02 | 2012-06-13 | 曙光信息产业(北京)有限公司 | Dynamic and extendable web interface method |
| CN102904947A (en) * | 2012-09-29 | 2013-01-30 | 北京百度网讯科技有限公司 | Method and system for displaying style update and/or content extension by application client |
| CN103023941A (en) * | 2011-09-26 | 2013-04-03 | 腾讯科技(深圳)有限公司 | Terminal application program updating method and system based on Web page |
| CN103152429A (en) * | 2013-03-21 | 2013-06-12 | 广东威创视讯科技股份有限公司 | Method and device based on web cross-platform and splicing wall interaction |
| CN103440143A (en) * | 2013-08-02 | 2013-12-11 | 安徽科大讯飞信息科技股份有限公司 | System and method for upgrading mobile web application |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060041665A1 (en) * | 2004-05-27 | 2006-02-23 | Karnik Neeran M | Network services applications |
| CN100481002C (en) * | 2007-04-18 | 2009-04-22 | 杭州华三通信技术有限公司 | Web interface extending method and device |
| CN101727490A (en) * | 2009-12-22 | 2010-06-09 | 福建星网锐捷网络有限公司 | Method for realizing page insertion in WEB application and WEB server |
| CN103257855B (en) * | 2012-12-11 | 2016-04-06 | 深圳市梦圆皇宫管理顾问有限公司 | A kind of disposal system based on MVC, disposal route and the application in beauty treatment software |
| CN103902319A (en) * | 2012-12-30 | 2014-07-02 | 青岛海尔软件有限公司 | Hot deployment method based on server-side javascript |
-
2014
- 2014-10-31 CN CN201410602688.0A patent/CN105630522B/en active Active
-
2015
- 2015-10-22 WO PCT/CN2015/092516 patent/WO2016066048A1/en not_active Ceased
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7277861B1 (en) * | 1999-08-27 | 2007-10-02 | Westport Insurance Corporation | Insurance policy renewal method and system |
| CN102087664A (en) * | 2011-01-27 | 2011-06-08 | 深圳市五巨科技有限公司 | Optimizing method of mobile terminal access network, system and mobile terminal |
| CN103023941A (en) * | 2011-09-26 | 2013-04-03 | 腾讯科技(深圳)有限公司 | Terminal application program updating method and system based on Web page |
| CN102495730A (en) * | 2011-12-02 | 2012-06-13 | 曙光信息产业(北京)有限公司 | Dynamic and extendable web interface method |
| CN102904947A (en) * | 2012-09-29 | 2013-01-30 | 北京百度网讯科技有限公司 | Method and system for displaying style update and/or content extension by application client |
| CN103152429A (en) * | 2013-03-21 | 2013-06-12 | 广东威创视讯科技股份有限公司 | Method and device based on web cross-platform and splicing wall interaction |
| CN103440143A (en) * | 2013-08-02 | 2013-12-11 | 安徽科大讯飞信息科技股份有限公司 | System and method for upgrading mobile web application |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106775821A (en) * | 2016-11-21 | 2017-05-31 | 上海斐讯数据通信技术有限公司 | A kind of method for upgrading system and device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105630522B (en) | 2019-03-08 |
| CN105630522A (en) | 2016-06-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2016066048A1 (en) | Method, apparatus and system for updating web application | |
| JP7719932B2 (en) | Editing a database while previewing a virtual web page | |
| US10810563B1 (en) | Payments portal | |
| CN108984714B (en) | Page rendering method and device, electronic equipment and computer readable medium | |
| US9122658B2 (en) | Webpage display system leveraging OSGi | |
| CN110020307B (en) | Drawing method and device for client end view | |
| US9645814B1 (en) | Generating and publishing applications for multiple platforms | |
| WO2017124952A1 (en) | Webpage script loading method and device | |
| US10902508B2 (en) | Methods for extracting and adapting information to generate custom widgets and devices thereof | |
| US11789963B2 (en) | Systems and methods for presenting web application content | |
| CN106997298A (en) | A kind of application resource acquisition methods and device | |
| CN113805973B (en) | Application program control method and device, application program development method and device | |
| US9436445B2 (en) | Drag-and-drop functionality for scalable vector graphics | |
| US20150242908A1 (en) | Determining a configuration of a content item display environment | |
| US11895553B2 (en) | Web application with components in different virtual environments | |
| CN108228181A (en) | The method and device of embedded html page in html page | |
| US9934019B1 (en) | Application function conversion to a service | |
| US20230266947A1 (en) | Rapid prototyping of user experience components and related application functionality | |
| Miravet et al. | Framework for the declarative implementation of native mobile applications | |
| US20090049423A1 (en) | Javascripttm programming extension | |
| CN114254232A (en) | Cloud product page generation method and device, computer equipment and storage medium | |
| Martola | An evaluation of implementing a progressive web application with micro frontend architecture | |
| CN111767498A (en) | Method and device for realizing file information sharing | |
| Nguyen | Improving web development process of MERN stack | |
| JP2025535022A (en) | Sub-application page processing method and apparatus, computer device, and computer program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 15854496 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 15854496 Country of ref document: EP Kind code of ref document: A1 |