WO2023109569A1 - Procédé de stockage de fichier, procédé d'accès à un fichier, dispositif électronique et support de stockage - Google Patents

Procédé de stockage de fichier, procédé d'accès à un fichier, dispositif électronique et support de stockage Download PDF

Info

Publication number
WO2023109569A1
WO2023109569A1 PCT/CN2022/136787 CN2022136787W WO2023109569A1 WO 2023109569 A1 WO2023109569 A1 WO 2023109569A1 CN 2022136787 W CN2022136787 W CN 2022136787W WO 2023109569 A1 WO2023109569 A1 WO 2023109569A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
runtime
installation package
compressed
data
Prior art date
Application number
PCT/CN2022/136787
Other languages
English (en)
Chinese (zh)
Inventor
王夏阳
钱璟
邱歌
谷德贺
姜俊超
陈宜
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023109569A1 publication Critical patent/WO2023109569A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1727Details of free space management performed by the file system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the embodiments of the present application relate to the field of information technology, and in particular, to a file storage method, a file access method, electronic equipment, and a storage medium.
  • terminal devices are indispensable in people's work, life and entertainment, and a large number of terminal device applications continue to emerge.
  • applications covering all aspects of work and life such as office, entertainment, social networking, shopping, and financial management.
  • users install a large number of applications to meet the all-round needs of personal daily life and work.
  • the application installed on the terminal device will occupy a part of the storage space of the terminal device to store various files required for the operation of the application.
  • the Android system is a mobile operating system that is widely used in terminal devices such as mobile phones, tablets, and TVs.
  • the terminal device includes storage devices such as flash memory, which are used to store instructions and data files that need to be used during the running of the application.
  • the application program generally does not directly access the storage device, but sends the file creation, read and write operation requests to the file system module (such as f2fs, ext4) in the operating system, and the file system further selects the storage location of the data and communicates with the storage device. interact.
  • the file system uses the inode data structure to manage the saved files, and each file corresponds to an inode. Each inode has a unique number.
  • the inode records the logical data block address of the file data stored on the storage device.
  • Terminal devices such as mobile phones, tablets, and TVs run different Android system interfaces, but the application installation methods follow a common process: the application developer releases the installation package file in APK format, and the terminal operating system unpacks the APK file and unpacks the package.
  • the files within are stored in the terminal device.
  • the APK file is a packaging file based on the JAR format, and the JAR format is designed and defined based on the mainstream compressed file format ZIP format. Therefore, the APK file format is basically similar to the ZIP archive format.
  • the APK file contains various resource files required for the application to run, including the dex file storing application instructions, the runtime file (extension so file), and data files such as pictures and text.
  • the process of installing an application in the Android system is roughly as follows: the application installer of the system unpacks the APK file, and stores the runtime file stored in the package in the application installation directory, and the APK file itself is also stored in the application installation directory. Since both the APK file and the runtime file obtained by unpacking the APK are stored in the application installation directory after installation, the runtime file exists repeatedly: it is stored in the APK file in a compressed form, and each runtime file is independent of the APK file. exist. Since the content of the runtime file is frequently used during the startup and running of the application, this storage method allows the application to read the data directly without decompressing the APK package during operation, thereby accelerating the running efficiency of the application.
  • the duplicated space occupation of runtime files wastes valuable storage space.
  • the runtime library files stored repeatedly in the APK occupy a total of more than 1GB of storage space, which is equivalent to more than 300 photo files of 3MB in size.
  • the embodiment of the present application provides a file storage method, a file access method, an electronic device, and a storage medium, so as to provide a method for storing the installation package file, which can save the space occupied by the installation package file in the terminal, thereby enabling Improve storage efficiency.
  • the embodiment of the present application provides a file storage method, including:
  • the corresponding relationship is used to characterize one or more of the runtime compressed files in the installation package file
  • the corresponding relationship between the data block and the runtime file, the first offset is used to represent the offset of one or more data blocks of the runtime compressed file in the installation package file in the installation package file.
  • the space occupied by the installation package file in the terminal can be saved, thereby enabling Improve storage efficiency.
  • the installation package file further includes a data compression file.
  • releasing one or more data blocks of the runtime compressed file in the installation package file includes:
  • releasing one or more data blocks of the runtime compressed file in the installation package file includes:
  • the compressed files can be deleted according to requirements, thereby improving flexibility.
  • One of the possible implementations also includes:
  • one or more data blocks store the data of the data compression file in the installation package file, then one or more data blocks are not released.
  • One of the possible implementations also includes:
  • the embodiment of the present application also provides a file access method, which is applied to an electronic device, and the electronic device is installed with an application program, including:
  • the application program sends an access request to the file system; wherein, the access request is used to access one or more data blocks released in the installation package file, and the access request includes a second offset and a data length;
  • the file system queries the runtime file corresponding to the freed one or more data blocks
  • the file system compresses the run-time library file obtained by the query, and obtains the compressed file of the run-time library accessed;
  • the file system acquires the first offset, reads the compressed file of the accessed runtime library based on the first offset, the second offset and the data length, and returns the read result to the application program.
  • an embodiment of the present application provides a file storage device, including: a processor and a memory, the memory is used to store a computer program; the processor is used to run the computer program, and execute the method as described in the first aspect.
  • an embodiment of the present application provides a file access device, including: a processor and a memory, the memory is used to store a computer program; the processor is used to run the computer program, and execute the method as described in the second aspect.
  • the embodiment of the present application provides an electronic device, including:
  • Memory the memory is used to store computer program codes
  • the computer program codes include instructions, when the electronic device reads the instructions from the memory, the electronic device executes the methods described in the first aspect and the second aspect.
  • the embodiments of the present application provide a computer-readable storage medium, in which a computer program is stored in the computer-readable storage medium, and when it is run on a computer, the computer executes the program described in the first aspect and the second aspect. Methods.
  • an embodiment of the present application provides a computer program, which is used to execute the methods described in the first aspect and the second aspect when the above computer program is executed by a computer.
  • all or part of the program in the seventh aspect may be stored on a storage medium packaged with the processor, or part or all may be stored on a memory not packaged with the processor.
  • FIG. 1 is a schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application
  • FIG. 2 is a schematic flow diagram of a file storage method provided in an embodiment of the present application.
  • FIG. 3 is a schematic diagram of file decompression storage provided by the embodiment of the present application.
  • FIG. 4 is a schematic diagram of data block release provided by the embodiment of the present application.
  • FIG. 5 is a schematic diagram of releasing some data blocks provided by the embodiment of the present application.
  • FIG. 6 is a schematic diagram of the software structure of the electronic device provided by the embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a file access method provided in an embodiment of the present application.
  • FIG. 8 is a schematic diagram of file compression provided by the embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a file storage device provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a file access device provided by an embodiment of the present application.
  • first and second are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as “first” and “second” may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, "plurality” means two or more.
  • terminal devices are indispensable in people's work, life and entertainment, and a large number of terminal device applications continue to emerge.
  • applications covering all aspects of work and life such as office, entertainment, social networking, shopping, and financial management.
  • users install a large number of applications to meet the all-round needs of personal daily life and work.
  • the application installed on the terminal device will occupy a part of the storage space of the terminal device to store various files required for the operation of the application.
  • the Android system is a mobile operating system that is widely used in terminal devices such as mobile phones, tablets, and TVs.
  • the terminal device includes storage devices such as flash memory, which are used to store instructions and data files that need to be used during the running of the application.
  • the application program generally does not directly access the storage device, but sends the file creation, read and write operation requests to the file system module (such as f2fs, ext4) in the operating system, and the file system further selects the storage location of the data and communicates with the storage device. interact.
  • the file system uses the inode data structure to manage the saved files, and each file corresponds to an inode. Each inode has a unique number.
  • the inode records the logical data block address of the file data stored on the storage device.
  • Terminal devices such as mobile phones, tablets, and TVs run different Android system interfaces, but the application installation methods follow a common process: the application developer releases the installation package file in APK format, and the terminal operating system unpacks the APK file and unpacks the package.
  • the files within are stored in the terminal device.
  • the APK file is a packaging file based on the JAR format, and the JAR format is designed and defined based on the mainstream compressed file format ZIP format. Therefore, the APK file format is basically similar to the ZIP archive format.
  • the APK file contains various resource files required for the application to run, including the dex file storing application instructions, the runtime file (extension so file), and data files such as pictures and text.
  • the process of installing an application in the Android system is roughly as follows: the application installer of the system unpacks the APK file, and stores the runtime file stored in the package in the application installation directory, and the APK file itself is also stored in the application installation directory. Since both the APK file and the runtime file obtained by unpacking the APK are stored in the application installation directory after installation, the runtime file exists repeatedly: it is stored in the APK file in a compressed form, and each runtime file is independent of the APK file. exist. Since the content of the runtime file is frequently used during the startup and running of the application, this storage method allows the application to read the data directly without decompressing the APK package during operation, thereby accelerating the running efficiency of the application.
  • the duplicated space occupation of runtime files wastes valuable storage space.
  • the runtime files repeatedly stored in the APK occupy a total of more than 1GB of storage space, which is equivalent to more than 300 photo files with a size of 3MB.
  • the embodiment of the present application proposes a file storage method, which is applied to the electronic device 100 .
  • the electronic device 100 may be a mobile terminal.
  • the mobile terminal may also be called terminal equipment, user equipment (User Equipment, UE), access terminal, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent, or user device.
  • the mobile terminal can also be a wearable device, for example, a smart watch, a smart bracelet, and the like.
  • the embodiment of the present application does not specifically limit the specific form of the electronic device 100 implementing the technical solution.
  • FIG. 1 shows a schematic structural diagram of an electronic device 100 .
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and A subscriber identification module (subscriber identification module, SIM) card interface 195 and the like.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit
  • the processor 110 may receive the image code stream of the rear camera, and output a preview image; when the touch sensor 180K detects a specific gesture, adjust the rendering parameters of the preview image or adjust the hardware parameters of the rear camera; and According to the user's gesture recognized by the gesture recognition unit, the shooting parameters adjusted by the gesture on the small screen are changed.
  • the controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is a cache memory.
  • the memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system.
  • processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input and output
  • subscriber identity module subscriber identity module
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (serial data line, SDA) and a serial clock line (derail clock line, SCL).
  • processor 110 may include multiple sets of I2C buses.
  • the processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flashlight, the camera 193 and the like through different I2C bus interfaces.
  • the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to realize the touch function of the electronic device 100 .
  • the I2S interface can be used for audio communication.
  • processor 110 may include multiple sets of I2S buses.
  • the processor 110 may be coupled to the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170 .
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering calls through the Bluetooth headset.
  • the PCM interface can also be used for audio communication, sampling, quantizing and encoding the analog signal.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is generally used to connect the processor 110 and the wireless communication module 160 .
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function.
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 .
  • MIPI interface includes camera serial interface (camera serial interface, CSI), display serial interface (display serial interface, DSI), etc.
  • the processor 110 communicates with the camera 193 through the CSI interface to realize the shooting function of the electronic device 100 .
  • the processor 110 communicates with the display screen 194 through the DSI interface to realize the display function of the electronic device 100 .
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193 , the display screen 194 , the wireless communication module 160 , the audio module 170 , the sensor module 180 and so on.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface conforming to the USB standard specification, specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100 , and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other electronic devices, such as AR devices.
  • the interface connection relationship between the modules shown in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is configured to receive a charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 can receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 is charging the battery 142 , it can also supply power to the electronic device through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be disposed in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be set in the same device.
  • the wireless communication function of the electronic device 100 can be realized by the antenna 1 , the antenna 2 , the mobile communication module 150 , the wireless communication module 160 , a modem processor, a baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves and radiate them through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 150 may be set in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be set in the same device.
  • a modem processor may include a modulator and a demodulator.
  • the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is passed to the application processor after being processed by the baseband processor.
  • the application processor outputs sound signals through audio equipment (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent from the processor 110, and be set in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite, etc. applied on the electronic device 100.
  • System global navigation satellite system, GNSS
  • frequency modulation frequency modulation, FM
  • near field communication technology near field communication, NFC
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (code division multiple access, CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC , FM, and/or IR techniques, etc.
  • the GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a Beidou navigation satellite system (beidou navigation satellite system, BDS), a quasi-zenith satellite system (quasi -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • Beidou navigation satellite system beidou navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos and the like.
  • 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 (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
  • the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • the electronic device 100 may include a main screen and a small screen, the main screen may be located on the front of the electronic device 100 , and the small screen may be located on the back of the electronic device 100 .
  • the main screen can be used to display the window of the camera application and can be used to display a preview image.
  • the small screen may be a small screen integrated on the back of the electronic device 100, and when the user uses the rear camera to take a selfie, a preview image is displayed. In a normal state (for example, a standby state), the small screen can display a clock.
  • the electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.
  • the ISP is used for processing the data fed back by the camera 193 .
  • the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin color.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be located in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object generates an optical image through the lens and projects it to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other image signals.
  • the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs.
  • the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
  • MPEG moving picture experts group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the electronic device 100 can be realized through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.
  • the internal memory 121 may be used to store computer-executable program codes including instructions.
  • the internal memory 121 may include an area for storing programs and an area for storing data.
  • the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
  • the storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the electronic device 100 can implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
  • the audio module 170 may also be used to encode and decode audio signals.
  • the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
  • Speaker 170A also referred to as a "horn" is used to convert audio electrical signals into sound signals.
  • Electronic device 100 can listen to music through speaker 170A, or listen to hands-free calls.
  • Receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the receiver 170B can be placed close to the human ear to receive the voice.
  • the microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can put his mouth close to the microphone 170C to make a sound, and input the sound signal to the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C. In some other embodiments, the electronic device 100 may be provided with two microphones 170C, which may also implement a noise reduction function in addition to collecting sound signals. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions, etc.
  • the earphone interface 170D is used for connecting wired earphones.
  • the earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (open mobile terminal platform, OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal.
  • pressure sensor 180A may be disposed on display screen 194 .
  • pressure sensors 180A such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors.
  • a capacitive pressure sensor may be comprised of at least two parallel plates with conductive material.
  • the electronic device 100 determines the intensity of pressure according to the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view short messages is executed. When a touch operation whose intensity is greater than or equal to the first pressure threshold acts on the icon of the short message application, the instruction of creating a new short message is executed.
  • the gyro sensor 180B can be used to determine the motion posture of the electronic device 100 .
  • the angular velocity of the electronic device 100 around three axes may be determined by the gyro sensor 180B.
  • the gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shaking of the electronic device 100 through reverse movement to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • the air pressure sensor 180C is used to measure air pressure.
  • the electronic device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip leather case.
  • the electronic device 100 when the electronic device 100 is a clamshell machine, the electronic device 100 can detect opening and closing of the clamshell according to the magnetic sensor 180D.
  • features such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the acceleration of the electronic device 100 in various directions (generally three axes).
  • the magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • the distance sensor 180F is used to measure the distance.
  • the electronic device 100 may measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F for distance measurement to achieve fast focusing.
  • Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diodes may be infrared light emitting diodes.
  • the electronic device 100 emits infrared light through the light emitting diode.
  • Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it may be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 .
  • the electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to make a call, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in leather case mode, automatic unlock and lock screen in pocket mode.
  • the ambient light sensor 180L is used for sensing ambient light brightness.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket, so as to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access to application locks, take pictures with fingerprints, answer incoming calls with fingerprints, and the like.
  • the temperature sensor 180J is used to detect temperature.
  • the electronic device 100 uses the temperature detected by the temperature sensor 180J to implement a temperature treatment strategy. For example, when the temperature reported by the temperature sensor 180J exceeds the threshold, the electronic device 100 may reduce the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection.
  • the electronic device 100 when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by the low temperature.
  • the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • the touch sensor 180K is also called “touch device”.
  • the touch sensor 180K can be disposed 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 a touch operation 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 .
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the position of the display screen 194 .
  • the touch sensor 180K can monitor the touch points on the small screen in real time, and perform gesture recognition according to the touch points to determine the touch gesture.
  • the bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice. The bone conduction sensor 180M can also contact the human pulse and receive the blood pressure beating signal. In some embodiments, the bone conduction sensor 180M can also be disposed in the earphone, combined into a bone conduction earphone.
  • the audio module 170 can analyze the voice signal based on the vibration signal of the vibrating bone mass of the vocal part acquired by the bone conduction sensor 180M, so as to realize the voice function.
  • the application processor can analyze the heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 180M, so as to realize the heart rate detection function.
  • the keys 190 include a power key, a volume key and the like.
  • the key 190 may be a mechanical key. It can also be a touch button.
  • the electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100 .
  • the motor 191 can generate a vibrating reminder.
  • the motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
  • touch operations applied to different applications may correspond to different vibration feedback effects.
  • the motor 191 may also correspond to different vibration feedback effects for touch operations acting on different areas of the display screen 194 .
  • Different application scenarios for example: time reminder, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the SIM card interface 195 is used for connecting a SIM card.
  • the SIM card can be connected and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 .
  • the electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different.
  • the SIM card interface 195 is also compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as calling and data communication.
  • the electronic device 100 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
  • FIG. 2 it is a schematic flowchart of an embodiment of the file storage method provided by the embodiment of the present application, including:
  • Step 201 obtaining an installation package file.
  • the installation package file may be obtained through user download, user import, etc., and the installation package file may be an installation package supported by the Android system (Android), for example, an apk file.
  • the installation package file may be an installation package of an application in the Android system.
  • the installation package may be a compressed file.
  • the installation package may include multiple runtime compressed files, where each runtime compressed file may include compressed data corresponding to the runtime compressed file. It can be understood that the installation package may also include other compressed files, for example, data compressed files such as pictures and text.
  • the installation package file may be stored on a storage device through a file system, where the storage device may be a storage medium such as a flash memory or a magnetic disk, and the embodiment of the present application does not specifically limit the type of the storage device.
  • Step 202 decompress the compressed data of the runtime file in the installation package file to obtain the runtime file.
  • the installation package file can be installed.
  • the compressed data of the runtime file in the installation package file can be decompressed, thereby obtaining the runtime file.
  • the installation package file and the runtime library file obtained after decompression may be stored in the file system.
  • other compressed files for example, data compressed files such as pictures and text
  • the installation package file is still reserved in the file system, there may be duplicate runtime files stored in the file system at this time.
  • a copy of the runtime file exists in the installation package file in a compressed form (the installation package file is stored in the file system), a run-time library file with the same content is stored independently in the file system in decompressed form.
  • the installation package file includes a runtime compressed file a', which is obtained by compressing the runtime file a, after decompressing the runtime compressed file a' in the installation package file, you can Get the runtime file a.
  • duplicate runtime files are stored in the file system, for example, runtime compressed file a' and runtime file a.
  • the installation package file 300 is stored in the file system, wherein the installation package file 300 includes three compressed runtime files, which are respectively the first runtime compressed file 301, the second runtime compressed file 302 and the second compressed runtime file. 3. Runtime compressed file 303.
  • the installation package file 300 is decompressed, thereby obtaining three runtime library files, for example, the first runtime library file 301', the second runtime library file 302', and the third runtime library file 303', wherein the first A runtime library file 301' is a runtime library file obtained after the first runtime library compressed file 301 is decompressed, and a second runtime library file 302' is a runtime library file obtained after decompressing the second runtime library compressed file 302.
  • the third runtime file 303 ′ is a runtime file obtained after decompressing the third runtime compressed file 303 .
  • the file system not only includes compressed runtime files (for example, the first runtime compressed file 301, the second runtime compressed file 302, and the third runtime compressed file 303), but also includes the decompressed runtime files. files (the first runtime file 301', the second runtime file 302' and the third runtime file 303').
  • Step 203 recording the correspondence between one or more data blocks of the runtime compressed file in the installation package file and the runtime file, and one or more data blocks of the runtime compressed file in the installation package file in the installation package file At the first offset of , free one or more data blocks of the runtime compressed file in the installation package file.
  • each compressed file contained in the apk file can be scanned according to the format definition of the installation package file (for example, apk file), and whether it is a runtime file with the so suffix is judged according to the file name saved in the metadata.
  • the installation directory of the application program can be scanned to find the corresponding independently stored runtime library file (for example, the first runtime library file 301', the second runtime library file 302' or the third runtime library file in FIG. library file 303'), and record the correspondence between the compressed runtime library file and the independently stored runtime library file.
  • the corresponding independently stored runtime library file for example, the first runtime library file 301', the second runtime library file 302' or the third runtime library file in FIG. library file 303'
  • information such as the above correspondence and the first offset may be stored in the metadata of the installation package file in the inode metadata area of the file system.
  • the above correspondence can be used to characterize the correspondence between one or more data blocks of compressed data of all runtime files in the installation package file and the decompressed runtime files, for example, the correspondence can include the The inode number of the runtime file corresponding to one or more data blocks of the compressed data of the runtime file in the package file.
  • the above-mentioned first offset is used to represent the offset of the first byte of one or more data blocks of the compressed data of the runtime file in the installation package file in the installation package file, for example, after the runtime file is compressed
  • the first byte of corresponds to the 1314th byte of the installation package file.
  • the above correspondence can record the inode number of the runtime file, and the runtime file can be the runtime file decompressed from the same installation package file, or the decompressed installation package file of other applications with the same Contents of the runtime file.
  • Some runtime libraries may be referenced by multiple applications, therefore, there may be runtime library files with the same content in the installation directories of multiple applications.
  • the compressed data of the runtime library file in the installation package file can be Release one or more data blocks, thereby saving the storage space of the electronic device 100 .
  • the above-mentioned release operation may be to set the logical storage address of one or more corresponding data blocks to 0 in the database index of the installation package file, and reclaim these data blocks, that is, to clear the occupied space of these data blocks. storage space.
  • one or more data blocks of the compressed data of all runtime library files in the installation package file may be released, or one or more data blocks in the installation package file may be released.
  • One or more data blocks of the compressed data of the partial runtime file are freed.
  • the file system stores an installation package file 300 , metadata 310 of the installation package file 300 and a set of decompressed files 320 .
  • the installation package file 300 includes a plurality of released compressed data and other compressed data, for example, the released compressed data may include the first released compressed data 401, the second released compressed data 402 and the third released compressed data 403, The other compressed data may include fourth other compressed data 404 .
  • the first released compressed data 401 may be a compressed file obtained after releasing the data blocks in the first compressed runtime file 301
  • the second released compressed data 402 may be the data blocks in the second compressed runtime file 302
  • the third released compressed data 403 may be a compressed file obtained after releasing the data blocks in the third compressed runtime file 303 .
  • the decompressed file set 320 includes decompressed runtime files, for example, a first runtime file 301', a second runtime file 302' and a third runtime file 303'.
  • the metadata 310 includes information such as a correspondence relationship 311 and a first offset 312 .
  • the corresponding relationship 311 may include the inode number of the first runtime file 301' corresponding to the first release data block 401, the inode number of the first runtime file 302' corresponding to the second release data block 402, and the third The inode number of the first runtime file 303' corresponding to the release data block 403 is released.
  • the first offset 312 may include the offset of the first byte of the data block of the first released compressed data 401 in the installation package file 300, the first byte of the data block of the second released compressed data 402 at The offset in the installation package file 300 and the offset of the first byte of the data block of the third released compressed data 403 in the installation package file 300 .
  • the installation package file may also be marked to indicate that the installation package file is a space-saving installation package. Since the storage space has not been released at this time, but in order to prevent the application program from accessing the installation package file while releasing the data block, the file system has not recognized that the installation package file needs special processing, so the compressed runtime file cannot be returned Data, thereby affecting the execution of the application program, therefore, the installation package file can be marked first. By setting the flag in advance, the file system can still respond to the application's read file request even if the free space operation has not been completed.
  • the file system releases one or more data blocks (for example, compressed runtime files) in the installation package file, since one runtime file may occupy multiple consecutive data blocks, and one data block may contain different
  • the data of the compressed file (for example, contains the data of the compressed file of the runtime library and the data of the compressed file of the data), so if a data block contains the data of different compressed files, the data block that stores the compressed data of the runtime file will not be released , that is to say, the file system can release some data blocks of the compressed runtime file to be released, wherein, this part of the data block only contains the data of the compressed runtime file, and does not contain the data of the compressed data file.
  • the data of the library compressed file contains the data blocks of the data compressed file, and will not be released.
  • the file system may be used to process the inode corresponding to the installation package file, and set the logical storage address record of the data block to be released to 0. Then the file system executes a data block reclamation operation, so that the freed data block can be used by other files, thereby completing space release, thereby improving space storage efficiency.
  • the storage device usually divides storage units (for example, data blocks) according to the granularity of 612 bytes, 4KB, etc.
  • a runtime compressed file may occupy a part of a storage unit in the installation package file, and the same storage unit also contains the data of other compressed files in the installation package file, that is, in the same data block, it may contain different Data of compressed files (for example, runtime compressed files and data compressed files).
  • the embodiment of the present application will not release part of the data blocks storing the compressed file data of the runtime library.
  • the runtime compressed file 510 may include four parts of data, such as a first part of data 511, a second part of data 512, a third part of data 513 and a fourth part of data 514, respectively occupying the first data block 501, The second data block 502 , the third data block 503 , and the fourth data block 504 .
  • each data block may be a storage unit.
  • the first data block 501 also includes the fifth part data 521 of the first other file
  • the fourth data block 504 also includes the sixth part data block 531 of the second other file.
  • the file and the second other files may be data compressed files of pictures and characters (that is, non-running library compressed files). Since the first data block 501 and the fourth data block 504 not only include part of the data of the runtime compressed file 510 (for example, the first part of data 511 and the fourth part of data 514), they also include part of the data of other files (for example, Also contains the fifth part data 521 of the first other file and the sixth part data 531 of the second other file), but the first other file and the second other file are not decompressed, thus causing the fifth part data 521 And after the sixth part of the data block 531 is released, the data cannot be recovered.
  • the first data block 501 and the fourth data block 504 not only include part of the data of the runtime compressed file 510 (for example, the first part of data 511 and the fourth part of data 514), they also include part of the data of other files (for example, Also contains the fifth part data 521 of the first other file and the sixth part data 531 of the second other file), but the first
  • the data stored in the first data block 501 and the fourth data block 504 cannot be released, that is, the first data block 501 and the fourth data block 504 cannot be released, only the second data block 502 and the third data block The data stored in the block 503 is released, thereby completing the release of some data blocks of the runtime compressed file 510 .
  • the above-mentioned embodiment is illustrated with the apk file of the Android system, but it does not constitute a limitation to the embodiment of the present application.
  • the present application is also applicable to other types of installations in the file field package file. Therefore, the embodiment of the present application does not specifically limit the type of the above-mentioned installation package file.
  • the application scenario of the embodiment of the present application may be that during the application installation process, the installer completes operations such as decompression of the installation package file (for example, apk file), or the system may set up a background worker thread to The above method is triggered when the system is idle.
  • the installation package file for example, apk file
  • the above exemplarily introduces the process of storing the installation package file through FIGS. 2-5 .
  • the following exemplarily introduces the process of the application program accessing the installation package file through FIGS. 6-8 .
  • FIG. 6 is a software system architecture diagram of the electronic device 100 .
  • the application program 600 runs on the electronic device 100.
  • the electronic device 100 can be equipped with an Android system or an Android-based operating system, and uses an apk format file as an application installation package. After the application program is installed, various files (for example, runtime files) will be deleted. stored on storage device 620 .
  • the storage device 620 is used to store instructions and data files that need to be used during the running of the application program.
  • the storage device 620 may store the installation package file (for example, apk file) itself, and the runtime file obtained by decompressing the installation package file.
  • the operating system 610 may include a file system 611 and a compression unit 612 .
  • the compression unit 612 is used to compress the runtime library file, so as to obtain the runtime library compressed file.
  • the application program 600 usually does not directly access the storage device 620 , but sends file creation, read and write operation requests to the file system 611 in the operating system 610 .
  • the type of the file system 611 may be f2fs or ext4. It can be understood that the type of the above file system 611 may also be other types, and the embodiment of the present application does not specifically limit the type of the above file system 611. After the file system 611 receives the above creation, read and write operation requests, it can further select the storage location of the data, and interact with the storage device 620, thereby completing the access of the application program.
  • Figure 7 is a schematic flowchart of an embodiment of the file access method provided by the embodiment of the present application, wherein the application scenario shown in Figure 7 can be application sharing, for example, the user can use the application sharing function in an application to install Package file shared with another user.
  • Other application scenarios are also possible, for example, the user may access one or more data blocks in the installation package file through an application.
  • the following is an exemplary description by accessing one or more data blocks in the installation package file, but this does not constitute a limitation to the embodiment of the present application. include:
  • step 701 the application program 600 sends an access request to the file system 611 for accessing one or more data blocks released in the installation package file.
  • the application program 600 may send an access request to the file system 611 for accessing one or more released data blocks in the installation package file.
  • the access request may include the second offset and data length of the one or more data blocks being accessed.
  • the second offset is used to characterize the offset of one or more data blocks being accessed in the installation package file
  • the data length is used to characterize the length of the data being accessed this time.
  • the application program 600 may access one or more released data blocks in the installation package file, where the one or more released data blocks may be runtime compressed files.
  • the file system 611 may provide a file reading interface, for example, read_data_page(file, offset, size), which is used to move file data blocks within a specified range from the storage device to the DRAM, thereby allowing the application program to read from DRAM directly reads file data blocks. It can be understood that, usually, the reading operation of files (including installation package files) will go through the above-mentioned read_data_page interface, which is a general interface.
  • step 702 the file system 611 queries the runtime file corresponding to the accessed freed data block.
  • the file system 611 After the file system 611 receives the access request from the application program 600, it can obtain the second offset of the accessed one or more data blocks in the installation package file, and can record the data block in the metadata Lookup in the logical address. If the logical address of the one or more accessed data blocks is 0, it means that the accessed one or more data blocks have been released.
  • the file system 611 can query the runtime file corresponding to the accessed and released data blocks, so as to reacquire the accessed data.
  • the file system 611 may perform a query on the metadata of the accessed freed data block, so as to obtain the corresponding relationship and the first offset.
  • the above-mentioned first offset is used to represent the offset of the compressed runtime file in the installation package file.
  • each runtime compressed file contains a first offset
  • the above second offset can be Compare with the first offset of each runtime compressed file one by one, if the first offset of any runtime compressed file (for example, assuming that the compressed runtime file is a.so) is the same as the second offset If the amount matches, the corresponding relationship (for example, inode number) corresponding to the runtime compressed file (a.so) can be obtained, and the runtime file corresponding to the accessed released data block can be found through the inode number. After the file system 611 finds the inode number in the metadata, it can obtain the corresponding runtime file according to the inode number.
  • step 703 the compression unit 612 compresses the accessed runtime file to obtain a compressed file of the accessed runtime.
  • the file system 611 can instruct the compression unit 612 to compress the accessed runtime file, thereby obtaining a compressed file of the accessed runtime library, which is the same as the above inode number correspond.
  • the compression unit 612 executes a compression algorithm (for example, the deflate algorithm)
  • the compression algorithm should be consistent with the compression algorithm of the installation package file, thereby ensuring that the runtime compressed file obtained after the runtime file is compressed is the same as
  • the runtime compressed files in the installation package file are consistent, for example, the length and content of the files are consistent.
  • the compressed accessed runtime library file can be stored in the compressed data cache.
  • the compressed data cache can be used to store the compressed compressed file. Access the runtime archive. In this way, the application program does not need to be compressed every time it is accessed, avoiding the efficiency reduction caused by repeated compression, but can directly access the compressed file of the accessed runtime library in the compressed cache, thereby improving access efficiency.
  • step 703 may also check whether the accessed runtime compressed file corresponding to the above inode number already exists in the compressed data cache. If the accessed runtime compressed file corresponding to the above-mentioned inode number already exists in the above-mentioned compressed data cache, the accessed data can be directly obtained from the above-mentioned compressed data cache. If there is no compressed file of the accessed runtime library corresponding to the above-mentioned inode number in the above-mentioned compressed data cache, step 703 can be further performed.
  • Step 704 the file system 611 reads the compressed file of the accessed runtime library according to the first offset, the second offset and the data length, and returns the read content to the application program 600 .
  • the file system 611 can be accessed according to the first offset, the second offset, and the data length. Read from the library compressed file, so you can get the read content. In a specific implementation, the file system 611 can read from the position of the second offset to the first offset of the accessed runtime compressed file, and obtain the read content after reading the length of the accessed data . Then, the file system 611 may return the read content to the application program 600 .
  • the first runtime compressed file 810 in the installation package file includes four parts of data, namely the seventh part of data 811 , the eighth part of data 812 , the ninth part of data 813 and the tenth part of data 814 .
  • the seventh part of data 811 occupies the fifth data block 801
  • the eighth part of data 812 occupies the sixth data block 802
  • the ninth part of data 813 occupies the seventh data block 803
  • the tenth part of data 814 occupies the eighth data block 802.
  • the fifth data block 801 also includes the eleventh part of data 815 of other runtime files
  • the eighth data block 804 also includes the twelfth part of data 816 of other runtime files. Therefore, the fifth data block 801 and the eighth data block 804 are not released.
  • the file system can pass the second offset 820 in the access request and the first offset in the metadata.
  • the offset 830 and the first correspondence (inode number) determine the target runtime file 840 corresponding to the inode number.
  • the first run-time library compressed file 810 is a file stored in the installation package file after the run-time library file corresponding to the above inode number is compressed, and the target run-time library file 840 is decompressed by the first run-time library compressed file 810.
  • the target runtime file 840 needs to be Compression, so that the second runtime compressed file 850 can be further obtained, and the second runtime compressed file 850 can be the accessed runtime compressed file.
  • the compression algorithm for the data in the installation package file is consistent with the compression algorithm performed by the compression unit.
  • the read content is obtained, and the read content is returned to the application program.
  • FIG. 9 is a schematic structural diagram of an embodiment of the file storage device of the present application.
  • the above-mentioned file storage device 90 may include: an acquisition module 91, a decompression module 92, and a release module 93; wherein,
  • Obtaining module 91 used to obtain the installation package file
  • the decompression module 92 is used to decompress the runtime compressed file in the installation package file to obtain the runtime file corresponding to the runtime compressed file;
  • the release module 93 is used to record the corresponding relationship and the first offset, and release one or more data blocks of the runtime compressed file in the installation package file; wherein, the corresponding relationship is used to characterize the runtime compression in the installation package file.
  • the corresponding relationship between one or more data blocks of the file and the runtime file, the first offset is used to represent the offset of one or more data blocks of the runtime compressed file in the installation package file in the installation package file.
  • the installation package file further includes a data compression file.
  • the releasing module 93 is further configured to release one or more data blocks of all runtime compressed files in the installation package file.
  • the releasing module 93 is further configured to release one or more data blocks of a part of the runtime compressed file in the installation package file.
  • the release module 93 is further configured to not release one or more data blocks if one or more data blocks store the data of the compressed data file in the installation package file.
  • the above-mentioned file storage device 90 further includes:
  • the marking module is configured to mark the installation package file whose data block has been released; wherein, the mark is used to identify that the data block has been released from the installation package file.
  • FIG. 10 is a schematic structural diagram of an embodiment of the file access device of the present application.
  • the above-mentioned file storage device 1000 may include: an access module 1010, a query module 1020, a compression module 1030 and a return module 1040; wherein,
  • the access module 1010 is used for the application program to send an access request to the file system; wherein, the access request is used to access one or more data blocks released in the installation package file, and the access request includes a second offset and a data length;
  • the query module 1020 is used for the file system to query the runtime files corresponding to the released one or more data blocks;
  • the compression module 1030 is used for the file system to compress the runtime file obtained from the query to obtain the accessed runtime compressed file;
  • the return module 1040 is used for the file system to obtain the first offset, based on the first offset, the second offset and the data length to read in the accessed runtime compressed file, and return the read result to the application program.
  • Each functional unit in each embodiment of the embodiment of the present application may be integrated into one processing unit, or each unit may physically exist separately, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage
  • the medium includes several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk, and other various media capable of storing program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Telephone Function (AREA)

Abstract

Des modes de réalisation de la présente demande concernent un procédé de stockage de fichier, un procédé d'accès à un fichier, un dispositif électronique et un support de stockage, se rapportant au domaine technique des informations. Le procédé comprend : l'acquisition d'un fichier de package d'installation ; la décompression d'un fichier de bibliothèque d'exécution compressé dans le fichier de package d'installation, pour obtenir un fichier de bibliothèque d'exécution correspondant au fichier de bibliothèque d'exécution compressé ; l'enregistrement d'une relation de correspondance et d'un premier décalage, et la libération d'un ou de plusieurs blocs de données du fichier de bibliothèque d'exécution compressé dans le fichier de package d'installation, la relation de correspondance étant utilisée pour représenter une correspondance entre le ou les blocs de données du fichier de bibliothèque d'exécution compressé dans le fichier de package d'installation et le fichier de bibliothèque d'exécution, et le premier décalage étant utilisé pour représenter un décalage dans le fichier de package d'installation du ou des blocs de données du fichier de bibliothèque d'exécution compressé dans le fichier de package d'installation. Le procédé décrit dans les modes de réalisation de la présente demande peut réduire l'espace occupé par un fichier de package d'installation, ce qui permet d'améliorer l'efficacité de stockage.
PCT/CN2022/136787 2021-12-15 2022-12-06 Procédé de stockage de fichier, procédé d'accès à un fichier, dispositif électronique et support de stockage WO2023109569A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111539019.XA CN116263760A (zh) 2021-12-15 2021-12-15 文件存储方法、文件访问方法、电子设备及存储介质
CN202111539019.X 2021-12-15

Publications (1)

Publication Number Publication Date
WO2023109569A1 true WO2023109569A1 (fr) 2023-06-22

Family

ID=86723611

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/136787 WO2023109569A1 (fr) 2021-12-15 2022-12-06 Procédé de stockage de fichier, procédé d'accès à un fichier, dispositif électronique et support de stockage

Country Status (2)

Country Link
CN (1) CN116263760A (fr)
WO (1) WO2023109569A1 (fr)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289374A (zh) * 2011-08-31 2011-12-21 中兴通讯股份有限公司 一种构建跨平台软件运行环境的方法及装置
CN104133695A (zh) * 2014-07-15 2014-11-05 珠海金山网络游戏科技有限公司 一种软件客户端的制作及应用方法
US20160124973A1 (en) * 2014-11-04 2016-05-05 International Business Machines Corporation Deleting files written on tape
CN106325896A (zh) * 2015-06-18 2017-01-11 腾讯科技(深圳)有限公司 安装包的共享函数库文件处理方法及装置
CN110941597A (zh) * 2018-09-21 2020-03-31 北京奇虎科技有限公司 解压缩文件的清理方法、装置、计算设备及计算机存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289374A (zh) * 2011-08-31 2011-12-21 中兴通讯股份有限公司 一种构建跨平台软件运行环境的方法及装置
CN104133695A (zh) * 2014-07-15 2014-11-05 珠海金山网络游戏科技有限公司 一种软件客户端的制作及应用方法
US20160124973A1 (en) * 2014-11-04 2016-05-05 International Business Machines Corporation Deleting files written on tape
CN106325896A (zh) * 2015-06-18 2017-01-11 腾讯科技(深圳)有限公司 安装包的共享函数库文件处理方法及装置
CN110941597A (zh) * 2018-09-21 2020-03-31 北京奇虎科技有限公司 解压缩文件的清理方法、装置、计算设备及计算机存储介质

Also Published As

Publication number Publication date
CN116263760A (zh) 2023-06-16

Similar Documents

Publication Publication Date Title
WO2020259452A1 (fr) Procédé d'affichage plein écran pour terminal mobile et appareil
WO2021083378A1 (fr) Procédé pour accélérer le démarrage d'une application et dispositif électronique
WO2022257977A1 (fr) Procédé de projection d'écran pour dispositif électronique, et dispositif électronique
CN113885759B (zh) 通知消息处理方法、设备、系统及计算机可读存储介质
WO2021159746A1 (fr) Procédé et système de partage de fichiers et dispositif associé
CN111030990B (zh) 一种建立通信连接的方法及客户端、服务端
CN113722058B (zh) 一种资源调用方法及电子设备
WO2021218429A1 (fr) Procédé de gestion d'une fenêtre d'application, dispositif terminal et support de stockage lisible par ordinateur
CN112181616B (zh) 任务处理方法及相关装置
CN114095599B (zh) 消息显示方法和电子设备
CN113973398A (zh) 无线网络连接方法、电子设备及芯片系统
WO2022121988A1 (fr) Procédé de synchronisation d'affichage, dispositif électronique et support de stockage lisible
CN112835610A (zh) 一种构建应用程序资源包的方法、构建装置及终端设备
CN112783418B (zh) 一种存储应用程序数据的方法及移动终端
WO2023051094A1 (fr) Procédé et appareil de récupération de mémoire, dispositif électronique et support de stockage lisible
CN113542574A (zh) 变焦下的拍摄预览方法、终端、存储介质及电子设备
CN113901485B (zh) 应用程序加载方法、电子设备及存储介质
CN113590346B (zh) 处理业务请求的方法和电子设备
WO2023109569A1 (fr) Procédé de stockage de fichier, procédé d'accès à un fichier, dispositif électronique et support de stockage
CN114971107A (zh) 一种隐私风险反馈方法、装置及第一终端设备
CN110737916A (zh) 通信终端及处理方法
CN116723384B (zh) 进程的控制方法、电子设备及可读存储介质
WO2024093703A1 (fr) Procédé et appareil de gestion d'instance, et dispositif électronique et support de stockage
WO2023020420A1 (fr) Procédé d'affichage de volume, dispositif électronique et support de stockage
CN116935869A (zh) 音频数据分发方法、电子设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22906319

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE