Application hot updating method and device, equipment and storage medium

By automatically filtering loaded programming modules of Python applications based on startup time and file modification time, efficient hot updates are achieved, solving the inefficiency problem caused by manual filtering. This is suitable for hot updates of applications on terminal devices and servers.

CN114064092BActive Publication Date: 2025-11-04NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111637490.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2025-11-04
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

In existing technologies, hot updates for Python applications require manual selection of programming modules that need to be hot-updated, resulting in low efficiency.

Method used

By obtaining the loaded programming modules of the application, and based on the relationship between startup time and file modification time, the programming modules that need to be hot-updated are automatically determined and added to the set to be updated for hot-updating.

Benefits of technology

It enables automatic selection of programming modules that need to be hot-updated, improving hot-updation efficiency, reducing hot-updation time, and expanding the scope of application, including hot-updating of special programming modules such as metaclasses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114064092B_ABST
    Figure CN114064092B_ABST
Patent Text Reader

Abstract

The application provides an application program hot updating method and device, equipment and storage medium, and relates to the technical field of data processing. The application program hot updating method comprises the following steps: acquiring loaded programming modules of an application program; determining, according to the starting time of the application program and the file modification time of each programming module in the application program, a programming module, which satisfies a preset condition in the size relationship between the file modification time and the starting time, as a first target programming module from the loaded programming modules; adding the first target programming module to a programming module set to be updated; and performing hot updating on each target programming module according to the code files of each target programming module in the programming module set to be updated. The first target programming module is a programming module that needs to be hot updated, the programming module that needs to be hot updated is automatically determined, the programming module that needs to be hot updated can be efficiently screened out, and the efficiency of hot updating of the programming modules in the application program is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, in particular to an application program hot updating method and device, equipment and storage medium. BACKGROUND

[0002] The hot updating technology refers to a method of updating the code or data in an application program in the process of running the application program without restarting the application program, so as to make the updated code and data effective. Due to its convenient and fast characteristics, the hot updating technology is widely used in online projects and development and production environments.

[0003] In the related art, for a python (a computer programming language) application program, a programming module that needs to be hot updated is manually screened and confirmed, the programming module can include code and data, the programming module that needs to be hot updated is popped out, and then imported again to realize hot updating of the application program.

[0004] However, in the related art, the programming module that needs to be hot updated needs to be manually screened, which reduces the efficiency of hot updating of the application program. SUMMARY

[0005] The present application aims to solve the problem that in the related art, the programming module that needs to be hot updated needs to be manually screened, which reduces the efficiency of hot updating of the application program.

[0006] To achieve the above-mentioned purpose, the technical solutions adopted by the embodiments of the present application are as follows:

[0007] In a first aspect, the embodiments of the present application provide an application program hot updating method, which comprises:

[0008] Obtaining loaded programming modules of an application program;

[0009] According to the start time of the application program and the file modification time of each programming module in the application program, determining, from the loaded programming modules, a programming module whose size relationship between the file modification time and the start time meets a preset condition as a first target programming module;

[0010] Adding the first target programming module to a programming module set to be updated;

[0011] According to the code files of each target programming module in the programming module set to be updated, hot updating the target programming modules.

[0012] Optionally, the method further comprises:

[0013] Optionally, the method further comprises:

[0014] Optionally, the method further comprises:

[0015] calculating a target time according to the start time of the application program and a preset tolerance time;

[0016] Optionally, the method further comprises:

[0017] Optionally, the method further comprises:

[0018] calculating the target time according to a difference between the start time and the preset tolerance time.

[0019] Optionally, the method further comprises:

[0020] determining a programming module registered in the application program and using a meta class as a second target programming module;

[0021] adding the second target programming module to the set of programming modules to be updated.

[0022] Optionally, the method further comprises:

[0023] deleting the target programming modules from a system module list of the application program;

[0024] re-importing code files of the target programming modules to reload the target programming modules.

[0025] Optionally, after the hot update of the target programming modules according to the code files of the target programming modules in the set of programming modules to be updated, the method further comprises:

[0026] resetting the start time of the application program to the current time.

[0027] In a second aspect, the embodiments of the present application further provide an application program hot update device, the device comprising:

[0028] an obtaining module, configured to obtain loaded programming modules of an application program;

[0029] a determining module, configured to determine, according to a start time of the application program and file modification times of programming modules in the application program, a programming module with a size relationship between the file modification time and the start time meeting a preset condition as a first target programming module from the loaded programming modules;

[0030] an adding module, configured to add the first target programming module to a set of programming modules to be updated;

[0031] a hot updating module, configured to perform hot update on target programming modules according to code files of the target programming modules in the set of programming modules to be updated.

[0032] Optionally, the determining module is further configured to determine, according to the start time and the file modification times of the programming modules, a programming module with a file modification time exceeding the start time as the first target programming module from the loaded programming modules.

[0033] Optionally, the determining module is further configured to calculate a target time according to the start time of the application program and a preset tolerance time, and determine a programming module with a file modification time exceeding the target time as the first target programming module from the loaded programming modules.

[0034] Optionally, the determining module is further configured to calculate the target time according to a difference between the start time and the preset tolerance time.

[0035] Optionally, the device further comprises:

[0036] a first determining module, configured to determine a programming module registered in the application program and using a meta class as a second target programming module;

[0037] an adding module, configured to add the second target programming module to the set of programming modules to be updated.

[0038] Optionally, the hot update module is further configured to delete the target programming modules from a system module list of the application program; and re-import code files of the target programming modules to reload the target programming modules.

[0039] Optionally, the apparatus further comprises:

[0040] a reset module configured to reset a start time of the application program to a current time.

[0041] In a third aspect, an embodiment of the present application further provides an apparatus for processing, comprising a memory and a processor, the memory stores a computer program executable by the processor, and the processor implements the application program hot update method according to any one of the first aspect when executing the computer program.

[0042] In a fourth aspect, an embodiment of the present application further provides a storage medium, the storage medium stores a computer program, and the computer program is read and executed to implement the application program hot update method according to any one of the first aspect.

[0043] The application has the beneficial effects that: in summary, the application provides an application program hot update method, comprising: obtaining loaded programming modules of an application program; determining, according to a start time of the application program and file modification times of the programming modules in the application program, a programming module whose size relationship between the file modification time and the start time meets a preset condition from the loaded programming modules as a first target programming module; adding the first target programming module to a programming module set to be updated; and performing hot update on the target programming modules according to code files of the target programming modules in the programming module set to be updated. The first target programming module, which is determined according to the size relationship between the file modification time and the start time, is a programming module that needs to be hot updated, and the application program hot update method automatically determines the programming module that needs to be hot updated, efficiently screens the programming module that needs to be hot updated, and improves the efficiency of hot updating the programming modules in the application program. BRIEF DESCRIPTION OF DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some of the embodiments of the present application, and therefore should not be considered as a limitation to the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.

[0045] Figure 1A flowchart of an application program hot updating method provided by an embodiment of the present application is shown in FIG. 1.

[0046] Figure 2 A flowchart of an application program hot updating method provided by an embodiment of the present application is shown in FIG. 1.

[0047] Figure 3 A flowchart of an application program hot updating method provided by an embodiment of the present application is shown in FIG. 1.

[0048] Figure 4 A flowchart of an application program hot updating method provided by an embodiment of the present application is shown in FIG. 1.

[0049] Figure 5 A structural diagram of an application program hot updating device provided by an embodiment of the present application is shown in FIG. 1.

[0050] Figure 6 A structural diagram of a processing device provided by an embodiment of the present application is shown in FIG. 1. DETAILED DESCRIPTION

[0051] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application.

[0052] Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative labor are within the scope of protection of the present application.

[0053] In the description of the present application, it should be noted that if the terms "upper", "lower", etc. indicate the orientation or position relationship shown in the drawings, or the orientation or position relationship of the product in use, only for the convenience of describing the present application and simplifying the description, and it does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation, therefore it cannot be understood as a limitation on the present application.

[0054] In addition, the terms "first", "second", and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a particular sequential or chronological order. It should be understood that the data thus used can be interchanged under appropriate circumstances to enable the embodiments of the application described herein to be implemented in other than the order illustrated or described herein. Furthermore, the terms "comprise" and "have", and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a list of steps or units is not necessarily limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to such processes, methods, products, or apparatus.

[0055] It should be noted that the features in the embodiments of the present application can be combined with each other without conflict.

[0056] The following first explains the terms involved in the embodiments of the present application.

[0057] Python: a programming language, which is often used in game script language.

[0058] Hot update: a method of updating the code or data in the application without restarting the application, so that the modified application takes effect.

[0059] C / S architecture: a typical two-layer architecture, which is short for Client (client) / Server (server), i.e. client server architecture.

[0060] Metaclass: metaclass, a programming language feature of Python. By writing code when creating a class, the same features are provided for derived classes.

[0061] IDE: integrated development environment used in program development, such as pycharm, vs code, etc.

[0062] The update method of the application includes normal update and hot update. Normal update needs to restart the application, while hot update technology refers to a method of updating the code or data in the application without restarting the application, so that the updated code and data take effect. Due to the convenient and fast characteristics of hot update, it is widely used in online projects and development and production environments.

[0063] In the related art, for a python application program, a programming module that needs to be hot updated is confirmed by manual screening, the programming module can include code and data, the programming module that needs to be hot updated is popped out and then imported again to realize hot updating of the application program. However, in the related art, the programming module that needs to be hot updated needs to be manually screened, which reduces the efficiency of hot updating of the application program.

[0064] To solve the above technical problems existing in the related art, the embodiment of the present application provides an application program hot updating method, according to the start time of the application program and the file modification time of each programming module in the application program, the programming module whose size relationship between the file modification time and the start time meets a preset condition is determined as a first target programming module from the loaded programming modules, the first target programming module is a programming module that needs to be hot updated, which realizes automatic determination of the programming module that needs to be hot updated, can efficiently screen out the programming module that needs to be hot updated, and further improves the efficiency of hot updating of the programming module in the application program. Moreover, by comparing the start time and the file modification time, the programming module that needs to be hot updated is screened from the loaded modules, which greatly reduces the number of modules that need to be hot updated, thereby further reducing the time consumption of hot updating.

[0065] The execution subject of the application program hot updating method provided by the embodiment of the present application can be a processing device, which can be a terminal, a server, or other devices running an application program and having processing functions, and the embodiment of the present application does not make specific limitations.

[0066] It should be noted that if the processing device is a terminal, the terminal can be any of the following: desktop computer, notebook computer, tablet computer, smart phone, game console, etc.

[0067] The application program hot updating method provided by the embodiment of the present application is explained below with the processing device as the execution subject.

[0068] Figure 1 The flowchart of the application program hot updating method provided by the embodiment of the present application is shown in Figure 1 The method can include:

[0069] S101, obtaining loaded programming modules of an application program.

[0070] The application program can be an application program written in a preset programming language. Optionally, the preset programming language can be python. When the preset programming language is python, a python script file can be regarded as a programming module.

[0071] In some embodiments, the processing device can employ a preset module to obtain the loaded programming modules of the application program. The preset module can be a sys module, which includes a set of very practical services, contains many function methods and variables, and is used to process Python runtime configuration and resources, so as to interact with the system environment outside the previous program.

[0072] Optionally, the obtained loaded programming modules can be stored in a preset list of the preset module. For example, if the preset module is a sys module, the preset list can be sys.modules.

[0073] It should be noted that the modules that have not been loaded during hot updating do not need to be loaded, and are waiting for subsequent on-demand loading. The processing device automatically uses the latest loaded programming modules.

[0074] S102, according to the start time of the application program and the file modification time of each programming module in the application program, determining the programming module whose size relationship between the file modification time and the start time meets the preset condition as the first target programming module from the loaded programming modules.

[0075] Each programming module has a corresponding file, which can record the programming code and data corresponding to the programming module. When the developer needs to modify the programming module, the file corresponding to the programming module can be modified, and each file has a corresponding modification time.

[0076] In some embodiments, the files of each loaded programming module are traversed to determine the size relationship between the file modification time and the start time. If the size relationship between the file modification time and the start time meets the preset condition, the file corresponding to the file modification time is determined, and the loaded programming module corresponding to the file is determined as the first target programming module.

[0077] In the embodiments of the present application, the start time of the application program can be the time when the application program is restarted, or the time when the application program is last hot updated. If the application program has not been hot updated, the start time of the application program can be the time when the application program is restarted.

[0078] S103, adding the first target programming module to the set of programming modules to be updated.

[0079] It should be noted that the programming modules in the set of programming modules to be updated can be referred to as target programming modules, and the target programming modules can include the first target programming module. The target programming modules are all modules that need to be hot updated.

[0080] S104, according to the code files of each target programming module in the set of programming modules to be updated, hot updating each target programming module.

[0081] Wherein, the programming code and data in the target programming modules are not modified, and the programming code and data in the code files of the target programming modules are modified.

[0082] In some embodiments, the processing device can perform hot update on the target programming modules according to the modified programming code and data in the code files of the target programming modules in the set of programming modules to be updated.

[0083] In addition, hot update on the target programming modules in the application program is implemented, that is, hot update on the application program is implemented.

[0084] In summary, the embodiment of the application provides an application program hot update method, which comprises the following steps: obtaining loaded programming modules of an application program; determining, according to a start time of the application program and file modification times of the programming modules in the application program, a programming module, whose size relationship between the file modification time and the start time meets a preset condition, from the loaded programming modules as a first target programming module; adding the first target programming module to a set of programming modules to be updated; and performing hot update on the target programming modules according to the code files of the target programming modules in the set of programming modules to be updated. The programming module, whose size relationship between the file modification time and the start time meets the preset condition, is determined as the first target programming module from the loaded programming modules according to the start time of the application program and the file modification times of the programming modules in the application program, the first target programming module is a programming module that needs to be hot updated, the programming module that needs to be hot updated is automatically determined, the programming module that needs to be hot updated is efficiently screened out, and the efficiency of hot update on the programming modules in the application program is improved.

[0085] Moreover, the programming module that needs to be hot updated is screened out from the loaded modules by comparing the start time and the file modification time, the number of the modules that need to be hot updated is greatly reduced, and the time consumption of hot update is further reduced.

[0086] Optionally, the process of determining, according to the start time of the application program and the file modification times of the programming modules in the application program, a programming module, whose size relationship between the file modification time and the start time meets a preset condition, from the loaded programming modules as a first target programming module in S102 can comprise the following steps:

[0087] determining, according to the start time and the file modification times of the programming modules, a programming module, whose file modification time is later than the start time, from the loaded programming modules as the first target programming module.

[0088] In some embodiments, files of each loaded programming module are traversed to determine whether a modification time of each file exceeds a start time, and if the modification time of the file exceeds the start time, the file corresponding to the modification time is determined, and the loaded programming module corresponding to the file is determined as the target programming module.

[0089] For example, the programming module a has a corresponding file a, the start time can be 15:00, the modification time of the file a is 15:05, and it is determined that the modification time of the file a exceeds the start time, and the programming module a can be determined as the first target programming module.

[0090] Optionally, the start time can be referred to as start_time, and the modification time can be referred to as modify_time.

[0091] In summary, the programming module whose modification time exceeds the start time is determined as the first target programming module from the loaded programming modules, and the programming module whose corresponding file is modified after the start time can be quickly screened out, and these programming modules are the first target programming modules that need to be hot updated, and the first target programming module that needs to be hot updated can be quickly and efficiently determined.

[0092] Optionally, Figure 2 A flowchart of an application hot updating method provided by an embodiment of the application is shown in FIG. 1. Figure 2 As shown in FIG. 1, the process of determining, in S102, the programming module whose modification time and start time satisfy a preset condition from the loaded programming modules as the first target programming module according to the start time of the application and the modification time of each programming module in the application can include the following steps.

[0093] S201, calculating a target time according to the start time of the application and a preset tolerance time.

[0094] In the embodiments of the application, some integrated environments used by application developers during development have memory buffering, which delays the saving of file contents corresponding to programming code. Based on the calculation of the target time according to the start time of the application and the preset tolerance time, a certain degree of time tolerance is achieved.

[0095] The integrated environment can be an IDE.

[0096] In some embodiments, the processing device can use a preset target time calculation rule to calculate the target time according to the start time of the application and the preset tolerance time.

[0097] S202, determining the programming module whose modification time exceeds the target time from the loaded programming modules as the first target programming module.

[0098] In some embodiments, files of each loaded programming module are traversed to determine whether a modification time of each file exceeds a target time, and if the modification time of the file exceeds the target time, the file corresponding to the modification time is determined, and the loaded programming module corresponding to the file is determined as the first target programming module.

[0099] In summary, the target time is calculated according to the start time of the application program and the preset tolerance time, and the programming module whose file modification time exceeds the target time is determined as the first target programming module. A certain time tolerance is added, and the situation of delayed saving of file content corresponding to the programming code can also be accurately and efficiently screened to select the module that needs to be hot updated.

[0100] Optionally, the process of calculating the target time according to the start time of the application program and the preset tolerance time in S201 can include:

[0101] The target time is calculated according to the difference between the start time and the preset tolerance time.

[0102] The preset tolerance time can also be referred to as a preset tolerance degree. The preset tolerance degree can be determined according to the delay duration of the file corresponding to the delayed saved programming code, or can be determined according to an empirical value, or can be determined in other ways, and the present application embodiment does not make specific limitations.

[0103] In addition, the target time can be obtained by subtracting the preset tolerance time from the start time.

[0104] In some embodiments, start_time represents the start time, and x represents the preset tolerance time, and the target time can be represented as: start_time-x.

[0105] Correspondingly, modify_time represents the file modification time, and the programming module corresponding to the file satisfying start_time-x<modify_time can be determined as the first target programming module.

[0106] It should be noted that the preset tolerance time can be determined according to the IDE environment based on the application program. The time of delayed saving after file modification is different in different IDE environments. The target time is calculated according to the difference between the start time and the preset tolerance time, which can be adapted to different IDE environments and expand the application range.

[0107] Optionally, Figure 3 A flowchart of an application program hot updating method provided by the present application embodiment is shown in Figure 3As shown in the above S104, before the process of performing the hot update on each target programming module according to the code files of each target programming module in the programming module set to be updated, the method can further include:

[0108] S301, determining that the programming module registered in the application and adopting the metaclass is a second target programming module.

[0109] In the embodiment of the application, since the programming module adopting the metaclass is a special programming module, the programming module adopting the metaclass registered in the application needs to be forcibly updated each time the hot update is performed.

[0110] S302, adding the second target programming module to the programming module set to be updated.

[0111] The programming module set to be updated can include the first target programming module and the second target programming module. The first target programming module and the second target programming module can both be target programming modules. The first target programming module and the second target programming module are both programming modules that need to be hot updated.

[0112] To sum up, the programming module adopting the metaclass registered in the application is determined to be a second target programming module, and the second target programming module is added to the programming module set to be updated. The application range of the hot update is expanded, the special programming module adopting the metaclass can be hot updated and take effect, and the development environment generated by different IDEs can be hot updated and take effect.

[0113] Optionally, Figure 4 A flowchart of an application hot update method provided by the embodiment of the application is shown in FIG. 2. Figure 4 As shown in the above S104, the process of performing the hot update on each target programming module according to the code files of each target programming module in the programming module set to be updated can include:

[0114] S401, deleting each target programming module from a system module list of the application.

[0115] In the embodiment of the application, the system module list can include loaded programming modules, the target programming module is a programming module that needs to be hot updated in the loaded programming modules, the content of the target programming module is not modified, but the content of the file corresponding to the target programming module has changed, and therefore, each target programming module needs to be deleted from the system module list of the application.

[0116] Optionally, the system module list can be sys.modules.

[0117] S402, reimporting the code files of each target programming module to reload each target programming module.

[0118] In some embodiments, an import module can be employed to reimport the code files of each target programming module to reload each target programming module. The import module can be an import statement.

[0119] It should be noted that the content in the code files of each target programming module is reimported, and the modified content is imported, and the target programming module after hot update can be obtained based on the modified content. The reloaded target programming module is the target programming module after hot update.

[0120] For example, the target programming module in the system module list is a1, the corresponding code file is b1, the content in a1 and b1 is different, and the content in b1 is modified; a1 can be deleted, and a2, the target programming module after hot update, can be obtained by reimporting the content in b1.

[0121] Optionally, after the process of hot updating each target programming module according to the code files of each target programming module in the programming module set to be updated in S104, the method can further include:

[0122] Resetting the start time of the application program to the current time.

[0123] It should be noted that resetting the start time of the application program to the current time can facilitate the next hot update.

[0124] The application program hot updating method provided in the embodiments of the present application can be applied to an online C / S architecture and a program development environment.

[0125] For the online C / S architecture, the client and the server perform hot updating in their respective environments to achieve efficient hot updating of the C / S architecture. For the program development environment, the effectiveness of the code and data can be quickly verified, and the effect of "what you write is what you get" can be achieved, which can greatly save the working time of the development and testing personnel and greatly improve the work efficiency.

[0126] To sum up, the embodiment of the application provides an application program hot updating method, which comprises the following steps: obtaining loaded programming modules of an application program; determining, according to a starting time of the application program and file modification times of the programming modules in the application program, a programming module, which satisfies a preset condition in the size relationship between the file modification time and the starting time, from the loaded programming modules as a first target programming module; adding the first target programming module to a programming module set to be updated; and performing hot updating on each target programming module according to code files of the target programming modules in the programming module set to be updated. According to the starting time of the application program and the file modification times of the programming modules in the application program, the programming module, which satisfies the preset condition in the size relationship between the file modification time and the starting time, is determined from the loaded programming modules as the first target programming module, and the first target programming module is the programming module that needs to be hot updated, so that the programming module that needs to be hot updated can be automatically determined, the programming module that needs to be hot updated can be efficiently screened out, and the efficiency of hot updating on the programming modules in the application program is improved.

[0127] Moreover, by comparing the starting time and the file modification time, the programming module that needs to be hot updated is screened out from the loaded modules, the number of the modules that need to be hot updated is greatly reduced, and the time consumption of hot updating is further reduced.

[0128] In addition, the time of hot updating in a production development environment is greatly shortened, and the effect of shortening the time consumption of hot updating is more obvious as the project engineering scale is larger. The application scope of hot updating is also expanded, so that special programming modules such as meta classes can be hot updated and take effect, and different IDEs of the production development environment can be hot updated and take effect.

[0129] The following describes an application program hot updating device, a processing device and a storage medium and the like for performing the application program hot updating method provided in the application, and the specific implementation process and technical effects can be referred to the related content of the application program hot updating method described above, which will not be described here.

[0130] Figure 5 A structural schematic diagram of an application program hot updating device provided in the embodiment of the application is shown in FIG. 1. Figure 5 As shown in FIG. 1, the device can comprise:

[0131] The obtaining module 501 is configured to obtain loaded programming modules of an application program.

[0132] The determining module 502 is configured to determine, according to a starting time of the application program and file modification times of the programming modules in the application program, a programming module, which satisfies a preset condition in the size relationship between the file modification time and the starting time, from the loaded programming modules as a first target programming module.

[0133] The adding module 503 is configured to add the first target programming module into the set of programming modules to be updated.

[0134] The hot updating module 504 is configured to perform hot updating on each target programming module according to a code file of the target programming module in the set of programming modules to be updated.

[0135] Optionally, the determining module 502 is further configured to determine, from the loaded programming modules, a programming module whose file modification time exceeds the start time as the first target programming module according to the start time and the file modification time of each programming module.

[0136] Optionally, the determining module 502 is further configured to calculate a target time according to the start time of the application program and a preset tolerance time, and determine, from the loaded programming modules, a programming module whose file modification time exceeds the target time as the first target programming module.

[0137] Optionally, the determining module 502 is further configured to calculate the target time according to a difference between the start time and the preset tolerance time.

[0138] Optionally, the apparatus further comprises:

[0139] The first determining module is configured to determine a programming module registered in the application program and using a meta class as a second target programming module.

[0140] The adding module is configured to add the second target programming module into the set of programming modules to be updated.

[0141] Optionally, the hot updating module 504 is further configured to delete each target programming module from a system module list of the application program, and re-import a code file of each target programming module to reload each target programming module.

[0142] Optionally, the apparatus further comprises:

[0143] The resetting module is configured to reset the start time of the application program as a current time.

[0144] The apparatus is used for executing the method provided by the foregoing embodiments, and has similar implementation principles and technical effects, which are not described here in detail.

[0145] The above modules can be one or more integrated circuits configured to implement the above methods, for example, one or more application specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs), etc. For another example, when a certain module above is implemented in the form of a processing element scheduling code, the processing element can be a general purpose processor, such as a central processing unit (CPU) or other processor capable of invoking program code. For another example, the modules can be integrated together to implement in the form of a system on a chip (SOC).

[0146] Figure 6 A structural schematic diagram of a processing device provided by an embodiment of the present application is shown in FIG. 1, which includes a processor 601 and a memory 602. Figure 6 The memory 602 is configured to store a program, and the processor 601 invokes the program stored in the memory 602 to execute the above method embodiments. The specific implementation manners and technical effects are similar, and will not be described here again.

[0147] The memory 602 is configured to store a program, and the processor 601 invokes the program stored in the memory 602 to execute the above method embodiments. The specific implementation manners and technical effects are similar, and will not be described here again.

[0148] Optionally, the present application also provides a program product, for example, a computer readable storage medium, including a program, which is used to execute the above method embodiments when executed by a processor.

[0149] In several embodiments provided by the present application, it should be understood that the disclosed apparatus and method can be implemented in other manners. For example, the described apparatus embodiments are merely schematic. The division of the units is merely a logical function division. There can be another division manner for the actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between the units can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.

[0150] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments of the present application.

[0151] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of hardware plus software function unit.

[0152] The integrated unit realized in the form of software function unit can be stored in a computer readable storage medium. The software function unit stored in a storage medium includes a plurality of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (English: Read-Only Memory, for short: ROM), a random access memory (English: Random Access Memory, for short: RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0153] The above is only the preferred embodiment of the present application and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for hot-updating an application, characterized in that, Applied to a processing device, the method includes: The processing device obtains the loaded programming module of the application through a preset module; Based on the application's startup time and the file modification time of each programming module in the application, the programming module whose file modification time and startup time satisfy a preset condition is identified from the loaded programming modules as the first target programming module; Add the first target programming module to the set of programming modules to be updated; The programming module registered in the application that uses metaclasses is identified as the second target programming module; Add the second target programming module to the set of programming modules to be updated; Based on the code files of each target programming module in the set of programming modules to be updated, perform hot updates on each target programming module; The step of determining the first target programming module from the loaded programming modules based on the application's startup time and the file modification time of each programming module in the application, where the relationship between the file modification time and the startup time satisfies a preset condition, includes: The target time is calculated based on the application's startup time and a preset tolerance time; the preset tolerance time is determined based on the integrated development environment on which the application is based. The programming module whose file modification time exceeds the target time is determined from the loaded programming modules and is identified as the first target programming module; The step of hot-updating each target programming module according to the code files of each target programming module in the set of programming modules to be updated includes: Remove each of the target programming modules from the system module list of the application; Re-import the code files of each target programming module to reload each target programming module.

2. The method according to claim 1, characterized in that, The step of determining the first target programming module from the loaded programming modules based on the application's startup time and the file modification time of each programming module in the application, where the relationship between the file modification time and the startup time satisfies a preset condition, includes: Based on the startup time and the file modification time of each programming module, the programming module whose file modification time exceeds the startup time is determined from the loaded programming modules as the first target programming module.

3. The method according to claim 1, characterized in that, The step of calculating the target time based on the application's startup time and a preset tolerance time includes: The target time is calculated based on the difference between the start time and the preset tolerance time.

4. The method according to any one of claims 1-3, characterized in that, After performing a hot update on each target programming module based on the code files of each target programming module in the set of programming modules to be updated, the method further includes: Reset the application's startup time to the current time.

5. An application hot update device, characterized in that, Applied to a processing device, the apparatus includes: An acquisition module is used by the processing device to acquire the loaded programming module of the application through a preset module; The determining module is used to determine, based on the startup time of the application and the file modification time of each programming module in the application, the programming module whose file modification time and startup time satisfy a preset condition from the loaded programming modules as the first target programming module; Add a module to add the first target programming module to the set of programming modules to be updated; The first determining module is used to determine the programming module using metaclasses registered in the application as the second target programming module; The add module is used to add the second target programming module to the set of programming modules to be updated; The hot update module is used to perform hot updates on each target programming module according to the code files of each target programming module in the set of programming modules to be updated; The determining module is specifically used to calculate the target time based on the application's startup time and a preset tolerance time; the preset tolerance time is determined based on the integrated development environment on which the application is based; and to determine the programming modules whose file modification time exceeds the target time from the loaded programming modules as the first target programming modules; The hot update module is specifically used to remove each target programming module from the system module list of the application. Re-import the code files of each target programming module to reload each target programming module.

6. A processing apparatus, characterized in that, include: A memory and a processor, the memory storing a computer program executable by the processor, the processor executing the computer program to implement the application hot update method according to any one of claims 1-4.

7. A storage medium, characterized in that, The storage medium stores a computer program, which, when read and executed, implements the application hot update method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Test code updating method and device, electronic equipment and storage medium

    CN113190448A