Compression processing method, electronic equipment and computer readable storage medium
By selecting appropriate compression algorithms based on the remaining storage space and usage history of electronic devices, and compressing files in the storage space, the problem that the existing technology cannot flexibly match user needs is solved, and the effect of releasing compression benefits that meet users' expectations and improving user experience is achieved.
Patent Information
- Application Number
- CN202411961369.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-12-30
AI Technical Summary
The prior art cannot flexibly match user needs and experiences at different stages of use of electronic devices, resulting in the inability to release compressed benefits that best meet users' expectations.
The files in the storage space are compressed by selecting an appropriate compression algorithm based on the remaining storage space and usage history of the electronic device. Specifically, when there is insufficient storage space, select high compression algorithms, and select appropriate compression algorithms based on the application usage frequency and predicted future usage.
It realizes the release of compressed benefits that meet users' expectations during different stages of use of electronic devices, improves the user experience, and improves the stability of stored data by reducing the frequent jumps of compression algorithms.
Smart Images

Figure CN119576882A_ABST
Abstract
Description
Technical Field
[0001] The present 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 smart terminals, people are becoming more and more dependent on electronic devices. In daily life, users use electronic devices to chat, take pictures, work and entertain, etc. As users use electronic devices more and more, they are paying more and more attention to the remaining storage space of electronic devices.
[0003] Some solutions involve losslessly compressing files in the storage space of electronic devices to free up storage space. However, currently, fixed compression algorithms are usually used for compression processing, which cannot flexibly match user needs and experiences in different scenarios, and cannot release the compression benefits that best meet user expectations at different use stages of electronic devices. Summary of the invention
[0004] The present application provides a compression processing method, an electronic device, and a computer-readable storage medium, which can release compression benefits that meet user expectations at different use stages of the electronic device, thereby improving user experience.
[0005] In order to achieve the above purpose, this application adopts the following technical solutions: In a first aspect, a compression processing method is provided, comprising: Selecting 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 the compression rate of the second algorithm; and the first information is used to indicate whether the first algorithm has been used within a preset historical time period; The files in the storage space of the electronic device are compressed according to the first target compression algorithm.
[0006] In the embodiment of the present application, a compression algorithm selection process is added to make the compression process more flexible and adaptable, and can release compression benefits that meet the user's expectations at different use stages of the electronic device, which is conducive to improving the user experience. In addition, in the process of selecting the compression algorithm, the remaining storage space of the electronic device is taken into consideration. Since the compression rates 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, in the process of selecting the compression algorithm, the use of algorithms with higher compression rates (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 jumps of the compression algorithm, thereby helping to improve the stability of the stored data.
[0007] For example, the first algorithm may be a Zstandard (also called zstd) algorithm, and the second algorithm may be an lz4 algorithm.
[0008] In an implementation of the first aspect, 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 less than a preset value, the first target compression algorithm is the first algorithm.
[0009] If the remaining storage space is greater than or equal to a preset value, and the first information indicates that the first algorithm has not been used within a preset historical time period, then the first target compression algorithm is the second algorithm.
[0010] If the remaining storage space is greater than or equal to a preset value, and the first information indicates that the first algorithm has been used within a preset historical time period, then the first target compression algorithm is the first algorithm.
[0011] Optionally, the same preset value may be set for different total storage spaces.
[0012] Optionally, different preset values may be set for different total storage spaces.
[0013] In the implementation of this application, it is equivalent to giving priority to the remaining storage space. When the remaining storage space is small, a compression algorithm with a high compression rate is used to help release more storage space. When the remaining storage space is large, the use of a higher compression rate algorithm (such as the first algorithm) in a historical time period is considered, which is equivalent to considering the historical status 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, and part of the storage space is released after processing, 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 used, the repeated jumps of the compression algorithm near the available space threshold can be reduced, which is conducive to improving the stability of the stored data.
[0014] In an implementation of the first aspect, compressing the files in the storage space of the electronic device according to the first target compression algorithm includes: 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; The first application is compressed according to the first target compression algorithm.
[0015] Optionally, in one implementation of counting the usage frequency of an application, the number of times the application is used within a certain historical time period may be counted; and the usage frequency may be calculated based on the number of uses and the historical time period.
[0016] Optionally, in another implementation method of counting the frequency of use of an application, the number of times the application is used and the duration of each use within a historical time period can be counted; the frequency of use is calculated based on the number of uses and the historical time period; if the frequency of use is greater than a preset frequency threshold and the duration of each use is less than a preset duration, then the frequency of use of the application is determined to be lower than the preset frequency; if the frequency of use is greater than the preset frequency threshold but the duration of each use is not less than the preset duration, then the frequency of use of the application is determined to be higher than the preset frequency; if the frequency of use is less than the preset frequency threshold, then the frequency of use of the application is determined to be higher than the preset frequency.
[0017] In the above embodiment, it is equivalent to compressing infrequently used applications and not compressing frequently used applications. In this way, the compression processing method can be more adapted to the user's usage habits and help release compression benefits that meet user needs.
[0018] In an implementation of the first aspect, compressing the first application according to the first target compression algorithm includes: When the first target compression algorithm is the second algorithm, the files of the first application are compressed according to the second algorithm.
[0019] When the first target compression algorithm is the first algorithm, determine the second target compression algorithm based on the second information of the first application; wherein the second information is used to indicate whether the first application is used within a preset future time period; and compress the first application according to the second target compression algorithm.
[0020] In an embodiment of the present application, the second information can represent a prediction of the user's behavior in using the application. When a compression algorithm with a high compression rate is determined, the application data in the storage space is adaptively compressed by predicting the user's behavior in using the application, so that the compression processing method can better adapt to the user's usage habits, thereby helping to release compression benefits that meet user needs.
[0021] Optionally, a method of obtaining the second information may include: if the first application is in a preset whitelist and the application type of the first application is a preset type, then the second information of the first application indicates that the user will use the first application in a future time period; if the first application is not in the preset whitelist, and / or the application type of the first application is not a preset type, then the second information of the first application indicates that the user will not use the first application in a future time period.
[0022] Optionally, another way to obtain the second information may include: inputting the keep-alive configuration and application type of the first application into a trained prediction model, and outputting the second information of the first application.
[0023] In the above embodiment, it is equivalent to predicting the probability of users using the first application in a future time period based on a preset whitelist and application type, and adaptively compressing the application data in the storage space by predicting the user's behavior in using the application program, so that the compression processing method can be more adapted to the user's usage habits, which helps to release compression benefits that meet user needs.
[0024] In an implementation manner of the first aspect, determining the 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 the future time period, the second target compression algorithm is the first algorithm; If the second information indicates that the user uses the first application in a future time period, the second target compression algorithm is the second algorithm.
[0025] In the above implementation, it is equivalent to compressing the first application using a first algorithm with a higher compression rate when it is predicted that the user will not use the first application in the future time period, thereby releasing more storage space; and compressing the first application using a second algorithm with a lower compression rate but a higher decoding speed when it is predicted that the user will use the first application in the future time period, so that the first application can be quickly decoded when the user uses it, which is conducive to improving the user experience. In 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 be more adapted to the user's usage habits, which helps to release compression benefits that meet user needs.
[0026] In an implementation of the first aspect, compressing the first application according to the first target compression algorithm includes: If the first application is in a compressed state, determining 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, the compressed file of the first application is decompressed, and the first application is compressed according to the second target compression algorithm.
[0027] If the first application is not in a compressed state, compressing the first application according to the second target algorithm.
[0028] 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 compression processing.
[0029] In a second aspect, an electronic device is provided, including: 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 as described in any one of the first aspects.
[0030] According to a third aspect, a chip system is provided, comprising a processor coupled to a memory, wherein the processor is configured to run a computer program stored in the memory to implement a method as described in any one of the first aspects.
[0031] According to a fourth aspect, a computer-readable storage medium is provided, wherein 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 the first aspects is implemented.
[0032] According to a fifth aspect, a computer program product is provided, wherein the computer program product comprises a computer program code, and when the computer program code runs on an electronic device, the electronic device implements the method as described in any one of the first aspects.
[0033] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application; Figure 2 A software structure block diagram of the electronic device 100 according to an embodiment of the present application; Figure 3 A schematic diagram of a compression processing method provided in an embodiment of the present application; Figure 4 A schematic diagram of a selection process of a compression algorithm provided in an embodiment of the present application; Figure 5 A schematic diagram of a compression process provided in an embodiment of the present application; Figure 6 An interactive schematic diagram of the compression process provided in an embodiment of the present application; Figure 7 A schematic diagram of an application scenario provided by an embodiment of the present application; Figure 8 A schematic diagram of an application scenario provided for another embodiment of the present application. DETAILED DESCRIPTION
[0035] In the following description, specific details such as specific system structures and technologies are provided for illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details.
[0036] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of 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 combinations thereof.
[0037] It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more than two; "and / or" describes the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B may be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0038] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", "fourth", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0039] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some 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 in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0040] With the development of smart terminals, people are becoming more and more dependent on electronic devices. In daily life, users use electronic devices to chat, take pictures, work and entertain, etc. As users use electronic devices more and more, they are paying more and more attention to the remaining storage space of electronic devices.
[0041] Some solutions involve losslessly compressing files in the storage space of electronic devices to free up storage space. However, currently, fixed compression algorithms are usually used for compression processing, which cannot flexibly match user needs and experiences in different scenarios, and cannot release the compression benefits that best meet user expectations at different use stages of electronic devices.
[0042] Based on this, the embodiment of the present application provides a compression processing method. In the embodiment of the present application, a compression algorithm selection process is added to make the compression processing more flexible and adaptable, and can release compression benefits that meet user expectations at different use stages of the electronic device, which is conducive to improving user experience.
[0043] The compression processing method provided in the embodiment of the present application can be applied in electronic devices. Electronic devices include terminal devices, which can also be called terminals, user equipment (UE), mobile stations (MS), mobile terminals (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, etc. The embodiments of the present application do not limit the specific technology and specific device form adopted by the electronic device.
[0044] See also Figure 1, is a structural diagram of an electronic device provided in 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, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. 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, and the like.
[0045] It is to be understood that the structure illustrated 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 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.
[0046] 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 memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0047] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0048] 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.
[0049] The external memory 120 generally refers to an external memory. In the embodiment of the present application, the external memory refers to a memory other than the memory of the electronic device and the cache of the processor, and the memory is generally a non-volatile memory.
[0050] The internal memory 121, which may also be referred to as "memory", may be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
[0051] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 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.
[0052] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0053] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0054] The camera 193 is used to capture still images or videos. The 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 light signal into an electrical signal, and then passes 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 RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0055] The electronic device 100 also includes various sensors that can convert various physical signals into electrical signals. Exemplarily, the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. The air pressure sensor 180C is used to measure the air 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 the distance. The electronic device 100 can measure the distance by 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 brightness of the ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering calls, etc. The temperature sensor 180J is used to detect the temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. The bone conduction sensor 180M can obtain a vibration signal.
[0056] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor 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 100, which is different from the position of the display screen 194.
[0057] Exemplarily, in an embodiment of the present application, the touch sensor 180K can detect a user's click operation on an application icon, and transmit the detected click operation to the application processor, determine that the click operation is used to start or run the application, and then execute the running operation of the application.
[0058] The wireless communication function of the electronic device 100 can be implemented through the first antenna 1, the second antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0059] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0060] The above is a specific description of the embodiment of the present application using the electronic device 100 as an example. It should be understood that the structure illustrated in the embodiment 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 may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.
[0061] 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 the operating system.
[0062] The operating system of the electronic device 100 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 100.
[0063] Figure 2It is a software structure block diagram of the electronic device 100 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: the application layer, the application framework layer, the system library and the Android runtime (Android runtime), and the kernel layer.
[0065] The application layer can include a series of application packages.
[0066] like Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, shopping, music, video, short message and system manager. For example, the system manager can be used to clean up the space, protect the security and manage the software of the electronic device. Taking the mobile phone as an example, the system manager can also be called the mobile phone manager. The embodiment of the present application does not specifically limit the name of the application.
[0067] It is understandable that the space cleaning function of the electronic device can be set up as a separate application or deployed in other applications, and the embodiments of the present application do not specifically limit this.
[0068] The application framework layer provides an application programming interface (API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0069] like Figure 2 As shown, the application framework layer may include StorageManagerService (SMS), learning library, window manager, content provider, view system, resource manager, notification manager, etc.
[0070] SMS is responsible for communicating with upper-level UIs (such as SystemUI and Settings), processing operations such as mounting, unmounting, and formatting of storage devices, and providing corresponding notifications and feedback to users.
[0071] The learning library can be used to predict user behavior on the application.
[0072] 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.
[0073] The content provider is used to store and obtain data and make the data accessible to the application. The data may include monitoring data obtained by the sensor module 180 (such as acceleration data obtained by the acceleration sensor 180E), video, image, audio, calls made and received, browsing history and bookmarks, phone book, etc.
[0074] 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.
[0075] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0076] 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 the completion of downloads, 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 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 prompted in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0077] In an embodiment of the present application, the application framework layer may include a camera access interface, wherein the camera access interface is used to provide an application programming interface and a programming framework for the camera application.
[0078] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0079] 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.
[0080] The application layer and the application framework layer run in a 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.
[0081] The system layer can include multiple functional modules, such as initialization module, media library, 3D graphics processing library (such as OpenGL ES) and 2D graphics engine (such as SGL).
[0082] The initialization module is used to execute the selection process in the compression processing method provided in the embodiment of the present application to realize the selection of different compression algorithms.
[0083] 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.
[0084] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0085] A 2D graphics engine is a drawing engine for 2D drawings.
[0086] The kernel layer is the layer between hardware and software, responsible for the management of the underlying hardware, including schedule scheduling, memory management, and device drivers. The kernel layer contains at least display drivers, camera drivers, memory drivers, and compression modules.
[0087] Among them, the storage driver is used to manage physical storage (such as memory) and disk space to ensure that applications and system services can run stably and efficiently.
[0088] 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).
[0089] The following describes the compression processing method of an embodiment of the present application in combination with the above-mentioned hardware structure and software structure.
[0090] See also Figure 3 , is a flow chart of the compression processing method provided in the embodiment of the present application. As an example and not a limitation, Figure 3 As shown, the compression processing method may include the following steps: S301, selecting a first target compression algorithm according to the remaining storage space of the electronic device and the first information.
[0091] 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.
[0092] For example, the first algorithm may be a Zstandard (also called zstd) algorithm, and the second algorithm may be an lz4 algorithm.
[0093] The principle of the zstd algorithm is: establish a dictionary before compression to store uncompressed data (original data); analyze the input data, find repeated patterns in it, and replace them with some shorter pointers to the repeated data that has been compressed before; determine the encoding rules; based on the analysis results and encoding rules, compress the original data into a continuous binary data.
[0094] The zstd algorithm can use multiple compression levels, and different compression levels correspond to different compression speeds and compression ratios. In addition, the zstd algorithm can make the encoding length of high-frequency words short and the encoding length of low-frequency words long during the encoding process, thereby achieving a higher compression rate.
[0095] The principle of the lz4 algorithm is: through dictionary coding theory, long strings (matches or phrases) are encoded into short tags, and small tags are used to replace phrases in the dictionary, so as to achieve the purpose of data compression.
[0096] Compared with the zstd algorithm, the lz4 algorithm has faster compression and decompression speeds, but the zstd algorithm has a higher compression ratio.
[0097] In one embodiment, see Figure 4 , is a schematic diagram of the selection process of the compression algorithm provided in 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 Figure 2 The initialization module of the system layer shown is executed.
[0098] By way of example and not limitation, Figure 4 As shown, S301 may include: S401, after starting the compression algorithm selection process, obtain the remaining storage space of the electronic device.
[0099] by Figure 2 Taking the compression algorithm selection process executed by the initialization module of the system layer as an example, the initialization module obtains the remaining storage space of the physical storage (such as memory or hard disk) of the electronic device through the memory driver of the kernel layer.
[0100] S402: Determine whether the remaining storage space of the electronic device is less than a preset value.
[0101] 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.
[0102] S403: If the remaining storage space of the electronic device is less than a preset value, determine the first algorithm as the first target compression algorithm.
[0103] S404: If the remaining storage space of the electronic device is greater than or equal to a preset value, determine whether the first algorithm has been used within a preset historical time period.
[0104] If the first algorithm has been used in the preset historical time period, S403 is executed, that is, the first algorithm is determined as the first target compression algorithm; if the first algorithm has not been used in the preset historical time period, S405 is executed.
[0105] S405: If the first algorithm has not been used in a preset historical time period, the second algorithm is determined as the first target compression algorithm.
[0106] The historical time period may be a preset fixed value, for example, one day, seven days, one month, etc.
[0107] For example, see Table 1, which shows compression algorithms corresponding to different storage spaces.
[0108]
[0109] 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.
[0110] The first information is "N", indicating that the first algorithm has not been used in the preset historical time period. The first information is "Y", indicating that the first algorithm has been used in the preset historical time period.
[0111] Taking 128G as an example, when the remaining storage space is less than C1, the first algorithm is used regardless of whether the first information is "N" or "Y". When the remaining storage space is greater than or equal to C1 and the first information is "N", the second algorithm is used; when the remaining storage space is greater than or equal to C1 and the first information is "Y", the first algorithm is used.
[0112] Optionally, the same preset value may be set for different total storage spaces, for example, C1, C2, C3 and C4 may have the same value.
[0113] Optionally, different preset values may be set for different total storage spaces, for example, different values of C1, C2, C3 and C4.
[0114] In other embodiments, the ratio of the remaining storage space to the total storage space may also be used as a limiting condition for selecting a compression algorithm. Specifically: If the ratio of the remaining storage space to the total storage space is less than a preset ratio, the first algorithm is determined as the first target compression algorithm; 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 in a preset historical time period, the second algorithm is determined as the first target compression algorithm; If the remaining storage space accounts for a preset ratio of the total storage space, and the first information indicates that the first algorithm has been used within a preset historical time period, the first algorithm is determined as the first target compression algorithm.
[0115] Continuing with Table 1 as an example, due to different total storage spaces, the ratio of the remaining storage space to the total storage space can be set to be different accordingly. For example, if the total storage space is 128G, the preset ratio C1 is 15%; if the total storage space is 256G, the preset ratio C2 is 10%; if the total storage space is 512G, the preset ratio C3 is 8%; if the total storage space is 1T, the preset ratio C4 is 5%.
[0116] Optionally, the preset value or preset proportion may be a preset fixed value. For example, for a 128G electronic device, the preset value may be preset to 20G, or the preset proportion may be preset to 15%.
[0117] Optionally, a preset value or preset ratio may be calculated based on the user's usage habits.
[0118] Exemplarily, the remaining storage space of the electronic device each time the space compression function is manually turned on in the user's historical operation behavior is obtained, and a statistical value (such as an average or mode, etc.) of the remaining storage space of the electronic device when the user manually turns on the space compression function is calculated based on the historical data, and the statistical value is determined as a preset value, or a preset proportion is calculated based on the statistical value.
[0119] Taking the statistical value as the majority as an example, obtain 10 historical operation behaviors of users. Among them, the remaining storage space is 20G when the user manually turns on the space compression function 8 times. In this case, 20G is set as the preset value. Or, based on the total storage space of 128G, the preset proportion is calculated to be approximately 15.6%, and the preset proportion is set to 15% or 16%.
[0120] In the implementation of this application, it is equivalent to giving priority to the remaining storage space. When the remaining storage space is small, a compression algorithm with a high compression rate is used to help release more storage space. When the remaining storage space is large, the use of a higher compression rate algorithm (such as the first algorithm) in a historical time period is considered, which is equivalent to considering the historical status 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, and part of the storage space is released after processing, 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 used, the repeated jumps of the compression algorithm near the available space threshold can be reduced, which is conducive to improving the stability of the stored data.
[0121] S302: compress files in the storage space according to a first target compression algorithm.
[0122] by Figure 2 Taking the software architecture shown as an example, S302 may be performed by the compression module of the kernel layer. Specifically, the compression module obtains the determined first target compression algorithm from the initialization module of the system layer, and then compresses the files in the storage space according to the first target compression algorithm.
[0123] 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.
[0124] In the embodiment of the present application, in the process of selecting a compression algorithm, the remaining storage space of the electronic device is taken into consideration. Since the compression rates of the first algorithm and the second algorithm are different, selecting a compression algorithm according to the remaining storage space helps to release more storage space. In addition, in the process of selecting a compression algorithm, the use of algorithms with higher compression rates (such as the first algorithm) in 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 jumps of the compression algorithm, thereby helping to improve the stability of the stored data.
[0125] In another embodiment, S302 may include: compressing the files of the first application in the storage space according to the first target compression algorithm, wherein the usage frequency of the first application is lower than the preset frequency.
[0126] It can be understood that the first application is any application installed in the electronic device. The application in the embodiment of the present application may include multiple files.
[0127] by Figure 2Taking the software architecture shown as an example, in one implementation, the above method can be executed by a compression module of the kernel layer. For example, the compression module obtains the usage time of each application installed in the electronic device through a 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 a preset frequency, compresses the file of the application according to the first target compression algorithm.
[0128] In another implementation, the usage frequency can also be counted by the initialization module of the system layer. For example, the initialization module obtains the usage time of each application installed in the electronic device through the memory driver; the usage frequency of each application is counted according to the usage time; for each application, if the usage frequency of the application is lower than the preset frequency, a mark information is set for the application, and the mark information is used to indicate that the usage frequency of the application is lower than the preset frequency; then the initialization module sends the mark information to the compression module; accordingly, after the compression module receives the first target compression algorithm and the mark information, the file of the application corresponding to the mark information is compressed according to the first target compression algorithm.
[0129] Optionally, in one implementation of counting the usage frequency of an application, the number of times the application is used in a certain historical time period may be counted, and the usage frequency may be calculated based on the number of uses and the historical time period. For example, if the historical time period is 7 days and an application is used once in the previous 7 days, the usage frequency is 1 / 7.
[0130] Optionally, in another implementation method of counting the frequency of use of an application, the number of times the application is used and the duration of each use within a historical time period can be counted; the frequency of use is calculated based on the number of uses and the historical time period; if the frequency of use is greater than a preset frequency threshold and the duration of each use is less than a preset duration, then the frequency of use of the application is determined to be lower than the preset frequency; if the frequency of use is greater than the preset frequency threshold but the duration of each use is not less than the preset duration, then the frequency of use of the application is determined to be higher than the preset frequency; if the frequency of use is less than the preset frequency threshold, then the frequency of use of the application is determined to be higher than the preset frequency.
[0131] It is understandable that in the above implementation, the average usage time or the maximum usage time of the application in the historical time period can also be counted. In the embodiment of the present application, the statistical parameters used when counting the usage frequency of the application are not specifically limited.
[0132] It should be noted that the historical time period used to count the usage frequency of the application program may be different from the historical time period used in the above process of determining the first target compression algorithm.
[0133] In the above embodiment, it is equivalent to compressing infrequently used applications and not compressing frequently used applications. In this way, the compression processing method can be more adapted to the user's usage habits and help release compression benefits that meet user needs.
[0134] In one embodiment, S302 may include: In a case where the first target compression algorithm is the second algorithm, determining the second algorithm as the second target compression algorithm, and performing compression processing on the file of the first application according to the second target compression algorithm; When the first target compression algorithm is the first algorithm, the second target compression algorithm is determined according to the second information of the first application; and the first application is compressed according to the second target compression algorithm.
[0135] The second information is used to indicate whether the user uses the first application within a preset future time period.
[0136] In an embodiment of the present application, the second information can represent a prediction of the user's behavior in using the application. When a compression algorithm with a high compression rate is determined, the application data in the storage space is adaptively compressed by predicting the user's behavior in using the application, so that the compression processing method can better adapt to the user's usage habits, thereby helping to release compression benefits that meet user needs.
[0137] Optionally, a method of obtaining the second information may include: if the first application is in a preset whitelist and the application type of the first application is a preset type, then the second information of the first application indicates that the user will use the first application in a future time period; if the first application is not in the preset whitelist, and / or the application type of the first application is not a preset type, then the second information of the first application indicates that the user will not use the first application in a future time period.
[0138] For example, some applications with keep-alive configuration can be set in a preset whitelist. The keep-alive configuration here means using various technical means to ensure that the application will not be forcibly closed by the system when running in the background, thereby keeping it running continuously.
[0139] For example, the application type can be divided according to the function of the application program, such as social type, game type, video type, etc. In the embodiment of the present application, the preset type of application program can indicate that the user uses the application program more frequently.
[0140] Optionally, another way to obtain the second information may include: inputting the keep-alive configuration and application type of the first application into a trained prediction model, and outputting the second information of the first application.
[0141] For example, Figure 2Taking the software architecture shown in the figure as an example, a prediction model can be deployed in the learning library of the application framework layer, and the prediction model can be trained with sample data in advance to obtain trained prediction data. The sample data may include the user's usage data of multiple applications in the electronic device and the keep-alive configuration and application type of each application.
[0142] It should be noted that the prediction model can be deployed on the client side or on the cloud side, but deploying it on the client side is more conducive to protecting user information and improving data security.
[0143] In the above embodiment, it is equivalent to predicting the probability of users using the first application in a future time period based on a preset whitelist and application type, and adaptively compressing the application data in the storage space by predicting the user's behavior in using the application program, so that the compression processing method can be more adapted to the user's usage habits, which helps to release compression benefits that meet user needs.
[0144] In one implementation of determining the second target compression algorithm, if the second information indicates that the user will 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 will use the first application in the future time period, the second algorithm is determined as the second target compression algorithm.
[0145] The future time period may be pre-set, for example, the next day, the next week, or the next month.
[0146] It is understandable that the compression rate of a compression algorithm is usually inversely proportional to the decoding speed. For example, the compression rate of a first algorithm is higher than that of a second algorithm, and accordingly, the decoding speed of the first algorithm is lower than that of the second algorithm.
[0147] In the above implementation, it is equivalent to compressing the first application using a first algorithm with a higher compression rate when it is predicted that the user will not use the first application in the future time period, thereby releasing more storage space; and compressing the first application using a second algorithm with a lower compression rate but a higher decoding speed when it is predicted that the user will use the first application in the future time period, so that the first application can be quickly decoded when the user uses it, which is conducive to improving the user experience. In 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 be more adapted to the user's usage habits, which helps to release compression benefits that meet user needs.
[0148] In one implementation, 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, compressing the first application according to the second target 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 compress 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 compress the first application according to the second target compression algorithm.
[0149] 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 use the decompression algorithm corresponding to the second algorithm to decompress the compressed file of the first application, and then compress the first application according to the first algorithm.
[0150] 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 use the decompression algorithm corresponding to the first algorithm to decompress the compressed file of the first application, and then compress the first application according to the second algorithm.
[0151] It should be noted that, when the first target compression algorithm is the second algorithm, in an implementation method of compressing the files of the first application according to the second algorithm, it can also be determined first whether the first algorithm is used to compress the first application; if so, first use the decompression algorithm corresponding to the first algorithm to decompress it, and then use the second algorithm to compress the first application; if not, there is no need to repeat the compression process.
[0152] 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 compression processing.
[0153] For example, see Figure 5 , is a schematic diagram of the compression process provided in the embodiment of the present application. As an example and not a limitation, Figure 5 As shown, the compression process may include the following steps: S501, determining whether the application is a commonly used application.
[0154] If the application is a commonly used application, there is no need to compress the first application; if the application is not a commonly used application, the application is recorded as the first application and S502 is executed.
[0155] Optionally, whether the application is a frequently used application may be determined based on the frequency of use of the application. For details, please refer to the description in the above embodiment, which will not be repeated here.
[0156] S502: Determine whether the first target compression algorithm is the first algorithm.
[0157] If the first target compression algorithm is not the first algorithm, execute S504; if the first target compression algorithm is the first algorithm, execute S503.
[0158] S503: If the first target compression algorithm is the first algorithm, determine whether the second information of the first application indicates that the user uses the first application in a future time period.
[0159] If the second information of the first application indicates that the user will use the first application in the future time period, 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, execute S507.
[0160] The implementation method of obtaining the second information can refer to the description in the above embodiment and will not be discussed here again.
[0161] S504: Determine whether the first application is compressed using the first algorithm.
[0162] If the first application has not been compressed, execute S506; if the first application has been compressed and compressed according to the first algorithm, execute S505.
[0163] S505: If the first application is compressed using the first algorithm, decompression is performed using a decompression algorithm corresponding to the first algorithm.
[0164] S506: Use the second algorithm to compress the first application.
[0165] S507: Determine whether the first application is compressed using the second algorithm.
[0166] If the first application has not been compressed, execute S509; if the first application has been compressed and compressed according to the second algorithm, execute S508.
[0167] S508: If the first application is compressed using the second algorithm, decompression is performed using a decompression algorithm corresponding to the second algorithm.
[0168] S509: Use the first algorithm to compress the first application.
[0169] Figure 5In the illustrated embodiment, infrequently used applications are compressed, and frequently used applications are not compressed. In this way, the compression processing method can better adapt to the user's usage habits and reduce performance loss caused by excessive compression. During the compression processing, by predicting the user's usage of the first application in the 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 compression benefits that meet user needs. In addition, 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 processing.
[0170] Below Figure 2 The software architecture shown in the figure is used as an example to illustrate the interaction process between the various modules involved in the compression process. Figure 6 , is an interactive schematic diagram of the compression process provided in the embodiment of the present application. As an example and not a limitation, Figure 6 As shown, the compression process may include the following steps: S601, the system manager obtains an application list.
[0171] Optionally, the application list may include all application programs installed on the electronic device.
[0172] Optionally, the application list may include application programs manually selected by the user.
[0173] S602: The system manager sends compressed information to the initialization module via SMS.
[0174] After receiving the compressed information, the initialization module traverses the application programs, and specifically, executes S603 to S609 for each application program.
[0175] S603, the initialization module sends a file traversal instruction to the compression module.
[0176] S604: After receiving the instruction to traverse the files, the compression module obtains the compression attribute of each file of the current application and sends it to the initialization module.
[0177] The compression attribute may include third information and file size, and the third information may be used to indicate whether the file is in a compressed state.
[0178] S605: The initialization module filters the files of the current application according to the compression properties of the files.
[0179] Optionally, the files indicated by the third information as being in a compressed state may be filtered out; and / or the files whose file sizes are smaller than a preset value may be filtered out.
[0180] S606, the initialization module selects a compression algorithm.
[0181] The initialization module may select a compression algorithm according to the method of S301. The specific implementation method may refer to the description of the embodiment of S301, which will not be described in detail here.
[0182] S607: The initialization module sends compression parameters to the compression module.
[0183] 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 the data is compressed, which is used to protect data security. The cluster is the smallest allocation unit used to manage disk space in the file system.
[0184] S608: After receiving the compression parameters, the compression module compresses the current application according to the compression parameters.
[0185] 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 a compression parameter to the compression module; the compression module executes the method of S501-S509 to determine the second target compression algorithm, and compresses the current application according to the second target compression algorithm.
[0186] 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 compresses the current application according to the second target compression algorithm (such as executing S504-S509).
[0187] S609: The compression module returns the space information of compressing the current application to the initialization module.
[0188] 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 application after compression is 2M, the space information is 8M.
[0189] After traversing all the application programs, S610 is executed.
[0190] like Figure 6 As shown, assuming that the application list includes n application programs, after the compression process of the nth application program is completed, S610 is executed.
[0191] S610: The initialization module counts the space saved by the compression process according to the space information of each application program and calculates the compression benefit.
[0192] For example, the space information of each application is accumulated to obtain the saved space; the ratio of the saved space to the total storage space is calculated to obtain the compression benefit of this compression process.
[0193] S611, the initialization module sends the compression income to the system manager via SMS.
[0194] The system manager can display the compression gain and / or space saving data to the user.
[0195] Compared with related technologies, Figure 6 In the embodiment, a compression algorithm selection process is added to make the compression processing more flexible and adaptable, and can release compression benefits that meet user expectations at different use stages of the electronic device, thereby improving the user experience.
[0196] It should be noted that Figure 6 Only some modules related to the compression processing of the embodiment of the present application are shown, and the number and names of the modules are not limited.
[0197] The application scenarios of the compression processing method of the embodiment of the present application may include the following three: 1. Automatic scanning and compression In this application scenario, the electronic device can automatically scan infrequently used applications and automatically perform compression processing.
[0198] For example, the system manager automatically executes S501 according to a preset cycle or whenever a preset state is met, scans each application installed on the electronic device, and determines whether it is a commonly used application, and generates an application list for infrequently used applications; then the electronic device automatically performs compression processing, such as S601-S611.
[0199] The preset state may be that the electronic device is connected to a charger or is in a standby state.
[0200] It is understandable that in this application scenario, the execution process of scanning and compression processing can be executed in the background, and the compression benefit may not be displayed to the user.
[0201] It should be noted that in this application scenario, the system manager can also generate an application list of all applications installed on the electronic device and send it to the initialization module. After receiving the compressed information of S602, the initialization module executes S501, that is, the step of determining whether it is an application program.
[0202] 2. Automatic scanning and manual compression In this application scenario, the electronic device can automatically scan infrequently used applications, and when there are compressible applications, display prompt information to the user to prompt the user to select compression processing; when the user manually chooses to perform compression processing, the electronic device performs compression processing.
[0203] For example, the system manager automatically executes S501 according to a preset period or whenever a preset state is met, scans each application installed on the electronic device, and determines whether it is a frequently used application; when there is an infrequently used application, a prompt message is displayed to the user in the form of a negative screen or a notification. The user can enter the cleaning interface of the system manager by clicking on the prompt message, such as Figure 7 The user clicks the "clean up speed" control 71, and in response to the user operation, the electronic device displays the following Figure 7 The interface shown in (b) in FIG. 1 ; the user clicks a control for instructing compression processing, such as Figure 7 As shown in (b) in FIG. 5 , the user clicks the “lossless compression” control 72 . In response to the user operation, the electronic device performs compression processing, such as S601 - S611 .
[0204] It is understandable that in this application scenario, if the user ignores the prompt information, the electronic device will not perform compression processing.
[0205] 3. Manual selection and manual compression In this application scenario, users can independently operate the system manager, actively scan, and manually choose to perform compression processing.
[0206] For example, Figure 8 As shown in (a) of FIG. 1 , the desktop of the electronic device is shown. The user clicks the application icon 81 of the system manager. In response to the user operation, the electronic device opens the system manager and displays the following information: Figure 8 The user clicks the "clean up and speed up" control 82, and in response to the user operation, the electronic device displays the following Figure 8 The user clicks the "lossless compression" control 83. In response to the user operation, the system manager executes S501 to scan each application installed on the electronic device and determine whether it is a commonly used application. The scanned infrequently used applications are displayed to the user, such as Figure 8 The user can select the application program to be compressed by operating the selection control 84 corresponding to each application, and then click the "compress" control 85. In response to the user operation, the electronic device performs compression processing, such as S601-S611.
[0207] It is understandable that in this application scenario, the system manager can generate an application list based on the application programs selected by the user.
[0208] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0209] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed on an electronic device, the steps in the above-mentioned method embodiments can be implemented.
[0210] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device or a wireless router, the electronic device can implement the steps in the above-mentioned various method embodiments.
[0211] 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 this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the 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 electric 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 disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0212] The embodiment of the present application further provides a chip, the chip includes a processor, the processor is coupled to a memory, and the processor calls a computer program stored in the memory to implement the steps of any method embodiment of the present application. The chip can be a single chip or a chip module composed of multiple chips.
[0213] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0214] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0215] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A compression processing method, characterized in that: include: Selecting 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 the compression rate of the second algorithm; and the first information is used to indicate whether the first algorithm has been used within a preset historical time period; The files in the storage space of the electronic device are compressed according to the first target compression algorithm.
2. The method according to claim 1, characterized in that 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 less than a preset value, the first target compression algorithm is the first algorithm.
3. The method according to claim 1, characterized in that 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 a preset value, and the first information indicates that the first algorithm has not been used within a preset historical time period, then the first target compression algorithm is the second algorithm.
4. The method according to claim 1, characterized in that: 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 a preset value, and the first information indicates that the first algorithm has been used within a preset historical time period, then the first target compression algorithm is the first algorithm.
5. The method according to any one of claims 1 to 4, characterized in that: The compressing the files in the storage space of the electronic device according to the first target compression algorithm includes: 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; The first application is compressed according to the first target compression algorithm.
6. The method according to claim 5, characterized in that The compressing the first application according to the first target compression algorithm includes: When the first target compression algorithm is the second algorithm, the files of the first application are compressed according to the second algorithm.
7. The method according to claim 5, characterized in that The compressing the first application according to the first target compression algorithm includes: In a case where the first target compression algorithm is the first algorithm, determining a second target compression algorithm according to second information of the first application; wherein the second information is used to indicate whether the first application is used within a preset future time period; The first application is compressed according to the second target compression algorithm.
8. The method according to claim 7, characterized in that 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 the future time period, the second target compression algorithm is the first algorithm; If the second information indicates that the user uses the first application in a future time period, the second target compression algorithm is the second algorithm.
9. The method according to claim 7 or 8, characterized in that: The compressing the first application according to the first target compression algorithm includes: If the first application is in a compressed state, determining 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, the compressed file of the first application is decompressed, and the first application is compressed according to the second target compression algorithm.
10. The method according to claim 7 or 8, characterized in that: The compressing the first application according to the first target compression algorithm includes: If the first application is not in a compressed state, compressing the first application according to the second target algorithm.
11. An electronic device, characterized in that: include: 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 10.
12. A chip system, characterized in that: The chip system includes a processor coupled to a memory, and the processor is used to run a computer program stored in the memory to implement the method according to any one of claims 1 to 10.
13. 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 10 is implemented.
14. A computer program product, characterized in that The computer program product comprises a computer program code, and when the computer program code is executed on an electronic device, the electronic device implements the method according to any one of claims 1 to 10.
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
Data compression method and device, computing equipment and storage system
CN117827775A
Data compression method and device and electronic equipment
CN118801896A