Application program updating method, electronic equipment and storage medium
By automatically pre-downloading and pre-loading application update packages within the target time period and under the target device conditions, the problem of excessively long application update times is solved, improving user experience and device performance.
Patent Information
- Application Number
- CN202411230788.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2026-03-17
AI Technical Summary
The application update package download and installation process takes too long, which affects the user experience, especially for large applications such as mobile games.
During the target time period and/or when the device is in the target state, the application update package is automatically queried and pre-downloaded through the pre-download service and preloaded on the virtual screen to avoid starting the main application process immediately when needed.
Users no longer need to wait for the update process, which improves application startup speed, reduces system load and device battery life, and enhances the user experience.
Smart Images

Figure CN121680879A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a method for updating an application, an electronic device, and a storage medium. Background Technology
[0002] To ensure that applications remain in good condition in terms of functionality, performance, security, and other aspects, meet users' continuous needs, and adapt to constantly changing technologies and environments, developers continuously update applications after release. After each update, they package the new version and upload it to the corresponding application distribution platform. This allows users to download the corresponding update package after launching the application on their electronic devices, and then use the update package to update the application.
[0003] However, when downloading large update packages, the download process often takes a considerable amount of time. After downloading, the update package still needs to be decompressed and installed, and this long waiting time severely impacts the user experience. Therefore, improving the user experience while updating applications is a pressing issue that needs to be addressed. Summary of the Invention
[0004] This application provides a method for updating applications, an electronic device, and a storage medium that can automatically update applications that need updating when a target time period is reached and / or when the electronic device is detected to be in a target state. This eliminates the need for users to wait for updates when using these applications, greatly saving users' time and improving user experience.
[0005] In a first aspect, embodiments of this application provide an application update method, which is applied to an electronic device. The method includes: when the electronic device is in a target time period and / or when the electronic device is detected to be in a target state, querying the electronic device based on a pre-download service to see if there is an application in the electronic device that needs to download an update package; when there is an application in the electronic device that needs to download an update package, pre-downloading the update package of the application that needs to download an update package based on the pre-download service; and preloading the successfully pre-downloaded application on a virtual screen.
[0006] The target time period can be understood as the off-peak time period, which can be determined based on historical data or experience. For example, this time period could be from 1 a.m. to 6 a.m.
[0007] The target state can be understood as a specific state of an electronic device, in which it is more suitable to perform an update operation. This target state can be, for example, an idle state (such as when the user is inactive, the screen is off, or the device is charging), a low-resource-consumption state (such as when no other tasks that consume a lot of computing resources are running), or a good network state (such as when connected to Wi-Fi rather than a mobile data network). Specific examples are provided below.
[0008] Based on the above implementation, when the target time period and / or when the electronic device is detected to be in the target state, the electronic device can automatically update applications that need updating. This allows users to use applications directly without waiting for updates, significantly saving user time and improving user experience. Furthermore, when the target time period and / or when the electronic device is detected to be in the target state, the system can first interact with the application pre-download service to determine if an application requiring an update package exists. If such an application exists, the update package is pre-downloaded using the pre-download service. After successful pre-download, the update is then preloaded on the virtual screen. Preloading typically involves launching the application and unpacking and installing the update package. Launching the application will start the application's main process, meaning that this application only starts the application's main process when an update is needed and the update package download is complete. Otherwise, it will not start the application's main process if no update is needed or the update package download is incomplete. Compared to starting the application's main process from the beginning, this reduces system load and the impact on background application persistence and device battery life, thus improving user experience.
[0009] In conjunction with the first aspect above, in some implementations of the first aspect, the electronic device being in the target state includes at least one of the following: the electronic device is in sleep mode, the electronic device is connected to a wireless network, the electronic device is in a charging state and the power of the electronic device is greater than or equal to a first threshold, the remaining storage space of the electronic device is greater than or equal to a second threshold, the case temperature of the electronic device is less than or equal to a third threshold, and the running memory of the electronic device is greater than or equal to a fourth threshold.
[0010] The first threshold can be any value between 20% and 50%; the second threshold can be any value such as 2G, 3G, or 4G; the third threshold can be any value between 40 and 50℃; and the fourth threshold can be any value such as 2G, 3G, or 4G. It should be understood that the above thresholds are merely examples, and other values may be used in practice; no limitation is imposed.
[0011] It should be understood that updating applications while the electronic device is in sleep mode, with the screen off and the user not operating the device, will not affect the user; updating applications while the electronic device is connected to a Wi-Fi network will not consume data traffic; updating applications while the electronic device is charging will not reduce battery power; updating applications when the remaining storage space of the electronic device is greater than or equal to a second threshold will have a minimal impact on storage space; updating applications when the case temperature of the electronic device is less than or equal to a third threshold will not cause the case temperature to overheat; and updating applications when the running memory of the electronic device is greater than or equal to a fourth threshold ensures that background applications remain active. Therefore, updating applications under these conditions will not be perceptible to the user, improving the user experience.
[0012] In conjunction with the first aspect above, in some implementations of the first aspect, the electronic device is in sleep mode when at least one of the following conditions is met: the electronic device is in a screen-off state and the duration is greater than or equal to a fifth threshold; the brightness of the environment in which the electronic device is located is less than or equal to a sixth threshold and the duration is greater than or equal to a seventh threshold; the electronic device is in a stationary state and the duration is greater than or equal to an eighth threshold; or the current time is later than the theoretical sleep time.
[0013] The fifth threshold can be any value between 30 and 60 minutes; the sixth threshold can be any value between 5 and 10 nits; and the seventh and eighth thresholds can be any values between 30 and 60 minutes. It should be understood that these thresholds are merely examples, and other values may be used in practice without limitation.
[0014] In conjunction with the first aspect described above, in some implementations of the first aspect, the theoretical sleep time is a specified time that is later than the start time of the target time period. For example, when the target time period is from 1 a.m. to 6 a.m., the theoretical sleep time can be specified as a time later than 1 a.m.
[0015] Alternatively, the theoretical sleep time can be determined based on the latest effective sleep time among at least the most recent effective sleep time. When the electronic device is in a screen-off state, the brightness of the environment surrounding the electronic device is less than or equal to the sixth threshold, and the electronic device is in a static state, and the duration of these conditions is greater than or equal to the ninth threshold, the point in time when these conditions are simultaneously met is recorded as an effective sleep time. The ninth threshold can be, for example, any value between 30 and 60 minutes.
[0016] For example, when determining the theoretical sleep time based on the latest effective sleep time among the three most recent effective sleep times, assuming the time point on the most recent first day that simultaneously meets the above conditions is 1:00 AM, then the first effective sleep time is 1:00 AM; assuming the time point on the most recent second day that simultaneously meets the above conditions is 1:30 AM, then the second effective sleep time is 1:30 AM; assuming the time point on the most recent third day that simultaneously meets the above conditions is 2:00 AM, then the third effective sleep time is 2:00 AM; finally, the theoretical sleep time determined based on the latest effective sleep time among the three effective sleep times is 2:00 AM.
[0017] In conjunction with the first aspect above, in some implementations of the first aspect, querying whether there are applications in the electronic device that require downloading update packages based on the pre-download service includes: obtaining a list of applications to be queried, the list of applications to be queried being determined based on user instructions or system instructions; obtaining and binding the pre-download service corresponding to each application to be queried in the list of applications to be queried; and querying whether there are update packages that need to be downloaded in each application to be queried based on the pre-download service corresponding to each application to be queried.
[0018] Based on this implementation method, queries and updates can be performed only on applications specified by the user or system, rather than on all applications on the electronic device. This reduces system load and minimizes the impact on keeping background applications alive and device battery life, thereby improving the user experience.
[0019] The list of applications to be queried can be updated based on instructions from subsequent users or the system. For example, if a subsequent user or system indicates other applications to be queried, these applications can be added to the previous list of applications to be queried. If the pre-download service subsequently finds applications in other applications to be queried that require downloading update packages, these applications can be added to the pre-download list. If a subsequent user or system no longer indicates certain applications in the previous list of applications to be queried, these applications can be removed from both the list of applications to be queried and the pre-download list.
[0020] In conjunction with the first aspect above, in some implementations of the first aspect, when there is an application in the electronic device that requires an update package to be downloaded, pre-downloading the update package of the application that requires an update package based on the pre-download service includes: determining a pre-download list; and pre-downloading the update package of the application in the pre-download list based on the pre-download service.
[0021] Specifically, a pre-download list can be determined first based on the applications that need to download update packages, and then the update packages for the applications on the pre-download list can be pre-downloaded based on the pre-download service.
[0022] In conjunction with the first aspect described above, in some implementations of the first aspect, the method further includes: updating the pre-download list based on the pre-download results.
[0023] This application proposes that the pre-download list can be updated based on the pre-download results. For example, applications that have been successfully pre-downloaded can be removed from the pre-download list so that the next pre-download will only download update packages that have not been downloaded or have not been fully downloaded, avoiding duplicate downloads. This can reduce system load pressure, reduce the impact on background application persistence and device battery life, and improve user experience.
[0024] It should be noted that if the pre-download process is interrupted, the pre-download service can save the download progress and automatically resume the download when the conditions are met, thereby avoiding downloading the entire update package repeatedly.
[0025] In one possible implementation, preloading successfully downloaded applications on a virtual screen includes: determining a preload list based on the successfully downloaded applications; creating the virtual screen; launching the applications in the preload list on the virtual screen; and decompressing and installing the update packages of the applications in the preload list.
[0026] This application proposes to first determine a preload list based on successfully pre-downloaded applications, and then launch the applications on the preload list on the virtual screen. In other words, this application will only launch the main process of the application if an update is required and the update package download is complete. Otherwise, the main process of the application will not be launched if no update is required or the update package download is incomplete. Compared with launching the main process of the application from the beginning, this can reduce the system load pressure, reduce the impact on background application persistence and device battery life, and improve the user experience.
[0027] In conjunction with the first aspect above, launching an application from the preloaded list on the virtual screen and decompressing and installing the update package of the application from the preloaded list includes: determining the preload duration of a first application in the preloaded list, the preload duration including the launch duration of the first application and the decompression and installation duration of the update package of the first application; starting a timer when launching the first application on the virtual screen, and stopping the preload of the first application when the timer's elapsed duration reaches the preload duration.
[0028] This application sets a reasonable preloading duration for applications that require preloading, so that after the application is launched on the virtual screen, the update package can be decompressed and installed within the preloading duration, and the preloading of the next application can continue when the preloading duration is reached, thereby ensuring the orderly progress of the update process and improving the user experience.
[0029] In conjunction with the first aspect above, in some implementations of the first aspect, when the update package of the first application is decompressed and installed for the first time, the decompression and installation time of the update package of the first application is a first duration; when the update package of the first application is not decompressed and installed for the first time, the decompression and installation time of the update package of the first application is a second duration, which is the difference between the first duration and the time consumed when it was previously decompressed and installed.
[0030] The first duration can be determined based on the file types and corresponding file sizes contained in the application's update package.
[0031] It should be noted that if the preloading process is interrupted, the system can save the preloading progress and automatically continue preloading when the conditions are met, thereby avoiding repeated decompression and installation of the entire update package. Therefore, when the application update package is not decompressed and installed for the first time, the corresponding time needs to be reduced by the time consumed during the previous decompression and installation.
[0032] In conjunction with the first aspect described above, in some implementations of the first aspect, the method further includes: updating the preload list based on the preload result.
[0033] This application proposes that the preload list can be updated based on the preload results. For example, applications that have been successfully preloaded can be removed from the preload list so that the next preload will only preload applications that have not been loaded or have not been fully loaded, thus avoiding repeated preloading. This can reduce system load pressure, reduce the impact on background application keep-alive and device battery life, and improve user experience.
[0034] In conjunction with the first aspect above, in some implementations of the first aspect, when the second application is included in the preload list, the method further includes: if the user launches the second application and completes the loading of the second application, then the second application is removed from the preload list.
[0035] Based on this, it is possible to avoid repeated preloading of the second application when the conditions are met in the future, thereby reducing the system load pressure, reducing the impact on background application keep-alive and device battery life, and improving the user experience.
[0036] In conjunction with the first aspect above, in some implementations of the first aspect, the method further includes: during the process of updating the application, if it is no longer in the target time period and / or the electronic device is detected to no longer be in the target state, then the update operation is paused to avoid interrupting the user's work and improve the user experience.
[0037] In a second aspect, embodiments of this application provide an electronic device, including: one or more processors; one or more memories; the memories storing one or more programs, which, when executed by the processors, cause the electronic device to perform any of the possible methods described in the first aspect.
[0038] Thirdly, embodiments of this application provide an apparatus included in an electronic device, which has the function of implementing the behaviors of the electronic device in the above aspects and possible implementations thereof. The functions can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. For example, a display module or unit, a detection module or unit, a processing module or unit, etc.
[0039] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform any of the possible methods described in the first aspect.
[0040] Fifthly, embodiments of this application provide a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the possible methods described in the first aspect.
[0041] The technical effects achieved by the second, third, fourth, and fifth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0042] Figure 1 This is a schematic diagram illustrating a different implementation path provided in an embodiment of this application;
[0043] Figure 2 This is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of this application;
[0044] Figure 3 This is a software structure block diagram of an electronic device 100 provided in an embodiment of this application;
[0045] Figure 4 This is a flowchart illustrating an application update method provided in an embodiment of this application;
[0046] Figure 5 This is a schematic diagram illustrating the specific structure of an application update module provided in an embodiment of this application;
[0047] Figure 6 This is a schematic diagram of a process for maintaining an idle-time update list provided in an embodiment of this application;
[0048] Figure 7This is a schematic diagram illustrating the activation of an electronic device for status monitoring, provided in an embodiment of this application.
[0049] Figure 8 This is a flowchart illustrating a process for determining whether an electronic device is in a target state, provided in an embodiment of this application.
[0050] Figure 9 This is a schematic diagram of a pre-download process when an electronic device is in a target state, provided in an embodiment of this application;
[0051] Figure 10 This is a schematic diagram of a pre-download process when an electronic device is in a non-target state, provided in an embodiment of this application;
[0052] Figure 11 This is a schematic diagram of a preloading process for an electronic device in a target state, provided in an embodiment of this application.
[0053] Figure 12 This is a schematic diagram of a preloading process for an electronic device in a non-target state, provided in an embodiment of this application.
[0054] Figure 13 This is a schematic diagram illustrating an update of the preloaded list provided in an embodiment of this application;
[0055] Figure 14 This is a schematic diagram of the structure of an application update device provided in an embodiment of this application;
[0056] Figure 15 This is a schematic diagram of the structure of a chip provided in an embodiment of this application. Detailed Implementation
[0057] To facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with essentially the same function and purpose. For example, "first chip" and "second chip" are used only to distinguish different chips and do not limit their order. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" do not necessarily imply that they are different.
[0058] It should be noted that, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0059] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0060] To facilitate understanding, the terminology used in this application will be introduced below.
[0061] Pre-download service: This is a service provided by a device or application platform. Based on this service, it can query whether an application has new update packages available for download. If so, the service will usually automatically download these update packages, meaning that users do not need to wait for downloads the next time they launch the application. There are three deployment methods for the pre-download service: 1. Independent deployment within each application: The pre-download service is integrated into each application and pre-downloads update packages or content specific to that application. 2. Deployed as a separate system service: The pre-download service runs as a system-level service or a separate background service, which multiple applications can share for pre-downloading update packages. 3. Hybrid mode: The system-level pre-download service handles general update download tasks, while specific applications can implement their own pre-download logic as needed to handle special requirements.
[0062] Preloading: In this application, preloading includes launching the application and unpacking and installing the update package. Unpacking and installing refers to unpacking the downloaded update package and updating it into the application.
[0063] Virtual screen: refers to a screen that is virtualized by software and invisible to the user without interfering with normal user operation. This application uses a virtual screen to preload applications, allowing users to update applications without manual intervention.
[0064] The following is a detailed description of the proposed solution with reference to the accompanying drawings.
[0065] To ensure the application remains in good condition in terms of functionality, performance, and security, meeting continuous user needs and adapting to constantly changing technologies and environments, developers continuously update the application after its release. After each update, the new version is packaged and uploaded to the appropriate application distribution platform. This allows users to download, extract, and install the updated package before using the updated application on their electronic devices. Figure 1 The path shown is Path 1.
[0066] However, when downloading large update packages, the download process often takes a considerable amount of time. After downloading, the update package must be decompressed and installed, and this long waiting time severely impacts the user experience. For example, in recent years, with the development of mobile game technology, game graphics and effects have rapidly improved, greatly enhancing the experience. However, this has also led to increasingly larger game packages and longer update times. Downloading a large update package can take more than 30 minutes, and the subsequent decompression and installation further exacerbates the user experience. This problem is even more pronounced for users with limited gaming time. Therefore, improving the user experience while updating applications is a pressing issue that needs to be addressed.
[0067] Based on this, this application proposes that when the electronic device is in a target time period and / or when it is detected to be in a target state, the electronic device can automatically update applications that need updating, so that users can directly use the updated applications after launching them without having to wait for updates. Figure 1 As shown in path 2, this greatly saves users' time and improves the user experience.
[0068] The solution of this application can be applied to electronic devices that include applications. Optionally, the aforementioned electronic devices can also be referred to as user equipment (UE), terminal equipment, or user terminal, etc. The electronic devices can be, but are not limited to, mobile phones, tablets, desktops, laptops, handheld computers, notebook computers, in-vehicle systems, ultra-mobile personal computers (UMPCs), netbooks, cellular phones, personal digital assistants (PDAs), augmented reality (AR) / virtual reality (VR) devices, etc. The embodiments of this application do not limit this.
[0069] For example, Figure 2This is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of this application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a USB interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, bone conduction sensors, etc.
[0070] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0071] Processor 110 may include one or more processing units, such as application processors, satellite communication processors, modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0072] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0073] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0074] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0075] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0076] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0077] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
[0078] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the same device as at least some modules of the processor 110.
[0079] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0080] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with networks and other devices through wireless communication technology.
[0081] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0082] The display screen 194 is used to display images, display videos, and receive swipe operations, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.
[0083] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0084] The ISP is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0085] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0086] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.
[0087] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0088] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0089] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0090] Internal memory 121 can be used to store executable program code, including instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located within the processor.
[0091] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0092] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0093] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, touch operations applied to different applications (such as taking photos, playing audio, etc.) can correspond to different vibration feedback effects. Touch operations applied to different areas of the display screen 194 can also correspond to different vibration feedback effects from motor 191. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.
[0094] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0095] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0096] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture, etc. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.
[0097] Figure 3This is a software structure block diagram of an electronic device 100 provided in an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system can be divided into, from top to bottom, an application layer, an application framework layer, the Android runtime and system libraries, and a kernel layer.
[0098] The application layer can include a series of application packages. For example... Figure 3 As shown, the application package may include games (e.g., Honor of Kings, PUBG Mobile, etc.), camera, gallery, browser, call, map, navigation, WLAN, Bluetooth, music, video, messaging and other applications.
[0099] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0100] like Figure 3 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, application update module, etc.
[0101] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0102] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0103] A view system includes visual controls, such as controls for displaying characters and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text message notification icon could include a view for displaying characters and a view for displaying images.
[0104] A phone manager is used to provide communication functions for electronic devices. For example, it manages call status (including connection and disconnection).
[0105] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0106] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0107] The application update module is used to update the application when the target time period is reached and / or when the electronic device is detected to be in the target state, as detailed below.
[0108] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0109] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0110] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0111] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0112] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0113] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0114] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0115] A 2D graphics engine is a graphics engine for 2D drawing.
[0116] The kernel layer is the layer between hardware and software. The kernel layer includes at least display drivers, camera drivers, audio drivers, sensor drivers, Bluetooth drivers, etc.
[0117] It should be noted that although the embodiments of this application are described using the Android system, the solutions of this application are also applicable to electronic devices with operating systems such as iOS or Windows.
[0118] In addition, the software layer can be connected to the hardware layer, which includes at least sensors, such as temperature sensors, touch sensors, ambient light sensors, fingerprint sensors, etc. In this application, these sensors are mainly used to monitor whether the electronic device is in a target state.
[0119] The application update method provided in this application embodiment will be described in detail below with reference to the accompanying drawings. It should be noted that this method is mainly applied to electronic devices that include applications. Figure 4 This is a flowchart illustrating an application update method provided in an embodiment of this application. The method 400 includes steps S410 to S430, which will be described in detail below.
[0120] S410, when the target time period is reached and / or the electronic device is detected to be in the target state, queries the electronic device based on the pre-download service to see if there are any applications in the electronic device that need to download update packages.
[0121] Optionally, the system can query whether an application requiring an update package exists on the electronic device during the target time period based on the pre-download service; alternatively, it can query whether an application requiring an update package exists on the electronic device when the electronic device is detected to be in the target state; and it can also query whether an application requiring an update package exists on the electronic device when both the target time period and the target state are detected. Specifically, in the last scenario, monitoring of whether the electronic device is in the target state can be initiated only when the target time period is reached, and then the system can query whether an application requiring an update package exists on the electronic device based on the pre-download service once the target state is detected.
[0122] The target time period can be understood as the off-peak time period, which can be determined based on historical data or experience. For example, this time period could be from 1 a.m. to 6 a.m.
[0123] The target state can be understood as a specific state of an electronic device, in which it is more suitable to perform an update operation. This target state can be, for example, an idle state (such as when the user is inactive, the screen is off, or the device is charging), a low-resource-consumption state (such as when no other tasks that consume a lot of computing resources are running), or a good network state (such as when connected to Wi-Fi rather than a mobile data network). Specific examples are provided below.
[0124] For example, the electronic device being in a target state may include at least one of the following: the electronic device is in sleep mode, the electronic device is connected to a wireless network, the electronic device is charging and the electronic device's battery level is greater than or equal to a first threshold, the electronic device's remaining storage space is greater than or equal to a second threshold, the electronic device's casing temperature is less than or equal to a third threshold, and the electronic device's RAM is greater than or equal to a fourth threshold.
[0125] It should be understood that updating applications while the electronic device is in sleep mode, with the screen off and the user not operating the device, will not affect the user; updating applications while the electronic device is connected to a Wi-Fi network will not consume data traffic; updating applications while the electronic device is charging will not reduce battery power; updating applications when the remaining storage space of the electronic device is greater than or equal to a second threshold will have a minimal impact on storage space; updating applications when the case temperature of the electronic device is less than or equal to a third threshold will not cause the case temperature to overheat; and updating applications when the running memory of the electronic device is greater than or equal to a fourth threshold ensures that background applications remain active. Therefore, updating applications under these conditions will not be perceptible to the user, improving the user experience.
[0126] In addition, the electronic device being in the target state may also include the electronic device being in primary user mode, thereby preventing updates from occurring in child mode or other non-primary user modes.
[0127] The first threshold can be any value between 20% and 50%; the second threshold can be a value such as 2G, 3G, or 4G; the third threshold can be any value between 40 and 50°C; and the fourth threshold can be a value such as 2G, 3G, or 4G. It should be understood that the example thresholds mentioned in this application are merely examples and do not constitute a limitation on the solution of this application. In actual operation, they can be determined by users or R&D personnel based on experience.
[0128] Optionally, the electronic device may be in sleep mode when at least one of the following conditions is met: the electronic device is in a screen-off state and the duration is greater than or equal to the fifth threshold; the brightness of the environment in which the electronic device is located is less than or equal to the sixth threshold and the duration is greater than or equal to the seventh threshold; the electronic device is in a stationary state and the duration is greater than or equal to the eighth threshold; or the current time is later than the theoretical sleep time.
[0129] The fifth threshold can be any value between 30 and 60 minutes; the sixth threshold can be any value between 5 and 10 nits; and the seventh and eighth thresholds can be any values between 30 and 60 minutes. It should be understood that these thresholds are merely examples, and other values may be used in practice without limitation.
[0130] In one possible implementation, the theoretical sleep time can be a specified time, which can be later than the start time of the target time period. For example, if the target time period is from 1 a.m. to 6 a.m., the theoretical sleep time can be specified as a time later than 1 a.m.
[0131] In another possible implementation, the theoretical sleep time can be determined based on the latest effective sleep time among at least the most recent effective sleep time. When the electronic device is in a screen-off state, the brightness of the environment in which the electronic device is located is less than or equal to the sixth threshold, and the electronic device is in a static state, and the duration of these conditions is greater than or equal to the ninth threshold, the point in time when these conditions are simultaneously met is recorded as an effective sleep time. The ninth threshold can be, for example, any value between 30 and 60 minutes.
[0132] For example, when determining the theoretical sleep time based on the latest effective sleep time among the three most recent effective sleep times, assuming the time point on the most recent first day that simultaneously meets the above conditions is 1:00 AM, then the first effective sleep time is 1:00 AM; assuming the time point on the most recent second day that simultaneously meets the above conditions is 1:30 AM, then the second effective sleep time is 1:30 AM; assuming the time point on the most recent third day that simultaneously meets the above conditions is 2:00 AM, then the third effective sleep time is 2:00 AM; finally, the theoretical sleep time determined based on the latest effective sleep time among the three effective sleep times is 2:00 AM.
[0133] In one possible implementation, when the target time period is reached and / or the electronic device is detected to be in the target state, the pre-download service corresponding to each application in the electronic device can be obtained and bound, and then the pre-download service corresponding to each application can be used to query whether there is an update package that needs to be downloaded in each application.
[0134] In another possible implementation, when the target time period is reached and / or the electronic device is detected to be in the target state, a list of all applications to be queried can be obtained first. This list is determined based on user or system commands. Then, the pre-download service corresponding to each application in the list is obtained and bound. Finally, based on the pre-download service corresponding to each application, it is checked whether an update package needs to be downloaded for that application. This implementation allows for querying and updating only the applications specified by the user or system, rather than querying and updating all applications on the electronic device. This reduces system load and minimizes the impact on background application persistence and device battery life, thus improving the user experience.
[0135] The list of applications to be queried can be updated based on instructions from subsequent users or the system. For example, if a subsequent user or the system indicates other applications to be queried, these applications can be added to the previous list of applications to be queried; if a subsequent user or the system no longer indicates certain applications in the previous list of applications to be queried, these applications can be removed from the list of applications to be queried.
[0136] S420: When an application that requires an update package to be downloaded exists in the electronic device, the update package of the application that requires an update package to be downloaded is pre-downloaded based on the pre-download service.
[0137] In one possible implementation, each application can be traversed sequentially. That is, each time an update package that needs to be downloaded is found, it is pre-downloaded, and then the next application is queried after the pre-download is complete. For example, the system can first check if the update package needs to be downloaded in the first application; if it exists, the update package is downloaded, and the second application is queried after the download is complete; or, if the update package does not exist in the first application, the system continues to query the second application, and so on, until all applications have been traversed.
[0138] In another possible implementation, query operations and pre-download operations for different applications can be performed synchronously. For example, while performing query operations and pre-download operations for the first application, query operations and pre-download operations for the second application can be performed simultaneously.
[0139] In another possible implementation, after querying all applications, a pre-download list can be determined based on the applications that need to download update packages, and then the update packages of the applications on the pre-download list can be pre-downloaded based on the pre-download service.
[0140] The aforementioned pre-download list can be updated based on updates to the list of applications to be queried. For example, if a subsequent user or system indicates other applications to be queried, these applications can be added to the previously queried application list. Subsequently, when the pre-download service finds applications among the other queried applications that require update packages, these applications can be added to the pre-download list. If a subsequent user or system no longer indicates certain applications from the previously queried application list, these applications can be removed from both the queried application list and the pre-download list.
[0141] The pre-download list can also be updated based on the pre-download results. For example, applications that have been successfully pre-downloaded can be removed from the pre-download list so that the next pre-download will only download update packages that have not been downloaded or have not been fully downloaded, avoiding duplicate downloads. This can reduce system load pressure, reduce the impact on keeping background applications alive and device battery life, and improve user experience.
[0142] It should be noted that if the pre-download process is interrupted, the pre-download service can save the download progress and automatically resume the download when the conditions are met, thereby avoiding downloading the entire update package repeatedly.
[0143] The S430 preloads successfully downloaded applications on a virtual screen.
[0144] The preloading process includes launching the application and unpacking and installing the application's update package. Launching the application will start the application's main process.
[0145] In one possible implementation, each application can be traversed sequentially. Each time an update package that needs to be downloaded is found, it is pre-downloaded and then preloaded directly onto the virtual screen. Only after preloading is complete can the query continue to the next application. For example, the query can first check if the required update package exists in the first application; if it does, it is downloaded and preloaded directly onto the virtual screen, then the query continues to the second application; or, if the required update package does not exist in the first application, the query continues to the second application, and so on, until all applications have been traversed.
[0146] In another possible implementation, query operations, pre-download operations, and pre-load operations for different applications can be performed synchronously. For example, while performing query operations, pre-download operations, and pre-load operations for the first application, query operations, pre-download operations, and pre-load operations for the second application can be performed synchronously.
[0147] In another possible implementation, a preload list can be determined based on the successfully preloaded applications after the pre-download is completed. Then, a virtual screen is created, the applications on the preload list are launched on the virtual screen, and the update packages of the applications on the preload list are decompressed and installed.
[0148] In one possible implementation, the preloading duration of the first application in the preloading list can be determined first. This preloading duration includes the startup time of the first application and the decompression and installation time of its update package. Subsequently, when the first application is launched on the virtual screen, a timer is started. When the timer reaches the preloading duration, the preloading of the first application stops, and the preloading of the second application continues in the same manner, and so on. This application proposes setting a reasonable preloading duration for applications that need to be preloaded, so that after the application is launched on the virtual screen, the decompression and installation of the update package can be completed within the preloading duration, and the preloading of the next application can continue when the preloading duration is reached. This ensures the orderly progress of the update process and improves the user experience.
[0149] It should be understood that the startup time of an application can be determined by averaging historical data, or it can be configured by relevant technical personnel based on experience, without any limitation.
[0150] It should be understood that the first time an application update package is extracted and installed, the extraction and installation time is called the first duration. The second time is the difference between the first duration and the time consumed during previous extractions and installations. The first duration can be determined based on the file types and sizes contained in the application update package.
[0151] It should be noted that if the preloading process is interrupted, the system can save the preloading progress and automatically continue preloading when the conditions are met, thereby avoiding repeated decompression and installation of the entire update package. Therefore, when the application update package is not decompressed and installed for the first time, the corresponding time needs to be reduced by the time consumed during the previous decompression and installation.
[0152] The aforementioned preload list can be updated based on the preload results. For example, applications that have been successfully preloaded can be removed from the preload list so that the next preload will only preload applications that have not been loaded or have not finished loading, avoiding repeated preloading. This can reduce system load pressure, reduce the impact on keeping background applications alive and device battery life, and improve user experience.
[0153] In one possible implementation, if an application (e.g., a second application) is included in the preload list, and the user actively launches and completes the loading of that application, then the application can be removed from the preload list. This avoids repeated preloading of applications when conditions are met subsequently, thereby reducing system load and minimizing the impact on background application persistence and device battery life, ultimately improving the user experience.
[0154] In one possible implementation, if the application is no longer in the target time period and / or the electronic device is no longer in the target state during the update process, the update operation can be paused to avoid interrupting the user's work and improve the user experience.
[0155] In summary, when the target time period and / or when the electronic device is detected to be in the target state, the electronic device can automatically update applications that need updating. This allows users to use applications directly without waiting for updates, significantly saving user time and improving user experience. Furthermore, when the target time period and / or when the electronic device is detected to be in the target state, the system can first interact with the application pre-download service to determine if any applications require update packages. If such applications exist, the system pre-downloads the update packages based on the pre-download service. After successful pre-download, the updates are then preloaded on the virtual screen. Preloading typically involves launching the application and unpacking and installing the update package. Launching the application will start the application's main process, meaning that this application only launches the application's main process if an update is needed and the update package download is complete. Otherwise, it will not launch the application's main process if no update is needed or the update package download is incomplete. Compared to launching the application's main process from the beginning, this reduces system load and minimizes the impact on background application persistence and device battery life, thus improving user experience.
[0156] The following is combined with Figure 5 right Figure 3 The specific structure of the application update module shown is illustrated by example. Figure 5 This is a schematic diagram illustrating the specific structure of an application update module provided in an embodiment of this application, such as... Figure 5 As shown, the application update module 500 may include a task management module 510, an idle time management module 520, a pre-download management module 530, and a pre-load management module 540. The functions of each module are described below with reference to the accompanying drawings.
[0157] The task management module 510 mainly involves two functions: first, receiving instructions from users or the system, creating / deleting idle-time update tasks for specified applications based on user or system instructions, and maintaining an idle-time update list (i.e., the list of applications to be queried mentioned above, where idle time can be understood as the target time period mentioned above); second, managing the application update process, including maintaining a pre-download list and a pre-load list of applications.
[0158] For example, such as Figure 6 As shown, the task management module 510 can receive information from users and the system regarding the on / off status of the idle update function. When the idle update function of the first application is enabled, the task management module 510 is enabled to create an idle update task, which is used to trigger the execution of the idle update logic daily. When the idle update function of all applications is disabled, the task management module 510 is disabled to delete the idle automatic update task, meaning that the idle update logic will no longer be triggered daily. Regardless of whether the idle update function of an application is enabled or disabled, the task management module 510 will update the idle update list based on the on / off status for use when subsequent idle update tasks are triggered.
[0159] As an example, the idle time management module 520 is primarily responsible for monitoring the status of electronic devices during idle times and notifying the task management module 510 of the results. Specifically, if an idle time update task has been created, during idle times (e.g., from point A to point B at night), the idle time management module 520 can be enabled to monitor the status of electronic devices to determine whether the electronic devices are in the target state, such as... Figure 7 As shown, the results are then sent to the task management module 510.
[0160] As an example, it can be based on Figure 8 The process shown determines whether the electronic device is in the target state, such as... Figure 8 As shown, an electronic device can be considered to be in the target state when it is in sleep mode and its state meets other specific conditions; and it can be considered to be in a non-target state when it is in non-sleep mode or its state does not meet other specific conditions.
[0161] As an example, an electronic device can be considered to be in sleep mode if it is in a screen-off state for a duration greater than or equal to the fifth threshold, the brightness of the environment in which the electronic device is located is less than or equal to the sixth threshold and the duration is greater than or equal to the seventh threshold, the electronic device is in a stationary state for a duration greater than or equal to the eighth threshold, and the current time is later than the theoretical sleep time. If any one of these conditions is not met, the electronic device can be considered to be in non-sleep mode.
[0162] As an example, other specific conditions may include the electronic device being connected to a wireless network, the electronic device being charged and having a battery level greater than or equal to a first threshold, the electronic device having remaining storage space greater than or equal to a second threshold, the electronic device having a casing temperature less than or equal to a third threshold, and the electronic device having RAM greater than or equal to a fourth threshold.
[0163] The pre-download management module 530 is mainly responsible for the first phase of the idle time update task. It mainly interacts with the application's pre-download service to complete the actual update package download logic and maintain the lifecycle of the update package pre-download, including operations such as start / pause / resume / end.
[0164] It should be understood that when the task management module 510 determines, based on the notification from the idle time management module 520, that the electronic device is currently in the target state and has not yet performed a pre-download, it can notify the pre-download management module 530 to perform a pre-download. As an example, Figure 9 This is a schematic diagram of a pre-download process when an electronic device is in a target state, as provided in an embodiment of this application. Figure 9 As shown, the process includes steps S901 to S909, which are described below.
[0165] S901, retrieve the idle time update list from the task management module 510;
[0166] S902, iterate through the applications in the list;
[0167] S903, during the traversal, obtains and binds the pre-download service of the corresponding application;
[0168] S904. Based on the pre-download service, interact with the application and call the interface to query whether the application has a new update package to download. If not, proceed to step S905; if so, proceed to step S906.
[0169] S905, continue iterating through the next application in the list;
[0170] S906 interacts with the application based on the pre-download service and calls the interface to start downloading the update package;
[0171] S907, confirming that the update package download has been completed;
[0172] S908, continue iterating through the next application in the list;
[0173] S909: After the entire list has been traversed, notify the task management module 510 that the pre-download phase has been completed.
[0174] It should be understood that during the pre-download process, if the task management module 510 determines, based on the notification from the idle time management module 520, that the current state of the electronic device has changed to a non-target state, the task management module 510 can notify the pre-download management module 530, which will then respond according to the actual situation. As an example, Figure 10 This is a schematic diagram of a pre-download process provided in an embodiment of this application when an electronic device is in a non-target state. Figure 10 As shown, the process includes steps S1001 to S1005, which are described below.
[0175] S1001, Determine whether the download of the update package has started. If yes, proceed to step S1002; otherwise, proceed to step S1003.
[0176] S1002, pause the application's pre-download action, and then proceed to step S1003;
[0177] S1003, determine whether the electronic device is in non-sleep mode. If yes, proceed to step S1004; otherwise, proceed to step S1005.
[0178] S1004 Notify the task management module 510 that the pre-download phase has been completed, that is, indicate that the pre-download operation will no longer be performed and the pre-loading phase can be entered directly;
[0179] S1005, do not process for now, and continue processing when the target state is reached again.
[0180] It should be understood that after the pre-download phase is completed, the task management module 510 can refresh the preload list based on the list of applications that have been successfully pre-downloaded with the update package.
[0181] The preload management module 540 is mainly responsible for the second phase of the idle time update task. It achieves the preloading of update packages by launching the application in a virtual screen and maintains the lifecycle of update package decompression and installation.
[0182] It should be understood that when the task management module 510 learns that the pre-download task has been completed, and determines, based on the notification from the idle time management module 520, that the electronic device is still in the target state, it can notify the pre-load management module 540 to perform pre-loading. As an example, Figure 11 This is a schematic diagram of a preloading process for an electronic device in a target state, as provided in an embodiment of this application. Figure 11 As shown, the process includes steps S1101 to S1109, which are described below.
[0183] S1101, Obtain the preload list from the task management module 510;
[0184] S1102, iterate through the applications in the list;
[0185] S1103, Create a virtual screen; it should be understood that this virtual screen only needs to be created when the first application is loaded.
[0186] S1104. During the traversal, obtain the preloading duration of the corresponding application, and execute steps S1105 and S1106 within the preloading duration.
[0187] S1105, launch the application on the virtual screen;
[0188] S1106, decompress and install the update package, and complete the preloading;
[0189] S1107, continue iterating through the next application in the list;
[0190] S1108, After the entire list has been traversed, delete the virtual screen;
[0191] S1109, Notify task management module 510 that the preloading phase has been completed.
[0192] It should be understood that during the preloading process, if the task management module 510 determines, based on the notification from the idle time management module 520, that the current state of the electronic device has changed to a non-target state, the task management module 510 can notify the preloading management module 530, which will then respond according to the actual situation. As an example, Figure 12 This is a schematic diagram of a preloading process for an electronic device in a non-target state, provided in an embodiment of this application. Figure 12 As shown, the process includes steps S1201 to S1205, which are described below.
[0193] S1201, Determine whether preloading has started. If yes, proceed to step S1202; otherwise, proceed to step S1203.
[0194] S1202, pause the application's preloading action, and then proceed to step S1203;
[0195] S1203, determine whether the electronic device is in non-sleep mode. If yes, proceed to step S1204; otherwise, proceed to step S1205.
[0196] S1204, delete the created virtual screen and notify the task management module 510 that the preloading phase has been completed, that is, indicate that the preloading operation will no longer be performed;
[0197] S1205, do not process for now, and continue processing when the target state is reached again.
[0198] It should be understood that after the preloading phase is completed, the task management module 510 can refresh the preload list based on the applications that have been successfully preloaded by the update package, for example, by deleting applications that have been successfully preloaded from the original list.
[0199] Furthermore, if an application is included in the updated preload list, and a user subsequently launches and completes the loading of that application, the preload list will be updated, meaning the application will be removed from the preload list. Figure 13 As shown.
[0200] It should be understood that the above modules and specific implementation processes are merely examples, and other implementation methods may be included in practice. For instance, during the pre-download phase, the list of applications requiring update packages can be queried first, and a pre-download list can be generated. Subsequently, the update packages for the applications on the pre-download list can be downloaded uniformly. Alternatively, in practice, each application can be pre-loaded as it is pre-downloaded, without waiting for all pre-downloads to complete before pre-loading. In summary, the solution presented in this application offers considerable flexibility in its implementation. Specific details can be found in the relevant content of method 300 above or adjusted according to actual applications. This application does not impose any limitations on this.
[0201] The following, combined with Figure 14 This application describes an embodiment of an application update device 1400. It should be understood that this device 1400 is used in an electronic device that includes an application. Figure 14 As shown, the device includes a query module 1410, a pre-download module 1420, and a pre-loading module 1430.
[0202] The query module 1410, pre-download module 1420, and pre-loading module 1430 are used by the device 1400 to execute the corresponding processing steps in the above method embodiments. For example, the query module 1410 is used to query whether there is an application that needs to download an update package in the electronic device based on the pre-download service when the target time period is reached and / or the electronic device is detected to be in a target state; the pre-download module 1420 is used to pre-download the update package of the application that needs to download an update package based on the pre-download service when there is an application that needs to download an update package in the electronic device; and the pre-loading module 1430 is used to pre-load the successfully pre-downloaded application on the virtual screen.
[0203] It should be understood that other related steps performed by the query module 1410, the pre-download module 1420, and the pre-loading module 1430 can be found in the description in the above method embodiments, and will not be repeated here.
[0204] In one possible implementation, the device 1400 may further include a storage module. This storage module is connected to the query module 1410, the pre-download module 1420, and the pre-load module 1430 via a line connection. The storage module may include one or more memories, which can be devices in one or more devices or circuits used for storing programs or data. The storage module can exist independently and be connected to the query module 1410, the pre-download module 1420, and the pre-load module 1430 via a communication bus. Alternatively, the storage module may be integrated with the query module 1410, the pre-download module 1420, and the pre-load module 1430.
[0205] The storage module may store computer-executable instructions for the methods in device 1400, causing device 1400 to execute the methods described in the above embodiments. The storage module may be a register, cache memory, or random access memory (RAM), etc. The storage module may also be a read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions.
[0206] Figure 15 This is a schematic diagram of the structure of a chip 1500 provided in an embodiment of this application. For example... Figure 15 As shown, chip 1500 includes one or more processors 1501, communication lines 1502 and communication interfaces 1503. Optionally, chip 1500 also includes memory 1504.
[0207] In some implementations, memory 1504 stores elements such as executable modules or data structures, or subsets thereof, or extended sets thereof.
[0208] The methods described in the embodiments of this application can be applied to processor 1501, or implemented by processor 1501. Processor 1501 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above methods can be completed by integrated logic circuits in the hardware of processor 1501 or by instructions in software form. The processor 1501 may be a general-purpose processor (e.g., a microprocessor or conventional processor), a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates, transistor logic devices, or discrete hardware components.
[0209] The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules can be located in mature storage media in the art, such as random access memory, read-only memory, programmable read-only memory, or electrically erasable programmable read-only memory (EEPROM). This storage medium is located in memory 1504, and processor 1501 reads information from memory 1504 and, in conjunction with its hardware, completes the steps of the above method.
[0210] The processor 1501, memory 1504 and communication interface 1503 can communicate with each other via communication line 1502.
[0211] In the above embodiments, the instructions stored in the memory for execution by the processor can be implemented in the form of a computer program product. This computer program product can be pre-written into the memory, or it can be downloaded and installed into the memory as software.
[0212] This application also provides a computer program product comprising one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. For example, available media may include magnetic media (e.g., floppy disk, hard disk, or magnetic tape), optical media (e.g., digital versatile disc (DVD)), or semiconductor media (e.g., solid-state disk (SSD)).
[0213] This application also provides an application update device, including: one or more processors; one or more memories; the memories store one or more programs, and when one or more programs are executed by the processor, the device executes the technical solutions in the above embodiments.
[0214] This application provides a chip. The chip includes a processor, which is used to call a computer program in memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those in the related embodiments described above, and will not be repeated here.
[0215] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program or instructions. When the computer program or instructions are executed by a processor, they implement the methods described above. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium accessible by a computer.
[0216] As one possible design, computer-readable media may include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM, or other optical disc storage; computer-readable media may include disk storage or other disk storage devices. Furthermore, any connecting cable may also be appropriately referred to as computer-readable media. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of media. As used herein, disks and optical discs include optical discs (CD), laser discs, optical discs, DVDs, floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0217] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1A device that provides the functions specified in one or more boxes.
[0218] The above specific embodiments further illustrate the purpose, technical solution and beneficial effects of this application. It should be understood that the above are only specific embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of this application should be included within the scope of protection of this application.
Claims
1. A method for updating an application, characterized in that, The method is applied to an electronic device, and the method includes: When the electronic device is in the target time period and / or when the electronic device is detected to be in the target state, query the electronic device based on the pre-download service to see if there are any applications in the electronic device that need to download update packages; When an application that requires an update package to be downloaded exists in the electronic device, the update package of the application that requires an update package to be downloaded is pre-downloaded based on the pre-download service; Preload the successfully downloaded application on the virtual screen.
2. The method according to claim 1, characterized in that, The electronic device being in the target state includes: The electronic device is in sleep mode, the electronic device is connected to a wireless network, the electronic device is charging and the battery level of the electronic device is greater than or equal to a first threshold, the remaining storage space of the electronic device is greater than or equal to a second threshold, the casing temperature of the electronic device is less than or equal to a third threshold, and the running memory of the electronic device is greater than or equal to a fourth threshold.
3. The method according to claim 2, characterized in that, The electronic device is in sleep mode when at least one of the following conditions is met: The electronic device is in a screen-off state and the duration is greater than or equal to the fifth threshold; the brightness of the environment in which the electronic device is located is less than or equal to the sixth threshold and the duration is greater than or equal to the seventh threshold; the electronic device is in a stationary state and the duration is greater than or equal to the eighth threshold; and the current time is later than the theoretical sleep time.
4. The method according to claim 3, characterized in that, The theoretical sleep time is a specified time, which is later than the start time of the target time period; Alternatively, the theoretical sleep time is determined based on the latest effective sleep time among the most recent effective sleep times. When the electronic device is in a screen-off state, the brightness of the environment in which the electronic device is located is less than or equal to the sixth threshold, and the electronic device is in a stationary state, and the duration of these conditions is greater than or equal to the ninth threshold, the time point at which these conditions are simultaneously met is recorded as an effective sleep time.
5. The method according to any one of claims 1 to 4, characterized in that, The query based on the pre-download service to check whether there are applications in the electronic device that require downloading update packages includes: Obtain a list of applications to be queried, the list of applications to be queried being determined based on user instructions or system instructions; Obtain and bind the pre-download service corresponding to each application in the list of applications to be queried; Based on the pre-download service corresponding to each application to be queried, query whether there is an update package that needs to be downloaded in each application to be queried.
6. The method according to claim 5, characterized in that, When an application that requires an update package exists in the electronic device, pre-downloading the update package of the application requiring an update package based on the pre-download service includes: Determine the pre-download list; The pre-download service is used to pre-download update packages for applications on the pre-download list.
7. The method according to claim 6, characterized in that, Its features are, The method further includes: The pre-download list is updated based on the pre-download results.
8. The method according to any one of claims 1 to 7, characterized in that, The preloading of the successfully downloaded application on the virtual screen includes: Determine the preload list based on applications that have been successfully pre-downloaded; Create the virtual screen; Launch the applications from the preload list on the virtual screen, and decompress and install the update packages for the applications from the preload list.
9. The method according to claim 8, characterized in that, The step of launching the applications in the preload list on the virtual screen and decompressing and installing the update packages of the applications in the preload list includes: Determine the preloading duration of the first application in the preload list, wherein the preloading duration includes the startup duration of the first application and the decompression and installation duration of the update package of the first application; When the first application is launched on the virtual screen, a timer is started, and when the timer reaches the preload duration, the preload of the first application is stopped.
10. The method according to claim 9, characterized in that, When the update package of the first application is decompressed and installed for the first time, the decompression and installation time of the update package of the first application is a first duration; when the update package of the first application is not decompressed and installed for the first time, the decompression and installation time of the update package of the first application is a second duration, and the second duration is the difference between the first duration and the time consumed when it was previously decompressed and installed.
11. The method according to claim 10, characterized in that, The method further includes: The preload list is updated based on the preload results.
12. The method according to claim 11, characterized in that, When a second application is included in the preload list, the method further includes: If the user launches the second application and completes its loading, the second application is removed from the preload list.
13. The method according to any one of claims 1 to 12, characterized in that, The method further includes: If the application is no longer in the target time period and / or the electronic device is no longer in the target state during the application update process, the update operation is paused.
14. An electronic device, characterized in that, include: One or more processors; one or more memories; The memory stores one or more programs that, when executed by the processor, cause the electronic device to perform the method of any one of claims 1 to 13.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 13.
