Compression processing method, electronic device and computer-readable storage medium

By selecting a compression algorithm based on the remaining storage space of the electronic device and user behavior prediction, the problem that compression processing in the prior art cannot flexibly match user needs, and the user experience and the stability of stored data are improved.

CN119576882BActive Publication Date: 2025-08-01HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411961369.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-08-01
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

In the prior art, the compression processing of electronic devices cannot flexibly match user needs and experiences in different scenarios, resulting in the inability to release the compression benefits that best meet users' expectations.

Method used

By selecting the appropriate compression algorithm based on the remaining storage space and historical usage information of the electronic device, combining the prediction of user behavior, dynamically adjusting the compression processing process, giving priority to algorithms with high compression rate or high decoding speed, reducing algorithm jumps, and improving the stability and user experience of stored data.

Benefits of technology

It realizes the release of compressed benefits that meet users' expectations in different usage stages, improves the user experience, and reduces the instability and repeated compression of stored data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576882B_ABST
    Figure CN119576882B_ABST
Patent Text Reader

Abstract

This application relates to the field of data processing, and in particular to a compression processing method, an electronic device, and a computer-readable storage medium. In the embodiments of this application, the selection process of the compression algorithm is added, making the compression processing more flexible and adaptable, and capable of releasing compression benefits that meet the user's expectations at different usage stages of the electronic device, which is conducive to improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, and in particular to a compression processing method, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the development of intelligent terminals, people's dependence on electronic devices is increasing. In daily life, users use electronic devices to chat, take pictures, work, and entertain, etc. As the degree of use of electronic devices by users increases, users also pay more and more attention to the remaining amount of storage space of electronic devices.

[0003] In some solutions, files in the storage space of an electronic device are losslessly compressed to free up storage space. However, currently, a fixed compression algorithm is usually used for compression processing, which cannot flexibly match the user needs and experiences in different scenarios, and the most suitable compression gain for users' expectations cannot be released at different usage stages of the electronic device. Summary of the Invention

[0004] This application provides a compression processing method, an electronic device, and a computer-readable storage medium, which can release a compression gain that meets users' expectations at different usage stages of the electronic device, and is beneficial to improving the user experience.

[0005] To achieve the above object, this application adopts the following technical solutions:

[0006] In a first aspect, a compression processing method is provided, including:

[0007] Select a first target compression algorithm according to the remaining storage space of the electronic device and the first information; wherein, the first target compression algorithm is the first algorithm or the second algorithm, and the compression rate of the first algorithm is higher than that of the second algorithm; the first information is used to indicate whether the first algorithm has been used in a preset historical time period;

[0008] Compress the files in the storage space of the electronic device according to the first target compression algorithm.

[0009] In the embodiments of the present application, a selection process of the compression algorithm is added, making the compression process more flexible and adaptable. It can release compression benefits that meet the user's expectations at different usage stages of the electronic device, which is conducive to improving the user experience. In addition, during the process of selecting the compression algorithm, the remaining storage space of the electronic device is considered. Since the compression ratios of the first algorithm and the second algorithm are different, selecting the compression algorithm according to the remaining storage space helps to release more storage space. In addition, during the process of selecting the compression algorithm, the usage of the algorithm with a higher compression ratio (such as the first algorithm) within a preset historical time period is also considered, which is equivalent to considering the historical status of the storage space. This method can reduce the frequent jump of the compression algorithm, thereby helping to improve the stability of the stored data.

[0010] For example, the first algorithm can be the Zstandard (also known as zstd) algorithm, and the second algorithm can be the lz4 algorithm.

[0011] In an implementation manner of the first aspect, the selecting the first target compression algorithm according to the remaining storage space of the electronic device and the first information includes:

[0012] If the remaining storage space is less than the preset value, the first target compression algorithm is the first algorithm.

[0013] If the remaining storage space is greater than or equal to the preset value, and the first information indicates that the first algorithm has not been used within the preset historical time period, the first target compression algorithm is the second algorithm.

[0014] If the remaining storage space is greater than or equal to the preset value, and the first information indicates that the first algorithm has been used within the preset historical time period, the first target compression algorithm is the first algorithm.

[0015] Optionally, the same preset value can be set for different total storage spaces.

[0016] Optionally, different preset values can also be set for different total storage spaces.

[0017] In the implementation of this application, it is equivalent to giving priority to considering the remaining storage space. When the remaining storage space is small, a compression algorithm with a high compression ratio is adopted, which helps to free up more storage space. When the remaining storage space is large, the usage of a compression algorithm with a relatively high compression ratio (such as the first algorithm) in the historical time period is considered, which is equivalent to considering the historical situation of the storage space. For example, when the remaining storage space is near the threshold, such as equal to or just less than the preset value, the first algorithm is used for compression processing. After processing, part of the storage space is freed up, so that the remaining storage space is greater than or equal to the preset value. If the second algorithm is used, it may cause the compression algorithm to jump repeatedly near the available space threshold. If the first algorithm is still continued to be used, it can reduce the repeated jumping of the compression algorithm near the available space threshold, which is beneficial to improving the stability of the stored data.

[0018] In one implementation manner of the first aspect, the compressing the files in the storage space of the electronic device according to the first target compression algorithm includes:

[0019] Scanning the storage space of the electronic device to obtain a first application; wherein, the usage frequency of the first application is lower than a preset frequency;

[0020] Compressing the first application according to the first target compression algorithm.

[0021] Optionally, in one implementation manner of counting the usage frequency of the application program, the number of times the application program is used in a certain historical time period can be counted; the usage frequency is calculated according to the number of times and the historical time period.

[0022] Optionally, in another implementation manner of counting the usage frequency of the application program, the number of times the application program is used and the usage duration of each use in a certain historical time period can be counted; the usage frequency is calculated according to the number of times and the historical time period; if the usage frequency is greater than a preset frequency threshold and the usage duration of each use is less than a preset duration, it is determined that the usage frequency of the application program is lower than the preset frequency; if the usage frequency is greater than a preset frequency threshold but the usage duration of each use is not less than the preset duration, it is determined that the usage frequency of the application program is higher than the preset frequency; if the usage frequency is less than a preset frequency threshold, it is determined that the usage frequency of the application program is higher than the preset frequency.

[0023] In the above embodiment, it is equivalent to compressing the infrequently used application programs and not compressing the frequently used application programs. In this way, the compression processing method can better adapt to the user's usage habits and helps to release the compression benefits that meet the user's needs.

[0024] In one implementation manner of the first aspect, the compressing the first application according to the first target compression algorithm includes:

[0025] When the first target compression algorithm is the second algorithm, compress the files of the first application according to the second algorithm.

[0026] When the first target compression algorithm is the first algorithm, determine a second target compression algorithm according to the second information of the first application; wherein, the second information is used to indicate whether the first application will be used within a preset future time period; compress the first application according to the second target compression algorithm.

[0027] In the embodiments of the present application, the second information can characterize the prediction of the user's behavior of using the application program. When a compression algorithm with a high compression rate is determined, the application data in the storage space is adaptively compressed through the prediction of the user's behavior of using the application program, so that the compression processing method can better adapt to the user's usage habits and help release the compression benefits that meet the user's needs.

[0028] Optionally, one way to obtain the second information may include: if the first application is in the preset whitelist and the application type of the first application is the preset type, the second information of the first application indicates that the user will use the first application within the future time period; if the first application is not in the preset whitelist and / or the application type of the first application is not the preset type, the second information of the first application indicates that the user will not use the first application within the future time period.

[0029] Optionally, another way to obtain the second information may include: input the keep-alive configuration and application type of the first application into the trained prediction model, and output the second information of the first application.

[0030] In the above embodiments, it is equivalent to predicting the probability of the user's use of the first application within the future time period according to the preset whitelist and application type, and adaptively compressing the application data in the storage space through the prediction of the user's behavior of using the application program, so that the compression processing method can better adapt to the user's usage habits and help release the compression benefits that meet the user's needs.

[0031] In one implementation manner of the first aspect, the determining the second target compression algorithm according to the second information of the first application includes:

[0032] If the second information indicates that the user will not use the first application within the future time period, the second target compression algorithm is the first algorithm;

[0033] If the second information indicates that the user will use the first application within the future time period, the second target compression algorithm is the second algorithm.

[0034] In the above implementation, it is equivalent to compressing the first application with a first algorithm having a relatively high compression ratio when it is predicted that the user will not use the first application in the future time period, so as to release more storage space; while when it is predicted that the user will use the first application in the future time period, the first application is compressed with a second algorithm having a relatively low compression ratio but a relatively high decoding speed, so that the first application can be quickly decoded when the user uses it, which is beneficial to improving the user experience. Through the above method, by predicting the user's behavior of using the application program, the application data in the storage space is adaptively compressed, so that the compression processing method can better adapt to the user's usage habits and helps to release the compression gain that meets the user's needs.

[0035] In one implementation of the first aspect, the compressing the first application according to the first target compression algorithm includes:

[0036] If the first application is in a compressed state, it is determined whether the compression algorithm corresponding to the compressed file of the first application is the second target compression algorithm;

[0037] If the compression algorithm corresponding to the compressed file of the first application is the second target compression algorithm, there is no need to compress the first application;

[0038] If the compression algorithm corresponding to the compressed file of the first application is not the second target compression algorithm, the compressed file of the first application is decompressed, and the first application is compressed according to the second target compression algorithm.

[0039] If the first application is not in a compressed state, the first application is compressed according to the second target algorithm.

[0040] In the above implementation, the judgment of the compression state of the first application is added, which can effectively reduce the situation of repeated compression and help to improve the reliability of the compression processing.

[0041] In a second aspect, an electronic device is provided, including:

[0042] One or more processors;

[0043] One or more memories;

[0044] The memory stores a computer program, and when the computer program is executed by the processor, the electronic device realizes the method according to any item of the first aspect.

[0045] In a third aspect, a chip system is provided. The chip system includes a processor, the processor is coupled to a memory, and the processor is configured to run a computer program stored in the memory to realize the method according to any item of the first aspect.

[0046] In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by one or more processors, the method described in any one of the first aspects is implemented.

[0047] In a fifth aspect, a computer program product is provided, which includes computer program code. When the computer program code runs on an electronic device, the electronic device is caused to implement the method described in any one of the first aspects.

[0048] It can be understood that for the beneficial effects of the above second to fifth aspects, reference can be made to the relevant descriptions in the first aspect above, and details are not repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 FIG. is a schematic structural diagram of an electronic device provided by an embodiment of the present application;

[0050] Figure 2 FIG. is a software structure block diagram of the electronic device 100 according to an embodiment of the present application;

[0051] Figure 3 FIG. is a schematic flowchart of a compression processing method provided by an embodiment of the present application;

[0052] Figure 4 FIG. is a schematic flowchart of the selection process of a compression algorithm provided by an embodiment of the present application;

[0053] Figure 5 FIG. is a schematic diagram of a compression processing flow provided by an embodiment of the present application;

[0054] Figure 6 FIG. is an interactive schematic diagram of a compression process provided by an embodiment of the present application;

[0055] Figure 7 FIG. is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0056] Figure 8 FIG. is a schematic diagram of an application scenario provided by another embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0057] In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details.

[0058] It should be understood that when used in the specification and appended claims of this application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.

[0059] It should also be understood that in the embodiments of this application, "one or more" means one, two or more; "and / or" describes the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0060] In addition, in the description of the specification and appended claims of this application, the terms "first", "second", "third", "fourth", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.

[0061] The reference to "one embodiment" or "some embodiments" etc. described in the specification of this application means that the specific features, structures or characteristics described in connection with that embodiment are included in one or more embodiments of this application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized.

[0062] With the development of intelligent terminals, people's dependence on electronic devices is increasing. In daily life, users use electronic devices to chat, take pictures, work, entertain, etc. As the degree of use of electronic devices by users increases, users are also more and more concerned about the remaining amount of storage space in electronic devices.

[0063] In some solutions, the files in the storage space of the electronic device are losslessly compressed to free up storage space. However, currently, a fixed compression algorithm is usually used for compression processing, which cannot flexibly match the user needs and experiences in different scenarios, and the most suitable compression gain expected by users cannot be released at different usage stages of the electronic device.

[0064] Based on this, an embodiment of the present application provides a compression processing method. In the embodiment of the present application, the selection process of the compression algorithm is added, making the compression processing more flexible and more adaptable, and capable of releasing compression benefits that meet the user's expectations at different usage stages of the electronic device, which is beneficial to improving the user experience.

[0065] The compression processing method provided by the embodiment of the present application can be applied to an electronic device. The electronic device includes a terminal device, and the terminal device can also be referred to as a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device can be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a smart screen, a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, and so on. The embodiments of the present application do not limit the specific technologies and specific device forms adopted by the electronic device.

[0066] See Figure 1, which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, a first antenna 1, a second 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, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a touch sensor 180K, an ambient light sensor 180L, etc.

[0067] It can be understood that the structure schematically shown in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0068] 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 processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0069] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.

[0070] A memory can also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can hold the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses and reduces the waiting time of the processor 110, thus improving the efficiency of the system.

[0071] The external memory 120 generally refers to the external storage. In the embodiments of the present application, the external memory refers to the storage other than the internal memory of the electronic device and the cache of the processor, and this storage is generally a non-volatile memory.

[0072] The internal memory 121, which can also be referred to as "memory", can be used to store computer-executable program codes, and the executable program codes include instructions. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, the image playback function, etc.).

[0073] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1. In some embodiments, the electronic device 100 displays a user interface through the display screen 194.

[0074] The electronic device 100 realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change the display information.

[0075] The electronic device 100 can implement the shooting function through the ISP, camera 193, video codec, GPU, display screen 194, application processor, etc.

[0076] The camera 193 is used to capture static images or videos. An object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard format such as RGB or YUV. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0077] The electronic device 100 also includes various sensors that can convert various different physical signals into electrical signals. Exemplarily, the pressure sensor 180A is used to sense pressure signals and can convert pressure signals into electrical signals. The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. The barometric pressure sensor 180C is used to measure barometric pressure. The magnetic sensor 180D includes a Hall sensor. The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance through infrared or laser. The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light brightness. The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access to application locks, fingerprint photography, fingerprint answering of incoming calls, etc. The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 executes a temperature processing strategy using the temperature detected by the temperature sensor 180J. The bone conduction sensor 180M can acquire vibration signals.

[0078] The touch sensor 180K, also known as the "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 together form a touch screen, also known as the "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can transmit 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 some other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from that of the display screen 194.

[0079] Exemplarily, in the embodiments of the present application, the touch sensor 180K can detect a click operation of a user on an icon of an application program, and transmit the detected click operation to the application processor to determine that the click operation is used to start or run the application program, and then execute the running operation of the application program.

[0080] The wireless communication function of the electronic device 100 can be implemented by the first antenna 1, the second antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.

[0081] The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor, etc. Such as music playback, recording, etc.

[0082] The above is a specific description of the embodiments of the present application by taking the electronic device 100 as an example. It should be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. The electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in the figure can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.

[0083] In addition, an operating system runs on the above components. Such as the iOS operating system, the Android open source operating system, and the Windows operating system, etc. Application programs can be installed and run on this operating system.

[0084] The operating system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. The embodiments of the present application take the Android system with a layered architecture as an example to exemplarily illustrate the software structure of the electronic device 100.

[0085] Figure 2It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.

[0086] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application framework layer, the system libraries and the Android runtime, and the kernel layer.

[0087] The application layer may include a series of application packages.

[0088] Such as Figure 2 shown, the application packages may include applications such as a camera, a gallery, a calendar, a call, a map, shopping, music, video, short message, and a system manager. For example: the system manager, which can be used to be responsible for the space cleaning, security protection, and software management of the electronic device, etc. Taking a mobile phone as an example, the system manager can also be called a mobile phone manager, etc. The embodiments of the present application do not make specific limitations on the names of the applications.

[0089] It can be understood that the space cleaning function of the electronic device can be set as a separate application or deployed in other applications, and the embodiments of the present application do not make specific limitations on this.

[0090] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.

[0091] Such as Figure 2 shown, the application framework layer may include StorageManagerService (SMS), a learning library, a window manager, a content provider, a view system, a resource manager, and a notification manager, etc.

[0092] SMS is responsible for communicating with the upper-layer UI (such as SystemUI and Settings), handling operations such as mounting, unmounting, and formatting of storage devices, and providing corresponding notifications and feedback to the user.

[0093] The learning library can be used to predict the user's usage behavior of applications.

[0094] The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0095] The content provider is used to store and obtain data, and make this data accessible to the application. The data can include monitoring data obtained by the sensor module 180 (such as acceleration data obtained by the acceleration sensor 180E), videos, images, audio, incoming and outgoing calls, browsing history and bookmarks, phone book, etc.

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

[0097] The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.

[0098] The notification manager enables the application to display notification information in the status bar. It can be used to convey notification-type messages, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform that the download is complete, message reminders (such as travel messages, 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 a notification of a background-running application, or a notification that appears in the form of a dialogue window on the screen. For example, it can prompt text information in the status bar, emit a prompt tone, vibrate the electronic device, blink the indicator light, etc.

[0099] In the embodiments of the present application, the application framework layer may include a camera access interface. Among them, the camera access interface is used to provide an application programming interface and a programming framework for the camera application.

[0100] Android runtime includes a core library and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system.

[0101] The core library contains two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core library of Android.

[0102] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application 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.

[0103] The system layer may include multiple functional modules. For example: an initialization module, media libraries, a 3D graphics processing library (such as: OpenGL ES), and a 2D graphics engine (such as: SGL), etc.

[0104] The initialization module is used to execute the selection process in the compression processing method provided by the embodiments of the present application to implement the selection of different compression algorithms.

[0105] The media library supports the playback and recording of a variety of common audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0106] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.

[0107] The 2D graphics engine is a drawing engine for 2D drawing.

[0108] The kernel layer is the layer between the hardware and the software, responsible for the management of the underlying hardware, including process scheduling, memory management, and device drivers, etc. The kernel layer at least includes a display driver, a camera driver, a memory driver, and a compression module.

[0109] Among them, the memory driver is used to manage the physical memory (such as memory) and disk space to ensure that the application programs and system services can run stably and efficiently.

[0110] The compression module is used to perform corresponding compression processing on the storage space (such as memory) of the electronic device according to the compression algorithm selected by the initialization module. For example, the compression module can adopt a flash-friendly filesystem (F2FS).

[0111] Next, in combination with the above hardware structure and software structure, the compression processing method of the embodiments of the present application will be introduced.

[0112] See Figure 3 , which is a schematic flowchart of the compression processing method provided by the embodiments of the present application. As an example rather than a limitation, as Figure 3 shown, the compression processing method may include the following steps:

[0113] S301, select a first target compression algorithm according to the remaining storage space of the electronic device and the first information.

[0114] Among them, the first target compression algorithm is the first algorithm or the second algorithm, and the compression rate of the first algorithm is higher than that of the second algorithm. The first information is used to indicate whether the first algorithm has been used during a preset historical time period.

[0115] For example, the first algorithm can be the Zstandard (also known as zstd) algorithm, and the second algorithm can be the lz4 algorithm.

[0116] Among them, the principle of the zstd algorithm is as follows: Before compression, a dictionary is established to store the uncompressed data (original data); the input data is analyzed to find the repeated patterns therein and replace them with some shorter pointers pointing to the repeated data that has been compressed previously; the encoding rules are determined; according to the analysis results and the encoding rules, the original data is compressed into a continuous binary data segment.

[0117] The zstd algorithm can use multiple compression levels, and the corresponding compression speed and compression ratio are different for different compression levels. In addition, during the encoding process, the zstd algorithm can make the encoding length of high-frequency words short and that of low-frequency words long, thereby achieving a higher compression ratio.

[0118] The principle of the lz4 algorithm is as follows: Through the dictionary encoding theory, long strings (matching items or phrases) are encoded into short tags, and the phrases in the dictionary are replaced with the small tags, thereby achieving the purpose of data compression.

[0119] Compared with the zstd algorithm, the lz4 algorithm has a faster compression speed and decompression speed, but the zstd algorithm has a higher compression ratio.

[0120] In one embodiment, refer to Figure 4 , which is a schematic diagram of the selection process of the compression algorithm provided by the embodiment of the present application. In one implementation, the selection process of the compression algorithm in the embodiment of the present application can be executed by Figure 2 the initialization module at the system layer shown.

[0121] By way of example and not limitation, as Figure 4 shown, S301 may include:

[0122] S401, after starting to execute the selection process of the compression algorithm, obtain the remaining storage space of the electronic device.

[0123] Taking Figure 2 the initialization module at the system layer shown as an example to execute the selection process of the compression algorithm, the initialization module obtains the remaining storage space of the physical memory (such as memory or hard disk) of the electronic device through the memory driver at the kernel layer.

[0124] S402, determine whether the remaining storage space of the electronic device is less than a preset value.

[0125] If the remaining storage space is less than the preset value, execute S403; if the remaining space is not less than the preset value, execute S404.

[0126] S403, if the remaining storage space of the electronic device is less than the preset value, then determine the first algorithm as the first target compression algorithm.

[0127] S404. If the remaining storage space of the electronic device is greater than or equal to the preset value, then determine whether the first algorithm has been used within the preset historical time period.

[0128] If the first algorithm has been used within the preset historical time period, then execute S403, that is, determine the first algorithm as the first target compression algorithm; if the first algorithm has not been used within the preset historical time period, then execute S405.

[0129] S405. If the first algorithm has not been used within the preset historical time period, then determine the second algorithm as the first target compression algorithm.

[0130] Among them, the historical time period can be a preset fixed value. For example, the historical time period can be one day, 7 days, one month, and so on.

[0131] Exemplarily, referring to Table 1, it shows the compression algorithms corresponding to different storage spaces.

[0132]

[0133] As shown in Table 1, the total storage space is 128G, and the preset value is C1; the total storage space is 256G, and the preset value is C2; the total storage space is 512G, and the preset value is C3; the total storage space is 1T, and the preset value is C4.

[0134] The first piece of information is "N", indicating that the first algorithm has not been used within the preset historical time period. The first piece of information is "Y", indicating that the first algorithm has been used within the preset historical time period.

[0135] Taking 128G as an example, when the remaining storage space is less than C1, regardless of whether the first piece of information is "N" or "Y", the first algorithm is adopted. When the remaining storage space is greater than or equal to C1 and the first piece of information is "N", the second algorithm is adopted; when the remaining storage space is greater than or equal to C1 and the first piece of information is "Y", the first algorithm is adopted.

[0136] Optionally, for different total storage spaces, the same preset value can be set. For example, the values of C1, C2, C3, and C4 are the same.

[0137] Optionally, for different total storage spaces, different preset values can also be set. For example, the values of C1, C2, C3, and C4 are different.

[0138] In some other embodiments, the ratio of the remaining storage space to the total storage space can also be used as a limiting condition for selecting the compression algorithm. Specifically:

[0139] If the ratio of the remaining storage space to the total storage space is less than the preset ratio, then determine the first algorithm as the first target compression algorithm;

[0140] If the ratio of the remaining storage space to the total storage space is greater than or equal to a preset ratio, and the first information indicates that the first algorithm has not been used within a preset historical time period, then determine the second algorithm as the first target compression algorithm;

[0141] If the ratio of the remaining storage space to the total storage space is less than the preset ratio, and the first information indicates that the first algorithm has been used within a preset historical time period, then determine the first algorithm as the first target compression algorithm.

[0142] Continuing with Table 1 as an example, since the total storage space is different, correspondingly, the ratio of the remaining storage space to the total storage space can be set differently. For example, for a total storage space of 128G, the preset ratio C1 is 15%; for a total storage space of 256G, the preset ratio C2 is 10%; for a total storage space of 512G, the preset ratio C3 is 8%; for a total storage space of 1T, the preset ratio C4 is 5%.

[0143] Optionally, the preset value or preset ratio can be a fixed value set in advance. For example, for an electronic device with a storage space of 128G, its preset value can be set to 20G in advance, or its preset ratio can be set to 15% in advance.

[0144] Optionally, a preset value or preset ratio can be statistically obtained according to the user's usage habits.

[0145] Exemplarily, obtain the remaining storage space of the electronic device each time the space compression function is manually enabled in the user's historical operation behavior, calculate the statistical value (such as the average value or the mode, etc.) of the remaining storage space of the electronic device when the space compression function is manually enabled according to this historical data, determine this statistical value as the preset value, or calculate the preset ratio according to this statistical value.

[0146] Taking the statistical value as the mode as an example, obtain 10 times of the user's historical operation behavior. Among them, the remaining storage space when the space compression function is manually enabled by the user 8 times is 20G. Then set 20G as the preset value, or calculate the preset ratio to be approximately 15.6% according to the total storage space of 128G, and then set the preset ratio to 15% or 16%.

[0147] In the implementation of this application, it is equivalent to giving priority to considering the remaining storage space. When the remaining storage space is small, a compression algorithm with a high compression ratio is adopted, which helps to release more storage space. When the remaining storage space is large, the usage of a compression algorithm with a high compression ratio (such as the first algorithm) in the historical time period is considered, which is equivalent to considering the historical situation of the storage space. For example, when the remaining storage space is near the threshold, such as equal to or just less than the preset value, the first algorithm is used for compression processing. After processing, part of the storage space is released, so that the remaining storage space is greater than or equal to the preset value. If the second algorithm is used, it may cause the compression algorithm to repeatedly jump near the available space threshold. If the first algorithm is still used, it can reduce the repeated jump of the compression algorithm near the available space threshold, which is beneficial to improving the stability of the stored data.

[0148] S302. Compress the files in the storage space according to the first target compression algorithm.

[0149] Take Figure 2 the software architecture shown as an example. S302 can be executed by the compression module in the kernel layer. Specifically, the compression module obtains the determined first target compression algorithm from the initialization module in the system layer, and then compresses the files in the storage space according to the first target compression algorithm.

[0150] In one embodiment, S302 may include: if the first target compression algorithm is the first algorithm, the compression module compresses the files in the storage space according to the first algorithm; if the first target compression algorithm is the second algorithm, the compression module compresses the files in the storage space according to the second algorithm.

[0151] In the embodiment of this application, during the process of selecting the compression algorithm, the remaining storage space of the electronic device is considered. Since the compression ratios of the first algorithm and the second algorithm are different, selecting the compression algorithm according to the remaining storage space helps to release more storage space. In addition, during the process of selecting the compression algorithm, the usage of a compression algorithm with a high compression ratio (such as the first algorithm) in the preset historical time period is also considered, which is equivalent to considering the historical situation of the storage space. This method can reduce the frequent jump of the compression algorithm, thereby helping to improve the stability of the stored data.

[0152] In another embodiment, S302 may include: compressing the files of the first application in the storage space according to the first target compression algorithm. Among them, the usage frequency of the first application is lower than the preset frequency.

[0153] It can be understood that the first application is any one of the application programs installed on the electronic device. The application programs in the embodiment of this application may include multiple files.

[0154] Take Figure 2Taking the software architecture shown as an example, in one implementation manner, the above method can be executed by the compression module in the kernel layer. For example, the compression module obtains the usage time of each installed application in the electronic device through the memory driver; counts the usage frequency of each application according to the usage time; for each application, if the usage frequency of the application is lower than the preset frequency, the file of the application is compressed according to the first target compression algorithm.

[0155] In another implementation manner, the usage frequency can also be counted by the initialization module in the system layer. For example, the initialization module obtains the usage time of each installed application in the electronic device through the memory driver; counts the usage frequency of each application according to the usage time; for each application, if the usage frequency of the application is lower than the preset frequency, marking information is set for the application, and the marking information is used to indicate that the usage frequency of the application is lower than the preset frequency; then the initialization module sends the marking information to the compression module; correspondingly, after receiving the first target compression algorithm and the marking information, the compression module compresses the file of the application corresponding to the marking information according to the first target compression algorithm.

[0156] Optionally, in one implementation manner of counting the usage frequency of an application, the number of times the application is used within a certain historical time period can be counted; the usage frequency is calculated according to the number of times of use and the historical time period. For example, the historical time period is 7 days, and the number of times an application is used in the previous 7 days is 1 time, that is, the usage frequency is 1 / 7.

[0157] Optionally, in another implementation manner of counting the usage frequency of an application, the number of times the application is used within a certain historical time period and the usage duration of each use can be counted; the usage frequency is calculated according to the number of times of use and the historical time period; if the usage frequency is greater than the preset frequency threshold and the usage duration of each use is less than the preset duration, it is determined that the usage frequency of the application is lower than the preset frequency; if the usage frequency is greater than the preset frequency threshold but the usage duration of each use is not less than the preset duration, it is determined that the usage frequency of the application is higher than the preset frequency; if the usage frequency is less than the preset frequency threshold, it is determined that the usage frequency of the application is higher than the preset frequency.

[0158] It can be understood that in the above implementation manner, the average usage duration or the maximum usage duration of the application within the historical time period can also be counted. In the embodiments of the present application, the statistical parameters used when counting the usage frequency of the application are not specifically limited.

[0159] It should be noted that the historical time period used when counting the usage frequency of the application can be different from the historical time period used in the process of determining the first target compression algorithm.

[0160] In the above embodiments, it is equivalent to compressing infrequently used application programs and not compressing frequently used application programs. In this way, the compression processing method can better adapt to the user's usage habits and help release compression benefits that meet the user's needs.

[0161] In one embodiment, S302 may include:

[0162] When the first target compression algorithm is the second algorithm, determine the second algorithm as the second target compression algorithm, and compress the files of the first application according to the second target compression algorithm;

[0163] When the first target compression algorithm is the first algorithm, determine the second target compression algorithm according to the second information of the first application; compress the first application according to the second target compression algorithm.

[0164] Wherein, the second information is used to indicate whether the user will use the first application within a preset future time period.

[0165] In the embodiments of the present application, the second information can characterize the prediction of the user's behavior of using application programs. When a compression algorithm with a high compression rate is determined, the application data in the storage space is adaptively compressed through the prediction of the user's behavior of using application programs, so that the compression processing method can better adapt to the user's usage habits and help release compression benefits that meet the user's needs.

[0166] Optionally, one way to obtain the second information may include: if the first application is in the preset whitelist and the application type of the first application is the preset type, the second information of the first application indicates that the user will use the first application within the future time period; if the first application is not in the preset whitelist and / or the application type of the first application is not the preset type, the second information of the first application indicates that the user will not use the first application within the future time period.

[0167] For example, some applications with keep-alive configurations can be set in the preset whitelist. Here, the keep-alive configuration refers to ensuring that the application program will not be forcibly closed by the system when running in the background through various technical means, so as to keep it running continuously. 2]

[0168] For example, the application type can be divided according to the functions of the application program, such as social, gaming, video, etc. In the embodiments of the present application, the application programs of the preset type can indicate that the user has a high usage frequency of the application program.

[0169] Optionally, another way to obtain the second information may include: input the keep-alive configuration and application type of the first application into the trained prediction model, and output the second information of the first application.

[0170] For example,Figure 2 Taking the software architecture shown as an example, a prediction model can be deployed in the learning library of the application framework layer, and the prediction model can be pre-trained using sample data to obtain the trained prediction data. Among them, the sample data may include the usage data of multiple applications in the electronic device by the user, as well as the keep-alive configuration and application type of each application.

[0171] It should be noted that the prediction model can be deployed on the edge side or on the cloud side. However, deploying on the edge side is more conducive to protecting the user's usage information and improving data security.

[0172] In the above embodiment, it is equivalent to predicting the usage probability of the user for the first application in the future time period according to the preset whitelist and application type. By predicting the user's behavior of using the application program, the application data in the storage space is adaptively compressed, so that the compression processing method can better adapt to the user's usage habits, which helps to release the compression benefit that meets the user's needs.

[0173] In one implementation manner of determining the second target compression algorithm, if the second information indicates that the user does not use the first application in the future time period, the first algorithm is determined as the second target compression algorithm; if the second information indicates that the user uses the first application in the future time period, the second algorithm is determined as the second target compression algorithm.

[0174] Among them, the future time period can be preset. For example, the next 1 day, the next week, or the next month, etc.

[0175] It can be understood that the compression ratio of the compression algorithm is usually inversely proportional to the decoding speed. For example, the compression ratio of the first algorithm is higher than that of the second algorithm, and correspondingly, the decoding speed of the first algorithm is lower than that of the second algorithm.

[0176] In the above implementation manner, it is equivalent to compressing the first application using the first algorithm with a higher compression ratio when it is predicted that the user does not use the first application in the future time period, so as to release more storage space; and compressing the first application using the second algorithm with a lower compression ratio but a higher decoding speed when it is predicted that the user uses the first application in the future time period, so that it can be quickly decoded when the user uses the first application, which is beneficial to improving the user experience. Through the above method, by predicting the user's behavior of using the application program, the application data in the storage space is adaptively compressed, so that the compression processing method can better adapt to the user's usage habits, which helps to release the compression benefit that meets the user's needs.

[0177] In one implementation manner, the method of compressing the first application according to the second target compression algorithm may include: determining whether the first application is in a compressed state; if the first application is not in a compressed state, the first application is compressed according to the second target algorithm;

[0178] If the first application is in a compressed state, determine whether the compression algorithm corresponding to the compressed file of the first application is the second target compression algorithm; if the compression algorithm corresponding to the compressed file of the first application is the second target compression algorithm, there is no need to perform compression processing on the first application; if the compression algorithm corresponding to the compressed file of the first application is not the second target compression algorithm, decompress the compressed file of the first application, and then perform compression processing on the first application according to the second target compression algorithm.

[0179] For example, if the second target compression algorithm is the first algorithm, first determine whether the first application has been compressed using the second algorithm; if so, first decompress the compressed file of the first application using the decompression algorithm corresponding to the second algorithm, and then perform compression processing on the first application according to the first algorithm.

[0180] If the second target compression algorithm is the second algorithm, first determine whether the first application has been compressed using the first algorithm; if so, first decompress the compressed file of the first application using the decompression algorithm corresponding to the first algorithm, and then perform compression processing on the first application according to the second algorithm.

[0181] It should be noted that in the case where the first target compression algorithm is the second algorithm, in an implementation of compressing the file of the first application according to the second algorithm, it is also possible to first determine whether the first application has been compressed using the first algorithm; if so, first decompress using the decompression algorithm corresponding to the first algorithm, and then compress the first application using the second algorithm; if not, there is no need to repeat the compression process.

[0182] In the above implementation, the judgment of the compression state of the first application is added, which can effectively reduce the situation of repeated compression and help improve the reliability of the compression process.

[0183] Exemplarily, refer to Figure 5 , which is a schematic diagram of the compression process provided by the embodiments of the present application. By way of example and not limitation, as Figure 5 shown, the compression process may include the following steps:

[0184] S501, determine whether the application program is a frequently used application.

[0185] If the application program is a frequently used application, there is no need to perform compression processing on the first application; if the application program is not a frequently used application, record the application program as the first application and execute S502.

[0186] Optionally, it can be determined whether the application program is a frequently used application according to the usage frequency of the application program. For specific details, refer to the description in the above embodiments and will not be elaborated here.

[0187] S502, Determine whether the first target compression algorithm is the first algorithm.

[0188] If the first target compression algorithm is not the first algorithm, then execute S504; if the first target compression algorithm is the first algorithm, then execute S503.

[0189] S503, If the first target compression algorithm is the first algorithm, then determine whether the second information of the first application indicates that the user will use the first application in the future time period.

[0190] If the second information of the first application indicates that the user will use the first application in the future time period, then execute S504; if the second information of the first application indicates that the user will not use the first application in the future time period, then execute S507.

[0191] The implementation method of obtaining the second information can be seen in the description in the above embodiments and will not be elaborated here.

[0192] S504, Determine whether the first application has been compressed using the first algorithm.

[0193] If the first application has not been compressed, then execute S506; if the first application has been compressed and compressed according to the first algorithm, then execute S505.

[0194] S505, If the first application has been compressed using the first algorithm, then decompress it using the decompression algorithm corresponding to the first algorithm.

[0195] S506, Compress the first application using the second algorithm.

[0196] S507, Determine whether the first application has been compressed using the second algorithm.

[0197] If the first application has not been compressed, then execute S509; if the first application has been compressed and compressed according to the second algorithm, then execute S508.

[0198] S508, If the first application has been compressed using the second algorithm, then decompress it using the decompression algorithm corresponding to the second algorithm.

[0199] S509, Compress the first application using the first algorithm.

[0200] Figure 5In the illustrated embodiment, infrequently used application programs are compressed, while frequently used application programs are not compressed. In this way, the compression processing method can better adapt to the user's usage habits and reduce performance losses caused by excessive compression. During the compression process, by predicting the user's usage of the first application in a future time period, the second target compression algorithm is further determined, and the application data in the storage space is adaptively compressed, so that the compression processing method can better adapt to the user's usage habits and help release the compression benefit that meets the user's needs. In addition, the determination of the compression state of the first application is added, which can effectively reduce the situation of repeated compression and help improve the reliability of the compression process.

[0201] The following uses Figure 2 the illustrated software architecture as an example to exemplarily illustrate the interaction process between the various modules involved in the compression process. Refer to Figure 6 , which is the interaction schematic diagram of the compression process provided by the embodiment of the present application. As an example rather than a limitation, as Figure 6 shown, the compression process may include the following steps:

[0202] S601, the system steward obtains the application list.

[0203] Optionally, the application list may include all the application programs installed on the electronic device.

[0204] Optionally, the application list may include the application programs manually selected by the user.

[0205] S602, the system steward sends compression information to the initialization module through SMS.

[0206] After receiving the compression information, the initialization module traverses the application programs. Specifically, for each application program, S603 - S609 are executed.

[0207] S603, the initialization module sends an instruction to traverse files to the compression module.

[0208] S604, after receiving the instruction to traverse files, the compression module obtains the compression attributes of each file of the current application program and sends them to the initialization module.

[0209] Among them, the compression attributes may include the third information and the file size, and the third information may be used to indicate whether the file is in a compressed state.

[0210] S605, the initialization module filters the files of the current application program according to the compression attributes of the files.

[0211] Optionally, the files indicated by the third information to be in a compressed state may be filtered out; and / or, the files with a file size less than a preset value may be filtered out.

[0212] S606, the initialization module selects a compression algorithm.

[0213] The initialization module can select a compression algorithm according to the method of S301. For the specific implementation method, please refer to the description of the embodiment of S301, which will not be elaborated here.

[0214] S607, the initialization module sends compression parameters to the compression module.

[0215] Among them, the compression parameters may include the index number of the compression algorithm selected by the initialization module, the compression flag, and the cluster, etc. The compression flag refers to the identifier or key obtained after compressing the data, which is used to protect data security. The cluster is the smallest allocation unit used to manage disk space in the file system.

[0216] S608, after receiving the compression parameters, the compression module performs compression processing on the current application according to the compression parameters.

[0217] In one case, the initialization module determines the first target compression algorithm by executing the method of S301, and sends the index number of the first target compression algorithm as the compression parameter to the compression module; the compression module executes the method of S501 - S509 to determine the second target compression algorithm, and performs compression processing on the current application according to the second target compression algorithm.

[0218] In another case, the initialization module determines the first target compression algorithm by executing S301, and then determines the second target compression algorithm (such as executing S501 - S503), and sends the index number of the determined second target compression algorithm to the compression module; the compression module performs compression processing on the current application according to the second target compression algorithm (such as executing S504 - S509).

[0219] S609, the compression module returns the space information of compressing the current application to the initialization module.

[0220] Among them, the space information refers to the size of the compressed space. For example, if the size of the space occupied by the application before compression is 10M, and the size of the space occupied by the compressed application is 2M, then the space information is 8M.

[0221] After traversing all applications, execute S610.

[0222] As Figure 6 shown, assuming that the application list includes n applications, then after completing the compression processing of the nth application, execute S610.

[0223] S610, the initialization module calculates the saved space of this compression processing according to the space information of each application, and calculates the compression benefit.

[0224] For example, the space information of each application is accumulated to obtain space savings; the ratio of the space savings to the total storage space is calculated to obtain the compression benefit of this compression process.

[0225] S611. The initialization module sends the compression benefit to the system manager via SMS.

[0226] The system manager can display the compression benefit and / or the data of the space savings to the user.

[0227] Compared with the related art, Figure 6 In the embodiment, the selection process of the compression algorithm is added, making the compression process more flexible and more adaptable, and capable of releasing the compression benefit that meets the user's expectations at different usage stages of the electronic device, which is beneficial to improving the user experience.

[0228] It should be noted that, Figure 6 only some modules related to the compression process of the embodiments of the present application are shown, and are not used to limit the number and names of the modules.

[0229] The application scenarios of the compression process method of the embodiments of the present application may include the following three types:

[0230] 1. Automatic scanning and automatic compression

[0231] In this application scenario, the electronic device can automatically scan the infrequently used applications and automatically perform the compression process.

[0232] For example, the system manager automatically executes S501 according to a preset period or whenever a preset state is met, scans each installed application of the electronic device, determines whether it is a frequently used application, and generates an application list for the infrequently used applications; then the electronic device automatically performs the compression process, such as S601 - S611.

[0233] Among them, the preset state may be that the electronic device is connected to the charger or the electronic device is in the standby state, etc.

[0234] It can be understood that in this application scenario, the execution processes of the scanning and compression processes can be executed in the background, and the compression benefit may not be displayed to the user.

[0235] It should be noted that in this application scenario, the system manager can also generate an application list of all the installed applications of the electronic device, send it to the initialization module, and then the initialization module executes S501, that is, the step of determining whether it is an application program, after receiving the compression information of S602.

[0236] 2. Automatic scanning and manual compression

[0237] In this application scenario, the electronic device can automatically scan for infrequently used applications. When there are applications that can be compressed, a prompt message is displayed to the user to prompt the user to select compression processing; when the user manually selects to perform compression processing, the electronic device performs compression processing.

[0238] For example, the System Manager automatically executes S501 at a preset cycle or whenever a preset condition is met, scans each installed application on the electronic device, and determines whether it is a frequently used application; when there are infrequently used applications, a prompt message is displayed to the user in the form of the negative first screen or a notification. The user can click on the prompt message to enter the cleaning interface of the System Manager, such as Figure 7 the interface shown in (a) of Figure 7 ; the user clicks on the "Clean & Accelerate" control 71, and in response to this user operation, the electronic device displays an interface such as Figure 7 shown in (b) of

[0239] It can be understood that in this application scenario, if the user ignores the prompt message, the electronic device does not perform compression processing.

[0240] 3. Manual selection and manual compression

[0241] In this application scenario, the user can independently operate the System Manager, actively perform a scan, and manually select to perform compression processing.

[0242] Exemplarily, as Figure 8 shown in (a) of Figure 8 is the desktop of the electronic device. The user clicks on the application icon 81 of the System Manager, and in response to this user operation, the electronic device opens the System Manager and displays an interface such as Figure 8 shown in (b) of Figure 8 ; the user clicks on the "Clean & Accelerate" control 82, and in response to this user operation, the electronic device displays an interface such as

[0243] It can be understood that in this application scenario, the system manager can generate an application list according to the application programs independently selected by the user.

[0244] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not imply the order of execution. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0245] The embodiments of the present application also provide a computer-readable storage medium storing a computer program, and when the computer program runs on an electronic device, the steps in the above method embodiments can be implemented.

[0246] The embodiments of the present application also provide a computer program product, and when the computer program product runs on an electronic device or a wireless router, the electronic device can implement the steps in the above method embodiments.

[0247] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above method embodiments of the present application, a computer program can be used to instruct relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps in the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device capable of carrying the computer program code to a first device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electrical carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.

[0248] The embodiments of the present application also provide a chip, which includes a processor. The processor is coupled to a memory, and the processor calls the computer program stored in the memory to implement the steps in any method embodiment of the present application. The chip can be a single chip or a chip module composed of multiple chips.

[0249] In the above embodiments, the descriptions of the various embodiments have their own focuses. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0250] Those of ordinary skill in the art can realize that the units and method steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0251] The above embodiments are only used to illustrate the technical solutions of this application, rather than to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A compression processing method, characterized in that, Including: Select a first target compression algorithm according to the remaining storage space of the electronic device and the first information; wherein, the first target compression algorithm is the first algorithm or the second algorithm, and the compression rate of the first algorithm is higher than that of the second algorithm; the first information is used to indicate whether the first algorithm has been used during a preset historical time period; Perform compression processing on the files in the storage space of the electronic device according to the first target compression algorithm; The step of selecting the first target compression algorithm includes: If the remaining storage space is less than a preset value, the first target compression algorithm is the first algorithm; If the remaining storage space is greater than or equal to the preset value, select the first target compression algorithm according to the first information; The performing compression processing on the files in the storage space of the electronic device according to the first target compression algorithm includes: In the case where the first target compression algorithm is the second algorithm, perform compression processing on the files of a first application according to the second algorithm; wherein, the usage frequency of the first application is lower than a preset frequency; In the case where the first target compression algorithm is the first algorithm, determine a second target compression algorithm according to the second information of the first application; wherein, the second information is used to indicate whether the first application will be used during a preset future time period; the second target compression algorithm is the first algorithm or the second algorithm; If the first application is not in a compressed state, perform compression processing on the first application according to the second target compression algorithm; If the first application is in a compressed state, determine whether the compression algorithm corresponding to the compressed file of the first application is the second target compression algorithm; If the compression algorithm corresponding to the compressed file of the first application is the second target compression algorithm, there is no need to perform compression processing on the first application; If the compression algorithm corresponding to the compressed file of the first application is not the second target compression algorithm, decompress the compressed file of the first application and perform compression processing on the first application according to the second target compression algorithm.

2. The method according to claim 1, wherein The selecting a first target compression algorithm according to the remaining storage space of the electronic device and the first information includes: If the remaining storage space is greater than or equal to the preset value and the first information indicates that the first algorithm has not been used during the preset historical time period, the first target compression algorithm is the second algorithm.

3. The method according to claim 1, wherein The selecting a first target compression algorithm according to the remaining storage space of the electronic device and the first information includes: If the remaining storage space is greater than or equal to the preset value and the first information indicates that the first algorithm has been used during the preset historical time period, the first target compression algorithm is the first algorithm.

4. The method according to any one of claims 1 to 3, characterized in that, The performing compression processing on the files in the storage space of the electronic device according to the first target compression algorithm includes: Scan the storage space of the electronic device to obtain a first application; wherein, the usage frequency of the first application is lower than a preset frequency; Perform compression processing on the first application according to the first target compression algorithm.

5. The method according to claim 1, wherein The determining a second target compression algorithm according to the second information of the first application includes: If the second information indicates that the user will not use the first application in a future time period, the second target compression algorithm is the first algorithm; If the second information indicates that the user will use the first application in a future time period, the second target compression algorithm is the second algorithm.

6. An electronic device, characterized in that, Comprising: One or more processors; One or more memories; The memory stores a computer program, and when the computer program is executed by the processor, the electronic device implements the method according to any one of claims 1 to 5.

7. A chip system, characterized in that, The chip system includes a processor, the processor is coupled to the memory, and the processor is configured to run the computer program stored in the memory to implement the method according to any one of claims 1 to 5.

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

9. A computer program product, characterized in that, The computer program product includes computer program code, and when the computer program code runs on an electronic device, the electronic device implements the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data processing method and device of distributed assembly line and storage medium

    CN114428786A

  • File dynamic compression method and system, terminal equipment and storage medium

    CN115048347A

  • Data processing method and device, electronic equipment and storage medium

    CN116126813A