Upgrade package installation method, electronic equipment, chip system and storage medium

By reserving storage space in OTA upgrades and creating download files and installation files, the problem of insufficient storage space for upgrade package download and installation is solved, and a fast and successful upgrade process is achieved.

CN119652750AActive Publication Date: 2025-03-18HONOR DEVICE CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411515154.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-03-18
Estimated Expiration
2044-10-28

AI Technical Summary

Technical Problem

In the OTA upgrade scenario, the download of the upgrade package takes up time and the user operations occupy storage space, resulting in the installation of the upgrade package being unable to be completed, affecting the upgrade speed and success rate.

Method used

Before downloading and installing the upgrade package, reserve the required storage space and ensure that there is enough storage space for downloading and installing the upgrade package by creating download and installing the download and installation files.

Benefits of technology

Ensure the successful download and installation of the upgrade package, quickly complete the upgrade, and avoid interruptions in the upgrade process caused by insufficient storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652750A_ABST
    Figure CN119652750A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an upgrade package installation method, electronic equipment, a chip system and a storage medium. The method comprises the following steps: determining a first byte number of an upgrade package and a second byte number of a storage space required for installing the upgrade package; under the condition that the byte number of the current available storage space is greater than or equal to the sum of the first byte number and the second byte number, creating a download file occupying the storage space of the first byte number, and creating an installation file occupying the storage space of the second byte number; downloading the upgrade package to the download file from the server; and in response to installation triggering of the upgrade package, deleting the installation file and releasing the storage space occupied by the installation file, and based on the available storage space after the storage space is released, installing the upgrade package. By adopting the method and the device, the storage space required for downloading and installing the upgrade package can be reserved, so that the enough storage space is available for downloading and installing the upgrade package in the upgrade process, and the upgrade is quickly and timely completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to an upgrade package installation method, an electronic device, a chip system and a storage medium. Background Art

[0002] OTA (Over The Air) refers to the technology of updating device software or firmware through wireless communication. OTA is widely used in many fields such as automobiles, smartphones, and IoT devices, allowing devices to upgrade software without directly connecting to a computer.

[0003] In the OTA upgrade scenario, the upgrade package is usually large and takes a long time to download. During the upgrade package download process, the user may be performing operations such as downloading videos, downloading files, taking photos, and recording videos. These operations will take up the storage space of the electronic device, which may result in insufficient storage space required for the upgrade, and the upgrade package download or installation cannot be completed, which will cause the upgrade process to be interrupted and affect the upgrade speed. If the user has not cleared enough storage space on the electronic device, the upgrade cannot be completed. Summary of the invention

[0004] The embodiments of the present application provide an upgrade package installation method, an electronic device, a chip system and a storage medium, which can reserve the storage space required for downloading and installing the upgrade package. During the upgrade process, the upgrade package is downloaded based on the reserved download space, and the upgrade package is installed based on the available storage space of the electronic device after the reserved installation space is released. In this way, there is enough storage space to successfully download the upgrade package and successfully install the upgrade package, thereby completing the upgrade quickly and timely.

[0005] In a first aspect, an embodiment of the present application provides an upgrade package installation method that can be applied to an electronic device, the method comprising: before downloading the upgrade package, determining a first byte number of the upgrade package, and determining a second byte number of storage space required to install the upgrade package; the sum of the first byte number and the second byte number can be used to indicate the size of the storage space required for this upgrade; in response to the number of bytes of the current available storage space of the electronic device being greater than or equal to the sum of the bytes, creating a download file that occupies the first byte number of storage space, and creating an installation file that occupies the second byte number of storage space; downloading the upgrade package from a server to the download file; after the upgrade package is downloaded, in response to a trigger for the installation of the upgrade package, deleting the installation file and releasing the storage space occupied by the installation file, and installing the upgrade package based on the available storage space of the electronic device after the storage space is released.

[0006] It can be seen that in this technical solution, before downloading the upgrade package, a download file is created to reserve the storage space required for downloading the upgrade package, and an installation file is created to reserve the storage space required for installing the upgrade package; during the upgrade process, the upgrade package is downloaded to the created download file, which can ensure that there is sufficient storage space for downloading the upgrade package, thereby successfully downloading the upgrade package, deleting the created installation file and releasing the storage space occupied by the installation file, which can ensure that the available storage space of the electronic device after the storage space is released is sufficient for installing the upgrade package, so that the upgrade package can be installed successfully based on the available storage space of the electronic device after the storage space is released, thereby completing the upgrade quickly and timely.

[0007] In combination with the first aspect, in a possible manner, the method of creating a download file may be: determining the download path of the upgrade package; creating the download file under the download path of the upgrade package, and setting the storage space occupied by the download file to the first number of bytes. It can be seen that the download file is created under the download path of the upgrade package, so that during the upgrade process, the upgrade package can be quickly downloaded to the download file according to the download path of the upgrade package, and this can save storage space. If the download file is not under the download path of the upgrade package, it is necessary to download the upgrade package according to the download path of the upgrade package and copy the upgrade package to the download file, which will occupy more storage space and cause a waste of storage space.

[0008] Combined with the first aspect, in a possible way, the way to create the installation file can be: create an installation file with a file attribute of a temporary file, and set the installation file to occupy the second byte of storage space. It can be seen that the file attribute of the installation file is a temporary file. Since there are many files (or data) after the upgrade package is decompressed, each file has a different path. If the same solution is used as for downloading, it is necessary to know the installation path where each file is located, which is currently difficult or even impossible to achieve. Based on this, an installation file with a file attribute of a temporary file is used to first occupy the storage space of the size required for the installation of the upgrade package (i.e., the second byte). This can prevent the problem that after the upgrade package is downloaded, the available storage space of the electronic device is insufficient to complete the installation of the upgrade package, and then the upgrade cannot be completed; and the temporary file is easy to delete and does not affect the operation of the device after deletion. In this way, the installation file can be quickly deleted during the upgrade process to release the storage space occupied by the installation file, thereby ensuring that the electronic device has enough storage space for the installation of the upgrade package.

[0009] In combination with the first aspect, in a possible manner, the method further includes: sending a file request to a server, the file request being used to request a detailed information file of an upgrade package; receiving the detailed information file of the upgrade package returned by the server; wherein the manner of determining the first byte number of the upgrade package and the second byte number of the storage space required for installing the upgrade package may be: parsing the detailed information file of the upgrade package to obtain the first byte number of the upgrade package and the second byte number of the storage space required for installing the upgrade package. It can be seen that by obtaining the detailed information file of the upgrade package from the server and parsing the detailed information file, the first byte number of the upgrade package and the second byte number of the storage space required for installing the upgrade package can be quickly obtained.

[0010] In combination with the first aspect, in a possible manner, the method further includes: in response to the triggering of the upgrade check, sending a package search request to the server, the package search request being used to request a search for whether there is an upgrade package; receiving a package search result returned by the server; in response to the package search result indicating that there is an upgrade package, executing the step of sending a file request to the server. It can be seen that before sending the file request to the server, a check will be made to see whether there is an upgrade package, which can avoid some useless operations and reduce the waste of resources.

[0011] In combination with the first aspect, in a possible manner, the method further includes: when the automatic storage space cleaning function is turned on, in response to the third byte number being less than the sum of the first byte number and the second byte number, based on the first byte number, the second byte number and the third byte number, cleaning up the cleanable data in the storage space of the electronic device. It can be seen that when the available storage space of the electronic device is insufficient for upgrading and the user turns on the automatic storage space cleaning function, the cleanable data in the storage space of the electronic device can be automatically cleaned up, which can quickly complete the cleaning of the storage space, speed up the upgrade, improve the upgrade efficiency, and reduce the user's manual cleaning operations, thereby improving the user experience.

[0012] In combination with the first aspect, in a possible manner, the method further includes: in response to the third byte number being less than the sum of the first byte number and the second byte number, displaying a message pop-up box; the message pop-up box includes a first prompt message and a second prompt message, the first prompt message is used to prompt that the storage space is insufficient, and the second prompt message is used to prompt the number of bytes of the storage space that needs to be cleared. It can be seen that when the available storage space of the electronic device is insufficient for upgrading, a message pop-up box can be displayed to prompt the user to clean up the storage space, thereby ensuring that the upgrade is completed in time.

[0013] In conjunction with the first aspect, in one possible manner, the method further includes: in response to the upgrade package being installed, deleting the downloaded file and releasing the storage space occupied by the downloaded file. It can be seen that after the upgrade package is installed, the downloaded file will be deleted in time to release the storage space occupied by the downloaded file, thereby increasing the available storage space of the electronic device.

[0014] In a second aspect, the present application provides an electronic device, which includes: one or more processors, a memory and a communication interface; the communication interface is used to exchange information with other devices, the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute: determine a first byte number of an upgrade package and a second byte number of storage space required to install the upgrade package; in response to a third byte number being greater than or equal to the sum of the first byte number and the second byte number, create a download file and an installation file; the third byte number is the number of bytes of the current available storage space of the electronic device, the download file occupies the first byte number of storage space, and the installation file occupies the second byte number of storage space; download the upgrade package from a server to the download file; in response to a trigger for the installation of the upgrade package, delete the installation file and release the storage space occupied by the installation file; based on the available storage space of the electronic device after the storage space is released, install the upgrade package.

[0015] In combination with the second aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: determine a download path for the upgrade package; create a download file under the download path for the upgrade package, and set the download file to occupy a first number of bytes of storage space.

[0016] In combination with the second aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: creating an installation file with a file attribute of a temporary file, and setting the installation file to occupy a second number of bytes of storage space.

[0017] In combination with the second aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: sending a file request to the server, the file request is used to request a detailed information file of the upgrade package; receiving the detailed information file of the upgrade package returned by the server; parsing the detailed information file of the upgrade package to obtain the first byte number of the upgrade package and the second byte number of the storage space required to install the upgrade package.

[0018] In combination with the second aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: in response to the triggering of an upgrade check, sending a package search request to the server, the package search request being used to request a search for whether an upgrade package exists; receiving the package search results returned by the server; and in response to the package search results indicating the existence of an upgrade package, executing the step of sending a file request to the server.

[0019] In combination with the second aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: when the automatic storage space cleaning function is turned on, in response to the third byte number being less than the sum of the first byte number and the second byte number, based on the first byte number, the second byte number and the third byte number, clean up the cleanable data in the storage space of the electronic device.

[0020] In combination with the second aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: in response to the third byte number being less than the sum of the first byte number and the second byte number, displaying a message pop-up box; the message pop-up box includes a first prompt message and a second prompt message, the first prompt message is used to prompt that the storage space is insufficient, and the second prompt message is used to prompt the number of bytes of storage space that needs to be cleared.

[0021] In combination with the second aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: in response to completion of the installation of the upgrade package, delete the downloaded file and release the storage space occupied by the downloaded file.

[0022] In a third aspect, the present application provides a chip system, which includes one or more processors, a memory and an interface circuit, wherein the memory, the interface circuit and one or more processors are interconnected by lines, and program instructions are stored in the memory; when the program instructions are executed by the processor, the chip system implements the method described in the first aspect above.

[0023] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method described in the first aspect above.

[0024] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to implement the method described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1A and Figure 1B A schematic diagram of the architecture of a communication system exemplarily provided in an embodiment of the present application;

[0026] Figure 2A-2D A schematic diagram of an interface for manually triggering an upgrade check provided as an example in an embodiment of the present application;

[0027] Figure 3 A flowchart of an upgrade package installation method exemplarily provided in an embodiment of the present application;

[0028] Figure 4A and Figure 4B A schematic diagram of an interface for displaying prompt information on a user interface provided as an example in an embodiment of the present application;

[0029] Figure 5A and Figure 5B Another schematic diagram of an interface for displaying prompt information on a user interface provided as an example in an embodiment of the present application;

[0030] Figure 6 A flowchart of another upgrade package installation method provided as an example in an embodiment of the present application;

[0031] Figure 7 A schematic diagram of the software structure of an electronic device exemplarily provided in an embodiment of the present application;

[0032] Figure 8 The present invention provides a hardware structure diagram of an electronic device exemplarily provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0034] The terms "first", "second", "third", etc. in the embodiments of the present application are distinguished from different objects, rather than being used to describe a specific order. In addition, the terms "include" and "have" and any variation thereof are intended to cover non-exclusive inclusions. For example, a series of steps or units are included, or alternatively, steps or units not listed are also included, or other steps or units inherent to these processes, methods, products or devices are optionally included. The terms "one embodiment" or "some embodiments", etc. mean that the specific features, structures or characteristics described in conjunction with the embodiment are included in one or more embodiments of the present application. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in the differences in the embodiments of the present application are not necessarily all with reference to the same embodiment, but mean "one or more but not all embodiments", unless otherwise particularly emphasized.

[0035] In the embodiments of the present application, words such as "exemplary", "for example", or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary", "for example", or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example", or "for example" is intended to present related concepts in a specific way.

[0036] In addition, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can mean: a, or b, or c, or a and b, or a and c, or b and c, or a, b and c, where a, b, c can be single or multiple.

[0037] The term "upgrade package" in the following embodiments of this application is an installation file used to enhance software or system functions, fix vulnerabilities, and improve performance. An upgrade package is usually a compressed file that contains a series of files and data used to update the software or system. In the field of smartphones, upgrade packages are often presented as an update.zip file. The main purpose of the upgrade package is to enhance the user experience by adding new features or fixing known problems without replacing the existing system or software, including the application of security patches, performance optimization, and the addition of new features. In the operating system, the upgrade package is used to upgrade from the old version to the new version, such as the OTA upgrade in the Android system, which can receive and install the upgrade package via the wireless network to obtain the latest system functions and security updates. In general, the upgrade package is an indispensable part of software and system maintenance, which can help users stay up to date and enjoy a better product experience and service.

[0038] Temporary files can refer to a type of file generated during the operation of a computer and used to store intermediate states or short-term data. Short-term data can be temporary data during the installation or update of software. These temporary data may include decompressed data, installation scripts, log information, etc. They play an auxiliary role in the installation process to ensure the smooth installation. Temporary files usually have suffixes such as ".tmp" and ".temp". The life cycle of temporary files is usually short and they will be deleted once their function is completed.

[0039] The user interface (UI) is a medium interface for interaction and information exchange between applications or operating systems and users. It realizes the conversion between the internal form of information and the form acceptable to users. The user interface is the source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on the electronic device and finally presented as content that the user can recognize. The commonly used form of user interface is the graphical user interface (GUI), which refers to the user interface related to computer operation displayed in a graphical way. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.

[0040] OTA upgrade is a method of remotely updating device firmware or software through wireless communication technology. OTA upgrade enables devices to automatically, reliably and securely obtain and apply updates from remote servers to improve device performance, add new features or fix security vulnerabilities. It can be used in the following application scenarios:

[0041] Smartphones and tablets: System updates and application updates are usually pushed via OTA.

[0042] IoT devices: such as smart home devices, sensor nodes, etc., can achieve remote firmware updates via OTA.

[0043] Automotive: OTA updates can be used to remotely update the software of the vehicle's infotainment and driver assistance systems.

[0044] Embedded Systems: Various embedded devices such as smart watches, fitness trackers, etc., use OTA updates to enhance functionality and improve user interfaces.

[0045] During the OTA upgrade process, users may be performing operations such as downloading videos, downloading files, taking photos, and recording videos. These operations will take up the storage space of the electronic device, which may lead to insufficient storage space required for the upgrade. The download and / or installation of the upgrade package will be suspended, resulting in the upgrade being unable to be completed in a timely manner.

[0046] Based on this, the upgrade package installation method provided in the embodiment of the present application can be applied to the scenario of OTA upgrade of electronic devices (such as smart phones). The upgrade package installation method provided in the embodiment of the present application can reserve the storage space required for downloading and installing the upgrade package, and during the upgrade process, the upgrade package is downloaded based on the reserved download space, and the upgrade package is installed based on the available storage space of the electronic device after the reserved installation space is released, so that there is enough storage space to successfully download the upgrade package and successfully install the upgrade package, thereby completing the upgrade quickly and in time.

[0047] It is understandable that "upgrade package installation" may also be referred to as "software or firmware update", "software or firmware upgrade", "version update", "version upgrade" and other terms, which are not limited to the embodiments of the present application.

[0048] First, the system architecture involved in this application is explained.

[0049] The upgrade package installation method provided in the embodiment of the present application can be applied to Figure 1A The system architecture shown. Figure 1A The system shown may include, but is not limited to: an electronic device 11 and a server 12, wherein the electronic device 11 and the server 12 are connected via a network. Figure 1A The number and form of the devices are used for example only and do not constitute a limitation on the embodiments of the present application. Figure 1A The electronic device 11 in the example is a smart phone. In a possible embodiment, the electronic device 11 may also be Figure 1BThe terminal devices that can perform OTA upgrades include, but are not limited to, tablets, smart TVs, computers, smart bracelets, vehicles (or vehicle-mounted terminals), etc. The server 12 can provide OTA upgrade services for the electronic device 11. In one possible manner, the server 12 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, and other services.

[0050] The following uses a smart phone as an example to illustrate the application scenarios of the embodiments of the present application.

[0051] like Figure 2A As shown, the electronic device can display the interface of the home screen, which includes multiple application icons, such as a live application icon, a gallery application icon, a weather application icon, a stock application icon, a calculator application icon, a settings application icon 21, an email application icon, a Facebook application icon, a browser application icon, a music application icon, a video application icon, an application store icon, etc. A page indicator is also included below the multiple application icons to indicate the positional relationship between the currently displayed page and other pages. The electronic device can detect a user's selection operation 22 (such as a click operation) for the settings application icon 21. In response to the selection operation 22, the electronic device can display Figure 2B The Settings app user interface is shown.

[0052] like Figure 2B As shown, the user interface of the settings application includes multiple interface objects, such as a search box, a "Users and Accounts" option, a "System and Updates" option 23, an "About Phone" option, etc. The electronic device can detect a user's selection operation 24 (such as a click operation) for the "System and Updates" option 23, and in response to the selection operation 24, the electronic device can display Figure 2C The system and update interface shown. Figure 2C As shown, the system and update interface includes multiple interface objects, such as a "software update" option 25, a "language and input method" option, a "date and time" option, a "user experience improvement plan" option, etc. The electronic device can detect a user's selection operation 26 (such as a click operation) for the "software update" option 25. In response to the selection operation 26, the electronic device can display Figure 2D The update interface shown.

[0053] like Figure 2DAs shown, the update interface displays the system information of the electronic device, and the system information may include the name and current version information of the operating system, and the update interface also includes a "check update" control 27. The electronic device can detect the user's trigger operation 28 (such as a click operation) for the "check update" control 27. In response to the trigger operation 28, the electronic device can execute the upgrade package installation method provided in the embodiment of the present application, including but not limited to the following steps: the electronic device sends a package search request to the server, and the package search request is used to request to search whether there is an upgrade package of the current version; the electronic device responds to the package search result returned by the server indicating that there is an upgrade package, determines the first byte number of the upgrade package, and the second byte number of the storage space required to install the upgrade package, and creates a download file occupying the first byte number of storage space when the number of bytes of the currently available storage space of the electronic device is greater than or equal to the sum of the first byte number and the second byte number, and creates an installation file occupying the second byte number of storage space; the electronic device downloads the upgrade package from the server to the download file, and after the upgrade package is downloaded, in response to the installation trigger of the upgrade package, deletes the installation file and releases the storage space occupied by the installation file, and installs the upgrade package based on the available storage space of the electronic device after the storage space is released. This way, there will be enough storage space to successfully download the upgrade package and successfully install the upgrade package, so that the upgrade can be completed quickly and in a timely manner.

[0054] The above is an introduction to the application scenario of manually triggering the upgrade and update by the user. The embodiments of the present application can also be applied to the application scenario of automatically triggering the upgrade and update. For example, the electronic device can send a package search request to the server at a preset time interval (for example, periodically), and the package search request is used to request a search for whether there is an upgrade package of the current version; the electronic device responds to the package search result returned by the server indicating the existence of the upgrade package, and executes the upgrade package installation method provided by the embodiment of the present application to upgrade. In addition, the embodiments of the present application can also be applied to the application scenario of voice-triggered upgrade and update, etc.

[0055] The following is a detailed description of the upgrade package installation method provided in the embodiment of this application. Figure 3 , Figure 3 A flowchart of an upgrade package installation method provided in an embodiment of the present application, the method may include but is not limited to the following steps:

[0056] S301, the electronic device sends a packet search request to the server in response to the triggering of the upgrade check.

[0057] In the embodiment of the present application, the package search request is used to request to search whether there is an upgrade package of the system software or system firmware of the currently installed version of the electronic device. The upgrade package can be used to upgrade the parameters, resources, accessories, etc. of the electronic device system.

[0058] In some embodiments, the electronic device may display an update interface according to the user's operation, and the update interface may include a "check for updates" control. Figure 2A-2D The introduction of "Check for Updates" is not repeated here. The electronic device may determine that the user has manually triggered the upgrade check when detecting the user's trigger operation (such as a click operation) on the "Check for Updates" control, and send a package search request to the server in response to the triggering of the upgrade check. The display position, text content, form, and other features of "Check for Updates" are not limited in this embodiment of the application.

[0059] In some embodiments, the electronic device may determine that an upgrade check is automatically triggered when it is determined that an upgrade check is to be performed at the current time according to a preset time interval, and send a packet search request to the server in response to the triggering of the upgrade check. For example, if the last upgrade check was on October 1, and the preset time interval is 15 days, if the current time is October 16, then the upgrade check will be automatically triggered on October 16.

[0060] In some embodiments, the electronic device may collect the user's voice instructions, and when a voice instruction for instructing an upgrade or an upgrade check is collected, it is determined that the user's voice has triggered the upgrade check, and in response to the triggering of the upgrade check, a packet search request is sent to the server. The voice instructions for instructing an upgrade check may be, for example: "software update", "system upgrade", "update check", "upgrade check", "software update check", "system upgrade check", "check whether there is an upgraded version", etc.

[0061] S302: The server performs an upgrade package search process in response to the package search request to obtain a package search result.

[0062] In the embodiment of the present application, in response to the package search request, the server searches the stored system software or system firmware upgrade packages to see whether there is an upgrade package of the system software or system firmware of the currently installed version of the electronic device, and obtains a package search result. The package search result may include indication information for indicating whether there is an upgrade package.

[0063] In some embodiments, the version information (e.g., version number) of the stored upgrade package and the version information (e.g., version number) of the currently installed version of the electronic device can be compared to determine whether the upgrade package exists. Optionally, the server can obtain the version information of the currently installed version of the electronic device from the historical upgrade record of the electronic device. Optionally, the search request sent by the electronic device to the server can carry the version information of the currently installed version of the electronic device, and the server can obtain the version information of the currently installed version of the electronic device from the search request.

[0064] S303, the server returns the packet search result to the electronic device.

[0065] Correspondingly, the electronic device receives the packet search result returned by the server.

[0066] S304: In response to the package search result indicating that an upgrade package exists, the electronic device determines a first byte number of the upgrade package and a second byte number of storage space required to install the upgrade package.

[0067] In the embodiment of the present application, the first byte number may refer to the size of the storage space required to save the upgrade package, and the second byte number may refer to the size of the storage space required to install the upgrade package.

[0068] In some embodiments, in response to the search result indicating the existence of an upgrade package, the electronic device sends a file request to the server, and the file request is used to request a detailed information file of the upgrade package. In response to the file request, the server queries or generates a detailed information file of the upgrade package, and returns the detailed information file of the upgrade package to the electronic device. Optionally, the detailed information file can be a filelist file of the upgrade package, and the filelist file of the upgrade package can be a text file containing a list of files and directories to be upgraded, which can be used to guide the update operation during the software or firmware upgrade process. The electronic device receives the detailed information file of the upgrade package returned by the server, performs file parsing processing on the detailed information file of the upgrade package, and obtains the first byte number of the upgrade package and the second byte number of the storage space required to install the upgrade package.

[0069] In some embodiments, the search request sent by the electronic device to the server in step S301, in addition to requesting to search whether there is an upgrade package of the system software or system firmware of the currently installed version of the electronic device, can also be used to request to return the detailed information file of the upgrade package when the upgrade package exists. In this way, in step S302, the server responds to the search request to search whether there is an upgrade package of the system software or system firmware of the currently installed version of the electronic device, and in the case of the existence of the upgrade package, inquires or generates the detailed information file of the upgrade package. In this way, the search result returned by the server to the electronic device in step S303 includes, in addition to the indication information for indicating the existence of the upgrade package, the detailed information file of the upgrade package. In this way, the electronic device does not need to send a file request to the server to obtain the detailed information file of the upgrade package when the search result indicates the existence of the upgrade package. The detailed information file of the upgrade package included in the search result returned by the server can be directly parsed to obtain the first byte number of the upgrade package and the second byte number of the storage space required to install the upgrade package. This method can save the interaction process between the electronic device and the server, thereby saving time and communication resources.

[0070] In some embodiments, when the search result indicates that there is no upgrade package, the electronic device can display a prompt message on the user interface or notification bar, and the prompt message is used to prompt that there is no upgrade package. For example, the prompt message can be displayed on the update interface, such as Figure 4A As shown in 41 in the figure, a prompt message "It is the latest version" is displayed on the update interface. For another example, when the electronic device is not currently displaying the update interface but displaying other user interfaces, a pop-up box can be displayed in the other user interfaces, and the prompt message can be displayed in the pop-up box, such as Figure 4B As shown, the electronic device currently displays the "mailbox interface", then a pop-up box 42 can be displayed in the "mailbox interface", and a prompt message "no new version exists" can be displayed in the pop-up box 42. After the electronic device displays the prompt message, the process can be directly ended.

[0071] In some embodiments, when there are multiple versions of upgrade packages relative to the currently installed version of the system software or system firmware of the electronic device, the upgrade package of the current highest version can be processed so that the system software or firmware of the electronic device can be upgraded to the current highest version.

[0072] S305: In response to the third byte number being greater than or equal to the sum of the first byte number and the second byte number, the electronic device creates a download file and an installation file.

[0073] In an embodiment of the present application, the third byte number is the number of bytes of the currently available storage space of the electronic device, that is, the size of the currently available storage space of the electronic device; the created download file can be set to occupy the first byte number of storage space of the electronic device to reserve the storage space of the size required for downloading the upgrade package; the created installation file can be set to occupy the second byte number of storage space of the electronic device to reserve the storage space of the size required for installing the upgrade package.

[0074] The electronic device determines the sum of the first byte number and the second byte number, which can be used to indicate the total size of the storage space required for this upgrade, detects the size relationship between the third byte number of the current available storage space of the electronic device and the sum of the byte numbers, and when the third byte number is greater than or equal to the sum of the byte numbers, that is, when the current available storage space of the electronic device can meet the needs of this upgrade, creates a download file occupying the first byte number of storage space, and creates an installation file occupying the second byte number of storage space.

[0075] In some embodiments, the method for creating a download file may be: determining the download path of the upgrade package, the download path of the upgrade package may refer to the save path of the upgrade package on the electronic device, the save path may be the system default path, or it may be a path set by the user; creating a download file under the download path of the upgrade package, and setting the download file to occupy the first number of bytes of storage space.

[0076] In one possible way, the download file created under the download path of the upgrade package can be named according to the file name of the upgrade package returned by the server. For example: if the file name of the upgrade package is "ota_update.zip", a download file of the upgrade package to be downloaded can be created under the download path " / data / update", and the file name of the download file can be "ota_update.zip", so the path of the download file is " / data / update / ota_update.zip". Optionally, the file name of the upgrade package can be obtained by the electronic device from the detailed information file of the upgrade package, or when the upgrade package exists, the server returns the file name of the upgrade package to the electronic device in the search result, and the electronic device obtains the file name of the upgrade package from the search result.

[0077] In a possible manner, the first number of bytes of storage space occupied by the downloaded file in the electronic device can be set based on the first code. The first code is as follows:

[0078] "RandomAccessFilerandomAccessFile=new RandomAccessFile(" / data / update /

[0079] ota_update.zip","rw");

[0080] randomAccessFile.setLength("fileliset.getBytesize());

[0081] randomAccessFile.close();"

[0082] The download file is created under the download path of the upgrade package, and the download file is named according to the file name of the upgrade package. In this way, during the upgrade process, the upgrade package can be quickly downloaded to the download file according to the download path of the upgrade package and the name of the download file, and this can save storage space. If the download file is not under the download path of the upgrade package, you may need to download the upgrade package according to the download path of the upgrade package and copy the upgrade package to the download file. This will take up more storage space and cause a waste of storage space.

[0083] In some embodiments, the installation file may be created by: creating an installation file with a temporary file attribute, and setting the installation file to occupy a second number of bytes of storage space. Optionally, the installation file may have a temporary file suffix such as ".temp" or ".tmp".

[0084] In one possible way, the installation file may be created in the download path of the upgrade package. For example, in the download path of the upgrade package " / data / update", an installation file named "install.temp" with the attribute of a temporary file is created, so that the path of the installation file is " / data / update / install.temp".

[0085] In a possible manner, the installation file can be set to occupy a second byte of storage space of the electronic device based on the second code. The second code is as follows:

[0086] "RandomAccessFileInstallrandomAccessFile=new RandomAccessFile(" / data / update /

[0087] Install.temp","rw");

[0088] InstallrandomAccessFile.setLength("fileliset.getInstallNeedsize());

[0089] InstallrandomAccessFile.close();”

[0090] The reason why an installation file (such as install.temp file) with a file attribute of a temporary file is used to occupy the storage space required for the installation of the upgrade package is, on the one hand, because there are many files (or data) after the upgrade package is decompressed, and the paths of each file are different. If the same solution is used for downloading, it is necessary to know the installation path of each file, which is currently difficult or even impossible to achieve. On the other hand, the size of the storage space required for the installation of the upgrade package is not the size of the storage space occupied after the upgrade package is decompressed. Temporary files (or temporary data) will be generated during the installation of the upgrade package. The storage space required for installation will be larger than the storage space occupied after the upgrade package is decompressed. Therefore, the file size cannot be used to occupy the storage space required for the installation of the upgrade package. Based on this, the embodiment of the present application uses an installation file (such as install.temp file) with a file attribute of a temporary file to first occupy the storage space required for the installation of the upgrade package (i.e., the second number of bytes). This can prevent the problem that after the upgrade package is downloaded, the available storage space of the electronic device is insufficient to complete the installation of the upgrade package, and then the upgrade cannot be completed.

[0091] In addition, the file attribute of the installation file is a temporary file. Temporary files are easy to delete and do not affect device operation after deletion. In this way, the installation file can be quickly deleted during the upgrade process to free up the storage space occupied by the installation file, thereby ensuring that the electronic device has sufficient storage space for installing the upgrade package.

[0092] S306, the electronic device sends an upgrade package download request to the server. The upgrade package download request is used to request to download the upgrade package from the server.

[0093] S307: The server sends the upgrade package to the electronic device in response to the upgrade package download request.

[0094] Optionally, the server sends the upgrade package to the electronic device in the form of a compressed package, which can speed up the downloading speed of the compressed package and save the storage space occupied by the compressed package.

[0095] S308, the electronic device receives the upgrade package sent by the server, and saves the upgrade package to the download file.

[0096] The download file is pre-created to occupy the storage space required for downloading the upgrade package, and the upgrade package is saved in the download file, so that sufficient storage space can be guaranteed to save the downloaded upgrade package, thereby successfully downloading the upgrade package. The electronic device downloads the upgrade package from the server to the download file, which can be to continuously receive the data of the upgrade package sent by the server, and continuously write the received data of the upgrade package to the download file.

[0097] In a possible manner, the electronic device may write the data of the upgrade package into the download file based on the third code. The third code is as follows:

[0098] "intbytesRead = 0;

[0099] Private byte[]mRead=new byte[BUFFER_SIZE];

[0100] RandomAccessFilemRandomAccessFile=new RandomAccessFile(" / data / update /

[0101] ota_update.zip","rw");

[0102] do{

[0103] bytesRead=mlnputStream.read(mRead);

[0104] mRandomAccessFile.write(mRead,0,bytesRead);

[0105] }while(bytesRead>-1)"

[0106] In some embodiments, after the electronic device downloads the upgrade package from the server, the upgrade package may be verified, including but not limited to verifying one or more of the dimensions of the source, security, integrity, etc. of the upgrade package. If the upgrade package passes the verification, the processing described in subsequent steps S309 and S310 may be performed to complete the installation of the upgrade package.

[0107] Optionally, when the upgrade package verification fails, the electronic device may display a prompt message in the user interface or notification bar, and the prompt message is used to prompt "upgrade package verification failed". For example, the content of the prompt message may be "upgrade package security verification failed", "upgrade package integrity verification failed", etc. The electronic device may also delete the upgrade package in the downloaded file and obtain other available upgrade packages from the server again. For example: the current version number of the system software or system firmware of the electronic device is 7.0.1.0, and the server includes two upgrade packages with version numbers 7.0.2.0 and 7.0.3.0. The above processing is performed on the upgrade package with version number 7.0.3.0 first. When the upgrade package with version number 7.0.3.0 fails to pass the verification, the above processing can be performed on the upgrade package with version number 7.0.2.0. When the upgrade package with version number 7.0.2.0 fails to pass the verification, the processing described in subsequent steps S309 and S310 can be performed on the upgrade package with version number 7.0.2.0 to complete the installation of the upgrade package with version number 7.0.2.0. In this way, even if the highest version of the upgrade package is not available, the system software or system firmware of the electronic device can be upgraded to a higher version, which is conducive to improving the user experience after the upgrade.

[0108] S309: In response to the installation trigger of the upgrade package, the electronic device deletes the installation file and releases the storage space occupied by the installation file.

[0109] In an embodiment of the present application, after the upgrade package is downloaded, the electronic device deletes the installation file and releases the storage space of the second number of bytes occupied by the installation file in response to the installation trigger of the upgrade package. The size of the available storage space of the electronic device after the storage space is released is greater than or equal to the second number of bytes, that is, greater than or equal to the size of the storage space required to install the upgrade package. In this way, even if the user performs operations such as downloading videos, downloading files, taking photos, and recording videos during the download of the upgrade package, which occupies the storage space of the electronic device, resulting in the remaining available storage space of the electronic device being insufficient to complete the installation of the upgrade package, the storage space occupied by the installation file can be released so that the available storage space of the electronic device after the storage space is released is sufficient to successfully complete the installation of the upgrade package.

[0110] In some embodiments, when the automatic installation function is enabled, the installation of the upgrade package will be automatically triggered after the upgrade package is downloaded. If the automatic installation function is not enabled, an "installation" control can be displayed in the user interface after the upgrade package is downloaded. When a triggering operation (such as a click operation) on the "installation control" is detected, the installation of the upgrade package is triggered. The embodiments of the present application do not limit the display position, text content, form, and other features of the "installation control".

[0111] S310: The electronic device installs the upgrade package based on the available storage space of the electronic device after the storage space is released.

[0112] After the storage space is released, the available storage space of the electronic device is sufficient to install the upgrade package. In this way, the upgrade package can be successfully installed based on the available storage space of the electronic device after the storage space is released, thereby completing the upgrade quickly and timely.

[0113] In some embodiments, during the upgrade package installation process, the upgrade package in the downloaded file can be decompressed, and the files (or data) in the upgrade package can be decompressed to different partitions and different paths of the system, for example: " / system", " / vendor", " / data", etc., so as to complete the upgrade of the system software or system firmware based on the decompressed files (or data) in different partitions and different paths.

[0114] In some embodiments, when the upgrade package is installed, the downloaded file can be deleted and the first byte of storage space occupied by the downloaded file can be released. This allows for timely cleaning of unnecessary files or data for system operation to increase the available storage space of the electronic device, which is beneficial for smooth operation of the electronic device.

[0115] In some embodiments, when the third byte number of the electronic device's current available storage space is less than the sum of the first byte number and the second byte number, that is, when the electronic device's current available storage space is insufficient for this upgrade, the electronic device may display a message pop-up box, which may include a first prompt message and a second prompt message, the first prompt message being used to prompt the user that the storage space is insufficient, and the second prompt message being used to prompt the user of the number of bytes of storage space that needs to be cleared.

[0116] For example: Figure 5A As shown, if the electronic device currently displays the "update interface", a message pop-up box 51 may be displayed in the "update interface", and the message pop-up box 51 includes the following prompt information: "Insufficient system storage space, unable to download and install. Please clear at least 17.68GB of storage space and try again. The temporarily occupied storage space will be automatically returned after the installation is completed." For another example, when the electronic device currently displays other user interfaces instead of the update interface, the message pop-up box may be displayed in other user interfaces, such as Figure 5B As shown, the electronic device currently displays the "mailbox interface", then a message pop-up box 52 can be displayed in the "mailbox interface", and the same prompt information as that of the message pop-up box 51 can be displayed in the message pop-up box 52.

[0117] Optional, such as Figure 5A and Figure 5B As shown, the message pop-up box may also include a "Go to clean up" control. When the electronic device detects a trigger operation (such as a click operation) on the "Go to clean up" control, it may display a data cleanup interface to facilitate the user to manually clean up the storage space. The present application embodiment does not limit the display position, text content, form, and other features of the "Go to clean up" control.

[0118] In one possible manner, the electronic device can detect the size of the available storage space of the electronic device at preset time intervals. When the size of the available storage space of the electronic device is greater than or equal to the sum of the first byte number and the second byte number, the processing described in the above steps S305-S310 is executed to complete the upgrade.

[0119] In some embodiments, when the third byte number of the currently available storage space of the electronic device is less than the sum of the first byte number and the second byte number, that is, when the currently available storage space of the electronic device is insufficient for this upgrade, if the automatic storage space cleaning function is turned on, the cleanable data in the storage space of the electronic device can be automatically cleaned based on the first byte number, the second byte number and the third byte number, so that the storage space can be cleaned quickly, the upgrade speed can be accelerated, the upgrade efficiency can be improved, and the user's manual cleaning operations can be reduced, thereby improving the user experience.

[0120] Optionally, the size of the storage space to be cleared may be determined based on a difference between the third number of bytes and the sum of the number of bytes, where the sum of the number of bytes is the sum of the first number of bytes and the second number of bytes.

[0121] The upgrade package installation method provided in the embodiment of the present application creates a download file to reserve the storage space required for downloading the upgrade package, and creates an installation file to reserve the storage space required for installing the upgrade package before downloading the upgrade package; during the upgrade process, the upgrade package is downloaded to the created download file, which can ensure that there is enough storage space for downloading the upgrade package, so that the upgrade package is successfully downloaded, and the created installation file is deleted and the storage space occupied by the installation file is released, which can ensure that the available storage space of the electronic device after the storage space is released is sufficient for installing the upgrade package. In this way, the upgrade package can be installed successfully based on the available storage space of the electronic device after the storage space is released, thereby completing the upgrade quickly and timely.

[0122] Next, a possible process of installing an upgrade package on an electronic device is introduced in combination with the internal module interaction of the electronic device. Figure 6 As shown, the following steps may be included but are not limited to:

[0123] S601: The upgrade and update module generates a package search request in response to a trigger of an upgrade check.

[0124] The package search request is used to request a search for whether there is an upgrade package of the system software or system firmware of the currently installed version of the electronic device.

[0125] Optionally, the upgrade check may be manually triggered by the user, and the display module may display an update interface, the update interface includes a "check for updates" control, and when a user triggers the "check for updates" control in the update interface, it is determined that the user manually triggers the upgrade check. The trigger operation may be a gesture operation, such as a click operation.

[0126] Optionally, the upgrade check may also be automatically triggered by the system, for example, performing an upgrade check at a preset time interval.

[0127] Optionally, the upgrade check may also be triggered by a voice command input by the user, and the voice command may be, for example, “upgrade check”.

[0128] S602: The upgrade and update module sends a packet search request to the communication module.

[0129] Optionally, the upgrade module can directly send a packet search request to the communication module, or can indirectly send a packet search request to the communication module, for example, the service scheduling module can send a packet search request to the communication module. The way of sending data between modules is similar to this, and will not be repeated later.

[0130] S603, the communication module sends a packet search request to the server, and receives a packet search result returned by the server.

[0131] The package search result may include indication information for indicating whether an upgrade package exists.

[0132] S604: The communication module sends the packet search result to the upgrade and update module.

[0133] S605: The upgrade and update module generates a file request in response to the package search result indicating that an upgrade package exists.

[0134] The file request is used to request the detailed information file of the upgrade package.

[0135] S606: The upgrade and update module sends a file request to the communication module.

[0136] S607, the communication module sends a file request to the server, and receives the detailed information file of the upgrade package returned by the server.

[0137] The detailed information file may be a file list file of an upgrade package, and the file list file of the upgrade package may be a text file containing a list of files and directories to be upgraded, and may be used to guide the update operation during the software or firmware upgrade process.

[0138] S608: The communication module sends the detailed information file of the upgrade package to the upgrade and update module.

[0139] S609, the upgrade and update module performs file parsing processing on the detailed information file of the upgrade package to obtain the first byte number of the upgrade package and the second byte number of the storage space required for installing the upgrade package.

[0140] The first number of bytes may refer to the size of the storage space required to store the upgrade package, and the second number of bytes may refer to the size of the storage space required to install the upgrade package.

[0141] S610: In response to the number of bytes of the current available storage space of the electronic device being greater than or equal to the sum of the first number of bytes and the second number of bytes, the upgrade and update module sends file creation indication information to the file management module.

[0142] The sum of the first byte number and the second byte number can be used to indicate the total size of the storage space required for this upgrade. If the number of bytes of the currently available storage space of the electronic device is greater than or equal to the sum of the first byte number and the second byte number, it indicates that the currently available storage space of the electronic device can meet the needs of this upgrade. The file creation indication information carries the first byte number and the second byte number, and the file creation indication information is used to instruct the file management module to create a download file based on the first byte number and to create an installation file based on the second byte number.

[0143] S611, the file management module creates a download file in response to the file creation instruction information, and sets the download file to occupy a first number of bytes of storage space, creates an installation file, and sets the installation file to occupy a second number of bytes of storage space.

[0144] A download file is created to reserve a storage space of a size required for downloading the upgrade package, and an installation file is created to reserve a storage space of a size required for installing the upgrade package.

[0145] Optionally, a download file may be created in the download path of the upgrade package.

[0146] Optionally, the file attribute of the installation file can be a temporary file. Since there are many files (or data) after the upgrade package is decompressed, and each file exists in a different path, if the same solution is used for downloading, it is necessary to know the installation path of each file, which is currently difficult or even impossible to achieve. Based on this, an installation file with a file attribute of a temporary file is used to first occupy the storage space required for the installation of the upgrade package (i.e., the second byte number). This can prevent the problem that after the upgrade package is downloaded, the available storage space of the electronic device is insufficient to complete the installation of the upgrade package, and the upgrade cannot be completed.

[0147] S612: The file management module sends the file creation result to the upgrade module.

[0148] The file creation result may be used to indicate whether the file creation is completed according to the requirements of the file creation instruction information.

[0149] S613: The upgrade and update module generates an upgrade package download request in response to the file creation result indicating that the file creation is completed.

[0150] The upgrade package download request is used to request to download the upgrade package from the server.

[0151] S614, the upgrade and update module sends an upgrade package download request to the communication module.

[0152] S615, the communication module sends an upgrade package download request to the server, and receives the upgrade package returned by the server.

[0153] S616, the communication module sends the upgrade package to the storage module.

[0154] S617: The storage module saves the upgrade package into the download file.

[0155] The download file is created in advance to occupy the storage space required for downloading the upgrade package. The upgrade package is saved to the download file, which ensures that there is enough storage space to save the downloaded upgrade package, thereby successfully downloading the upgrade package.

[0156] S618: In response to the installation trigger of the upgrade package, the upgrade and update module sends installation file deletion instruction information to the file management module.

[0157] The installation file deletion instruction information is used to instruct the file management module to delete the installation file and release the storage space occupied by the installation file.

[0158] S619: The file management module deletes the installation file and releases the storage space occupied by the installation file in response to the installation file deletion instruction information.

[0159] The size of the available storage space of the electronic device after the storage space is released is greater than or equal to the second number of bytes, that is, greater than or equal to the size of the storage space required for installing the upgrade package. In this way, even if the user performs operations such as downloading videos, downloading files, taking photos, and recording videos during the download of the upgrade package, which occupies the storage space of the electronic device and causes the remaining available storage space of the electronic device to be insufficient to complete the installation of the upgrade package, the storage space occupied by the installation file can be released so that the available storage space of the electronic device after the storage space is released is sufficient to successfully complete the installation of the upgrade package.

[0160] S620: The file management module sends the file deletion result to the upgrade and update module.

[0161] The file deletion result may be used to indicate whether the installation file is successfully deleted. Successful deletion of the installation file means that the storage space occupied by the installation file is successfully released.

[0162] S621: In response to the file deletion result indicating that the file deletion is completed, the upgrade and update module installs the upgrade package based on the available storage space of the electronic device after the storage space is released.

[0163] After the storage space is released, the available storage space of the electronic device is sufficient to install the upgrade package. In this way, the upgrade package can be successfully installed based on the available storage space of the electronic device after the storage space is released, thereby completing the upgrade quickly and timely.

[0164] S622, in response to the completion of the installation of the upgrade package, the upgrade and update module sends a download file deletion instruction message to the file management module.

[0165] The downloaded file deletion instruction information is used to instruct the file management module to delete the downloaded file and release the storage space occupied by the downloaded file.

[0166] S623: The file management module deletes the downloaded file and releases the storage space occupied by the downloaded file in response to the downloaded file deletion instruction information.

[0167] In one embodiment, when the third number of bytes of the currently available storage space of the electronic device is less than the sum of the first number of bytes and the second number of bytes, that is, when the currently available storage space of the electronic device is insufficient for this upgrade, the upgrade and update module may send a first indication message to the display module, and the first indication message may be used to instruct the display module to display a message pop-up box, and the message pop-up box displayed by the display module may include a first prompt message and a second prompt message, the first prompt message is used to prompt that the storage space is insufficient, and the second prompt message is used to prompt the user the number of bytes of the storage space that needs to be cleared. After the user manually clears out enough storage space, the above steps may be executed to complete the upgrade.

[0168] In some embodiments, when the third byte number of the currently available storage space of the electronic device is less than the sum of the first byte number and the second byte number, that is, when the currently available storage space of the electronic device is insufficient for this upgrade, if the automatic storage space cleaning function is turned on, the upgrade and update module can send a second indication message to the storage space cleaning module, and the second indication message can be used to instruct the storage space cleaning module to automatically clean up the cleanable data in the storage space of the electronic device based on the first byte number, the second byte number and the third byte number. After automatically cleaning up enough storage space, the above steps can be performed to complete the upgrade.

[0169] For implementation methods that are not exhaustively described in the above steps, please refer to the relevant description in the previous method embodiment, which will not be repeated here.

[0170] Exemplarily, the software structure of the electronic device in the embodiment of the present application is introduced below.

[0171] Optionally, the software structure of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The following takes the Android system of the layered architecture as an example to introduce the software structure of the electronic device.

[0172] like Figure 7 As shown, the layered architecture of the electronic device can divide the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into an application layer, an application framework layer, and a kernel layer from top to bottom.

[0173] The application layer may include a series of application packages, which may include camera, gallery, video playback, system settings, map, calendar, music, call and other applications. In the embodiment of the present application, the application layer may also include a display module. The display module may be used to control the user interface to output content related to the upgrade package installation function, such as outputting an update interface, detecting update controls, outputting a message pop-up box, outputting prompt information, etc.

[0174] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0175] The application framework layer may include a window manager. The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0176] The application framework layer can also include a view system, a notification manager, etc.

[0177] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0178] The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction. In an embodiment of the present application, the notification manager can output prompt information to the user, such as prompting the user that the electronic device is performing an upgrade operation, prompting the user that the upgrade is complete, prompting the user that the storage space is insufficient, or prompting the user the number of bytes of storage space that need to be cleared, etc.

[0179] In the embodiment of the present application, the application framework layer may also include an upgrade and update module, a file management module, a detection module, a storage module, and a communication module. Among them, the upgrade and update module can be used to install the upgrade package, generate a request related to the upgrade and update for sending to the server, and parse the detailed information file of the upgrade package. The file management module can be used to create files that occupy storage space, such as creating a download file for occupying the download space, creating an installation file for occupying the installation space; the file management module can also be used to delete the download file to release the storage space occupied by the file, such as deleting the download file to release the storage space occupied by the download file, and deleting the installation file to release the storage space occupied by the download file. The detection module can be used to detect whether the automatic check update function is turned on, detect whether the automatic storage space cleaning function is turned on, detect whether the upgrade check is triggered, check whether the upgrade package installation is triggered, etc. The storage module can be used to store data, including the downloaded upgrade package, the data after the upgrade package is decompressed, etc. The communication module can be used to communicate and interact with the server, such as downloading the upgrade package from the server, obtaining the detailed information file of the upgrade package, and sending a search package request to the server. The communication module can also be used to realize information interaction between modules inside the electronic device.

[0180] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, storage driver, processor driver, communication driver, etc.

[0181] It should be noted that the various functional modules included in the above software structure are only exemplary and do not constitute a specific limitation on the software architecture of the electronic device of the present application. In other embodiments, the various functional modules included in the above software structure may be more or less, and the present application does not limit this. Although the embodiments of the present application are described using the Android system as an example, the basic principles are also applicable to electronic devices based on operating systems such as iOS or Windows.

[0182] It should be understood that in the embodiments of the present application, the electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, a mobile internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, a personal digital assistant (PDA), etc., and the embodiments of the present application are not limited to this.

[0183] Exemplarily, the hardware structure of the electronic device in the embodiment of the present application is introduced below.

[0184] like Figure 8 As shown, the electronic device 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. Among them, 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.

[0185] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural network processor (neural network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. In the embodiment of the present application, the processor can be used to install upgrade packages, create or delete files, compare byte sizes, etc.

[0186] NPU is a neural network computing processor. It can quickly process input information and continuously self-learn by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain. NPU can realize applications such as intelligent cognition of electronic devices, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0187] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, 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.

[0188] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc. In the embodiment of the present application, the wireless communication function of the electronic device can be used to communicate and interact with the server, such as downloading an upgrade package from the server, obtaining a detailed information file of the upgrade package, etc.

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

[0190] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 150 may 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, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for 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. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0191] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as WiFi networks), Bluetooth (Blue Tooth, BT), BLE broadcasting, global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc., which are applied to electronic devices. 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, 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 it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0192] The electronic device 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.

[0193] 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, MicrooLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1. In the embodiment of the present application, the display screen 194 can be used to display Figure 2A-2D The user interface shown, Figure 4A-4B The user interface shown, Figure 5A-Figure 5B The user interface shown.

[0194] 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 180K 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. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device, which is different from the position of the display screen 194. In the embodiment of the present application, the touch sensor 180K can be used to detect the operation of the user manually triggering the check update function, such as a click operation on the check update control.

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

[0196] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in this application is generated in whole or in part. 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. For example, the computer instructions can be transmitted from a 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.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. 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 hard disk Solid State Disk), etc.

[0197] It should be noted that, for the above-mentioned various method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0198] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.

[0199] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.

[0200] A person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing the relevant hardware through a program, and the program may be stored in a computer-readable storage medium, which may include a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0201] The above disclosure is only a preferred embodiment of the present application, which is only a part of the embodiments of the present application and cannot be used to limit the scope of rights of the present application.

Claims

1. A method for installing an upgrade package, characterized in that: The method comprises: Determine a first byte number of an upgrade package and a second byte number of storage space required to install the upgrade package; In response to the third byte number being greater than or equal to the sum of the first byte number and the second byte number, creating a download file and an installation file; the third byte number is the number of bytes of storage space currently available in the electronic device, the download file occupies the storage space of the first byte number, and the installation file occupies the storage space of the second byte number; Downloading the upgrade package from the server to the download file; In response to the installation trigger of the upgrade package, deleting the installation file and releasing the storage space occupied by the installation file; The upgrade package is installed based on the available storage space of the electronic device after the storage space is released.

2. The method according to claim 1, characterized in that The step of creating download files and installation files includes: Determine the download path of the upgrade package; The download file is created under the download path of the upgrade package, and the download file is set to occupy the storage space of the first number of bytes.

3. The method according to claim 1, characterized in that The step of creating download files and installation files includes: Create the installation file with a file attribute of a temporary file, and set the installation file to occupy a storage space of the second number of bytes.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Sending a file request to the server, where the file request is used to request a detailed information file of the upgrade package; Receiving the detailed information file of the upgrade package returned by the server; The determining of the first number of bytes of the upgrade package and the second number of bytes of the storage space required to install the upgrade package includes: The detailed information file of the upgrade package is parsed to obtain a first byte number of the upgrade package and a second byte number of storage space required for installing the upgrade package.

5. The method according to claim 4, characterized in that The method further comprises: In response to the triggering of the upgrade check, sending a package search request to the server, wherein the package search request is used to request to search whether the upgrade package exists; Receiving the packet search result returned by the server; In response to the package search result indicating the existence of the upgrade package, the step of sending a file request to the server is performed.

6. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When the automatic storage space cleaning function is turned on, in response to the third byte number being less than the sum of the first byte number and the second byte number, the cleanable data in the storage space of the electronic device is cleaned based on the first byte number, the second byte number and the third byte number.

7. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: In response to the third byte number being less than the sum of the first byte number and the second byte number, a message pop-up box is displayed; the message pop-up box includes a first prompt message and a second prompt message, the first prompt message is used to prompt that the storage space is insufficient, and the second prompt message is used to prompt the number of bytes of the storage space that needs to be cleared.

8. The method according to claim 1, characterized in that The method further comprises: In response to the upgrade package being installed completely, the downloaded file is deleted and the storage space occupied by the downloaded file is released.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors, a memory and a communication interface; the communication interface is used to exchange information with other devices, and the memory is used to store program code; the processor is used to run the program code, so that the electronic device implements the method described in any one of claims 1-8.

10. A chip system, characterized in that: The chip system includes one or more processors, a memory and an interface circuit, the memory, the interface circuit and the one or more processors are interconnected via lines, and program instructions are stored in the memory; when the program instructions are executed by the processor, the chip system implements the method as described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method and system for improving success rate of downloading and mounting

    CN104050000A

  • Application program downloading and installing method and device

    CN105573770A

  • A system and method for version upgrade of wireless terminal

    CN109426521A

  • Deployment method and device of operating system, electronic equipment and storage medium

    CN115454457A

  • Application installation method, device and equipment and computer readable storage medium

    CN115516419A