Application update method, system, electronic device, medium and program product
By migrating the toolkit's storage path to the application class loader, the problem of the compiler class loader being unable to access other compiled files was resolved, improving the efficiency of application compilation and updates, simplifying the update process, and reducing costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI SHIZHUANG INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2026-02-24
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, during application updates, the compiler class loader cannot directly access other compiled files that have been loaded into the application, resulting in low compilation efficiency and thus reducing the efficiency of application updates.
By moving the storage path of the toolkit from the compiler class loader to the application class loader or its parent class loader, and using the application class loader for compilation, the need for direct access to other compiled files is avoided, thus improving compilation efficiency.
It improves the compilation and update efficiency of applications, reduces update complexity and cost, and reduces the risk of production environment failures.
Smart Images

Figure CN122132067A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, system, electronic device, medium, and program product for updating applications. Background Technology
[0002] Application development involves steps such as writing, compiling, loading, and running source files. Source files (e.g., Java source files) are written by developers and include source code that conforms to the rules of a specific language (e.g., the Java programming language). After the source files are written, they can be compiled by a class loader, which converts the source code into bytecode readable by the electronic device, resulting in a compiled file (e.g., a class file) containing the bytecode. This compiled file is then loaded into the corresponding application by the application class loader for execution.
[0003] It's understandable that application development involves updating the application, such as adding new code to the application's source files or updating some historical code in the source files with new code. During the compilation of new code by the class loader, if the new code references other compiled files already loaded into the application by the application class loader, the class loader cannot directly access these other compiled files. It can only recompile the source files corresponding to these other compiled files, thus completing the compilation process for the new code.
[0004] It can be seen that this compilation method increases compilation time, reduces compilation efficiency, and consequently reduces the efficiency of application updates. Summary of the Invention
[0005] This application provides an application update method, system, electronic device, medium, and program product.
[0006] In a first aspect, this application provides a method for updating an application, applied to a business system including a first server and a second server. The method includes: the first server, while running a target application, sending a first source file retrieval request to the second server; the second server, in response to the first source file retrieval request, sending a target update source file to the first server, wherein the target update source file is used to update the target application; the first server loading a compiler based on a first class loader, the first class loader being an application class loader or a parent class loader of an application class loader; the first server using the compiler based on the application class loader to compile the target update source file, obtaining a compiled file corresponding to the target update source file; and the first server updating the target application based on the compiled file.
[0007] In this method, the first server compiles the target update source files using the compiler based on the application class loader, rather than using the compiler class loader. This avoids the problem of low compilation efficiency in the target application caused by the compiler class loader being unable to access other compiled files loaded into the target application when new code references those files. Therefore, this method can improve compilation efficiency, thereby improving the update efficiency of the target application.
[0008] In the method provided in this application, after the first server obtains the target update source file, it compiles the target update source file, loads and runs the corresponding compiled file within the first server to update the target application. This method eliminates the need for personnel performing hot deployment to compile the target update source file in a local integrated development environment (IDE), separating developers and compilers, reducing the complexity and cost of updating the target application, and improving the usability of the target update source file.
[0009] In one possible implementation of the first aspect, before the first server sends a first source file retrieval request to the second server while running the target application, the method further includes: the second server receiving a program update instruction from the target application, the program update instruction carrying a target file identifier corresponding to the target update source file; and the second server retrieving the target update source file based on the target file identifier in response to the program update instruction.
[0010] In one possible implementation of the first aspect, the second server, in response to a program update instruction, obtains a target update source file based on a target file identifier, including: the second server sending a second source file retrieval request to a code hosting platform, wherein the second source file retrieval request carries a target file identifier, the code hosting platform stores at least one update source file of the target application, and the code hosting platform is used to determine the target update source file from at least one update source file based on the target file identifier; and receiving the target update source file sent by the code hosting platform.
[0011] It is understandable that the target update source file is obtained from the code hosting platform. Therefore, this method can avoid the production environment failure caused by the target update source file being different from the code on the code hosting platform when hot-deployed in the test environment.
[0012] In one possible implementation of the first aspect, at least one update source file includes multiple update source files, each update source file corresponding to a file identifier, and the file identifiers corresponding to the multiple update source files are consecutive; the target file identifier includes a first identifier and a second identifier, and the target update source file includes the update source file corresponding to the first identifier, the update source file corresponding to the second identifier, and the update source file corresponding to the file identifier between the first identifier and the second identifier.
[0013] In one possible implementation of the first aspect, the first server, while running the target application, sends a first source file retrieval request to the second server, including: the first server, while running the target application, periodically sends the first source file retrieval request to the second server.
[0014] Secondly, this application provides an application update method applied to a first server. The method includes: obtaining a target update source file while the target application is running, the target update source file being used to update the target application; loading a compiler based on a first type of loader, the first type of loader being an application class loader or a parent class loader of an application class loader; compiling the target update source file using the compiler based on the application class loader to obtain a compiled file corresponding to the target update source file; and updating the target application based on the compiled file.
[0015] In one possible implementation of the second aspect, obtaining the target update source file while the target application is running includes: sending a first source file retrieval request to a second server while the target application is running; and receiving the target update source file sent by the second server in response to the first source file retrieval request.
[0016] In one possible implementation of the second aspect, when the target application is running, sending a first source file retrieval request to a second server includes: when the target application is running, periodically sending a first source file retrieval request to a second server.
[0017] Thirdly, this application provides a business system, which includes a first server and a second server. The first server is used to execute the steps performed by the first server in the first and second aspects described above, and the second server is used to execute the steps performed by the second server in the first and second aspects described above.
[0018] Fourthly, this application provides an electronic device comprising: at least one processor; at least one memory; the at least one memory storing at least one program, which, when executed by the at least one processor, causes the electronic device to perform the application update method involved in the first and second aspects.
[0019] Fifthly, this application provides a computer-readable storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the update methods for the application programs involved in the first and second aspects.
[0020] Sixthly, this application provides a computer program product comprising: computer instructions that, when executed on an electronic device, cause the electronic device to execute the update method of the application program involved in the first and second aspects.
[0021] The beneficial effects of the second to sixth aspects can be found in the first aspect and the beneficial effects of any possible implementation of the first aspect, and will not be repeated here. Attached Figure Description
[0022] Figure 1 According to some embodiments of this application, a schematic diagram of a parent-child relationship of class loaders is shown;
[0023] Figure 2 According to some embodiments of this application, a flowchart of an application update method is shown;
[0024] Figure 3 According to some embodiments of this application, a schematic diagram of another parent-child relationship of class loaders is shown;
[0025] Figure 4 According to some embodiments of this application, a schematic diagram of the interactive flow of an application update method is shown;
[0026] Figure 5 According to some embodiments of this application, a schematic diagram of the structure of a business system for which an application update method is applied is shown;
[0027] Figure 6 According to some embodiments of this application, a schematic diagram of the structure of an electronic device is shown. Detailed Implementation
[0028] The illustrative embodiments of this application include, but are not limited to, application update methods, systems, electronic devices, media, and program products.
[0029] Java source files: Plain text files with the .java extension written in the Java programming language. Java files contain human-readable Java source code.
[0030] Compiler class loader: A class loader used to compile Java source code. It can load the Java compiler (Javac) through a toolkit (tools.jar) to compile Java source files into compiled files, i.e., class files.
[0031] Class file: A binary file with the .class extension generated after Java source files are compiled, containing bytecode instructions that the target application needs to execute.
[0032] Application class loader: A class loader used to load the binary bytecode in a class file into the target application for execution.
[0033] Java's parent delegation model is a working mode and hierarchical structure for class loaders, specifying the delegation order and hierarchy when class loaders load classes. For safety and memory considerations, when a class loader receives a class loading request, it first delegates the task to its parent class loader. Only if the parent class loader cannot complete the loading will the child class loader load the class. Furthermore, child class loaders can access class files loaded by their parent class loaders.
[0034] Code hosting platforms, such as GitLab, SVN, and GitHub, are used to store source code written by developers. Each time a code hosting platform receives a source file uploaded by a developer, it generates a commit identifier (commit ID) for that file. Code hosting platforms allow external devices to retrieve source files, compare code changes, and access commit history through their open application programming interfaces (APIs).
[0035] Hot deployment: This involves incrementally updating the compiled files corresponding to the source files without stopping the running application, thereby updating the application itself. The hot deployment process can be implemented using the Java Development Kit (JDK).
[0036] The Java Development Kit (JDK) provides interfaces for toolkits (tools.jar), class loaders, etc., allowing open-source frameworks (such as HotswapAgent) to perform operations such as loading and verifying the compiled files corresponding to the source files during the runtime of the target application, and then run these compiled files.
[0037] As mentioned above, during the process of the compiler class loader compiling new code, if the new code references other compiled files that have been loaded into the application by the application class loader, the compiler class loader cannot directly access these other compiled files. It can only recompile the source files corresponding to these other compiled files, thereby realizing the compilation process of the new code.
[0038] For example, Figure 1 According to some embodiments of this application, a schematic diagram of a parent-child relationship of class loaders is shown.
[0039] like Figure 1 As shown, due to Java's parent delegation model, AppClassLoader is the system class loader and the parent class loader of LaunchedURLClassLoader and FactoryURLClassLoader. FactoryURLClassLoader is the compiler class loader, and it includes the storage path for the compilation toolkit (tools.jar). Therefore, FactoryURLClassLoader can load the compiler by loading the toolkit, compile the new code, and obtain the compiled file corresponding to the new code. After FactoryURLClassLoader obtains the compiled file, LaunchedURLClassLoader can load the compiled file into the application.
[0040] However, as Figure 1 As shown, there is no parent-child relationship between LaunchedURLClassLoader and FactoryURLClassLoader. Therefore, FactoryURLClassLoader cannot access compiled files loaded by LaunchedURLClassLoader. If new code references other compiled files that have already been loaded into the application by LaunchedURLClassLoader, FactoryURLClassLoader, unable to access these other compiled files during the compilation process, can only recompile the source files corresponding to these other compiled files, thus completing the compilation of the new code.
[0041] It can be seen that this compilation method increases compilation time, reduces compilation efficiency, and consequently reduces the efficiency of application updates.
[0042] Understandably, because LaunchedURLClassLoader does not include the storage path of the toolkit, it cannot load the compiler by loading the toolkit, and therefore cannot compile the new code.
[0043] To address the aforementioned technical problems, this application provides a method for updating an application. In this method, the toolkit's storage path is no longer located in FactoryURLClassLoader, but rather in LaunchedURLClassLoader or AppClassLoader. Thus, during the application update process, the compiler can compile the new code based on LaunchedURLClassLoader.
[0044] Specifically, in this method, the first server, while running the target application, obtains the target update source file, which is used to update the target application. A compiler is loaded based on a first type of class loader, which is either an application class loader (e.g., LaunchedURLClassLoader) or a parent class loader of the application class loader (e.g., AppClassLoader). Then, the compiler is used to compile the target update source file based on the application class loader, resulting in a compiled file corresponding to the target update source file. The target application is then updated based on the compiled file.
[0045] In some embodiments, the first server can implement the above method based on the JDK using open-source frameworks such as HotswapAgent.
[0046] This method uses the application class loader to compile the target update source files using the compiler, rather than using the compiler class loader. This avoids the problem of low compilation efficiency caused by the compiler class loader being unable to access other compiled files loaded into the target application when new code references those files. Therefore, this method improves compilation efficiency, thereby improving the update efficiency of the target application.
[0047] As can be understood, this method incrementally and hotly updates the compiled files corresponding to the target update source files without stopping the running target application, thereby updating the target application. In other words, this method is applied to hot deployment scenarios and can further improve the update efficiency of the target application.
[0048] The method for updating the application provided in this application will now be described in detail with reference to the accompanying drawings. For example, Figure 2According to some embodiments of this application, a flowchart illustrating an application update method provided in this application is shown. Figure 2 The execution entity for each step of the process shown is the first server. For ease of description, this will be explained in the following description. Figure 2 The execution entity of each step in the process shown will not be described again.
[0049] like Figure 2 As shown, the method may include:
[0050] S201: When the target application is running, obtain the target update source file, which is used to update the target application.
[0051] It is understood that the target application in this application can be a Java application, and the target update source file can be a target update Java source file.
[0052] The target application runs in the target Java process (or hot-deployed target Java process). Therefore, obtaining the target update source file while the target application is running can mean obtaining the target update source file while the target Java process is running.
[0053] This application does not limit the method by which the first server obtains the target update source file. In some embodiments, the first server may send a first source file retrieval request to a second server, and then receive the target update source file sent by the second server. The first source file retrieval request may include the identifier (ID) of the first server.
[0054] This application embodiment does not limit the timing or method of the first server sending the first source file retrieval request to the second server. For example, the first server may periodically send the first source file retrieval request to the second server after the target application starts running. For instance, the first server may send the first source file retrieval request to the second server at fixed intervals. The fixed interval could be 30 seconds or 40 seconds, etc.
[0055] S202: The compiler is loaded based on the first class loader, which is the application class loader or the parent class loader of the application class loader.
[0056] In this embodiment of the application, the storage path of the toolkit used for compilation is located in the first type of loader. Therefore, the toolkit can be loaded based on the first type of loader, and then the compiler can be loaded.
[0057] like Figure 3As shown, the storage path for the toolkit used for compilation can be located in LaunchedURLClassLoader (as an example of an application class loader), or in AppClassLoader, the parent class loader of LaunchedURLClassLoader (as an example of a parent class loader of an application class loader).
[0058] S203: The target update source file is compiled using the compiler based on the application class loader to obtain the compiled file corresponding to the target update source file.
[0059] Taking LaunchedURLClassLoader as the application class loader and AppClassLoader as the parent class loader of the application class loader as an example, it can be understood that regardless of whether the compiler is loaded based on LaunchedURLClassLoader or AppClassLoader, in this S203, the compiler is used to compile the target update source file based on LaunchedURLClassLoader.
[0060] Specifically, if the compiler is loaded based on LaunchedURLClassLoader, then the compiler needs to be used to compile the target update source file based on LaunchedURLClassLoader to obtain the compiled file (e.g., class file) corresponding to the target update source file.
[0061] If the compiler is loaded based on AppClassLoader, due to the limitations of Java's parent delegation model, the child class loader can access the compiled files loaded by the parent class loader. Therefore, the compiler loaded by AppClassLoader can be used based on LaunchedURLClassLoader to compile the target update source file and obtain the compiled file corresponding to the target update source file.
[0062] S204: Update the target application based on the compiled files.
[0063] In some embodiments, the compiled file is used to be added to the compiled file that the target application is running. Therefore, after obtaining the compiled file, the obtained compiled file can be loaded into the target application, and then the compiled file can be run to update the target application.
[0064] In other embodiments, the compiled file is used to update a historical compiled file with the same class name that is currently running in the target application. Therefore, after obtaining the compiled file, it can be loaded into the target application, and then the class definitions of the historical compiled file can be replaced with the class definitions of the compiled file corresponding to the target updated source file to update the target application. For example, the class definitions of the historical compiled file can be replaced with the class definitions of the compiled file corresponding to the target updated source file by redefining class files.
[0065] It is understandable that, regardless of which update method is used, the compiled files can be loaded into the target application by calling the relevant interfaces provided by the JDK.
[0066] This method uses the application class loader to compile the target update source files using the compiler, rather than using the compiler class loader. This avoids the problem of low compilation efficiency caused by the compiler class loader being unable to access other compiled files loaded into the target application when new code references those files. Therefore, this method improves compilation efficiency, thereby improving the update efficiency of the target application.
[0067] In addition, such as Figure 3 As shown, the storage path for the compilation toolkit can be located in LaunchedURLClassLoader or AppClassLoader. Since AppClassLoader is also the parent class loader of the compilation class loader FactoryURLClassLoader, FactoryURLClassLoader can also use the toolkit to perform other tasks. Therefore, this method can also expand the use cases of the toolkit and improve its efficiency.
[0068] For example, Figure 4 According to some embodiments of this application, a schematic diagram of the interactive flow of an application update method provided in this application is shown. This interactive flow is applied to a first server, a second server, and a code hosting platform.
[0069] like Figure 4 As shown, the method may include:
[0070] S401: The second server receives the program update instruction of the target application, which carries the target file identifier corresponding to the target update source file.
[0071] In some embodiments, the program update instruction (or hot deployment task instruction) may be issued by a user (e.g., the person performing the hot deployment) to a second server. The program update instruction carries a target file identifier (i.e., the target file's commit identifier), which is the file identifier corresponding to this hot deployment process, used to obtain the target update source file. The target update source file is used to update the target application.
[0072] S402: In response to the program update instruction, the second server sends a second source file retrieval request to the code hosting platform, wherein the second source file retrieval request carries the target file identifier.
[0073] It is understandable that the second server can send a request to the code hosting platform to retrieve the second source file by calling the code hosting platform's open API.
[0074] S403: The code hosting platform identifies the target update source file in at least one update source file based on the target file identifier.
[0075] In this embodiment of the application, the code hosting platform stores at least one update source file of the target application, and the at least one update source file may be uploaded to the code hosting platform by the user.
[0076] It's understandable that each time a code hosting platform receives an updated source file uploaded by a user, it generates a unique file identifier. Therefore, at least one updated source file corresponds to at least one file identifier.
[0077] In the case where at least one update source file includes multiple update source files, the file identifiers corresponding to the multiple update source files are consecutive, that is, the file identifiers corresponding to the multiple update source files are set consecutively according to the upload time of each update source file.
[0078] In some embodiments, the target file identifier may include a start identifier (e.g., a first identifier) and an end identifier (e.g., a second identifier) of the target update source file. In this case, the target update source file may include: the update source file corresponding to the start identifier, the update source file corresponding to the end identifier, and the source file corresponding to each file identifier between the start identifier and the end identifier.
[0079] In other embodiments, the target file identifier may include a start identifier and an end identifier of the target update source file, as well as each identifier between the start identifier and the end identifier. In this case, the target update source file also includes: the update source file corresponding to the start identifier, the update source file corresponding to the end identifier, and the source file corresponding to each file identifier between the start identifier and the end identifier.
[0080] In some other embodiments, the target file identifier may also include the end identifier of the previous hot deployment process and the end identifier of the current hot deployment process. In this case, the target update source file may include: the update source file corresponding to the end identifier of the current hot deployment process and the update source file corresponding to the file identifier between the end identifier of the previous hot deployment process and the end identifier of the current hot deployment process.
[0081] S404: The code hosting platform sends the target update source file to the second server.
[0082] It is understandable that a code hosting platform can send the target updated source files to a second server by calling the code hosting platform's open API.
[0083] S405: The second server receives the target update source file sent by the code hosting platform.
[0084] In this embodiment of the application, the process of the second server sending a second source file acquisition request to the code hosting platform and receiving the target updated source file sent by the code hosting platform can also be referred to as the process of the second server downloading the target updated source file.
[0085] S406: The first server, while running the target application, sends a request to the second server to obtain the first source file.
[0086] It is understandable that the execution principle of S406 is the same as that of S201 mentioned above, so it will not be repeated here.
[0087] It is understood that the embodiments of this application do not limit the order of S406 and S401-S405. For example, S406 can be executed before S401, after S405, or during the execution of S401-S405.
[0088] S407: The second server responds to the first source file retrieval request by sending the target updated source file to the first server.
[0089] In some embodiments, in response to a first source file retrieval request, the second server may package and compress the target update source file into a tape archive (TAR) package and then send the TAR package to the first server.
[0090] For example, the second server can send the TAR packet corresponding to the target update source file to the first server through a long Hypertext Transfer Protocol (HTTP) connection established with the first server.
[0091] S408: The first server loads the compiler based on the first class loader, which is the application class loader or the parent class loader of the application class loader.
[0092] It is understandable that the execution principle of S408 is the same as that of S202 mentioned above, so it will not be repeated here.
[0093] S409: The first server uses the application class loader and compiler to compile the target update source file, and obtains the compiled file corresponding to the target update source file.
[0094] It is understandable that after the first server receives the TAR package corresponding to the target update source file sent by the second server, it can decompress the TAR package to obtain the target update source file, and then use the compiler based on the application class loader to compile the target update source file to obtain the compiled file corresponding to the target update source file.
[0095] It is understandable that the execution principle of S409 is the same as that of S203 mentioned above, so it will not be repeated here.
[0096] S410: The first server updates the target application based on the compiled files.
[0097] It is understandable that the execution principle of S410 is the same as that of S204 mentioned above, so it will not be repeated here.
[0098] In the method provided in this application, after the first server obtains the target update source file, it compiles the target update source file, loads and runs the compiled file corresponding to the target update source file within the first server to update the target application, instead of using the traditional method of compiling the target update source file in the local integrated development environment (IDE) and then uploading the compiled file to the first server for hot deployment.
[0099] Understandably, the aforementioned traditional methods lead to problems such as high update costs for the target application and loss of target update source files. Specifically, the developers who write the target source files and the personnel performing hot deployment may be different. The personnel performing hot deployment need to learn how to compile the target update source files locally in an IDE, which increases the complexity and cost of updating the target application.
[0100] Furthermore, if the compiled files corresponding to the target updated source files obtained in the IDE are not uploaded to the code hosting platform, it may lead to the loss of compiled files. Even if the compiled files are successfully hot-deployed in the test environment, because the compiled files were not uploaded to the code hosting platform, the updated source files hot-deployed in the test environment will be different from the updated source files in the code hosting platform. This will also cause the compiled files corresponding to the updated source files to fail to be deployed, resulting in production environment failures.
[0101] Therefore, in the method provided in this application, the personnel performing hot deployment only need to send the target file identifier corresponding to the target update source file to the second server to achieve automatic updates of the target application. This eliminates the need for the personnel performing hot deployment to compile the target update source file in their local IDE, separating developers and compilers, reducing the complexity and cost of updating the target application, and improving the usability of the target update source file. Furthermore, since the target update source file is obtained from a code hosting platform, this method can avoid production environment failures caused by differences between the target update source file hot-deployed in the test environment and the code on the code hosting platform.
[0102] For example, Figure 5 According to some embodiments of this application, a schematic diagram of the structure of a business system in which the application update method provided in this application is applied is shown.
[0103] like Figure 5 As shown, the application update system includes a first server with hot-deployment target Java processes, a second server with a hot-deployment system, and a code hosting platform.
[0104] The hot deployment system receives program update instructions for the target application issued by the user, and then sends a second source file retrieval request to the code hosting platform through the code hosting platform's open API to obtain the target update source file.
[0105] The hot deployment system is also used to establish a persistent HTTP connection with the target Java process and, after receiving the first source file retrieval request sent by the target Java process via the persistent HTTP connection, send the target update source file to the target Java process via the persistent HTTP connection.
[0106] The code hosting platform is used to receive a second source file retrieval request carrying a target file identifier via an open API, then determine the target update source file from at least one update source file based on the target file identifier, and send the target update source file to the hot deployment system via the open API.
[0107] The target Java process for hot deployment is used to establish a persistent HTTP connection with the hot deployment system, and while the target application is running, to send a request to the second server to retrieve the first source file via the persistent HTTP connection. It is also used to receive the target update source file sent by the hot deployment system via the persistent HTTP connection.
[0108] The target Java process for hot deployment is also used to perform hot deployment operations, which means that during the running of the target application, the target update source files are compiled to obtain the compiled files corresponding to the target update source files, and the target application is updated based on the compiled files.
[0109] In some embodiments, this application provides another method for updating an application. The method is applied to a business system, which includes a first server and a second server. The method includes: the first server, while running a target application, sending a first source file retrieval request to the second server; the second server, in response to the first source file retrieval request, sending a target update source file to the first server, wherein the target update source file is used to update the target application; the first server loading a compiler based on a first class loader, wherein the first class loader is an application class loader or a parent class loader of an application class loader; the first server using the compiler based on the application class loader to compile the target update source file, obtaining a compiled file corresponding to the target update source file; and the first server updating the target application based on the compiled file.
[0110] It is understood that the implementation methods described above can be found in the preceding text. Figure 4 The relevant descriptions will not be repeated here.
[0111] In some embodiments, this application also provides a business system, which includes a first server and a second server, wherein the first server is used to execute... Figure 2 and Figure 4 The steps in the method shown are executed by the first server, and the second server is used to execute... Figure 2 and Figure 4 The steps performed by the second server in the method shown.
[0112] In some embodiments, this application also provides a computer-readable storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the application update method described in the above embodiments.
[0113] In some embodiments, this application also provides a computer program product, including: computer instructions, which, when executed on an electronic device, cause the electronic device to perform the application update method described in the above embodiments.
[0114] In some embodiments, this application also provides an electronic device, the electronic device including: at least one processor; at least one memory; the at least one memory storing at least one program, which, when executed by at least one processor, causes the electronic device to perform the application update method described in the above embodiments.
[0115] For example, Figure 6 According to some embodiments of this application, a schematic diagram of the structure of an electronic device is shown.
[0116] In some embodiments, the electronic device may be a first server or a second server. In one embodiment, the electronic device may include one or more processors 604, a system control logic unit 608 connected to at least one of the one or more processors 604, system memory 612 connected to the system control logic unit 608, non-volatile memory (NVM) 616 connected to the system control logic unit 608, and a network interface 620 connected to the system control logic unit 608.
[0117] In some embodiments, processor 604 may include one or more single-core or multi-core processors. In some embodiments, processor 604 may include any combination of general-purpose processors and special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In embodiments where the electronic device employs an enhanced node B (ENB) or radio access network (RAN) controller, processor 604 may be configured to perform various conforming embodiments, such as... Figure 2 and Figure 4 One or more of the multiple embodiments shown.
[0118] In some embodiments, the system control logic unit 608 may include any suitable interface controller to provide any suitable interface to at least one of the processors 604 and / or any suitable device or component communicating with the system control logic unit 608.
[0119] In some embodiments, the system control logic unit 608 may include one or more memory controllers to provide an interface to the system memory 612. The system memory 612 may be used to load and store data and / or instructions. In some embodiments, the system memory 612 of the electronic device may include any suitable volatile memory, such as a suitable dynamic random access memory.
[0120] The non-volatile memory 616 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some embodiments, the non-volatile memory 616 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as at least one of a hard disk drive (HDD), a compact disc (CD) drive, and a digital versatile disc (DVD) drive.
[0121] The non-volatile memory 616 may include a portion of the storage resources on a device on which an electronic device is installed, or it may be accessible by the device but is not necessarily part of the device. For example, the non-volatile memory 616 may be accessed over a network via a network interface 620.
[0122] Specifically, system memory 612 and non-volatile memory 616 may each include a temporary copy and a permanent copy of instruction 624. Instruction 624 may include instructions that, when executed by at least one of processors 604, cause electronic devices to... Figure 2 and Figure 4 The instructions for the method shown. In some embodiments, instructions 624, hardware, firmware and / or their software components may additionally / alternatively be located in system control logic unit 608, network interface 620 and / or processor 604.
[0123] Network interface 620 may include a transceiver for providing a radio interface to an electronic device, thereby enabling communication with any other suitable device (such as a front-end module, antenna, etc.) via one or more networks. In some embodiments, network interface 620 may be integrated into other components of the electronic device. For example, network interface 620 may be integrated into at least one of processor 604, system memory 612, non-volatile memory 616, and firmware device (not shown) with instructions, which, when at least one of processor 604 executes the instructions, enable the electronic device to implement... Figure 2 and Figure 4 The method shown.
[0124] The network interface 620 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 620 may be a network adapter, a wireless network adapter, a telephone modem, and / or a wireless modem.
[0125] In one embodiment, at least one of the processors 604 may be packaged together with the logic of one or more controllers for the system control logic unit 608 to form a system in package (SiP). In another embodiment, at least one of the processors 604 may be integrated on the same die with the logic of one or more controllers for the system control logic unit 608 to form a system on chip (SoC).
[0126] The electronic device may further include an input / output (I / O) device 628. The I / O device 628 may include a user interface enabling a user to interact with the electronic device; the peripheral component interface is designed to allow peripheral components to also interact with the electronic device. In some embodiments, the electronic device may also include sensors for determining at least one type of environmental condition and location information relevant to the electronic device.
[0127] In some embodiments, the user interface may include, but is not limited to, a display (e.g., a liquid crystal display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (e.g., a still image camera and / or a video camera), a flashlight (e.g., a light-emitting diode flash), and a keyboard.
[0128] In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.
[0129] In some embodiments, the sensor may include, but is not limited to, a gyroscope sensor, an accelerometer, a proximity sensor, an ambient light sensor, and a positioning unit. The positioning unit may also be part of or interact with the network interface 620 to communicate with components of the positioning network, such as GPS satellites.
[0130] It is understood that, as used herein, the term “module” may refer to or include, or be part of, an application-specific integrated circuit (ASIC), electronic circuitry, a processor (shared, dedicated, or grouped) and / or memory that executes one or more software or firmware programs, combinational logic circuitry, and / or other suitable hardware components that provide the described functionality.
[0131] It is understood that in the various embodiments of this application, the processor may be a microprocessor, a digital signal processor, a microcontroller, etc., and / or any combination thereof. According to another aspect, the processor may be a single-core processor, a multi-core processor, etc., and / or any combination thereof.
[0132] The embodiments disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of this application can be implemented as computer programs or program code executable on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0133] Program code can be applied to input instructions to execute the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, the processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application-specific integrated circuit (ASIC), or a microprocessor.
[0134] The program code can be implemented using a high-level procedural language or an object-oriented programming language to communicate with the processing system. Assembly language or machine language can also be used when needed. In fact, the mechanisms described in this application are not limited to any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0135] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored thereon on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed via a network or via other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine-readable (e.g., computer-readable) form, including but not limited to floppy disks, optical disks, CD-ROMs, magneto-optical disks, read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic cards or optical cards, flash memory, or tangible machine-readable storage for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in the form of electrical, optical, acoustic, or other forms of propagated signals. Therefore, machine-readable media includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a machine-readable (e.g., computer-readable) form.
[0136] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. Furthermore, the inclusion of structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.
[0137] It should be noted that all units / modules mentioned in the device embodiments of this application are logical units / modules. Physically, a logical unit / module can be a physical unit / module, a part of a physical unit / module, or a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important factor; the combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed in this application. Furthermore, to highlight the innovative aspects of this application, the above-described device embodiments of this application have not introduced units / modules that are not closely related to solving the technical problems proposed in this application. This does not mean that the above-described device embodiments do not contain other units / modules.
[0138] It should be noted that in the examples and description of this application, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0139] Although this application has been illustrated and described with reference to certain embodiments thereof, those skilled in the art will understand that various changes in form and detail may be made thereto without departing from the scope of this application.
Claims
1. A method for updating an application, characterized in that, The method is applied to a business system, which includes a first server and a second server, and the method includes: When the first server is running the target application, it sends a first source file retrieval request to the second server. In response to the first source file acquisition request, the second server sends a target update source file to the first server, wherein the target update source file is used to update the target application; The first server loads the compiler based on a first type class loader, which is either the application class loader or the parent class loader of the application class loader. The first server uses the compiler based on the application class loader to compile the target update source file, thereby obtaining the compiled file corresponding to the target update source file; The first server updates the target application based on the compiled file.
2. The method according to claim 1, characterized in that, Before the first server sends a first source file retrieval request to the second server while the first server is running the target application, the method further includes: The second server receives a program update instruction from the target application, the program update instruction carrying a target file identifier corresponding to the target update source file; In response to the program update instruction, the second server obtains the target update source file based on the target file identifier.
3. The method according to claim 2, characterized in that, In response to the program update instruction, the second server obtains the target update source file based on the target file identifier, including: The second server sends a second source file retrieval request to the code hosting platform, wherein the second source file retrieval request carries the target file identifier, the code hosting platform stores at least one update source file of the target application, and the code hosting platform is used to determine the target update source file based on the target file identifier in the at least one update source file; Receive the target updated source file sent by the code hosting platform.
4. The method according to claim 3, characterized in that, The at least one update source file includes multiple update source files, each update source file corresponds to a file identifier, and the file identifiers corresponding to the multiple update source files are consecutive; The target file identifier includes a first identifier and a second identifier, and the target update source file includes the update source file corresponding to the first identifier, the update source file corresponding to the second identifier, and the update source file corresponding to the file identifier between the first identifier and the second identifier.
5. The method according to claim 1, characterized in that, When the first server is running the target application, it sends a first source file retrieval request to the second server, including: When the first server is running the target application, it periodically sends a first source file retrieval request to the second server.
6. A method for updating an application, characterized in that, The method is applied to a first server, and the method includes: With the target application running, obtain the target update source file, which is used to update the target application; The compiler is loaded based on the first type of loader, which is the application class loader or the parent class loader of the application class loader; The target update source file is compiled using the compiler based on the application class loader to obtain the compiled file corresponding to the target update source file; The target application is updated based on the compiled file.
7. The method according to claim 6, characterized in that, The step of obtaining the target update source file while the target application is running includes: While the target application is running, a request to retrieve the first source file is sent to the second server. Receive the target updated source file sent by the second server in response to the first source file retrieval request.
8. The method according to claim 7, characterized in that, When the target application is running, sending a first source file retrieval request to the second server includes: When the target application is running, requests to retrieve the first source file are periodically sent to the second server.
9. An electronic device, characterized in that, include: At least one processor; at least one memory; The at least one memory stores at least one program, which, when executed by the at least one processor, causes the electronic device to perform the application update method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on an electronic device, cause the electronic device to perform the application update method according to any one of claims 1 to 8.
11. A computer program product, characterized in that, include: Computer instructions, when executed on an electronic device, cause the electronic device to perform the application update method according to any one of claims 1 to 8.