CN111381856A - Method and device for hot updating of Java software - Google Patents

Method and device for hot updating of Java software Download PDF

Info

Publication number
CN111381856A
CN111381856A CN202010221271.5A CN202010221271A CN111381856A CN 111381856 A CN111381856 A CN 111381856A CN 202010221271 A CN202010221271 A CN 202010221271A CN 111381856 A CN111381856 A CN 111381856A
Authority
CN
China
Prior art keywords
service
module
application
service instance
updating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010221271.5A
Other languages
Chinese (zh)
Inventor
陈益玲
何本强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Business Intelligence Of Oriental Nations Corp ltd
Original Assignee
Business Intelligence Of Oriental Nations Corp ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Business Intelligence Of Oriental Nations Corp ltd filed Critical Business Intelligence Of Oriental Nations Corp ltd
Priority to CN202010221271.5A priority Critical patent/CN111381856A/en
Publication of CN111381856A publication Critical patent/CN111381856A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

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)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method and a device for hot updating Java software, which comprises the following steps of S1: deploying an application framework in a Java running virtual machine, and importing an application running package which already comprises a required component library and other running resource package class libraries; s2: after the application deployment is completed, adding a new service instance; s3: checking whether the new service instance in the S2 is effective or not through the client test; s4: updating the service instance in S2; s5: checking whether the service instance in the S4 is updated through the client test; s6: uninstall the service instance in S4; s7: through the client test, it is checked whether the service instance in S6 exists. The invention also discloses a device for hot updating of Java software, which comprises four modules, namely a data stack module, a component library module, a service arrangement module and a resource loading and unloading module.

Description

Method and device for hot updating of Java software
Technical Field
The invention relates to the technical field of service application, in particular to a method and a device for hot updating of Java software.
Background
In the era of continuous delivery, redeployment of a new version only needs to click a button, but in some cases, redeployment process may be complex, shutdown is not allowed, and in order to enable an application to continuously provide the application without interruption, service is continuously provided on the premise of not restarting the application, which is also called hot update.
The JAVA hot-update technology is constantly making updating progress, and there are three main technologies involved at present, one is high availability, and a system is described to be specially designed, so that the downtime is reduced, and the high availability of the service is maintained; a Java class loader (Java Classloader) which is a part of a Java Runtime Environment (Java Runtime Environment) and is responsible for dynamically loading Java classes into a memory space of a Java virtual machine; third, the application service system providing several services; each service has independent inputs and outputs.
However, at present, the service based on Java application usually uses Java to implement service capability, the release of service capability requires updating class file in application running state, and a shutdown operation is required, and the shutdown process may cause application service interruption, which reduces system availability.
Disclosure of Invention
In view of the above technical problems in the related art, the present invention provides a method and an apparatus for hot update of Java software, which can overcome the above disadvantages in the prior art.
In order to achieve the technical purpose, the technical scheme of the invention is realized as follows:
a method for hot updating Java software comprises the following steps:
s1: the method comprises the steps of application deployment, namely deploying an application framework in a Java running virtual machine, importing an application running package containing a required component library and other running resource package class libraries, and after the application runs, not loading a new running class library any more, wherein the application only has one basic kernel;
s2: after the application deployment is completed, adding a new service instance, and issuing a service arrangement resource file to an application resource directory by calling 2 components in the service instance;
s3: checking whether the new service instance in the step S2 is effective or not through client test, and if the new service instance is not effective, reissuing the service arrangement resource file to the application resource directory until the new service instance is effective; otherwise, continuing the next step;
s4: updating the service instances in the S2, and updating the service arrangement resource file to the application resource directory by adjusting the number of the calling components to be 3;
s5: checking whether the service instance in the S4 is updated or not through client test, if the service instance is not updated, updating the service arrangement resource file to the application resource directory again, otherwise, continuing the next step;
s6: uninstalling the service instance in the S4, and deleting the service arrangement resource file of the service instance from the application resource directory;
s7: and through the client test, checking whether the service instance in the S6 exists, if the service does not exist, deleting the service arrangement resource file of the service A from the application resource directory again, and otherwise, ignoring.
Further, for step S2 and step S4, the components in the component library are implemented by java class, and provide independent input and output functions.
The invention also discloses a device for hot updating of Java software, which comprises four modules, namely a data stack module, a component library module, a service arrangement module and a resource loading and unloading module;
the data stack module is used in a software updating method, generates data when receiving a data request, and cleans the data after the request processing is finished;
the component library module is used for selecting and matching components according to the application scene requirement, and presetting the components into an application, wherein the components in the component library module are connected with the data stack module through an interface, the components acquire data from the data stack, and after the processing of the components is completed, the results are output to the data stack;
the service arrangement module provides an expression to simplify the access of the value in the data stack module, expresses a service processing flow through a service arrangement file, controls the execution sequence of the component instances in the component library module, sets the execution dependent parameters of each component instance in the component library module, and realizes the expression of a service scene;
the resource loading and unloading module comprises a service instance pool, all the service instances are stored in the service instance pool in a centralized mode, after the resource loading and unloading module receives the request, the corresponding service instances are taken out from the service instance pool according to the service marks, and then business processing is carried out through the service instances.
Further, the service in the data stack module adopts a Map structure as the data stack, and the Map object increase and decrease attribute is dynamic increase and decrease.
The data requirement of the Map data stack (key, value) is that the key is a character string and the value is of any type.
Furthermore, the components in the component library module only interact with the data stack module, and no direct relation is generated between the components.
Furthermore, the service arranging module comprises sequential processing, conditional processing, loop processing, Finaily processing, sub-flow nesting and transaction processing functions.
Further, the service instance in the resource loading and unloading module is stored in a service instance pool in a key value MAP mode, the key is a service mark, and the value is the service instance.
The invention has the beneficial effects that: the instantiation of Class is realized based on a bean management mechanism of spring frame, a basic component library and a running base core are provided, the service processing of components and services is defined by a service arrangement file, the loading and unloading of Class instances are triggered by monitoring the updating of the service arrangement configuration file, and the service level hot updating capability without stopping starting is achieved; the method is suitable for online service application, can keep the application service highly available to a certain extent, and reduces the time for stopping and maintaining the application.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a flowchart illustrating application startup of a method and apparatus for hot updating Java software according to an embodiment of the present invention;
FIG. 2 is a flowchart of application data of the method and apparatus for hot update of Java software according to an embodiment of the present invention;
fig. 3 is an Ares hot update diagram of the method and apparatus for hot updating Java software according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present invention.
As shown in fig. 1, a method for hot update of Java software according to an embodiment of the present invention includes the following steps:
s1: the method comprises the steps of application deployment, namely deploying an application framework in a JAVA running virtual machine, importing an application running package containing a required component library and other running resource package class libraries, and after the application runs, no longer loading a new running class library, wherein the application only has one basic kernel;
s2: after the application deployment is completed, adding a new service instance, and issuing a service arrangement resource file to an application resource directory by calling 2 components in the service instance;
s3: checking whether the new service instance in the step S2 is effective or not through client test, and if the new service instance is not effective, reissuing the service arrangement resource file to the application resource directory until the new service instance is effective; otherwise, continuing the next step;
s4: updating the service instances in the S2, and updating the service arrangement resource file to the application resource directory by adjusting the number of the calling components to be 3;
s5: checking whether the service instance in the S4 is updated or not through client test, if the service instance is not updated, updating the service arrangement resource file to the application resource directory again, otherwise, continuing the next step;
s6: uninstalling the service instance in the S4, and deleting the service arrangement resource file of the service instance from the application resource directory;
s7: and through the client test, checking whether the service instance in the S6 exists, if the service does not exist, deleting the service arrangement resource file of the service A from the application resource directory again, and otherwise, ignoring.
As shown in FIG. 3, in one embodiment, in step S1, an ARES frame is selected as the application frame.
In one embodiment, for steps S2 and S4, the components in the component library are implemented by java class, providing independent input and output functions.
As shown in fig. 2, the present invention also discloses a Java software hot update device, which comprises four modules, namely a data stack module, a component library module, a service orchestration module and a resource loading and unloading module;
the data stack module is used in the software updating method, generates data when receiving a data request, and cleans the data after the request processing is finished;
the component library module is used for selecting and matching components according to the application scene requirement, the components are preset in the application, the components in the component library module are connected with the data stack module through interfaces, the components acquire data from the data stack, and after the processing of the components is completed, the results are output to the data stack;
the service arrangement module provides an expression to simplify the access of the value in the data stack module, expresses a service processing flow, controls the execution sequence of the component examples in the component library module and sets the execution dependent parameters of each component example in the component library module through a service arrangement file, and realizes the expression of a service scene;
the resource loading and unloading module comprises a service instance pool, all the service instances are stored in the service instance pool in a centralized mode, after the request is received, the corresponding service instances are taken out from the service instance pool according to the service marks, and then business processing is carried out through the service instances.
In a specific embodiment, a service in a data stack module adopts a Map structure as a data stack, and does not adopt a JavaBean as the data stack, because when the object attribute of the JavaBean changes, the Class resource needs to be updated, and the Map object can dynamically increase or decrease the attribute without updating the Class resource.
Preferably, the data requirements of the Map data stack ("key", value) are that the key be a string and the value be of any type.
Preferably, when the value in the Map data stack is a List object, the value is expressed in a List < Map > manner.
Preferably, when the value in the Map data stack is a common object, the value is expressed by using a Map > List > Map mode.
In a specific embodiment, when the application is required to be stopped and started during the running period of the application, the component library can be selected and configured according to the requirement of an application scene and is preset in the application.
In a specific embodiment, the components in the component library module only interact with the data stack module, and no direct relation is generated between the components, so that a loose coupling design is achieved.
In one embodiment, the service orchestration module includes sequential processing, conditional processing, loop processing, Finaily processing, sub-flow nesting, and transaction processing functions.
In a specific embodiment, the service instance in the resource loading and unloading module is stored in the service instance pool by adopting a key value MAP mode, the key is a service mark, and the value is the service instance.
In order to facilitate understanding of the above-described technical aspects of the present invention, the above-described technical aspects of the present invention will be described in detail below in terms of specific usage.
When the method is used specifically, according to the method and the device for hot updating of Java software, an application framework is deployed in a JAVA running virtual machine, and an application running package which contains a required component library and other running resource package libraries is imported; then adding a new service instance, issuing a service arrangement resource file to an application resource directory by calling 2 components, and checking whether the new service instance is effective or not through client test; then updating the new service instances added in the previous step, adjusting the number of the calling components to be 3, updating the service arrangement resource file to the application resource directory, and checking whether the service instances are updated through client test; and finally, unloading the service instance, deleting the service arrangement resource file of the service instance from the application resource directory, and checking whether the service instance exists through client test. The device according to the method comprises a data stack module, a component library module, a service arrangement module and a resource loading and unloading module, wherein the data stack module is used for adding a new service instance and an update service instance when receiving a data request in the software updating process, generating data, unloading the service instance after the request processing is finished, and cleaning the data; the component library module selects and matches components according to the requirement of an application framework updated by software, the components are preset in the application, the components in the component library module are connected with the data stack module through interfaces, the components acquire data from the data stack, and after the processing of the components is completed, the results are output to the data stack; the service arrangement module provides an expression to simplify the access of the value in the data stack module, expresses a service processing flow, controls the execution sequence of the component examples in the component library module and sets the execution dependent parameters of each component example in the component library module through a service arrangement file, and realizes the expression of a service scene; the resource loading and unloading module comprises a service instance pool, all service instances are stored in the service instance pool in a centralized manner in the software updating process, and after the resource loading and unloading module receives the request, the corresponding service instances are taken out from the service instance pool according to the service marks and then are subjected to service processing through the service instances.
In summary, the Class instantiation of the present invention is realized based on the bean management mechanism of the spring frame, a basic component library and a running base core are provided, the service processing of the components and the services is defined by the service arrangement file, the loading and unloading of the Class instance is triggered by monitoring the update of the service arrangement configuration file, and the service level hot update capability without the stop is achieved.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (8)

1. A method for hot updating Java software is characterized by comprising the following steps:
s1: the method comprises the steps of application deployment, namely deploying an application framework in a Java running virtual machine, importing an application running package containing a required component library and other running resource package class libraries, and after the application runs, not loading a new running class library any more, wherein the application only has one basic kernel;
s2: after the application deployment is completed, adding a new service instance, calling 2 components in the component library module in the service instance, and issuing a service arrangement resource file to an application resource directory;
s3: checking whether the new service instance in the step S2 is effective or not through client test, and if the new service instance is not effective, reissuing the service arrangement resource file to the application resource directory until the new service instance is effective; otherwise, continuing the next step;
s4: updating the service instances in the S2, and updating the service arrangement resource file to the application resource directory by adjusting the number of the calling components in the component library module to be 3;
s5: checking whether the service instance in the S4 is updated or not through client test, if the service instance is not updated, updating the service arrangement resource file to the application resource directory again, otherwise, continuing the next step;
s6: uninstalling the service instance in the S4, and deleting the service arrangement resource file of the service instance from the application resource directory;
s7: and through the client test, checking whether the service instance in the S6 exists, if the service does not exist, deleting the service arrangement resource file of the service A from the application resource directory again, and otherwise, ignoring.
2. The method for hot updating of Java software according to claim 1, wherein for step S2 and step S4, each component in the component library is implemented by Java class, and provides independent input and output functions.
3. A device for hot updating Java software is characterized by comprising a data stack module, a component library module, a service arrangement module and a resource loading and unloading module;
the data stack module is used in a software updating method, generates data when receiving a data request, and cleans the data after the request processing is finished;
the component library module is used for selecting and matching components according to the application scene requirement, and presetting the components into an application, wherein the components in the component library module are connected with the data stack module through an interface, the components acquire data from the data stack, and after the processing of the components is completed, the results are output to the data stack;
the service arrangement module provides an expression to simplify the access of the value in the data stack module, expresses a service processing flow through a service arrangement file, controls the execution sequence of the component instances in the component library module, sets the execution dependent parameters of each component instance in the component library module, and realizes the expression of a service scene;
the resource loading and unloading module comprises a service instance pool, all the service instances are stored in the service instance pool in a centralized mode, after the request is received, the corresponding service instances are taken out from the service instance pool according to the service marks, and then business processing is carried out through the service instances.
4. The apparatus for hot updating Java software according to claim 3, wherein the service in the data stack module adopts a Map structure as a data stack, and the Map object increase and decrease attribute is dynamic increase and decrease.
5. The apparatus for hot updating Java software according to claim 4, wherein the data requirement of the Map data stack ("key", value) is that the key is a character string and the value is of any type.
6. The device for hot updating of Java software according to claim 3, wherein the components in the component library module only interact with the data stack module, and no direct relationship is generated between the components.
7. The apparatus for hot update of Java software according to claim 3, wherein the service orchestration module comprises sequential processing, conditional processing, loop processing, Finally processing, sub-flow nesting, and transaction processing functions.
8. The apparatus according to claim 3, wherein the service instances in the resource handling module are stored in the service instance pool by using a MAP with key values, the key is a service label, and the value is a service instance.
CN202010221271.5A 2020-03-26 2020-03-26 Method and device for hot updating of Java software Pending CN111381856A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010221271.5A CN111381856A (en) 2020-03-26 2020-03-26 Method and device for hot updating of Java software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010221271.5A CN111381856A (en) 2020-03-26 2020-03-26 Method and device for hot updating of Java software

Publications (1)

Publication Number Publication Date
CN111381856A true CN111381856A (en) 2020-07-07

Family

ID=71221824

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010221271.5A Pending CN111381856A (en) 2020-03-26 2020-03-26 Method and device for hot updating of Java software

Country Status (1)

Country Link
CN (1) CN111381856A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2246782A1 (en) * 2009-04-30 2010-11-03 Sap Ag Application modification framework
US20140289713A1 (en) * 2009-08-28 2014-09-25 Stacy T. Young Dynamic Media Content Instantiation Framework
CN106708547A (en) * 2015-11-12 2017-05-24 卓望数码技术(深圳)有限公司 Service plug-in management method and system
CN106844793A (en) * 2017-04-12 2017-06-13 环球大数据科技有限公司 Management method, the apparatus and system of example service
CN108089873A (en) * 2017-12-21 2018-05-29 福建天泉教育科技有限公司 A kind of method and terminal of application component immediate updating
CN110221820A (en) * 2019-04-23 2019-09-10 平安科技(深圳)有限公司 The general type of spring frame relies on method for implanting, device and computer equipment, storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2246782A1 (en) * 2009-04-30 2010-11-03 Sap Ag Application modification framework
US20140289713A1 (en) * 2009-08-28 2014-09-25 Stacy T. Young Dynamic Media Content Instantiation Framework
CN106708547A (en) * 2015-11-12 2017-05-24 卓望数码技术(深圳)有限公司 Service plug-in management method and system
CN106844793A (en) * 2017-04-12 2017-06-13 环球大数据科技有限公司 Management method, the apparatus and system of example service
CN108089873A (en) * 2017-12-21 2018-05-29 福建天泉教育科技有限公司 A kind of method and terminal of application component immediate updating
CN110221820A (en) * 2019-04-23 2019-09-10 平安科技(深圳)有限公司 The general type of spring frame relies on method for implanting, device and computer equipment, storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈永政, 西安电子科技大学出版社 *

Similar Documents

Publication Publication Date Title
WO2022016848A1 (en) Method and apparatus for performing application deployment according to service role
US8707283B2 (en) Parallel DLL tree initialization
CN106686420A (en) Live streaming application program management method and apparatus
CN102262555B (en) Method and device for loading different versions of JAVA three-party library
CN107239313A (en) The upgrade method and storage medium of Spring application services
US20120089571A1 (en) Computer process management
CN109240733A (en) A kind of method and terminal updating advertisement SDK based on Android system
CN101221498B (en) System and method for managing service modules
CN116560801B (en) Cross-container counter system credit migration method and equipment
US9336027B2 (en) System and method for modular business applications
US8260850B2 (en) Thin-client and distributed development using data programming
CN111381856A (en) Method and device for hot updating of Java software
US20220326939A1 (en) Mobile service upgrade method and apparatus, and terminal
CN100428151C (en) C/C++ module hot plug-in and pull-off method of base version in large scale concurrent on-line trade
JP2000259417A (en) Device and method for data processing and program providing medium
CN113867776A (en) Method and device for publishing middle station application, electronic equipment and storage medium
US7191443B2 (en) Digital device, task management method and program therefor
US7900217B2 (en) Dynamic DLL cycle resolution
KR101083090B1 (en) Mobile terminal with mobile platform comprising structure of functional modularization, method for driving the mobile platform and managing idle application
CN111752635A (en) Application program running method and device, computer equipment and storage medium
US20030212770A1 (en) System and method of controlling software components
JP2010536101A (en) Coroutine interface for user customization of SIP and SDP protocols
CN115988066A (en) Self-adaptive access method and system for non-invasive heterogeneous micro-service framework
CN115729526A (en) Monomer and micro-service integrated software development method
CN116954678A (en) Object updating method, device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination