Software updating method, device and system

By analyzing the update features in the software update package and compiling and optimizing for related applications, the problem of poor application performance during the software update process is solved, and efficient software updates and optimized user experience is achieved.

CN119440565APending Publication Date: 2025-02-14HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310954302.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-28
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

During the software update process, electronic devices cannot effectively compile and optimize the applications installed in the system, resulting in poor application performance and affecting the user experience. At the same time, the existing technology compiles and optimizes all applications without distinction during system upgrade, resulting in too long update process and affecting the user experience.

Method used

Provides a software update method to compile and optimize for applications with coupled dependencies with these features by parsing update features in software update packages. This method includes obtaining software update packages, parsing update features, and compiling and optimizing related applications.

Benefits of technology

It realizes accurate compilation and optimization of applications during the software update process, improves software update efficiency, ensures the performance of applications after software update, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440565A_ABST
    Figure CN119440565A_ABST
Patent Text Reader

Abstract

The invention discloses a software updating method, device and system, and relates to the fields of terminal technology, artificial intelligence and the like. In the application, the electronic device can analyze the software update package after obtaining the software update package, and obtain update features, the update features including patch features or upgrade features; and then, the electronic equipment can compile and optimize the application program of the application having the coupling dependency relationship with the updating feature, or compile and optimize the application program of the application having the coupling dependency relationship with the updating feature and meeting the first condition. Based on the scheme, accurate application program compilation optimization can be realized, and waste of processing resources and extension of an updating process caused by compilation optimization of irrelevant applications can be avoided, so that the software updating efficiency can be improved, in addition, the performance (such as compatibility and execution efficiency) of the applications after software updating can be ensured, and the user experience can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of terminal technology, artificial intelligence, and in particular to a software updating method, device, and system. Background Art

[0002] With the rapid and diversified development of device hardware technology and software technology, electronic devices can realize a variety of functions by relying on the software running in them. Among them, when developers develop new functions, electronic devices usually need to perform system updates, such as patch repairs or system upgrades.

[0003] However, in some conventional software update processes, such as the patch repair process based on block devices, after completing the system update (i.e., the block device file update), the electronic device will not compile and optimize the applications installed in the system (such as third-party applications), which will cause the applications to not be updated adaptively according to the system, thereby affecting the subsequent performance of the applications. In other conventional software update processes, such as the system upgrade process based on dual images, after completing the system upgrade, the electronic device will indiscriminately compile and optimize all applications installed in the system. The compilation and optimization of a large number of irrelevant applications is not only unnecessary, but also causes the software update process to take too long, affecting the user experience. Summary of the invention

[0004] The present application provides a software update method, device and system, which can perform targeted compilation optimization of application software according to the specific patch characteristics or upgrade characteristics of the software during the software update process, while improving the software update efficiency, ensuring the performance of the application after the software update, and improving the user experience.

[0005] In order to achieve the above objectives, this application adopts the following technical solutions:

[0006] In a first aspect, a software update method is provided, which is applied to an electronic device, and the method includes: the electronic device obtains a software update package; the electronic device parses the obtained software update package to obtain update features, wherein the update features include patch features or upgrade features; the electronic device compiles and optimizes an application program of an application that has a coupling dependency relationship with the above-mentioned update features, or compiles and optimizes an application program of an application that has a coupling dependency relationship with the above-mentioned update features and satisfies a first condition.

[0007] For example, the software update package obtained by the electronic device is a patch package or an upgrade package. Among them, the patch package is mainly used to patch or repair the security loopholes or operation bugs (errors) of the software, and the upgrade package is mainly used to add new functions to the software or update certain functions of the software. Of course, the upgrade package can also be used to patch or repair the security loopholes or operation bugs (errors) of the software.

[0008] In some embodiments, the electronic device can trigger a request for a software update package from the cloud-side device based on a user operation (such as clicking an upgrade button, etc.). Correspondingly, after receiving the request, the cloud-side device can send the latest version of the software package (such as a software update package) to the electronic device.

[0009] In some embodiments, the cloud-side device may also actively send a software update package to the electronic device, such as actively sending a software update package to the electronic device when a new version of the software package is developed, or sending a software update package to the electronic device when it is identified that the software version in the electronic device is an old version. According to the scheme provided in the first aspect above, after receiving the software update package, the electronic device can perform targeted compilation optimization on the application program according to the specific update characteristics of the software. For example, compilation optimization is performed on an application program that has a coupling dependency relationship with a patch feature or an upgrade feature, or compilation optimization is performed on an application program that has a coupling dependency relationship with a patch feature or an upgrade feature and meets certain conditions (such as the first condition). Based on this scheme, not only accurate application compilation optimization can be achieved, but also the performance of the application after the software update (such as compatibility and execution efficiency, etc.) can be guaranteed while improving the efficiency of software updates, thereby improving the user experience.

[0010] As a possible implementation method, the electronic device parses the software update package to obtain the update feature, including: the electronic device parses the software update package to obtain the patch file; the electronic device mounts the patch file as a patch device; the electronic device reads the compilation subdirectory of the patch device to obtain the update feature, and the update feature is the patch feature. Based on this, when the software update package is a patch package, the electronic device can smoothly obtain the patch file by mounting the patch file as a patch device, so as to subsequently perform targeted application compilation optimization based on the patch file, realize accurate application compilation optimization, and improve the software update efficiency while ensuring the performance of the application after the software update.

[0011] As a possible implementation method, the patch feature includes a first system library file that has a coupling dependency relationship with the first application, and the electronic device compiles and optimizes the application program of the application that has a coupling dependency relationship with the update feature, including: the electronic device merges the patch device with the first system device corresponding to the current system library file in the electronic device to generate a second system device; the electronic device extracts the system library file of the second system device, wherein the system library file includes the first system library file; the electronic device identifies the first application that has been patched or repaired in the system library file of the second system device; the electronic device compiles and optimizes the first application. Based on this, the electronic device can update the system device according to the patch device, and successfully identify the application that has a coupling dependency relationship with the patch feature according to the system library file of the updated system device, and then align and perform targeted compilation optimization of the application program, so as to achieve accurate application compilation optimization, and improve the software update efficiency while ensuring the performance of the application after the software update.

[0012] As a possible implementation, the first application includes one or more applications in the electronic device. The solution provided in the present application for targeted compilation and optimization of application programs according to specific update features of software can be applied to a variety of patch scenarios or upgrade scenarios.

[0013] For example, when there are multiple applications that are coupled with the update feature, the electronic device can automatically compile and optimize the application programs of the multiple applications; for another example, when there is only one application that is coupled with the update feature, the electronic device can automatically compile and optimize the application program of the one application, and can be executed dynamically and accurately according to the specific situation. Based on this, not only the waste of processing resources and the extension of the update process caused by the compilation optimization of irrelevant applications is avoided, but also the performance of the application after the software update can be guaranteed.

[0014] As a possible implementation, the first system library file is related to the first function, and the first application includes an application with the first function in the electronic device. Based on this, when the update feature is related to a certain function, the electronic device can compile and optimize the application program with the function in a targeted manner, which not only avoids the waste of processing resources and the extension of the update process caused by the compilation optimization of irrelevant applications, but also ensures the performance of the application after the software update.

[0015] Exemplarily, the first function may include but is not limited to a payment function, a wireless communication function (such as a near-field communication function, etc.), a code scanning function, an editable function, etc.

[0016] As a possible implementation, the first system library file includes the first information, and the first application includes an application in the electronic device that uses the first information when running. Based on this, when the update feature is related to a certain information, the electronic device can perform targeted compilation optimization on the application program that uses the information, which not only avoids the waste of processing resources and the extension of the update process caused by the compilation optimization of irrelevant applications, but also ensures the performance of the application after the software update.

[0017] Exemplarily, the first information may include, but is not limited to, the directory where the class or package required by the Java program executed by the application is located.

[0018] As a possible implementation method, the electronic device parses the software update package to obtain the update feature, including: the electronic device parses the software update package to obtain differential information; the electronic device generates a system device according to the differential information and then extracts the upgrade feature from the system library file of the system device. Based on this, when the software update package is an upgrade package, the electronic device can smoothly obtain the upgrade file by generating a system device according to the differential information, so as to subsequently perform targeted application compilation optimization based on the upgrade file, realize accurate application compilation optimization, improve the software update efficiency, and ensure the performance of the application after the software update.

[0019] Exemplarily, when the differential strategy of the differential information is a differential package strategy, the electronic device can obtain the upgrade file by the above-mentioned method of generating a system device according to the differential information.

[0020] As a possible implementation method, the electronic device parses the software update package and obtains the update feature, including: the electronic device parses the software update package to obtain differential information; the electronic device mounts the differential information as a block device; the electronic device merges the block device with the first system device corresponding to the current system library file in the electronic device to generate a second system device; the electronic device extracts the upgrade feature from the system library file of the second system device. Based on this, when the software update package is an upgrade package, the electronic device can smoothly obtain the upgrade file by mounting the differential information as a block device and updating the system device according to the block device, so as to subsequently perform targeted application compilation optimization based on the upgrade file, realize accurate application compilation optimization, and improve the efficiency of software updates while ensuring the performance of applications after software updates.

[0021] Exemplarily, when the differential strategy of the differential information is a differential customized information strategy, the electronic device can obtain the upgrade file by mounting the differential information as a block device and updating the system device according to the block device.

[0022] As a possible implementation, the first condition is satisfied, including one or more of the following: the usage frequency satisfies the first threshold, and the usage frequency satisfies the second threshold. Based on this, the electronic device can compile and optimize frequently used applications, and further improve the software update efficiency without affecting the user experience.

[0023] As a possible implementation, the method further includes: the electronic device sends the size of the available update partition of the electronic device to the cloud-side device, so that the cloud-side device selects whether to carry the application optimization code related to the system library file in the software update package according to the size of the available update partition, or selects the strategy and / or form of carrying the differential information in the software update package. Based on this, the cloud-side device can dynamically adjust the size of the software update package based on the size of the available update partition of the electronic device, so as to avoid the problem that the electronic device cannot successfully complete the software update due to insufficient available update partitions.

[0024] As a possible implementation, the size of the available update partition of the electronic device meets the second condition, and the software update package includes the system library file and the application optimization code related to the system library; or, the size of the available update partition of the electronic device does not meet the second condition, and the software update package includes the system library file but does not include the application optimization code related to the system library. Based on this, the cloud-side device can dynamically decide whether the software update package carries the application optimization code related to the system library based on the size of the available update partition of the electronic device, so as to avoid the problem that the electronic device cannot successfully complete the software update due to insufficient available update partition.

[0025] In addition, since the application optimization code related to the system library can also be generated locally on the electronic device based on the system library file, not carrying the application optimization code related to the system library in the software update package when the available update partition of the electronic device is insufficient will not have any impact on the effect of the software update.

[0026] As a possible implementation method, the software update package includes a system library file and an application optimization code related to the system library, and the electronic device compiles and optimizes the application program of the application that has a coupling dependency relationship with the update feature, including: the electronic device determines the application that has a coupling dependency relationship with the update feature according to the system library file; the electronic device compiles and optimizes the application program of the application that has a coupling dependency relationship with the update feature according to the application optimization code related to the system library. Based on this, the electronic device compiles and optimizes the relevant application program in a corresponding manner according to whether the software update package carries the application optimization code related to the system library. For example, when the software update package includes the application optimization code related to the system library, the application optimization code is directly used to improve the efficiency of application compilation optimization.

[0027] As a possible implementation, the software update package includes a system library file but does not include an application optimization code related to the system library, and the electronic device compiles and optimizes the application program of the application that has a coupling dependency relationship with the update feature, including: the electronic device parses the system library file to obtain the application optimization code related to the system library, and determines the application that has a coupling dependency relationship with the update feature; the electronic device compiles and optimizes the application program of the application that has a coupling dependency relationship with the update feature according to the application optimization code related to the system library. Based on this, the problem that the electronic device cannot successfully complete the software update due to insufficient available update partitions can be avoided.

[0028] In a second aspect, a software update method is provided, which is applied to a cloud-side device, and the method includes: the cloud-side device sends a software update package to an electronic device, wherein the software update package is a patch package, which includes a patch feature, and the patch feature has a coupling dependency relationship with one or more applications in the electronic device; or the software update package is an upgrade package, which includes an upgrade feature, and the upgrade feature has a coupling dependency relationship with one or more applications in the electronic device.

[0029] Among them, patch packages are mainly used to patch or repair software security vulnerabilities or operation BUGs (errors), upgrade packages are mainly used to add new functions to the software or update certain functions of the software. Of course, upgrade packages can also be used to patch or repair software security vulnerabilities or operation BUGs (errors).

[0030] Exemplarily, the cloud-side device may include, but is not limited to, a remote server or a diagnostic instrument and other equipment having a software update management function.

[0031] In some embodiments, the cloud-side device may trigger sending of a software update package to the electronic device based on a request from the electronic device.

[0032] In some embodiments, the cloud-side device may also actively send software update packages to electronic devices, such as actively sending software update packages to electronic devices when a new version of the software package is developed, or sending software update packages to electronic devices when it is identified that the software version in the electronic device is an old version.

[0033] According to the solution provided in the second aspect above, the cloud-side device can carry update features in the software update package sent to the electronic device, such as carrying patch features in the patch package and carrying upgrade features in the upgrade package, to indicate the applications related to the current software update, so that when the electronic device is performing a software update, it can compile and optimize the applications that have a coupling dependency relationship with the patch features or the upgrade features in a targeted manner, thereby ensuring that the electronic device can achieve accurate application compilation optimization, and while improving the software update efficiency, it can also ensure the performance of the application after the software update (such as compatibility and execution efficiency, etc.), thereby improving the user experience.

[0034] As a possible implementation, the method further includes: the cloud-side device receives the size of the available update partition of the electronic device from the electronic device; the cloud-side device selects whether to carry the application optimization code related to the system library file in the software update package according to the size of the available update partition, and / or the cloud-side device selects the strategy and / or form of carrying the differential information in the software update package according to the size of the available update partition. Based on this, the cloud-side device can dynamically adjust the size of the software update package based on the size of the available update partition of the electronic device to avoid the problem that the electronic device cannot successfully complete the software update due to insufficient available update partitions.

[0035] As a possible implementation, the size of the available update partition of the electronic device meets the second condition, and the software update package includes the system library file and the application optimization code related to the system library; or, the size of the available update partition of the electronic device does not meet the second condition, and the software update package includes the system library file but does not include the application optimization code related to the system library. Based on this, the cloud-side device can dynamically decide whether the software update package carries the application optimization code related to the system library based on the size of the available update partition of the electronic device, so as to avoid the problem that the electronic device cannot successfully complete the software update due to insufficient available update partition.

[0036] According to a third aspect, an electronic device is provided, comprising: a communication unit for obtaining a software update package; a software update unit for parsing the obtained software update package to obtain update features, wherein the update features include patch features or upgrade features, and compiling and optimizing an application program of an application that has a coupling dependency relationship with the above-mentioned update features, or compiling and optimizing an application program of an application that has a coupling dependency relationship with the above-mentioned update features and satisfies the first condition.

[0037] According to the solution provided in the third aspect above, after receiving the software update package, the electronic device can compile and optimize the application program in a targeted manner according to the specific update characteristics of the software. For example, the application program of the application that has a coupling dependency relationship with the patch feature or the upgrade feature is compiled and optimized, and the application program of the application that has a coupling dependency relationship with the patch feature or the upgrade feature and meets certain conditions (such as the first condition) is compiled and optimized. Based on this solution, not only can accurate application program compilation optimization be achieved, but also the performance of the application after the software update (such as compatibility and execution efficiency, etc.) can be guaranteed while improving the software update efficiency, thereby improving the user experience.

[0038] As a possible implementation method, the software update package is a patch package, and the software update unit is specifically used to: mount the patch file as a patch device; and read the compilation subdirectory of the patch device to obtain the update feature, and the update feature is the patch feature. Based on this, when the software update package is a patch package, the electronic device can smoothly obtain the patch file by mounting the patch file as a patch device, so as to subsequently perform targeted application compilation optimization based on the patch file, realize accurate application compilation optimization, improve the software update efficiency, and ensure the performance of the application after the software update.

[0039] As a possible implementation method, the patch feature includes a first system library file that has a coupling dependency relationship with the first application, and the software update unit compiles and optimizes the application program of the application that has a coupling dependency relationship with the update feature, including: the software update unit merges the patch device with the first system device corresponding to the current system library file in the electronic device to generate a second system device; the software update unit extracts the system library file of the second system device, wherein the system library file includes the first system library file; the software update unit identifies the first application that has been patched or repaired in the system library file of the second system device; the software update unit compiles and optimizes the first application. Based on this, the electronic device can update the system device according to the patch device, and successfully identify the application that has a coupling dependency relationship with the patch feature according to the system library file of the updated system device, and then align and perform targeted compilation optimization of the application program, so as to achieve accurate application compilation optimization, and ensure the performance of the application after the software update while improving the efficiency of the software update.

[0040] As a possible implementation, the first application includes one or more applications in the electronic device. The solution provided in the present application for targeted compilation and optimization of application programs according to specific update features of software can be applied to a variety of patch scenarios or upgrade scenarios.

[0041] As a possible implementation, the first system library file is related to the first function, and the first application includes an application with the first function in the electronic device. Based on this, when the update feature is related to a certain function, the electronic device can compile and optimize the application program with the function in a targeted manner, which not only avoids the waste of processing resources and the extension of the update process caused by the compilation optimization of irrelevant applications, but also ensures the performance of the application after the software update.

[0042] As a possible implementation, the first system library file includes the first information, and the first application includes an application in the electronic device that uses the first information when running. Based on this, when the update feature is related to a certain information, the electronic device can perform targeted compilation optimization on the application program that uses the information, which not only avoids the waste of processing resources and the extension of the update process caused by the compilation optimization of irrelevant applications, but also ensures the performance of the application after the software update.

[0043] As a possible implementation method, the software update unit parses the software update package to obtain the update feature, including: the software update unit parses the software update package to obtain differential information; the software update unit generates a system device according to the differential information and then extracts the upgrade feature from the system library file of the system device. Based on this, when the software update package is an upgrade package, the electronic device can smoothly obtain the upgrade file by generating a system device according to the differential information, so as to subsequently perform targeted application compilation optimization based on the upgrade file, realize accurate application compilation optimization, improve the software update efficiency, and ensure the performance of the application after the software update.

[0044] As a possible implementation method, the software update unit parses the software update package to obtain update features, including: the software update unit parses the software update package to obtain differential information; the software update unit mounts the differential information as a block device; the software update unit merges the block device with the first system device corresponding to the current system library file in the electronic device to generate a second system device; the software update unit extracts the upgrade features from the system library file of the second system device. Based on this, when the software update package is an upgrade package, the electronic device can smoothly obtain the upgrade file by mounting the differential information as a block device and updating the system device according to the block device, so as to subsequently perform targeted application compilation optimization based on the upgrade file, realize accurate application compilation optimization, and improve the software update efficiency while ensuring the performance of the application after the software update.

[0045] As a possible implementation, the first condition is satisfied, including one or more of the following: the usage frequency satisfies the first threshold, and the usage frequency satisfies the second threshold. Based on this, the electronic device can compile and optimize frequently used applications, and further improve the software update efficiency without affecting the user experience.

[0046] As a possible implementation, the communication unit is also used to: send the size of the available update partition of the electronic device to the cloud-side device, so that the cloud-side device can select whether to carry the application optimization code related to the system library file in the software update package according to the size of the available update partition, or to select the strategy and / or form of carrying the differential information in the software update package. Based on this, the cloud-side device can dynamically adjust the size of the software update package based on the size of the available update partition of the electronic device, so as to avoid the problem that the electronic device cannot successfully complete the software update due to insufficient available update partitions.

[0047] As a possible implementation, the size of the available update partition of the electronic device meets the second condition, and the software update package includes the system library file and the application optimization code related to the system library; or, the size of the available update partition of the electronic device does not meet the second condition, and the software update package includes the system library file but does not include the application optimization code related to the system library. Based on this, the cloud-side device can dynamically decide whether the software update package carries the application optimization code related to the system library based on the size of the available update partition of the electronic device, so as to avoid the problem that the electronic device cannot successfully complete the software update due to insufficient available update partition.

[0048] As a possible implementation method, the software update package includes a system library file and an application optimization code related to the system library, and the software update unit compiles and optimizes the application program of the application that has a coupling dependency relationship with the update feature, including: the software update unit determines the application that has a coupling dependency relationship with the update feature according to the system library file; the software update unit compiles and optimizes the application program of the application that has a coupling dependency relationship with the update feature according to the application optimization code related to the system library. Based on this, the electronic device compiles and optimizes the relevant application program in a corresponding manner according to whether the software update package carries the application optimization code related to the system library. For example, when the software update package includes the application optimization code related to the system library, the application optimization code is directly used to improve the efficiency of application compilation optimization.

[0049] As a possible implementation, the software update package includes a system library file but does not include an application optimization code related to the system library, and the software update unit compiles and optimizes the application program of the application that has a coupling dependency relationship with the update feature, including: the software update unit parses the system library file to obtain the application optimization code related to the system library, and determines the application that has a coupling dependency relationship with the update feature; the software update unit compiles and optimizes the application program of the application that has a coupling dependency relationship with the update feature according to the application optimization code related to the system library. Based on this, the problem that the electronic device cannot successfully complete the software update due to insufficient available update partitions can be avoided.

[0050] In a fourth aspect, a cloud-side device is provided, comprising: a communication unit for sending a software update package to an electronic device, wherein the software update package is a patch package, the patch package includes a patch feature, and the patch feature has a coupling dependency relationship with one or more applications in the electronic device; or the software update package is an upgrade package, the upgrade package includes an upgrade feature, and the upgrade feature has a coupling dependency relationship with one or more applications in the electronic device.

[0051] According to the solution provided in the fourth aspect above, the cloud-side device can carry update features in the software update package sent to the electronic device, such as carrying patch features in the patch package and carrying upgrade features in the upgrade package, to indicate the applications related to the current software update, so that when the electronic device is performing a software update, it can compile and optimize the applications that have a coupling dependency relationship with the patch features or the upgrade features in a targeted manner, thereby ensuring that the electronic device can achieve accurate application compilation optimization, and while improving the software update efficiency, it can also ensure the performance of the application after the software update (such as compatibility and execution efficiency, etc.), thereby improving the user experience.

[0052] As a possible implementation, the communication unit is also used to: receive the size of the available update partition of the electronic device from the electronic device; the cloud-side device also includes: a software update management unit, which is used to select whether to carry the application optimization code related to the system library file in the software update package according to the size of the available update partition, and / or select the strategy and / or form of carrying the differential information in the software update package according to the size of the available update partition. Based on this, the cloud-side device can dynamically adjust the size of the software update package based on the size of the available update partition of the electronic device to avoid the problem that the electronic device cannot successfully complete the software update due to insufficient available update partitions.

[0053] As a possible implementation, the size of the available update partition of the electronic device meets the second condition, and the software update package includes the system library file and the application optimization code related to the system library; or, the size of the available update partition of the electronic device does not meet the second condition, and the software update package includes the system library file but does not include the application optimization code related to the system library. Based on this, the cloud-side device can dynamically decide whether the software update package carries the application optimization code related to the system library based on the size of the available update partition of the electronic device, so as to avoid the problem that the electronic device cannot successfully complete the software update due to insufficient available update partition.

[0054] In a fifth aspect, an electronic device is provided, comprising: a transceiver for receiving and / or sending signals, such as receiving information from a cloud-side device, sending information to a cloud-side device, etc.; a memory for storing computer program instructions; and a processor for executing the computer program instructions to support the electronic device to implement a method in any possible implementation manner of the first aspect.

[0055] In a sixth aspect, a cloud-side device is provided, which includes: a transceiver for receiving and / or sending signals, such as receiving information from an electronic device, sending information to an electronic device, etc.; a memory for storing computer program instructions; and a processor for executing the computer program instructions to support the cloud-side device to implement a method in any possible implementation manner of the first aspect.

[0056] In a seventh aspect, a communication system is provided, comprising an electronic device as in any possible implementation of the third aspect or the fifth aspect, and a cloud-side device as in any possible implementation of the fourth aspect or the sixth aspect.

[0057] In an eighth aspect, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method in any possible implementation of the first aspect or the second aspect is implemented.

[0058] In a ninth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to implement a method in any possible implementation of the first aspect or the second aspect.

[0059] In a tenth aspect, a chip system is provided, the chip system comprising a processing circuit and a storage medium, wherein the storage medium stores computer program instructions; when the computer program instructions are executed by the processor, the chip system implements the method in any possible implementation of the first aspect or the second aspect. The chip system may be composed of a chip, or may include a chip and other discrete devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 A schematic diagram of a system upgrade process;

[0061] Figure 2A A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0062] Figure 2B A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;

[0063] Figure 3 A flowchart of a software update method provided in an embodiment of the present application;

[0064] Figure 4 A patch feature provided in an embodiment of the present application includes a schematic diagram of an application compilation optimization process of a point cloud library (PCL);

[0065] Figure 5 A schematic diagram of an application program compilation optimization process including a patch feature including a single application change feature provided in an embodiment of the present application;

[0066] Figure 6 A patch feature provided in an embodiment of the present application includes a schematic diagram of an application compilation optimization process for a bootclasspath library;

[0067] Figure 7 A schematic diagram of the interface during the software update process provided in an embodiment of the present application;

[0068] Figure 8 A schematic diagram of a scalable strategy for unused software update packages provided in an embodiment of the present application;

[0069] Fig. 9 A schematic diagram of a software update package scalable strategy provided in an embodiment of the present application;

[0070] Fig.10 A flowchart of another software update method provided in an embodiment of the present application;

[0071] Fig.11 A schematic diagram of an application compilation optimization process provided in an embodiment of the present application;

[0072] Fig.12 A schematic diagram of another application compilation optimization process provided in an embodiment of the present application;

[0073] Fig.13 A structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0074] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0075] In the following, the terms "first", "second", etc. are only used to distinguish different description objects, and have no limiting effect on the position, order, priority, quantity or content of the described objects. For example, if the described object is a "field", the ordinal number before the "field" in the "first field" and the "second field" does not limit the position or order between the "fields", and the "first" and "second" do not limit whether the "fields" they modify are in the same message, nor do they limit the order of the "first field" and the "second field". For another example, if the described object is a "level", the ordinal number before the "level" in the "first level" and the "second level" does not limit the priority between the "levels". For another example, the number of described objects is not limited by the ordinal number, and can be one or more. Taking the "first device" as an example, the number of "devices" can be one or more. In addition, the objects modified by different prefixes can be the same or different. For example, if the described object is a "device", the "first device" and the "second device" can be the same type of device or different types of devices. For another example, if the described object is "information", the "first information" and the "second information" can be information of the same content or information of different contents. In summary, the use of prefixes such as ordinal numbers to distinguish the described objects in the embodiments of the present application does not constitute a limitation on the described objects. For the statement of the described objects, please refer to the description in the context of the claims or embodiments, and no unnecessary limitation should be constituted due to the use of such prefixes.

[0076] Furthermore, in the embodiments of the present application, "connection" may be a direct connection or an indirect connection; in addition, it may refer to an electrical connection or a communication connection; for example, the connection between two electrical components A and B may refer to a direct connection between A and B, or may refer to an indirect connection between A and B through other electrical components or connecting media, or may refer to an indirect connection between A and B through other communication devices or communication media, as long as communication between A and B can be achieved.

[0077] To facilitate understanding, some concepts involved in the embodiments of the present application are first briefly introduced.

[0078] 1. Patch repair:

[0079] When an operating system or application has a security hole or a running bug (error), another small program is run to patch or repair the error in the operating system or application. This is called "patch repair", commonly known as "patching". Generally, a patch can correspond to a specific error in a specific software.

[0080] 2. Software upgrade:

[0081] Software upgrade refers to upgrading an operating system or application from one version to another. The new version may include new features or updated features, and may also modify some firmware, or patch or repair some security vulnerabilities or operational bugs.

[0082] For example, please refer to Figure 1 , Figure 1 A schematic diagram of a system upgrade process is shown. Figure 1 As shown, after obtaining the upgrade package, the electronic device can trigger the system upgrade process, and perform a system upgrade after restarting the electronic device (such as a system upgrade based on over-the-air (OTA) technology); then, the electronic device can use a compilation filter (such as dexopt) for the first optimization after restarting again, wherein the first optimization is mainly used for compilation optimization for a portion of applications; finally, the electronic device can use a compilation filter (such as bg-dexopt) for the second optimization when idle, charging or fully charged, wherein the second optimization is mainly used for compilation optimization for another portion of applications.

[0083] 3. Software upgrade based on dual images:

[0084] When performing software upgrade based on dual images, two image files (such as image file A and image file B) are stored in the electronic device, one as an active image and the other as a backup image. The active image is the image file currently running on the electronic device, and the backup image is the image file currently not running on the electronic device.

[0085] Among them, the identities of the two image files in the electronic device can be switched freely. For example, assuming that image file A is an old version of the software and image file B is a new version of the software, when the electronic device implements software upgrade by loading and running image file B, image file B is the active image and image file A is the backup image. If the electronic device software upgrade fails or an abnormality occurs during the upgrade process, the electronic device stops running image file B and reloads and runs image file A. Software upgrade based on dual images can ensure that the electronic device can still provide services to users normally when the software upgrade fails or an abnormality occurs during the upgrade process.

[0086] 4. Patch repair based on block devices:

[0087] A block device is a driver that accesses the underlying physical disk based on sectors and accesses the upper file system based on blocks. Disks and SD cards are common block devices. A sector is usually a power of 2, such as 512 bytes. A block is the basic unit of data processing for the kernel or file system defined by the operating system. A block is usually composed of one or more sectors.

[0088] 5. Compilation optimization:

[0089] Application performance usually includes the compatibility of the application and the time it takes for the application to complete a task, that is, the code execution efficiency. Among them, an important way to improve application performance is to perform compilation optimization. As the core means of code generation, compilation optimization can effectively improve code execution efficiency, reduce the burden on programmers, and better be compatible with the existing ecosystem. Compilation optimization refers to the use of a compiler to convert application source code, where part of the conversion of the application source code is necessary for generating machine code, and the other part of the conversion is to reduce the code size to improve the performance of the application. Machine code is a programming language used directly by the computer, and its statements are machine instruction codes (also called "codes"), which are a set of binary numbers used to direct the computer to perform operations and operand addresses.

[0090] As an example, compilation optimization may include the following processes: first, package resource files to generate java files, arsc files, res files and xml files, wherein the java files include the java language related to the application running, the arsc files include the binary resource files related to the application running, the res files include the files involved in the application running process (such as images, etc.), and the xml files include the manifest configuration files related to the application; then, compile the java files into binary files that can be recognized by the computer, such as class files; then, compress the class files to generate executable files that can be executed by the operating system, such as dex files, wherein the dex files include a file header, a data index area, a class definition area, a data area and a link data area (link_data). The file header is used to record the relevant attributes of the entire dex file; the data index area is used to store the index of resource data such as strings, type data, method information, field information, etc.; the class definition area is used to record class information, including but not limited to interfaces, superclasses, class data offsets, etc.; the data area is used to store the real data of each class; the link data area is used to store the data used in static link files; finally, the resource file and the dex file are packaged to generate an apk file, where the apk file is a file format that the operating system can recognize and run. For a basic introduction to compilation optimization, you can refer to conventional technology, and the embodiments of this application will not be repeated.

[0091] In order to solve the problem that in the conventional software update process, after the system update is completed, the electronic device will not compile and optimize the applications installed in the system (such as third-party applications), which will affect the subsequent compatibility or execution efficiency of the applications, or the electronic device will indiscriminately compile and optimize all applications installed in the system, resulting in low efficiency of the system update process, the embodiment of the present application provides a software update method, which can perform targeted compilation and optimization of the application program according to the specific patch features or upgrade features of the software update package, while improving the software update efficiency, ensuring the performance of the application after the software update, and improving the user experience.

[0092] Among them, the electronic device described in the embodiments of the present application may include but is not limited to devices in any field such as smart terminal field, car field, smart home field, industrial field, municipal facilities field, medical field, education field, etc.

[0093] Taking the field of smart terminals as an example, the electronic devices described in the embodiments of the present application may include but are not limited to smart phones, netbooks, tablet computers, PDAs, car computers, personal computers (PCs), personal digital assistants (PDAs), portable multimedia players (PMPs), augmented reality (AR) / virtual reality (VR) devices, smart TVs, projection devices, or somatosensory game consoles in human-computer interaction scenarios, etc. Of course, the electronic devices described in the embodiments of the present application may also be wearable devices, such as smart watches, smart bracelets, phone watches, or other types or structures of electronic devices, which are not limited in the present application.

[0094] As an example, see Figure 2A , Figure 2A A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0095] like Figure 2A As shown, the electronic device may include a processor 210, a memory (including an external memory interface 220 and an internal memory 221), a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display screen 294, etc. Among them, the sensor module 280 may include a touch sensor, a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, an ambient light sensor, a bone conduction sensor, etc.

[0096] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0097] The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a flight controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0098] The processor 210 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may store instructions or data that the processor 210 has just used or cyclically used. If the processor 210 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.

[0099] In an embodiment of the present application, the processor 210 can be used to perform software update package parsing, update feature identification, software update, and corresponding application compilation optimization based on specific update features (such as patch features, upgrade features), etc. according to a preset software update logic.

[0100] In some embodiments, the processor 210 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0101] The charging management module 240 is used to receive charging input from the charger. The power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240 to power the processor 210, the internal memory 221, the display screen 294, the camera assembly 293 and the wireless communication module 260.

[0102] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modem processor and baseband processor.

[0103] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0104] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 250 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the same device as at least some of the modules of the processor 210.

[0105] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 270A, a receiver 270B, etc.), or displays an image or video through a display screen 294. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be set in the same device as the mobile communication module 250 or other functional modules.

[0106] The wireless communication module 260 can provide wireless communication solutions including wireless local area networks (WLAN) (such as WiFi networks), Bluetooth BT, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to electronic devices. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 210. The wireless communication module 260 can also receive the signal to be sent from the processor 210, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0107] In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the electronic device can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).

[0108] In some embodiments of the present application, electronic devices can exchange information with other devices through the wireless communication module 260 based on wireless communication technology, such as sending software version information, sending software update requests, sending available update partition sizes, receiving software update packages (such as upgrade packages or patch packages), etc.

[0109] The electronic device implements the display function through a GPU, a display screen 294, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs that execute program instructions to generate or change display information.

[0110] In an embodiment of the present application, the electronic device can use a GPU to draw and render relevant interfaces during the software update process, such as a software package download interface, a software update interface, etc.

[0111] The display screen 294 is used to display images, videos, etc. The display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 294, where N is a positive integer greater than 1.

[0112] In the embodiment of the present application, the electronic device can display relevant interfaces in the software update process, such as a software package download interface, a software update interface, etc., through the display screen 294.

[0113] The electronic device can realize the shooting function through ISP, camera component 293, video codec, GPU, display screen 294 and application processor.

[0114] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function.

[0115] Internal memory 221 may be used to store computer executable program code. For example, the computer program may include an operating system program and an application program. The operating system may include but is not limited to apple OS and other operating systems. Among them, the executable program code includes instructions. The processor 210 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 221. The internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area may store the operating system, at least one application required for a function, etc. The data storage area may store data created during the use of the electronic device (such as user operation information, input events, drawn layers, etc.). In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 210 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 221, and / or the instructions stored in the memory provided in the processor.

[0116] The electronic device can realize audio functions through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C and the application processor, such as music playing and recording. For the specific working principles and functions of the audio module 270, the speaker 270A, the receiver 270B and the microphone 270C, reference can be made to the introduction in the conventional technology.

[0117] In addition, for the introduction of hardware such as buttons 290, motor 291, and indicator 292, reference may be made to conventional technologies, and the embodiments of the present application will not be repeated.

[0118] It is understandable that this application Figure 2A The illustrated structure does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0119] As a possible example, see Figure 2B , Figure 2B FIG. 1 shows a schematic diagram of the software structure of an electronic device provided in an embodiment of the present application. Figure 2B As shown, the operating system of the electronic device may include an application layer, a framework layer (framework, FWK) and a kernel layer.

[0120] The application layer can include a range of applications, such as Figure 2B Shown are instant messaging applications, office applications, shopping applications, financial applications, entertainment applications, navigation applications, etc.

[0121] The framework layer is used to provide application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 2B As shown, the framework layer may include a software update manager, a compilation optimization manager, a package manager, and the like.

[0122] Among them, the software update manager can be used to parse the obtained software update package, including determining whether the software update package is a patch package or an upgrade package, and obtaining update features in the software update package, such as patch features or upgrade features. The software update manager can also be used to determine applications that have a coupling dependency relationship with the patch features or upgrade features. After determining the applications that have a coupling dependency relationship with the patch features or upgrade features, the software update manager can hand over the results to the compilation optimization manager for the compilation optimization manager to perform subsequent targeted compilation optimization of the application program.

[0123] The compilation optimization manager can be used to compile and optimize application programs that are determined by the software update manager to have coupling dependencies with patch features or upgrade features, and hand over the compiled and optimized results (such as apk files) to the package manager for the package manager to perform subsequent application update / installation operations.

[0124] The package manager is mainly used to manage the installation, uninstallation, and update processes of applications. For example, the package manager can perform application update operations by calling an application installer or a software package installer (such as Package Installer (or Installer)). In an embodiment of the present application, after obtaining the result of the compilation optimization (such as an apk file) from the compilation optimization manager, the package manager can verify the permissions of the apk file and parse the apk file after the verification is passed to complete the subsequent update or installation operation.

[0125] Of course, the framework layer can also be used to provide other management services, such as window manager, activity manager, content provision service, phone management service, resource management service, notification management service, location management service and view system (viewsystem) and other services. Among them, the window manager is used to provide window management, such as window creation, window startup, window deletion, window movement, window position / size / style management, etc. The activity manager is responsible for managing activities (Activity), responsible for the startup, switching, scheduling of various components in the system, and the management and scheduling of applications. The content provision service is used to support an application to access the data of another application (such as a contact database), or to share its own data with other applications, where the data may include video, images, audio, dialed and received calls, browsing history and bookmarks, phone books, etc. The phone management service is used to provide a method for accessing the status and information related to the communication of the terminal device; and provide the communication function of the terminal device, such as the management of the call status (including connecting, hanging up, etc.). The resource management service is used to provide access to non-code resources, such as access to local strings, icons, pictures, graphics, video files or layout files (Layoutfile). The notification management service is used to provide the function of displaying customized prompt information in the status bar. The prompt information can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. The location management service is used to provide services related to processing geographic location. The view system can be used to build the display interface of the application. The view system includes visual controls, such as text box (TextBox) controls, list (List) controls, grid (Grid) controls, button (Button) controls, and embeddable Web browser controls.

[0126] The kernel layer is the layer between hardware and software. The kernel layer can include camera driver, keyboard driver, display driver, microphone driver, headphone driver, sensor driver, Bluetooth driver, etc.

[0127] It should be noted that Figure 2B This is only an example of a software structure diagram of an electronic device, in which only the layers and software modules related to the solution of the present application are simply listed. In practical applications, the operating system of the electronic device may also include other layers, and each layer may also include other software modules for implementing one or more functions or services. This embodiment of the present application does not specifically limit this.

[0128] In addition, the embodiments of the present application do not specifically limit the relationship between the various software modules, such as multiple related modules can also be combined together. Figure 2BThe compilation optimization manager shown may also be located in the software update manager, or the compilation optimization manager and / or the software update manager may also be located in the package manager; for example, Figure 2B The functions provided by the compilation optimization manager shown may also be implemented by the software update manager, or the functions provided by the compilation optimization manager and / or the software update manager may also be implemented by the package manager.

[0129] As described above, based on an embodiment of the present application, a software update method is provided. After receiving a software update package, the electronic device can perform targeted compilation optimization of the application program according to the specific patch features or upgrade features of the software, thereby improving the software update efficiency while ensuring the performance of the application after the software update (such as compatibility and execution efficiency, etc.), thereby improving the user experience.

[0130] For example, if an upgrade feature is obtained based on the analysis of the software update package, it means that the software update package is used for a major software version upgrade. In this case, when performing a software update, the electronic device can extract the upgraded image content based on the upgrade feature, and then perform compilation optimization for system upgrade optimization based on the image content.

[0131] For another example, if a patch feature is obtained based on the analysis of the software update package, it indicates that the software update package is used to patch or repair an error. In this case, when performing a software update, the electronic device can perform targeted compilation optimization of a single application, part of the applications, or all the applications based on the specific information of the patch feature.

[0132] In some embodiments, the patch feature includes library files that have a coupling dependency relationship with certain applications. These library files may include but are not limited to point cloud library (PCL) (hereinafter referred to as PCL library). Among them, the PCL library includes a wealth of point cloud processing functions, such as filters, features, I / O, keypoints, registration, sample consensus surface, visualization, range image, etc., where filters are used to implement sampling, outlier removal, feature extraction, fitting estimation, filtering, etc., and features are used to implement the screening of various three-dimensional features, such as surface normal, curvature, boundary point estimation, etc.; I / O is used to implement data input and output; keypoints are used to implement different key point extraction methods; registration is used to implement point cloud registration, etc.; sample consensus surface is used to implement surface reconstruction, etc.; visualization is used to implement visualization; range image is used to support range images generated by different point cloud data sets. In this case, when performing software updates, the electronic device can compile and optimize the applications that have a coupling dependency relationship with the above-mentioned library files to ensure the good performance of these applications after the software update.

[0133] In some embodiments, the patch features include the change features of certain applications. In this case, when performing software update, the electronic device can compile and optimize these applications to ensure good performance of these applications after the software update.

[0134] In some embodiments, the patch feature includes library files that have coupling dependencies with all upper-layer applications. These library files may include, but are not limited to, Java files in the path where the search class files are located, such as the jar package (Java archive file) in the bootclasspath. Among them, the bootclasspath usually includes three paths: the src.main.java path, the src.main.resources path, and the root path of the third-party jar package. Among them, the src.main.java path is used to store all the source code of the application, the src.main.resources path is used to store the resources needed when the application is running, and the root path of the third-party jar package is used to store the jar package of the third-party application.

[0135] Among them, the application corresponding to the jar package is closely related to Java. The jar package is a document format of Java. The jar package usually includes a META-INF / MANIFEST.MF file, which is automatically created when the jar file is generated. As a "details sheet" in the jar, it is used to indicate the version of the jar package, the creator, and the class search path Class-Path and other information. In some embodiments, if the jar package is an executable package, the jar package will also include a Main-Class attribute to indicate the Main method entry. Since the jar package in the bootclasspath involves the jar package of a third-party application, when the patch feature includes the jar package in the bootclasspath, it usually involves an upper-layer third-party application. In this case, when performing a software update, the electronic device can perform cache optimization on all upper-layer third-party applications to ensure good performance of the application after the software update. The following will specifically introduce a software update method provided in an embodiment of the present application in combination with a specific software update scenario.

[0136] Please refer to Figure 3 , Figure 3 The flowchart of the software update method provided by the embodiment of the present application is shown. Figure 3 As shown, the method may include S301-S302, and S303-1 and S304-1, or and S303-2 and S304-2:

[0137] S301: The electronic device obtains a software update package from a cloud-side device.

[0138] Among them, the software update package is such as a patch package or an upgrade package.

[0139] In some embodiments, the software update package may include, but is not limited to, software version information, system library files, and application optimization codes related to the system library. In the Android open source project (AOSP) scenario, the system library file is the jar of the framework layer, and the application optimization code related to the system library is the oat code of the application related to the jar. Software version information such as version identification (such as version number, etc.). In some embodiments, the software version information can be carried in a pre-compiled version number field (such as a pre-compile-version field).

[0140] As an example, the cloud-side device may include but is not limited to a remote server or diagnostic instrument with a software update management function. For example, the cloud-side device may use OTA to remotely send a software update package to an electronic device to update or increase the functions supported by the electronic device. For another example, the cloud-side device may use the diagnostic communication over Internet Protocol (DOIP) technology of the in-vehicle Ethernet to remotely send a software update package to an electronic device to repair or patch certain problems in the software of the electronic device.

[0141] In some embodiments, the cloud-side device may actively send the software update package to the electronic device. For example, after the developer completes the software update, the cloud-side device may actively send the updated software update package to the electronic device.

[0142] In other embodiments, the cloud-side device may also send a software update package to the cloud-side device according to a request from the electronic device. For example, the electronic device may trigger a request for a software update package from the cloud-side device according to a user operation (such as clicking an upgrade button, etc.). For another example, the electronic device may automatically trigger a request for a software update package from the cloud-side device when it detects that the software has been updated.

[0143] In other embodiments, the cloud-side device may also send a software update package to the electronic device when it is identified that the software version in the electronic device is an old version. For example, the electronic device may send the software version information of the software in the electronic device to the cloud-side device, and the cloud-side device may send the latest version of the software update package to the electronic device when there is a software version higher than the old version.

[0144] It should be noted that the specific timing and triggering method for the electronic device to obtain the software update package are not specifically limited in the embodiments of the present application, and reference may be made to the implementation process in conventional technologies.

[0145] In some embodiments, if the software update package is a patch package, the software update package also includes a patch file; if the software update package is an upgrade package, the software update package also includes an upgrade file.

[0146] Among them, the patch file or upgrade file in the software update package is generated by the cloud-side device according to the specific changes of the new version software package and encapsulated in the software update package.

[0147] For example, the cloud-side device can determine the patch file by comparing the new version software package with the old version software package corresponding to the software version information sent by the electronic device, where the patch file can reflect the patch characteristics, for example, the patch file may include a patch or repair file of the new version software package compared to the old version software package.

[0148] As an example, the patch file may be located in a compiled application subdirectory in the software update package, such as a compile-app subdirectory.

[0149] For another example, the cloud-side device may determine the upgrade file by comparing the version information of the new version software package with the software version information sent by the electronic device, wherein the upgrade file may reflect the upgrade feature and may include differential information between the new version software package and the old version software package.

[0150] As an example, the upgrade file may be located in the configuration file information in the software update package, such as a file list (such as filelist); or, the upgrade file may be carried by the differential strategy (diff_strategy) field in the software update package, which is not specifically limited in the embodiments of the present application.

[0151] Among them, the form of differential information can be a conventional differential package, or a file differential or a block differential, which is specifically related to the differential strategy and / or the size of the available update partition of the electronic device. For example, if the differential strategy is a differential package strategy, the form of the differential information is usually a conventional differential package; if the differential strategy is a differential customized information strategy, the form of the differential information is usually a file differential or a block differential. For another example, if the differential strategy is a differential customized information strategy, and the size of the available update partition of the electronic device is insufficient (such as not meeting the second condition), the form of the differential information may be a block differential. Among them, block differentials can greatly save space for system images compared to file differentials. Therefore, when the size of the available update partition of the electronic device is insufficient, the cloud-side device can reduce the storage load of the electronic device when performing software updates by carrying differential information in the form of block differentials in the software update package, thereby ensuring the normal execution of the software update.

[0152] S302: The electronic device determines the type of the software update package.

[0153] As an example, since the software update package includes version information, after parsing the software update package, the electronic device can obtain the version identifier (such as version number, etc.) of the software update package, and then determine the type of the software update package according to the version identifier.

[0154] For example, if the version identifier is the first identifier, it means that the software update package is a patch package, which is mainly used to patch or fix errors; illustratively, the first identifier is patch package 1 (patch01), patch package 2 (patch02), etc. If the version identifier is the second identifier, it means that the software update package is an upgrade package, which is mainly used for major software version upgrades; illustratively, the second identifier is B100, etc.

[0155] As an example, the version identifier of the software update package may be located in the configuration file information of the software update package, such as a file list (such as filelist). For example, the configuration file information may include a package type field (package_type) and a version identifier field. If the software update package is a patch package, the package type field may be the first field (such as patch), and the version identifier field may be the first identifier (such as patch01, patch02, etc.); if the software update package is an upgrade package, the package type field may be the second field (such as OTA), and the version identifier field may be the second identifier (such as B100, etc.); or, if the software update package is another type of software package, the package type field and the version identifier field may be other field values, depending on the specific situation.

[0156] In some embodiments, after receiving the software update package, the electronic device may first verify the software version information. For example, when the version corresponding to the software update package is higher than the software version currently running in the electronic device, the next steps are executed, such as executing S302 to determine the type of the software update package; or when the version corresponding to the software update package is the same as or lower than the software version currently running in the electronic device, the software update is abandoned.

[0157] like Figure 3 As shown, if the software update package is a patch package, such as the package type field in the configuration file information of the software update package is the first field and the version identification field is the first identification, the electronic device executes S303-1 and then executes S304-1; if the software update package is an upgrade package, such as the package type field in the configuration file information of the software update package is the second field and the version identification field is the second identification, the electronic device executes S303-2 and then executes S304-2.

[0158] S303-1: The electronic device parses the software update package to obtain patch features.

[0159] In some embodiments, the electronic device may obtain a patch file in the software update package by parsing the package, and obtain a patch feature by parsing the patch file.

[0160] For example, after obtaining the patch file, the software update function module of the electronic device (such as a software update engine) can mount the patch file as a patch device (also called a patch-temp device), wherein, after mounting the patch file as a patch device, the software update function module can read the compilation subdirectory corresponding to the patch file. By reading the compilation subdirectory, the software update function module can obtain patch features. Taking the patch file located in the compilation application subdirectory (such as the compile-app subdirectory) in the software update package as an example, after the electronic device generates the patch device, it can obtain the patch features by reading the content under the compilation application subdirectory. Among them, the above-mentioned patch device is a virtual device generated by the software update function module. Regarding the method and specific process of the software update function module (such as the software update engine) generating a virtual device such as a patch device, reference can be made to conventional technology, and the embodiments of the present application are not specifically limited.

[0161] S304-1: The electronic device compiles and optimizes one or more application programs that have a coupling dependency relationship with the patch feature.

[0162] In some embodiments, if the patch feature includes library files that have a coupling dependency relationship with certain applications, such as a first system library file, the electronic device can compile and optimize the application program for one or more applications that have a coupling dependency relationship with the above-mentioned first system library file to ensure good performance of these applications after the software update.

[0163] Exemplarily, the first system library file may be related to the first function, such as the first function may include but is not limited to a payment function, a wireless communication function (such as a near-field communication function, etc.), a code scanning function, an editable function, etc. The first application may include an application in the electronic device that has the above-mentioned first function.

[0164] For example, if compile-app=pcl, the electronic device can determine that the patch feature is a patch or repair of the PCL library. Based on this, the electronic device can parse the PCL library to determine one or more applications that have a coupling dependency relationship with the PCL library, and then compile and optimize the application programs of the one or more applications. As a possible implementation method, the software update function module (such as the software update engine) of the electronic device can synthesize the system device 1 (such as the system-temp1 device) corresponding to the patch device and the system library file in the original software package to generate a new system device 2 (such as the system-temp2 device); then, the software update function module (such as the software update engine) can extract the PCL library in the new system device to determine one or more applications that have a coupling dependency relationship with the PCL library; finally, the software update function module (such as the software update engine) can compile and optimize the application programs of the one or more applications. Among them, the above-mentioned system device is a virtual device generated by the software update function module. Regarding the method and specific process of the software update function module (such as the software update engine) generating virtual devices such as system devices, reference can be made to conventional technology, and the embodiments of the present application are not specifically limited.

[0165] For example, please refer to Figure 4 , Figure 4 FIG. 1 shows a schematic diagram of an application compilation optimization process including a PCL library in a patch feature provided by an embodiment of the present application. Figure 4 As shown, assuming that the original software package in the electronic device is version 1, the system device corresponding to the system library file in the original software package is Figure 4 The patch feature of the software package of system device 1 and version 2 shown in the figure is the patch or repair of the PCL library, such as adding a jar package of the PCL library. The virtual device generated based on the patch feature is Figure 4 Patch devices such as Figure 4 As shown, after the electronic device synthesizes the patch device and the system device 1 to generate a new system device 2, it can extract the PCL library in the system device 2 to determine one or more applications that have a coupling dependency relationship with the PCL library, and then compile and optimize the application programs of the one or more applications.

[0166] In some embodiments, if the patch features include changed features of certain applications, the electronic device may compile and optimize these applications to ensure good performance of these applications after the software update.

[0167] For example, if compile-app=single-app, the electronic device can determine that the patch feature is a patch or repair of a single application, based on which the electronic device can compile and optimize the application program associated with the single application. As a possible implementation, the software update function module (such as a software update engine) of the electronic device can synthesize the system device 1 (such as a system-temp1 device) corresponding to the patch device and the system library file in the original software package to generate a new system device 2 (such as a system-temp2 device); then, the software update function module (such as a software update engine) can extract the system library file in the new system device 2, and compile and optimize the application program of the application involved according to the application identifier of the patched or repaired application in the system library file of the system device 2. Exemplarily, the application identifier is such as the application name.

[0168] For example, please refer to Figure 5 , Figure 5 A schematic diagram of an application program compilation optimization process including a patch feature including a single application change feature provided by an embodiment of the present application is shown. Figure 5 As shown, assuming that the original software package in the electronic device is version 1, the system device corresponding to the system library file in the original software package is Figure 5 The patch feature of the software package of system device 1 and version 2 shown in the figure is to add a resource patch or repair of a single application, wherein the virtual device generated based on the patch feature is Figure 5 Patch devices such as Figure 5 As shown, after the electronic device synthesizes the patch device and the system device 1 to generate a new system device 2, the electronic device can extract the patched or repaired application identifier in the system library file of the system device 2 to compile and optimize the application program involved in the single application according to the application identifier.

[0169] In some embodiments, if the patch feature includes a library file that has a coupling dependency relationship with all upper-layer applications, such as a first system library file, the electronic device can compile and optimize the application programs of all applications in the electronic device to ensure good performance of all applications after the software update.

[0170] Exemplarily, the first system library file may include first information, such as the first information may include but is not limited to the directory where the class or package required by the Java program executed by the application is located, etc. The first application may include an application in the electronic device that needs to use the first information during operation.

[0171] For example, if compile-app=bootclasspath, the electronic device can determine that the patch feature is a patch or repair of a jar package, based on which the electronic device can compile and optimize the application programs of all applications in the electronic device. As a possible implementation method, the software update function module of the electronic device (such as a software update engine) can synthesize the system device 1 (such as a system-temp1 device) corresponding to the patch device and the system library file in the original software package to generate a new system device 2 (such as a system-temp2 device); finally, the software update function module (such as a software update engine) can extract the system library file in the new system device 2, and compile and optimize the application programs of the applications involved according to the application identifiers (actually the application identifiers of all mall applications) that have been patched or repaired in the system library file of the system device 2.

[0172] For example, please refer to Figure 6 , Figure 6 A schematic diagram of an application compilation optimization process including a bootclasspath library with a patch feature provided by an embodiment of the present application is shown. Figure 6 As shown, assuming that the original software package in the electronic device is version 1, the system device corresponding to the system library file in the original software package is Figure 6 The patch feature of the software package of system device 1 and version 2 shown in the figure is the patch or repair of the bootclasspath library, such as adding a jar package of the bootclasspath library. The virtual device generated based on the patch feature is Figure 6 Patch devices such as Figure 6 As shown, after the electronic device synthesizes the patch device and the system device 1 to generate a new system device 2, the electronic device can extract the application identifier that has been patched or repaired in the bootclasspath library in the system device 2 to compile and optimize the application program involved according to the application identifier.

[0173] It should be noted that, in some embodiments, when compiling and optimizing one or more applications that have a coupling dependency relationship with the patch feature, the electronic device may also compile and optimize the applications that meet the preset conditions based on the most recent use time, use frequency, and use frequency of the applications that have a coupling dependency relationship with the patch feature in the electronic device. We know that there may be applications in the electronic device that have been installed but have never been used by the user or have not been used for a long time. For such applications, not compiling and optimizing the applications will have little impact on the user, so they may not be compiled and optimized. Based on this, the software update efficiency can be further improved while ensuring the performance of highly important applications after the software update.

[0174] Alternatively, when compiling and optimizing one or more applications that have a coupling dependency relationship with the patch feature, the electronic device may also optimize the software based on other relevant information of the applications in the electronic device that have a coupling dependency relationship with the patch feature, such as the size of storage resources required for application compilation optimization, application compilation optimization, and / or improving software update efficiency.

[0175] S303-2: The electronic device parses the software update package to determine a differential strategy, and obtains upgrade features according to the determined differential strategy.

[0176] In some embodiments, the electronic device may obtain the differential strategy and the upgrade file by parsing the software update package, and parse the upgrade file according to the differential strategy to obtain the upgrade feature.

[0177] For example, after obtaining the upgrade file, the software update function module (such as the software update engine) of the electronic device can parse the software update package to obtain the differential strategy and differential information, wherein the differential strategy may include but is not limited to the differential package strategy and the differential custom information strategy; then, the software update function module can extract the upgrade features from the differential information in a manner that matches the differential strategy. The differential strategy can be located in the configuration file information of the software update package, such as a file list (such as filelist).

[0178] Exemplarily, if the differential strategy is a differential package strategy, that is, the differential information is in the form of a conventional differential package, the software update function module can restore the system image according to the differential package and mount the system image as a system device; then the software update function module can extract the jar package in the bootclasspath in the system device, and obtain the upgrade feature.

[0179] Or, exemplarily, if the differential strategy is a differential custom information strategy, that is, the differential information is in the form of file differential or block differential, the software update function module can generate a system device in a corresponding manner according to the specific type of differential information; then the software update function module can extract the jar package in the bootclasspath in the system device, that is, obtain the upgrade feature. For example, if the differential information is a file differential, the software update function module can restore the system image according to the file differential and mount the system image as a system device 1 (such as a system-temp1 device); if the differential information is a block differential, the software update function module can mount the block differential as a block device, and then synthesize the block device and the system device 1 to generate a new system device 2 (such as a system-temp2 device). Among them, the above-mentioned block device is a virtual device generated by the software update function module. Regarding the method and specific process of the software update function module (such as the software update engine) generating a virtual device such as a block device, reference can be made to conventional technology, and the embodiments of the present application are not specifically limited.

[0180] S304-2: The electronic device compiles and optimizes the application according to the upgrade characteristics.

[0181] In some embodiments, after obtaining the upgrade feature, the software update function module of the electronic device (such as a software update engine) can compile and optimize the application programs that have a coupling dependency relationship with the upgrade feature, such as the jar package in the bootclasspath, to ensure good performance of these applications after the software upgrade.

[0182] In some embodiments, when compiling and optimizing applications according to the upgrade feature, the electronic device may also compile and optimize applications that meet preset conditions according to the most recent use time, use frequency, and use frequency of the applications that are coupled and dependent on the upgrade feature in the electronic device. We know that there may be applications in the electronic device that have been installed but have never been used by the user or have not been used for a long time. For such applications, not compiling and optimizing the applications will have little impact on the user, so they may not be compiled and optimized. Based on this, the software update efficiency can be further improved while ensuring the performance of applications with high importance after the software update.

[0183] Alternatively, when compiling and optimizing an application program according to the upgrade features, the electronic device may also optimize the application program according to other relevant information of the application program in the electronic device that is coupled and dependent on the upgrade features, such as the size of storage resources required for application compilation optimization, application compilation optimization, and / or improving software update efficiency.

[0184] In some embodiments, after the compilation and optimization of the application is completed, such as after S304-1 or S304-2 is executed, the electronic device can be restarted, and after the restart, the old version of the application will be replaced by the compiled and optimized application, so the entire software upgrade process is faster and can ensure smooth performance when the user uses the application. Figure 1 In the conventional system upgrade process shown, based on the solution provided by the present application, the electronic device does not need to perform the system update and the compilation optimization of the application separately, but can pre-compile and optimize the related applications in the background while the system is being updated. This feature can greatly shorten the time required for software updates. In addition, based on the solution provided by the present application, the electronic device does not need to perform multiple device restarts and compilation optimization after the restart, but can complete it at one time, thereby further shortening the time required for software updates and improving software update efficiency.

[0185] It should be noted that in the process of downloading software update packages or updating software (including software upgrades and software patch repairs) in the embodiments of the present application, the downloading of software update packages or software updates may be visible to the user or invisible to the user, and the embodiments of the present application do not make specific limitations. Among them, the downloading of software update packages is visible to the user. For example, in the process of downloading software update packages, the electronic device displays to the user Figure 7 Download interface 701 shown; software updates are visible to users. For example, during the software update process, the electronic device displays to the user Figure 7 The software update interface 702 is shown. The software update package download or software update is invisible to the user. For example, the electronic device can download the software update package or update the software in the background when it is idle (such as at night), charging or fully charged. The embodiment of the application does not specifically limit whether the software update package download or software update process is displayed in the interface, and the specific display content, display form and display effect of the interface when the interface is displayed.

[0186] In some embodiments, in order to reduce the storage load of the electronic device, the software update package sent by the cloud-side device to the electronic device may also include only the system library file, but not the application optimization code related to the system library.

[0187] Exemplarily, in order to avoid the problem of being unable to perform software updates normally due to the size of the software update package exceeding the size of the available update partition of the electronic device, the cloud-side device can send a first software package including system library files and application optimization codes related to the system library to the electronic device when the size of the available update partition of the electronic device is sufficient (such as satisfying the second condition, such as satisfying the second condition such as being greater than the size of the first software package); or, the cloud-side device can send a second software package including only system library files but not application optimization codes related to the system library to the electronic device when the size of the available update partition of the electronic device is insufficient (such as not satisfying the second condition, such as not satisfying the second condition such as being less than or equal to the size of the first software package). Among them, in the case where the software update package only includes system library files but does not include application optimization codes related to the system library, when performing a software update, the electronic device can locally generate application optimization codes related to the system library based on the system library files.

[0188] For example, assuming that the version of the original software package is Figure 8 The version shown is 1, the updated version of the software package is Figure 8 As shown in version 2, compared with version 1, the software package of version 2 not only includes system library files (such as Figure 8 System library files-2 and system library files-4) and application optimization codes related to the system library (such as Figure 8 As shown in the application optimization code-3 and application optimization code-6), it also includes other patches 1 (such as dynamic library files (such as native1.so files)) and other patches 2 (such as dynamic library files (such as native2.so files)). Figure 8 As shown, after adding other patch 1 and other patch 2, the size of the software package of version 2 exceeds the available update partition size of the electronic device, thus affecting the normal update of the software package of version 2.

[0189] Based on the scalable strategy of the software update package provided in the embodiment of the present application, such as Fig. 9 As shown in (a), when the available update partition size of the electronic device is insufficient, the cloud-side device can greatly reduce the file size of the version 2 software package by not encapsulating the application optimization code related to the system library (such as application optimization code-3 and application optimization code-6) in the version 2 software package, thereby avoiding the problem of software update failure due to insufficient available update partitions. In addition, since the application optimization code related to the system library can also be generated locally on the electronic device based on the system library file, the elastic scaling of the software update package according to the available update partition size will not have any impact on the effect of the software update. Or, Fig. 9As shown in (b), when the available update partition size of the electronic device is sufficient, the cloud-side device can normally encapsulate the application optimization code related to the system library in the version 2 software package, which will not affect the storage load of the electronic device and can ensure the normal execution of the software update.

[0190] In some embodiments, the software update package sent by the cloud-side device to the electronic device may also carry indication information for indicating whether the software update package includes application optimization code related to the system library. Exemplarily, the indication information may be carried by a patch-shrink field (such as a patch-shrink field) in a file list (such as filelist) in the software update package. For example, if the software update package only includes system library files and does not include application optimization code related to the system library, the value of the patch-shrink field may be a first value, such as true; if the software update package includes both system library files and application optimization code related to the system library, the value of the patch-shrink field may be a second value, such as false.

[0191] In order to make the cloud-side device aware of the available update partition size of the electronic device, as a possible implementation method, the electronic device can send its own available update partition size to the cloud-side device. For example, the electronic device can send the available update partition size of the electronic device to the cloud-side device while sending software version information to the cloud-side device. Alternatively, the electronic device can also send the available update partition size to the cloud-side device at other times. The specific time and method of the electronic device sending the available update partition size to the cloud-side device are not specifically limited in the embodiments of the present application.

[0192] Please refer to Fig.10 , Fig.10 Taking the electronic device sending the available update partition size to the cloud side device as an example, a flow chart of a software update method provided by an embodiment of the present application is shown. Fig.10 As shown, before the electronic device executes S301, the method may further include S1000A-S1000B:

[0193] S1000A: The electronic device sends the available update partition size of the electronic device to the cloud-side device.

[0194] S1000B: The cloud-side device uses the first software package as the software update package when the file size of the first software package meets the second condition; or uses the second software package as the software update package when the file size of the first software package does not meet the second condition.

[0195] The first software package includes the system library file and the application optimization code related to the system library; the second software package includes the system library file but does not include the application optimization code related to the system library.

[0196] When the electronic device sends the available update partition size of the electronic device to the cloud-side device, and the cloud-side device sends the software update package to the electronic device according to the available update partition size of the electronic device and adopts a strategy of elastically scaling the software update package according to the available update partition size, Figure 3 The S304-1 shown can be replaced by Fig.10 Shown is S304-1' or S304-1''.

[0197] Exemplarily, the electronic device may determine whether the software update package includes application optimization code related to the system library based on indication information carried in the software update package for indicating whether the software update package includes application optimization code related to the system library. For example, the electronic device may determine that the software update package includes system library files and application optimization code related to the system library when the value of the patch scaling field (such as the patch-shrink field) in the file list (such as filelist) in the software update package is the second value, such as false; the electronic device may determine that the software update package includes system library files but does not include application optimization code related to the system library when the value of the patch scaling field in the file list (such as filelist) in the software update package is the first value, such as true.

[0198] When it is determined that the software update package includes a system library file and an application optimization code related to the system library, the electronic device executes Fig.10 S304-1'; when it is determined that the software update package includes a system library file but does not include application optimization code related to the system library, the electronic device executes Fig.10 S304-1'' is shown. S304-1' and S304-1'' are as follows:

[0199] S304-1': The electronic device compiles and optimizes one or more application programs having a coupling dependency relationship with the patch feature according to the application optimization code related to the system library in the software update package.

[0200] For example, please refer to Fig.11 , Fig.11 Taking the software update package including system library files and application optimization codes related to the system library as an example, a schematic diagram of an application compilation optimization process provided by an embodiment of the present application is shown. Fig.11 As shown, assuming that the original software package in the electronic device is version 1, the system device corresponding to the system library file in the original software package is Fig.11 The software package of system device 1, version 2 includes system library files (such as Fig.11 System library files-2 and system library files-4) and application optimization codes related to the system library (such as Fig.11 As shown in application optimization code-3 and application optimization code-6), Fig.11 As shown, after the electronic device synthesizes the patch device and the system device 1 to generate a new system device 2, the electronic device can extract the system library file in the system device 2 to determine one or more applications that have a coupling dependency relationship with the system library, and then compile and optimize the application programs of the one or more applications according to the application optimization code related to the system library.

[0201] S304-1'': The electronic device parses the system library file in the software update package to obtain application optimization code related to the system library, and uses the application optimization code related to the system library to compile and optimize one or more application programs having a coupling dependency relationship with the patch feature.

[0202] For example, please refer to Fig.12 , Fig.12 Taking the software update package including system library files but not including application optimization codes related to the system library as an example, another schematic diagram of the application compilation optimization process provided by the embodiment of the present application is shown. Fig.12 As shown, assuming that the original software package in the electronic device is version 1, the system device corresponding to the system library file in the original software package is Fig.12 The software package of system device 1, version 2 includes system library files (such as Fig.12 As shown in system library file-2 and system library file-4), Fig.12 As shown, after the electronic device synthesizes the patch device and the system device 1 to generate a new system device 2, the electronic device can extract the system library file in the system device 2 to determine one or more applications that have a coupling dependency relationship with the system library, and obtain the application optimization code related to the system library based on the system library file, and then compile and optimize the application programs of the one or more applications based on the application optimization code related to the system library.

[0203] Among them, regarding the method and specific process of generating application optimization code related to the system library according to the system library file, reference can be made to conventional technologies.

[0204] It can be understood that based on a software update method provided by an embodiment of the present application, after receiving a software update package, the electronic device can perform a one-time and targeted compilation optimization of the application program during the software update process according to the specific patch features or upgrade features of the software, thereby achieving accurate application compilation optimization, improving the software update efficiency, and ensuring the performance of the application after the software update (such as compatibility and execution efficiency, etc.), thereby improving the user experience.

[0205] In addition, in some embodiments of the present application, the cloud-side device can dynamically adjust the files included in the software update package according to the size of the available update partition of the electronic device. For example, when the size of the available update partition is sufficient, a first software package including system library files and application optimization codes related to the system library is sent to the electronic device; when the size of the available update partition of the electronic device is insufficient, a second software package including only system library files but not application optimization codes related to the system library is sent to the electronic device. This elastic scaling strategy can reduce the storage load of the electronic device while ensuring the normal execution of the software update.

[0206] Moreover, in some embodiments of the present application, the cloud-side device can dynamically adjust the form of the files in the software update package according to a specific differential strategy. For example, when the differential strategy is a differential package strategy, differential information in the form of a conventional differential package is sent to the electronic device; when the differential strategy is a differential customized information strategy, differential information in the form of a file differential or a block differential is sent to the electronic device. Optionally, the cloud-side device can also dynamically adjust the form of the files in the software update package according to the size of the available update partition of the electronic device. For example, when the size of the available update partition is sufficient, differential information in the form of a file differential is sent to the electronic device; when the size of the available update partition of the electronic device is insufficient, differential information in the form of a block differential is sent to the electronic device. Based on this, the form of the files in the software update package can be flexibly adjusted based on the specific usage scenario, while ensuring the normal execution of the software update, and reducing the storage load of the electronic device when the size of the available update partition of the electronic device is insufficient.

[0207] It should be noted that the embodiments of the present application do not specifically limit the system architecture and usage scenarios to which the software update method is applied. For example, the software update method provided in the embodiments of the present application can be applied to a single-frame software update system architecture or a dual-image software update system architecture.

[0208] It should be understood that the various schemes of the embodiments of the present application can be used in reasonable combination, and the explanations or descriptions of the various terms appearing in the embodiments can be mutually referenced or explained in the various embodiments, without limitation.

[0209] It should also be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0210] It is understandable that, in order to implement the functions of any of the above-mentioned embodiments, the electronic device or cloud-side device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0211] The embodiments of the present application can divide the electronic device or cloud-side device into functional modules. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiments of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0212] For example, Fig.13 As shown, the electronic device may include a communication unit 1310, a software update unit 1320 and a storage unit 1330. Among them, the communication unit 1310 can be used to support the electronic device to communicate with other communication devices, such as sending software version information, software update requests, available update partition sizes, etc. to the cloud side device, and receiving software update packages (such as upgrade packages or patch packages) from the cloud side device, and / or other information related to the embodiments of the present application. The software update unit 1320 is used to perform software updates and compilation optimization of applications of related applications according to the software update package, and / or other processes related to the embodiments of the present application. The storage unit 1330 is used to provide the required storage space for software updates, and / or store other information related to the embodiments of the present application.

[0213] In some embodiments, Fig.13 As shown, the electronic device may further include a display unit 1340 for displaying interfaces, such as displaying a software package download interface, a software update interface, and / or displaying other interfaces related to the embodiments of the present application.

[0214] It should also be understood that each module in the electronic device or cloud-side device can be implemented in software and / or hardware form, without specific limitation. In other words, the electronic device is presented in the form of functional modules. The "module" here can refer to an application-specific integrated circuit ASIC, a circuit, a processor and memory that executes one or more software or firmware programs, an integrated logic circuit, and / or other devices that can provide the above functions.

[0215] In an optional manner, when data transmission is implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is implemented in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disk (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0216] The steps of the method or algorithm described in conjunction with the embodiments of the present application can be implemented in hardware or by executing software instructions by a processor. Software instructions can be composed of corresponding software modules, and software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable read-only memory (EEPROM) memory, register, hard disk, mobile hard disk, compact disc read-only memory (CD-ROM) or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). In addition, the ASIC can be located in an electronic device or a cloud side device. Of course, the processor and the storage medium can also exist as discrete components.

[0217] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

Claims

1. A software updating method, characterized in that: Applied to electronic equipment, the method comprises: The electronic device obtains the software update package; The electronic device parses the software update package to obtain update features, where the update features include patch features or upgrade features; The electronic device compiles and optimizes an application program that has a coupling dependency relationship with the update feature, or compiles and optimizes an application program that has a coupling dependency relationship with the update feature and satisfies a first condition.

2. The method according to claim 1, characterized in that: The electronic device parses the software update package to obtain update features, including: The electronic device parses the software update package to obtain a patch file; The electronic device mounts the patch file as a patch device; The electronic device reads the compiled subdirectory of the patch device to obtain an update feature, where the update feature is a patch feature.

3. The method according to claim 2, characterized in that The patch feature includes a first system library file having a coupling dependency relationship with the first application, and the electronic device compiles and optimizes the application program of the application having a coupling dependency relationship with the update feature, including: The electronic device merges the patch device with the first system device corresponding to the current system library file in the electronic device to generate a second system device; The electronic device extracts a system library file of the second system device, wherein the system library file includes the first system library file; The electronic device identifies the first application that has been patched or repaired in the system library file of the second system device; The electronic device compiles and optimizes the first application.

4. The method according to claim 3, characterized in that The first application includes one or more applications in the electronic device.

5. The method according to claim 3 or 4, characterized in that: The first system library file is related to a first function, and the first application includes an application in the electronic device having the first function.

6. The method according to claim 3 or 4, characterized in that: The first system library file includes first information, and the first application includes an application in the electronic device that uses the first information during operation.

7. The method according to claim 1, characterized in that The electronic device parses the software update package to obtain update features, including: The electronic device parses the software update package to obtain differential information; The electronic device generates a system device according to the differential information and then extracts the upgrade feature from a system library file of the system device.

8. The method according to claim 1, characterized in that: The electronic device parses the software update package to obtain update features, including: The electronic device parses the software update package to obtain differential information; The electronic device mounts the differential information as a block device; The electronic device merges the block device with a first system device corresponding to a current system library file in the electronic device to generate a second system device; The electronic device extracts the upgrade feature from a system library file of the second system device.

9. The method according to any one of claims 1 to 8, characterized in that The satisfying of the first condition includes one or more of the following: the usage frequency satisfies a first threshold, and the usage frequency satisfies a second threshold.

10. The method according to any one of claims 1 to 9, characterized in that The method further comprises: The electronic device sends the available update partition size of the electronic device to the cloud-side device, so that the cloud-side device can select whether to carry application optimization code related to the system library file in the software update package based on the available update partition size, or can select the strategy and / or form of carrying differential information in the software update package.

11. The method according to claim 10, characterized in that The size of the available update partition of the electronic device meets the second condition, and the software update package includes a system library file and an application optimization code related to the system library; or The available update partition size of the electronic device does not meet the second condition, and the software update package includes system library files but does not include application optimization codes related to the system library.

12. The method according to any one of claims 1 to 11, characterized in that The software update package includes a system library file and an application optimization code related to the system library, and the electronic device compiles and optimizes an application program of an application having a coupling dependency relationship with the update feature, including: The electronic device determines, according to the system library file, an application having a coupling dependency relationship with the update feature; The electronic device compiles and optimizes the application program of the application having a coupling dependency relationship with the update feature according to the application optimization code related to the system library.

13. The method according to any one of claims 1 to 11, characterized in that The software update package includes a system library file but does not include an application optimization code related to the system library, and the electronic device compiles and optimizes an application program of an application having a coupling dependency relationship with the update feature, including: The electronic device parses the system library file to obtain application optimization code related to the system library, and determines an application having a coupling dependency relationship with the update feature; The electronic device compiles and optimizes the application program of the application having a coupling dependency relationship with the update feature according to the application optimization code related to the system library.

14. An electronic device, characterized in that: The electronic device comprises: a memory for storing computer program instructions; A processor, configured to execute the computer program instructions to support the electronic device to implement the method as described in any one of claims 1-13.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processing circuit, the method according to any one of claims 1 to 13 is implemented.

16. A computer program product comprising instructions, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 13.

17. A chip system, characterized in that: The chip system includes a processing circuit and a storage medium, wherein the storage medium stores computer program instructions; when the computer program instructions are executed by the processing circuit, the chip system implements the method as described in any one of claims 1-13.