A method for cleaning redundant installation packages
By calling the system interface to scan the storage directory and display the installation package options, the user can select and install the target version and clean up redundant installation packages. This solves the problem in the existing technology of being unable to clean up redundant installation packages in the application sandbox and improves storage space utilization. rate and user experience.
Patent Information
- Application Number
- CN202211430085.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-15
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2042-11-15
AI Technical Summary
Existing technology cannot clean redundant installation package data stored in the application sandbox because third-party software cannot obtain scanning permissions, resulting in users being unable to effectively clean redundant data in the system.
By calling the system interface, the storage directory is scanned, an interface of multiple installation package options and installation options is presented, the user is allowed to select the target installation package, and redundant installation packages are automatically determined to clean up redundant installation packages.
It improves storage space utilization, enhances user experience, can effectively clean up redundant installation packages in the system, and solves the problem of redundant data that cannot be cleaned up.
Smart Images

Figure CN116679872B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for cleaning redundant installation packages. Background Art
[0002] With the development of Internet technology, users have more and more ways to download installation packages, such as browsers, social software, application stores, and PC sharing. Users may download different versions of the same installation package from multiple or certain channels, but due to their own needs, they only install a certain version of the installation package, which results in the remaining versions of the installation package being retained in the system, which is called redundant data.
[0003] Currently, users can use third-party cleaning software to clean up redundant data, but some installation packages are stored in the application sandbox, and third-party software cannot obtain scanning permissions and cannot clean them. Summary of the invention
[0004] The present application provides a redundant installation package cleaning method, which solves the problem of being unable to clean up redundant installation package data.
[0005] In order to achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, the present application provides a redundant installation package cleaning method, which can be applied to electronic devices, comprising: the electronic device first obtains different versions of installation packages of the same application, and then in response to the user's installation operation on any version of the installation package in multiple installation packages, can call the system interface to scan the storage directory, after scanning the storage directory, can present multiple installation package options and a first interface of the installation option, in response to the user's selection operation on the target installation package option in the multiple installation package options and the click operation on the installation option, install the target version of the installation package, and then determine the installation packages that are not installed in the multiple installation packages as redundant installation packages and clean up the redundant installation packages. Since the method in the present application can call the system interface to scan all storage directories in the system, the installation packages that are not installed in the scanned multiple installation packages, that is, the redundant installation packages, can be cleaned up, thereby improving the effective rate of storage space and improving user experience.
[0007] Optionally, the called system interface may be a preset acquisition interface function, and the storage directory may be scanned by calling the preset acquisition interface function.
[0008] Optionally, when it is necessary to clean up redundant installation packages, a preset acquisition interface function may be called to scan the storage directory.
[0009] Optionally, in order to determine the number of other versions of the installation packages of the application in the storage directory except the parsed version installation package, the first function can be called to determine the return value of the first function, and then the size of the first function and the first threshold is judged. If the return value of the first function is greater than the first threshold, it means that in addition to the parsed version installation package, there are other versions of the installation packages. If the return value of the first function is equal to or less than the first threshold, it means that only the parsed version installation package exists. It should be noted that the return value of the first function can be expressed in a number, and the number of the return value can indicate the number of other versions of the installation packages in addition to the parsed version installation package. When it is determined that the return value of the first function is greater than the first threshold and it is determined that there are other versions of the installation packages in addition to the parsed version installation package, the first interface can be presented.
[0010] Optionally, the user selects an installation package of the first target version from multiple versions of installation packages displayed. Due to some reasons, a non-latest version of an installation package may be selected as the first target installation package. Therefore, before installing the target version of the installation package, the method of the present application may also determine the latest version of the installation package as the latest default selected version of the installation package, and then call a pre-set second function to determine the return value of the second function. If it is determined that the return value of the second function is equal to the second threshold, it can be determined that the default selected version of the installation package is the latest version of the installation package. When it is determined that the first target version of the installation package determined according to the user's selection operation is different from the default selected version of the installation package, a reminder pop-up window including multiple selection options can be presented. In response to the user's selection operation of the second target installation package option among the multiple selection options, the second target version of the installation package is installed.
[0011] The electronic device can call a second function and determine the return value of the second function. If it is determined that the return value of the second function is equal to a second threshold, it can be determined that the installation package of the first target version is not the latest version of the installation package, and a reminder pop-up window including multiple selection options can be presented. The electronic device can then determine whether to install the latest version of the installation package or continue to install the current version of the installation package based on the user's selection operation of the option, and then determine the installation package of the second target version that needs to be installed.
[0012] Optionally, before cleaning up the redundant installation packages, a prompt pop-up window may be presented. The prompt pop-up window may include a yes option and a no option. When the user selects the yes option, the electronic device may determine to clean up the redundant installation packages. When the user selects the no option, the electronic device may determine not to clean up the redundant installation packages. The electronic device may then determine whether to clean up the redundant data packets based on the user's selection of options.
[0013] Optionally, an installation interface may be presented, and when the user clicks on the installation interface to continue installing the control, the electronic device may scan the storage directory.
[0014] In a second aspect, the present application provides a redundant installation package cleaning method, which is applied to an electronic device, comprising:
[0015] The electronic device first obtains multiple installation packages of different versions of the same application, and then in response to the user's installation operation on any version of the multiple installation packages, it can call the system interface to scan the storage directory. In response to completing the scanning of the storage directory, the latest version of the installation package in the multiple installation packages can be determined as the target version of the installation package, and the target version of the installation package can be installed. Finally, the installation package of the uninstalled version in the multiple installation packages can be determined as a redundant installation package and the redundant installation packages can be cleaned up. In this way, the electronic device can automatically determine the latest version of the installation package as the target version of the installation package, and then install the target version of the installation package and clean up the redundant installation packages.
[0016] In a third aspect, the present application provides an electronic device, including: a memory;
[0017] One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device performs the method described in any one of the first aspects.
[0018] In a fourth aspect, the present application provides a computer storage medium, comprising computer instructions, which, when executed on a mobile terminal, enables the electronic device to execute the method described in any one of the first aspects.
[0019] In a fifth aspect, the present application provides a computer program product, comprising instructions; when the instructions are executed by an electronic device, the electronic device executes the method described in any one of the first aspects.
[0020] It can be seen from the above technical solution that the present application has the following beneficial effects:
[0021] The present application provides a redundant installation package cleaning method, which can be applied to electronic devices, including: the electronic device first obtains different versions of installation packages of the same application, and in response to the user's installation operation on any version of the installation package in multiple installation packages, calls the system interface, scans the storage directory, and after scanning the storage directory, multiple installation package options and a first interface of the installation options can be presented, and in response to the user's selection operation on the target installation package option in the multiple installation package options and the click operation on the installation option, the target version of the installation package is installed, and then the installation packages that are not installed in the multiple installation packages are determined as redundant installation packages and the redundant installation packages are cleaned up. Since the method in the present application can call the system interface to scan all storage directories in the system, the installation packages that are not installed in the scanned multiple installation packages, that is, the redundant installation packages, can be cleaned up, thereby improving the effective rate of storage space and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 An exemplary diagram of the composition of an electronic device provided in an embodiment of the present application;
[0023] Figure 2 An example diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0024] Figure 3A A schematic diagram of an electronic device application interface provided in an embodiment of the present application;
[0025] Figure 3B A schematic diagram of searching for an installation package in an application store provided in an embodiment of the present application;
[0026] Figure 3C A schematic diagram of an installation package installation interface provided in an embodiment of the present application;
[0027] Figure 3D A schematic diagram of another installation package installation interface provided in an embodiment of the present application;
[0028] Figure 3E A schematic diagram of the installation package download progress in a status bar provided in an embodiment of the present application;
[0029] Figure 3F A schematic diagram of the completion of downloading an installation package in a status bar provided in an embodiment of the present application;
[0030] Figure 3G A schematic diagram of an application storage directory interface in a scanning system provided in an embodiment of the present application;
[0031] Figure 4A A schematic diagram of an interface for selecting different versions of installation packages provided in an embodiment of the present application;
[0032] Figure 4B A schematic diagram of an installation package interface including a reminder pop-up window provided in an embodiment of the present application;
[0033] Figure 4C An interface for completing the cleaning of redundant installation packages provided in an embodiment of the present application;
[0034] Figure 4D A schematic diagram of an interface including a prompt pop-up window provided in an embodiment of the present application;
[0035] Figure 5 A flowchart of a redundant installation package cleaning method provided in an embodiment of the present application;
[0036] Figure 6 A flowchart of another redundant installation package cleaning method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.
[0038] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0039] In order to make the description of the following embodiments clear and concise, a brief introduction to the related technology is first given:
[0040] An installation package, also called a software installation package, is a collection of self-decompressible files. An electronic device can obtain the corresponding application by installing the installation package. The installation package of the same application may have different versions. Installing the installation packages of different versions of the application can obtain different versions of the application. For example, installing the installation package of version 2.0 of application A can obtain version 2.0 of application A, and installing the installation package of version 3.0 of application A can obtain version 3.0 of application A.
[0041] Since users may download different versions of the same installation package from multiple or certain channels, but install only a certain version of the installation package for their own needs, the remaining versions of the installation package are retained in the system, which is called redundant data.
[0042] Currently, users can use third-party cleaning software to clean up redundant data, but some installation packages are stored in the application sandbox, and third-party software cannot obtain scanning permissions and cannot clean them.
[0043] Sandbox is a virtual system program. In the sandbox, network access, access to the real system, and reading of input devices are usually prohibited or strictly restricted, so third-party software has no right to scan the sandbox.
[0044] In view of this, the present application provides a redundant installation package cleaning method, which can be applied to electronic devices, including: the electronic device first obtains different versions of installation packages of the same application, and in response to the user's installation operation on any version of the installation package in multiple installation packages, calls the system interface, scans the storage directory, and after scanning the storage directory, multiple installation package options and a first interface of the installation option can be presented, and in response to the user's selection operation on the target installation package option in the multiple installation package options and the click operation on the installation option, the target version of the installation package is installed, and then the installation packages that are not installed in the multiple installation packages are determined as redundant installation packages and the redundant installation packages are cleaned up. Since the method in the present application can call the system interface to scan all storage directories in the system, the installation packages that are not installed in the scanned multiple installation packages, that is, the redundant installation packages, can be cleaned up, thereby improving the effective rate of storage space and improving user experience.
[0045] In some embodiments, the electronic device may be a mobile phone, a tablet computer, a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, a smart watch, etc. The present application does not impose any special restrictions on the specific form of the above electronic devices. In this embodiment, the structure of the electronic device may be as follows: Figure 1 As shown, Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0046] like Figure 1 As shown, the electronic device may include a processor 110, an internal memory 121, a speaker 170A, a receiver 170B, a microphone 170C, a sensor module 180, a display screen 194, etc. The sensor module 180 may include a touch sensor 180K, etc.
[0047] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0048] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated into one or more processors. For example, in the present application, the processor 110 may be an image signal processor.
[0049] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0050] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0051] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0052] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface to realize the touch function of the electronic device.
[0053] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to realize the shooting function of the electronic device. The processor 110 and the display screen 194 communicate via the DSI interface to realize the display function of the electronic device.
[0054] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0055] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0056] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0057] A series of graphical user interfaces (GUIs) can be displayed on the display screen 194 of the electronic device, and these GUIs are the main screens of the electronic device. Generally speaking, the size of the display screen 194 of the electronic device is fixed, and only limited controls can be displayed on the display screen 194 of the electronic device. A control is a GUI element, which is a software component included in an application program, and controls all data processed by the application program and interactive operations on the data. Users can interact with the control through direct manipulation to read or edit relevant information of the application program. Generally speaking, a control can include visual interface elements such as icons, controls, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.
[0058] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0059] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device can be provided with at least one microphone 170C. In other embodiments, the electronic device can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, and directional recording function, etc.
[0060] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device, which is different from the position of the display screen 194.
[0061] In addition, an operating system is running on the above components, such as the iOS operating system developed by Apple, the Android open source operating system developed by Google, and the Windows operating system developed by Microsoft. Application programs can be installed and run on the operating system.
[0062] The operating system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device.
[0063] Figure 2 This is an example diagram of the software structure of an electronic device according to an embodiment of the present application.
[0064] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: application layer, framework layer, Android runtime and system library, and kernel layer.
[0065] The application layer can include a series of application packages. Figure 2 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0066] The framework layer provides application programming interface (API) and programming framework for the application layer. The framework layer includes some predefined functions. Figure 2 As shown, the framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0067] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0068] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0069] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0070] The phone manager is used to provide communication functions for electronic devices, such as the management of call status (including answering, hanging up, etc.).
[0071] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0072] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0073] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0074] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0075] The application layer and framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0076] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0077] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0078] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0079] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0080] A 2D graphics engine is a drawing engine for 2D drawings.
[0081] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0082] It should be noted that although the embodiments of the present application are described using the Android system as an example, its basic principles are also applicable to electronic devices based on operating systems such as iOS and Windows.
[0083] In the embodiments provided in the present application, the electronic device can download the installation package through a variety of channels, such as browsers, social software, application stores, and PC sharing, etc. The following takes the example of a user downloading the installation package in the application store.
[0084] In some embodiments, Figure 3A A schematic diagram of an electronic device application interface is shown, including multiple application software and corresponding icons. When a user performs a touch operation on the touch sensor 180K, the touch sensor 180K can obtain the user's touch operation and report the touch operation to the processor 110. After receiving the touch operation sent by the touch sensor 180K, the processor 110 can respond to the touch operation and start the application corresponding to the icon touched by the touch operation.
[0085] For example, the user's touch operation is to open an application store, and the electronic device can start the application corresponding to the application store icon 301 (which can be simply referred to as the application store) in response to the above touch operation.
[0086] In addition, in the embodiment of the present application, the electronic device can also start the application store and display the application store interface on the display screen 194 in other ways. For example, the user issues a voice command to open the application store, and the electronic device can report the received voice command to open the application store issued by the user to the processor 110 through the microphone 170C. After receiving the voice command to open the application store issued by the user, the processor 110 can respond to the user's voice command to start the application store and display the application store interface on the display screen 194. Alternatively, the user can store a shortcut command to open the application store in the electronic device in advance. For example, the shortcut command to open the application store can be set to the operation of touching the bottom of the electronic device screen and sliding upward. When the user triggers a quick operation instruction to open the application store, the touch sensor 180K can receive the quick operation instruction issued by the user and report the quick operation instruction to the processor 110. After receiving the quick operation instruction, the processor 110 can respond to the quick operation instruction, start the application store 301, and display the application store interface on the display screen 194. It should be noted that the application store can also be started in other ways in the present application. This is just an example and does not limit the way of starting the application store.
[0087] In some embodiments, Figure 3B A schematic diagram of searching for installation packages in an application store is shown. After the electronic device starts the application store 301, the user can enter the name of the application he wants to download in the search application bar 302 of the application store as needed. The electronic device can then display the corresponding application icon, application name, installation package file size and other information based on the content input by the user. The electronic device can then download the installation package of application A based on the user's operation, wherein the installation package version takes version 3.0 as an example. It should be noted that the version 3.0 installation package here is just an example and may also be other versions.
[0088] After the 3.0 version installation package of application A is downloaded, Figure 3C A schematic diagram of an installation package installation interface is shown. The processor 110 can automatically control the electronic device to display the installation interface on the display screen 194, and then the user can click the continue installation control 304A in the installation interface to trigger the continue installation operation instruction. The touch sensor 180K can receive the continue installation operation instruction issued by the user and report the continue installation operation instruction to the processor 110. The processor 110 responds to the continue installation operation instruction to control the electronic device to install the installation package to complete the installation of the corresponding application.
[0089] Of course, you can also install the installation package in other ways, such as Figure 3D10. In another installation package installation interface schematic diagram, after the installation package of application A is downloaded, the installation control 303 is changed to the opening control 305, and the user can trigger the opening control operation. In response to the user triggering the opening control operation, the electronic device can display on the display screen 194 as shown in FIG. Figure 3C The installation interface schematic diagram shown in the figure, and then the user can click the continue installation control in the installation interface to trigger the continue installation operation instruction, the touch sensor 180K can receive the continue installation operation instruction issued by the user, and report the continue installation operation instruction to the processor 110, and the processor 110 responds to the continue installation operation instruction to control the electronic device to install the installation package to complete the installation of the 3.0 version of the application A. It should be noted that the above are only two ways of installing the installation package provided in the embodiments of the present application, and those skilled in the art can set other ways of installing the application package, which are not limited here.
[0090] The above embodiment takes the case where a user downloads an installation package in an application store as an example. The following description will take the case where a user downloads an installation package in a browser as an example.
[0091] In some embodiments, the electronic device can open a browser in a manner similar to the above-mentioned embodiments. After the electronic device starts the application browser 301, the user can enter the name of the application to be downloaded in the search bar as needed. The electronic device can display the corresponding application icon, application name, installation package file size and other information. Then, the electronic device can trigger the download operation based on the user to download the installation package of application A, wherein the installation package version takes version 2.0 as an example. It should be noted that the version 2.0 installation package here is just an example and may also be other versions.
[0092] like Figure 3E A schematic diagram of the download progress of an installation package in a status bar is shown. In this embodiment, after the electronic device starts downloading the installation package of application A, the notification manager in the electronic device can display the download progress and download status of the installation package of application A in the status bar, so that the user can intuitively understand the download status of the installation package. After the installation package is downloaded, the notification manager can display a download completion notification in the status bar to inform that the installation package download is complete so as to perform subsequent operations.
[0093] like Figure 3F Another schematic diagram of the installation package download completion in the status bar is shown. After the download completion notification is displayed in the status bar, in order to install the application A in the electronic device, the user can click the download completion notification. In response to the user's click operation, the electronic device can display the following Figure 3CThe interface diagram shown in FIG. 1 shows, and then the user can click the continue installation control 304A in the installation interface to trigger the continue installation operation instruction. The electronic device responds to the continue installation operation instruction and controls the electronic device to install the installation package to complete the installation of the 2.0 version of application A. Of course, the application installation package can also be installed in other ways in this application, which is not limited here.
[0094] In some embodiments, the electronic device operating system comes with a certain version of the installation package of application A, for example, the electronic device comes with a version 1.0 installation package of application A, and the electronic device can also download different versions of the installation package of application A in the application store, browser or other channels, for example, the electronic device downloads the version 3.0 installation package of application A in the application store. The user may install the version 3.0 installation package as required, so the version 1.0 installation package stored in the electronic device becomes redundant data.
[0095] In some embodiments, the electronic device downloads different versions of the installation package of Application A through the same channel, or the electronic device downloads different versions of the installation package of Application A through different channels. Taking the example of the electronic device downloading different versions of the installation package of Application A through different channels, for example, the electronic device downloads the 3.0 version installation package of Application A in the application store, and downloads the 2.0 version installation package of Application A in the browser. The user installs the 3.0 version installation package as needed, so the 2.0 version installation package downloaded in the browser of the electronic device becomes redundant data.
[0096] Currently, users can use third-party cleaning software to clean up redundant data, but some installation packages are stored in the application sandbox, and third-party software cannot obtain scanning permissions and cannot clean them.
[0097] In order to solve the above problems, the present application also provides a redundant installation package cleaning method to clean up redundant data generated by redundant installation packages in an electronic device operating system.
[0098] In order to make the technical solution of the present application clearer and easier to understand, the redundant installation package cleaning method provided by the embodiment of the present application is described in detail below in combination with the above embodiments and corresponding drawings. Figure 1 The electronic device of the structure shown in the figure is implemented, wherein the electronic device includes a camera, a microphone and a display screen. Figure 5 A flowchart of a redundant installation package cleaning method is shown in FIG. Figure 5 As shown, the redundant installation package cleaning method provided in the embodiment of the present application may include:
[0099] S501: Download installation packages of different versions of the same application.
[0100] An installation package, also called a software installation package, is a collection of self-decompressible files. An electronic device can obtain the corresponding application by installing the installation package. It should be noted that the installation package of the same application may have different versions. Installing the installation packages of different versions of the application can obtain different versions of the application. For example, installing the installation package of version 2.0 of application A can obtain version 2.0 of application A, and installing the installation package of version 3.0 of application A can obtain version 3.0 of application A.
[0101] In addition, there are various ways to download the installation package. For example, the electronic device can download the same version or different versions of the installation package from the application store, browser, and social software, and the electronic device can download different versions of the installation package of the same application in the same way, or download different versions of the installation package of the same application in different ways. The following takes the example of downloading two different versions of the installation package of application A in different ways. Of course, the two versions here are just examples, and there can be multiple versions, which are not limited here.
[0102] like Figure 3A As shown, Figure 3A An electronic device application interface is shown. For example, a user touch operation is to open an application store. The touch sensor 180K can receive the user's touch operation on the application store icon 301 and report the touch operation on the application store icon 301 to the processor 110. After receiving the touch operation on the application store icon 301, the processor 110 can respond to the above touch operation to start the application corresponding to the application store icon 301 (which can be simply referred to as the application store).
[0103] After the electronic device starts the application store 301, the application store interface can be displayed on the display screen 194, and a number of recommended applications and a search application bar can be displayed. The user can enter the name of the application to be downloaded in the search application bar according to the needs, for example, Figure 3B As shown, if a user wants to download application A in the application store, he can enter the name of application A in the search application bar 302, and then click the confirmation search control 302A to trigger the confirmation search operation. The processor 110 in the electronic device responds to the user triggering the confirmation search operation and can display information such as the application icon, application name, and installation package file size of application A based on the content input by the user. The user can click the installation control, and the electronic device responds to the user triggering the installation control operation and starts downloading the installation package of application A. The installation package version takes version 3.0 as an example. It should be noted that the version 3.0 installation package here is just an example and can also be other versions.
[0104] In some embodiments, the electronic device can open a browser in a manner similar to the above-mentioned embodiments. After starting the application browser 301A, the electronic device can display the browser interface on the display screen 194. The user can enter the name of the application to be downloaded in the search bar as needed. For example, if the user wants to download application A in the browser, the user can enter the name of application A in the search bar and then click the search control to trigger the search operation. The processor 110 in the electronic device responds to the user triggering the search operation and can display information such as the application icon, application name, and installation package file size of application A based on the name of application A entered by the user. The user can click the download control, and the electronic device responds to the user triggering the download control operation to start downloading the installation package of application A. The installation package version takes version 2.0 as an example. It should be noted that the version 2.0 installation package here is just an example and may also be other versions.
[0105] After the installation package is downloaded, the electronic device may save information about the installation package, where the information about the installation package may include the name of the installation package, the version number of the installation package, the file size of the installation package, and the like.
[0106] S502: Start application installation and scan the application storage directory in the system.
[0107] After the installation package is downloaded, the electronic device can respond to the user operation, parse the name, version number, file size and other information of the installation package and start the application installation, and display the following information: Figure 3C As shown in the schematic diagram, users can click Figure 3C The continue installation control 304A in the system triggers the continue installation operation instruction. In response to the continue installation operation instruction, the electronic device can scan the application storage directory in the system, such as Figure 3G FIG. 1 shows a schematic diagram of an interface for scanning an application storage directory in a system, wherein, according to the parsed installation package name, an installation package having the same name as the parsed installation package but a different version is scanned, such as Figure 4A A schematic diagram of an interface for selecting different versions of installation packages is shown, in which the parsed installation package name and version number and the scanned installation package name and version number are all displayed. Figure 4A In the installation package, users can select the target version.
[0108] Further, taking the installation package of version 3.0 downloaded from the application store as an example, after the installation package of application A is downloaded, Figure 3D As shown, the installation control 303 is changed to the opening control 305, and the user can trigger the opening control operation. In response to the user triggering the opening control operation, the electronic device can display on the display screen 194 as shown in FIG. Figure 3CAs shown in the interface diagram, the user can click the continue installation control 304A in the installation interface to trigger the continue installation operation instruction. The touch sensor 180K can receive the continue installation operation instruction issued by the user and report the continue installation operation instruction to the processor 110. In response to the continue installation operation instruction, the processor 110 controls the electronic device to call the acquisition interface function preset by the system to scan and parse the installation packages with the same installation package name but different versions.
[0109] The following takes the installation package of version 2.0 downloaded from the browser as an example. After the installation package is downloaded, the notification manager can display a download completion notification in the status bar to inform that the installation package download is complete. Figure 3F As shown, after the download completion notification is displayed in the status bar, in order to install application A in the electronic device, the user can click on the download completion notification, and the electronic device can display the following in response to the user's click operation: Figure 3C As shown in the interface diagram, the user can then click the Continue Installation control 304A in the installation interface to trigger the Continue Installation operation instruction. The electronic device responds to the Continue Installation operation instruction by calling the system's pre-set interface to scan and parse installation packages with the same installation package name but different versions.
[0110] Of course, the embodiments provided in the present application can also install the installation package in other ways. For example, the electronic device can detect the download status of the installation package in real time, and automatically display the status on the display screen 194 in response to detecting that the installation package download is complete. Figure 3C The interface diagram shown is for the user to perform the next step, and is not limited here.
[0111] In some embodiments, the acquisition interface function can be preset as Public List <systeminstallpackageinfo>getSystemTotalPackageInfo(String pckname, intvercode){}, used to obtain installation packages with the same name as the parsed installation package but different versions in all directories in the system. The SystemInstallPackageInfo function is used to scan the name, version number, file size, creation date, download path and latest version of all installation packages in the system. It can include parameters such as String packageName, intversionCode, long fileSize, Date createDate, String filePath, Int isLatestVersion, etc. String packageName is used to scan the name of the installation package, int versionCode is used to scan the version number of the installation package, long fileSize is used to scan the file size of the installation package, Date createDate is used to scan the creation date of the installation package, String filePath is used to scan the download path of the installation package, and Int isLatestVersion is used to scan the latest version of the installation package.
[0112] getSystemTotalPackageInfo(String pckname, int vercode) is used to scan all directories in the system for installation packages with the same name as the parsed installation package but different versions. It can include parameters such as String pckname and intvercode. String pckname can be used to scan installation packages with the same name as the parsed installation package, and intvercode is used to scan different versions of the installation package with the same name as the parsed installation package.
[0113] In some embodiments, the electronic device downloads the installation package of version 3.0 of application A from the application store, downloads the installation package of version 2.0 of application A in the browser, and in response to the user operation, starts to install version 3.0 of application A. The electronic device can call the SystemInstallPackageInfo function to scan the name, version number, file size, creation date, download path, and latest version of all installation packages in the system, and call (getSystemTotalPackageInfo(String pckname, int vercode) function obtains the installation package with the same name as the parsed installation package but different versions from all installation package information, such as the installation package of application A of version 2.0, and the return value can be judged by the listsize function, and then the size of the return value and the first threshold value can be judged, wherein the first threshold value can be set as required, such as 0, and the return value can be represented by a number. If the return value is greater than the first threshold value, it can be determined that the return value is a few numbers that can represent how many other versions of the installation package there are in addition to the parsed version of the installation package. For example, in this embodiment, the electronic device stores application A3.0 version and 2.0 version installation package, when the application A of version 3.0 is started and installed, the 3.0 version number of application A can be parsed, and then the listsize function is used to judge whether the return value is greater than the first threshold value. In this embodiment, the return value is a number 1 greater than the first threshold value 0, indicating that in addition to the 3.0 version of application A, there is another version, that is, the 2.0 version of the application A installation package, if the return value is equal to the first threshold value of 0, it means that there is only the parsed version of the installation package in the current electronic device.
[0114] After the scan is completed, if it is determined that the return value of the listsize function is greater than the first threshold, the following display can be displayed: Figure 4A In the interface shown, the parsed installation package name and version number and the scanned installation package name and version number are all displayed Figure 4A In the example, the user can select the target version of the installation package, wherein the listsize function can also be called the first function.
[0115] S503: Install the installation package of the target version.
[0116] In display Figure 4A After the interface is shown, the user can choose to install the target version of the installation package as needed. First, the user can determine the target version of the installation package as needed, and then click the target version of the installation package from multiple versions of the installation packages. Then, the user can further click the installation control 401 to trigger an installation operation instruction carrying the target version installation package information selected by the user. The touch sensor 180K can receive the installation operation instruction issued by the user and report the installation operation instruction to the processor 110. In response to the installation operation instruction, the processor 110 can install the target version of the installation package according to the target version installation package information carried in the instruction.
[0117] In some embodiments, the user selects the first target version of the installation package from the displayed multiple versions of the installation package. Due to some reasons, a non-latest version of the installation package may be selected as the first target installation package. After the electronic device responds to the installation operation instruction issued by the user, the electronic device can call the pre-set SystemInstallPackageInfo.isLatestVersion function, and use the return value of the function to determine whether the current default selected version is the latest version. If the return value of the function is equal to the second threshold, it can be determined that the current default selected version of the installation package is the latest version of the installation package. When the user selects other versions of the installation package, the electronic device can display a reminder pop-up window in the interface. Among them, the SystemInstallPackageInfo.isLatestVersion function can also be called the second function, which is illustrated below.
[0118] Taking the example of an electronic device storing version 3.0 and version 2.0 installation packages of application A, the second threshold can be set to 1.
[0119] In some examples, when displaying Figure 4A After the interface shown, the electronic device can automatically determine the latest version of the installation package as the default selected installation package, and call the second function to further determine whether the default selected installation package is the latest version through the return value of the second function, such as Figure 4A The default selected version displayed in the display is the installation package of version 3.0, which is the latest version, so the electronic device calls the second function, and the return value of the second function is equal to the second threshold value, which is 1. After determining that the default selected version is the latest version, if the user clicks the option of application A version 2.0, the electronic device selects and determines the installation package of the first target version according to the user operation, that is, the installation package of application A version 2.0 is installed. At this time, since the installation package of application A version 2.0 is not the latest version of the installation package, the electronic device can display the following Figure 4B A schematic diagram of an installation package interface including a reminder pop-up window is shown. The reminder pop-up window may include a yes option, a no option and an install current package option. When the user selects the yes option, the electronic device can determine to install the latest version of the installation package, that is, to install the 3.0 version of the installation package of application A. When the user selects the no option, the electronic device can determine to cancel the installation of the installation package. When the user selects the install current package option, the electronic device can determine to continue to install the current version of the installation package, that is, to continue to install the 2.0 version of the installation package of application A. The electronic device can then determine whether to install the latest version of the installation package or continue to install the current version of the installation package based on the user's selection of the option, and then determine the second target version of the installation package that needs to be installed. It should be noted that this embodiment only takes the 3.0 version and 2.0 version of the installation package of application A as an example, and is not limited here.
[0120] Specifically, the release time of each version of the installation package can be obtained through the Internet or other channels, and the installation package with the latest release time can be determined as the latest version of the installation package. For example, the installation package of version 3.0 of application A was released on November 1, 2022, and the installation package of version 2.0 of application A was released on October 1, 2022. It can be determined that the installation package of version 3.0 of application A is the new version of the installation package.
[0121] In some embodiments, in order to save user operations, the electronic device can automatically determine that the latest version of the installation package is the target version of the installation package, and then install the target version of the installation package.
[0122] It should be noted that the above embodiment only takes downloading two different versions of installation packages as an example. Of course, you can also download only one version of the installation package and install the downloaded installation package in the same way.
[0123] S504: In response to the installation of the target version of the installation package being completed, clearing redundant installation packages.
[0124] The electronic device can detect the installation status of the installation package in real time, and in response to the installation completion of the installation package of the target version, can clean up the redundant installation packages of the remaining versions.
[0125] Furthermore, the system can pre-set the deletion interface, Public int delSystemInstallPackage(List <string>filepath){}, where delSystemInstallPackage(List <string>The filepath) function is used to delete redundant installation packages of versions other than the target version based on the download path. <string>filepath can be used to scan the download path of the installation package.
[0126] In some embodiments, the electronic device can call delSystemInstallPackage(List <string>The filepath) function deletes redundant installation packages of versions other than the target version, where List <string>The delSystemInstallPackage(List filepath) function is used to scan the download path of the installation package. For example, the download path of the 3.0 version of the installation package comes from the app store, and the download path of the 2.0 version of the installation package comes from the browser. After the installation of the 3.0 version of the installation package of application A is completed, the 2.0 version of the installation package of the application is a redundant installation package. By calling delSystemInstallPackage(List filepath) <string>The filepath) function can delete the 2.0 version installation package downloaded through the browser path, and then display the following on the display screen 194: Figure 4C An interface for completing the cleaning of redundant installation packages is shown.
[0127] In some embodiments, see Figure 6 A flowchart of another redundant installation package cleaning method provided by the present application, wherein after the target version is installed and the latter responds to the installation package of the target version being installed, the electronic device may display the following Figure 4D A schematic diagram of an interface including a prompt pop-up window is shown. The prompt pop-up window may include a yes option and a no option. When the user selects the yes option, the electronic device can determine to clean up the redundant installation packages. When the user selects the no option, the electronic device can determine not to clean up the redundant installation packages. The electronic device can then determine whether to clean up the redundant data packets based on the user's selection of options.
[0128] The present application provides a redundant installation package cleaning method, including: the electronic device can download different versions of the installation package in the same way or different ways, and then start the application installation in response to the user operation or automatically start the application installation in response to the detection of the installation package download completion, and can parse the installation package name and version number of the installation package to start the installation, scan the application storage directory in the system by calling the preset acquisition interface function, obtain the installation package with the same name but different version as the parsed installation package in all directories in the system, and display the scanned installation packages of different versions on the display screen of the electronic device, and then determine the target version of the installation package according to the user's selection operation, and then the electronic device can install the target version of the installation package, in response to the installation completion, the electronic device can call the preset deletion interface function to delete the redundant installation packages of the remaining versions except the target version. After starting the application installation in the present application, the application storage directory in the system can be scanned by calling the preset acquisition interface function, and the installation packages of different versions in all directories can be displayed, and the installation package of the target version can be determined from the installation packages of different versions, and then the installation package of the target version can be installed, and then the preset deletion interface function can be called to clean up the redundant installation packages, so that the redundant installation packages that cannot be cleaned up in the prior art can be cleaned up.
[0129] The embodiment of the present application also provides an electronic device, including: a memory;
[0130] One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device executes the method described in any one of the above embodiments.
[0131] An embodiment of the present application further provides a computer storage medium, comprising computer instructions, which, when executed on a mobile terminal, enables the electronic device to execute a method as described in any one of the above embodiments.
[0132] An embodiment of the present application further provides a computer program product, including instructions; when the instructions are executed by an electronic device, the electronic device executes any of the methods described in the above embodiments.
[0133] The technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk, etc., various media that can store program codes.
[0134] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.< / string> < / string> < / string> < / string> < / string> < / string> < / systeminstallpackageinfo>
Claims
1. A redundant installation package cleaning method, applied to electronic equipment, characterized in that: include: Obtain multiple installation packages, where the multiple installation packages are installation packages of different versions of the same application; In response to a user's installation operation on any version of an installation package among the multiple installation packages, a preset acquisition interface function is called to scan the storage directory, wherein the interface function is used to acquire installation packages with the same name as the installation package but with different versions in all directories in the system; In response to completing the scanning of the storage directory, calling a preset first function and determining a return value of the first function; In response to the return value of the first function being greater than a first threshold, presenting a first interface, the return value of the first function being used to indicate the number of installation packages of other versions of the application in the storage directory except for the parsed version installation package, the first interface including a plurality of installation package options and installation options, different installation package options corresponding to installation packages of different versions, and the first threshold being 0; Determine the latest version of the installation package of the application in the storage directory as the latest default selected version of the installation package; Calling a preset second function to determine a return value of the second function; In response to the return value of the second function being equal to a second threshold, determining that the installation package of the default selected version is the installation package of the latest version; In response to a user selecting a target installation package option from a plurality of installation package options and clicking an installation option, and the installation package of the first target version is different from the installation package of the latest default selected version, presenting a reminder pop-up window, the reminder pop-up window including a yes option, a no option, and an install current package option; The target installation package option corresponds to the installation package of the first target version; If the user selects the Yes option in the reminder pop-up window, the latest version of the installation package is installed; if the user selects the Install current package option in the reminder pop-up window, the first target version of the installation package is installed; the installation package that is not installed in the multiple installation packages is determined as a redundant installation package, and a reminder pop-up window is presented, wherein the reminder pop-up window includes a Yes option and a No option; In response to the user's operation on the option in the prompt pop-up window, a preset deletion interface function is called to clean up the redundant installation package, thereby cleaning up the redundant installation package.
2. The method according to claim 1, characterized in that: The calling of a preset acquisition interface function and scanning of a storage directory includes: Call the SystemInstallPackageInfo function and the (getSystemTotalPackageInfo(String pckname, int vercode) function to scan the storage directory; the SystemInstallPackageInfo function is used to scan the name, version number, file size, creation date, download path and latest version information of all installation packages in the system, and the (getSystemTotalPackageInfo(String pckname, int vercode) function is used to obtain an installation package with the same name as the parsed installation package but a different version from all installation package information.
3. The method according to claim 1, characterized in that The scanned storage directory includes: The installation interface is displayed; In response to a user clicking operation on a continue installation control in the installation interface, a storage directory is scanned.
4. An electronic device, characterized in that: include: Memory; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device performs the method according to any one of claims 1 to 3.
5. A computer storage medium, characterized in that: The method comprises computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Application management system and method
CN104793978A
Application program installation method and device
CN104951336A
Application program installation method, device, storage medium and terminal
CN109508198A
Application version management method and mobile terminal
CN110543329A
