Upgrade package installation method, electronic device, chip system, and storage medium
By reserving storage space to create download and installation files, the problem of insufficient storage space during OTA upgrades is solved, enabling fast and timely installation of upgrade packages.
Patent Information
- Application Number
- CN202411515154.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2044-10-28
AI Technical Summary
During the OTA upgrade process, users may run out of storage space while performing other operations, which may prevent the upgrade package from being downloaded and/or installed, affecting the upgrade speed and interrupting the process.
Reserve storage space before downloading the upgrade package. Ensure sufficient storage space for downloading and installation by creating download and installation files. Release the space occupied by the installation files after the download is complete.
Ensure sufficient storage space to successfully download and install the upgrade package, thereby completing the upgrade quickly and promptly, and avoiding upgrade interruptions due to insufficient storage space.
Smart Images

Figure CN119652750B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminals, and in particular to an upgrade package installation method, an electronic device, a chip system, and a storage medium. BACKGROUND
[0002] OTA (Over The Air) refers to a technology for updating device software or firmware through wireless communication. OTA is widely used in many fields such as automobiles, smartphones, and Internet of Things devices, and allows devices to be upgraded without being directly connected to a computer.
[0003] In an OTA upgrade scenario, an upgrade package is usually large, and the upgrade package download takes a long time. During the upgrade package download process, the user may perform operations such as downloading a video, downloading a file, taking a photo, or recording a video. These operations will occupy the storage space of the electronic device, and thus may cause insufficient storage space for upgrading, and the upgrade package download or upgrade package installation cannot be completed, which will cause the upgrade process to be interrupted and affect the upgrade speed. If the user does not clean up enough storage space of the electronic device, the upgrade cannot be completed. SUMMARY
[0004] The embodiments of the present application provide an upgrade package installation method, an electronic device, a chip system, and a storage medium. The storage space required for downloading and installing an upgrade package can be reserved. During the upgrade process, the downloading of the upgrade package is performed based on the reserved download space, and the installation of the upgrade package is performed 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 and install the upgrade package, so that the upgrade can be quickly and timely completed.
[0005] In a first aspect, the embodiments of the present application provide an upgrade package installation method, which can be applied to an electronic device. The method includes: before downloading an upgrade package, determining a first byte number of the upgrade package, and determining a second byte number of the storage space required for installing the upgrade package; the sum of the byte numbers 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 byte number of the current available storage space of the electronic device being greater than or equal to the sum of the byte numbers, a download file occupying the storage space of the first byte number is created, and an installation file occupying the storage space of the second byte number is created; the upgrade package is downloaded from a server to the download file; after the upgrade package is downloaded, in response to a trigger for installing the upgrade package, the installation file is deleted and the storage space occupied by the installation file is released, and based on the available storage space of the electronic device after the storage space is released, the upgrade package is installed.
[0006] It can be seen that in the technical solution, before downloading the upgrade package, a download file is created to reserve storage space required for downloading the upgrade package, and an installation file is created to reserve storage space required for installing the upgrade package; during the upgrading process, the upgrade package is downloaded to the created download file, so that sufficient storage space is ensured 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, and 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 is installed based on the available storage space of the electronic device after the storage space is released, and the upgrade package is successfully installed, thereby quickly and timely completing the upgrading.
[0007] In combination with the first aspect, in a possible manner, the download file can be created in the following manner: a download path of the upgrade package is determined; and the download file is created under the download path of the upgrade package, and the download file occupies a first number of bytes of storage space. It can be seen that the download file is created under the download path of the upgrade package, so that the upgrade package can be quickly downloaded to the download file according to the download path of the upgrade package during the upgrading process, and the storage space can be saved in this way. If the download file is not created under the download path of the upgrade package, the upgrade package needs to be downloaded according to the download path of the upgrade package and then copied to the download file, which occupies more storage space and causes waste of storage space.
[0008] In combination with the first aspect, in a possible manner, the installation file can be created in the following manner: an installation file with a file attribute of a temporary file is created, and the installation file occupies a second number of bytes 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, and different paths exist for each file, it is difficult or even impossible to know the installation path of each file if the same scheme is used for downloading. Therefore, a temporary file with a file attribute of a temporary file is used to occupy storage space of a size required for installing the upgrade package (i.e., the second number of bytes), so that the available storage space of the electronic device is sufficient for installing the upgrade package after the upgrade package is downloaded, thereby preventing the problem that the upgrading cannot be completed. In addition, the temporary file is easy to delete and does not affect the operation of the device after being deleted, so that the installation file can be quickly deleted to release the storage space occupied by the installation file during the upgrading process, thereby ensuring that the electronic device has sufficient storage space for installing the upgrade package.
[0009] With reference to the first aspect, in a possible implementation manner, the method further includes: sending, to the server, a file request, the file request being used to request a detail information file of the upgrade package; receiving the detail information file of the upgrade package returned by the server; and determining the first byte number of the upgrade package and the second byte number of the storage space required for installing the upgrade package by performing parsing processing on the detail information file of the upgrade package. It can be seen that 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 by obtaining the detail information file of the upgrade package from the server and performing parsing on the detail information file.
[0010] With reference to the first aspect, in a possible implementation manner, the method further includes: in response to triggering of the upgrade check, sending, to the server, a package searching request, the package searching request being used to request searching whether the upgrade package exists; receiving a package searching result returned by the server; and in response to the package searching result indicating that the upgrade package exists, performing the step of sending the file request to the server. It can be seen that whether the upgrade package exists is checked before the file request is sent to the server, so that some useless operations can be avoided, and resource waste is reduced.
[0011] With reference to the first aspect, in a possible implementation 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, performing cleaning on 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, when the storage space automatic cleaning function is in an enabled state. It can be seen that when the available storage space of the electronic device is insufficient for upgrade and the storage space automatic cleaning function is enabled by the user, the cleanable data in the storage space of the electronic device can be automatically cleaned, so that the cleaning of the storage space can be quickly completed, the upgrade speed is accelerated, the upgrade efficiency is improved, the manual cleaning operation of the user is reduced, and the user experience is improved.
[0012] With reference to the first aspect, in a possible implementation 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 first prompt information and second prompt information, the first prompt information being used to prompt that the storage space is insufficient, and the second prompt information being used to prompt the byte number of the storage space that needs to be cleaned. It can be seen that when the available storage space of the electronic device is insufficient for upgrade, the message pop-up box can be displayed to prompt the user to clean the storage space, so that the upgrade can be ensured to be completed in time.
[0013] With reference to the first aspect, in a possible implementation manner, the method further includes: in response to completion of installation of the upgrade package, deleting the download file and releasing the storage space occupied by the download file. It can be seen that, after completion of installation of the upgrade package, the download file is deleted in a timely manner to release the storage space occupied by the download file, thereby increasing the available storage space of the electronic device.
[0014] With reference to the second aspect, the present application provides an electronic device, including: one or more processors, a memory and a communication interface; the communication interface is used for information interaction with other devices, the memory is coupled with the one or more processors, the memory is used for storing computer program code, the computer program code includes computer instructions, the one or more processors invoke the computer instructions to enable the electronic device to perform: determining a first byte number of an upgrade package, a second byte number of storage space required for installation of the upgrade package; in response to a third byte number being greater than or equal to a sum of the first byte number and the second byte number, creating a download file and an installation file; the third byte number is a byte number of currently available storage space of the electronic device, the download file occupies storage space of the first byte number, and the installation file occupies storage space of the second byte number; downloading the upgrade package from a server to the download file; in response to installation triggering of the upgrade package, deleting the installation file and releasing the storage space occupied by the installation file; based on available storage space of the electronic device after release of the storage space, installing the upgrade package.
[0015] With reference to the second aspect, in a possible implementation manner, the one or more processors invoke the computer instructions to enable the electronic device to perform: determining a download path of the upgrade package; creating the download file under the download path of the upgrade package, and setting the download file to occupy storage space of the first byte number.
[0016] With reference to the second aspect, in a possible implementation manner, the one or more processors invoke the computer instructions to enable the electronic device to perform: creating the installation file with a file attribute of a temporary file, and setting the installation file to occupy storage space of the second byte number.
[0017] With reference to the second aspect, in a possible implementation manner, the one or more processors invoke the computer instructions to enable the electronic device to perform: sending a file request to a server, the file request being used for requesting a detail information file of the upgrade package; receiving the detail information file of the upgrade package returned by the server; performing parsing processing on the detail information file of the upgrade package to obtain the first byte number of the upgrade package and the second byte number of storage space required for installation of the upgrade package.
[0018] With reference to the second aspect, in a possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: in response to triggering of the upgrade check, sending a package searching request to the server, the package searching request being used to request whether there is an upgrade package; receiving a package searching result returned by the server; and in response to the package searching result indicating that there is an upgrade package, performing the step of sending the file request to the server.
[0019] With reference to the second aspect, in a possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: in response to the third byte number being less than the sum of the first byte number and the second byte number, cleaning data that can be cleaned in the storage space of the electronic device based on the first byte number, the second byte number and the third byte number, when the storage space automatic cleaning function is in an enabled state.
[0020] With reference to the second aspect, in a possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: 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 containing first prompt information and second prompt information, the first prompt information being used to prompt that the storage space is insufficient, and the second prompt information being used to prompt the byte number of the storage space that needs to be cleaned.
[0021] With reference to the second aspect, in a possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: in response to the upgrade package installation being completed, deleting the download file and releasing the storage space occupied by the download file.
[0022] In a third aspect, the present application provides a chip system, which comprises one or more processors, a memory and an interface circuit, the memory, the interface circuit and the one or more processors are interconnected through a line, and the memory stores program instructions; the program instructions are executed by the processor, so that the chip system implements the method of the first aspect.
[0023] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method of the first aspect.
[0024] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on an electronic device, cause the electronic device to implement the method of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0025] FIG. 1A and FIG. 1B FIG. 1 shows a schematic diagram of an architecture of a communication system provided by an embodiment of the present application;
[0026] FIGS. 2A-2D A schematic diagram of an interface for manually triggering an upgrade check, provided exemplarily for an embodiment of the present application;
[0027] FIG. 3 A schematic diagram of a flow of an upgrade package installation method, provided exemplarily for an embodiment of the present application;
[0028] FIG. 4A and FIG. 4B A schematic diagram of an interface for displaying prompt information on a user interface, provided exemplarily for an embodiment of the present application;
[0029] FIG. 5A and FIG. 5B Another schematic diagram of an interface for displaying prompt information on a user interface, provided exemplarily for an embodiment of the present application;
[0030] FIG. 6 Another schematic diagram of a flow of an upgrade package installation method, provided exemplarily for an embodiment of the present application;
[0031] FIG. 7 A schematic diagram of a software structure of an electronic device, provided exemplarily for an embodiment of the present application;
[0032] FIG. 8 A schematic diagram of a hardware structure of an electronic device, provided exemplarily for an embodiment of the present application. DETAILED DESCRIPTION
[0033] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0034] The terms "first", "second", "third", etc. in the embodiments of the present application are to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a series of steps or units are included, or optionally, other steps or units not listed are also included, or optionally, other steps or units inherent to the process, method, product or equipment are also included. The term "one embodiment" or "some embodiments" means that the specific features, structures or characteristics described in connection with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in further some embodiments" and the like appearing in different embodiments of the present application do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized.
[0035] In the embodiments of the present application, the words "exemplary", "such as", or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design presented as "exemplary", "such as", or "for example" in the embodiments of the present application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Rather, the use of the words "exemplary", "such as", or "for example" is intended to present related concepts in a concrete manner.
[0036] In addition, "at least one" means one or more, and "multiple" means two or more. The "and / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the cases of A alone, A and B together, B alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b and c, can represent: 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 examples of the present application: is an installation file used to enhance the functionality of software or system, fix vulnerabilities, and improve performance. Upgrade package is usually a compressed file containing a series of files and data for updating software or system. In the field of smart phones, upgrade package often appears as an update.zip file. The main purpose of upgrade package is to enhance user experience by adding new functions or fixing known problems without replacing the existing system or software, which includes the application of security patches, performance optimization and the addition of new functions, etc. In the operating system, upgrade package is used to upgrade from the old version to the new version, such as OTA upgrade in Android system, which can receive and install upgrade package through wireless network to obtain the latest system functions and security updates. In general, upgrade package is an indispensable part of software and system maintenance, which can help users keep up-to-date and enjoy better product experience and service.
[0038] Temporary files can refer to a type of files generated by computers during operation, used to store intermediate states or transient data. Transient data can be temporary data during software installation or update process, which may include decompressed data, installation scripts, log information, etc., which play a supporting role in the installation process to ensure smooth installation. Temporary files usually have ".tmp", ".temp" suffix, and the life cycle of temporary files is usually short, and once its function is completed, it will be deleted.
[0039] User interface (UI) is the medium interface between application or operating system and user for interaction and information exchange, which realizes the conversion between internal form and user acceptable form. User interface is the source code written by java, extensible markup language (XML) and other specific computer languages, and the interface source code is parsed, rendered and finally presented as content that can be recognized by users on electronic devices. The common form of user interface is graphic user interface (GUI), which refers to the user interface related to computer operation displayed in graphical form. It can be visual interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, Widgets displayed on the display screen of electronic devices.
[0040] OTA upgrade is a method of updating device firmware or software remotely through wireless communication technology. OTA upgrade enables devices to automatically, reliably and securely obtain and apply updates from remote servers, improving device performance, adding new functions or fixing security vulnerabilities. It can be used in the following application scenarios:
[0041] Smartphones and tablets: usually updated with system updates and app updates via OTA push.
[0042] Internet of Things devices: such as smart home devices, sensor nodes, etc. implement remote firmware updates via OTA.
[0043] Cars: OTA updates can be used to remotely update the software of in-car infotainment systems and driver assistance systems.
[0044] Embedded systems: various embedded devices such as smartwatches, fitness trackers, etc. are updated via OTA to enhance functionality and improve user interface.
[0045] During the OTA upgrade process, the user may perform operations such as downloading a video, downloading a file, taking a photo, recording a video, etc., which will occupy the storage space of the electronic device, thus possibly causing insufficient storage space for the upgrade, and the upgrade package download and / or installation will be paused, causing the upgrade to be unable to be completed in time.
[0046] Based on this, the upgrade package installation method provided by the embodiments of the present application can be applied to the scene of OTA upgrade of an electronic device (such as a smartphone). The upgrade package installation method provided by the embodiments of the present application can reserve the storage space required for downloading and installing the upgrade package, and during the upgrade process, the downloading of the upgrade package is based on the reserved downloading space, and the installation of the upgrade package is based on the available storage space of the electronic device after the reserved installation space is released, so there is enough storage space to successfully download the upgrade package and successfully install the upgrade package, thereby quickly and timely completing the upgrade.
[0047] It can be understood that "upgrade package installation" can also be referred to as "software or firmware update", "software or firmware upgrade", "version update", "version upgrade", and other terms, which are not limited by the embodiments of the present application.
[0048] First, the system architecture involved in the present application is described.
[0049] The upgrade package installation method provided by the embodiments of the present application can be applied to FIG. 1A the system architecture shown. FIG. 1A The system shown can include but is not limited to: an electronic device 11 and a server 12, and the electronic device 11 and the server 12 are connected through a network. FIG. 1A The number and form of the electronic devices in FIG. 1A The electronic device 11 in FIG. 1BThe devices shown include tablets, smart TVs, computers, smart bracelets, and vehicles (or in-vehicle terminals) capable of OTA upgrades, but are not limited to these. Server 12 can provide OTA upgrade services for electronic devices 11. In one possible scenario, server 12 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, and middleware services.
[0050] The following uses a smartphone as an example to illustrate the application scenarios of the embodiments of this application.
[0051] like FIG. 2A As shown, the electronic device can display a main screen interface, which includes multiple application icons, such as a live streaming app icon, a gallery app icon, a weather app icon, a stock app icon, a calculator app icon, a settings app icon 21, an email app icon, a Facebook app icon, a browser app icon, a music app icon, a video app icon, and an app store icon. Below each application icon is a page indicator to show the positional relationship between the currently displayed page and other pages. The electronic device can detect a user's selection operation 22 (e.g., a click operation) on the settings app icon 21, and in response to the selection operation 22, the electronic device can display... FIG. 2B The user interface for the settings application is shown.
[0052] like FIG. 2B As shown, the settings application's user interface includes several interface objects, such as a search box, a "Users and Accounts" option, a "System and Updates" option 23, and an "About Phone" option. The electronic device can detect a user's selection action 24 (e.g., a click) on the "System and Updates" option 23, and in response to the selection action 24, the electronic device can display... FIG. 2C The system and update interface are shown below. FIG. 2C As shown, the system and update interface includes multiple interface objects, such as the "Software Update" option 25, the "Language and Input Method" option, the "Date and Time" option, and the "User Experience Improvement Program" option. The electronic device can detect the user's selection action 26 (e.g., a click) on the "Software Update" option 25, and in response to the selection action 26, the electronic device can display... FIG. 2D The update interface shown.
[0053] like FIG. 2DAs shown, system information of the electronic device is displayed in the update interface, the system information can include the name and current version information of the operating system, and the update interface further includes a "check update" control 27. The electronic device can detect a triggering operation 28 (for example, a click operation) of the user on the "check update" control 27, and in response to the triggering operation 28, the electronic device can perform the upgrade package installation method provided by the embodiments of the present application, including but not limited to the following steps: the electronic device sends a package search request to the server, the package search request is used to request to search whether there is an upgrade package of the current version; the electronic device determines the first byte number of the upgrade package, the second byte number of the storage space required for installing the upgrade package, in the case that the byte number of the current 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, creates a download file occupying the storage space of the first byte number, and creates an installation file occupying the storage space of the second byte number; 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. In this way, there is enough storage space to successfully download the upgrade package and successfully install the upgrade package, so that the upgrade is completed quickly and timely.
[0054] The above is an introduction to the application scenario of manually triggering the user to upgrade the update. The embodiments of the present application can also be applied to the application scenario of automatically triggering the upgrade 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 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, and performs the upgrade package installation method provided by the embodiments of the present application to upgrade. In addition, the embodiments of the present application can also be applied to the application scenario of voice triggering the upgrade update and the like.
[0055] The upgrade package installation method provided by the embodiments of the present application will be described in detail below. Please refer to FIG. 3 , FIG. 3 The flowchart of the upgrade package installation method provided by the embodiments of the present application can include but not limited to the following steps:
[0056] S301, the electronic device responds to the trigger of the upgrade check, and sends a package search request to the server.
[0057] In the embodiments 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 current installation version of the electronic device. The upgrade package can be used to upgrade the parameters, resources, accessories, etc. of the system of the electronic device.
[0058] In some embodiments, the electronic device may display an update interface based on user input. This update interface includes a "Check for Updates" control, and the process can be referenced above. FIGS. 2A-2D The details of the previous description are omitted here. The electronic device can determine that the user has manually triggered the upgrade check when it detects a user's triggering action (e.g., a click) on the "Check for Updates" control, and in response to the triggering of the upgrade check, send a packet search request to the server. This application embodiment does not limit the display location, text content, or form of the "Check for Updates" control.
[0059] In some embodiments, the electronic device may determine that an upgrade check has been automatically triggered when an upgrade check is scheduled for the current time based on a preset time interval, and in response to the triggering of the upgrade check, send a packet search request to the server. For example, if the last upgrade check was on October 1st and the preset time interval is 15 days, and the current time is October 16th, then the upgrade check will be automatically triggered on October 16th.
[0060] In some embodiments, the electronic device can collect user voice commands. When a voice command indicating an upgrade or upgrade check is collected, it determines that the user's voice has triggered an upgrade check and, in response to the triggering of the upgrade check, sends a packet search request to the server. Voice commands indicating an upgrade check may include, for example, "software update," "system upgrade," "update check," "upgrade check," "software update check," "system upgrade check," "detect for upgrade version," etc.
[0061] S302, the server responds to the packet search request, performs upgrade packet search processing, and obtains the packet search results.
[0062] In this embodiment, in response to a packet search request, the server searches for the existence of an upgrade package for the currently installed version of the system software or firmware in the stored system software or firmware upgrade packages, and obtains the packet search results. The packet search results may include indication information indicating whether an upgrade package exists.
[0063] In some embodiments, the version information (e.g., version number) of the stored upgrade package can be compared with the version information (e.g., version number) of the currently installed version of the electronic device to determine whether an upgrade package exists. Optionally, the server can obtain the version information of the currently installed version of the electronic device from the historical upgrade records of the electronic device. Optionally, the packet 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 packet search request.
[0064] S303, the server returns the packet search results to the electronic device.
[0065] Correspondingly, the electronic device receives the package search result returned by the server.
[0066] In response to the package search result indicating that the upgrade package exists, the electronic device determines a first byte number of the upgrade package and a second byte number of storage space required for installing the upgrade package.
[0067] In the embodiments of the present application, the first byte number can refer to the size of the storage space required for saving the upgrade package, and the second byte number can refer to the size of the storage space required for installing the upgrade package.
[0068] In some embodiments, in response to the package search result indicating that the upgrade package exists, the electronic device sends a file request to the server, where the file request is used to request a detail information file of the upgrade package. In response to the file request, the server queries or generates the detail information file of the upgrade package, and returns the detail information file of the upgrade package to the electronic device. Optionally, the detail information file can be a file list file of the upgrade package, which can be a text file containing a list of files and directories that need to be upgraded, and can be used to guide the update operation in the software or firmware upgrade process. The electronic device receives the detail information file of the upgrade package returned by the server, and performs file parsing processing on the detail 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.
[0069] In some embodiments, the package search request sent by the electronic device to the server in step S301 can be used to request the return of the detail information file of the upgrade package when the upgrade package exists, in addition to requesting the search of whether the upgrade package of the system software or system firmware of the current installed version of the electronic device exists. Thus, in step S302, the server searches whether the upgrade package of the system software or system firmware of the current installed version of the electronic device exists in response to the package search request, and in the case where the upgrade package exists, queries or generates the detail information file of the upgrade package. Thus, in step S303, the package search result returned by the server to the electronic device includes not only the indication information indicating that the upgrade package exists, but also the detail information file of the upgrade package. Thus, the electronic device does not need to send a file request to the server to obtain the detail information file of the upgrade package in the case where the package search result indicates that the upgrade package exists, and can directly perform file parsing processing on the detail information file of the upgrade package included in the package search result returned by the server 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. This manner can save the interaction process between the electronic device and the server, thereby saving time and communication resources, etc.
[0070] In some embodiments, in the case that the package searching result indicates that there is no upgrade package, the electronic device can display a prompt information in the user interface or the notification bar, which is used to prompt that there is no upgrade package. For example, the prompt information "Already the latest version" can be displayed in the update interface as shown in 41 of FIG. 4. For another example, in the case that the electronic device is not currently displaying the update interface but is displaying other user interface, a pop-up box can be displayed in the other user interface, and the prompt information can be displayed in the pop-up box. For example, in the case that the electronic device is currently displaying the "mailbox interface", a pop-up box 42 can be displayed in the "mailbox interface", and the prompt information "No new version" can be displayed in the pop-up box 42. After the electronic device displays the prompt information, the process can be directly ended. FIG. 4A FIG. 4B
[0071] In some embodiments, in the case that there are multiple versions of upgrade packages for the system software or the system firmware of the currently installed version of the electronic device, the upgrade package for the currently highest version can be processed, so that the system software or the system firmware of the electronic device can be upgraded to the currently highest version.
[0072] S305, the electronic device creates a download file and an installation file in response to that the third byte number is greater than or equal to the sum of the first byte number and the second byte number.
[0073] In the embodiments of the present application, the third byte number is the byte number of the currently available storage space of the electronic device, i.e., the size of the currently available storage space of the electronic device; the created download file can be set to occupy the storage space of the first byte number of the electronic device, so as to reserve the storage space of the required size for downloading the upgrade package; and the created installation file can be set to occupy the storage space of the second byte number of the electronic device, so as to reserve the storage space of the required size 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 currently available storage space of the electronic device and the sum of the byte numbers, and in the case that the third byte number is greater than or equal to the sum of the byte numbers, i.e., in the case that the currently available storage space of the electronic device can meet the requirements of this upgrade, a download file occupying the storage space of the first byte number is created, and an installation file occupying the storage space of the second byte number is created.
[0075] In some embodiments, the way of creating the download file can be: determining the download path of the upgrade package, the download path of the upgrade package can be the saving path of the upgrade package on the electronic device, which can be the system default path or the path set by the user; creating the download file under the download path of the upgrade package, and setting the download file to occupy the storage space of the first byte number.
[0076] In one possible approach, the download file created at the download path of the upgrade package can be named based on the filename of the upgrade package returned by the server. For example, if the upgrade package filename is "ota_update.zip", a download file for the upgrade package to be downloaded can be created at the download path " / data / update", and the filename of the download file can be "ota_update.zip", so the download file path is " / data / update / ota_update.zip". Optionally, the upgrade package filename can be obtained by the electronic device from the upgrade package details file, or the server can include the upgrade package filename in the packet search results when the upgrade package exists, and the electronic device can obtain the upgrade package filename from the packet search results.
[0077] In one possible approach, the storage space occupied by the downloaded file on the electronic device can be set based on the first code. The first code is shown below:
[0078] "RandomAccessFile randomAccessFile=new RandomAccessFile(" / data / update /
[0079] ota_update.zip","rw");
[0080] randomAccessFile.setLength("fileliset.getBytesize());
[0081] randomAccessFile.close();"
[0082] Create the download file in the download path of the upgrade package and name the download file according to the file name of the upgrade package. This way, during the upgrade process, the upgrade package can be quickly downloaded to the download file according to the download path and the file name, which can save storage space. If the download file is not in the download path of the upgrade package, the upgrade package may need to be downloaded according to the download path and then copied to the download file, which will occupy more storage space and waste storage space.
[0083] In some embodiments, the installation file can be created by: creating an installation file with the file attributes of a temporary file, and setting the installation file to occupy the second byte of storage space. Optionally, the extension of the installation file can be a temporary file extension such as ".temp" or ".tmp".
[0084] In another possible approach, the installation file can be created in the download path of the upgrade package. For example, in the download path of the upgrade package " / data / update", create an installation file named "install.temp" with the attribute set to temporary file. In this case, the path of the installation file would be " / data / update / install.temp".
[0085] In one possible approach, the storage space occupied by the installation file on the electronic device can be determined based on the second code. The second code is shown below:
[0086] "RandomAccessFile InstallrandomAccessFile=new RandomAccessFile(" / data / update /
[0087] Install.temp","rw");
[0088] InstallrandomAccessFile.setLength("fileliset.getInstallNeedsize());
[0089] InstallrandomAccessFile.close();”
[0090] The reason for using a temporary installation file (e.g., install.temp) to occupy the storage space required for the upgrade package installation is twofold. First, the uncompressed upgrade package contains numerous files (or data), each with a different path. Using the same method as downloading would require knowing the installation path of each file, which is currently difficult or even impossible. Second, the storage space required for the upgrade package installation is not the same as the storage space occupied after uncompressing. Temporary files (or temporary data) are generated during the installation process, resulting in a larger storage space required than the uncompressed upgrade package. Therefore, file size cannot be used to determine the storage space required for the upgrade package installation. Based on this, this embodiment uses a temporary installation file (e.g., install.temp) to occupy the storage space required for the upgrade package installation (i.e., the second byte count). This prevents the upgrade from failing due to insufficient available storage space on the electronic device after the upgrade package download.
[0091] In addition, the file attribute of the installation file is a temporary file, the temporary file is easy to delete and does not affect the operation of the device after being deleted, so that the installation file can be quickly deleted to release the storage space occupied by the installation file during the upgrading process, 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 downloading 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, so as to accelerate the download 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 a download file.
[0096] The download file is created in advance to occupy the storage space required for downloading the upgrade package, and the upgrade package is saved to the download file, so as to ensure that there is sufficient storage space to save the downloaded upgrade package, thereby successfully downloading the upgrade package. Wherein, the electronic device downloads the upgrade package from the server to the download file, which can be continuously receiving the data of the upgrade package sent by the server and continuously writing the received data of the upgrade package to the download file.
[0097] In one possible way, the electronic device can write the data of the upgrade package to the download file based on the third code. The third code is as follows:
[0098] “Int bytesRead=0;
[0099] Private byte[]mRead=new byte[BUFFER_SIZE];
[0100] RandomAccessFile mRandomAccessFile=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 electronic device can verify the upgrade package, including but not limited to verifying one or more of the source, security, integrity, and the like of the upgrade package. If the upgrade package passes the verification, the electronic device can perform the processes described in steps S309 and S310 to complete the installation of the upgrade package.
[0107] Optionally, if the upgrade package fails the verification, the electronic device can display a prompt in the user interface or the notification bar, the prompt indicating that the upgrade package fails the verification. For example, the prompt can indicate that the security verification of the upgrade package fails, or that the integrity verification of the upgrade package fails. The electronic device can also delete the upgrade package from the download file, and can obtain another available upgrade package from the server. For example, if the current version of the system software or the 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 electronic device can perform the above processes for the upgrade package with version number 7.0.3.0 first. If the upgrade package with version number 7.0.3.0 fails the verification, the electronic device can perform the above processes for the upgrade package with version number 7.0.2.0. If the upgrade package with version number 7.0.2.0 passes the verification, the electronic device can perform the processes described in steps S309 and S310 for 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 unavailable, the electronic device can still upgrade the system software or the system firmware to a higher version, which can improve the user experience.
[0108] S309, in response to the installation of the upgrade package, the electronic device deletes the installation file and releases the storage space occupied by the installation file.
[0109] In the embodiments 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 byte number occupied by the installation file in response to the installation trigger of the upgrade package. After the storage space is released, the size of the available storage space of the electronic device is greater than or equal to the second byte number, 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 a video, downloading a file, taking a photo, and recording a video on the storage space of the electronic device during the upgrade package downloading process, and the remaining available storage space of the electronic device is insufficient for completing 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 turned on, the installation of the upgrade package is automatically triggered after the upgrade package is downloaded. When the automatic installation function is not turned on, an “installation” control can be displayed on the user interface after the upgrade package is downloaded, and the installation of the upgrade package is triggered when a trigger operation (such as a click operation) on the “installation” control is detected. The display position, text content, and form of the “installation” control are not limited in the embodiments of the present application.
[0111] In some embodiments, when the automatic installation function is turned on, the installation of the upgrade package is automatically triggered after the upgrade package is downloaded. When the automatic installation function is not turned on, an “installation” control can be displayed on the user interface after the upgrade package is downloaded, and the installation of the upgrade package is triggered when a trigger operation (such as a click operation) on the “installation” control is detected. The display position, text content, and form of the “installation” control are not limited in the embodiments of the present application.
[0112] The available storage space of the electronic device after the storage space is released is sufficient for the installation of the upgrade package, so that the installation of the upgrade package based on the available storage space of the electronic device after the storage space is released can successfully install the upgrade package, thereby quickly and timely completing the upgrade.
[0113] In some embodiments, during the installation of the upgrade package, the upgrade package in the download 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, such as “ / system”, “ / vendor”, “ / data”, and the like, so as to complete the upgrade of the system software or the system firmware based on the decompressed files (or data) in the different partitions and different paths.
[0114] In some embodiments, after the installation of the upgrade package is completed, the download file can be deleted and the storage space of the first byte number occupied by the download file can be released, so as to timely clean up unnecessary files or data for the system to run, thereby increasing the available storage space of the electronic device and facilitating the smooth running of the electronic device.
[0115] In some embodiments, if 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, if the currently available storage space of the electronic device is insufficient for this upgrade, the electronic device may display a message pop-up. The message pop-up may contain a first prompt message and a second prompt message. The first prompt message is used to prompt the user that the storage space is insufficient, and the second prompt message is used to prompt the user that the number of bytes of storage space needs to be cleared.
[0116] For example: FIG. 5A As shown, if the electronic device is currently displaying the "Update Interface," then message pop-up 51 can be displayed on the "Update Interface." Message pop-up 51 includes the following prompt: "Insufficient system storage space, unable to download and install. Please free up at least 17.68GB of storage space and try again. The temporarily occupied storage space will be automatically refunded after installation." Alternatively, if the electronic device is not currently displaying the Update Interface but another user interface, this message pop-up can be displayed on that other user interface, such as... FIG. 5B As shown, if the electronic device is currently displaying the "email interface", then message pop-up 52 can be displayed on the "email interface", and the same prompt message as message pop-up 51 can be displayed in message pop-up 52.
[0117] Optional, such as FIG. 5A and FIG. 5B As shown, the message pop-up may also include a "Go to Cleanup" control. When the electronic device detects a trigger operation (such as a click) on the "Go to Cleanup" control, it can display a data cleanup interface to allow the user to manually clean up storage space. This application embodiment does not limit the display position, text content, or shape of the "Go to Cleanup" control.
[0118] In one possible approach, the electronic device can detect the size of its available storage space at preset time intervals. If the size of the available storage space is greater than or equal to the sum of the first byte number and the second byte number, the processing described in steps S305-S310 above is then executed to complete the upgrade.
[0119] In some embodiments, if the third byte count of the currently available storage space of the electronic device is less than the sum of the first and second byte counts, i.e., if the currently available storage space of the electronic device is insufficient for this upgrade, and if the automatic storage space cleanup function is enabled, the cleanupable data in the storage space of the electronic device can be automatically cleaned based on the first, second, and third byte counts. This can quickly complete the cleanup of the storage space, speed up the upgrade process, improve upgrade efficiency, reduce manual cleanup operations by the user, and improve the user experience.
[0120] Optionally, the size of the storage space that needs to be cleaned up can be determined according to a difference between the third byte number and the sum of the byte numbers, the sum of the byte numbers being a sum of the first byte number and the second byte number.
[0121] The method for installing the upgrade package provided in the embodiments of the present application creates a download file to reserve storage space required for downloading the upgrade package and creates an installation file to reserve storage space required for installing the upgrade package before downloading the upgrade package; in the upgrade process, the upgrade package is downloaded to the created download file, so that sufficient storage space is ensured 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, so 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 is installed based on the available storage space of the electronic device after the storage space is released, and the upgrade package is successfully installed, thereby quickly and timely completing the upgrade.
[0122] Next, a possible process for installing the upgrade package on the electronic device is introduced in combination with the internal module interaction of the electronic device. As shown in FIG. 6, the process can include but is not limited to the following steps: FIG. 6
[0123] S601, the upgrade update module generates a package searching request in response to triggering of the upgrade check.
[0124] The package searching request is used to request searching whether there is an upgrade package of the system software or the system firmware of the current installed version of the electronic device.
[0125] Optionally, the upgrade check can be manually triggered by the user, and the display module can display an update interface, the update interface including a “check update” control. When receiving a triggering operation of the user on the “check update” control in the update interface, it is determined that the user manually triggers the upgrade check. The triggering operation can be a gesture operation, for example, a click operation.
[0126] Optionally, the upgrade check can also be automatically triggered by the system, for example, once according to a preset time interval.
[0127] Optionally, the upgrade check can also be triggered by the user inputting a voice instruction, for example, “upgrade check”.
[0128] S602, the upgrade update module sends the package searching request to the communication module.
[0129] Optionally, the upgrade update module can directly send the package searching request to the communication module, or indirectly send the package searching request to the communication module, for example, through the service scheduling module. The way of sending data between modules is similar, and will not be described hereinafter.
[0130] S603, the communication module sends a package searching request to the server and receives a package searching result returned by the server.
[0131] The package searching result can include indication information indicating whether there is an upgrade package.
[0132] S604, the communication module sends the package searching result to the upgrade updating module.
[0133] S605, the upgrade updating module generates a file request in response to the package searching result indicating that there is an upgrade package.
[0134] The file request is used to request a detail information file of the upgrade package.
[0135] S606, the upgrade updating module sends the file request to the communication module.
[0136] S607, the communication module sends the file request to the server and receives a detail information file of the upgrade package returned by the server.
[0137] The detail information file can be a file list file of the upgrade package, which can be a text file containing a list of files and directories that need to be upgraded and can be used to guide the updating operation in the software or firmware upgrade process.
[0138] S608, the communication module sends the detail information file of the upgrade package to the upgrade updating module.
[0139] S609, the upgrade updating module performs file parsing processing on the detail information file of the upgrade package to obtain a first byte number of the upgrade package and a second byte number of a storage space required for installing the upgrade package.
[0140] The first byte number can refer to the size of the storage space required for saving the upgrade package, and the second byte number can refer to the size of the storage space required for installing the upgrade package.
[0141] S610, the upgrade updating module sends file creation indication information to the file management module in response to the byte number of the currently available storage space of the electronic device being greater than or equal to the sum of the first byte number and the second byte number.
[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 byte number of the current 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 current available storage space of the electronic device can meet this upgrade. The file creation indication information carries the first byte number and the second byte number. 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 and sets the download file to occupy the first byte number of storage space, and creates an installation file and sets the installation file to occupy the second byte number of storage space, in response to the file creation indication information.
[0144] The download file is created to reserve the size of the storage space required for downloading the upgrade package, and the installation file is created to reserve the size of the storage space required for installing the upgrade package.
[0145] Optionally, the download file can be created under 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 different paths, if the same scheme is used for downloading, the installation path of each file needs to be known, which is currently difficult or even impossible to implement. Therefore, a temporary file attribute is used for the installation file to first occupy the storage space required for installing the upgrade package (i.e., the second byte number), which can prevent the problem that the available storage space of the electronic device is insufficient to complete the installation of the upgrade package after the download of the upgrade package is completed, and thus the upgrade cannot be completed.
[0147] S612, the file management module sends a file creation result to the upgrade update module.
[0148] The file creation result can be used to indicate whether the file creation is completed according to the requirements of the file creation indication information.
[0149] S613, the upgrade 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 update module sends the upgrade package download request to the communication module.
[0152] S615, the communication module sends the 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, and the upgrade package is saved into the download file, so that there is enough storage space to save the downloaded upgrade package, thereby successfully downloading the upgrade package.
[0156] S618, the upgrade update module sends installation file deletion instruction information to the file management module in response to the installation of the upgrade package.
[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 byte number, that is, greater than or equal to the size of the storage space required for installing the upgrade package. Therefore, even if the user performs operations such as downloading videos, downloading files, taking photos, and recording videos on the storage space of the electronic device during the downloading of the upgrade package, and the remaining available storage space of the electronic device is insufficient for completing 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 update module.
[0161] The file deletion result can be used to indicate whether the installation file is successfully deleted, and the successful deletion of the installation file means that the storage space occupied by the installation file is successfully released.
[0162] S621, the upgrade update module installs the upgrade package based on the available storage space of the electronic device after the storage space is released in response to the file deletion result indicating that the file deletion is completed.
[0163] The available storage space of the electronic device after the storage space is released is sufficient for the installation of the upgrade package, so that the installation of the upgrade package based on the available storage space of the electronic device after the storage space is released can successfully install the upgrade package, thereby quickly and timely completing the upgrade.
[0164] S622, the upgrade update module sends download file deletion instruction information to the file management module in response to the completion of the installation of the upgrade package.
[0165] The download file deletion indication information is used to instruct the file management module to delete the download file and release the storage space occupied by the download file.
[0166] S623, in response to the download file deletion indication information, the file management module deletes the download file and releases the storage space occupied by the download file.
[0167] In an embodiment, in a case where 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, i.e., in a case where the currently available storage space of the electronic device is insufficient for the current upgrade, the upgrade update module can send the first indication information to the display module. The first indication information can be used to instruct the display module to display a message pop-up. The message pop-up displayed by the display module can include the first prompt information and the second prompt information. The first prompt information is used to prompt that the storage space is insufficient, and the second prompt information is used to prompt the number of bytes of the storage space that needs to be cleaned up by the user. After the user manually cleans up sufficient storage space, the above steps can be executed to complete the upgrade.
[0168] In some embodiments, in a case where 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, i.e., in a case where the currently available storage space of the electronic device is insufficient for the current upgrade, if the storage space automatic cleaning function is in an enabled state, the upgrade update module can send the second indication information to the storage space cleaning module. The second indication information can be used to instruct the storage space cleaning module to automatically clean up the data that can be cleaned up in the storage space of the electronic device based on the first number of bytes, the second number of bytes, and the third number of bytes. After sufficient storage space is automatically cleaned up, the above steps can be executed to complete the upgrade.
[0169] For implementation modes not exhaustively described above, reference can be made to the related description in the foregoing method embodiments, which will not be described herein again.
[0170] For example, the software structure of the electronic device in the embodiments of the present application is introduced as follows.
[0171] Optionally, the software structure of the electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The software structure of the electronic device is introduced below taking the layered architecture of an Android system as an example.
[0172] As shown in FIG. 1, FIG. 7 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 includes, from top to bottom, an application layer, an application framework layer, and a kernel layer, etc.
[0173] The application layer can include a series of application packages, which can include camera, gallery, video play, system settings, map, calendar, music, call, and the like. In the embodiments of the present application, the application layer can further include a display module. The display module can be used to control the user interface to output the content related to the installation of the upgrade package, such as outputting an update interface, detecting an update control, outputting a message pop-up box, outputting a prompt information, and the like.
[0174] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions.
[0175] The application framework layer can include a window manager. The window manager is used to manage window programs. The window manager can acquire the size of a display screen, determine whether there is a status bar, lock a screen, and intercept a screen, and the like.
[0176] The application framework layer can further include a view system, a notification manager, and the like.
[0177] The view system includes visual controls, such as a control for displaying text, a control for displaying pictures, and the like. The view system can be used to build an application. A display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.
[0178] The notification manager enables an application to display notification information in a status bar, which can be used to convey a type of message that can automatically disappear after a short stay without user interaction. In the embodiments of the present application, the notification manager can be used to output prompt information to a 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 the storage space that needs to be cleaned, and the like.
[0179] In the embodiments of the present application, the application framework layer can further include an upgrade updating module, a file management module, a detection module, a storage module, and a communication module, etc. The upgrade updating module can be used for installing an upgrade package, generating a request related to upgrade updating for sending to a server, parsing a detail information file of the upgrade package, etc. The file management module can be used for creating a file occupying storage space, such as creating a download file for occupying a download space, creating an installation file for occupying an installation space; the file management module can also be used for deleting a download file to release the storage space occupied by the file, such as deleting a download file to release the storage space occupied by the download file, deleting an installation file to release the storage space occupied by the download file. The detection module can be used for detecting whether an automatic check updating function is enabled, detecting whether a storage space automatic cleaning function is enabled, detecting whether an upgrade check is triggered, checking whether an upgrade package installation is triggered, etc. The storage module can be used for storing data, including a downloaded upgrade package, data after decompression of the upgrade package, etc. The communication module can be used for communicating with a server, such as downloading an upgrade package from the server, obtaining a detail information file of the upgrade package, sending a package searching request to the server, etc. The communication module can also be used for realizing information interaction between internal modules of the electronic device.
[0180] The kernel layer is a layer between hardware and software. The kernel layer at least contains display drivers, camera drivers, audio drivers, storage drivers, processor drivers, communication drivers, etc.
[0181] It should be noted that the various functional modules included in the 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 software structure can be more or less, and the present application does not limit this. Although the embodiments of the present application are described taking the Android system as an example, the basic principles are also applicable to electronic devices based on iOS or Windows operating systems.
[0182] It should be understood that in the embodiments of the present application, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, 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 smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a personal digital assistant (PDA), and the like, and the embodiments of the present application are not limited thereto.
[0183] For example, the hardware structure of the electronic device in the embodiments of the present application is introduced as follows.
[0184] As shown in FIG. 8 , the electronic device can 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 loudspeaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, and the like. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric 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, and the like.
[0185] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors. In the embodiments of the present application, the processor can be used for upgrade package installation, file creation or file deletion, comparison of byte size, etc.
[0186] The NPU is a neural network computing processor, which can quickly process input information by learning from the structure of biological neural networks, such as learning from the transmission mode between human brain neurons, and can also continuously self-learn. Through the NPU, intelligent cognition and other applications of electronic devices can be realized, such as image recognition, face recognition, speech recognition, text understanding, etc.
[0187] The memory in the processor 110 can also be configured to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that have just been used or are recycled by the processor 110. If the processor 110 needs to use the instructions or data again, it can directly call from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.
[0188] The wireless communication function of the electronic device can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc. In the embodiments of the present application, the electronic device can communicate with the server based on the wireless communication function, such as downloading the upgrade package from the server, obtaining the detail information file of the upgrade package, etc.
[0189] The antenna 1 and the antenna 2 are used for transmitting and receiving 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 multiplexed to improve the utilization rate of the antennas. For example: the antenna 1 can be multiplexed as a diversity antenna of 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 a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive an electromagnetic wave by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic wave, and transfer to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor, and radiate as an electromagnetic wave through the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the same device as at least part of the modules of the processor 110.
[0191] The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., a WiFi network), Bluetooth (BT), BLE broadcasting, a global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives an electromagnetic wave via the antenna 2, performs frequency modulation and filtering on the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification, and radiate as an electromagnetic wave through the antenna 2.
[0192] The electronic device implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.
[0193] The display screen 194 is configured to display images, videos, and the like. 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 (AMOLED), a flex light emitting diode (FLED), a Miniled, a Micro Led, a MicrooLed, a quantum dot light emitting diodes (QLED), or the like. In some embodiments, the electronic device can include one or N display screens 194, where N is a positive integer greater than 1. In the embodiments of the present application, the display screen 194 can be configured to display FIGS. 2A-2D the user interface shown in FIG. 1A, FIGS. 4A-4B the user interface shown in FIG. 1B, FIGS. 5A-5B the user interface shown in FIG. 1C.
[0194] The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch screen, also referred to as a "touch panel", is composed of the touch sensor 180K and the display screen 194. The touch sensor 180K is configured to detect a touch operation acting on or near the touch sensor 180K. The touch sensor 180K can transmit the detected touch operation to the application processor to determine the touch event type. The 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 disposed on the surface of the electronic device, which is different from the position where the display screen 194 is located. In the embodiments of the present application, the touch sensor 180K can be configured to detect the operation of manually triggering the check update function by the user, such as the click operation on the check update control and the like.
[0195] It can be understood that the structure shown in the embodiments does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0196] In the above embodiments, all or part can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed by a computer, all or part of the computer program instructions generate the processes or functions described in the present application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another, for example, the computer instructions can be transferred from one website, computer, server or data center to another via wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (e.g., floppy disk, hard disk, magnetic tape), optical media (e.g., DVD), or semiconductor media (e.g., Solid State Disk), etc.
[0197] It should be noted that for each of the above method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the order of the described actions, because according to the present application, some steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0198] The steps in the method embodiments of the present application can be adjusted in sequence, combined and deleted according to actual needs.
[0199] The modules in the device embodiments of the present application can be combined, divided and deleted according to actual needs.
[0200] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer-readable storage medium, which can include flash disk, ROM, RAM, magnetic disk or optical disk, etc.
[0201] The above disclosure is only a preferred embodiment of the present application, and only a part of the embodiments of the present application, which cannot limit the scope of the right of the present application.
Claims
1. An upgrade package installation method characterized by comprising: The method comprises: sending a file request to the server, the file request being used to request a detail information file of an upgrade package; receiving the detail information file of the upgrade package returned by the server; performing parsing processing on the detail information file of the upgrade package to obtain a first byte number of the upgrade package and a second byte number of storage space required for installing the upgrade package, the first byte number indicating a size of storage space required for saving the upgrade package, and the second byte number indicating a size of storage space required for installing the upgrade package; in response to a third byte number being greater than or equal to a sum of the first byte number and the second byte number, creating a download file and an installation file, the third byte number being a byte number of currently available storage space of an electronic device, the download file occupying the first byte number of storage space, and the installation file occupying the second byte number of storage space; downloading the upgrade package from the server to the download file; performing verification on the upgrade package; in a case where the verification on the upgrade package is passed, in response to installation triggering of the upgrade package, deleting the installation file and releasing storage space occupied by the installation file; based on available storage space of the electronic device after the storage space is released, installing the upgrade package; in response to the installation of the upgrade package being completed, deleting the download file and releasing storage space occupied by the download file; in a case where the verification on the upgrade package is not passed, a version of the upgrade package is a highest version, and there exists an intermediate upgrade package with a version lower than a version corresponding to the upgrade package, performing the step of sending the file request to the server and subsequent steps on the intermediate upgrade package.
2. The method of claim 1, wherein, The creating of the download file and the installation file comprises: determining a download path of the upgrade package; creating the download file under the download path of the upgrade package and setting the download file to occupy the first byte number of storage space.
3. The method of claim 1, wherein, The creating of the download file and the installation file comprises: creating the installation file with a file attribute being a temporary file and setting the installation file to occupy the second byte number of storage space.
4. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: in response to triggering of an upgrade check, sending a package searching request to the server, the package searching request being used to request searching whether the upgrade package exists; receiving a package searching result returned by the server; in response to the package searching result indicating that the upgrade package exists, performing the step of sending the file request to the server.
5. The method according to any one of claims 1 to 3, wherein The method further comprises: in a case where a storage space automatic cleaning function is in an enabled state, in response to the third byte number being less than the sum of the first byte number and the second byte number, cleaning data that can be cleaned in the storage space of the electronic device based on the first byte number, the second byte number and the third byte number.
6. The method according to any one of claims 1 to 3, wherein 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, displaying a message pop-up box; the message pop-up box containing first prompt information and second prompt information, the first prompt information being used to prompt that storage space is insufficient, and the second prompt information being used to prompt a byte number of storage space that needs to be cleaned.
7. An electronic device, comprising: The electronic device comprises one or more processors, a memory and a communication interface; the communication interface is used for information interaction with other devices, the memory is used for storing program codes; the processor is used for running the program codes, so that the electronic device implements the method according to any one of claims 1-6.
8. A chip system, characterized by The chip system comprises one or more processors, a memory and an interface circuit, the memory, the interface circuit and the one or more processors are interconnected through lines, and program instructions are stored in the memory; when the program instructions are executed by the processor, the chip system implements the method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method according to any one of claims 1-6.
Citation Information
Patent Citations
Application program downloading and installing method and device
CN105573770A
Storage reserve in a file system
US20190332370A1