File compression method and device, electronic equipment and storage medium
By obtaining the library files during application installation and using the F2FS compression algorithm for compression, the problem of difficult to effectively reduce the storage space of application library files in the prior art is solved, and the effect of improving storage efficiency without affecting the application function and performance is achieved.
Patent Information
- Application Number
- CN202311347891.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-17
- Publication Date
- 2025-04-18
AI Technical Summary
When compressing library files of applications, it is difficult to effectively reduce storage space usage without affecting application functions and performance, especially when the storage space on mobile terminals is limited.
Responsive to application installation, the application's library files are obtained and the compression algorithm supported by F2FS is used to compress the library files.
It realizes that without affecting the function and performance of the application, reduces storage space usage, improves storage efficiency, and is suitable for devices with limited storage space such as mobile terminals.
Smart Images

Figure CN119848003A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of storage technology, and in particular to a file compression method, device, electronic device and storage medium. Background Art
[0002] In the field of storage technology, file compression is a common way to reduce storage space usage. For example, compression algorithms such as LZ77, LZSS, and DEFLATE can be used to compress duplicate data in files, thereby reducing the size of the file. Many electronic devices compress files to reduce storage space usage, especially mobile terminals with relatively small storage space. The application of file compression is particularly important. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a file compression method, device, electronic device and storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a file compression method is provided, the method comprising:
[0005] In response to installing the application, obtaining a library file of the application;
[0006] The library file is compressed.
[0007] In some embodiments, in response to installing the application, obtaining the library file of the application further includes:
[0008] Scanning via package management services;
[0009] When an application being installed is scanned, a library file of the application is obtained.
[0010] In some embodiments, in response to installing the application, obtaining the library file of the application further includes:
[0011] Determining the state of the operating system when no program being installed is scanned;
[0012] When the operating system is in the first startup state or the upgrade state, the application programs installed during the first startup or the upgrade process of the operating system are screened to obtain the library files of the application programs.
[0013] In some embodiments, before scanning by the package management service, the method further includes:
[0014] In response to a triggering operation on the package management service, starting the package management service;
[0015] The trigger operation includes at least one of the following: an application installation operation triggered by a user; an operating system startup operation; an operating system upgrade operation.
[0016] In some embodiments, obtaining the library file of the application includes:
[0017] Traverse the library file path corresponding to the application to obtain the library file.
[0018] In some embodiments, obtaining the library file of the application includes:
[0019] Calling a preset function interface to obtain the library file;
[0020] The compressing the library file comprises:
[0021] The preset function interface is called to compress the library file.
[0022] In some embodiments, compressing the library file includes:
[0023] The library file is compressed based on a compression algorithm supported by the flash-friendly file system F2FS.
[0024] According to a second aspect of an embodiment of the present disclosure, a file compression device is provided, the device comprising:
[0025] A library file acquisition module, configured to acquire a library file of the application in response to installing the application;
[0026] The file compression module is configured to compress the library file.
[0027] In some embodiments, the library file acquisition module is configured to:
[0028] Scanning via package management services;
[0029] When the application being installed is scanned, the library file of the application is obtained.
[0030] In some embodiments, the library file acquisition module is further configured to:
[0031] Determining the state of the operating system when no program being installed is scanned;
[0032] When the operating system is in the first startup state or the upgrade state, the application programs installed during the first startup or the upgrade process of the operating system are screened to obtain the library files of the application programs.
[0033] In some embodiments, the apparatus further comprises:
[0034] a service start module, configured to start the package management service in response to a triggering operation on the package management service;
[0035] The trigger operation includes at least one of the following: an application installation operation triggered by a user; an operating system startup operation; an operating system upgrade operation.
[0036] In some embodiments, the library file acquisition module is configured to:
[0037] Traverse the library file path corresponding to the application to obtain the library file.
[0038] In some embodiments, the library file acquisition module is configured to call a preset function interface to acquire the library file;
[0039] The file compression module is configured to call the preset function interface to compress the library file.
[0040] In some embodiments, the file compression module is configured to compress the library file based on a compression algorithm supported by a flash-friendly file system F2FS.
[0041] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0042] processor;
[0043] a memory for storing processor-executable instructions;
[0044] The processor is configured to execute the method as described in the first aspect of the embodiment of the present disclosure.
[0045] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in the first aspect of the embodiment of the present disclosure.
[0046] The above method of the present disclosure has the following beneficial effects:
[0047] The method provided in the embodiment of the present disclosure obtains the library file of the application in response to installing the application, and compresses the library file. A new compression method is provided, which can reduce the storage space occupied and improve the storage efficiency by compressing the library file of the application without affecting the function and performance of the application.
[0048] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0050] Figure 1 is a flow chart showing a file compression method according to an exemplary embodiment;
[0051] Figure 2 is a flow chart showing a file compression method according to an exemplary embodiment;
[0052] Figure 3 is a flow chart showing a file compression method according to an exemplary embodiment;
[0053] Figure 4 is a block diagram of a file compression device according to an exemplary embodiment;
[0054] Figure 5 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0055] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0056] In the related art, traditional file compression formats in the field of storage technology include ZIP, RAR, 7Z, etc. These compression formats use different compression algorithms, for example, LZ77, LZSS, DEFLATE, etc. In addition to traditional file compression formats, there are also some file compression formats for mobile terminals, for example, APK compression format, which is a compression format specially designed for Android applications. It can compress the resource files of the application, thereby reducing the size of the application and improving the download speed and installation efficiency of the application.
[0057] For electronic devices, dozens or hundreds of applications may be installed in an electronic device, and the applications occupy a large amount of storage space in the electronic device. Even if the compression method in the above-mentioned related technology is used to compress the applications, it will still occupy a large amount of storage space. For example, an application will have a library file of 10M to 200M. When 100 applications are installed in the electronic device, the library files of all applications will probably occupy about 10G of storage space. Therefore, it is very necessary to compress the library files. The disclosed embodiment compresses the library files of the application, which can reduce the storage space occupied and improve the storage efficiency without affecting the functions and performance of the application.
[0058] The method provided in the embodiments of the present disclosure is applied to an electronic device, which may be a mobile phone, a tablet computer, a laptop computer, a wearable device, a smart home device, a vehicle-mounted terminal, or the like.
[0059] Figure 1 is a flowchart of a file compression method according to an exemplary embodiment, which is executed by an electronic device, see Figure 1 , the method comprises the following steps:
[0060] Step S101, in response to installing an application, obtaining a library file of the application.
[0061] In the disclosed embodiment, in the installation scenario of the application, the library file of the application is obtained. The application has at least one corresponding library file. When obtaining the library file, all the library files can be obtained, or part of the library files can be obtained. Among them, the library file of the application can also be called a dynamic link library file, or an application extension. For many applications, the application is not a complete executable file, but is divided into some relatively independent library files and stored in the system. When a certain application is executed, the corresponding library file will be called.
[0062] The application is any application that can be installed on the electronic device. The application can be an application that is installed by default on the electronic device and cannot be uninstalled by the user, or it can be an application that is installed by the user and can be uninstalled.
[0063] The installation scenario of the application may include any of the scenarios of the first startup of the operating system of the electronic device, the operating system upgrade scenario, and the user installing the application scenario. Among them, in the scenario of the first startup of the operation startup and the scenario of the operating system upgrade, the electronic device will also install the application. For example, the electronic device is a mobile phone, and some applications are pre-installed on the mobile phone when it leaves the factory. When the mobile phone is turned on for the first time (that is, the operating system is started for the first time), these applications are installed; or when the operating system of the mobile phone is upgraded, some installed system applications will also be upgraded with the upgrade of the operating system, that is, the upgraded system applications will also be installed.
[0064] Step S102, compressing the library file.
[0065] Since the library file is a read-only file that will not be modified, even if the library file is compressed, it will not affect the subsequent calls of the library file. Therefore, the library file is compressed.
[0066] The method provided by the embodiment of the present disclosure obtains the library file of the application in response to installing the application; and compresses the library file. A new compression method is provided, which can reduce the storage space occupied and improve the storage efficiency by compressing the library file of the application without affecting the function and performance of the application. In addition, the library file is compressed when the application is installed, and the library file can be compressed as early as possible, so that the storage space occupied can be reduced as early as possible.
[0067] Figure 2 is a flowchart of a file compression method according to an exemplary embodiment, which is executed by an electronic device, see Figure 2 , the method comprises the following steps:
[0068] Step S201, scanning through the package management service.
[0069] The package management mechanism is an important mechanism in Android. The package refers to APK (Android application package), jar files, and so files. The package is loaded into the memory and converted into executable code. This requires a mechanism to load, parse, and manage the package, which is the package management mechanism. The package management mechanism is composed of many classes, the core of which is the Package Manager Service (PMS), which is responsible for managing the package. In the disclosed embodiment, the installation package of the application can be scanned based on the package management service, and the package management service is used to scan and determine whether the application is currently being installed.
[0070] In some embodiments, before scanning through the package management service, it is necessary to start the package management service first, that is, in response to a trigger operation on the package management service, start the package management service. The trigger operation is used to start the package management service, and the trigger operation includes at least one of the following: an application installation operation triggered by a user; an operating system startup operation; an operating system upgrade operation. Of course, the trigger operation can also be other operations, for example, the electronic device periodically starts the package management service. In this case, the scan of the package management service belongs to the daily system scan, and no new applications may be installed.
[0071] Optionally, when the triggering operation is an operating system startup operation, the package management service is started during the operating system startup process and scanning is performed through the package management service; when the triggering operation is an operating system upgrade operation, the package management service is started during the operating system upgrade process and scanning is performed through the package management service.
[0072] In the disclosed embodiment, the installation package of the application is scanned by the package management service, and when the application being installed is scanned, step S202 is executed, and when the application being installed is not scanned, step S203 is executed. That is, when a new installation package is scanned, step S202 is executed, and when no new installation package is scanned, step S203 is executed.
[0073] Step S202: when an application being installed is scanned, a library file of the application is obtained.
[0074] The scanned applications being installed include: applications being installed for the first time, and applications that have been installed and are currently being updated. When an application being installed is scanned, it means that there is a newly installed application, or that an application is being updated, so the library file of the application can be obtained.
[0075] In some embodiments, obtaining the library file of the application includes: traversing the library file path corresponding to the application to obtain the library file. That is, the application has multiple corresponding library files, and the storage paths of the multiple library files may be the same or different. In order to obtain the library file, the library file path is traversed to obtain all the library files.
[0076] In some embodiments, the electronic device provides a preset function interface, and when obtaining a library file, the preset function interface is called to obtain the library file. The preset function interface can be an interface for executing a file compression function provided by F2FS (Flash Friendly File System) compression technology.
[0077] Optionally, after traversing the library file path corresponding to the application, the preset function interface is called to obtain the library file based on the library file path.
[0078] Step S203: when no program being installed is scanned, determine the state of the operating system.
[0079] When no application being installed is scanned, it means that there is no newly installed application. However, if the operating system is currently in the first startup state or the upgrade state, a new application may be installed. Therefore, the state of the operating system is determined. When the operating system is in the first startup state or the upgrade state, step S204 is executed. When the operating system is not in the first startup state or the upgrade state, it is determined that the current package management service scan is a system routine scan, and no new application is installed, and the subsequent file compression process is no longer required.
[0080] Step S204, when the operating system is in the first startup state or the upgrade state, filter the application programs installed during the first startup or the upgrade process of the operating system and obtain the library files of the application programs.
[0081] In the disclosed embodiment, considering that some applications may not need to be installed or reinstalled when the operating system is first started or upgraded, the applications installed during the first startup or upgrade of the operating system are screened from all applications.
[0082] In some embodiments, when the operating system is in the first startup state, the applications installed during the first startup of the operating system are screened, and the installation package (ScanPackage) is scanned through the package management service to copy the library files of the application from the APK of the application to obtain the library files of the application.
[0083] In some embodiments, when the operating system is in an upgrade state, applications that are updated as the system is upgraded during the operating system upgrade are screened, and the installation packages are scanned through the package management service. When an application is updated, the library file of the application is copied from the APK of the application to obtain the library file of the application.
[0084] In some embodiments, obtaining the library file of the application includes: traversing the library file path corresponding to the application to obtain the library file. That is, the application has multiple corresponding library files, and the storage paths of the multiple library files may be the same or different. In order to obtain the library file, the library file path is traversed to obtain all the library files.
[0085] In some embodiments, the electronic device provides a preset function interface, and when acquiring a library file, the preset function interface is called to acquire the library file. The preset function interface may be an interface for executing a file compression function provided by the F2FS compression technology.
[0086] Optionally, after traversing the library file path corresponding to the application, the preset function interface is called to obtain the library file based on the library file path.
[0087] Step S205: compress the library file based on a compression algorithm supported by the flash-friendly file system.
[0088] Among them, Flash Friendly File System (F2FS) is a file system designed for flash memory devices such as SSD (Solid State Disk), eMMC (Embedded Multi Media Card), and UFS (Universal Flash Storage). The compression algorithms supported by F2FS include LZ4, ZSTD, LZO, ZSTD and other algorithms. When compressing library files, any compression algorithm supported by F2FS can be used to compress library files.
[0089] In some embodiments, a preset function interface is called to compress the library file.
[0090] It should be noted that the embodiment of the present disclosure only uses the compression algorithm supported by F2FS to compress library files as an example. In another embodiment, other algorithms can also be used to compress library files, and the embodiment of the present disclosure does not limit this.
[0091] It should be noted that after compressing the library file, the compressed library file is saved so that the corresponding library file can be called later when the application is run.
[0092] The method provided by the embodiment of the present disclosure obtains the library file of the application in response to installing the application; and compresses the library file. A new compression method is provided, which can reduce the storage space occupied and improve the storage efficiency by compressing the library file of the application without affecting the function and performance of the application. This compression method has high reliability and stability. In addition, when the library file is compressed when the application is installed, the library file can be compressed as early as possible, and the storage space occupied can be reduced as early as possible.
[0093] Furthermore, in the disclosed embodiments, the library files of installed applications can be compressed for scenarios where users install applications, operating systems are started for the first time, and operating systems are upgraded, which is applicable to security scenarios for all applications.
[0094] Figure 3 is a flowchart of a file compression method according to an exemplary embodiment, which is executed by an electronic device, see Figure 3 , the method comprises the following steps:
[0095] Step S301, scanning through the package management service.
[0096] Step S302, determine whether a new installation package is scanned, that is, execute SCAN_NEW_INSTALL. If a new installation package is scanned, execute step S303, if no new installation package is scanned, execute step S304.
[0097] Step S303, obtain the library file path in the installation package, obtain the library file, and compress the library file.
[0098] Step S304, determine whether the operating system is currently started for the first time or the operating system is being upgraded. If it is the first time the operating system is started or the operating system is being upgraded, execute step S305, if it is not the first time the operating system is started or the operating system is being upgraded, execute step S307.
[0099] Step S305: Filter the installation packages newly installed during the current operating system startup or upgrade process from multiple installation packages.
[0100] Step S306, obtaining the library file path in the installation package, obtaining the library file, and compressing the library file.
[0101] Step S307, determining that this scan is a routine scan of the system.
[0102] Figure 3 The implementation of the embodiment shown is described above. Figure 2 The embodiments shown will not be described in detail here.
[0103] Figure 4 is a block diagram of a file compression device according to an exemplary embodiment, which is configured in an electronic device, see Figure 4 , the device comprises:
[0104] The library file acquisition module 401 is configured to acquire the library file of the application in response to installing the application;
[0105] The file compression module 402 is configured to compress the library file.
[0106] The device provided in the embodiment of the present disclosure obtains the library file of the application in response to installing the application and compresses the library file. By compressing the library file of the application, the storage space occupied can be reduced and the storage efficiency can be improved without affecting the function and performance of the application.
[0107] In some embodiments, the library file acquisition module 401 is configured to:
[0108] Scanning via package management services;
[0109] When an application being installed is scanned, the library file of the application is obtained.
[0110] In some embodiments, the library file acquisition module 401 is further configured to:
[0111] Determining the state of the operating system when no program being installed is scanned;
[0112] When the operating system is in the first startup state or the upgrade state, the application programs installed during the first startup or the upgrade process of the operating system are screened to obtain the library files of the application programs.
[0113] In some embodiments, the apparatus further comprises:
[0114] A service startup module, configured to start the package management service in response to a triggering operation on the package management service;
[0115] The trigger operation includes at least one of the following: an application installation operation triggered by a user; an operating system startup operation; an operating system upgrade operation.
[0116] In some embodiments, the library file acquisition module 401 is configured to:
[0117] Traverse the library file path corresponding to the application and obtain the library file.
[0118] In some embodiments, the library file acquisition module 401 is configured to call a preset function interface to acquire a library file;
[0119] The file compression module 402 is configured to call a preset function interface to compress the library file.
[0120] In some embodiments, the file compression module 402 is configured to compress the library file based on a compression algorithm supported by the flash-friendly file system F2FS.
[0121] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0122] An embodiment of the present disclosure further provides an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the file compression method in the above embodiment.
[0123] Figure 5 is a block diagram of an electronic device 500 according to an exemplary embodiment.
[0124] Reference Figure 5 , the electronic device 500 may include one or more of the following components: a processing component 502 , a memory 504 , a power component 506 , a multimedia component 508 , an audio component 510 , an input / output (I / O) interface 512 , a sensor component 514 , and a communication component 516 .
[0125] The processing component 502 generally controls the overall operation of the electronic device 500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.
[0126] The memory 504 is configured to store various types of data to support operations on the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phone book data, messages, pictures, videos, etc. The memory 504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0127] The power supply component 506 provides power to the various components of the electronic device 500. The power supply component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 500.
[0128] The multimedia component 508 includes a screen that provides an output interface between the electronic device 500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0129] The audio component 510 is configured to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC), and when the electronic device 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 504 or sent via the communication component 516. In some embodiments, the audio component 510 also includes a speaker for outputting audio signals.
[0130] I / O interface 512 provides an interface between processing component 502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0131] The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the electronic device 500. For example, the sensor assembly 514 can detect the open / closed state of the electronic device 500, the relative positioning of components, such as the display and keypad of the electronic device 500, and the sensor assembly 514 can also detect the position change of the electronic device 500 or a component of the electronic device 500, the presence or absence of user contact with the electronic device 500, the orientation or acceleration / deceleration of the electronic device 500, and the temperature change of the electronic device 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 514 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0132] The communication component 516 is configured to facilitate wired or wireless communication between the electronic device 500 and other devices. The electronic device 500 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0133] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0134] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, and the instructions can be executed by a processor 520 of an electronic device 500 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0135] The embodiments of the present disclosure also provide a non-temporary computer-readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the file compression method in the above embodiment.
[0136] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0137] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A file compression method, characterized in that: The method comprises: In response to installing the application, obtaining a library file of the application; The library file is compressed.
2. The method according to claim 1, characterized in that In response to installing the application, obtaining a library file of the application includes: Scanning via package management services; When an application being installed is scanned, a library file of the application is obtained.
3. The method according to claim 2, characterized in that In response to installing the application, obtaining the library file of the application further includes: Determining the state of the operating system when no program being installed is scanned; When the operating system is in the first startup state or the upgrade state, the application programs installed during the first startup or the upgrade process of the operating system are screened to obtain the library files of the application programs.
4. The method according to claim 2, characterized in that: Before scanning by the package management service, the method further includes: In response to a triggering operation on the package management service, starting the package management service; The trigger operation includes at least one of the following: an application installation operation triggered by a user; an operating system startup operation; an operating system upgrade operation.
5. The method according to any one of claims 1 to 4, characterized in that: The step of obtaining the library file of the application comprises: Traverse the library file path corresponding to the application to obtain the library file.
6. The method according to any one of claims 1 to 4, characterized in that: The step of obtaining the library file of the application comprises: Calling a preset function interface to obtain the library file; The compressing the library file comprises: The preset function interface is called to compress the library file.
7. The method according to any one of claims 1 to 4, characterized in that: The compressing the library file comprises: The library file is compressed based on a compression algorithm supported by the flash-friendly file system F2FS.
8. A file compression device, characterized in that: The device comprises: A library file acquisition module, configured to acquire a library file of the application in response to installing the application; The file compression module is configured to compress the library file.
9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method as claimed in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 7.