WO2024131823A1 - 免安装应用的升级方法及电子设备 - Google Patents

免安装应用的升级方法及电子设备 Download PDF

Info

Publication number
WO2024131823A1
WO2024131823A1 PCT/CN2023/140157 CN2023140157W WO2024131823A1 WO 2024131823 A1 WO2024131823 A1 WO 2024131823A1 CN 2023140157 W CN2023140157 W CN 2023140157W WO 2024131823 A1 WO2024131823 A1 WO 2024131823A1
Authority
WO
WIPO (PCT)
Prior art keywords
function package
electronic device
package
installation
verification value
Prior art date
Application number
PCT/CN2023/140157
Other languages
English (en)
French (fr)
Inventor
王振
孙冰心
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024131823A1 publication Critical patent/WO2024131823A1/zh

Links

Definitions

  • the present application relates to the technical field of electronic equipment, and in particular to an upgrade method for installation-free applications and an electronic device.
  • an application may include multiple different installation packages, such as a basic package, a configuration package, an entry function package, or a feature function package.
  • the electronic device requires that the version numbers of the multiple different installation packages are consistent. Whenever an application is updated, the old version of the installation package needs to be deleted and the new version of the installation package needs to be downloaded again.
  • the present application provides an upgrade method for an installation-free application and an electronic device, which can reduce unnecessary updates of some function packages in the installation-free application, increase the startup speed of the function packages in the installation-free application, and improve the user experience.
  • the present application provides an upgrade method for a free installation application, the method comprising: an electronic device obtains a first function package and a second function package of a first free installation application, the first function package includes a first description information and a first check value, and the second function package includes a second description information and a second check value; the electronic device sends the first description information and the first check value, as well as the second description information and the second check value to an application server, the first description information is used for the application server to obtain a third check value, and the second description information is used for the application server to obtain a fourth check value; when the third check value is the same as the first check value and the fourth check value is different from the second check value, the electronic device receives a second update function package sent by the application server; the electronic device deletes the second function package and saves or installs the second update function package.
  • the acquisition operation of the electronic device may refer to the operation of the electronic device searching, querying or indexing in its kernel space, user space or memory. It should be understood that the acquisition operation of the application server may refer to the operation of the server searching, querying or indexing in its memory space, memory or database.
  • the first description information and the first check value may be the same information or different information.
  • the second description information and the second check value may be the same information or different information.
  • the first description information may include one or more of the following: the package name of the first function package, the application name of the first installation-free application, etc.
  • the first function package may also include other description information, such as the version number of the first function package.
  • the second description information may include one or more of the following: the package name of the second function package, the application name of the first installation-free application, etc.
  • the second function package may also include other description information, such as the version number of the second function package.
  • the third verification value may refer to a verification value of an installation file in a first update function package of the first installation-free application stored on the application server.
  • the fourth verification value may refer to a verification value of an installation file in the second update function package in the first installation-free application stored on the application server.
  • the electronic device can verify whether the function package in the first installation-free application needs to be updated in the application server periodically/at regular intervals/irregularly based on the method.
  • the electronic device can determine whether to delete the function package stored on the electronic device based on the verification value of the installation file.
  • different versions of function packages in the same free installation application can exist on the electronic device 100 at the same time.
  • the other function packages do not need to be updated, which can increase the startup speed of the function package and improve the user experience.
  • the version number of the first function package is the same as or different from the version number of the second function package; the version number of the first function package is different from the version number of the second updated function package.
  • the version number of the first function package is different from the version number of the second update function package.
  • the electronic device can modify the version number of the first function package to the version number of a newer version, that is, the same as the version number of the second update function package. In this way, when the first function package is running, the version number presented to the electronic device is the version number of the newer version.
  • the method further includes: when the third check value is the same as the first check value, and the fourth check value is the same as the second check value, the electronic device receives a second message sent by the application server; in response to the second message, the electronic device Continue to save the first function package and the second function package.
  • the electronic device can continue to store the first function package and the second function package.
  • the method also includes: when the third verification value is different from the first verification value and the fourth verification value is the same as the second verification value, the electronic device receives a first update function package sent by the application server; the electronic device deletes the first function package, and saves or installs the first update function package.
  • the electronic device can delete the first function package, obtain and save the first updated function package. If the installation file in the second function package has not been updated, the electronic device can continue to save the second function package without downloading the second updated function package.
  • the method also includes: when the third verification value is different from the first verification value, and the fourth verification value is also different from the second verification value, the electronic device receives the first update function package and the second update function package sent by the application server; the electronic device deletes the first function package and the second function package, and saves or installs the first update function package and the second update function package.
  • the electronic device can delete the first function package and the second function package, and obtain and save the first updated function package and the second updated function package.
  • the first function package also includes a first installation file, and the first verification value is a verification value of the first installation file; the second function package also includes a second installation file, and the second verification value is a verification value of the second installation file.
  • the first update function package may include a first update installation file, first description information, and a third check value.
  • the first update function package may also include other description information, such as a version number of the first update function package.
  • the version number of the first update function package is different from the version number of the first function package.
  • the second update function package may include a second update installation file, second description information, and a fourth check value.
  • the second update function package may also include other description information, such as a version number of the second update function package.
  • the version number of the second update function package is different from the version number of the second function package.
  • the method before the electronic device receives the second update function package sent by the application server, the method also includes: the electronic device receives a first message sent by the application server; the electronic device receives the second update function package sent by the application server, specifically including: in response to the first message, the electronic device sends second description information to the application server, the second description information is used for the application server to obtain the second update function package; the electronic device receives the second update function package sent by the application server.
  • the electronic device can download the second update function package from the server when it needs to use the second update function package.
  • the method before the electronic device sends the first description information and the first verification value, and the second description information and the second verification value to the application server, the method also includes: the electronic device receives a first operation; in response to the first operation, the electronic device runs a second function package.
  • the electronic device can also proactively verify whether the function package in the first free installation application needs to be updated in the application server when the user uses the first free installation application, and obtain the updated function package. The user can use the updated function package the next time he uses the first free installation application.
  • the electronic device deletes the second function package, specifically including: after the electronic device stops running the second function package, the electronic device deletes the second function package.
  • the electronic device can delete the second function package after the second function package stops running, so that the user's use of the second function package will not be affected.
  • the method also includes: the electronic device obtains a third function package of the first installation-free application, the third function package including third description information and a fifth verification value; the electronic device receives the third description information and the sixth verification value sent by the application server; when the fifth verification value is different from the sixth verification value, the electronic device receives a third updated function package sent by the application server; the electronic device deletes the third function package, and saves or installs the third updated function package.
  • the electronic device may send an update request for the third function package to the application server so that the application server sends the third updated function package.
  • the third function package may include a third installation file, third description information and a fifth check value.
  • the third function package may also include other description information, such as a version number of the third function package.
  • the third update function package may include a third update installation file, third description information and a sixth check value.
  • the third update function package may also include other description information, such as a version number of the third update function package.
  • the version number of the third update function package is different from the version number of the third function package.
  • the server may also proactively verify with the electronic device whether the function package of the first installation-free application needs to be updated.
  • the present application provides a method for upgrading an installation-free application, which is applied to an application server, and the method includes: the application server receives a first verification value and a second verification value sent by an electronic device; the first verification value is used to verify a first function package of the first installation-free application, and the second verification value is used to verify a second function package of the first installation-free application; the application server obtains a third verification value based on the first verification value, and obtains a fourth verification value based on the second verification value; when the third verification value is the same as the first verification value, and the fourth verification value and the second verification value are different, the application server sends a second update function package to the electronic device.
  • the first check value may include description information of the first function package and a check value of an installation file in the first function package.
  • the description information of the first function package may include one or more of the following: a package name of the first function package, a name of the first installation-free application, and a version number of the first function package.
  • the second check value may include description information of the second function package and a check value of the installation file in the first function package.
  • the description information of the second function package may include one or more of the following: the package name of the second function package, the name of the first free installation application, and the version number of the second function package.
  • the third check value may include description information of the first update function package and a check value of the installation file in the first update function package.
  • the description information of the first update function package may include one or more of the following: the package name of the first update function package, the name of the first installation-free application, and the version number of the first update function package.
  • the version number of the first update function package is different from the version number of the first function package.
  • the fourth check value may include description information of the second update function package and a check value of the installation file in the first update function package.
  • the description information of the second update function package may include one or more of the following: the package name of the second update function package, the name of the first installation-free application, and the version number of the second update function package.
  • the version number of the second update function package is different from the version number of the second function package.
  • the electronic device sending the first verification value to the application server may refer to the electronic device sending the package name of the first function package and the verification value of the installation file in the first function package to the application server.
  • the electronic device sending the second verification value to the application server may refer to the electronic device sending the package name of the second function package and the verification value of the installation file in the second function package to the application server.
  • the application server obtains the third verification value according to the first verification value, which may mean that the application server obtains the verification value of the installation file in the first update function package according to the package name of the first function package.
  • the application server obtains the fourth verification value according to the second verification value, which may mean that the application server obtains the verification value of the installation file in the second update function package according to the package name of the second function package.
  • the third check value is the same as the first check value, which may mean that the check value of the installation file in the first update function package is the same as the check value of the installation file in the first function package.
  • the fourth check value is different from the second check value, which may mean that the check value of the installation file in the second update function package is different from the check value of the installation file in the second function package.
  • the version number of the first function package is the same as or different from the version number of the second function package; the version number of the first function package is different from the version number of the second updated function package.
  • the method also includes: the application server sends the sixth verification value of the third updated function package to the electronic device, and the sixth verification value is used by the electronic device to verify the third function package of the installation-free application; when the fifth verification value of the third function package is different from the sixth verification value of the third update function package, the server sends the third updated function package to the electronic device.
  • the server may receive an update request for the third function package sent by the electronic device to send the third updated function package to the electronic device.
  • the fifth check value may include description information of the third function package and a check value of the installation file in the third function package.
  • the description information of the third function package may include one or more of the following: the package name of the third function package, the name of the first installation-free application, and the version number of the third function package.
  • the sixth check value may include description information of the third update function package and a check value of the installation file in the third update function package.
  • the description information of the third update function package may include one or more of the following: the package name of the third update function package, the name of the first installation-free application, and the version number of the third update function package.
  • the version number of the third update function package is different from the version number of the third function package.
  • the application server sending the sixth verification value to the electronic device may refer to the application server sending the package name of the third update function package and the verification value of the installation file in the third update function package to the electronic device.
  • the sixth verification value is used by the electronic device to obtain the fifth verification value, and may refer to a verification value of an installation file in the third function package obtained by the electronic device based on the package name of the third update function package.
  • the fifth check value is different from the sixth check value, which may mean that the check value of the installation file in the third update function package is different from the check value of the installation file in the third function package.
  • the present application provides an electronic device, characterized in that the electronic device includes a processor and a memory; the memory and the processor The device is coupled, the memory is used to store computer program code, the computer program code includes computer instructions, and the processor calls the computer instructions to enable the electronic device to execute an installation-free application upgrade method provided in any possible implementation of any of the above aspects.
  • the present application provides a computer-readable storage medium, characterized in that it is used to store computer instructions.
  • the computer instructions When the computer instructions are executed on an electronic device, the electronic device executes a method for upgrading an installation-free application provided in any possible implementation of any of the above aspects.
  • the present application provides a computer program product, characterized in that when the computer program product is run on an electronic device, the electronic device executes a method for upgrading an installation-free application provided in any possible implementation of any of the above aspects.
  • FIG. 1A-FIG. 1B are a set of UI diagrams provided in an embodiment of the present application.
  • 2A-2C are another set of UI diagrams provided in the application embodiment
  • 3-4 are schematic diagrams of a group of update function packages provided in the application embodiment
  • 5A-5B are schematic diagrams of another set of update function packages provided in an embodiment of the present application.
  • FIG5C is a system architecture diagram provided in an embodiment of the present application.
  • FIG6 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the application.
  • FIG. 7 is a block diagram of a software architecture of an electronic device 100 provided in an embodiment
  • FIG8 is a schematic diagram of a process of updating a single function package on an electronic device 100 provided in an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a flow chart of an electronic device 100 updating multiple function packages provided in an embodiment of the present application.
  • FIG10 is a schematic diagram of a flow chart of a method for upgrading an installation-free application provided in an embodiment of the present application
  • FIG. 11 is a flow chart of another method for upgrading an application without installation provided in an embodiment of the present application.
  • first and second are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated.
  • a feature defined as “first” or “second” may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality” means two or more.
  • ordinary applications may refer to applications that require users to manually download installation packages from application servers and install them on electronic devices. After ordinary applications are installed on electronic devices, the icons of ordinary applications may be displayed on the desktop of electronic devices. In addition, ordinary applications also require users to manually uninstall them from electronic devices. After ordinary applications are uninstalled from electronic devices, the icons of ordinary applications also disappear from the desktop of electronic devices.
  • the installation package of a common application can implement multiple different functional features.
  • a user only wants to use one functional feature in a common application, he or she needs to download and save the complete installation package of the common application on the electronic device before using the functional feature.
  • the installation package of a common application is relatively large.
  • the size of the installation package of a common application is generally around 100MB, 150MB or 200MB. Therefore, it takes a long time to download the installation package of a common application.
  • the common application may be a Huawei video application.
  • FIG. 1A shows the main interface 210 of the electronic device 100 before the Huawei video application is installed.
  • the main interface 210 includes icons of multiple applications, such as an icon of a weather application, an icon of a Huawei store application, an icon of a smart home application, an icon of a sports and health application, an icon of a memo application, an icon of a calendar application, an icon of a life service application, an icon of a camera application, an icon of an address book application, an icon of a phone application, and an icon of an information application.
  • the main interface 210 also shows a battery indicator, a weather indicator, a date indicator, a network signal indicator, a page indicator, and the like.
  • Figure 1B shows the main interface 220 of the electronic device 100 after the Huawei video application is installed.
  • the main interface 220 is similar to the main interface 210, except that the main interface 220 also includes an icon 2201 of the Huawei video application.
  • the electronic device 100 can receive a user's request for the Huawei video application icon 2201 in the main interface 220. In response to the user's input operation (such as a single click), the electronic device 100 can display the content of the Huawei Video application, such as playing a video provided by the Huawei Video application.
  • Installation-free applications may refer to applications that do not require users to manually download the application installation package from the application server and are installed on electronic devices on demand.
  • the application server may automatically send the installation packages of the top N installation-free applications used by the user group to the electronic device, and the electronic device may automatically install the installation-free application.
  • the electronic device may display an icon, card, or link of the installation-free application.
  • the electronic device 100 can display a card of an installation-free application
  • the electronic device can receive an input operation of the user for the card and start the installation-free application.
  • the user does not need to manually uninstall the installed installation-free application from the electronic device.
  • the electronic device can automatically uninstall the installation-free application from the electronic device.
  • the installation package of the installation-free application is relatively small.
  • the size of the installation package of the installation-free application can generally be within 10MB, 15MB or 20MB, so the electronic device can quickly download the installation package of the installation-free application, and quickly install and start the installation-free application on the device.
  • the installation-free application may be an air-conditioning control application.
  • the electronic device 100 receives a sliding operation (eg, a horizontal sliding operation to the right) performed by the user on the main interface 210 .
  • the electronic device 100 may display the user interface 410 shown in FIG. 2B .
  • the user interface 410 may be a user interface of a service center on the electronic device 100.
  • the user may search for or use an installation-free application in the user interface 410.
  • the service center may be a capability provided by the operating system of the electronic device 100, and the service center may be understood as a system application on the electronic device 100.
  • the service center may recommend cards of free installation applications to users based on the usage habits of users using the electronic device 100. Users may quickly open free installation applications based on the cards of free installation applications provided by the service center.
  • the user interface 410 shown in FIG. 2B may be a user interface provided by the service center on the electronic device 100.
  • the electronic device 100 can receive a user input operation (such as a single click) on the card for the air-conditioning control application.
  • a user input operation such as a single click
  • the electronic device 100 can send the type of the electronic device 100 and the identifier of the air-conditioning control application to the application server.
  • the electronic device 100 can receive the user's search operation in the search bar in the user interface 410 to find and download the air conditioning control application.
  • the card of the air conditioning control application is not limited to being displayed in the user interface 410, and the card of the air conditioning control application can also be displayed on the desktop or in the pull-down notification bar. This application does not limit this.
  • the electronic device 100 may display the user interface 420 shown in FIG. 2C.
  • the user interface 420 is a user interface in the air conditioning control application.
  • the user can control the air conditioning in the living room on the user interface 420, such as turning on/off the air conditioning in the living room, turning on/off the energy-saving mode of the air conditioning in the living room, adjusting the temperature of the air conditioning in the living room, the timing duration of the air conditioning in the equipment hall, turning on/off the remote control of the air conditioning in the living room, etc.
  • An installation-free application may include multiple installation packages, and different installation packages may implement different functional characteristics.
  • the electronic device 100 also supports the user to download only the installation package corresponding to one of the multiple functional characteristics of the installation-free application when using the one functional characteristic.
  • the multiple installation packages of the installation-free application may also be referred to as multiple function packages of the installation-free application. In this way, the electronic device 100 can quickly download and install the function package of the installation-free application, and quickly implement the functional characteristics provided by the function package.
  • the first free installation application is generally developed by the same manufacturer, and the first free installation application can implement the same or similar functions on devices of different device types.
  • the installation files or package names of the function packages of the first free installation application downloaded by devices of different device types can be the same or different.
  • the installation package sizes of the first free installation application can also be the same or different.
  • the first installation-free application has three function packages, which are installation packages of different functional characteristics in the first installation-free application.
  • the first function package can implement the first functional characteristics
  • the second function package can implement the second functional characteristics
  • the third function package can implement the third functional characteristics.
  • the electronic device 100 can download any one of the three function packages in time sharing, and use the functional characteristics of each function package in time sharing.
  • the first function package may include a basic function package or an Entry function package.
  • the second function package may include a configuration function package, such as a resource package related to the language configuration of the first installation-free application, a resource package related to the configuration of the central processing unit (CPU) of the first installation-free application, etc.
  • the third function package may include a Feature function package, such as a resource package related to images in the first installation-free application, etc.
  • the version numbers of the first function package, the second function package and the third function package are the same.
  • the version numbers of the first function package, the second function package and the third function package are all app version1.0.
  • the version numbers of different function packages in the same free installation application on the electronic device 100 need to be consistent. For example, when the electronic device 100 updates a function package in the first free installation application, the electronic device 100 can download a newer version of the function package from the application server. When the electronic device 100 installs the newer version of the function package, if the version number of other function packages installed on the electronic device 100 is inconsistent with the version number of the newer version of the function package, the electronic device 100 will delete the other function packages and then download the newer version of the other function packages from the application server.
  • the electronic device 100 can receive the user's operation to download the first functional package from the application server. After the electronic device 100 downloads the first functional package locally on the electronic device 100, the user can use the first functional characteristics of the first installation-free application. For example, the user can control the working mode of the air conditioner in the home based on the user interface 420 shown in FIG. 2C .
  • the first function package may include a first installation file, description information of the first function package, a check value of the first installation file, etc.
  • the first installation file may be used by the electronic device 100 to implement the first functional characteristics of the first installation-free application.
  • the description information of the first function package may include but is not limited to one or more of the following: the package name of the first function package, the name of the first installation-free application, the version number of the first function package, etc.
  • the check value of the first installation file may be used to verify whether the first installation file in the first function package is updated.
  • the electronic device 100 can receive the user's operation to download the second functional package from the application server. After the electronic device 100 downloads the second functional package locally on the electronic device 100, the user can use the second functional characteristics of the first installation-free application based on the second functional package.
  • the functions implemented by the second functional package are different from those implemented by the first functional package.
  • the version number of the first function package in the first installation-free application is consistent with the version number of the second function package in the first installation-free application, so the first function package and the second function package can be stored on the electronic device 100 at the same time.
  • the function package of the free installation application also needs to be updated. Then the developer needs to upload the updated function package of the free installation application to the application server.
  • the dark box shown in (a) in Figure 4 represents the first updated function package after the first functional feature is updated.
  • the developer uploads the first updated function package of the first free-installation application to the application server.
  • the developer also needs to update the version number of the first updated function package.
  • the version number of the first updated function package is app version 2.0.
  • the version numbers of the second function package and the third function package need to be modified to be consistent with the version number of the first updated function package.
  • the version numbers of the first updated function package, the second updated function package, and the updated third function package are all app version 2.0.
  • the electronic device 100 can continue to allow the user to continue to use the first functional characteristics of the first free installation application based on the first functional package. Accordingly, the electronic device 100 can download the first updated functional package of the first free installation application from the application server. After the first free installation application stops being used, the electronic device 100 will delete the first functional package and store the first updated functional package on the electronic device 100, so that the electronic device 100 can implement the first updated functional characteristics of the first free installation application based on the first updated functional package.
  • the second functional package of the first free installation application is stored on the electronic device 100. Since the version of the second functional package is app version1.0, it is inconsistent with the version number of the first updated functional package. Then, according to the principle of the newer version number, the electronic device 100 can delete the second functional package stored on the electronic device 100.
  • the electronic device 100 can save the first updated function package, and the version number of the first updated function package is app version 2.0.
  • the electronic device 100 can download the second updated functional package from the application server and install the second updated functional package. After installing the second updated functional package, the electronic device 100 can implement the second updated functional characteristics of the first installation-free application based on the second updated functional package.
  • the electronic device 100 when the installation file in the second update function package is the same as the first installation file in the second update function package, that is, the installation file in the second update function package is not updated, but only the version number of the second update function package is updated, the electronic device 100 also needs to delete the old version of the second function package previously stored on the electronic device 100 and download the newer version of the second update function package.
  • the network environment of the electronic device 100 is not good, it will take a long time for the electronic device 100 to download the second update function package, which will also waste traffic and poor user experience.
  • various embodiments of the present application provide a method for independently upgrading a function package of an application without installing the application.
  • the method may include:
  • the electronic device 100 downloads the first function package and the second function package of the first installation-free application from the application server.
  • the first function package may include a first installation file, description information of the first function package, a checksum of the first installation file, etc.
  • the installation file is used by the electronic device 100 to implement the first functional characteristics of the first installation-free application.
  • the description information of the first function package may include but is not limited to one or more of the following: the package name of the first function package, the name of the first installation-free application, the version number of the first function package, etc.
  • the checksum of the first installation file is used to verify whether the first installation file in the first function package is updated.
  • the second function package may include a second installation file of the second function package, description information of the second function package, a check value of the second installation file, etc.
  • the second installation file is used by the electronic device 100 to implement the second functional characteristics of the first installation-free application.
  • the description information of the second function package may include but is not limited to one or more of the following: the package name of the second function package, the name of the first installation-free application, the version number of the second function package, etc.
  • the check value of the second installation file is used to verify whether the second installation file in the second function package is updated.
  • the electronic device 100 obtains the description information of the first function package and the verification value of the first installation file, as well as the description information of the second function package and the verification value of the second installation file, and sends them to the server 200 .
  • the server 200 may obtain the verification value of the first update installation file stored on the server 200 based on the description information of the first function package, and may also obtain the verification value of the second update installation file stored on the server 200 based on the description information of the second function package.
  • the acquisition operation of the electronic device may refer to the search, query or index operation of the electronic device in its kernel space, user space or memory.
  • the acquisition operation of the application server may refer to the search, query or index operation of the server in its memory space, storage or database.
  • the server 200 can send a message to the electronic device 100, which is used to indicate that the electronic device 100 does not need to delete the first function package, and the electronic device 100 can still implement the first functional characteristics of the first free installation application based on the first function package.
  • the electronic device 100 can delete the first function package in the electronic device 100.
  • the server 200 may actively send the first update function package and/or the second update function package to the electronic device 100.
  • the electronic device 100 may download the first update function package and/or the second update function package from the server 200.
  • the checksum of the installation file may be a hash value of the installation file.
  • any method that can verify whether the installation file in the function package has changed may be applicable to the present application, such as a timestamp or a logical clock, etc., which is not limited in the present embodiment.
  • the electronic device 100 can determine whether to delete the locally stored function package based on the verification value of the installation file.
  • different versions of function packages in the same free installation application can exist on the electronic device 100 at the same time.
  • FIG5A is a schematic diagram of a system for independently upgrading an application provided by the present application.
  • the dark box shown in (a) in FIG. 5A represents the first updated function package after the first functional feature is updated.
  • the developer needs to re-upload the first updated function package to the application server. Accordingly, the developer also needs to change the version number of the first updated function package to app version 2.0.
  • the first function package after the version number and installation file are updated can be called the first updated function package.
  • the version number of the second function package needs to be changed to app version 2.0
  • the version number of the third function package needs to be changed to app version 2.0.
  • the second function package after the version number is updated can be called the second updated function package
  • the third function package after the version number is updated can be called the updated third function package.
  • the checksum of the first update installation file is different from the checksum of the first installation file, and the version number of the first update function package is also different from the version number of the first function package.
  • the checksum of the second update installation file is the same as the checksum of the second installation file, but the version number of the second update function package is the same as the version number of the second function package.
  • the package version numbers are different.
  • the checksum of the updated installation file three is the same as the checksum of the installation file three, but the version numbers of the updated third function package and the third function package are different.
  • the electronic device 100 can allow the user to continue to use the first function characteristic of the first free installation application based on the first function package. Accordingly, the electronic device 100 can download the first updated function package of the first free installation application from the application server. After the first free installation application stops being used, the electronic device 100 will delete the first function package and save the first updated function package of the first free installation application, so that the user can use the first updated function characteristic of the first free installation application based on the first updated function package next time.
  • the second function package of the first free installation application is stored on the electronic device 100.
  • the electronic device 100 needs to determine whether the installation file in the second function package is also updated. Specifically, the electronic device 100 can obtain the description information of the second function package and the verification value of the second installation file. And send the description information of the second function package and the verification value of the second installation file to the application server. The application server can obtain the verification value of the second updated installation file based on the description information of the second function package.
  • the check value of the second installation file is the same as the check value of the second updated installation file, it means that the second installation file and the second updated installation file are the same, that is, the functional characteristics of the free installation application 2 are not updated, and there is no need to delete the second function package.
  • the electronic device 100 may simultaneously store a first updated function package and a second function package having inconsistent version numbers.
  • the installation file in the second update function package is different from the installation file in the second function package.
  • the electronic device 100 can download the first update function package of the first installation-free application from the application server. After the first installation-free application stops being used, the electronic device 100 can delete the first function package and save the first update function package on the electronic device 100, so that the user can use the first update function feature of the first installation-free application based on the first update function package next time.
  • the electronic device 100 has previously downloaded the second function package of the first installation-free application.
  • the version of the second function package is app version1.0, which is inconsistent with the version of the first update function package.
  • the electronic device 100 needs to determine whether the installation file of the second function package is also updated. Specifically, the electronic device 100 can obtain the description information of the second function package and the verification value of the second installation file. And send the description information of the second function package and the verification value of the second installation file to the application server. The application server can obtain the verification value of the second update installation file based on the description information of the second function package. When the check value of the second installation file is different from the check value of the second update installation file, it means that the second installation file and the second update installation file are different. At this time, the electronic device 100 can delete the second function package and download the second update function package.
  • the first update function package and the second update function package are stored on the electronic device 100.
  • the versions of the first update function package and the second update function package are the same.
  • the electronic device 100 may also periodically or at intervals or irregularly verify whether the locally stored installation files in the first function package and the installation files in the second function package are updated. Specifically, the electronic device 100 may periodically or at intervals or irregularly obtain the description information of the first function package and the check value of the first installation file, as well as the description information of the second function package and the check value of the second installation file, and send the description information of the first function package and the check value of the first installation file, as well as the description information of the second function package and the check value of the second installation file to the application server.
  • the application server may obtain the check value of the first updated installation file based on the description information of the first function package, and obtain the check value of the second updated installation file based on the description information of the second function package.
  • the application server may compare the check value of the installation file with the check value of the updated installation file to confirm whether the installation files in the first function package and the installation files in the second function package are updated. Specifically, when the check value of the first installation file is the same as the check value of the first updated installation file, and the check value of the second installation file is also the same as the check value of the second updated installation file, the electronic device 100 may continue to save the first function package and the second function package.
  • the electronic device 100 can obtain the second update function package, delete the second function package, and save the first function package and the second update function package.
  • the electronic device 100 can obtain the first update function package, delete the first function package, and save the first update function package and the second function package.
  • the electronic device 100 can obtain the first update function package and the second update function package, delete the first function package and the second function package, and save the first update function package and the second update function package.
  • FIG5C is a system architecture diagram provided in an embodiment of the present application.
  • the devices included in the system include but are not limited to an electronic device 100 and a server 200 .
  • server 200 may also be referred to as an application server.
  • the electronic device 100 includes but is not limited to a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld Computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, vehicle-mounted devices, smart home devices and/or smart city devices.
  • PDAs personal digital assistants
  • AR augmented reality
  • VR virtual reality
  • AI artificial intelligence
  • wearable devices wearable devices
  • vehicle-mounted devices smart home devices and/or smart city devices.
  • the electronic device 100 stores a first function package and a second function package of a first installation-free application.
  • the first function package can implement a first functional characteristic of the first installation-free application
  • the second function package can implement a second functional characteristic of the first installation-free application.
  • the electronic device 100 updates a function package in the first free installation application, it also needs to determine whether other function packages in the first free installation application are updated. Specifically, the electronic device 100 obtains the description information and check value of other function packages in the first free installation application, and sends the description information and check value of other functions to the server 200.
  • the server 200 may obtain the verification values of the installation files in other function packages stored in the server 200 based on the description information of the other function packages.
  • the verification value of the installation files in other function packages stored in the server 200 is the same as the verification value of the installation files in other function packages sent by the electronic device 100, it means that the installation files in the other function packages have not changed, and only the version numbers of the other function packages have changed. In this case, the other function packages stored on the electronic device 100 do not need to be deleted.
  • the electronic device 100 can delete the stored other function packages and re-download the newer version of the function packages from the server 200.
  • FIG. 6 shows a schematic structural diagram of the electronic device 100 .
  • the embodiment is described in detail below by taking the electronic device 100 as an example. It should be understood that the electronic device 100 shown in FIG6 is only an example, and the electronic device 100 may have more or fewer components than those shown in FIG6, may combine two or more components, or may have different component configurations.
  • the various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits.
  • the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 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 components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc.
  • AP application processor
  • GPU graphics processor
  • ISP image signal processor
  • controller a memory
  • video codec a digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • Different processing units may be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 100.
  • the controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 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 110, and thus improves the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • the interfaces 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 (mobile industry processor interface, MIPI), general-purpose input/output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and/or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C inter-integrated circuit
  • I2S inter-integrated circuit sound
  • PCM pulse code modulation
  • UART universal asynchronous receiver/transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may include multiple groups of I2C buses.
  • the processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces.
  • the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
  • the I2S interface can be used for audio communication.
  • the processor 110 can include multiple I2S buses.
  • the processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170.
  • the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
  • the PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals.
  • the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface.
  • the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus for asynchronous communication.
  • the bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the UART interface is generally used to connect the processor 110 and the wireless communication module 160.
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
  • the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193.
  • the MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc.
  • the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100.
  • the processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc.
  • the GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
  • the USB interface 130 is an interface that complies with USB standard specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
  • the USB interface 130 may be used to connect a charger to charge the electronic device 100. It may also be used to connect headphones to play audio through the headphones.
  • the interface may also be used to connect other electronic devices, such as AR devices, etc.
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100.
  • the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
  • the charging management module 140 is used to receive charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 may receive charging input from a wired charger through the USB interface 130.
  • the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc.
  • the power management module 141 can also be set in the processor 110.
  • the power management module 141 and the charging management module 140 can also be set in the same device.
  • the wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
  • Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas.
  • antenna 1 can be reused as a diversity antenna for a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 can provide solutions for wireless communications including 2G/3G/4G/5G, etc., applied to the electronic device 100.
  • the mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modem.
  • the processor performs demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves for radiation through the antenna 1.
  • at least some functional modules of the mobile communication module 150 can be set in the processor 110.
  • at least some functional modules of the mobile communication module 150 can be set in the same device as at least some modules of the processor 110.
  • the modem processor may include a modulator and a demodulator.
  • 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.
  • the application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194.
  • the modem processor may be an independent device.
  • the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) and the like applied to the electronic device 100.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared
  • the wireless communication module 160 can be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering processing, and sends the processed signal to the processor 110.
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify the signal, and convert it into electromagnetic waves for radiation through the antenna 2.
  • the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 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 a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and/or a satellite based augmentation system (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation system
  • the electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor.
  • the GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, etc.
  • the display screen 194 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, quantum dot light-emitting diodes (QLED), etc.
  • the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
  • the electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
  • ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise and brightness of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and projects it onto the photosensitive element.
  • the photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor.
  • CMOS complementary metal oxide semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • the DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format.
  • the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
  • the digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
  • Video codecs are used to compress or decompress digital videos.
  • the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
  • MPEG Moving Picture Experts Group
  • MPEG2 MPEG2, MPEG3, MPEG4, etc.
  • NPU is a neural network (NN) computing processor.
  • NN neural network
  • applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
  • the internal memory 121 can be used to store computer executable program codes, which include instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121.
  • the internal memory 121 may include a program storage area and a data storage area.
  • the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.
  • the data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc.
  • the internal memory 121 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.
  • UFS universal flash storage
  • the electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
  • the speaker 170A also called a "speaker" is used to convert an audio electrical signal into a sound signal.
  • the electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
  • the receiver 170B also called a "earpiece" is used to convert audio electrical signals into sound signals.
  • the voice can be received by placing the receiver 170B close to the human ear.
  • Microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C.
  • the electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
  • the earphone interface 170D is used to connect a wired earphone.
  • the earphone interface 170D may be the USB interface 130, or may be a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A can be set on the display screen 194.
  • the capacitive pressure sensor can be a parallel plate including at least two conductive materials.
  • the electronic device 100 determines the intensity of the pressure according to the change in capacitance.
  • the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A.
  • the electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
  • the gyro sensor 180B can be used to determine the motion posture of the electronic device 100.
  • the angular velocity of the electronic device 100 around three axes i.e., x, y, and z axes
  • the gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • the air pressure sensor 180C is used to measure air pressure.
  • the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case.
  • the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D, and then set the flip cover automatic unlocking and other features according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
  • the distance sensor 180F is used to measure the distance.
  • the electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
  • the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the electronic device 100 emits infrared light outward through the light emitting diode.
  • the electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100.
  • the electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
  • the temperature sensor 180J is used to detect temperature.
  • the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • the touch sensor 180K is also called a "touch panel”.
  • the touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
  • the bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone.
  • the audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function.
  • the application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.
  • the key 190 includes a power key, a volume key, etc.
  • the key 190 may be a mechanical key or a touch key.
  • the electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
  • Motor 191 can generate vibration prompts.
  • Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
  • touch operations acting on different applications can correspond to different vibration feedback effects.
  • touch operations acting on different areas of the display screen 194 can also correspond to different vibration feedback effects.
  • Different application scenarios for example: time reminders, receiving messages, alarm clocks, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.
  • the SIM card interface 195 is used to connect a SIM card.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.
  • the embodiment of the present invention uses a layered architecture to exemplify the software structure of the electronic device 100.
  • FIG 7 is a software architecture block diagram of the electronic device 100 of an embodiment of the present application.
  • the layered architecture divides the software into several layers, each with a clear role and division of labor.
  • the layers communicate with each other through software interfaces.
  • the system of the electronic device can be divided into an application layer, an application architecture layer, a system library, and a kernel layer.
  • the application layer can be used to implement application management and interface operations.
  • the application layer can include a series of application packages, such as Users can search for or use installation-free applications through the service center on their electronic devices.
  • the application framework layer may include a function package download module, a function package management module, and a free application installation module.
  • the function package downloading module is used to delete the function package stored on the electronic device 100 when the installation file in the function package stored on the electronic device 100 has been updated.
  • the feature package download module is also used to install file updates in the feature package and download newer versions of the feature package of the free-to-install application from the application server.
  • the feature package management module is used to store feature packages of free installation applications.
  • the free-installation application installation module is used to implement the functional features of the free-installation application based on the function package of the free-installation application.
  • the system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
  • functional modules such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
  • the surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
  • a 2D graphics engine is a drawing engine for 2D drawings.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • the embodiment of the present application provides a method for independently upgrading a function package of an application without installation, which determines whether the function package needs to be updated based on the check value of the installation file in the function package. If the check value of the installation file in the function package stored on the electronic device is consistent with the check value of the installation file in the updated function package stored in the server, it means that the installation file in the function package stored on the electronic device has not been updated, and the electronic device does not need to delete the function package.
  • the AppScope directory may include resources and app.json.
  • the description information of the installation-free application may be added to the AppScope directory, for example, the description information of the installation-free application may be added to the app.json file.
  • the description information of the installation-free application may include but is not limited to: the name of the application, the version number of the application, etc.
  • An installation-free app can include multiple feature packages. Developers can create multiple feature package directories within an installation-free app under the AppScope directory, such as an entry feature package directory and a feature feature package directory. Developers can also add description information of the feature package in the feature package directory.
  • the entry function package directory may include scr/main, resources, ets and module.json. Developers can add information about the entry function package in the entry function package directory. For example, the information about the entry function package can be added in the module.json file.
  • the information about the entry function package includes but is not limited to the name of the entry function package, component information that implements the functional characteristics of the entry function package, etc. In some embodiments, the component information that implements the functional characteristics of the entry function package can also be referred to as the installation file of the entry function package.
  • the feature package directory may also include scr/main, resources, ets, and module.json. Developers may also add feature package information in the feature package directory. For example, feature package information may be added to the module.json file. Feature package information includes but is not limited to the name of the feature package, component information of the feature package, etc. In some embodiments, the component information of the feature package may also be referred to as the installation file of the feature package.
  • the checksums of the files installed in the entry package and the feature package are calculated separately. There is no need to calculate the checksum of the AppScope file. In this way, even if the version number of the installation-free application changes, it will only affect the checksum of the AppScope file, and will not affect the checksum of the installation file in the entry function package and the checksum of the installation file in the feature function package.
  • a development module.json file can generate a deployment hap file.
  • an entry.hap file is generated.
  • a feature.hap file is generated.
  • the module.json file in the entry.hap file may be composed of the module.json file in the entry file and the app.json file in the AppScope directory in Table 1. Accordingly, the checksum of the installation file in the entry function package needs to be inserted into the module.json file.
  • the module.json file in the feature.hap file is composed of the module.json file in the feature file in Table 1 and the app.json file in the AppScope directory. Accordingly, the checksum of the installation file in the feature package needs to be inserted into the module.json file.
  • the entry.hap file may be referred to as an entry function package.
  • the feature.hap file may be referred to as a feature function package.
  • the entry.hap file contains the checksum of the function package installation file.
  • the feature.hap function package also contains the checksum of the function package installation file.
  • the deployment state view of the free-installation application is obtained, the deployment state view of the free-installation application is packaged and merged, and the complete installation package of the free-installation application is uploaded to the application server.
  • the name of the free installation application may be “xxx”, and the free installation application includes two function packages with different functional features, such as entry.hap and feature.hap.
  • entry.hap includes the installation file of the feature package, information about entry.hap, application description information of the free installation application to which entry.hap belongs, and the verification value of the entry.hap installation file.
  • feature.hap includes the installation file of the feature package, feature.hap information, application description information of the free installation application to which feature.hap belongs, and the checksum of the feature.hap installation file.
  • the information of entry.hap and the application description information of the installation-free application to which entry.hap belongs may be referred to as the description information of entry.hap.
  • the information of feature.hap and the application description information of the installation-free application to which feature.hap belongs may be referred to as the description information of feature.hap.
  • this application is described by taking the example of how to obtain the checksum value of the hap package during the compilation process of the hap package of the free installation application in OpenHarmony.
  • the embodiments of this application can also be applied to other operating systems, such as operating system,
  • the principle of obtaining the verification value of the installation package in the operating system is similar to that of the present application, and the embodiments of the present application do not limit this.
  • FIG8 is a schematic diagram of a process of updating a single function package on an electronic device 100 provided in an embodiment of the present application.
  • a first function package of a first installation-free application is stored in an application server, and a verification value of a first installation file is verification value one.
  • the application server stores a first function package of a first installation-free application, and the first function package can implement a first functional characteristic of the first installation-free application.
  • the first function package may include a first installation file, description information of the first function package, and a check value 1 of the first installation file.
  • the description information of the first function package may include but is not limited to one or more of the following: the package name of the first function package, the name of the first installation-free application, the version number of the first function package (the first version number), etc.
  • the check value 1 of the first installation file is used to verify whether the first installation file is updated.
  • Fig. 8 is described by taking the update of one function package in the first installation-free application as an example.
  • the description of the update of multiple function packages in the first installation-free application please refer to the embodiment of Fig. 9.
  • the application server sends the first function package to the electronic device 100 .
  • the electronic device 100 implements the first functional characteristics of the first installation-free application based on the first functional package.
  • the electronic device 100 may download the first function package of the first installation-free application from the application server, and the electronic device 100 may implement the first functional characteristics of the first installation-free application based on the first function package.
  • the application server receives a first update function package of a first installation-free application uploaded by a developer, and the verification value of the first update installation file is verification value 2.
  • the first updated installation file in the first updated function package is different from the first installation file in the first function package, and correspondingly, the version number of the first updated function package will also change.
  • the first updated function package may include the first updated installation file of the first updated function package, the description information of the first updated function package, and the second check value of the first updated installation file.
  • the description information of the first updated function package may include but is not limited to one or more of the following: the package name of the first updated function package, the name of the first installation-free application, the version number of the first updated function package (the second version number), etc.
  • the second check value of the first updated installation file is also different from the first check value of the first installation file, that is, the first updated installation file in the first updated function package is different from the first installation file in the first function package, so that it can be judged that the installation file of the first updated function package has been updated.
  • only the version number of the first function package may be updated to obtain the first updated function package of the first installation-free application.
  • the first updated function package may include the first installation file of the first updated function package, the description information of the first updated function package, and the second check value of the first installation file in the first updated function package.
  • the description information of the first updated function package may include but is not limited to one or more of the following: the package name of the first updated function package, the name of the first installation-free application, the version number of the first updated function package (the second version number), etc.
  • the second check value of the first installation file in the first update function package is the same as the first check value of the first installation file in the first function package, that is, the installation file in the first update function package is the same as the installation file in the first function package, so that it can be judged that the installation file in the first update function package has not been updated.
  • S804 may also be executed after S802.
  • the application server deletes the first function package and saves the first updated function package.
  • the application server may save the newer version of the function package and delete the old version of the function package, that is, the application server deletes the first function package and saves the first updated function package.
  • S806 The electronic device 100 receives the first operation and runs the first function package.
  • the user can use the first functional characteristics of the first free-installation application based on the first function package.
  • the first free-installation application can be an air-conditioning control application, and the user can control the working mode of the air-conditioning in the home based on the user interface 420 shown in FIG2C.
  • the electronic device 100 sends the description information and the verification value of the first function package to the application server.
  • the electronic device 100 When the electronic device 100 runs the first function package, it can obtain the description information and check value 1 of the first function package, and send the description information and check value 1 of the first function package to the application server.
  • the application server can confirm whether the installation file of the first function package is updated based on the description information and check value 1 of the first function package. In the case where the installation file in the first function package is updated, the electronic device 100 can obtain a newer version of the first function package. In the case where the installation file of the first function package is not updated, the electronic device 100 can continue to save the first function package.
  • the method provided in the embodiment of the present application may not execute S806, and the electronic device 100 may send the description information of the first function package and the verification value of the installation file in the first function package to the application server periodically, at regular intervals, or irregularly.
  • the application server may verify whether the installation file in the first function package is updated based on the description information of the first function package and the verification value of the installation file in the first function package.
  • the electronic device 100 may obtain a function package containing the updated installation file, namely, the first updated function package. In this way, when the user uses the first functional feature of the first installation-free application, the electronic device 100 may implement the first updated functional feature of the first installation-free application based on the first updated function package.
  • the method provided in the embodiment of the present application may not execute S806.
  • the application server may periodically, at a certain interval, or irregularly send the description information of the first updated function package and the second check value of the first updated installation file to the electronic device 100.
  • the electronic device 100 confirms whether to obtain the first updated function package.
  • the application server obtains a second verification value of the first update installation file based on the description information of the first function package.
  • the application server may obtain the second verification value of the first updated installation file based on the description information of the first function package, and determine whether the installation file has changed by comparing the verification values of the installation file.
  • S809 The application server needs to determine whether the check value 1 and the check value 2 are the same.
  • the verification value can be obtained based on the installation files in the function package.
  • check value 1 and the check value 2 are the same, it means that the installation file in the first function package and the installation file in the first update function package are the same. In this case, the electronic device 100 does not need to reacquire the first update function package, and the process ends. In this way, even if the version number of the first update function package changes, but the installation file in the first update function package does not change, the electronic device 100 can continue to save the first function package.
  • the electronic device 100 may execute S810 - S811 .
  • the application server sends message 1 to the electronic device 100.
  • the electronic device 100 deletes the first function package and saves the first updated function package.
  • message one may include an indication message for obtaining a first update function package.
  • the electronic device 100 may prompt the user whether to obtain the first update function package. If the user agrees, the electronic device 100 may obtain the first update function package from the application server. When the electronic device 100 is running the first function package, the electronic device 100 may wait until the first function package stops running, then delete the first function package, and save the first update function package. If the user disagrees, the electronic device 100 will not obtain the first update function package, but will save the first function package.
  • the electronic device 100 may first obtain the first update function package from the application server, and then prompt the user whether to save the first update function package. If the user agrees, when the electronic device 100 is running the first function package, the electronic device 100 may wait until the first function package stops running, then delete the first function package, and save the first update function package. If the user disagrees, the electronic device 100 may delete the first update function package or save the first function package.
  • message one may include a first update function package.
  • the electronic device 100 may prompt the user whether to save the first update function package. If the user agrees, when the electronic device 100 is running the first function package, the electronic device 100 may wait until the first function package stops running, and then delete the first function package and save the first update function package. If the user disagrees, the electronic device 100 may delete the first update function package or save the first function package.
  • the application server when the application server confirms that the installation files in the first update function package are the same as the installation files in the first function package, it also confirms that the installation files in the first update function package have not been updated. In this case, the electronic device 100 does not need to obtain the first update function package, which can save the traffic of the electronic device 100.
  • the electronic device 100 may also save other function packages of the first free installation application, such as a second function package, which is used to implement the second functional characteristics of the first free installation application. While the electronic device 100 confirms whether the installation file in the first update function package is updated, the electronic device 100 also needs to confirm whether the installation file in the second update function package is updated.
  • a second function package which is used to implement the second functional characteristics of the first free installation application.
  • FIG. 9 is a schematic diagram of a flow chart of updating multiple function packages of an electronic device 100 provided in an embodiment of the present application.
  • the application server saves a first function package and a second function package of a first installation-free application, wherein the verification value of the installation files in the first function package is verification value one, and the verification value of the installation files in the second function package is verification value three.
  • the function package of the first installation-free application stored in the application server may include a first function package and a second function package, wherein the first function package is used to implement a first functional characteristic of the first installation-free application, and the second function package is used to implement a second functional characteristic of the first installation-free application.
  • the first function package may include a first installation file, description information of the first function package, and a checksum of the first installation file.
  • It may include the second installation file, description information of the second function package, and the checksum value of the second installation file.
  • the application server sends the first function package and the second function package to the electronic device 100 .
  • S903 The electronic device 100 saves the first function package and the second function package.
  • the electronic device 100 can download the first function package and the second function package of the first installation-free application from the application server.
  • the electronic device 100 can implement the first function characteristic of the first installation-free application based on the first function package, and can also implement the second function characteristic of the first installation-free application based on the second function package.
  • the application server receives the first update function package and the second update function package uploaded by the developer.
  • the verification value of the installation file in the first update installation file is verification value two
  • the verification value of the installation file in the second update function package is verification value four.
  • the application server receives the first update function package and the second update function package uploaded by the developer.
  • the first update function package may include a first update installation file, description information of the first update function package, and check value 2 of the first update installation file.
  • the description information of the first update function package may include but is not limited to one or more of the following: the package name of the first update function package, the name of the first installation-free application, the version number of the first update function package (the second version number), etc.
  • the second check value is different from the first check value, indicating that the first update installation file is different from the first installation file. This can be used to determine that the installation file in the first update function package has been updated, and the version number of the first update function package is also different from the version number of the first function package.
  • the check value 2 is the same as the check value 1, indicating that the first update installation file is the same as the first installation file, except that The version number of the first updated function package is different from the version number of the first function package.
  • the second update function package may include a second update installation file, description information of the second update function package, and a checksum of the second update installation file.
  • the description information of the second update function package may include but is not limited to one or more of the following: the package name of the second update function package, the name of the first installation-free application, the version number of the second update function package (second version number), etc.
  • check value four is different from check value three, indicating that the second update installation file is different from the second installation file. This can be used to determine that the installation file in the second update function package has been updated, and the version number of the second update function package is also different from the version number of the second function package.
  • check value four is the same as check value three, indicating that the second update installation file is the same as the second installation file, and only the version number of the second update function package is different from the version number of the second function package.
  • S904 may also be executed after S902.
  • S905 The application server deletes the first function package and the second function package, and saves the first updated function package and the second updated function package.
  • the application server can save the newer version of the function package and delete the old version of the function package, that is, the application server deletes the first function package and the second function package and saves the first updated function package and the second updated function package.
  • S906 The electronic device 100 receives the first operation and runs the second function package.
  • the electronic device 100 stores the first function package and the second function package, and the user can use the first function feature of the first free installation application based on the first function package, and the user can also use the second function feature of the first free installation application based on the second function package.
  • the electronic device 100 can receive the first operation, run the second function package, and the electronic device 100 can display the user interface 420 shown in FIG. 2C, and the user can control the working mode of the air conditioner in the home based on the user interface 420 shown in FIG. 2C.
  • the electronic device 100 sends the description information and verification value 1 of the first function package, and the description information and verification value 3 of the second function package to the application server.
  • the electronic device 100 can obtain the description information and the check value 1 of the first function package, and the description information and the check value 3 of the second function package.
  • the description information and the check value 1 of the first function package, and the description information and the check value 3 of the second function package are sent to the application server to confirm whether the installation files in the first function package and the installation files in the second function package are updated.
  • the electronic device 100 can obtain a newer version of the first function package. If the installation file of the first function package is not updated, the electronic device 100 can continue to save the first function package.
  • the electronic device 100 can obtain a newer version of the second function package. If the installation file of the second function package is not updated, the electronic device 100 can continue to save the second function package.
  • the method provided in the embodiment of the present application may not execute S906, and the electronic device 100 may send the description information and check value one of the first function package, and the description information and check value three of the second function package to the application server periodically, at regular intervals, or irregularly.
  • the electronic device 100 can obtain a function package containing updated installation files, such as the first updated function package and/or the second updated function package.
  • the electronic device 100 can implement the first updated functional characteristics of the first installation-free application based on the first updated function package, or the electronic device 100 can implement the second updated functional characteristics of the first installation-free application based on the second updated function package.
  • the method provided in the embodiment of the present application may not execute S906.
  • the application server may periodically or at regular intervals or irregularly send the description information of the first updated function package and the second check value of the first updated installation file, and/or the description information of the second updated function package and the fourth check value of the second updated installation file to the electronic device 100.
  • the electronic device 100 confirms whether to obtain the first updated function package and/or the second updated function package.
  • the application server obtains a second verification value of the first update installation file based on the description information of the first function package, and obtains a fourth verification value of the second update function package based on the description information of the second function package.
  • the application server stores a newer version of the first function package and a newer version of the second function package, namely, the first update function package and the second update function package. Therefore, the application server needs to determine whether the installation files in the first update function package are the same as the installation files in the first function package stored on the electronic device 100. Correspondingly, the server also needs to determine whether the installation files in the second update function package are the same as the installation files in the second function package stored on the electronic device 100.
  • the application server can obtain the second check value of the first update installation file based on the description information of the first function package.
  • the application server can also obtain the fourth check value of the second update installation file based on the description information of the second function package. By comparing the check values of the installation files, it is determined whether the installation files have changed.
  • the application server needs to confirm whether the check value 1 is the same as the check value 2, and whether the check value 3 is the same as the check value 4.
  • the verification value can be obtained based on the installation files in the function package.
  • check value 1 is the same as the check value 2, it means that the installation file in the first function package and the installation file in the first update function package are the same, and the electronic device 100 does not need to re-acquire the first update function package, and the process ends. In this way, even if the version number of the first update function package changes, the installation file in the first update function package does not change, and the electronic device 100 can continue to save the first function package.
  • check value 1 When the check value 1 is different from the check value 2, it means that the installation file in the first function package and the installation file in the first update function package are different, that is, the installation file in the first update function package has been updated, and the electronic device 100 can obtain the first update function package.
  • the check value 3 and the check value 4 are the same, it means that the installation file in the second function package and the installation file in the second update function package are the same, and the electronic device 100 does not need to re-acquire the second update function package, and the process ends. In this way, even if the version number of the second update function package changes, the installation file in the second update function package does not change, and the electronic device 100 can continue to save the second function package.
  • check value three and the check value four are different, it means that the installation file in the second function package and the installation file in the second update function package are different, that is, the installation file in the second update function package has been updated, and the electronic device 100 can obtain the second update function package.
  • the application server can identify the following four situations:
  • Case 1 The application server confirms that the check value 1 is the same as the check value 2, and the check value 3 is the same as the check value 4. At this time, it can be determined that the electronic device 100 does not need to obtain the first update function package and the second update function package, and the process ends.
  • Case 2 The application server confirms that check value one is the same as check value two, and check value three is different from check value four. Then it can be determined that the installation files in the second function package are different from the installation files in the second update function package, that is, the installation files in the second update function package have been updated. At this time, the electronic device 100 can obtain the second update function package, delete the second function package stored on the electronic device 100, and save the second update function package. In this way, the version number of the first function package stored on the electronic device 100 is different from the version number of the second update function package, and function packages with different version numbers coexist in the same application.
  • Case three The application server confirms that check value one is different from check value two, and check value three is the same as check value four. Then it can be determined that the installation file in the first function package is different from the installation file in the first update function package, that is, the installation file in the first update function package has been updated. At this time, the electronic device 100 can obtain the first update function package, delete the first function package stored on the electronic device 100, and save the first update function package. In this way, the version number of the first update function package stored on the electronic device 100 is different from the version number of the second function package, and function packages with different version numbers coexist in the same application.
  • Case 4 The application server confirms that check value 1 is different from check value 2, and check value 3 is different from check value 4. Then it can be determined that the installation file in the first function package is different from the installation file in the first update function package, that is, the installation file in the first update function package has been updated, and the installation file in the second function package is also different from the installation file in the second update function package, that is, the installation file in the second update function package is also updated. At this time, the electronic device 100 can obtain the first update function package and the second update function package, delete the first function package and the second function package stored on the electronic device 100, and save the first update function package and the second update function package.
  • the application server sends message 2 to the electronic device 100 .
  • the electronic device 100 saves the first updated function package and/or the second updated function package.
  • the application server may send message 2 to the electronic device 100, so that the electronic device 100 may save the first update function package and/or the second update function package.
  • Case 1 the electronic device 100 deletes the first function package, obtains the first updated function package, and saves the first updated function package and the second function package.
  • Case 2 the electronic device 100 deletes the second function package, obtains the second updated function package, and saves the first function package and the second updated function package.
  • Case 3 the electronic device 100 deletes the first function package and the second function package, obtains the first updated function package and the second updated function package, and saves the first updated function package and the second updated function package.
  • FIG10 is a flow chart of an installation-free application upgrade method provided in an embodiment of the present application.
  • the electronic device obtains a first function package and a second function package of a first installation-free application, where the first function package includes first description information and a first verification value, and the second function package includes second description information and a second verification value.
  • the first check value may also be referred to as check value 1.
  • the second check value may also be referred to as check value 3.
  • the first function package also includes a first installation file, and the first verification value is a verification value of the first installation file; the second function package also includes a second installation file, and the second verification value is a verification value of the second installation file.
  • the first description information and the first check value may be the same information or different information.
  • the second description information and the second check value may be the same information or different information.
  • the first description information may include one or more of the following: the package name of the first function package, the application name of the first installation-free application, etc.
  • the first function package may also include other description information, such as the version number of the first function package.
  • the second description information may include one or more of the following: the package name of the second function package, the application name of the first installation-free application, etc.
  • the second function package may also include other description information, such as the version number of the second function package.
  • the electronic device sends the first description information and the first verification value, as well as the second description information and the second verification value to the application server.
  • the first description information is used by the application server to obtain the third verification value
  • the second description information is used by the application server to obtain the fourth verification value.
  • the third check value may also be referred to as check value two.
  • the fourth check value may also be referred to as check value four.
  • the third verification value may refer to a verification value of an installation file in a first update function package of the first installation-free application stored on the application server.
  • the fourth verification value may refer to a verification value of an installation file in the second update function package in the first installation-free application stored on the application server.
  • the electronic device can verify whether the function package in the first installation-free application needs to be updated in the application server periodically/at regular intervals/irregularly based on the method.
  • the method before the electronic device sends the first description information and the first verification value, and the second description information and the second verification value to the application server, the method also includes: the electronic device receives a first operation; in response to the first operation, the electronic device runs a second function package.
  • the electronic device can also proactively verify whether the function package in the first free installation application needs to be updated in the application server when the user uses the first free installation application, and obtain the updated function package. The user can use the updated function package the next time he uses the first free installation application.
  • the first update function package may include a first update installation file, first description information, and a third check value.
  • the first update function package may also include other description information, such as a version number of the first update function package.
  • the version number of the first update function package is different from the version number of the first function package.
  • the second update function package may include a second update installation file, second description information, and a fourth check value.
  • the second update function package may also include other description information, such as a version number of the second update function package.
  • the version number of the second update function package is different from the version number of the second function package.
  • the method before the electronic device receives the second update function package sent by the application server, the method also includes: the electronic device receives a first message sent by the application server; the electronic device receives the second update function package sent by the application server, specifically including: in response to the first message, the electronic device sends second description information to the application server, the second description information is used for the application server to obtain the second update function package; the electronic device receives the second update function package sent by the application server.
  • the electronic device can download the second update function package from the server when it needs to use the second update function package.
  • the first message may be message 2 shown in the embodiment of FIG. 9 .
  • S1004 The electronic device deletes the second function package and saves or installs the second updated function package.
  • the version number of the first function package is the same as or different from the version number of the second function package; the version number of the first function package is different from the version number of the second updated function package.
  • the version number of the first function package is different from the version number of the second update function package.
  • the electronic device can modify the version number of the first function package to the version number of a newer version, that is, the same as the version number of the second update function package. In this way, when the first function package is running, the version number presented to the electronic device is the version number of the newer version.
  • the method also includes: when the third verification value is the same as the first verification value and the fourth verification value is also the same as the second verification value, the electronic device receives a second message sent by the application server; in response to the second message, the electronic device continues to save the first function package and the second function package.
  • the electronic device can continue to store the first function package and the second function package.
  • the method also includes: when the third verification value is different from the first verification value and the fourth verification value is the same as the second verification value, the electronic device receives a first update function package sent by the application server; the electronic device deletes the first function package and saves or installs the first update function package.
  • the electronic device can delete the first function package and obtain and save the first function package.
  • Update function package If the installation file in the second function package is not updated, the electronic device can continue to store the second function package without downloading the second update function package.
  • the method also includes: when the third verification value is different from the first verification value and the fourth verification value is also different from the second verification value, the electronic device receives the first update function package and the second update function package sent by the application server; the electronic device deletes the first function package and the second function package, and saves or installs the first update function package and the second update function package.
  • the electronic device can delete the first function package and the second function package, and obtain and save the first updated function package and the second updated function package.
  • the electronic device deletes the second function package, specifically including: after the electronic device stops running the second function package, the electronic device deletes the second function package.
  • the electronic device can delete the second function package after the second function package stops running, so that the user's use of the second function package will not be affected.
  • the method also includes: the electronic device obtains a third function package of the first installation-free application, the third function package including third description information and a fifth verification value; the electronic device receives the third description information and the sixth verification value sent by the application server; when the fifth verification value is different from the sixth verification value, the electronic device receives a third updated function package sent by the application server; the electronic device deletes the third function package, and saves or installs the third updated function package.
  • the electronic device may send an update request for the third function package to the application server so that the application server sends the third updated function package.
  • the third function package may include a third installation file, third description information and a fifth check value.
  • the third function package may also include other description information, such as a version number of the third function package.
  • the third update function package may include a third update installation file, third description information and a sixth check value.
  • the third update function package may also include other description information, such as a version number of the third update function package.
  • the version number of the third update function package is different from the version number of the third function package.
  • the server may also proactively verify with the electronic device whether the function package of the first installation-free application needs to be updated.
  • the electronic device can determine whether to delete the function package stored on the electronic device based on the verification value of the installation file.
  • different versions of function packages in the same free installation application can exist on the electronic device 100 at the same time.
  • FIG. 11 is a flow chart of another method for upgrading an application without installation provided in an embodiment of the present application.
  • An application server receives a first verification value and a second verification value sent by an electronic device; the first verification value is used to verify a first function package of a first installation-free application, and the second verification value is used to verify a second function package of the first installation-free application.
  • the first check value may also be referred to as check value 1.
  • the second check value may also be referred to as check value 3.
  • the first check value may include description information of the first function package and a check value of an installation file in the first function package.
  • the description information of the first function package may include one or more of the following: a package name of the first function package, a name of the first installation-free application, and a version number of the first function package.
  • the second check value may include description information of the second function package and a check value of the installation file in the first function package.
  • the description information of the second function package may include one or more of the following: the package name of the second function package, the name of the first free installation application, and the version number of the second function package.
  • the electronic device sending the first verification value to the application server may refer to the electronic device sending the package name of the first function package and the verification value of the installation file in the first function package to the application server.
  • the electronic device sending the second verification value to the application server may refer to the electronic device sending the package name of the second function package and the verification value of the installation file in the second function package to the application server.
  • the application server obtains a third verification value according to the first verification value, and obtains a fourth verification value according to the second verification value.
  • the third check value may also be referred to as check value two.
  • the fourth check value may also be referred to as check value four.
  • the third check value may include description information of the first update function package and a check value of the installation file in the first update function package.
  • the description information of the first update function package may include one or more of the following: the package name of the first update function package, the name of the first installation-free application, and the version number of the first update function package.
  • the version number of the first update function package is different from the version number of the first function package.
  • the fourth check value may include description information of the second update function package and a check value of the installation file in the first update function package.
  • the description information of the second update function package may include one or more of the following: the package name of the second update function package, the name of the first installation-free application, and the version number of the second update function package.
  • the version number of the second update function package is different from the version number of the second function package.
  • the application server obtains the third verification value according to the first verification value, which may mean that the application server obtains the verification value of the installation file in the first update function package according to the package name of the first function package.
  • the application server obtains the fourth verification value according to the second verification value, which may mean that the application server obtains the verification value of the installation file in the second update function package according to the package name of the second function package.
  • the third check value is the same as the first check value, which may mean that the check value of the installation file in the first update function package is the same as the check value of the installation file in the first function package.
  • the fourth check value is different from the second check value, which may mean that the check value of the installation file in the second update function package is different from the check value of the installation file in the second function package.
  • the version number of the first function package is the same as or different from the version number of the second function package; the version number of the first function package is different from the version number of the second updated function package.
  • the method also includes: the application server sends the sixth verification value of the third updated function package to the electronic device, and the sixth verification value is used by the electronic device to verify the third function package of the free installation application; when the fifth verification value of the third function package is different from the sixth verification value of the third update function package, the server sends the third updated function package to the electronic device.
  • the server may receive an update request for the third function package sent by the electronic device to send the third updated function package to the electronic device.
  • the fifth check value may include description information of the third function package and a check value of the installation file in the third function package.
  • the description information of the third function package may include one or more of the following: the package name of the third function package, the name of the first installation-free application, and the version number of the third function package.
  • the sixth check value may include description information of the third update function package and a check value of the installation file in the third update function package.
  • the description information of the third update function package may include one or more of the following: the package name of the third update function package, the name of the first installation-free application, and the version number of the third update function package.
  • the version number of the third update function package is different from the version number of the third function package.
  • the application server sending the sixth verification value to the electronic device may refer to the application server sending the package name of the third update function package and the verification value of the installation file in the third update function package to the electronic device.
  • the sixth verification value is used by the electronic device to obtain the fifth verification value, and may refer to a verification value of an installation file in the third function package obtained by the electronic device based on the package name of the third update function package.
  • the fifth check value is different from the sixth check value, which may mean that the check value of the installation file in the third update function package is different from the check value of the installation file in the third function package.
  • the present application provides an electronic device, characterized in that the electronic device includes a processor and a memory; the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and the processor calls the computer instructions to enable the electronic device to execute a method for upgrading an installation-free application shown in Figure 10 or Figure 11 above.
  • the present application provides a computer-readable storage medium, characterized in that it is used to store computer instructions.
  • the computer instructions When the computer instructions are executed on an electronic device, the electronic device executes an installation-free application upgrade method shown in FIG. 10 or FIG. 11 .
  • the present application provides a computer program product, characterized in that when the computer program product is run on an electronic device, the electronic device executes an installation-free application upgrade method as shown in FIG. 10 or FIG. 11 .
  • the computer program product includes one or more computer instructions.
  • the computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated.
  • the available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.
  • SSD solid state drive
  • the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the above-mentioned method embodiments.
  • the aforementioned storage medium includes: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

Abstract

本申请提供了一种免安装应用的升级方法及电子设备。方法包括:电子设备获取第一功能包和第二功能包,第一功能包包括第一描述信息和第一校验值,第二功能包包括第二描述信息和第二校验值;电子设备将第一描述信息和第一校验值,第二描述信息和第二校验值发送至应用服务器,第一描述信息和第二描述信息用于应用服务器获取到第三校验值和第四校验值;在第三校验值和第一校验值相同,第四校验值与第二校验值不同的情况下,电子设备接收应用服务器发送的第二更新功能包,删除第二功能包并保存或者安装第二更新功能包。该方法可以基于安装文件的校验值确定出是否更新电子设备上存储的功能包,提高了功能包的启动速度,提高了用户体验。

Description

免安装应用的升级方法及电子设备
本申请要求在2022年12月22日提交中国国家知识产权局、申请号为202211656834.9的中国专利申请的优先权,发明名称为“免安装应用的升级方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子设备技术领域,尤其涉及免安装应用的升级方法及电子设备。
背景技术
随着科技的进步和智能电子设备的发展,电子设备的种类和功能越来越丰富。为了满足用户的使用需要,开发者开发了各种各样的功能性应用,用户可以将应用下载安装在电子设备上,通过已安装的应用体验不同的功能特性,例如播放音乐、播放视频等。
目前,一个应用可以包括多个不同的安装包,例如基础包、配置包、入口(Entry)功能包或者特性(Feature)功能包等。电子设备上要求该多个不同安装包的版本号是一致的。每当应用更新,都需要删除掉旧版本的安装包,再重新下载新版本的安装包。
发明内容
本申请提供了一种免安装应用的升级方法及电子设备,能够降低免安装应用中一些功能包的不必要更新,提高了免安装应用内功能包的启动速度,提高了用户体验。
第一方面,本申请提供了一种免安装应用的升级方法,方法包括:电子设备获取第一免安装应用的第一功能包和第二功能包,第一功能包包括第一描述信息和第一校验值,第二功能包包括第二描述信息和第二校验值;电子设备将第一描述信息和第一校验值,以及第二描述信息和第二校验值发送至应用服务器,第一描述信息用于应用服务器获取到第三校验值,第二描述信息用于应用服务器获取到第四校验值;在第三校验值和第一校验值相同,第四校验值与第二校验值不同的情况下,电子设备接收应用服务器发送的第二更新功能包;电子设备删除第二功能包,保存或者安装第二更新功能包。应理解,对于电子设备的获取操作,可以指电子设备在其内核空间、用户空间或者存储器中的查找、查询或索引等操作。应理解,对于应用服务器的获取操作,可以指服务器在其内存空间、存储器或者数据库中的查找、查询或索引等操作。在一些实施例中,第一描述信息和第一校验值可以是同一个信息,也可以是不同的信息。第二描述信息和第二校验值可以是同一个信息,也可以是不同的信息。
其中,第一描述信息可以包括以下一项或多项:第一功能包的包名、第一免安装应用的应用名等。第一功能包除了包括第一描述信息外,还可以包括其他的描述信息,例如第一功能包的版本号等。
第二描述信息可以包括以下一项或多项:第二功能包的包名、第一免安装应用的应用名等。第二功能包除了包括第一描述信息外,还可以包括其他的描述信息,例如第二功能包的版本号等。
第三校验值可以指应用服务器上存储的第一免安装应用中第一更新功能包中安装文件的校验值。
第四校验值可以指应用服务器上存储的第一免安装应用中第二更新功能包中安装文件的校验值。
电子设备可以周期性地/间隔一定时间/不定时地基于该方法到应用服务器中验证第一免安装应用中的功能包是否需要更新。
通过第一方面提供的方法,电子设备可以基于安装文件的校验值确定出是否将电子设备上存储的功能包删除掉。也就是说,电子设备100上可以同时存在同一个免安装应用内不同版本的功能包。在更新同一个免安装应用内某一个功能包时,在该免安装应用内其他功能包的安装文件在没有变化的时候,其他功能包无需更新,可以提高功能包的启动速度,提高用户体验。
结合第一方面,在一种可能的实现方式中,第一功能包的版本号和第二功能包的版本号相同或者不同;第一功能包的版本号与第二更新功能包的版本号不同。
在一些实施例中,第一功能包的版本号与第二更新功能包的版本号不同,在电子设备运行第一功能包时,电子设备可以将第一功能包的版本号修改为较新版本的版本号,即与第二更新功能包的版本号一致。这样,第一功能包在运行时,向电子设备呈现的版本号为较新版本的版本号。
这样,电子设备上同一个免安装应用内不同版本的功能包可以互存。
结合第一方面,在一种可能的实现方式中,方法还包括:在第三校验值和第一校验值相同,第四校验值与第二校验值也相同的情况下,电子设备接收应用服务器发送的第二消息;响应于第二消息,电子设备 继续保存第一功能包和第二功能包。
这样,在第一功能包中安装文件和第二功能包中安装文件没有更新的情况下,电子设备可以继续保存第一功能包和第二功能包。
结合第一方面,在一种可能的实现方式中,方法还包括:在第三校验值和第一校验值不同,第四校验值与第二校验值相同的情况下,电子设备接收应用服务器发送的第一更新功能包;电子设备删除第一功能包,保存或者安装第一更新功能包。
这样,在第一功能包中安装文件已更新的情况下,电子设备可以将第一功能包删除掉,获取并保存第一更新功能包。在第二功能包中安装文件没更新的情况下,电子设备可以继续保存第二功能包,无需下载第二更新功能包。
结合第一方面,在一种可能的实现方式中,方法还包括:在第三校验值和第一校验值不同,第四校验值与第二校验值也不同的情况下,电子设备接收应用服务器发送的第一更新功能包和第二更新功能包;电子设备删除第一功能包和第二功能包,保存或者安装第一更新功能包和第二更新功能包。
这样,在第一功能包中安装文件和第二功能包中安装文件均已更新的情况下,电子设备可以将第一功能包和第二功能包删除掉,获取并保存第一更新功能包和第二更新功能包。
结合第一方面,在一种可能的实现方式中,第一功能包还包括第一安装文件,第一校验值为第一安装文件的校验值;第二功能包还包括第二安装文件,第二校验值为第二安装文件的校验值。
第一更新功能包可以包括第一更新安装文件、第一描述信息和第三校验值。第一更新功能包除了包括第一描述信息外,还可以包括其他的描述信息,例如第一更新功能包的版本号等。第一更新功能包的版本号与第一功能包的版本号不同。
第二更新功能包可以包括第二更新安装文件、第二描述信息和第四校验值。第二更新功能包除了包括第一描述信息外,还可以包括其他的描述信息,例如第二更新功能包的版本号等。第二更新功能包的版本号与第二功能包的版本号不同。
结合第一方面,在一种可能的实现方式中,在电子设备接收应用服务器发送的第二更新功能包之前,方法还包括:电子设备接收应用服务器发送的第一消息;电子设备接收应用服务器发送的第二更新功能包,具体包括:响应于第一消息,电子设备将第二描述信息发送至应用服务器,第二描述信息用于应用服务器获取到第二更新功能包;电子设备接收应用服务器发送的第二更新功能包。
这样,电子设备可以在需要使用第二更新功能包时,再从服务器下载第二更新功能包。
结合第一方面,在一种可能的实现方式中,电子设备将第一描述信息和第一校验值,以及第二描述信息和第二校验值发送至应用服务器之前,方法还包括:电子设备接收第一操作;响应第一操作,电子设备运行第二功能包。
这样,除了电子设备周期性地/间隔一定时间/不定时地到应用服务器中验证第一免安装应用中的功能包是否需要更新。电子设备也可以在用户使用第一免安装应用时,主动到应用服务器中验证第一免安装应用中的功能包是否需要更新,并获取到更新的功能包。用户可以在下次使用第一免安装应用时,使用的是更新的功能包。
结合第一方面,在一种可能的实现方式中,电子设备删除第二功能包,具体包括:在电子设备停止运行第二功能包后,电子设备删除第二功能包。
这样,在电子设备需要更新第一免安装应用的第二功能包时,电子设备可以在第二功能包停止运行后,再将第二功能包删除掉。这样,不会影响用户使用第二功能包。
结合第一方面,在一种可能的实现方式中,方法还包括:电子设备获取第一免安装应用的第三功能包,第三功能包包括第三描述信息和第五校验值;电子设备接收应用服务器发送的第三描述信息和第六校验值;在第五校验值与第六校验值不同的情况下,电子设备接收应用服务器发送的第三更新功能包;电子设备删除第三功能包,保存或者安装第三更新功能包。
在一些示例中,在第五校验值与第六校验值不同的情况下,电子设备可以向应用服务器发送对第三功能包的更新请求,以便于应用服务器发送第三更新功能包。
第三功能包可以包括第三安装文件、第三描述信息和第五校验值。第三功能包除了包括第三描述信息外,还可以包括其他的描述信息,例如第三功能包的版本号等。
第三更新功能包可以包括第三更新安装文件、第三描述信息和第六校验值。第三更新功能包除了包括第三描述信息外,还可以包括其他的描述信息,例如第三更新功能包的版本号等。第三更新功能包的版本号与第三功能包的版本号不同。
这样,也可以由服务器主动向电子设备验证第一免安装应用的功能包是否需要更新。
第二方面,本申请提供了一种免安装应用的升级方法,应用于应用服务器,方法包括:应用服务器接收电子设备发送的第一校验值和第二校验值;第一校验值用于校验第一免安装应用的第一功能包,第二校验值用于校验第一免安装应用的第二功能包;应用服务器根据第一校验值获取第三校验值,以及根据第二校验值获取第四校验值;在第三校验值和第一校验值相同,第四校验值和第二校验值不同的情况下,应用服务器向电子设备发送第二更新功能包。
其中,第一校验值可以包括第一功能包的描述信息和第一功能包中安装文件的校验值。第一功能包的描述信息可以包括以下一项或多项:第一功能包的包名、第一免安装应用的名称、第一功能包的版本号。
第二校验值可以包括第二功能包的描述信息和第一功能包中安装文件的校验值。第二功能包的描述信息可以包括以下一项或多项:第二功能包的包名、第一免安装应用的名称、第二功能包的版本号。
第三校验值可以包括第一更新功能包的描述信息和第一更新功能包中安装文件的校验值。第一更新功能包的描述信息可以包括以下一项或多项:第一更新功能包的包名、第一免安装应用的名称、第一更新功能包的版本号。第一更新功能包的版本号与第一功能包的版本号不同。
第四校验值可以包括第二更新功能包的描述信息和第一更新功能包中安装文件的校验值。第二更新功能包的描述信息可以包括以下一项或多项:第二更新功能包的包名、第一免安装应用的名称、第二更新功能包的版本号。第二更新功能包的版本号与第二功能包的版本号不同。
其中,电子设备将第一校验值发送至应用服务器,可以指电子设备将第一功能包的包名和第一功能包中安装文件的校验值发送至应用服务器。
电子设备将第二校验值发送至应用服务器,可以指电子设备将第二功能包的包名和第二功能包中安装文件的校验值发送至应用服务器。
应用服务器根据第一校验值获取第三校验值,可以指应用服务器根据第一功能包的包名获取到第一更新功能包中安装文件的校验值。
应用服务器根据第二校验值获取第四校验值,可以指应用服务器根据第二功能包的包名获取到第二更新功能包中安装文件的校验值。
第三校验值和第一校验值相同,可以指第一更新功能包中安装文件的校验值和第一功能包中安装文件的校验值相同。
第四校验值和第二校验值不同,可以指第二更新功能包中安装文件的校验值和第二功能包中安装文件的校验值不同。
结合第二方面,在一种可能的实现方式中,第一功能包的版本号和第二功能包的版本号相同或者不同;第一功能包的版本号与第二更新功能包的版本号不同。
结合第二方面,在一种可能的实现方式中,方法还包括:应用服务器将第三更新功能包的第六校验值发送至电子设备,第六校验值用于电子设备校验免安装应用的第三功能包;在第三功能包的第五校验值与第三更新功能包的第六校验值不同的情况下,服务器将第三更新功能包发送至电子设备。
在一些示例中,在第五校验值与第六校验值不同的情况下,服务器可以接收电子设备发送的对第三功能包的更新请求,以向电子设备发送第三更新功能包。
第五校验值可以包括第三功能包的描述信息和第三功能包中安装文件的校验值。第三功能包的描述信息可以包括以下一项或多项:第三功能包的包名、第一免安装应用的名称、第三功能包的版本号。
第六校验值可以包括第三更新功能包的描述信息和第三更新功能包中安装文件的校验值。第三更新功能包的描述信息可以包括以下一项或多项:第三更新功能包的包名、第一免安装应用的名称、第三更新功能包的版本号。第三更新功能包的版本号与第三功能包的版本号不同。
应用服务器将第六校验值发送至电子设备,可以指应用服务器将第三更新功能包的包名和第三更新功能包中安装文件的校验值发送至电子设备。
第六校验值用于电子设备获取到第五校验值,可以指电子设备基于第三更新功能包的包名获取到第三功能包中安装文件的校验值。
第五校验值与第六校验值不同的,可以指第三更新功能包中安装文件的校验值和第三功能包中安装文件的校验值不同。
第三方面,本申请提供了一种电子设备,其特征在于,电子设备包括处理器和存储器;存储器与处理 器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,处理器调用计算机指令以电子设备执行上述任一方面任一可能的实现方式中提供的一种免安装应用的升级方法。
第四方面,本申请提供了一种计算机可读存储介质,其特征在于,用于存储计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行上述任一方面任一可能的实现方式中提供的一种免安装应用的升级方法。
第五方面,本申请提供了一种计算机程序产品,其特征在于,当计算机程序产品在电子设备上运行时,使得电子设备执行上述任一方面任一可能的实现方式中提供的一种免安装应用的升级方法。
对于第二方面至第五方面中有益效果的描述,可以参考第一方面中有益效果的描述,本申请在此不再赘述。
附图说明
图1A-图1B为本申请实施例提供的一组UI图;
图2A-图2C为申请实施例提供的另一组UI图;
图3-图4为申请实施例提供的一组更新功能包的示意图;
图5A-图5B为本申请实施例提供的另一组更新功能包的示意图;
图5C为本申请实施例提供的一种***架构图;
图6申请实施例提供的一种电子设备100的结构示意图;
图7请实施例提供的一种电子设备100的软件架构框图;
图8为本申请实施例提供的一种在电子设备100上更新单个功能包的流程示意图;
图9为本申请实施例提供的一种电子设备100更新多个功能包的流程示意图;
图10为本申请实施例提供的一种免安装应用的升级方法的流程示意图;
图11为本申请实施例提供的另一种免安装应用的升级方法的流程示意图。
具体实施方式
下面将结合附图对本申请实施例中的技术方案进行清除、详尽地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
首先,对本申请涉及的普通应用和免安装应用进行介绍。
其中,普通应用可以指需要用户手动从应用服务器中下载安装包,并安装在电子设备上的应用。普通应用在电子设备上安装完成之后,普通应用的图标可以显示在电子设备的桌面上。并且,普通应用也需要用户手动从电子设备上卸载掉。在普通应用从电子设备上卸载掉之后,普通应用的图标也从电子设备的桌面上消失了。
普通应用的安装包可以实现多个不同的功能特性,当用户只想使用普通应用中的一个功能特性时,也需要将普通应用的完整安装包下载保存在电子设备上才可以使用该功能特性。普通应用的安装包比较大,例如普通应用的安装包的大小一般可以在,100MB、150MB或者200MB左右。因此,下载普通应用的安装包的时间会比较久。
示例性的,普通应用可以是华为视频应用。
如图1A所示,图1A示出了电子设备100在安装华为视频应用之前的主界面210。主界面210包括多个应用的图标,例如天气应用的图标、华为商店应用的图标、智慧家庭应用的图标、运动健康应用的图标、备忘录应用的图标、日历应用的图标、生活服务应用的图标、相机应用的图标、通讯录应用的图标、电话应用的图标和信息应用的图标等。主界面210还示出了电量指示符、天气指示符、日期指示符、网络信号指示符、页面指示符等。
如图1B所示,图1B示出了电子设备100在安装华为视频应用之后的主界面220。主界面220与主界面210类似,不同之处在于主界面220中还包括了华为视频应用的图标2201。
在华为视频应用安装在本地之后,电子设备100可以接收用户针对主界面220中华为视频应用的图标2201 的输入操作(例如单击),响应于用户的输入操作,电子设备100可以显示华为视频应用的内容,例如播放华为视频应用提供的视频。
免安装应用可以指不需要用户手动从应用服务器中下载应用的安装包,并按需安装在电子设备上的应用。例如应用服务器可以自动将用户群体使用排名前N的免安装应用的安装包发送至电子设备,电子设备可以自动安装免安装应用。免安装应用在电子设备上安装完成之后,电子设备可以显示免安装应用的图标、卡片或者链接等。
示例性的,当电子设备100可以显示免安装应用的卡片时,电子设备可以接收用户针对该卡片的输入操作,启动免安装应用。并且,用户也无需手动将已安装的免安装应用从电子设备上卸载掉。例如,在用户超过一定时间没有使用已安装的免安装应用后,电子设备可以自动将免安装应用从电子设备上卸载掉。免安装应用的安装包比较小,例如免安装应用的安装包的大小一般可以在10MB,15MB或者20MB以内,因此电子设备能够快速下载免安装应用的安装包,并在设备上快速安装和启动免安装应用。
示例性的,免安装应用可以是空调控制应用。
如图2A所示,电子设备100接收用户作用在主界面210上的滑动操作(例如水平向右的滑动操作),响应于用户的输入操作,电子设备100可以显示图2B所示的用户界面410。
用户界面410可以是电子设备100上服务中心的用户界面。用户可以在用户界面410中查找或者使用免安装应用。
服务中心可以是电子设备100的操作***提供的一种能力,服务中心可以理解为电子设备100上的一种***应用。服务中心可以针对使用电子设备100的用户的使用习惯,向用户推荐免安装应用的卡片。用户可以基于服务中心提供的免安装应用的卡片,快速开启免安装应用。例如,图2B显示的用户界面410可以是电子设备100上服务中心提供的用户界面。
如图2B所示,当用户界面410中显示有空调控制应用的卡片,那么电子设备100可以接收用户针对空调控制应用的卡片的输入操作(例如单击),响应于用户的输入操作,当电子设备100之前没有安装空调控制应用,那么电子设备100可以将电子设备100的类型和空调控制应用的标识发送至应用服务器。
当用户界面410中没有显示空调控制应用的卡片,那么电子设备100可以接收用户在用户界面410中搜索栏内的搜索操作,查找并下载空调控制应用。
不仅限于点击卡片或搜索免安装应用,用户也可以通过扫一扫或者碰一碰的方式查找并下载空调控制应用。本申请对此不做限定。
不仅限于在用户界面410中显示空调控制应用的卡片,也可以在桌面或者下拉通知栏中空调控制应用的卡片,本申请对此不做限定。
示例性的,在电子设备100安装空调控制应用后,电子设备100可以显示图2C所示的用户界面420。用户界面420为空调控制应用中的用户界面。用户可以在用户界面420上对客厅的空调进行控制,例如控制客厅的空调开启/关闭、控制客厅的空调的节能模式开启/关闭、调节客厅的空调的温度、设备厅的空调的定时时长、开启/关闭客厅的空调遥控开启/关闭等。
一个免安装应用可以包括多个安装包,不同的安装包可以实现不同的功能特性。电子设备100也支持用户在使用免安装应用多个功能特性中的一个功能特性时,仅下载该一个功能特性对应的安装包即可。免安装应用的多个安装包也可以被称为免安装应用的多个功能包。这样,电子设备100可以快速下载并安装免安装应用的功能包,快速实现功能包提供的功能特性。
针对不同类型的设备,第一免安装应用一般是由相同厂商开发的,第一免安装应用在不同设备类型的设备上可以实现相同或者相近的功能。不同设备类型的设备下载的第一免安装应用的功能包的安装文件或者功能包的包名可以相同或者不同。针对不同类型的设备,第一免安装应用的安装包大小也可以相同或者不同。
如图3中(a)所示,第一免安装应用有三个功能包,这三个功能包是第一免安装应用中不同的功能特性的安装包。其中,第一功能包可以实现第一功能特性,第二功能包可以实现第二功能特性,第三功能包可以实现第三功能特性。电子设备100可以分时下载三个功能包中的任意一个功能包,并分时使用每一个功能包的功能特性。例如,第一功能包可以包括基础功能包或者Entry功能包。第二功能包可以包括配置功能包,例如与第一免安装应用的语言配置相关的资源包、与第一免安装应用的中央处理器(central processing unit,CPU)配置相关的资源包等。第三功能包可以包括Feature功能包,例如与第一免安装应用中图像相关的资源包等。
由于第一功能包、第二功能包和第三功能包均属于第一免安装应用中的功能包,因此第一功能包、第二功能包和第三功能包的版本号是相同的。例如第一功能包、第二功能包和第三功能包的版本号均为app version1.0。
电子设备100上同一个免安装应用内不同功能包的版本号是需要保持一致的。例如,在电子设备100更新第一免安装应用中的某一个功能包时,电子设备100可以从应用服务器下载较新版本的功能包。在电子设备100安装该较新版本的功能包时,若电子设备100上安装的其他功能包的版本号与该较新版本的功能包的版本号不一致时,电子设备100会将其他功能包删除掉,再从应用服务器中下载较新版本的其他功能包。
如图3中的(b)所示,用户想使用第一免安装应用的第一功能特性时,电子设备100可以接收用户的操作从应用服务器中下载第一功能包。在电子设备100将第一功能包下载在电子设备100本地之后,用户可以使用第一免安装应用的第一功能特性。例如,用户可以基于图2C所示的用户界面420对家庭里空调的工作模式进行控制。
其中,第一功能包可以包括第一安装文件、第一功能包的描述信息、第一安装文件的校验值等。其中,第一安装文件可用于电子设备100实现第一免安装应用的第一功能特性。第一功能包的描述信息可以包括但不仅限于以下一项或多项:第一功能包的包名、第一免安装应用的名称、第一功能包的版本号等。第一安装文件的校验值可用于验证第一功能包中的第一安装文件是否更新。
再例如,用户想使用第一免安装应用的第二功能特性时,电子设备100可以接收用户的操作从应用服务器中下载第二功能包。在电子设备100将第二功能包下载在电子设备100本地之后,用户可以基于第二功能包使用第一免安装应用的第二功能特性。其中,第二功能包实现的功能与第一功能包实现的功能不同。
第一免安装应用中第一功能包的版本号与第一免安装应用中第二功能包的版本号是一致的,因此第一功能包和第二功能包可以同时存储在电子设备100上。
在一些实施例中,由于免安装应用的功能特性更新之后,免安装应用的功能包也需要更新。那么开发者需要将更新后的免安装应用的功能包上架至应用服务器。
图4中的(a)所示的深色方框内表示的是第一功能特性更新后的第一更新功能包,开发者将第一免安装应用的第一更新功能包上传至应用服务器中。相应地,开发者也需要将第一更新功能包的版本号做更新。例如,第一更新功能包的版本号为app version2.0。为了保证同一个免安装应用内不同功能包的版本号是一致的,无论第二功能包和第三功能包的安装文件是否发生变化,第二功能包的版本号和第三功能包的版本号均需要修改为与第一更新功能包的版本号一致。例如第一更新功能包、第二更新功能包和更新第三功能包的版本号均为app version2.0。
如图4中的(b)所示,在免安装应用的功能包更新之后,用户在电子设备100上使用第一免安装应用的第一功能特性时,电子设备100可以继续基于第一功能包让用户继续使用第一免安装应用的第一功能特性。相应地,电子设备100可以从应用服务器中下载第一免安装应用的第一更新功能包。在第一免安装应用停止使用后,电子设备100会删除掉第一功能包,并将第一更新功能包存储在电子设备100上,使得电子设备100可以基于第一更新功能包实现第一免安装应用的第一更新功能特性。而电子设备100上存储有第一免安装应用的第二功能包。由于第二功能包的版本为app version1.0,和第一更新功能包的版本号不一致。那么依据较新版本号原则,电子设备100可以将电子设备100上存储的第二功能包删除掉。
如图4中的(c)所示,在电子设备100将第二功能包删除掉之后,电子设备100可以保存第一更新功能包,第一更新功能包的版本号为app version2.0。
当用户需要在电子设备100上使用第一免安装应用的第二功能特性时,由于电子设备100已经将第二功能包删除掉,电子设备100可以再从应用服务器中下载第二更新功能包并安装第二更新功能包。电子设备100在安装第二更新功能包之后,可以基于第二更新功能包实现第一免安装应用的第二更新功能特性。
从图3和图4可以看出,在第二更新功能包中安装文件和第二功能包中第一安装文件相同的情况下,即第二更新功能包中的安装文件没有更新,只是第二更新功能包的版本号做了更新,电子设备100也需将电子设备100上之前存储的旧版本的第二功能包删除掉,并下载较新版本的第二更新功能包。当电子设备100的网络环境不好时,电子设备100下载第二更新功能包的时间会比较久,也会浪费流量,用户体验差。
基于此,本申请各个实施例提供了免安装应用的功能包独立升级的方法。方法可以包括:
电子设备100从应用服务器下载第一免安装应用的第一功能包和第二功能包。
第一功能包可以包括第一安装文件、第一功能包的描述信息、第一安装文件的校验值等。其中,第一 安装文件用于电子设备100实现第一免安装应用的第一功能特性。第一功能包的描述信息可以包括但不仅限于以下一项或多项:第一功能包的包名、第一免安装应用的名称、第一功能包的版本号等。第一安装文件的校验值用于验证第一功能包中第一安装文件是否更新。
第二功能包可以包括第二功能包的第二安装文件、第二功能包的描述信息、第二安装文件的校验值等。其中,第二安装文件用于电子设备100实现第一免安装应用的第二功能特性。第二功能包的描述信息可以包括但不仅限于以下一项或多项:第二功能包的包名、第一免安装应用的名称、第二功能包的版本号等。第二安装文件的校验值用于验证第二功能包中的第二安装文件是否更新。
电子设备100获取到第一功能包的描述信息和第一安装文件的校验值,以及第二功能包的描述信息和第二安装文件的校验值,并发送至服务器200。
服务器200可以基于第一功能包的描述信息获取到服务器200上存储的第一更新安装文件的校验值,也可以基于第二功能包的描述信息获取到服务器200上存储的第二更新安装文件的校验值。
在一些示例中,对于电子设备的获取操作,可以指电子设备在其内核空间、用户空间或者存储器中的查找、查询或索引等操作。对于应用服务器的获取操作,可以指服务器在其内存空间、存储器或者数据库中的查找、查询或索引等操作。
在第一更新安装文件的校验值与第一安装文件的校验值相同的情况下,说明第一更新安装文件和第一安装文件是相同的,仅是第一更新功能包的版本号与第一功能包的版本号不同。那么服务器200可以向电子设备100发送消息,该消息用于指示电子设备100无需删除第一功能包,电子设备100仍可以基于第一功能包实现第一免安装应用的第一功能特性。
在第一更新安装文件的校验值与第一安装文件的校验值不同的情况下,说明第一更新安装文件和第一安装文件是不同的,即第一更新功能包的安装文件已更新,并且第一更新功能包的版本号与第一功能包的版本号也是不同的。电子设备100可以将电子设备100中的第一功能包删除掉。
同理,验证第二功能包中安装文件是否更新的原理与验证第一功能包中安装文件是否更新的原理类似,本申请在此不再赘述。
当电子设备100需获取到第一更新功能包和/或第二更新功能包时,在一种可能的实现方式中,服务器200可以主动向电子设备100发送第一更新功能包和/或第二更新功能包。在其他可能的实现方式中,当用户需要在电子设备100上使用第一免安装应用的第一更新功能特性和/或第二更新功能特性时,电子设备100可以再从服务器200上下载第一更新功能包和/或第二更新功能包。
可选的,安装文件的校验值可以是安装文件的哈希值。不仅限于哈希值,能够实现验证功能包中安装文件是否发生变化的方法均可以适用于本申请,例如时间戳或者逻辑时钟等,本申请实施例对此不做限定。
这样,电子设备100可以基于安装文件的校验值确定出是否将本地存储的功能包删除掉。也就是说,电子设备100上可以同时存在同一个免安装应用内不同版本的功能包。在更新同一个免安装应用内某一个功能包时,在该免安装应用内其他功能包的安装文件在没有变化的时候,其他功能包无需更新,可以提高功能包的启动速度,提高用户体验。
图5A为本申请提供的一种应用独立升级的***示意图。
参考图3实施例中的描述,电子设备100上存储有第一免安装应用的第一功能包和第二功能包。其中,第一功能包可以实现第一免安装应用的第一功能特性,第二功能包可以实现第一免安装应用的第二功能特性。
图5A中的(a)所示的深色方框内表示的是第一功能特性更新后的第一更新功能包,开发者需要重新将第一更新功能包上传至应用服务器。相应地,开发者还需将第一更新功能包的版本号更改为app version2.0。可以将版本号和安装文件更新之后的第一功能包称为第一更新功能包。对应地,也需将第二功能包的版本号修改为app version2.0,将第三功能包的版本号修改为app version2.0。可以将版本号更新之后的第二功能包称为第二更新功能包,将版本号更新之后的第三功能包称为更新第三功能包。
需要说明的是,图5A中的(a)中所示的深色方框表示的第一更新功能包中的安装文件发生了变化。图5A中的(a)中所示的浅色方框表示的第二更新功能包和更新第三功能包中的安装文件没有发生变化,仅是第二更新功能包的版本号和更新第三功能包的版本号发生了变化。
其中,第一更新安装文件的校验值和第一安装文件的校验值不同,第一更新功能包的版本号和第一功能包的版本号也不同。
第二更新安装文件的校验值和第二安装文件的校验值相同,但是第二更新功能包的版本号和第二功能 包的版本号不同。
更新安装文件三的校验值和安装文件三的校验值相同,但是更新第三功能包和第三功能包的版本号不同。
如图5A中的(b)所示,在第一免安装应用的第一功能包更新之后,用户在电子设备100上使用第一免安装应用的第一功能特性时,电子设备100可以基于第一功能包让用户继续使用第一免安装应用的第一功能特性。相应地,电子设备100可以从应用服务器中下载第一免安装应用的第一更新功能包。在第一免安装应用停止使用后,电子设备100会删除掉第一功能包,并保存第一免安装应用的第一更新功能包,使得用户可以在下次基于第一更新功能包使用第一免安装应用的第一更新功能特性。而电子设备100上存储有第一免安装应用的第二功能包。因此电子设备100需确定出第二功能包中安装文件是否也更新。具体的,电子设备100可以获取到第二功能包的描述信息和第二安装文件的校验值。并将第二功能包的描述信息和第二安装文件的校验值发送至应用服务器。应用服务器可以基于第二功能包的描述信息获取到第二更新安装文件的校验值。在第二安装文件的校验值和第二更新安装文件的校验值相同的情况下,说明第二安装文件和第二更新安装文件是相同的,即免安装应用二的功能特性没有更新,此时无需删除第二功能包。
如图5A中的(c)所示,电子设备100可以同时存储版本号不一致的第一更新功能包和第二功能包。
在其他实施例中,如图5B中的(a)所示,第二更新功能包中安装文件与第二功能包中安装文件不同。如图5B中的(b)所示,电子设备100可以从应用服务器中下载第一免安装应用的第一更新功能包。在第一免安装应用停止使用后,电子设备100可以删除掉第一功能包,并将第一更新功能包保存在电子设备100上,使得用户可以在下次基于第一更新功能包使用第一免安装应用的第一更新功能特性。而电子设备100之前下载过第一免安装应用的第二功能包。第二功能包的版本为app version1.0,与第一更新功能包的版本不一致。因此电子设备100需确定出第二功能包的安装文件是否也更新。具体的,电子设备100可以获取到第二功能包的描述信息和第二安装文件的校验值。并将第二功能包的描述信息和第二安装文件的校验值发送至应用服务器。应用服务器可以基于第二功能包的描述信息获取到第二更新安装文件的校验值。在第二安装文件的校验值和第二更新安装文件的校验值不同的情况下,说明第二安装文件和第二更新安装文件是不同的,此时电子设备100可以将第二功能包删除掉,并下载第二更新功能包。
如图5B中的(c)所示,电子设备100从应用服务器下载第二更新功能包后,电子设备100上存储有第一更新功能包和第二更新功能包。其中,第一更新功能包和第二更新功能包的版本是一致的。
在其他实施例中,电子设备100也可以周期性地或者间隔一段时间或者不定时地验证本地存储的第一功能包中的安装文件和第二功能包中的安装文件是否更新。具体的,电子设备100可以周期性地或者间隔一段时间或者不定时地获取到第一功能包的描述信息和第一安装文件的校验值,以及第二功能包的描述信息和第二安装文件的校验值,并将第一功能包的描述信息和第一安装文件的校验值,以及第二功能包的描述信息和第二安装文件的校验值发送至应用服务器。应用服务器可以基于第一功能包的描述信息获取到第一更新安装文件的校验值,以及基于第二功能包的描述信息获取到第二更新安装文件的校验值。应用服务器可以比较安装文件的校验值和更新安装文件的校验值,确认第一功能包中的安装文件和第二功能包中的安装文件是否更新。具体的,在第一安装文件的校验值和第一更新安装文件的校验值相同,且第二安装文件的校验值和第二更新安装文件的校验值也相同的情况下,电子设备100可以继续保存第一功能包和第二功能包。在第一安装文件的校验值和第一更新安装文件的校验值相同,第二安装文件的校验值和第二更新安装文件的校验值不同的情况下,电子设备100可以获取到第二更新功能包,将第二功能包删除掉,并保存第一功能包和第二更新功能包。在第一安装文件的校验值和第一更新安装文件的校验值不同,第二安装文件的校验值和第二更新安装文件的校验值相同的情况下,电子设备100可以获取到第一更新功能包,将第一功能包删除掉,并保存第一更新功能包和第二功能包。在第一安装文件的校验值和第一更新安装文件的校验值不同,第二安装文件的校验值和第二更新安装文件的校验值也不同的情况下,电子设备100可以获取到第一更新功能包和第二更新功能包,将第一功能包和第二功能包删除掉,并保存第一更新功能包和第二更新功能包。
图5C为本申请实施例提供的一种***架构图。
如图5C所示,该***包括的设备包括但不仅限于电子设备100和服务器200。
在一些实施例中,服务器200也可以被称为应用服务器。
示例性,电子设备100的设备包括但不仅限于手机、平板电脑、桌面型计算机、膝上型计算机、手持 计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence,AI)设备、可穿戴式设备、车载设备、智能家居设备和/或智慧城市设备,本申请以下实施例以电子设备100为手机为例进行说明,本申请实施例对电子设备100的具体类型不作特殊限制。
其中,电子设备100上存储有第一免安装应用的第一功能包和第二功能包。其中,第一功能包可以实现第一免安装应用的第一功能特性,第二功能包可以实现第一免安装应用的第二功能特性。
电子设备100在更新第一免安装应用中的某一个功能包时,也需确定出第一免安装应用中其他功能包是否更新。具体的,电子设备100获取到第一免安装应用中其他功能包的描述信息和校验值,并将其他功能的描述信息和校验值发送至服务器200。
服务器200可以基于其他功能包的描述信息获取到服务器200中存储的其他功能包中安装文件的校验值。
在服务器200中存储的其他功能包中安装文件的校验值与电子设备100发送的其他功能包中安装文件的校验值相同的情况下,则说明其他功能包中安装文件没有发生变化,仅是其他功能包的版本号发生了变化,那么电子设备100上存储的其他功能包无需删除。
在服务器200中存储的其他功能包中安装文件的校验值与电子设备100发送的其他功能包中安装文件的校验值不同的情况下,则说明其他功能包中安装文件也发生了变化,相应地,其他功能包的版本号也发生了变化,那么电子设备100可以将存储的其他功能包删除掉,并从服务器200上重新下载较新版本的功能包。
图6示出了电子设备100的结构示意图。
下面以电子设备100为例对实施例进行具体说明。应该理解的是,图6所示电子设备100仅是一个范例,并且电子设备100可以具有比图6中所示的更多的或者更少的部件,可以组合两个或多个的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。
电子设备100可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了***的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器 接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等***器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调 处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星***(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯***(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,和/或IR技术等。所述GNSS可以包括全球卫星定位***(global positioning system,GPS),全球导航卫星***(global navigation satellite system,GLONASS),北斗卫星导航***(beidou navigation satellite system,BDS),准天顶卫星***(quasi-zenith satellite system,QZSS)和/或星基增强***(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作***,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一 些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。
下面介绍本申请实施例提供的一种电子设备的软件***架构。
电子设备100的软件***可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构,示例性说明电子设备100的软件结构。
请参考图7,图7是本申请实施例的电子设备100的软件架构框图。分层架构将软件分成当干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,可以将电子设备的***分为应用层、应用程序架构层、***库和内核层。
其中,应用层可用于实现对应用的管理和界面操作,该应用层可以包括一系列应用程序包,例如,服 务中心。用户在电子设备上通过服务中心查找或者使用免安装应用。
应用程序框架层可以包括功能包下载模块、功能包管理模块以及免安装应用安装模块。
其中,功能包下载模块,用于在电子设备100上存储的功能包中安装文件已更新的情况下,将电子设备100上存储的功能包删除掉。
功能包下载模块,还用于在功能包中安装文件更新,从应用服务器中下载免安装应用的较新版本的功能包。
功能包管理模块,用于存储免安装应用的功能包。
免安装应用安装模块,用于基于免安装应用的功能包实现免安装应用的功能特性。
***库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子***进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
本申请实施例提供的一种免安装应用的功能包独立升级的方法,是基于功能包中安装文件的校验值来确定出是否需更新功能包的。在电子设备上存储的功能包中安装文件的校验值与服务器中存储的更新功能包中安装文件的校验值一致的情况下,说明电子设备上存储的功能包中安装文件是没有更新的,那么电子设备无需将该功能包删除掉。
接下来介绍如何生成免安装应用的功能包中安装文件的校验值的。
表1
如表1所示,开发者需创建免安装应用的AppScope(应用全局范围配置)目录。AppScope目录可以包括resources和app.json。可以在该AppScope目录中添加该免安装应用的描述信息,例如该免安装应用的描述信息可以添加在app.json文件中。该免安装应用的描述信息可以包括但不仅限于:应用的名称、应用的版本号等。
一个免安装应用可以包括多个功能包,开发者可以在AppScope目录下创建一个免安装应用内的多个功能包目录,例如entry功能包目录和feature功能包目录。并在功能包目录中添加该功能包的描述信息。
其中,entry功能包目录可以包括scr/main、resources、ets和module.json。开发者可以在entry功能包目录中添加entry功能包的信息。例如,entry功能包的信息可以添加在module.json文件中。entry功能包的信息包括但不仅限于entry功能包的名称、实现entry功能包功能特性的组件信息等。在一些实施例中,实现entry功能包功能特性的组件信息也可以被称为entry功能包的安装文件。
feature功能包目录也可以包括scr/main、resources、ets和module.json。开发者也可以在feature功能包目录中添加feature功能包的信息。例如,feature功能包的信息可以添加在module.json文件中。feature功能包的信息包括但不仅限于feature功能包的名称、feature功能包的组件信息等。在一些实施例中,feature功能包的组件信息也可以被称为feature功能包的安装文件。
之后,可以对开发视图中的目录进行编译,得到免安装应用的部署态视图。
在编译的过程中,会分别计算entry功能包中安装文件的校验值和feature功能包中安装文件的校验值, 无需计算AppScope文件的校验值。这样,即使免安装应用的版本号发生了变化,只会影响AppScope文件的校验值,也不会影响entry功能包中安装文件的校验值和feature功能包中安装文件的校验值。
一个开发态的module.json文件在编译之后,可以生成一个部署态的hap文件。
表2
如表2所示,entry文件在编译之后,生成了一个entry.hap文件。feature文件在编译之后,生成了一个feature.hap文件。
在编译之后,entry.hap文件中的module.json文件可以由表1中entry文件中的module.json文件和AppScope目录下的app.json文件组成。相应地,还需将entry功能包中安装文件的校验值***至module.json文件中。
同理,feature.hap文件中的module.json文件由表1中feature文件中的module.json文件和AppScope目录下的app.json文件组成。相应地,还需将feature功能包中安装文件的校验值***至module.json文件中。
在一些实施例中,entry.hap文件可以被称为entry功能包。feature.hap文件可以被称为feature功能包。这样,entry.hap中有该功能包安装文件的校验值。feature.hap功能包中也有该功能包安装文件的校验值。
在得到免安装应用的部署态视图之后,再将免安装应用的部署态视图进行打包合并,并将该免安装应用的完整安装包上传至应用服务器中。
所有的hap包最终会编译到一个app pack中。该app pack可用于上传至应用服务器中。
该免安装应用的名称可以是“xxx”,该免安装应用包括两个不同功能特性的功能包,例如entry.hap和feature.hap。
entry.hap包括该功能包的安装文件、entry.hap的信息、entry.hap所属免安装应用的应用描述信息、entry.hap安装文件的校验值。
feature.hap包括该功能包的安装文件、feature.hap的信息、feature.hap所属免安装应用的应用描述信息、feature.hap安装文件的校验值。
在一些实施例中,entry.hap的信息、entry.hap所属免安装应用的应用描述信息可以被称为entry.hap的描述信息。feature.hap的信息、feature.hap所属免安装应用的应用描述信息可以被称为feature.hap的描述信息。
需要说明的是,本申请是以OpenHarmony中免安装应用的hap包在编译过程中如何得到hap包的校验值为例进行说明的,本申请实施例也可适用于其他操作***,例如操作***、等操作***中得到安装包的校验值的原理与本申请类似,本申请实施例对此不做限定。
图8为本申请实施例提供的一种在电子设备100上更新单个功能包的流程示意图。
S801、应用服务器中保存有第一免安装应用的第一功能包,第一安装文件的校验值为校验值一。
应用服务器中存储有第一免安装应用的第一功能包,第一功能包可以实现第一免安装应用的第一功能特性。例如,第一功能包可以包括第一安装文件、第一功能包的描述信息、第一安装文件的校验值一。其中,第一功能包的描述信息可以包括但不仅限于以下一项或多项:第一功能包的包名、第一免安装应用的名称、第一功能包的版本号(第一版本号)等。第一安装文件的校验值一用于验证第一安装文件是否更新。
需要说明的是,图8实施例是以第一免安装应用中一个功能包更新为例进行说明的。对第一免安装应用中多个功能包更新的相关描述,可以参考图9实施例。
S802、应用服务器将第一功能包发送至电子设备100。
S803、电子设备100基于第一功能包实现第一免安装应用的第一功能特性。
电子设备100可以从应用服务器中下载第一免安装应用的第一功能包。电子设备100可以基于第一功能包实现第一免安装应用的第一功能特性。
S804、应用服务器接收开发者上传的第一免安装应用的第一更新功能包,第一更新安装文件的校验值为校验值二。
在一些实施例中,在第一免安装应用的第一功能特性更新的情况下,第一更新功能包中第一更新安装文件与第一功能包中第一安装文件不同,对应的,第一更新功能包的版本号也会发生变化。第一更新功能包可以包括第一更新功能包的第一更新安装文件、第一更新功能包的描述信息、第一更新安装文件的校验值二。其中,第一更新功能包的描述信息可以包括但不仅限于以下一项或多项:第一更新功能包的包名、第一免安装应用的名称、第一更新功能包的版本号(第二版本号)等。其中,第一更新安装文件的校验值二也与第一安装文件的校验值一不同,也即第一更新功能包中第一更新安装文件与第一功能包中第一安装文件不同,以此可以判断第一更新功能包的安装文件已更新。
在其他实施例中,也可以仅将第一功能包的版本号进行更新,得到第一免安装应用的第一更新功能包。第一更新功能包可以包括第一更新功能包的第一安装文件、第一更新功能包的描述信息、第一更新功能包中第一安装文件的校验值二。其中,第一更新功能包的描述信息可以包括但不仅限于以下一项或多项:第一更新功能包的包名、第一免安装应用的名称、第一更新功能包的版本号(第二版本号)等。其中,第一更新功能包中第一安装文件的校验值二与第一功能包中第一安装文件的校验值一是相同,也即第一更新功能包中安装文件与第一功能包中安装文件是相同的,以此可以判断第一更新功能包中安装文件没有更新。
需要说明的是,S804也可以在S802之后执行。
S805、应用服务器删除第一功能包,保存第一更新功能包。
在第一免安装应用中功能包更新的情况下,应用服务器中可以保存较新版本的功能包,并删除掉旧版本的功能包,即应用服务器将第一功能包删除掉,保存第一更新功能包。
S806、电子设备100接收第一操作,运行第一功能包。
由S803中的描述可知,在电子设备100保存第一功能包之后,用户可以基于第一功能包使用第一免安装应用的第一功能特性。例如,第一免安装应用可以是空调控制应用,用户可以基于图2C所示的用户界面420对家庭里空调的工作模式进行控制。
S807、电子设备100将第一功能包的描述信息和校验值一发送至应用服务器。
电子设备100在运行第一功能包时,可以获取到第一功能包的描述信息和校验值一,并将第一功能包的描述信息和校验值一发送至应用服务器。应用服务器可以基于第一功能包的描述信息和校验值一确认出第一功能包的安装文件是否更新。在第一功能包中安装文件更新的情况下,电子设备100可以获取到较新版本的第一功能包。在第一功能包安装文件没有更新的情况下,电子设备100可以继续保存第一功能包。
可选的,本申请实施例提供的方法也可以不执行S806,电子设备100可以周期性地或者间隔一定时间或者不定时地将第一功能包的描述信息和第一功能包中安装文件的校验值一发送至应用服务器。应用服务器可以基于第一功能包的描述信息和第一功能包中安装文件的校验值一验证第一功能包中安装文件是否更新。在更新的情况下,电子设备100可以获取到包含更新安装文件的功能包,即第一更新功能包。这样,在用户使用第一免安装应用的第一功能特性时,电子设备100可以基于第一更新功能包实现第一免安装应用的第一更新功能特性。
可选的,本申请实施例提供的方法也可以不执行S806,在应用服务器上的第一功能包更新之后,应用服务器可以周期性地或者间隔一定时间或者不定时地将第一更新功能包的描述信息和第一更新安装文件的校验值二发送至电子设备100。由电子设备100确认是否获取第一更新功能包。
S808、应用服务器基于第一功能包的描述信息获取到第一更新安装文件的校验值二。
由S804中的描述可知,应用服务器中存储的是较新版本的第一功能包,即第一更新功能包,因此应用服务器需确定出第一更新功能包中安装文件是否与电子设备100上存储的第一功能包中安装文件是否相同。
应用服务器可以基于第一功能包的描述信息获取到第一更新安装文件的校验值二,通过比较安装文件的校验值来确定出安装文件是否发生变化。
S809、应用服务器需确定出校验值一和校验值二是否相同。
在一些实施例中,校验值可以基于功能包中的安装文件得到。
在校验值一和校验值二相同的情况下,说明第一功能包中安装文件和第一更新功能包中安装文件是相 同的。在这种情况下,电子设备100不需要重新获取第一更新功能包,流程结束。这样,即使第一更新功能包的版本号发生变化,但是第一更新功能包中安装文件没有变化的,电子设备100可以继续保存第一功能包。
在校验值一和校验值二不同的情况下,说明第一功能包中的安装文件和第一更新功能包中的安装文件不同,电子设备100可以执行S810-S811。
S810、应用服务器向电子设备100发送消息一。
S811、电子设备100删除第一功能包,保存第一更新功能包。
在一些实施例中,消息一可以包括获取第一更新功能包的指示消息。
在一种可能的实现方式中,电子设备100在获取到消息一后,可以提示用户是否获取到第一更新功能包。在用户同意的情况下,电子设备100可以从应用服务器中获取到第一更新功能包。当电子设备100正在运行第一功能包,电子设备100可以等待第一功能包停止运行之后,再将第一功能包删除掉,并保存第一更新功能包。在用户不同意的情况下,电子设备100不会获取到第一更新功能包,还是保存第一功能包。
在其他可能的实现方式中,电子设备100在获取到消息一后,可以先从应用服务器中获取到第一更新功能包,再提示用户是否保存第一更新功能包。在用户同意的情况下,当电子设备100正在运行第一功能包,电子设备100可以等待第一功能包停止运行之后,再将第一功能包删除掉,并保存第一更新功能包。在用户不同意的情况下,电子设备100可以将第一更新功能包删除掉,还是保存第一功能包。
在其他实施例中,消息一可以包括第一更新功能包。
在电子设备100获取到应用服务器发送的第一更新功能包之后,电子设备100可以提示用户是否保存第一更新功能包。在用户同意的情况下,当电子设备100正在运行第一功能包,那么电子设备100可以等待第一功能包停止运行之后,电子设备100再将第一功能包删除掉,并保存第一更新功能包。在用户不同意的情况下,电子设备100可以将第一更新功能包删除掉,还是保存第一功能包。
图8实施例中,在应用服务器确认出第一更新功能包中的安装文件与第一功能包中的安装文件相同的情况下,也就确认出第一更新功能包中安装文件没有更新,那么电子设备100也就无需获取第一更新功能包,可以节省电子设备100的流量。
在其他实施例中,电子设备100还可以保存第一免安装应用的其他功能包,例如第二功能包,第二功能包用于实现第一免安装应用的第二功能特性。电子设备100在确认第一更新功能包中安装文件是否更新的同时,电子设备100也需确认第二更新功能包中安装文件是否更新。
图9为本申请实施例提供的一种电子设备100更新多个功能包的流程示意图。
S901、应用服务器保存第一免安装应用的第一功能包和第二功能包,第一功能包中安装文件的校验值为校验值一,第二功能包中安装文件的校验值为校验值三。
应用服务器中存储的第一免安装应用的功能包可以包括第一功能包和第二功能包。其中,第一功能包用于实现第一免安装应用的第一功能特性,第二功能包用于实现第一免安装应用的第二功能特性。
第一功能包可以包括第一安装文件、第一功能包的描述信息、第一安装文件的校验值一。第二功能包
可以包括第二安装文件、第二功能包的描述信息、第二安装文件的校验值三。
S902、应用服务器将第一功能包和第二功能包发送至电子设备100。
S903、电子设备100保存第一功能包和第二功能包。
电子设备100可以从应用服务器中下载第一免安装应用的第一功能包和第二功能包。电子设备100可以基于第一功能包实现第一免安装应用的第一功能特性,也可以基于第二功能包实现第一免安装应用的第二功能特性。
S904、应用服务器接收开发者上传的第一更新功能包和第二更新功能包,第一更新安装文件中安装文件的校验值为校验值二,第二更新功能包中安装文件的校验值为校验值四。
应用服务器接收开发者上传的第一更新功能包和第二更新功能包。
其中,第一更新功能包可以包括第一更新安装文件、第一更新功能包的描述信息、第一更新安装文件的校验值二。其中,第一更新功能包的描述信息可以包括但不仅限于以下一项或多项:第一更新功能包的包名、第一免安装应用的名称、第一更新功能包的版本号(第二版本号)等。
在一些施例中,校验值二与校验值一不同,说明第一更新安装文件与第一安装文件不同,以此可以判断第一更新功能包中安装文件已更新,第一更新功能包的版本号与第一功能包的版本号也不同。
在其他实施例中,校验值二与校验值一相同,说明第一更新安装文件与第一安装文件是相同的,仅是 第一更新功能包的版本号与第一功能包的版本号号不同。
同理,第二更新功能包可以包括第二更新安装文件、第二更新功能包的描述信息、第二更新安装文件的校验值四。其中,第二更新功能包的描述信息可以包括但不仅限于以下一项或多项:第二更新功能包的包名、第一免安装应用的名称、第二更新功能包的版本号(第二版本号)等。
在一些施例中,校验值四与校验值三不同,说明第二更新安装文件与第二安装文件不同,以此可以判断第二更新功能包中安装文件已更新,第二更新功能包的版本号与第二功能包的版本号也不同。
在其他实施例中,校验值四与校验值三相同,说明第二更新安装文件与第二安装文件是相同的,仅是第二更新功能包的版本号与第二功能包的版本号不同。
需要说明的是,S904也可以在S902之后执行。
S905、应用服务器删除第一功能包和第二功能包,保存第一更新功能包和第二更新功能包。
在第一免安装应用的功能包更新的情况下,应用服务器中可以保存较新版本的功能包,并删除掉旧版本的功能包,即应用服务器将第一功能包和第二功能包删除掉,保存第一更新功能包和第二更新功能包。
S906、电子设备100接收第一操作,运行第二功能包。
由S903中的描述可知,电子设备100中保存有第一功能包和第二功能包,用户可以基于第一功能包使用第一免安装应用的第一功能特性,用户也可以基于第二功能包使用第一免安装应用的第二功能特性。例如,电子设备100可以接收第一操作,运行第二功能包,电子设备100可以显示图2C所示的用户界面420,用户可以基于图2C所示的用户界面420对家庭里空调的工作模式进行控制。
S907、电子设备100将第一功能包的描述信息和校验值一,以及第二功能包的描述信息和校验值三发送至应用服务器。
电子设备100在运行第一功能包时,电子设备100可以获取到第一功能包的描述信息和校验值一,以及第二功能包的描述信息和校验值三。并将第一功能包的描述信息和校验值一,以及第二功能包的描述信息和校验值三发送至应用服务器。以确认出第一功能包中安装文件和第二功能包中安装文件是否更新。
在第一功能包中安装文件更新的情况下,电子设备100可以获取到较新版本的第一功能包。在第一功能包安装文件没有更新的情况下,则电子设备100可以继续保存第一功能包。
在第二功能包中安装文件更新的情况下,电子设备100可以获取到较新版本的第二功能包。在第二功能包安装文件没有更新的情况下,则电子设备100可以继续保存第二功能包。
可选的,本申请实施例提供的方法也可以不执行S906,电子设备100可以周期性地或者间隔一定时间或者不定时地将第一功能包的描述信息和校验值一,以及第二功能包的描述信息和校验值三发送至应用服务器。以确认出第一功能包中安装文件和第二功能包中安装文件是否更新。在更新的情况下,电子设备100可以获取到包含更新安装文件的功能包,例如第一更新功能包和/或第二更新功能包。这样,在用户使用第一免安装应用的第一功能特性或者第一免安装应用的第二功能特性时,电子设备100可以基于第一更新功能包实现第一免安装应用的第一更新功能特性,或者电子设备100可以基于第二更新功能包实现第一免安装应用的第二更新功能特性。
可选的,本申请实施例提供的方法也可以不执行S906,在应用服务器上的第一功能包和/或第二功能包更新之后,应用服务器可以周期性地或者间隔一定时间或者不定时地将第一更新功能包的描述信息和第一更新安装文件的校验值二,和/或,第二更新功能包的描述信息和第二更新安装文件的校验值四发送至电子设备100。由电子设备100确认是否获取第一更新功能包和/或第二更新功能包。
S908、应用服务器基于第一功能包的描述信息获取到第一更新安装文件的校验值二,基于第二功能包的描述信息获取到第二更新功能包的校验值四。
由S904中的描述可知,应用服务器中存储的是较新版本的第一功能包和较新版本的第二功能包,即第一更新功能包和第二更新功能包,因此应用服务器需确定出第一更新功能包中安装文件是否与电子设备100上存储的第一功能包中安装文件相同,相应地,服务器也需确定出第二更新功能包中安装文件是否与电子设备100上存储的第二功能包中安装文件相同。
那么应用服务器可以基于第一功能包的描述信息获取到第一更新安装文件的校验值二。应用服务器也可以基于第二功能包的描述信息获取到第二更新安装文件的校验值四。通过比较安装文件的校验值来确定出安装文件是否发生变化。
S909、应用服务器需确认出校验值一和校验值二是否相同,并且校验值三和校验值四是否相同。
在一些实施例中,校验值可以基于功能包中安装文件得到。
在校验值一和校验值二相同的情况下,说明第一功能包中安装文件和第一更新功能包中安装文件是相同的,此时电子设备100也不需要重新获取第一更新功能包,流程结束。这样,即使第一更新功能包的版本号发生变化,但是第一更新功能包中安装文件是没有变化的,电子设备100可以继续保存第一功能包。
在校验值一和校验值二不同的情况下,说明第一功能包中安装文件和第一更新功能包中安装文件是不同的,即第一更新功能包中安装文件已经更新,电子设备100可以获取到第一更新功能包。
同理,在校验值三和校验值四相同的情况下,说明第二功能包中安装文件和第二更新功能包中安装文件是相同的,此时电子设备100也不需要重新获取第二更新功能包,流程结束。这样,即使第二更新功能包的版本号发生了变化,但是第二更新功能包中安装文件是没有变化的,电子设备100可以继续保存第二功能包。
在校验值三和校验值四不同的情况下,说明第二功能包中安装文件和第二更新功能包中安装文件是不同的,即第二更新功能包中安装文件已经更新,电子设备100可以获取到第二更新功能包。
综上所述,在S909中,应用服务器可以确认出以下四种情况:
情况一:应用服务器确认出校验值一和校验值二相同,校验值三和校验值四也相同。此时可以确定出电子设备100无需获取到第一更新功能包和第二更新功能包,则流程结束。
情况二:应用服务器确认出校验值一和校验值二相同,校验值三和校验值四不同。那么可以确定出第二功能包中安装文件和第二更新功能包中安装文件不同,即第二更新功能包中安装文件已更新。此时电子设备100可以获取到第二更新功能包,将电子设备100上存储的第二功能包删除掉,并保存第二更新功能包。这样,电子设备100上存储的第一功能包的版本号和第二更新功能包的版本号不同,同一个应用内不同版本号的功能包互存。
情况三:应用服务器确认出校验值一和校验值二不同,校验值三和校验值四相同。那么可以确定出第一功能包中安装文件和第一更新功能包中安装文件不同,即第一更新功能包中安装文件已更新。此时电子设备100可以获取到第一更新功能包,将电子设备100上存储的第一功能包删除掉,并保存第一更新功能包。这样,电子设备100上存储的第一更新功能包的版本号和第二功能包的版本号不同,也同一个应用内不同版本号的功能包互存。
情况四:应用服务器确认出校验值一和校验值二不同,校验值三和校验值四也不同。那么可以确定出第一功能包中安装文件和第一更新功能包中安装文件不同,即第一更新功能包中安装文件已更新,并且第二功能包中安装文件和第二更新功能包中安装文件也不同,即第二更新功能包中安装文件也更新。此时电子设备100可以获取到第一更新功能包和第二更新功能包,将电子设备100上存储的第一功能包和第二功能包删除掉,并保存第一更新功能包和第二更新功能包。
S910、应用服务器向电子设备100发送消息二。
S911、电子设备100保存第一更新功能包和/或第二更新功能包。
在校验值一和校验值二不同,和/或,校验值三和校验值四不同的情况下,应用服务器可以向电子设备100发送消息二。以使得电子设备100可以保存第一更新功能包和/或第二更新功能包。
基于S909中的描述,S911中存在三种情况。
情况一、电子设备100删除第一功能包,获取到第一更新功能包,保存第一更新功能包和第二功能包。
情况二、电子设备100删除第二功能包,获取到第二更新功能包,保存第一功能包和第二更新功能包。
情况三、电子设备100删除第一功能包和第二功能包,获取到第一更新功能包和第二更新功能包,保存第一更新功能包和第二更新功能包。
对于电子设备100如何获取到第一更新功能包和/或第二更新功能包的,可以参考S811中的描述,本申请实施例在此不再赘述。
图10为本申请实施例提供的一种免安装应用的升级方法的流程示意图。
S1001、电子设备获取第一免安装应用的第一功能包和第二功能包,第一功能包包括第一描述信息和第一校验值,第二功能包包括第二描述信息和第二校验值。
在一些实施例中,第一校验值也可以被称为校验值一。第二校验值也可以被称为校验值三。
在一种可能的实现方式中,第一功能包还包括第一安装文件,第一校验值为第一安装文件的校验值;第二功能包还包括第二安装文件,第二校验值为第二安装文件的校验值。
在一些实施例中,第一描述信息和第一校验值可以是同一个信息,也可以是不同的信息。第二描述信息和第二校验值可以是同一个信息,也可以是不同的信息。
其中,第一描述信息可以包括以下一项或多项:第一功能包的包名、第一免安装应用的应用名等。第一功能包除了包括第一描述信息外,还可以包括其他的描述信息,例如第一功能包的版本号等。
第二描述信息可以包括以下一项或多项:第二功能包的包名、第一免安装应用的应用名等。第二功能包除了包括第一描述信息外,还可以包括其他的描述信息,例如第二功能包的版本号等。
S1002、电子设备将第一描述信息和第一校验值,以及第二描述信息和第二校验值发送至应用服务器,第一描述信息用于应用服务器获取到第三校验值,第二描述信息用于应用服务器获取到第四校验值。
在一些实施例中,第三校验值也可以被称为校验值二。第四校验值也可以被称为校验值四。
第三校验值可以指应用服务器上存储的第一免安装应用中第一更新功能包中安装文件的校验值。
第四校验值可以指应用服务器上存储的第一免安装应用中第二更新功能包中安装文件的校验值。
电子设备可以周期性地/间隔一定时间/不定时地基于该方法到应用服务器中验证第一免安装应用中的功能包是否需要更新。
在一种可能的实现方式中,电子设备将第一描述信息和第一校验值,以及第二描述信息和第二校验值发送至应用服务器之前,方法还包括:电子设备接收第一操作;响应第一操作,电子设备运行第二功能包。
这样,除了电子设备周期性地/间隔一定时间/不定时地到应用服务器中验证第一免安装应用中的功能包是否需要更新。电子设备也可以在用户使用第一免安装应用时,主动到应用服务器中验证第一免安装应用中的功能包是否需要更新,并获取到更新的功能包。用户可以在下次使用第一免安装应用时,使用的是更新的功能包。
S1003、在第三校验值和第一校验值相同,第四校验值与第二校验值不同的情况下,电子设备接收应用服务器发送的第二更新功能包。
第一更新功能包可以包括第一更新安装文件、第一描述信息和第三校验值。第一更新功能包除了包括第一描述信息外,还可以包括其他的描述信息,例如第一更新功能包的版本号等。第一更新功能包的版本号与第一功能包的版本号不同。
第二更新功能包可以包括第二更新安装文件、第二描述信息和第四校验值。第二更新功能包除了包括第一描述信息外,还可以包括其他的描述信息,例如第二更新功能包的版本号等。第二更新功能包的版本号与第二功能包的版本号不同。
在一种可能的实现方式中,在电子设备接收应用服务器发送的第二更新功能包之前,方法还包括:电子设备接收应用服务器发送的第一消息;电子设备接收应用服务器发送的第二更新功能包,具体包括:响应于第一消息,电子设备将第二描述信息发送至应用服务器,第二描述信息用于应用服务器获取到第二更新功能包;电子设备接收应用服务器发送的第二更新功能包。
这样,电子设备可以在需要使用第二更新功能包时,再从服务器下载第二更新功能包。
其中,第一消息可以是图9实施例中所示的消息二。
S1004、电子设备删除第二功能包,保存或者安装第二更新功能包。
在一种可能的实现方式中,第一功能包的版本号和第二功能包的版本号相同或者不同;第一功能包的版本号与第二更新功能包的版本号不同。
在一些实施例中,第一功能包的版本号与第二更新功能包的版本号不同,在电子设备运行第一功能包时,电子设备可以将第一功能包的版本号修改为较新版本的版本号,即与第二更新功能包的版本号一致。这样,第一功能包在运行时,向电子设备呈现的版本号为较新版本的版本号。
这样,电子设备上同一个免安装应用内不同版本的功能包可以互存。
在一种可能的实现方式中,方法还包括:在第三校验值和第一校验值相同,第四校验值与第二校验值也相同的情况下,电子设备接收应用服务器发送的第二消息;响应于第二消息,电子设备继续保存第一功能包和第二功能包。
这样,在第一功能包中安装文件和第二功能包中安装文件没有更新的情况下,电子设备可以继续保存第一功能包和第二功能包。
在一种可能的实现方式中,方法还包括:在第三校验值和第一校验值不同,第四校验值与第二校验值相同的情况下,电子设备接收应用服务器发送的第一更新功能包;电子设备删除第一功能包,保存或者安装第一更新功能包。
这样,在第一功能包中安装文件已更新的情况下,电子设备可以将第一功能包删除掉,获取并保存第 一更新功能包。在第二功能包中安装文件没更新的情况下,电子设备可以继续保存第二功能包,无需下载第二更新功能包。
在一种可能的实现方式中,方法还包括:在第三校验值和第一校验值不同,第四校验值与第二校验值也不同的情况下,电子设备接收应用服务器发送的第一更新功能包和第二更新功能包;电子设备删除第一功能包和第二功能包,保存或者安装第一更新功能包和第二更新功能包。
这样,在第一功能包中安装文件和第二功能包中安装文件均已更新的情况下,电子设备可以将第一功能包和第二功能包删除掉,获取并保存第一更新功能包和第二更新功能包。
在一种可能的实现方式中,电子设备删除第二功能包,具体包括:在电子设备停止运行第二功能包后,电子设备删除第二功能包。
这样,在电子设备需要更新第一免安装应用的第二功能包时,电子设备可以在第二功能包停止运行后,再将第二功能包删除掉。这样,不会影响用户使用第二功能包。
在一种可能的实现方式中,方法还包括:电子设备获取第一免安装应用的第三功能包,第三功能包包括第三描述信息和第五校验值;电子设备接收应用服务器发送的第三描述信息和第六校验值;在第五校验值与第六校验值不同的情况下,电子设备接收应用服务器发送的第三更新功能包;电子设备删除第三功能包,保存或者安装第三更新功能包。
在一些示例中,在第五校验值与第六校验值不同的情况下,电子设备可以向应用服务器发送对第三功能包的更新请求,以便于应用服务器发送第三更新功能包。
第三功能包可以包括第三安装文件、第三描述信息和第五校验值。第三功能包除了包括第三描述信息外,还可以包括其他的描述信息,例如第三功能包的版本号等。
第三更新功能包可以包括第三更新安装文件、第三描述信息和第六校验值。第三更新功能包除了包括第三描述信息外,还可以包括其他的描述信息,例如第三更新功能包的版本号等。第三更新功能包的版本号与第三功能包的版本号不同。
这样,也可以由服务器主动向电子设备验证第一免安装应用的功能包是否需要更新。
通过该方法,电子设备可以基于安装文件的校验值确定出是否将电子设备上存储的功能包删除掉。也就是说,电子设备100上可以同时存在同一个免安装应用内不同版本的功能包。在更新同一个免安装应用内某一个功能包时,在该免安装应用内其他功能包的安装文件在没有变化的时候,其他功能包无需更新,可以提高功能包的启动速度,提高用户体验。
图11为本申请实施例提供的另一种免安装应用的升级方法的流程示意图。
S1101、应用服务器接收电子设备发送的第一校验值和第二校验值;第一校验值用于校验第一免安装应用的第一功能包,第二校验值用于校验第一免安装应用的第二功能包。
在一些实施例中,第一校验值也可以被称为校验值一。第二校验值也可以被称为校验值三。
其中,第一校验值可以包括第一功能包的描述信息和第一功能包中安装文件的校验值。第一功能包的描述信息可以包括以下一项或多项:第一功能包的包名、第一免安装应用的名称、第一功能包的版本号。
第二校验值可以包括第二功能包的描述信息和第一功能包中安装文件的校验值。第二功能包的描述信息可以包括以下一项或多项:第二功能包的包名、第一免安装应用的名称、第二功能包的版本号。
其中,电子设备将第一校验值发送至应用服务器,可以指电子设备将第一功能包的包名和第一功能包中安装文件的校验值发送至应用服务器。
电子设备将第二校验值发送至应用服务器,可以指电子设备将第二功能包的包名和第二功能包中安装文件的校验值发送至应用服务器。
S1102、应用服务器根据第一校验值获取第三校验值,以及根据第二校验值获取第四校验值。
在一些实施例中,第三校验值也可以被称为校验值二。第四校验值也可以被称为校验值四。
第三校验值可以包括第一更新功能包的描述信息和第一更新功能包中安装文件的校验值。第一更新功能包的描述信息可以包括以下一项或多项:第一更新功能包的包名、第一免安装应用的名称、第一更新功能包的版本号。第一更新功能包的版本号与第一功能包的版本号不同。
第四校验值可以包括第二更新功能包的描述信息和第一更新功能包中安装文件的校验值。第二更新功能包的描述信息可以包括以下一项或多项:第二更新功能包的包名、第一免安装应用的名称、第二更新功能包的版本号。第二更新功能包的版本号与第二功能包的版本号不同。
应用服务器根据第一校验值获取第三校验值,可以指应用服务器根据第一功能包的包名获取到第一更新功能包中安装文件的校验值。
应用服务器根据第二校验值获取第四校验值,可以指应用服务器根据第二功能包的包名获取到第二更新功能包中安装文件的校验值。
S1103、在第三校验值和第一校验值相同,第四校验值和第二校验值不同的情况下,应用服务器向电子设备发送第二更新功能包。
第三校验值和第一校验值相同,可以指第一更新功能包中安装文件的校验值和第一功能包中安装文件的校验值相同。
第四校验值和第二校验值不同,可以指第二更新功能包中安装文件的校验值和第二功能包中安装文件的校验值不同。
在一种可能的实现方式中,第一功能包的版本号和第二功能包的版本号相同或者不同;第一功能包的版本号与第二更新功能包的版本号不同。
在一种可能的实现方式中,方法还包括:应用服务器将第三更新功能包的第六校验值发送至电子设备,第六校验值用于电子设备校验免安装应用的第三功能包;在第三功能包的第五校验值与第三更新功能包的第六校验值不同的情况下,服务器将第三更新功能包发送至电子设备。
在一些示例中,在第五校验值与第六校验值不同的情况下,服务器可以接收电子设备发送的对第三功能包的更新请求,以向电子设备发送第三更新功能包。
第五校验值可以包括第三功能包的描述信息和第三功能包中安装文件的校验值。第三功能包的描述信息可以包括以下一项或多项:第三功能包的包名、第一免安装应用的名称、第三功能包的版本号。
第六校验值可以包括第三更新功能包的描述信息和第三更新功能包中安装文件的校验值。第三更新功能包的描述信息可以包括以下一项或多项:第三更新功能包的包名、第一免安装应用的名称、第三更新功能包的版本号。第三更新功能包的版本号与第三功能包的版本号不同。
应用服务器将第六校验值发送至电子设备,可以指应用服务器将第三更新功能包的包名和第三更新功能包中安装文件的校验值发送至电子设备。
第六校验值用于电子设备获取到第五校验值,可以指电子设备基于第三更新功能包的包名获取到第三功能包中安装文件的校验值。
第五校验值与第六校验值不同的,可以指第三更新功能包中安装文件的校验值和第三功能包中安装文件的校验值不同。
本申请提供了一种电子设备,其特征在于,电子设备包括处理器和存储器;存储器与处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,处理器调用计算机指令以电子设备执行上述图10或图11所示的一种免安装应用的升级方法。
本申请提供了一种计算机可读存储介质,其特征在于,用于存储计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行上述图10或图11所示的一种免安装应用的升级方法。
本申请提供了一种计算机程序产品,其特征在于,当计算机程序产品在电子设备上运行时,使得电子设备执行上述图10或图11所示的一种免安装应用的升级方法。
本申请的各实施方式可以任意进行组合,以实现不同的技术效果。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来 指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
以上所述仅为本发明技术方案的实施例,并非用于限定本发明的保护范围。凡根据本发明的揭露,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (15)

  1. 一种免安装应用的升级方法,其特征在于,所述方法包括:
    电子设备获取第一免安装应用的第一功能包和第二功能包,所述第一功能包包括第一描述信息和第一校验值,所述第二功能包包括第二描述信息和第二校验值;
    所述电子设备将所述第一描述信息和所述第一校验值,以及所述第二描述信息和所述第二校验值发送至应用服务器,所述第一描述信息用于所述应用服务器获取到第三校验值,所述第二描述信息用于所述应用服务器获取到第四校验值;
    在所述第三校验值和所述第一校验值相同,所述第四校验值与所述第二校验值不同的情况下,所述电子设备接收所述应用服务器发送的第二更新功能包;
    所述电子设备删除所述第二功能包,保存或者安装所述第二更新功能包。
  2. 根据权利要求1所述的方法,其特征在于,所述第一功能包的版本号和所述第二功能包的版本号相同或者不同;
    所述第一功能包的版本号与所述第二更新功能包的版本号不同。
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    在所述第三校验值和所述第一校验值不同,所述第四校验值与所述第二校验值相同的情况下,所述电子设备接收所述应用服务器发送的第一更新功能包;
    所述电子设备删除所述第一功能包,保存或者安装所述第一更新功能包。
  4. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    在所述第三校验值和所述第一校验值不同,所述第四校验值与所述第二校验值也不同的情况下,所述电子设备接收所述应用服务器发送的第一更新功能包和第二更新功能包;
    所述电子设备删除所述第一功能包和所述第二功能包,保存或者安装所述第一更新功能包和所述第二更新功能包。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述第一功能包还包括第一安装文件,所述第一校验值为所述第一安装文件的校验值;
    所述第二功能包还包括第二安装文件,所述第二校验值为所述第二安装文件的校验值。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,在所述电子设备接收所述应用服务器发送的第二更新功能包之前,所述方法还包括:
    所述电子设备接收所述应用服务器发送的第一消息;
    所述电子设备接收所述应用服务器发送的第二更新功能包,具体包括:
    响应于所述第一消息,所述电子设备将所述第二描述信息发送至所述应用服务器,所述第二描述信息用于所述应用服务器获取到所述第二更新功能包;
    所述电子设备接收所述应用服务器发送的第二更新功能包。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,在所述电子设备将所述第一描述信息和所述第一校验值,以及所述第二描述信息和所述第二校验值发送至应用服务器之前,所述方法还包括:
    所述电子设备接收第一操作;
    响应所述第一操作,所述电子设备运行所述第二功能包。
  8. 根据权利要求7所述的方法,其特征在于,所述电子设备删除所述第二功能包,具体包括:
    在所述电子设备停止运行所述第二功能包后,所述电子设备删除所述第二功能包。
  9. 根据权利要求1-8任一项所述的方法,其特征在于,所述方法还包括:
    所述电子设备获取所述第一免安装应用的第三功能包,所述第三功能包包括第三描述信息和第五校验值;
    所述电子设备接收所述应用服务器发送的所述第三描述信息和第六校验值;
    在所述第五校验值与所述第六校验值不同的情况下,所述电子设备接收所述应用服务器发送的第三更新功能包;
    所述电子设备删除所述第三功能包,保存或者安装所述第三更新功能包。
  10. 一种免安装应用的升级方法,其特征在于,应用于应用服务器,所述方法包括:
    所述应用服务器接收电子设备发送的第一校验值和第二校验值;所述第一校验值用于校验第一免安装应用的第一功能包,所述第二校验值用于校验所述第一免安装应用的第二功能包;
    所述应用服务器根据所述第一校验值获取第三校验值,以及根据所述第二校验值获取第四校验值;
    在所述第三校验值和所述第一校验值相同,所述第四校验值和所述第二校验值不同的情况下,所述应用服务器向所述电子设备发送第二更新功能包。
  11. 根据权利要求10所述的方法,其特征在于,所述第一功能包的版本号和所述第二功能包的版本号相同或者不同;
    所述第一功能包的版本号与所述第二更新功能包的版本号不同。
  12. 根据权利要求10或11所述的方法,其特征在于,所述方法还包括:
    所述应用服务器将第三更新功能包的第六校验值发送至所述电子设备,所述第六校验值用于所述电子设备校验免安装应用的第三功能包;
    在所述第三功能包的第五校验值与所述第三更新功能包的第六校验值不同的情况下,所述服务器将所述第三更新功能包发送至所述电子设备。
  13. 一种电子设备,其特征在于,所述电子设备包括处理器和存储器;所述存储器与所述处理器耦合,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,所述处理器调用所述计算机指令以所述电子设备执行上述权利要求1-9中任一项所述的方法。
  14. 一种计算机可读存储介质,其特征在于,用于存储计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行上述权利要求1-9中任一项所述的方法。
  15. 一种计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行上述权利要求1-9中任一项所述的方法。
PCT/CN2023/140157 2022-12-22 2023-12-20 免安装应用的升级方法及电子设备 WO2024131823A1 (zh)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211656834.9 2022-12-22

Publications (1)

Publication Number Publication Date
WO2024131823A1 true WO2024131823A1 (zh) 2024-06-27

Family

ID=

Similar Documents

Publication Publication Date Title
CN110633090B (zh) 补丁方法、相关装置及***
US20230021994A1 (en) Cross-Device Content Projection Method and Electronic Device
WO2021159746A1 (zh) 文件共享方法、***及相关设备
WO2021052204A1 (zh) 基于通讯录的设备发现方法、音视频通信方法及电子设备
CN113704205B (zh) 日志存储的方法、芯片、电子设备和可读存储介质
CN113568634B (zh) 应用优化的处理方法及处理装置
CN114124980B (zh) 一种启动应用的方法、设备、***、终端及存储介质
CN112860445B (zh) 一种快应用与原生应用间数据共享的方法及终端
WO2021073337A1 (zh) 安装插件的方法、装置和存储介质
CN113821767A (zh) 应用程序的权限管理方法、装置和电子设备
CN115309431B (zh) 一种参数更新方法、可读介质和电子设备
CN114553814A (zh) 处理推送消息的方法和装置
CN115438354A (zh) 一种用户隐私保护方法及装置
CN113703894A (zh) 通知消息的显示方法和显示装置
CN113608753A (zh) 应用卸载方法、应用恢复方法、电子设备以及存储介质
WO2022228180A1 (zh) 一种应用的管理方法和电子设备
WO2022111664A1 (zh) 打补丁的方法、相关设备及***
CN113485709B (zh) 应用优化方法、装置以及电子设备
WO2021238376A1 (zh) 功能包的加载方法、装置、服务器和电子设备
CN117348894A (zh) 一种软件升级方法、终端设备及***
WO2024131823A1 (zh) 免安装应用的升级方法及电子设备
CN113467821A (zh) 应用程序的修复方法、装置、设备及可读存储介质
CN114546969A (zh) 一种文件共享方法、装置及电子设备
CN117009023B (zh) 显示通知信息的方法及相关装置
WO2024104137A1 (zh) 一种支持数据融合的数据恢复方法及装置