Upgrading processing method and device, compiling end and equipment to be upgraded
By building optimized files that match the device's overall software library path environment at the compilation end and packaging them into the upgrade package, the problem of optimized files becoming invalid after device upgrades was solved, improving system boot and application running performance and enhancing user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-14
- Publication Date
- 2026-04-10
AI Technical Summary
During the device upgrade process, the library path environment that the upgrade package built by the compiler depends on is inconsistent with the library path environment actually used by the device's software. This causes the optimized files of the application and framework to become invalid after the upgrade, resulting in a decrease in system boot performance and application running performance.
The compiler obtains the class library path environment of the whole machine software of the device to be upgraded, builds matching optimization files, and packages them into the upgrade package to ensure that the optimization files are effective in the device after the upgrade, avoiding repeated optimization processing and JIT dynamic compilation.
It improves device boot performance and application running performance, reduces boot time and application startup speed, reduces system resource consumption, and enhances user experience.
Smart Images

Figure CN121832998A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of operating system technology, specifically to an upgrade processing method, apparatus, compiler, and device to be upgraded. Background Technology
[0002] When a device is upgraded, it uses an upgrade package built by the compiler to upgrade objects that need to be upgraded (such as components, single partitions, and modules (APEX)). However, the class library path environment (BootClassPath environment) that the compiler depends on when building the upgrade package is often inconsistent with the class library path environment actually used by the device's software. This will cause the optimized files (such as vdex, odex, art, etc.) of the application (APK) and framework (jar package) within the upgraded object to become invalid.
[0003] In some cases, the failure of optimization files for applications and JAR packages can cause the virtual machine (ART) to force optimization of these files during the boot process on first boot, thus prolonging boot time and reducing system boot performance. In other cases, the lack of effective optimization files can frequently trigger JIT dynamic compilation during application runtime, resulting in decreased application performance. Summary of the Invention
[0004] This application provides an upgrade processing solution that can effectively improve system boot performance and application running performance after upgrading components, single partitions, and modules (APEX), thereby enhancing the user experience.
[0005] The embodiments of this application provide the following technical solutions: According to one embodiment of this application, an upgrade processing method is applied to the compilation end. The method includes: obtaining the class library path environment of the whole machine software of the device to be upgraded; constructing a matching optimization file of the class library path environment based on the class library path environment; and packaging the matching optimization file into an upgrade package so that the device to be upgraded can be upgraded based on the upgrade package.
[0006] In some embodiments of this application, obtaining the class library path environment of the whole machine software of the device to be upgraded includes: obtaining a first intermediate product package corresponding to the actual software version of the whole machine software in the device to be upgraded and whole machine pre-optimization configuration information, wherein the first intermediate product package is an intermediate product package of the compiled whole machine software; and obtaining the class library path environment from the first intermediate product package according to the whole machine pre-optimization configuration information, wherein the class library path environment includes the system partition file where the class library path file is located.
[0007] In some embodiments of this application, the class library path environment includes the system partition file where the class library path file is located; the step of constructing a matching optimization file for the class library path environment based on the class library path environment includes: obtaining a second intermediate product package corresponding to the object to be upgraded, wherein the second intermediate product package is an intermediate product package of the compiled object; extracting the object partition file related to the object from the second intermediate product package; and constructing the matching optimization file for the class library path environment according to the object partition file and the system partition file.
[0008] In some embodiments of this application, the step of constructing the matching optimization file of the class library path environment based on the object partition file and the system partition file includes: replacing the file with the same name in the system partition file with the object partition file to obtain a merged system partition file; extracting class library path files from the merged system partition file to obtain a class library path file set; and generating the matching optimization file of the optimization target in the object based on the class library path file set.
[0009] In some embodiments of this application, generating the matching optimization file of the optimization target in the object based on the library path file set includes: obtaining pre-optimization configuration information and installation package file corresponding to the optimization target; and using a preset tool to generate the matching optimization file of the optimization target based on the library path file set, the pre-optimization configuration information, and the installation package file.
[0010] In some embodiments of this application, packaging the matching optimization file into the upgrade package includes: replacing the corresponding old optimization file in the merged system partition file with the matching optimization file to obtain an updated system partition file; generating a new partition image file of the object based on the updated system partition file; and packaging the new partition image file into the upgrade package of the object.
[0011] In some embodiments of this application, the step of packaging the new partition image file into the upgrade package of the object includes: obtaining the object upgrade script and upgrade metadata file, wherein the upgrade metadata file contains a description tag for the matching optimization file; and packaging the new partition image file, the object upgrade script, and the upgrade metadata file into the upgrade package of the object.
[0012] In some embodiments of this application, the upgrade metadata file is obtained by: obtaining the whole machine metadata file from the first intermediate product package; obtaining the object metadata file from the second intermediate product package; and merging the whole machine metadata file and the object metadata file to obtain the upgrade metadata file.
[0013] In some embodiments of this application, before obtaining the first intermediate product package corresponding to the actual software version of the whole machine software in the device to be upgraded, the method further includes: obtaining the basic software package corresponding to the actual software version from the server, wherein the basic software package includes the first intermediate product package, whole machine pre-optimization configuration information and preset tools.
[0014] In some embodiments of this application, before obtaining the second intermediate product package corresponding to the object to be upgraded, the method further includes: obtaining the object software package corresponding to the object from the server, wherein the object software package includes the second intermediate product package and pre-optimization configuration information corresponding to the optimization target in the object.
[0015] According to one embodiment of this application, an upgrade processing method is applied to a device to be upgraded. The method includes: obtaining an upgrade package, wherein the upgrade package is constructed by the compiler based on a matching optimization file, and the matching optimization file is constructed by the compiler based on the class library path environment of the whole machine software of the device to be upgraded; and performing an object upgrade based on the upgrade package.
[0016] According to one embodiment of this application, an upgrade processing apparatus is applied to a compilation end. The apparatus includes: an environment acquisition module, configured to: acquire the class library path environment of the whole machine software of the device to be upgraded; a construction module, configured to: construct a matching optimization file of the class library path environment based on the class library path environment; and a generation module, configured to: package the matching optimization file into an upgrade package, so that the device to be upgraded can be upgraded based on the upgrade package.
[0017] According to one embodiment of this application, an upgrade processing apparatus is applied to a device to be upgraded. The apparatus includes: an upgrade package acquisition module, configured to: acquire an upgrade package, wherein the upgrade package is constructed by the compiler based on a matching optimization file, and the matching optimization file is constructed by the compiler based on the class library path environment of the whole machine software of the device to be upgraded; and an upgrade module, configured to: perform object upgrades based on the upgrade package.
[0018] According to another embodiment of this application, a storage medium stores a computer program thereon, which, when executed by a processor of a compiler, causes the compiler to execute the method described in the embodiment of the compiler side of this application.
[0019] According to another embodiment of this application, a storage medium storing a computer program, when the computer program is executed by the processor of the device to be upgraded, causes the device to be upgraded to perform the method described in the embodiment of the device to be upgraded in this application.
[0020] According to another embodiment of this application, a compiler may include: a memory storing a computer program; and a processor reading the computer program stored in the memory to execute the methods described in the embodiments of this application.
[0021] According to another embodiment of this application, an upgradeable device may include: a memory storing a computer program; and a processor reading the computer program stored in the memory to execute the methods described in the embodiments of this application.
[0022] According to another embodiment of this application, a computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor at a compiler reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the compiler to perform the methods provided in the various optional implementations described in the embodiments of this application.
[0023] According to another embodiment of this application, a computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor of a device to be upgraded reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the device to be upgraded to perform the methods provided in the various optional implementations described in the embodiments of this application.
[0024] In this embodiment of the application, the compiler can: obtain the class library path environment of the whole machine software of the device to be upgraded; construct a matching optimization file for the class library path environment based on the class library path environment; and package the matching optimization file into an upgrade package so that the device to be upgraded can be upgraded based on the upgrade package.
[0025] In this embodiment of the application, during the construction phase of the upgrade package for the objects in the device to be upgraded, the compiler builds a matching optimization file based on the class library path environment of the whole machine software of the device to be upgraded, and packages the matching optimization file into the upgrade package. After the device to be upgraded performs object upgrade based on the upgrade package, the device will detect that the matching optimization file is valid when it boots up. The system will not force the optimization of the optimization file to be re-executed during the boot phase, and JIT dynamic compilation will not be frequently triggered during application operation. Overall, it effectively improves the system boot performance and application running performance after the upgrade of objects such as components, single partitions and modules (APEX), and improves the user experience. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 An architecture diagram of an upgrade processing system according to an embodiment of this application is shown.
[0028] Figure 2 A flowchart of an upgrade processing method according to an embodiment of this application is shown.
[0029] Figure 3 A schematic diagram of the structure of a basic software package according to an embodiment of this application is shown.
[0030] Figure 4 A schematic diagram of the structure of an object software package according to an embodiment of this application is shown.
[0031] Figure 5 A flowchart of an upgrade processing method according to another embodiment of this application is shown.
[0032] Figure 6 A schematic diagram of the overall software structure according to an embodiment of this application is shown.
[0033] Figure 7 An upgrade process flowchart according to an example of this application is shown.
[0034] Figure 8 A flowchart illustrating the basic software package construction process according to an example of this application is shown.
[0035] Figure 9 A flowchart illustrating an example of object package construction according to this application is shown.
[0036] Figure 10 An optimized file update flowchart according to an example of this application is shown.
[0037] Figure 11 A flowchart illustrating an example of an upgrade package packaging process according to this application is shown.
[0038] Figure 12 A block diagram of an upgrade processing apparatus according to an embodiment of this application is shown.
[0039] Figure 13 A block diagram of an upgrade processing apparatus according to another embodiment of this application is shown.
[0040] Figure 14A block diagram of a device to be upgraded according to one embodiment of this application is shown. Detailed Implementation
[0041] The present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments provided herein are merely illustrative of the present disclosure and are not intended to limit the present disclosure. Furthermore, the embodiments provided below are some embodiments for implementing the present disclosure, and not all embodiments for implementing the present disclosure. Unless otherwise specified, the technical solutions described in the embodiments of the present disclosure can be implemented in any combination. It should be noted that, in the embodiments of this disclosure, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a method or apparatus that includes a list of elements includes not only the elements expressly described, but also other elements not expressly listed, or elements inherent to implementing the method or apparatus. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other related elements (e.g., steps in the method or units in the apparatus; for example, a unit may be a portion of circuitry, a portion of a processor, a portion of a program or software, etc.) in the method or apparatus that includes that element. For example, the upgrade processing method provided in this embodiment includes a series of steps, but the upgrade processing method provided in this embodiment is not limited to the steps described. Similarly, the upgrade processing apparatus provided in this embodiment includes a series of units, but the apparatus provided in this embodiment is not limited to the units explicitly described, and may also include units that need to be set up for obtaining relevant information or processing based on information. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of this disclosure. It is understood that in the specific implementation of this application, relevant data is involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards.
[0042] When a device is upgraded, it uses an upgrade package built by the compiler to upgrade objects that need to be upgraded (such as components, single partitions, and modules (APEX)). However, the class library path environment (BootClassPath environment) that the compiler relies on when building the upgrade package is often inconsistent with the class library path environment actually used by the device's overall software. This causes the optimized files (such as vdex, odex, and art files) of the application (APK) and framework (jar package) within the upgraded object to become invalid. In some cases, the invalid optimized files of the application (APK) and framework (jar package) cause the virtual machine (ART) to forcibly perform optimization processing of the optimized files during the boot process on the first boot, prolonging the boot time and resulting in a decrease in system boot performance. In other cases, during application operation, the lack of effective optimized files will frequently trigger JIT dynamic compilation, causing a decrease in application runtime performance.
[0043] Specifically, the compiler builds the upgrade package based on the first class library path environment (BootClassPath environment). However, the actual operating environment of the device software often uses the second class library path environment. The first and second class library path environments are frequently inconsistent. Therefore, the upgraded new objects will be updated to use the first class library path environment. The old optimized files (such as vdex, odex, and art files) of the applications (APKs) and frameworks (JAR packages) in these new objects will not be updated during the upgrade (currently, the upgrade package does not carry optimized files), and these old optimized files do not match the second class library path environment. Therefore, the optimized files of the applications and JAR packages in the upgraded objects will be deemed invalid by the system at runtime due to the inconsistency in the environment.
[0044] In some cases, if the system's post-upgrade optimization strategy is set to high-speed mode, when the device detects an invalid optimization file upon first boot after the upgrade, the virtual machine (ART) will force the optimization of the application (APK) and framework (JAR package) within the new object to be re-executed during the boot process. This process involves a large amount of code compilation and cache data writing, which will compete for system resources, leading to an increase in system boot time and a decrease in system boot performance. In other cases, if the system's post-upgrade optimization strategy is set to verify mode, the system will not force the optimization of the optimization file upon boot when the device detects an invalid optimization file. However, during application operation, the lack of a valid optimization file will frequently trigger JIT dynamic compilation, causing slower application startup speed, increased system resource consumption, and a decrease in application performance.
[0045] Optimized files (DEX (Dalvik Executable) files) are executable files optimized for performance and resource consumption. These files can include vdex, odex, and art files. The odex (Optimized Dalvik Executable) file is an optimized executable file generated by the ART virtual machine using AOT (Ahead-Of-Time) compilation technology. It stores the application's bytecode, class information, and related data structures. The vdex (Verifier Dalvik Executable) file is also an optimized executable file generated by ART using AOT technology. It stores verification information and metadata from the DEX file and is an important supplement to the ODEX file. The art file stores the native machine code compiled using AOT.
[0046] To address these issues, this application provides an upgrade solution that can effectively improve system boot performance and application running performance after upgrading components, single partitions, and modules (APEX), thereby enhancing the user experience.
[0047] like Figure 1 As shown, an example upgrade processing system 100 may include at least a compilation terminal 101 and a device to be upgraded 102. The compilation terminal 101 may be a server or terminal capable of compiling and building upgrade packages. The device to be upgraded 102 may be a mobile phone, smartwatch, robot, virtual reality device, in-vehicle device, home appliance, etc.
[0048] For example, compiler 101 can: obtain the class library path environment of the whole machine software of the device to be upgraded; construct a matching optimization file for the class library path environment based on the class library path environment; and package the matching optimization file into an upgrade package so that the device to be upgraded can be upgraded based on the upgrade package. Device 102 to be upgraded can: obtain an upgrade package, which is constructed by the compiler based on the matching optimization file, and the matching optimization file is constructed by the compiler according to the class library path environment of the whole machine software of the device to be upgraded; and perform an object upgrade based on the upgrade package. The upgrade package constructed by compiler 101 can be transmitted indirectly or directly to device 102 to be upgraded, and this application does not impose any special limitations on this.
[0049] The following is a detailed description of the relevant embodiments of the upgrade processing solution provided in this application.
[0050] First, let's describe the relevant embodiments of this application from the perspective of the compilation side, such as... Figure 2As shown, the upgrade processing method executed by the compiler may include steps S210 to S230.
[0051] Step S210: Obtain the class library path environment of the whole machine software of the device to be upgraded; Step S220: Construct a matching optimization file for the library path environment based on the library path environment; Step S230: Package the matching optimization files into the upgrade package so that the device to be upgraded can be upgraded based on the upgrade package.
[0052] The term "complete system software" refers to the system software of the entire device being upgraded. Specifically, it can be the complete system software built by the device manufacturer based on an operating system (such as Android). Complete system software can comprise the entire chain of system software, including the operating system, driver layer, middleware, and application layer.
[0053] The BootClassPath environment is the runtime environment based on the BootClassPath. Specifically, the BootClassPath environment corresponds to the system partition file where the BootClassPath file (i.e., the BootClassPath JAR file) is located. The BootClassPath is the set of basic library paths set and loaded by the virtual machine during the Zygote process startup phase at runtime. It includes the core libraries required by the virtual machine (such as core-oj.jar, framework.jar, service.jar, etc.).
[0054] During the build phase of the upgrade package for objects in the device to be upgraded (such as components, single partitions, and modules (APEX)), the compiler obtains the class library path environment (BootClassPath environment) of the device's overall software. Then, it builds a matching optimization file for this class library path environment. This matching optimization file is an optimization file that matches the class library path environment of the device's overall software (such as vdex, odex, art, etc. optimization files), meaning that this matching optimization file can directly take effect in the class library path environment of the device's overall software.
[0055] The matching optimization file is packaged into the upgrade package. After the upgraded device performs an object upgrade based on this upgrade package, the optimization files of the optimized targets (such as applications (APKs) and frameworks (JAR packages)) in the upgraded object will be updated to the matching optimization file. Therefore, upon the first boot of the upgraded device, the system will detect that the matching optimization file is valid. Consequently, the system will not force a re-execution of the optimization file during the boot process, resulting in faster device boot efficiency and effectively improving the boot performance of the upgraded system. Furthermore, the application will not lack a valid optimization file during operation, thus avoiding frequent JIT dynamic compilation. This leads to faster application startup and reduced system resource consumption, effectively improving the performance of upgraded applications.
[0056] In this embodiment of the application, during the construction phase of the upgrade package for the objects in the device to be upgraded, the compiler builds a matching optimization file based on the class library path environment of the whole machine software of the device to be upgraded, and packages the matching optimization file into the upgrade package. After the device to be upgraded performs object upgrade based on the upgrade package, the device will detect that the matching optimization file is valid when it boots up. The system will not force the optimization of the optimization file to be re-executed during the boot phase, and JIT dynamic compilation will not be frequently triggered during application operation. Overall, it effectively improves the system boot performance and application running performance after the upgrade of objects such as components, single partitions and modules (APEX), and improves the user experience.
[0057] The following description Figure 2 Further optional specific embodiments are provided for each step performed during the upgrade process described in the example.
[0058] In one embodiment, step S210, obtaining the class library path environment of the whole machine software of the device to be upgraded, may include: obtaining the first intermediate product package corresponding to the actual software version of the whole machine software in the device to be upgraded and the whole machine pre-optimization configuration information, wherein the first intermediate product package is the intermediate product package of the compiled whole machine software; and obtaining the class library path environment from the first intermediate product package according to the whole machine pre-optimization configuration information, wherein the class library path environment includes the system partition file where the class library path file is located.
[0059] The server or local repository can retrieve the first intermediate artifact package corresponding to the actual software version of the complete machine software (i.e., the software version of the complete machine software currently deployed on the device to be upgraded, such as version number or version identifier, etc.) and the complete machine pre-optimization configuration information. The first intermediate artifact package is the intermediate artifact package (MID package) of the compiled complete machine software of the actual software version. This first intermediate artifact package may include the system partition file (which includes the first partition file of all objects in the complete machine software), the complete machine image file (which includes the first image file of all objects in the complete machine software), and the complete machine metadata file (such as the META folder, which may include preset metadata, preset signature information, and preset upgrade scripts required during the creation and upgrade process of the upgrade package for all objects in the complete machine software). The complete machine pre-optimization configuration information is the preset optimization configuration information of the complete machine software. This pre-optimization configuration information may include the pre-optimization configuration information of all optimization targets within the complete machine software (such as applications (APK) and frameworks (jar packages)). The pre-optimization configuration information may include the storage location of the class library path (BootClassPath) file, optimization rules, compilation architecture, and other information.
[0060] Based on the pre-optimized configuration information of the entire machine, after decompressing the first intermediate product package, the library path environment can be obtained from the first intermediate product package. This library path environment includes the system partition file where the library path file is located. Specifically, based on the storage location of the library path (BootClassPath) file in the pre-optimized configuration information of all optimization targets in the pre-optimized configuration information of the entire machine, the system partition file containing the library path (BootClassPath) file (i.e., all first partition files containing the library path (BootClassPath) file) can be determined. The system partition file containing the library path (BootClassPath) file can then be obtained from the first intermediate product package as the library path environment of the entire machine software.
[0061] Furthermore, before obtaining the first intermediate product package corresponding to the actual software version of the whole machine software in the device to be upgraded, it may also include: obtaining the basic software package corresponding to the actual software version from the server, wherein the basic software package includes the first intermediate product package, whole machine pre-optimization configuration information and preset tools.
[0062] Based on the actual software version, the system retrieves the corresponding base software package (i.e., the system software target package) from a predetermined server. This base software package is a pre-built package designed to ensure the generation of "matching optimization files that match the system software's library path environment." See also... Figure 3The basic software package 300 may include a first intermediate product package 310, whole machine pre-optimized configuration information 320, and preset tools 330. The preset tools are preset tools used to generate matching optimization files. The first intermediate product package 310 may include a system partition file 311 (the system partition file includes the first partition file of all objects in the whole machine software), a whole machine image file 312 (the whole machine image file includes the first image file of all objects in the whole machine software), and a whole machine metadata file 313 (such as a META folder, which may include preset metadata, preset signature information, and preset upgrade scripts required for the creation and upgrade process of the upgrade package for all objects in the whole machine software).
[0063] When building the upgrade package, the base package corresponding to the actual software version is obtained from the server. After decompressing the base package, the first intermediate product package corresponding to the actual software version of the whole machine software and the whole machine pre-optimization configuration information can be obtained from the base package. This further ensures the consistency and matching of the generated matching optimization file with the class library path environment of the whole machine software of the device to be upgraded.
[0064] Optionally, in other embodiments, step S210, obtaining the class library path environment of the whole machine software of the device to be upgraded, may include: obtaining the class library path environment input by the user, wherein the class library path environment includes the system partition file containing the class library path file input by the user.
[0065] In one embodiment, in step S220, the library path environment includes the system partition file where the library path file is located; constructing a matching optimization file for the library path environment based on the library path environment may include: obtaining a second intermediate product package corresponding to the object to be upgraded, wherein the second intermediate product package is an intermediate product package of the compiled object; extracting the object-related object partition file from the second intermediate product package; and constructing a matching optimization file for the library path environment based on the object partition file and the system partition file.
[0066] The second intermediate artifact package corresponding to the object to be upgraded can be obtained from the server or local library. This second intermediate artifact package is the compiled intermediate artifact package (MID package) of the object, that is, it is compiled based on the latest code of the object. The second intermediate artifact package may include the second partition file (i.e., the object partition file) related to the object and the object metadata file (such as the META folder, which may include the preset metadata required for the creation of the upgrade package and the upgrade process of the object to be upgraded).
[0067] Extract the object partition file related to the object to be upgraded from the second intermediate product package. The system partition file where the previously obtained class library path file is located matches the class library path environment of the whole machine software. The object partition file obtained in this step matches the latest code of the object. Combining the object partition file and the system partition file, a matching optimization file for the class library path environment of the whole machine software of the device to be upgraded can be reliably constructed.
[0068] Furthermore, in one embodiment, before obtaining the second intermediate product package corresponding to the object to be upgraded, the method may further include: obtaining the object software package corresponding to the object from the server, wherein the object software package includes the second intermediate product package and pre-optimized configuration information corresponding to the optimization target in the object.
[0069] Retrieve the latest object package (i.e., the object target package) from the server. This object package is a pre-built package designed to further ensure the generation of match-optimized files that match the class library path environment of the system software. See also Figure 4 The object package 400 may include a second intermediate product package 410 and pre-optimization configuration information 420 for optimization targets (such as pre-optimization configuration information corresponding to optimization target 1, pre-optimization configuration information corresponding to optimization target 2, etc.). The second intermediate product package 410 may include object partition files 411 related to the upgraded object and object metadata files 412 (such as a META folder, the object metadata file may include metadata required during the creation of the upgrade package and the upgrade process of the object, etc.). The object partition files 411 related to the object may include the installation package file (APK file) and the old optimization file for each optimization target.
[0070] When building the upgrade package, the latest object package of the object to be upgraded is obtained from the server. The object package is decompressed, and the second intermediate product package of the object and the pre-optimized configuration information corresponding to the optimization target in the object can be obtained from the object package. This further ensures the consistency and matching of the generated matching optimization file with the class library path environment of the whole machine software of the device to be upgraded.
[0071] Optionally, in other embodiments, when obtaining the class library path environment of the whole machine software of the device to be upgraded in step S220, the second intermediate product package corresponding to the object to be upgraded input by the user can be obtained.
[0072] Furthermore, in one embodiment, constructing a matching optimization file for the library path environment based on the object partition file and the system partition file includes: replacing the file with the same name in the system partition file with the object partition file to obtain a merged system partition file; extracting library path files from the merged system partition file to obtain a library path file set; and generating a matching optimization file for the optimization target in the object based on the library path file set.
[0073] The system partition file containing the BootClassPath file (i.e., the first partition file of all files containing the BootClassPath file) includes the first partition file of this object. The object partition file is the second partition file associated with this object. The system partition file with the same name is replaced with the object partition file (i.e., the first partition file associated with this object in the system partition file is replaced with the second partition file associated with this object). The system partition file after replacing the object partition file is the merged system partition file.
[0074] The merged system partition file contains both the first partition file (containing the BootClassPath file under the system software) and the latest second partition file related to the object. All BootClassPath files are extracted from the merged system partition file; the collection of extracted BootClassPath files constitutes the BootClassPath file set. This BootClassPath file set accurately corresponds to the system software's BootClassPath environment. Matching optimization files for the optimization targets in the object are generated based on this BootClassPath file set, further ensuring the consistency between the matching optimization files and the BootClassPath environment of the device to be upgraded.
[0075] Furthermore, in one embodiment, generating a matching optimization file for the optimization target in the object based on the library path file set may include: obtaining pre-optimization configuration information and installation package files corresponding to the optimization target; and using a preset tool to generate a matching optimization file for the optimization target based on the library path file set, pre-optimization configuration information, and installation package files.
[0076] For each optimization target in the object to be upgraded (e.g., not every application within a component), obtain the pre-optimization configuration information (which may include the library path, optimization rules, and compilation architecture of the optimization target) and the installation package file (i.e., the APK file) corresponding to the optimization target.
[0077] Using a pre-defined tool for generating optimization files, combined with the library path file set, pre-optimized configuration information of the optimization target, and installation package files, a matching optimization file (such as vdex, odex, art, etc.) that matches the library path environment of the whole machine software can be accurately generated. This operation is repeated to generate a corresponding matching optimization file for each optimization target in the object to be upgraded.
[0078] Furthermore, in step S230, packaging the matching optimization file into the upgrade package may specifically include: replacing the corresponding old optimization file in the merged system partition file with the matching optimization file to obtain the updated system partition file; generating a new partition image file for the object based on the updated system partition file; and packaging the new partition image file into the upgrade package for the object.
[0079] The merged system partition file includes the latest second partition file related to the object to be upgraded. This second partition file includes the installation package file (APK file) of the optimization target and the old optimization file. The corresponding old optimization file in the merged system partition file is replaced with the matching optimization file to obtain the updated system partition file (that is, the corresponding old optimization file of each optimization target in the merged system partition file is replaced with the matching optimization file of each optimization target in the object to be upgraded). The merged system partition file that has replaced the matching optimization file is the updated system partition file.
[0080] Based on the updated system partition file containing the matching optimization file and installation package file of the optimization target in the object, a new partition image file of the object is compressed and generated. The new partition image file is packaged into the upgrade package of the object. After the upgraded device uses the upgrade package to upgrade the object, it will automatically apply the matching optimization file of the optimization target in the object. After the object is upgraded, the device will detect the matching optimization file when it boots up and determine that the matching optimization file is valid.
[0081] Specifically, the obtained system software library path environment (the system partition file where the library path file is located) can be placed in a temporary directory. Object partition files related to the objects extracted from the second intermediate product package are also placed in this temporary directory. The aforementioned replacement operations can be performed in this temporary directory, that is, a new object partition image file is generated in the temporary directory.
[0082] Furthermore, in one embodiment, packaging the new partition image file into the object's upgrade package includes: obtaining the object upgrade script and upgrade metadata file, wherein the upgrade metadata file contains a description tag matching the optimization file; and packaging the new partition image file, the object upgrade script, and the upgrade metadata file into the object's upgrade package.
[0083] The object upgrade script and upgrade metadata file can be obtained from the predetermined location. The object upgrade script (update-script) can contain instructions related to this object upgrade, such as instructions to upgrade only the specified target partition. The upgrade metadata file can include metadata required for this object upgrade and description tags for matching optimization files. The object upgrade script and upgrade metadata file can be constructed by the relevant user according to their needs. The new partition image file, object upgrade script, and upgrade metadata file are compressed and packaged into the object upgrade package. The device to be upgraded can then complete the object upgrade using the new partition image file based on the object upgrade script and upgrade metadata file.
[0084] Furthermore, in one embodiment, the upgrade metadata file is obtained as follows: the whole machine metadata file is obtained from the first intermediate product package; the object metadata file is obtained from the second intermediate product package; the whole machine metadata file and the object metadata file are merged to obtain the upgrade metadata file.
[0085] Obtain the system metadata file from the first intermediate product package and the object metadata file from the second intermediate product package. The system metadata file (such as the META folder, which may include preset metadata, preset signature information, and preset upgrade scripts required for the creation and upgrade of upgrade packages for all objects in the system software) and the object metadata file (such as the META folder, which may include preset metadata required for the creation and upgrade of upgrade packages for the object being upgraded) can be placed in a temporary directory. The system metadata file and the object metadata file are merged in the temporary directory according to predetermined rules. After merging, an upgrade metadata file is obtained, which can further accurately describe the metadata required for the object upgrade.
[0086] In this process, after replacing the corresponding old optimized file in the merged system partition file with a matching optimized file, a description tag for the matching optimized file can be added to the metadata directory of the object to be upgraded in the upgrade metadata file. Then, when the device to be upgraded uses the upgrade package, the matching optimized file can be deployed in the object according to the description tag of the matching optimized file.
[0087] First, the relevant embodiments of this application will be described from the device side, such as... Figure 5 As shown, the upgrade process performed on the device side may include steps S510 to S520.
[0088] Step S510: Obtain the upgrade package. The upgrade package is built by the compiler based on the matching optimization file. The matching optimization file is built by the compiler according to the class library path environment of the whole machine software of the device to be upgraded. Step S520: Perform object upgrade based on the upgrade package.
[0089] The upgrade package built by the compiler can be transmitted to the device to be upgraded indirectly or directly by the compiler; this application does not impose any special restrictions on this. After obtaining the upgrade package, the device to be upgraded can upgrade the corresponding object (such as a component, single partition, or module) based on the upgrade package.
[0090] The upgrade package can include a new partition image file, an object upgrade script, and an upgrade metadata file. The device to be upgraded can use the new partition image file to complete the object upgrade based on the object upgrade script and the upgrade metadata file. In the upgrade metadata file, a description tag for the matching optimization file is added to the metadata directory corresponding to the object to be upgraded. Then, when the device to be upgraded uses the upgrade package to upgrade, it can deploy the matching optimization file in the object based on the description tag of the matching optimization file.
[0091] To facilitate better implementation of the upgrade processing method provided in the embodiments of this application, the above embodiments are further described below in conjunction with the upgrade process of components in a device (that is, the object to be upgraded in this scenario is specifically a component) in a specific scenario. In this scenario, the upgrade of components in the device is achieved by applying the above embodiments of this application.
[0092] See Figure 6 In one example, the overall software 600 in the device can be functionally divided into system components 610, chip components 620, product components 630, and other components 640 (such as configuration components, product customization components, etc.). It can be understood that the overall software 600 in the device can also be divided into other components according to other classification methods. In this scenario, the object to be upgraded specifically refers to the component in the overall software that needs to be upgraded.
[0093] See Figure 7 In this scenario, the device upgrade process may include steps S710 to S740.
[0094] Step S710: Build the basic software package for the entire system (i.e., the system software Target package). See [link / reference] Figure 8 Step S710 may specifically include steps S711 to S714.
[0095] Step S711: Compile the first intermediate product package (first MID package) of the complete system software. The first intermediate product package can be compiled by executing native compilation instructions. The first intermediate product package is the intermediate product package (MID package) of the compiled actual software version of the complete system software. The first intermediate product package may include the system partition file (the system partition file includes the first partition file of all components in the complete system software), the complete system image file (the complete system image file includes the first image file of all components in the complete system software), the complete system metadata file, etc., required to generate the upgrade package.
[0096] Step S712: Generate the whole-machine pre-optimization configuration information (dexpreopt configuration) for the whole-machine software. Specifically, obtain the pre-optimization configuration information of the dex files of all optimization targets (such as applications (APKs) and frameworks (jar packages)) within the whole-machine software. The pre-optimization configuration information may include the storage location of the class library path (BootClassPath) file, optimization rules, compilation architecture, and other information. The whole-machine pre-optimization configuration information is composed of the pre-optimization configuration information of all optimization targets within the whole-machine software.
[0097] Step S713 generates a preset toolkit (dexpreopt toolkit), which may include tools such as dex2oatd, dexpreopt_gen, aapt2, oatdump, and soong_zip. The dex2oatd tool can compile the .dex (Dalvik Executable) bytecode in the application into native machine code. The dexpreopt_gen tool can be used to generate optimization scripts; executing these scripts will generate optimized files. The aapt2 tool can be used for resource compilation and packaging. The oatdump tool can be used to analyze .oat files. The soong_zip tool is used to package files into a specific format (such as ZIP or image files).
[0098] Step S714: Upload to server archive. Specifically, the first intermediate product package (first MID package), the preset tool (dexpreopt tool package), and the whole machine pre-optimization configuration information (dexpreopt configuration) are compressed and packaged into the whole machine software base package (i.e., the whole machine software Target package), and the software version corresponding to the base package is marked (such as version number or version identifier, etc.), and the base package (i.e., the whole machine software Target package) is uploaded to the server for archive.
[0099] Step S720: Construct the component package (i.e., the component Target package). In this scenario, the "object" to be upgraded is the "component" to be upgraded in the whole machine software. Specifically, the object package (i.e., the object Target package) is the component package (i.e., the component Target package). See also... Figure 9 Step S720 may specifically include steps S721 to S723.
[0100] Step S721: Compile the second intermediate artifact package (second MID package) of the component to be upgraded. The second intermediate artifact package can be compiled by executing native compilation instructions. This second intermediate artifact package is the compiled intermediate artifact package (MID package) of the component, meaning it is compiled based on the latest code of the component. The second intermediate artifact package may include the component-related second partition file (i.e., the component partition file) and component metadata files (such as a META folder, which may include preset metadata required for the component's upgrade package creation and upgrade process). The component partition file may include the installation package file (APK file) and old optimization files for each optimization target within the component.
[0101] Step S722: Generate pre-optimized configuration information (dexpreopt configuration) for the component to be upgraded. The pre-optimized configuration information includes the pre-optimized configuration information for each optimization objective within the component (e.g., pre-optimized configuration information corresponding to optimization objective 1, pre-optimized configuration information corresponding to optimization objective 2, etc.). The pre-optimized configuration information for the component is composed of the pre-optimized configuration information for all optimization objectives within the component.
[0102] Step S723: Upload to server archive. Specifically, the second intermediate product package (second MID package) and the pre-optimized configuration information of the component (dexpreopt configuration) are compressed and packaged into the component package (i.e., the component Target package), and the component package (i.e., the component Target package) is uploaded to the server archive.
[0103] Step S730: Update the component optimization file. For details, please refer to... Figure 10 Step S730 may include steps S731 to S738.
[0104] Step S731, prepare the environment. Specifically, (1) obtain the basic software package corresponding to the actual software version and the component software package from the server; decompress the basic software package to obtain the first intermediate product package corresponding to the actual software version of the whole machine software and the whole machine pre-optimization configuration information; decompress the component software package to obtain the second intermediate product package; (2) according to the whole machine pre-optimization configuration information, obtain the library path environment from the first intermediate product package, the library path environment includes the system partition file where the library path file is located, and copy the system partition file where the library path file is located to the temporary directory; and extract the component-related component partition file from the second intermediate product package and copy it to the temporary directory; (3) obtain the whole machine metadata file (such as the META folder) from the first intermediate product package, obtain the component metadata file (such as the META folder) from the second intermediate product package, and copy it to the temporary directory.
[0105] Step S732, merge processing. Specifically, in the temporary directory, (1) replace the file with the same name in the system partition file with the component partition file to obtain the merged system partition file; (2) merge the whole machine metadata file with the component metadata file to obtain the upgrade metadata file.
[0106] Step S733: Extract the library path files (i.e., extract the BootClassPath jar package). Specifically, extract the library path files from the merged system partition files to obtain a set of library path files. This involves directly extracting the BootClassPath jar package from the merged system partition files, and scanning the apex files within the merged system partition files. The apex files are then decompressed using the deapexer or apexd_host tool (available from the dexpreopt toolkit) to obtain the BootClassPath jar package from each apex file (e.g., / apex / com.android.art / javalib / core-oj.jar). These two BootClassPath jar packages constitute the set of library path files.
[0107] Step S734: Obtain optimization targets and configurations. This involves obtaining the pre-optimization configuration information and installation package file (APK file) corresponding to each optimization target (such as an application) within the component to be upgraded. Specifically, all pre-installed installation package files (APK files) under the component's related second partition file can be traversed, and the pre-optimization configuration information for a single optimization target (such as an application) can be obtained from the component's pre-optimization configuration information (dexpreopt configuration) by the name of the installation package file (APK file).
[0108] Step S735: Generate matching optimization files. That is, for each optimization target (such as an application) within the component, a preset tool is used to generate a matching optimization file based on the library path file set, the pre-optimization configuration information of the optimization target, and the installation package file. Specifically, the dexpreopt_gen tool can be used to generate an optimization script (such as dexpreopt_app.sh) for a single optimization target based on the library path file set, the pre-optimization configuration information of the individual optimization target, and the installation package file. Executing the optimization script for a single optimization target will generate the matching optimization file for that single optimization target. This process can be repeated for each optimization target within the component to generate a matching optimization file for each optimization target separately.
[0109] Step S736, update and replace the optimization files. (1) Replace the corresponding old optimization files in the merged system partition file with matching optimization files to obtain the updated system partition file (the merged system partition file includes the latest second partition file related to the component to be upgraded, which includes the installation package file (APK file) of each optimization target in the component and the old optimization files. Replace the corresponding old optimization files in the merged system partition file with matching optimization files to obtain the updated system partition file (that is, replace the corresponding old optimization files of each optimization target in the merged system partition file with the matching optimization files of each optimization target in the component to be upgraded). The merged system partition file that has replaced the matching optimization files is the updated system partition file). (2) Add the description tag of the matching optimization files to the metadata directory corresponding to the object to be upgraded in the upgrade metadata file.
[0110] Step S737, update the image file. (1) Delete the "partition image file related to the component to be upgraded" in the updated system partition file; (2) Based on the updated system partition file, generate a new partition image file for the component. The new partition image file of the component can include the installation package file (APK file) and matching optimization file for each optimization target in the component.
[0111] Step S738: Package the new complete system software package (complete system MID package). Specifically, the soong_zip tool can be used to package the "new partition image file of the component", "upgrade metadata file", etc., into a new complete system software package (complete system MID package) for subsequent creation of component upgrade packages.
[0112] Step S740: Build the component upgrade package. That is, package the new partition image file, component upgrade script, and upgrade metadata file into the object's upgrade package. For details, see [link to relevant documentation]. Figure 11 Step S740 may include steps S741 to S744.
[0113] Step S741: Unzip the new complete system software package (complete system MID package), which includes "new partition image file of components", "upgrade metadata file", etc.
[0114] Step S742: Package the image file. Specifically, extract the "new partition image file of the component" and "upgrade metadata file" from the new complete machine software package (complete machine MID package) and package them into the component's upgrade package.
[0115] Step S743: Create the component upgrade script for the component and package it into the component upgrade package. The component upgrade script (update-script) can contain instructions related to this object upgrade, such as instructions to upgrade only the specified target partition.
[0116] Step S744: Package and sign the upgrade package. Specifically, the soong_zip tool can be used to compress the component's upgrade package, and a signing tool can be used to sign the compressed upgrade package.
[0117] In this scenario, when upgrading components using the embodiments of this application, the compiler builds a matching optimization file based on the class library path environment of the whole machine software of the device to be upgraded during the construction phase of building the upgrade package of the components in the device to be upgraded. The matching optimization file is then packaged into the upgrade package. After the device to be upgraded performs component upgrades based on the upgrade package, the device will detect that the matching optimization file is valid when it boots up. The system will not force the optimization of the optimization file to be re-executed during the boot phase, and JIT dynamic compilation will not be frequently triggered during application operation. Overall, this effectively improves the system boot performance and application running performance after component upgrades, and enhances the user experience.
[0118] To facilitate better implementation of the upgrade processing method provided in the embodiments of this application, the embodiments of this application also provide an upgrade processing apparatus based on the above-described upgrade processing method. The meanings of the terms used are the same as in the upgrade processing method described above, and specific implementation details can be found in the descriptions in the method embodiments.
[0119] Figure 12 A block diagram of an upgrade processing apparatus according to one embodiment of this application is shown. Figure 12 The upgrade processing device 800 shown can be applied to the compilation end. The upgrade processing device 800 may include: an environment acquisition module 810, which can be used to: acquire the class library path environment of the whole machine software of the device to be upgraded; a construction module 820, which can be used to: construct a matching optimization file of the class library path environment based on the class library path environment; and a generation module 830, which can be used to: package the matching optimization file into an upgrade package so that the device to be upgraded can be upgraded based on the upgrade package.
[0120] In some embodiments of this application, when obtaining the class library path environment of the whole machine software of the device to be upgraded, the environment acquisition module 810 can be used to: obtain the first intermediate product package corresponding to the actual software version of the whole machine software in the device to be upgraded and the whole machine pre-optimization configuration information, wherein the first intermediate product package is the intermediate product package of the compiled whole machine software; and obtain the class library path environment from the first intermediate product package according to the whole machine pre-optimization configuration information, wherein the class library path environment includes the system partition file where the class library path file is located.
[0121] In some embodiments of this application, the class library path environment includes the system partition file where the class library path file is located; when constructing the matching optimization file of the class library path environment based on the class library path environment, the construction module 820 can be used to: obtain a second intermediate product package corresponding to the object to be upgraded, the second intermediate product package being an intermediate product package of the compiled object; extract the object partition file related to the object from the second intermediate product package; and construct the matching optimization file of the class library path environment according to the object partition file and the system partition file.
[0122] In some embodiments of this application, when constructing the matching optimization file of the class library path environment based on the object partition file and the system partition file, the construction module 820 can be used to: replace the file with the same name in the system partition file with the object partition file to obtain a merged system partition file; extract class library path files from the merged system partition file to obtain a class library path file set; and generate the matching optimization file of the optimization target in the object based on the class library path file set.
[0123] In some embodiments of this application, when generating the matching optimization file for the optimization target in the object based on the library path file set, the construction module 820 can be used to: obtain the pre-optimization configuration information and installation package file corresponding to the optimization target; and use a preset tool to generate the matching optimization file for the optimization target based on the library path file set, the pre-optimization configuration information, and the installation package file.
[0124] In some embodiments of this application, when packaging the matching optimization file into the upgrade package, the generation module 830 can be used to: replace the corresponding old optimization file in the merged system partition file with the matching optimization file to obtain an updated system partition file; generate a new partition image file of the object based on the updated system partition file; and package the new partition image file into the upgrade package of the object.
[0125] In some embodiments of this application, when packaging the new partition image file into the upgrade package of the object, the generation module 830 can be used to: obtain the object upgrade script and upgrade metadata file, wherein the upgrade metadata file contains a description tag for the matching optimization file; and package the new partition image file, the object upgrade script, and the upgrade metadata file into the upgrade package of the object.
[0126] In some embodiments of this application, the construction module 820 can be used to: obtain a complete machine metadata file from the first intermediate product package; obtain an object metadata file from the second intermediate product package; and merge the complete machine metadata file and the object metadata file to obtain the upgrade metadata file.
[0127] In some embodiments of this application, before obtaining the first intermediate product package corresponding to the actual software version of the whole machine software in the device to be upgraded, the device further includes a package acquisition module that can be used to: obtain the basic software package corresponding to the actual software version from the server, wherein the basic software package includes the first intermediate product package, whole machine pre-optimization configuration information and preset tools.
[0128] In some embodiments of this application, before obtaining the second intermediate product package corresponding to the object to be upgraded, the package acquisition module may be used to: obtain the object software package corresponding to the object from the server, wherein the object software package includes the second intermediate product package and pre-optimization configuration information corresponding to the optimization target in the object.
[0129] Figure 13 A block diagram of an upgrade processing apparatus according to another embodiment of this application is shown. Figure 13 The upgrade processing device 900 shown can be applied to the device to be upgraded. The upgrade processing device 900 may include: an upgrade package acquisition module 910, which can be used to: acquire an upgrade package, wherein the upgrade package is constructed by the compiler based on a matching optimization file, and the matching optimization file is constructed by the compiler based on the class library path environment of the whole machine software of the device to be upgraded; and an upgrade module 920, which can be used to: perform object upgrade based on the upgrade package.
[0130] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0131] Furthermore, this application embodiment also provides a device to be upgraded, such as... Figure 14 As shown, Figure 14 A block diagram of a device according to an embodiment of this application is shown, specifically: The upgrade may include components such as a processor 1001 with one or more processing cores, a memory 1002 with one or more computer-readable storage media, a power supply 1003, and an input unit 1004. Those skilled in the art will understand that... Figure 14The device structure shown does not constitute a limitation on the device and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. Wherein: The processor 1001 is the control center of the device, connecting various parts of the computer device via various interfaces and lines. It executes software programs and / or modules stored in the memory 1002, and calls data stored in the memory 1002, to perform various functions and process data. Optionally, the processor 1001 may include one or more processing cores; preferably, the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user page, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1001.
[0132] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory 1002 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.
[0133] The device also includes a power supply 1003 that supplies power to the various components. Preferably, the power supply 1003 can be logically connected to the processor 1001 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 1003 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0134] The device may also include an input unit 1004, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0135] Although not shown, the device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 1001 in the device can load the executable files corresponding to the processes of one or more computer programs into the memory 1002 according to the following instructions, and the processor 1001 runs the computer programs stored in the memory 1002, thereby realizing the various functions in the foregoing embodiments of this application.
[0136] For example, processor 1001 can perform the following: obtain the upgrade package, which is built by the compiler based on the matching optimization file, which is built by the compiler according to the class library path environment of the whole machine software of the device to be upgraded; and perform object upgrade based on the upgrade package.
[0137] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0138] Therefore, embodiments of this application also provide a storage medium storing a computer program that can be loaded by a processor to execute the steps in any of the methods provided in embodiments of this application.
[0139] The storage medium can be a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0140] Since the computer program stored in the storage medium can execute the steps of any of the methods provided in the embodiments of this application, the beneficial effects that the methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0141] According to another embodiment of this application, a computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor of the device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the device to perform the methods provided in the various optional implementations described in the embodiments of this application.
[0142] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0143] It should be understood that this application is not limited to the embodiments described above and shown in the accompanying drawings, but various modifications and changes can be made without departing from its scope.
Claims
1. An upgrade processing method, characterized in that, Applied to the compiler, the method includes: Obtain the class library path environment of the whole machine software of the device to be upgraded; Construct a matching optimization file for the library path environment based on the library path environment; The matching optimization file is packaged into an upgrade package so that the device to be upgraded can be upgraded based on the upgrade package.
2. The method according to claim 1, characterized in that, The process of obtaining the class library path environment of the whole machine software of the device to be upgraded includes: Obtain the first intermediate product package corresponding to the actual software version of the whole machine software in the device to be upgraded and the whole machine pre-optimization configuration information, wherein the first intermediate product package is the intermediate product package of the compiled whole machine software; Based on the pre-optimized configuration information of the whole machine, the class library path environment is obtained from the first intermediate product package. The class library path environment includes the system partition file where the class library path file is located.
3. The method according to claim 1, characterized in that, The library path environment includes the system partition file where the library path file is located; the step of constructing a matching optimization file for the library path environment based on the library path environment includes: Obtain the second intermediate product package corresponding to the object to be upgraded, wherein the second intermediate product package is the intermediate product package of the compiled object; Extract the object partition file related to the object from the second intermediate product package; Based on the object partition file and the system partition file, construct the matching optimization file for the class library path environment.
4. The method according to claim 3, characterized in that, The step of constructing the matching optimization file for the class library path environment based on the object partition file and the system partition file includes: The system partition file is merged by replacing the file with the same name in the object partition file. Extract the library path files from the merged system partition files to obtain a set of library path files; The matching optimization file for the optimization target in the object is generated based on the library path file set.
5. The method according to claim 4, characterized in that, The step of generating the matching optimization file for the optimization target in the object based on the library path file set includes: Obtain the pre-optimization configuration information and installation package file corresponding to the optimization target; Using a preset tool, the matching optimization file for the optimization target is generated based on the library path file set, the pre-optimization configuration information, and the installation package file.
6. The method according to claim 4, characterized in that, The step of packaging the matching optimization file into the upgrade package includes: The corresponding old optimized file in the merged system partition file is replaced with the matching optimized file to obtain the updated system partition file; Based on the updated system partition file, a new partition image file of the object is generated; Package the new partition image file into the upgrade package of the object.
7. The method according to claim 6, characterized in that, The step of packaging the new partition image file into the upgrade package of the object includes: Obtain the object upgrade script and upgrade metadata file, wherein the upgrade metadata file contains a description tag for the matching optimization file; The new partition image file, the object upgrade script, and the upgrade metadata file are packaged into the object's upgrade package.
8. The method according to claim 7, characterized in that, The upgrade metadata file was obtained in the following manner: Obtain the complete machine metadata file from the first intermediate product package; Obtain the object metadata file from the second intermediate product package; The system metadata file and the object metadata file are merged to obtain the upgrade metadata file.
9. The method according to claim 2, characterized in that, Before obtaining the first intermediate product package corresponding to the actual software version of the whole machine software in the device to be upgraded, the method further includes: Obtain the basic software package corresponding to the actual software version from the server. The basic software package includes the first intermediate product package, whole machine pre-optimization configuration information, and preset tools.
10. The method according to claim 3, characterized in that, Before obtaining the second intermediate product package corresponding to the object to be upgraded, the method further includes: Obtain the object package corresponding to the object from the server. The object package includes the second intermediate product package and the pre-optimization configuration information corresponding to the optimization target in the object.
11. An upgrade processing method, characterized in that, Applied to devices to be upgraded, the method includes: Obtain the upgrade package, which is built by the compiler based on the matching optimization file, and the matching optimization file is built by the compiler according to the class library path environment of the whole machine software of the device to be upgraded; The object is upgraded based on the upgrade package.
12. An upgrade processing apparatus, characterized in that, Applied to the compiler, the device includes: The environment acquisition module is used to: acquire the class library path environment of the whole machine software of the device to be upgraded; The building module is used to: build a matching optimization file for the library path environment based on the library path environment; The generation module is used to: package the matching optimization file into an upgrade package so that the device to be upgraded can be upgraded based on the upgrade package.
13. An upgrade processing apparatus, characterized in that, Applied to equipment to be upgraded, the device includes: The upgrade package acquisition module is used to: acquire an upgrade package, wherein the upgrade package is built by the compiler based on a matching optimization file, and the matching optimization file is built by the compiler according to the class library path environment of the whole machine software of the device to be upgraded; The upgrade module is used to: upgrade objects based on the upgrade package.
14. A compiler, characterized in that, include: Memory, which stores computer programs; A processor reads a computer program stored in memory to perform the method according to any one of claims 1 to 10.
15. A device to be upgraded, characterized in that, include: Memory, which stores computer programs; The processor reads a computer program stored in memory to execute the method of claim 11.