CN115357277A - Hot update method, device, electronic apparatus, storage medium and program product - Google Patents

Hot update method, device, electronic apparatus, storage medium and program product Download PDF

Info

Publication number
CN115357277A
CN115357277A CN202210870672.2A CN202210870672A CN115357277A CN 115357277 A CN115357277 A CN 115357277A CN 202210870672 A CN202210870672 A CN 202210870672A CN 115357277 A CN115357277 A CN 115357277A
Authority
CN
China
Prior art keywords
updated
update
resource
folder
class
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
CN202210870672.2A
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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202210870672.2A priority Critical patent/CN115357277A/en
Publication of CN115357277A publication Critical patent/CN115357277A/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
    • G06F8/656Updates while running
    • 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/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • 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/445Program loading or initiating
    • G06F9/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for loading

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 Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present disclosure relates to a hot update method, apparatus, electronic device, storage medium, and program product, the method comprising: in the running process of the target process, determining a storage area of a loading resource of a class loader of the target process; establishing an update folder in a storage area, and modifying a class loading path of a class loader to obtain a class loading path which points to the update folder most preferentially; storing the updated resource into an updated folder, wherein the updated resource is a replacement item of the resource to be updated in other paths pointed by the class loading path; and under the condition that the resources to be updated need to be loaded, preferentially loading the updated resources from the update folder according to the priority of each path pointed by the class loading path, thereby realizing the hot update of the resources to be updated of the target process. The method and the device establish an update folder with a class loading path pointing to the highest priority, and when the resources to be updated need to be loaded, the replacement items of the resources to be updated are loaded in the update folder in the priority, so that the hot update of the target process is realized.

Description

Hot update method, device, electronic apparatus, storage medium and program product
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a hot update method, an apparatus, an electronic device, a storage medium, and a program product.
Background
Java is a program language for compiled execution, in which each framework loads resources through a ClassLoader (class loader). In the related art, in order to implement hot update on the target process, the resource required by the target process is directly replaced, so that the ClassLoader can load the replaced resource when loading the resource.
However, directly replacing the resources required by the target process has the following problems: if a resource to be replaced exists in a plurality of paths with different priorities pointed by a ClassPath (class loading path), and only the resource in the path with lower priority is replaced, the resource which is not replaced in the path with higher priority is loaded when the resource is loaded, so that the hot update of the target process is not effective. Therefore, a hot refresh method that can be guaranteed to be effective is urgently needed.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a hot update method, apparatus, electronic device, storage medium, and program product. The technical scheme of the disclosure is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided a thermal update method, including:
in the running process of a target process, determining a storage area of a loading resource of a class loader of the target process;
establishing an update folder in the storage area, and modifying a class loading path of the class loader to obtain the class loading path which points to the update folder with the highest priority;
storing an updated resource to the update folder, wherein the updated resource is a replacement item of a resource to be updated in other paths pointed by the class loading path;
and preferentially loading the updated resources from the update folder according to the priority of each path pointed by the class loading path under the condition that the resources to be updated need to be loaded, so as to realize the hot update of the resources to be updated of the target process.
Optionally, the updated resource and the resource to be updated have the same name, the resource to be updated is stored in other folders or jar packages pointed by the class loading path, and the priorities of the other folders and the jar packages are lower than the priority of the updated folder;
the preferentially loading the updated resource from the update folder to realize the hot update of the resource to be updated of the target process comprises the following steps:
preferentially loading the updated resources in the updated folder according to the names of the resources to be updated, and replacing the resources to be updated with the loaded updated resources to run the target process.
Optionally, the method further comprises:
deleting the update resource in the update folder in a case where a restoration to a state before a hot update is required.
Optionally, the method further comprises:
and in the case of needing to be restored to the state before the hot update, deleting the update folder and restoring the class loading path of the class loader.
Optionally, the storing the updated resource to the update folder includes:
receiving the updated resource sent by a remote server;
storing the updated resource to the update folder.
Optionally, the modifying the class loading path of the class loader to obtain the class loading path that points to the update folder with the highest priority includes:
and adding the name of the update folder in front of the array of the class loading path of the class loader to obtain the class loading path of which the first bit of the array is the name of the update folder.
According to a second aspect of an embodiment of the present disclosure, there is provided a hot-update apparatus including:
the storage area determining module is configured to determine a storage area of a loading resource of a class loader of a target process in the running process of the target process;
the folder establishing module is configured to establish an updating folder in the storage area, modify a class loading path of the class loader and enable the class loading path to preferentially point to the updating folder;
and the update resource storage module is configured to store the update resource to the update folder, so that the class loader loads the update resource from the update folder to realize hot update of the target process.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the hot update method as described in the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions, when executed by a processor of an electronic device, enable the electronic device to perform the hot update method according to the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the hot update method according to the first aspect.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
in the method, in the running process of the target process, the update folder is directly established in the storage area of the loading resource of the class loader of the target process, the class loading path of the class loader is modified, the class loading path which points to the update folder in the highest priority is obtained, the update resource is stored into the update folder, and the update resource is a replacement item of the resource to be updated in other paths which point to the class loading path. Because the class loader loads the resources according to the priority of each path pointed by the class loading path, and the update folder is the folder pointed by the class loading path in the highest priority, when loads the resources to be updated through the class loader, the resources to be updated are loaded in the update folder preferentially, and the resources to be updated which are not updated are not loaded from the paths with lower priority, so that the situation that the resources to be updated exist in a plurality of paths, only the resources to be updated in the paths with lower priority are updated, and the resources which are not updated and loaded in the paths with higher priority cause ineffective update is avoided, and the hot update of the target process can be effective.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flow chart illustrating a method of hot-updating in accordance with an exemplary embodiment;
FIG. 2 is a diagram illustrating class load paths pointing to arrays in the related art;
FIG. 3 is a schematic diagram illustrating a modified class load path pointing to multiple arrays in accordance with an illustrative embodiment;
FIG. 4 is a diagram illustrating remote transmission of an update resource in accordance with an illustrative embodiment;
FIG. 5 is a block diagram illustrating a thermal update apparatus according to an exemplary embodiment;
FIG. 6 is a block diagram illustrating an apparatus for hot updates, according to an example embodiment;
FIG. 7 is a block diagram illustrating an apparatus for hot updating according to an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
FIG. 1 is a flow chart illustrating a thermal update method according to an exemplary embodiment, which includes the following steps, as shown in FIG. 1.
In step S11, during the running process of the target process, a storage area of the load resource of the class loader of the target process is determined.
The target process may be a Java process and the resources required by the target process are resources loaded by the class loader. To perform a hot update on the target process, an update folder may be created directly in the storage area of the load resource of the class loader of the target process. To do this, first the storage area of the load resource of the class loader of the target process needs to be determined.
In step S12, an update folder is established in the storage area, and a class loading path of the class loader is modified, so as to obtain the class loading path that points to the update folder with highest priority.
The storage area of the target process's class loader load resource is specified by the class load path. The multiple folders or jar packages (a document format of Java) pointed by the class loading path have different priorities, and when the class loader loads a resource from a folder or jar package with a higher priority, the resource will not be loaded from other folders or jar packages with a lower priority any more. If only the resources in the folder or jar package with the lower priority are replaced, but the resources in the folder or jar package with the higher priority are not replaced, the resources which are not replaced are loaded from the folder or jar package with the higher priority preferentially, and therefore the updating is not effective. Therefore, in order to validate the update, the update folder needs to be set to the folder to which the class load path is most preferentially directed.
The class loading path of the class loader can be modified to point to the update folder in the highest priority. The class loading path is an array, the elements in the array comprise names of folders or jar, and the sequence of the elements in the array indicates the priority level of the folder or jar packet pointed by the class loading path. Therefore, the name of the update folder can be added in front of the array of the class loading path of the class loader through a reflection technology, so that the first bit of the array of the class loading path is the name of the update folder, and thus, the folder or jar package pointed by the class loading path with the highest priority is the update folder.
FIG. 2 is a diagram illustrating a related art class loading path pointing to a plurality of arrays, wherein each array represents a folder or a jar package, and priorities between the arrays decrease sequentially from left to right. FIG. 3 is a diagram illustrating a modified class load path pointing to multiple arrays in accordance with an illustrative embodiment. Each array represents a folder or a jar package, the priority among the arrays is sequentially reduced from left to right, the updating folder is positioned at the leftmost side and has the highest priority, and the first position of the modified class loading path points to the updating folder.
The name of the update folder is directly added in front of the array of the class loading path of the class loader, so that the modification of the class loading path can be completed relatively simply.
Optionally, modification of the class load path may also be implemented by modifying the underlying logic code.
In step S13, an updated resource is stored in the update folder, where the updated resource is a replacement of a resource to be updated in another path pointed by the class loading path.
And under the condition that the class loading path of the class loader preferentially points to the updating folder, storing the updating resource into the updating folder. The updated resource is a replacement item of the resource to be updated which is originally stored in other folders or jar packages pointed by the class loading path of the class loader and needs to be replaced. And under the condition that the class loader is loaded to the updated resource from the update folder preferentially, the resource to be updated is not loaded from other folders or jar packages any more. Therefore, by loading the updated resource, the original resource to be updated loaded is updated, and the target process is updated thermally.
In step S14, when the resource to be updated needs to be loaded, the updated resource is preferentially loaded from the update folder according to the priority of each path pointed by the class loading path, so as to implement hot update on the resource to be updated of the target process.
Because the newly established update folder is the path to which the class loading path points most preferentially, when the resources to be updated need to be loaded, according to the priority of each path to which the class loading path points, the updated resources are preferentially read from the update folder, and the resources to be updated are not continuously read from other paths, so that the process of updating the resources to be updated by using the updated resources is realized.
The resource to be updated is the resource required by the target process in the execution process, so that the target process also realizes corresponding hot updating under the condition that the resource to be updated loaded by the class loader of the target process becomes the updated resource.
By adopting the technical scheme of the embodiment of the disclosure, in the running process of the target process, the update folder is directly established in the storage area of the loading resource of the class loader of the target process, the class loading path of the class loader is modified, the class loading path which points to the update folder in the highest priority is obtained, the update resource is stored in the update folder, and the update resource is a replacement item of the resource to be updated in other paths pointed by the class loading path. Because the class loader loads the resources according to the priority of each path pointed by the class loading path, and the update folder is the folder to which the class loading path points most preferentially, when the loads the resources to be updated through the class loader, the resources to be updated are preferentially loaded in the update folder, and the resources to be updated which are not updated are not loaded from the paths with lower priority, so that the situation that the resources to be updated exist in a plurality of paths, only the resources to be updated in the paths with lower priority are updated, and the resources which are not updated and loaded in the paths with higher priority cause ineffective update is avoided, and the thermal update of the target process can be effective.
Optionally, in order to enable the class loader to load the updated resource when loading the resource to be updated, the updated resource and the resource to be updated may have the same name. The resources to be updated are the resources originally loaded by the class loader before the target process is updated, and the hot update is to load the updated resources so that the target process does not load the original resources to be updated any more. And storing the resource to be updated in other folders or jar packages pointed by the class loading path of the class loader, wherein the priority of the other folders and jar packages is lower than that of the update folder.
And when the class loader needs to load the resources to be updated, searching the names of the resources to be updated in the folders or jar packages pointed by the class loading path in sequence according to the sequence from high priority to low priority. Because the priority of the update folder is highest, and the update resources in the update folder and the resources to be updated have the same name, the class loader searches the update resources from the update folder, so that the resources to be updated are not continuously searched from other folders or jar packages, and the target process is directly operated according to the update resources, thereby realizing the hot update of the target process.
In order to replace the resource to be updated stored in the jar packet (delete the resource to be updated in the jar packet and store the updated resource in the jar packet), the related art cannot directly replace the resource to be updated stored in the jar packet. By adopting the technical scheme of the embodiment of the disclosure, the resource to be updated in the jar package does not need to be deleted and stored in the jar package, and the resource to be updated can be replaced only by storing the updated resource in the update folder. In addition, no matter whether the resources to be updated are stored in the folder or the jar package, the replacement of the resources to be updated can be realized under the condition that the original resources to be updated are not deleted, so that the state before the hot update can be conveniently recovered.
Optionally, sometimes, the hot update is only to test the target process, and after the test is completed, the target process may need to be restored to the state before the hot update; or the target process after the hot update has an error, the target process also needs to be restored to the state before the hot update.
In the case where the target process needs to be restored to the state before the hot update, the update resource in the update folder may be directly deleted. Because the updated resources in the update folder have been deleted, the class loader cannot search for the updated resources in the update folder, but can only continue to search for resources to be updated from other folders or jar packages. Because the resource to be updated is not deleted, the target process can be operated according to the searched resource to be updated, so that the target process is restored to the state before the hot update, and the target process is restored to the state before the hot update.
Thus, the target process can be restored to the state before the hot update only by simple deletion operation.
Optionally, in a case that the target process needs to be restored to the state before the hot update, the entire update folder may also be directly deleted, and the class loading path of the class loader is restored. Deleting the whole updating folder, and deleting the updating resources in the updating folder. And at the same time, restoring the class loading path of the class loader, so that the class loader searches resources to be updated in other folders or jar packages according to the previous class loading path.
Therefore, when more than one update resource is needed, the target process can be restored to the state before the hot update by directly deleting the whole update folder without deleting the plurality of update resources in the update folder one by one, and the method is more convenient and quicker.
Optionally, on the basis of the above technical solution, the update resource may be sent by the remote server to the target machine where the target process is located, and the update resource is stored in the update folder.
FIG. 4 is a diagram illustrating remote transmission of update resources with a development environment to the left of the dashed line and a test environment to the right of the dashed line, where both the development environment and the test environment are remote with respect to each other, according to an example embodiment.
Accordingly, the operations of establishing an update folder, modifying a class loading path of a class loader, deleting an update resource, deleting an update folder, and the like, may be implemented through remote operations.
In this way, remote hot update of the target process can be achieved, and the remote hot update has a wide application scenario, for example, a game developer performs hot update on a game application installed on a player client.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Fig. 5 is a block diagram illustrating a hot update apparatus according to an exemplary embodiment, and referring to fig. 5, the apparatus includes a storage area determination module 51, a folder establishment module 52, a resource storage module 53, and a resource loading module 54.
The storage area determining module 51 is configured to determine, during running of a target process, a storage area of a load resource of a class loader of the target process;
the folder establishing module 52 is configured to establish an update folder in the storage area, and modify a class loading path of the class loader to obtain the class loading path which points to the update folder with the highest priority;
the resource storage module 53 is configured to store an updated resource to the update folder, where the updated resource is a replacement item of a resource to be updated in another path pointed by the class loading path;
the resource loading module 54 is configured to, when the resource to be updated needs to be loaded, preferentially load the updated resource from the update folder according to the priority of each path pointed by the class loading path, so as to implement hot update on the resource to be updated of the target process.
Optionally, the updated resource and the resource to be updated have the same name, the resource to be updated is stored in other folders or jar packages pointed by the class loading path, and the priorities of the other folders and the jar packages are lower than the priority of the updated folder;
the resource loading module 54 includes:
and the resource loading unit is configured to preferentially load the updated resources in the update folder according to the names of the resources to be updated, and to operate the target process according to the loaded updated resources instead of the resources to be updated.
Optionally, the method further comprises:
a first deletion module configured to delete the update resource in the update folder if a recovery to a state before a hot update is required.
Optionally, the method further comprises:
and the second deleting module is configured to delete the update folder and restore the class loading path of the class loader under the condition that the state before the hot update needs to be recovered.
Optionally, the resource storage module 53 includes:
a receiving unit configured to receive the updated resource transmitted by a remote server;
a storage unit configured to store the update resource to the update folder.
Optionally, the folder establishing module 52 includes:
a path modifying unit configured to add the name of the update folder in front of a tuple of a class loading path of the class loader, and obtain the class loading path of which the first bit of the tuple is the name of the update folder.
With regard to the apparatus in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
FIG. 6 is a block diagram illustrating an apparatus for hot updating according to an example embodiment. For example, the apparatus 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 6, apparatus 600 may include one or more of the following components: a processing component 602, a memory 604, a power component 606, a multimedia component 608, an audio component 610, an interface to input/output (I/O) 612, a sensor component 614, and a communication component 616.
The processing component 602 generally controls overall operation of the device 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 602 may include one or more processors 620 to execute instructions to perform all or a portion of the steps of the above-described thermal update method. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is configured to store various types of data to support operations at the apparatus 600. Examples of such data include instructions for any application or method operating on device 600, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 604 may be implemented by any type or combination of volatile and non-volatile storage devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power supply component 606 provides power to the various components of device 600. The power components 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 600.
The multimedia component 608 includes a screen that provides an output interface between the device 600 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 600 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 610 is configured to output and/or input audio signals. For example, audio component 610 includes a Microphone (MIC) configured to receive external audio signals when apparatus 600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 further includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 614 includes one or more sensors for providing status assessment of various aspects of the apparatus 600. For example, the sensor component 614 may detect an open/closed state of the device 600, the relative positioning of components, such as a display and keypad of the device 600, the sensor component 614 may also detect a change in position of the device 600 or a component of the device 600, the presence or absence of user contact with the device 600, orientation or acceleration/deceleration of the device 600, and a change in temperature of the device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 616 is configured to facilitate communications between the apparatus 600 and other devices in a wired or wireless manner. The apparatus 600 may access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described thermal update methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 604 comprising instructions, executable by the processor 620 of the apparatus 600 to perform the above-described thermal update method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
FIG. 7 is a block diagram illustrating an apparatus for hot updating according to an example embodiment. For example, the apparatus 700 may be provided as a server. Referring to fig. 7, apparatus 700 includes a processing component 722 that further includes one or more processors and memory resources, represented by memory 732, for storing instructions, e.g., a computer program product, that are executable by processing component 722. The computer program product stored in memory 732 may include one or more modules that each correspond to a set of instructions. Further, the processing component 722 is configured to execute instructions to perform the above-described hot update method.
The apparatus 700 may also include a power component 726 configured to perform power management of the apparatus 700, a wired or wireless network interface 750 configured to connect the apparatus 700 to a network, and an input output (I/O) interface 758. The apparatus 700 may operate based on an operating system stored in memory 732, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A method of thermal renewal, comprising:
in the running process of a target process, determining a storage area of a loading resource of a class loader of the target process;
establishing an updating folder in the storage area, and modifying a class loading path of the class loader to obtain the class loading path which points to the updating folder most preferentially;
storing an updated resource to the update folder, wherein the updated resource is a replacement item of a resource to be updated in other paths pointed by the class loading path;
and preferentially loading the updated resources from the update folder according to the priority of each path pointed by the class loading path under the condition that the resources to be updated need to be loaded, so as to realize the hot update of the resources to be updated of the target process.
2. The method according to claim 1, wherein the updated resource has the same name as the resource to be updated, the resource to be updated is stored in other folders or jar packages pointed by the class loading path, and the priority of the other folders and the priority of the jar packages are lower than that of the updated folder;
the preferentially loading the updated resource from the update folder to realize the hot update of the resource to be updated of the target process comprises the following steps:
preferentially loading the updated resources in the updated folder according to the names of the resources to be updated, and replacing the resources to be updated with the loaded updated resources to run the target process.
3. The method of claim 1, further comprising:
deleting the update resource in the update folder in a case where a restoration to a state before a hot update is required.
4. The method of claim 1, further comprising:
and in the case of needing to restore the state before the hot update, deleting the update folder and restoring the class loading path of the class loader.
5. The method of claim 1, wherein storing the updated resource to the update folder comprises:
receiving the updated resource sent by a remote server;
storing the updated resource to the update folder.
6. The method of claim 1, wherein the modifying the class loading path of the class loader to obtain the class loading path that points to the update folder with the highest priority comprises:
and adding the name of the update folder in front of the array of the class loading path of the class loader to obtain the class loading path of which the first bit of the array is the name of the update folder.
7. A thermal update apparatus, comprising:
the storage area determining module is configured to determine a storage area of a loading resource of a class loader of a target process in the running process of the target process;
the folder establishing module is configured to establish an update folder in the storage area, modify a class loading path of the class loader and obtain the class loading path which points to the update folder with highest priority;
a resource storage module configured to store an updated resource to the update folder, where the updated resource is a replacement item of a resource to be updated in another path to which the class loading path points;
and the resource loading module is configured to preferentially load the updated resources from the update folder according to the priority of each path pointed by the class loading path under the condition that the resources to be updated need to be loaded, so as to realize the hot update of the resources to be updated of the target process.
8. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the thermal update method of any one of claims 1 to 6.
9. A computer-readable storage medium whose instructions, when executed by a processor of an electronic device, enable the electronic device to perform the thermal update method of any of claims 1-6.
10. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the thermal update method of any one of claims 1 to 6.
CN202210870672.2A 2022-07-22 2022-07-22 Hot update method, device, electronic apparatus, storage medium and program product Pending CN115357277A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210870672.2A CN115357277A (en) 2022-07-22 2022-07-22 Hot update method, device, electronic apparatus, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210870672.2A CN115357277A (en) 2022-07-22 2022-07-22 Hot update method, device, electronic apparatus, storage medium and program product

Publications (1)

Publication Number Publication Date
CN115357277A true CN115357277A (en) 2022-11-18

Family

ID=84032272

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210870672.2A Pending CN115357277A (en) 2022-07-22 2022-07-22 Hot update method, device, electronic apparatus, storage medium and program product

Country Status (1)

Country Link
CN (1) CN115357277A (en)

Similar Documents

Publication Publication Date Title
CN111221559B (en) Application updating method, device, storage medium, terminal and server
CN112003893B (en) Resource downloading method and device
KR20160089329A (en) Method, device and terminal for restoring firmware program
CN113076504B (en) Skeleton screen generation method, device, equipment and storage medium
CN107463372B (en) Data-driven page updating method and device
US20160006787A1 (en) Methods and devices for visiting a webpage
CN109522286B (en) Processing method and device of file system
CN111221613A (en) Program calling method and device and storage medium
CN108427568B (en) User interface updating method and device
CN111290882B (en) Data file backup method, data file backup device and electronic equipment
CN115357277A (en) Hot update method, device, electronic apparatus, storage medium and program product
CN108549570B (en) User interface updating method and device
CN107257384B (en) Service state monitoring method and device
CN114077461A (en) Application program running method, device, equipment and storage medium
CN107463414B (en) Application installation method and device
CN111045701A (en) Version switching method and device and version switching device
CN111104110A (en) Global style sharing method, global style sharing device and electronic device
CN111625251B (en) Method and device for processing application instance
CN112083981A (en) Method and device for creating page view component
CN113360341B (en) Front-end application maintenance and loading method and device
CN114416084B (en) Data processing method and device, electronic equipment and storage medium
CN116126320B (en) Data processing method and device, electronic equipment and storage medium
CN113946346B (en) Data processing method and device, electronic equipment and storage medium
CN110311968B (en) Method and device for loading file in streaming mode and intelligent equipment
CN110659081B (en) File processing method and device for program object and electronic equipment

Legal Events

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