WO2023207683A1 - 应用压缩方法、解压缩方法及电子设备 - Google Patents

应用压缩方法、解压缩方法及电子设备 Download PDF

Info

Publication number
WO2023207683A1
WO2023207683A1 PCT/CN2023/089053 CN2023089053W WO2023207683A1 WO 2023207683 A1 WO2023207683 A1 WO 2023207683A1 CN 2023089053 W CN2023089053 W CN 2023089053W WO 2023207683 A1 WO2023207683 A1 WO 2023207683A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
electronic device
interface
file
target application
Prior art date
Application number
PCT/CN2023/089053
Other languages
English (en)
French (fr)
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 WO2023207683A1 publication Critical patent/WO2023207683A1/zh

Links

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/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
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04817Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance using icons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04842Selection of displayed objects or displayed text elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/22Details of telephonic subscriber devices including a touch pad, a touch sensor or a touch detector

Definitions

  • the present application relates to the field of terminal technology, and in particular, to an application compression method, a decompression method and an electronic device.
  • This application provides an application compression method, a decompression method and an electronic device to improve the storage space utilization of the electronic device and improve the user experience.
  • the present application provides an application compression method.
  • the method includes: an electronic device displays a first interface, the first interface includes an application icon and a compression option; then, the electronic device responds to a second click on the first interface. The second operation is used to select the target application icon in the first interface; finally, the electronic device performs transparent compression on the target application corresponding to the target application icon in response to the click operation on the compression option on the first interface.
  • users can select applications to be compressed on the interface according to their own needs, and then the electronic device compresses the selected applications, thereby saving storage space of the electronic device, improving storage space utilization, and thus improving user experience.
  • the method further includes: the electronic device displays a second interface, the second interface includes first prompt information, the first prompt information is used to prompt for the target application corresponding to the target application icon. Compression progress.
  • the prompt information of the compression progress is displayed on the interface, which can facilitate the user to check the compression progress, learn the compression status of the application in a timely manner, and improve the user experience.
  • the method further includes: the electronic device displays a third interface, where the third interface includes the compressed application icon of the target application.
  • the application icon of the compressed target application can be displayed, and the user can determine whether the application is compressed through the displayed application icon.
  • the method further includes: the electronic device displays a fourth interface in response to a third operation on the third interface, and the fourth interface includes a decompression option; the electronic device responds to a third operation on the third interface. Click the decompression option to decompress the target application.
  • the decompression operation interface can be triggered on the interface including the compressed application icon, and then the target application can be decompressed by clicking the decompression option.
  • the method further includes: the electronic device displays a fifth interface, the fifth interface includes second prompt information, and the second prompt information is used to prompt the decompression progress of the target application. .
  • the prompt information of the decompression progress is displayed on the interface, which can facilitate the user to check the decompression progress, learn the decompression status of the application in a timely manner, and improve the user experience.
  • the method further includes: an electronic device launching the target application in response to a fourth operation on the third interface; and the electronic device displaying an application interface of the target application.
  • the fourth operation may be a click operation on the target application, and then the electronic device may respond to the click operation and start the target application.
  • the application can be decompressed at the same time as it is started, so that the user does not need to wait and can quickly open the application.
  • the method further includes: in response to a fourth operation on the third interface, the electronic device displays third prompt information, where the third prompt information includes the file being decompressed by the target application. Information; when the target application is decompressed, the electronic device starts the target application and displays the application interface of the target application.
  • the target application when the user opens the target application, the target application can be decompressed first, and after the decompression is completed, the target application can be started and the application interface can be displayed.
  • the electronic device transparently compresses the target application corresponding to the target application icon, including: the electronic device selects a target file among the application files of the target application, and compresses the target file Divide the file into multiple file blocks; the electronic device selects a corresponding target compression algorithm for each file block of the multiple file blocks; the electronic device compresses each file block of the multiple file blocks according to the corresponding target compression algorithm.
  • the file of the target application can be divided into multiple file blocks, and then each file block can be compressed, thereby reducing the size of the application file of the target application and improving space utilization.
  • the electronic device transparently compresses the target application corresponding to the target application icon, including: the electronic device obtains a first file included in the target application, and the first file includes first data; The device compresses the first data in the first file to obtain a second file.
  • the second file includes the first compressed data, the file names and suffixes of the first file and the second file. Same name.
  • the application data when an application is transparently compressed, the application data can be compressed.
  • the file name and file suffix before and after compression do not change, and the compression process is imperceptible to the application.
  • the electronic device decompresses the target application, including: the electronic device obtains a second file included in the target application, and the second file includes first compressed data of the first data, The first data is data included in the first file in the target application; the electronic device decompresses the first compressed data in the second file to obtain the first file, and the first The file name and suffix name of the file and the second file are the same.
  • the compressed data can be decompressed when decompressing the application. Since the file name and file suffix have not changed before and after decompression, the decompression process is imperceptible to the application.
  • the method further includes: in response to the fifth operation on the target application icon, the electronic device changes the compression mode of the target application corresponding to the target application icon.
  • the compression method of the target application can be changed, so that users can adjust the compression method according to their own needs, which can improve the user experience.
  • this application provides a method for application decompression, which is applied to electronic devices.
  • the method includes:
  • the electronic device displays a fourth interface, the fourth interface includes a target application icon and decompression option of the transparently compressed target application; the electronic device responds to a sixth operation on the fourth interface, the sixth The operation is to select the target application icon in the fourth interface; the electronic device responds to a click operation on the decompression option on the fourth interface, and selects the target application icon corresponding to the target application icon.
  • the application performs transparent decompression.
  • the method further includes: in response to a fifth operation on the target application icon, the electronic device changes the compression method of the target application corresponding to the target application icon.
  • users can change the compression method of the target application, so that users can adjust the compression method according to their own needs, which can improve user experience.
  • the present application provides an electronic device including a display screen; one or more processors; one or more memories; one or more sensors; multiple applications; and one or more computer programs ; wherein the one or more computer programs are stored in the one or more memories, the one or more computer programs include instructions, and when the instructions are called and executed by the one or more processors,
  • the electronic device is caused to perform the above-mentioned first aspect and any possible designed method of the first aspect thereof.
  • the present application provides an electronic device including a display screen; one or more processors; one or more memories; one or more sensors; multiple applications; and one or more computer programs ; wherein the one or more computer programs are stored in the one or more memories, the one or more computer programs include instructions, and when the instructions are called and executed by the one or more processors,
  • the electronic device is caused to perform the above-mentioned second aspect and any possible designed method of the second aspect.
  • the present application also provides an electronic device, which includes modules/units that perform the method of the first aspect or any possible design of the first aspect; these modules/units can be implemented by hardware, or can be The corresponding software implementation is executed through hardware.
  • the present application also provides an electronic device, which includes modules/units that perform the second aspect or any possible design method of the second aspect; these modules/units can be implemented by hardware, or can be The corresponding software implementation is executed through hardware.
  • the present application also provides a computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are run on an electronic device, the electronic device causes the electronic device to execute the first aspect and the first aspect thereof. First aspect any possible design method.
  • the present application also provides a computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are run on an electronic device, the electronic device causes the electronic device to execute the second aspect and the second aspect thereof. Second aspect any possible design method.
  • the present application also provides a computer program product.
  • the computer program product When the computer program product is run on an electronic device, it causes the electronic device to execute the first aspect of the embodiment of the present application and any possible design of the first aspect. method.
  • an embodiment of the present application provides a computer program product.
  • the electronic device causes the electronic device to execute the second aspect of the embodiment of the present application and any possible design of the second aspect. method.
  • Figure 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • Figure 2 is a software structure block diagram of the electronic device provided by the embodiment of the present application.
  • Figure 3 is a flow chart of an application compression method provided by an embodiment of the present application.
  • Figure 4A is a schematic diagram of a user interface for compressing applications provided by an embodiment of the present application.
  • Figure 4B is a schematic diagram of another user interface for compressing applications provided by an embodiment of the present application.
  • Figure 5A is a schematic diagram of a mild compression method for files provided by an embodiment of the present application.
  • Figure 5B is a schematic diagram of a moderate compression method for files provided by an embodiment of the present application.
  • Figure 5C is a schematic diagram of a heavy compression method for files provided by an embodiment of the present application.
  • Figure 6 is a schematic diagram of another user interface for compressing applications provided by an embodiment of the present application.
  • Figure 7 is a schematic diagram of another user interface for compressing applications provided by an embodiment of the present application.
  • Figure 8 is a schematic diagram of another user interface for compressing applications provided by an embodiment of the present application.
  • Figure 9 is a flow chart of another application compression method provided by an embodiment of the present application.
  • Figure 10 is a schematic diagram of a user interface for decompressing an application provided by an embodiment of the present application.
  • Figure 11 is a schematic diagram of another user interface for decompressing an application provided by an embodiment of the present application.
  • Figure 12 is a schematic diagram of another user interface for decompressing an application provided by an embodiment of the present application.
  • Figure 13 is a schematic diagram of a user interface for decompressing an application provided by an embodiment of the present application
  • Figure 14 is a schematic diagram of a user interface for starting a compressed application provided by an embodiment of the present application.
  • Figure 15 is a schematic diagram of another user interface for starting a compressed application provided by an embodiment of the present application.
  • Figure 16 is a schematic structural diagram of another electronic device provided by an embodiment of the present application.
  • Application program referred to as application, it is a software program that can realize one or more specific functions.
  • multiple applications can be installed in an electronic device.
  • camera applications text messaging applications, email applications, video applications, music applications, etc.
  • the applications mentioned below may be applications installed when the electronic device leaves the factory, or may be applications downloaded from the Internet or obtained by the user from other electronic devices during the use of the electronic device.
  • Transparent compression In transparent compression, when the application writes the original data to the file system, the file system itself compresses the data, and then writes the compressed data to the storage device, such as general flash storage. (universal flash storage, UFS); when an application reads data, it first reads the compressed data from UFS, decompresses it through the file system and returns it to the application.
  • UFS universal flash storage
  • compression and decompression can be completely transparent to applications. It should be understood that the application is unaware of the compression and decompression of data. For example, the storage format or suffix name of the data included in the application does not change before and after transparent compression and transparent decompression. The data included in the application becomes compressed data after transparent compression, and the application can still directly recognize and read the compressed data. data.
  • this application provides an application compression method, in which applications can be selected for compression to save storage space occupied by applications, improve storage space utilization, and improve user experience.
  • At least one of the following embodiments includes one or more; wherein, multiple means greater than or equal to two.
  • words such as “first” and “second” are only used for the purpose of differentiating the description.
  • the application compression method provided by the embodiment of the present application can be applied to a variety of electronic devices with display screens, such as mobile phones, tablet computers, wearable devices (for example, watches, bracelets, smart helmets, smart glasses, etc. ), vehicle-mounted equipment, augmented reality (AR)/virtual reality (VR) equipment, notebook computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants , PDA), etc., are not limited by the embodiments of this application.
  • the electronic device involved in the embodiment of the present application may be a foldable electronic device, such as a foldable mobile phone, a foldable tablet computer, etc., which is not limited by the present application.
  • exemplary embodiments of electronic devices include, but are not limited to, equipped with Or other electronic devices with operating systems.
  • the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, and a battery 142.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyro 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, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) wait.
  • different processing units can be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the mobile phone 100 .
  • the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions 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, thus improving the efficiency of the system.
  • the USB interface 130 is an interface that complies with USB standard specifications, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
  • the USB interface 130 can be used to connect a charger to charge the mobile phone 100, and can also be used to transmit data between the mobile phone 100 and peripheral devices.
  • the charging management module 140 is used to receive charging input from the charger.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, wireless communication module 160, etc.
  • the wireless communication function of the mobile phone 100 can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be reused as a diversity antenna for a wireless LAN. In other embodiments, antennas may be used in conjunction with tuning switches.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the mobile phone 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation.
  • at least part of the functional modules of the mobile communication module 150 may be disposed 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 provided in the same device.
  • the wireless communication module 160 can provide applications on the mobile phone 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (bluetooth, BT), and global navigation satellite system. (global navigation satellite system, GNSS), frequency modulation (FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication technology
  • 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
  • the antenna 1 of the mobile phone 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the mobile phone 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 (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), the fifth generation (the fifth generation , 5G) mobile communication system, future communication system, such as the sixth generation (6th generation, 6G) system, etc., BT, GNSS, WLAN, NFC, FM and/or IR technology, etc.
  • GSM global system for mobile communications
  • GPRS general packet radio service
  • CDMA code division multiple access
  • WCDMA broadband Code division multiple access
  • WCDMA wideband code division multiple access
  • time division code division multiple access time-division code
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), 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
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the display screen 194 is used to display the display interface of the application, etc.
  • Display 194 includes a display panel.
  • the display panel can use 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).
  • the mobile phone 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
  • the display screen 194 can be used to display multiple application icons, compression methods, etc., and the user can select The application to compress and how to compress it.
  • Camera 193 is used to capture still images or video.
  • the camera 193 may include a front camera and a rear camera.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the processor 110 executes instructions stored in the internal memory 121 to execute various functional applications and data processing of the mobile phone 100 .
  • the internal memory 121 may include a program storage area and a data storage area.
  • the stored program area can store the operating system and the software code of at least one application program (such as iQiyi application, WeChat application, etc.).
  • the storage data area can store data (such as images, videos, etc.) generated during the use of the mobile phone 100.
  • the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, save pictures, videos, etc. files on an external memory card.
  • the mobile phone 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals.
  • pressure sensor 180A may be disposed on display screen 194 .
  • the gyro sensor 180B can be used to determine the movement posture of the mobile phone 100 .
  • the angular velocity of the phone 100 about three axes ie, x, y, and z axes
  • the gyro sensor 180B can be used to determine the movement posture of the mobile phone 100 .
  • the angular velocity of the phone 100 about three axes may be determined by the gyro sensor 180B.
  • the gyro sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyro sensor 180B detects the angle at which the mobile phone 100 shakes, and calculates the distance that the lens module needs to compensate based on the angle, so that the lens can offset the shake of the mobile phone 100 through reverse movement to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • Air pressure sensor 180C is used to measure air pressure.
  • the mobile phone 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
  • Magnetic sensor 180D includes a Hall sensor.
  • the mobile phone 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case.
  • the mobile phone 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Then, based on the detected opening and closing status of the leather case or the opening and closing status of the flip cover, features such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the acceleration of the mobile phone 100 in various directions (generally three axes). When the mobile phone 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices and be used in horizontal and vertical screen switching, pedometer and other applications.
  • the mobile phone 100 can measure distance via infrared or laser. In some embodiments, when shooting a scene, the mobile phone 100 can use the distance sensor 180F to measure distance to achieve fast focusing.
  • Proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the mobile phone 100 emits infrared light through the light emitting diode.
  • Cell phone 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the mobile phone 100 .
  • the mobile phone 100 can determine that there is no object near the mobile phone 100 .
  • the mobile phone 100 can use the proximity light sensor 180G to detect when the user is holding the mobile phone 100 close to the ear for talking, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in holster mode, and pocket mode automatically unlocks and locks the screen.
  • the ambient light sensor 180L is used to sense ambient light brightness.
  • the mobile phone 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.
  • Ambient light transmission The sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the mobile phone 100 is in the pocket to prevent accidental touching.
  • Fingerprint sensor 180H is used to collect fingerprints.
  • the mobile phone 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application lock, fingerprint photography, fingerprint answering incoming calls, etc.
  • Temperature sensor 180J is used to detect temperature.
  • the mobile phone 100 uses the temperature detected by the temperature sensor 180J to execute the temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the mobile phone 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the mobile phone 100 heats the battery 142 to prevent the low temperature from causing the mobile phone 100 to shut down abnormally. In some other embodiments, when the temperature is lower than another threshold, the mobile phone 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K can be disposed on the display screen 194.
  • the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near the touch sensor 180K.
  • the touch sensor can pass the detected touch operation to the application processor to determine the touch event type.
  • Visual output related to the touch operation may be provided through display screen 194 .
  • the touch sensor 180K may also be disposed on the surface of the mobile phone 100 in a position different from that of the display screen 194 .
  • the touch sensor 180K can detect the user's touch operation on the display screen, for example, it can detect the user's long press operation on the application icon, and then the mobile phone 100 can respond to the long press operation and display an operation menu (such as an operation menu). can include uninstallation, compression, etc.). Then, the user can select compression in the operation menu, and the mobile phone 100 can respond to the user's operation and display the compression mode (for example, light compression, moderate compression, heavy compression). At this time, the user can click to select the compression mode, and the mobile phone 100 can respond to the user's operation. Operation, compress the application, such as transparent compression.
  • Bone conduction sensor 180M can acquire vibration signals.
  • the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human body's vocal part.
  • the bone conduction sensor 180M can also contact the human body's pulse and receive blood pressure beating signals.
  • the buttons 190 include a power button, a volume button, etc.
  • Key 190 may be a mechanical key. It can also be a touch button.
  • the mobile phone 100 can receive key input and generate key signal input related to user settings and function control of the mobile phone 100 .
  • the motor 191 can generate vibration prompts.
  • the motor 191 can be used for vibration prompts for incoming calls and can also be used for touch vibration feedback. For example, touch operations for different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects.
  • the indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, missed calls, notifications, etc.
  • the SIM card interface 195 is used to connect a SIM card.
  • the SIM card can be connected to and separated from the mobile phone 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 .
  • the components shown in Figure 1 do not constitute a specific limitation to the mobile phone.
  • the mobile phone may also include more or fewer components than shown in the figure, or some components may be combined, or some components may be separated, or may be different component layout.
  • the mobile phone 100 shown in FIG. 1 is taken as an example for introduction.
  • the software system of the above-mentioned mobile phone 100 can adopt a layered architecture, including an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of this application takes the Android system with a layered architecture as an example to illustrate the software structure of the mobile phone 100 . It should be understood that the system in the embodiments of this application can also be the Hongmeng system, and this application does not limit this.
  • FIG. 2 is a software structure block diagram of the mobile phone 100 according to the embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has clear roles and division of labor.
  • the layers communicate through software interfaces.
  • the Android system is divided into five layers, from top to bottom: application layer, application framework layer, Android runtime (ART) and native C/C++ library, hardware abstraction layer (hardware abstract layer (HAL) and kernel layer.
  • the application layer can include a series of application packages. As shown in Figure 2, the application package can include desktop, settings, gallery, calendar, call, map, navigation, music, video, short message and other applications.
  • the application framework layer provides an application programming interface (API) and programming framework for applications in the application layer.
  • API application programming interface
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a space compression manager, a window manager, a content provider, a view system, a resource manager, a notification manager, an activity manager, an input manager, etc.
  • the space compression manager is used to scan the application files after the user selects the application to be compressed, and selects the files to be compressed and the file compression algorithm in the application file. For example, the user chooses to lightly compress the gallery application, and then the space compression manager can scan the application file of the gallery, select the file to be compressed in the application file of the gallery, divide the file into file blocks, and then determine the size of the file block. Size, select compression algorithm.
  • the window manager provides window management service (window manager service, WMS).
  • WMS can be used for window management, window animation management, surface management, and as a transfer station for the input system.
  • Content providers are used to store and retrieve data and make this data accessible to applications.
  • This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, etc.
  • a view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
  • the resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.
  • the notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, text information is prompted in the status bar, a beep sounds, the electronic device vibrates, the indicator light flashes, etc.
  • the input manager can provide input management service (Input Manager Service, IMS).
  • IMS can be used to manage system input, such as touch screen input, key input, sensor input, etc.
  • IMS takes out events from the input device node and distributes the events to appropriate windows through interaction with WMS.
  • the Android runtime includes core libraries and Android runtime.
  • the Android runtime is responsible for converting source code into machine code.
  • the Android runtime mainly includes the use of ahead of time (ahead or time, AOT) compilation technology and just in time (just in time, JIT) compilation technology.
  • the core library is mainly used to provide basic Java class library functions, such as basic data structures, mathematics, IO, tools, databases, networks and other libraries.
  • the core library provides APIs for users to develop Android applications.
  • Native C/C++ libraries can include multiple function modules. For example: surface manager (surface manager), media framework (Media Framework), libc, OpenGL ES, SQLite, Webkit, etc.
  • the surface manager is used to manage the display subsystem and provides the integration of 2D and 3D layers for multiple applications.
  • the media framework supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG etc.
  • OpenGL ES provides the drawing and manipulation of 2D graphics and 3D graphics in applications. SQLite provides a lightweight relational database for electronic device 100 applications.
  • the hardware abstraction layer runs in user space, encapsulates the kernel layer driver, and provides a calling interface to the upper layer.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer includes at least the file system, display driver, Bluetooth driver, camera driver, audio driver, and sensor driver. Among them, the file system can provide file compression capabilities.
  • the user can select the application to be compressed (for example, a gallery application) and the compression method on the desktop, and click the compression button. Then the space compression manager can scan the application files and select the files to be compressed in the application files. and file compression algorithms. Then, the space compression manager can call the file system to compress the gallery application. In other embodiments, the file system may be called through a system application, such as a settings application, to compress the gallery application.
  • the application to be compressed for example, a gallery application
  • the space compression manager can scan the application files and select the files to be compressed in the application files. and file compression algorithms. Then, the space compression manager can call the file system to compress the gallery application.
  • the file system may be called through a system application, such as a settings application, to compress the gallery application.
  • the process of applying compression can be triggered by the user or by an electronic device, which is not limited by this application.
  • the following uses mobile phone 100 as an example to introduce the application compression method triggered by the user.
  • FIG. 3 it is a flow chart of an application compression method provided by an embodiment of the present application.
  • the method may include the following steps:
  • S301 Receive the user's instruction to select the application to be compressed and the corresponding compression method.
  • users can select the applications to be compressed and their corresponding compression methods through the following methods:
  • Method 1 The user triggers the application to enter editing mode through gesture operations on the main interface, and then selects the application to be compressed and its corresponding compression method.
  • Example 1 As shown in Figure 4A, assume that the mobile phone 100 displays the main interface 400 shown in (a) in Figure 4A.
  • the mobile phone 100 detects the user's gesture operation on the main interface, such as pinching with two fingers as shown in the figure.
  • the interface 410 may be displayed in response to the user's gesture operation, for example, as shown in (b) in FIG. 4A .
  • the interface 410 includes identification of multiple applications (for example, maps, galleries, etc.) with selection boxes, and identification of compression methods (for example, light compression, medium compression, heavy compression). Then, the mobile phone 100 can detect the user's operation on the selection box of the application.
  • the user selects the application icon corresponding to the gallery application and the application icon of the email application in the interface 410 shown in (b) of FIG. 4A.
  • a check mark (for example, a check mark ⁇ ) can be displayed in the selection box of the mail application, and then the medium compression mode button is clicked.
  • the mobile phone 100 can respond to this operation and perform moderate compression on the gallery application and the email application.
  • the interface after compression can be Refer to interface 420 shown in (c) in Figure 4A.
  • the interface 420 may display compressed application icons and uncompressed application icons.
  • the application icon before compression and the application icon after compression can be different.
  • the transparency of the application icon before and after compression can be different; by changing the transparency of the application, users can easily distinguish whether the application is compressed.
  • the user can first select the application icon of the gallery application, and then click the medium compression mode button to compress the gallery application first. Then, the user can select the application icon of the email application, and then click the light compression mode button to compress the email application.
  • the compressed application icons for different applications may be the same or different.
  • the application icon of the compressed gallery application can be as shown in (c) in Figure 4A, and the application icon of the compressed email application can display the word "Compressed” etc., this application does not limit this.
  • the display of the compressed application icon can be different.
  • the transparency corresponding to different compression methods can be different. Through the transparency of the application, the user can easily distinguish the applied compression method.
  • the mobile phone 100 may respond to the user's gesture operation and display the interface. 430.
  • the interface 430 may include identification of multiple applications (eg, map, gallery, etc.) with selection boxes, and a compression button 431 .
  • the three compression modes in the schematic diagram shown in (b) of FIG. 4A may not be displayed on the interface.
  • the user can select the gallery application and the email application in the interface 430, and click the compression button 431.
  • the mobile phone 100 can respond to this operation and compress the gallery application and the email application.
  • the interface after compression can be seen in (( in Figure 4A c) Interface 420 shown.
  • the mobile phone 100 can automatically select a corresponding compression algorithm for the application based on the usage of the application, such as the number of times the application is used. For example, the mobile phone 100 can classify applications according to the number of days the application has not been used, and then select different compression algorithms for different levels. For example, applications that have been unused for more than 7 days use the lz4 algorithm, applications that have been unused for more than 14 days use the Zstd algorithm, and applications that have been unused for more than 30 days use the zip algorithm.
  • the corresponding compression algorithm can also be automatically selected for the application in other ways, such as selecting a compression algorithm based on the frequency of use of the application's files, etc. This application does not limit this.
  • gesture operations shown in Figure 4A and Figure 4B are only examples.
  • the gesture operations can also be other operations, such as drawing circles, drawing polygons, etc. on the display screen.
  • Operation alternatively, the gesture operation may also be an operation such as "shake", which is not limited in the embodiments of this application.
  • the applications selected by the user to be compressed may include one or more.
  • the user can check multiple application icons in the interface 410 and then compress the multiple applications.
  • the files of an application can be divided into multiple files, and then the files are divided into file blocks in each file, and finally compressed according to the file blocks.
  • file 1 can be divided into multiple file blocks of 16KB
  • the application data is written to the file system, and the file system compresses the file blocks.
  • 12KB compressed data, 11KB can be obtained compressed data, etc.
  • the compressed data is written to the UFS device.
  • the file size is significantly reduced compared to the file before compression.
  • data can be read from the UFS device during decompression, then decompressed in the file system, and finally the decompressed data is provided to the application.
  • file size shown in the figure is only an example.
  • the space compression manager can divide the file block size according to the actual situation of the application file.
  • the original data shown in the figure can also be 32KB, etc. This application will Not limited.
  • the application's file may include a file name, an inode, and a data portion.
  • the inode can include the number of bytes of the file, the creation date of the file, the user ID of the file owner, etc.
  • the following two methods can be used to transparently compress applications:
  • the first way only compress the data part. For example, assuming that the applied file is file 1.txt, and the data content in file 1.txt is 1, 2, 3, 4, 5, 6, 7, 8, 9, then 1, 2, 3, 4, 5, 6, 7, 8, and 9 are compressed.
  • the compressed content is: 1-9, that is, the compressed file is file 1.txt, and the data content in file 1.txt is 1-9. .
  • Second method Replace the application file. For example, assuming that the applied file is file 1.txt, and the data content in file 1.txt is 1, 2, 3, 4, 5, 6, 7, 8, 9, then file 1 can be compressed, for example Data content 1. 2, 3, 4, 5, 6, 7, 8, 9 are compressed to: 1-9. At this time, the file 1 with the data content of 1, 2, 3, 4, 5, 6, 7, 8, 9 can be compressed. txt is replaced by file 1.txt with data content 1-9.
  • the ID in the inode can be changed. For example, the ID is 1 before compression and the ID is 2 after compression.
  • the application has no awareness of the compression process. Moreover, in the embodiment of the present application, there is no need to delete the source files of the application when compressing the application, that is, there is no need to delete the application. In this way, there is no need to reinstall the application when using it subsequently, which can save storage space and improve user experience.
  • file 1 can be compressed into compressed file 1, for example, recorded as: file 1.compress , compress file 2 into compressed file 2, for example, recorded as: file 2.compress, and so on, to compress multiple files respectively.
  • all the files of the application can be packaged into one file for compression, that is, compressed into a compressed file.
  • application 1 includes N files, such as file 1, file 2, file 3...file N, and then file 1-file N can be packaged into one file for compression, for example, after compression, we obtain The file is: application1.compress file.
  • Example 2 As shown in Figure 6, assuming that the mobile phone 100 displays the main interface 600 shown in (a) of Figure 6, the user can long press the application icon on the main interface 600, for example, the mobile phone 100 can long press the gallery application icon.
  • the interface 610 shown in (b) in FIG. 6 is displayed.
  • the interface 610 may include a share button 611, an uninstall button 612, and a compress button 613.
  • the user can click the compression button 613, and the mobile phone 100 can respond to the click operation and display the interface 620 shown in (c) of Figure 6.
  • the interface 620 can include a light compression button 621, a medium compression button 622, and a heavy compression button. Button 623.
  • the user can select a compression method in the interface 620, for example, click the moderate compression button 622.
  • the mobile phone 100 can respond to this operation and perform moderate compression on the gallery application.
  • the interface after compression can be seen in (d) of Figure 6 Interface 630.
  • the interface 630 may include compressed application icons and uncompressed application icons. Among them, the word "Compressed" can be displayed under the name of the compressed application icon. Of course, it can also be displayed in other locations, which is not limited in this application. You can use text prompts to remind users whether the application is compressed.
  • the user can click the compression button 613, and the mobile phone 100 can respond to the click operation and automatically select a compression algorithm to compress the gallery application, that is, directly display the interface 630 shown in (d) in Figure 6 , no need for the user to choose the compression method.
  • the long press operation may be to press and hold the application icon for a preset time (for example, 2 seconds) before the mobile phone 100 displays the interface 610 shown in (b) of FIG. 6 .
  • Method 2 Users can select the application to be compressed and its corresponding compression method in the system settings.
  • Example 1 As shown in Figure 7, assume that the user clicks the settings application icon on the main interface of the mobile phone 100.
  • the mobile phone 100 can respond to the click operation and enter the settings application interface. For example, refer to the interface 700 shown in (a) in Figure 7.
  • Compression setting options 701 may be included in the interface 700 .
  • the user can click the compression setting option 701 to enter the compression setting interface.
  • the interface 710 shown in (b) in Figure 7 can be displayed, and the user can select the application to be compressed and the compression method in the interface 710. For example, after the user selects the gallery, he or she can continue to select heavy compression among the compression methods.
  • the mobile phone 100 can compress the gallery application, and at this time, the interface 720 shown in (c) in Figure 7 can be displayed on the display screen.
  • the interface 720 may include prompt information 721.
  • the prompt information 721 may be: the gallery application is being compressed and the compression progress, such as 30% as shown in the figure. The user can see the progress of the compression through the prompt information.
  • the mobile phone can continue to display the interface 710 shown in (b) in Figure 7 .
  • Example 2 As shown in Figure 8, assuming that the user clicks the settings application icon on the main interface of the mobile phone 100, the mobile phone 100 can respond to the click operation and enter the settings application interface.
  • Compression setting options 801 may be included in the interface 800 .
  • the user can click the compression setting option 801 to enter the compression setting interface.
  • the interface 810 shown in (b) in Figure 8 can be displayed.
  • the interface 810 can include multiple compression mode buttons corresponding to each application.
  • the user can select compression by method to select an application. For example, the user can click the heavy compression button 811 in the gallery application, and the mobile phone 100 can respond to the user's click operation and compress the gallery application.
  • the interface 820 shown in (c) in Figure 8 can be displayed, and the interface can include prompts.
  • Message 821 such as "Compressing gallery application” and compression progress.
  • the mobile phone can continue to display the interface 810 shown in (b) in Figure 8 . It should be understood that in this example, the user does not need to select an application separately, and can directly select a compression method to achieve the purpose of selecting applications at the same time.
  • the three compression mode buttons on the interfaces shown in Figures 7 and 8 may not be displayed, and only one "Compression” button may be displayed, such as the one shown in Figure 4B Compression button 431.
  • FIG. 4A Taking Figure 4A as an example, assuming that the user clicks the moderate compression mode button in the interface 410, the mobile phone 100 can respond to this operation and perform moderate compression on the gallery application.
  • the interface after compression can be referred to the interface shown in (c) in Figure 4A 420.
  • the interface 420 may include compressed application icons and uncompressed application icons. Also, the application icons of compressed applications and uncompressed applications are different. It should be noted that after an application is compressed, users can distinguish between uncompressed applications and compressed applications through the icon style or text information on the interface.
  • a compression button can also be added to the status bar, so that the user can directly click from the status bar to enter the compression setting interface to select the files to be compressed. application.
  • the interface may include more or fewer controls, which is not limited in this application.
  • the installation data and data generated during use of the application are compressed.
  • the storage paths of these data can be: data/data/com.xxx.xx; data/app/com.xxx.xx; sdcard/Android/data/com.xx.xx.
  • the storage path of these data can be the following path:
  • users can select the application to be compressed and the compression method of the application according to their own needs, and then compress the application, which can save storage space of the electronic device and improve space utilization. Moreover, letting the user select the applications and compression methods to be compressed can improve the user experience.
  • the preset compression conditions may include at least one of the following conditions:
  • the remaining storage space of the electronic device is less than the set threshold. For example, application compression is triggered when the remaining amount of storage space is less than 5% of the total storage space.
  • the temperature of electronic equipment does not exceed the set temperature, such as 45 degrees Celsius.
  • the size of the compressible files in the electronic device exceeds the set threshold, such as exceeding 10GB.
  • the estimated revenue after compression of compressible files in electronic devices is greater than the set threshold, for example, greater than 1GB.
  • the electronic equipment has sufficient power.
  • the power of electronic equipment is greater than 60%.
  • compression may be triggered when the battery of the electronic device is in a charging state and the battery is greater than a set battery (for example, 60%).
  • a set battery for example, 60%
  • the set power amount can also be other values, such as 50%, etc., which is not limited in this application.
  • S902 Select the application to be compressed and the compression method.
  • the electronic device can select the application to be compressed based on the user's use of the application. For example, the electronic device may select applications that are frequently used by users as applications to be compressed. Of course, you can also select infrequently used applications as applications to be compressed, which is not limited in this application.
  • the electronic device may select an application to be compressed based on the storage space occupied by the application. For example, the electronic device can select an application that occupies a large storage space as an application to be compressed. For example, the electronic device can sort the storage space occupied by the application, and then select the top N (N is a positive integer) occupied storage space. applications as applications to be compressed.
  • the electronic device can select a compression method according to the usage of the application. For example, frequently used applications can select light compression, occasionally used applications can select medium compression, and applications that are rarely used can select heavy compression. It should be understood that a frequently used application may be an application whose number of uses within a set time is greater than the first set threshold, and an occasionally used application may be an application whose number of uses within a set time is greater than the second set threshold and less than the second set threshold. An application with a set threshold, an application that is rarely used is an application whose number of uses within a set time is less than the second set threshold.
  • different compression methods can be selected for different applications, or the same compression method can be selected, which is not limited in this application.
  • S903 Compress the application to be compressed according to the selected compression method.
  • S903 in the embodiment shown in FIG. 9 is the same as S302 in the embodiment shown in FIG. 3.
  • the above embodiments introduce the application compression process.
  • the following describes the application decompression process based on the above-mentioned methods of selecting compressed applications.
  • Example 1 As shown in Figure 10, assume that the user selects multiple applications to be compressed.
  • the compressed application interface is interface 1000 as shown in (a) of Figure 10.
  • the mobile phone 100 can detect that the user is on this interface 1000.
  • the gesture operation triggers the compressed application to enter the editing state.
  • the gesture operation can be the user's long press operation on a blank position on the interface 1000.
  • the mobile phone 100 can respond to the user's long press operation and display the interface 1010 shown in (b) in Figure 10.
  • the interface 1010 The icon of the compressed application in editing state and the decompression button 1011 may be included on the interface 1010 , and the user can select the application to be decompressed on the interface 1010 .
  • the user can select a compressed gallery application on the interface 1010 (for example, a ⁇ mark can be displayed on the selection box of the compressed gallery application), and then click the decompress button 1011.
  • the mobile phone 100 can respond to the click operation and perform the decompression of the gallery application. Decompress. After decompression is completed, refer to interface 1020 shown in (c) in Figure 10 .
  • Example 2 As shown in Figure 11, for the compressed interface 1100, the mobile phone 100 can detect the user's gesture operation on the interface.
  • the gesture operation can be performed by the user on the interface 1100 shown in (a) in Figure 11
  • the mobile phone 100 may respond to the long press operation and display the interface 1110 shown in (b) in Figure 11 .
  • the interface 1110 may include a share button 1111, an uninstall button 1112, and a decompression button 1113. The user can click the decompression button 1113 on the interface 1110, and the mobile phone 100 can respond to the click operation and decompress the gallery application.
  • the gesture operation can also be other operations, and of course it can also be a voice-triggered operation.
  • the user when selecting an application to be compressed/decompressed, the user can select multiple applications for batch compression/decompression.
  • Example 3 As shown in Figure 12, assume that the mobile phone 100 displays the interface 1200 shown in (a) of Figure 12.
  • the interface 1200 may include a decompression setting option 1201.
  • the decompression setting interface can be entered, for example, the interface 1210 shown in (b) in Figure 12 is displayed.
  • the interface 1210 can display a list of compressed applications, and the user can select the application that needs to be decompressed in the interface. For example, the user can check the gallery application and then click the decompression button 1211.
  • the mobile phone 100 can respond to the decompression button 1211. Click operation to decompress the gallery application, for example, the interface 1220 shown in (c) in Figure 12 may be displayed.
  • the interface 1220 may include prompt information 1221.
  • the prompt information may be: the gallery application is being decompressed and the decompression progress bar. The user can see the decompression progress through the decompression progress bar.
  • the interface 1210 shown in (b) in Figure 12 can continue to be displayed.
  • the mobile phone 100 can also return to the main interface, etc., and this application does not limit this.
  • Example 4 As shown in Figure 13, assume that the mobile phone 100 displays the interface 1300 shown in (a) of Figure 13.
  • the interface 1300 may include a compression setting option 1301.
  • the mobile phone 100 may ring. You should click the operation to enter the compression setting interface, for example, the interface 1310 shown in (b) in Figure 13 is displayed.
  • the interface 1310 may include a compressed application list and an uncompressed application list. Assume that the gallery is a compressed application.
  • the mobile phone 100 can respond to the user's click operation and decompress the gallery application.
  • the interface 1320 shown in (c) in Figure 13 can be displayed.
  • the interface 1320 may include prompt information 1321.
  • the prompt information may be: the gallery application is being decompressed and the decompression progress bar.
  • the mobile phone 100 can display the interface 1330 shown in (d) in Figure 13. In the interface 1330, the compression mark in the rectangular frame where the gallery application is located has changed.
  • the application Since the application is not deleted when the application is compressed, in the embodiment of the present application, the application can be used directly after decompressing the application without reinstalling the application.
  • a compressed application can be started while being decompressed, that is, the application can be started normally.
  • the file system can directly pass the decompressed data to the application, and the application cannot sense the decompression process. , can shorten time, improve efficiency, and improve user experience.
  • the mobile phone 100 displays the main interface 1400 shown in (a) of Figure 14.
  • the gallery application in this interface 1400 is a compressed application.
  • the mobile phone 100 can respond to the operation, open the gallery application, and display the application interface of the gallery, for example, display the interface 1410 shown in (b) in Figure 14 .
  • the compressed application can be decompressed first, and then launched into the application interface after the decompression is completed. That is, the user can see the application decompression process and wait for the decompression to complete before using the application.
  • the mobile phone 100 displays the main interface 1500 shown in (a) of Figure 15.
  • the gallery application in the interface 1500 is a compressed application.
  • the mobile phone 100 can respond to the operation and decompress the gallery application, and for example, can display the interface 1510 shown in (b) in Figure 15 .
  • the interface 1510 may include prompt information 1511 for decompressing the gallery.
  • the gallery application may be opened to display the application interface of the gallery, such as the interface 1520 shown in (c) in Figure 15 .
  • the above various examples of methods for compressing or decompressing applications may also include: changing the compression method for the compressed application in response to the user's operation on the application icon of the compressed application.
  • the compressed application is a gallery application
  • the gallery application is a lightly compressed application. Users can long press the app icon of the gallery app to change the light compression mode to medium compression mode and perform medium compression on the gallery app. Then, the user can long press the application icon of the moderately compressed gallery application to change the medium compression mode to heavy compression mode and perform heavy compression on the gallery application. In this way, users can adjust the compression method according to their own needs, which can improve the user experience.
  • compression mode is only a schematic explanation.
  • the compression modes in the embodiments of the present application can be switched at will, for example, it can also be changed from a light compression mode to a heavy compression mode, or from a moderate compression mode. It is a light compression mode, and then changes from a light compression mode to a heavy compression mode, etc. This application does not limit this.
  • the method provided by the embodiments of the present application is introduced from the perspective of the electronic device as the execution subject.
  • the electronic device may include a hardware structure and/or a software module to implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above functions is performed as a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
  • the electronic device 1600 includes: a display screen 1601; one or more processors 1602; one or more memories 1603; one or more sensors (not shown in the figure), multiple applications ( Figure (not shown in the figure); and one or more computer programs (not shown in the figure), each of the above devices can be connected through one or more communication buses 1604.
  • the display screen 1601 is used to display a display interface of an application in the electronic device, or to display prompt information.
  • One or more computer programs are stored in the memory 1603, and the one or more computer programs include instructions; the processor 1602 calls the instructions stored in the memory 1603, so that the electronic device 1600 can apply the compression method and application of the above embodiments. Decompression method.
  • the processor 1602 may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, which can be implemented Or execute the disclosed methods, steps and logical block diagrams in the embodiments of this application.
  • a general-purpose processor may be a microprocessor or any conventional processor, etc.
  • the steps of the methods disclosed in the embodiments of this application can be directly
  • the interface is implemented by a hardware processor or a combination of hardware and software modules in the processor.
  • the software module may be located in the memory 1603.
  • the processor 1602 reads the program instructions in the memory 1603 and completes the steps of the above method in combination with its hardware.
  • the memory 1603 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or it may be a volatile memory (volatile memory).
  • RAM volatile memory
  • Memory may also be, but is not limited to, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
  • the memory in the embodiment of the present application can also be a circuit or any other device capable of realizing a storage function, used to store instructions and/or data.
  • the present application also provides a computer storage medium.
  • a computer program is stored in the computer storage medium.
  • the computer program When executed by a computer, it causes the computer to execute the application compression method provided in the above embodiments. Apply decompression method.
  • An embodiment of the present application also provides a computer program product, which includes instructions that, when run on a computer, cause the computer to execute the application compression method and the application decompression method provided in the above embodiments.
  • Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by instructions. These instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that instructions executed by the processor of the computer or other programmable data processing device produce for implementation means a function specified in a process or processes in a flowchart and/or in a block or blocks in a block diagram.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
  • the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Telephone Function (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本申请提供一种应用压缩方法、解压缩方法及电子设备。在该方法中,用户可在用户界面上根据自身需求选择要压缩的应用,然后电子设备响应用户的操作,对选择的应用进行压缩,以节省应用所占的存储空间,提升存储空间利用率,用户也可以根据自身需求选择对已经压缩的应用进行解压缩,以方便用户后续使用应用。

Description

应用压缩方法、解压缩方法及电子设备
相关申请的交叉引用
本申请要求在2022年04月29日提交中国专利局、申请号为202210474441.X、申请名称为“应用压缩方法、解压缩方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术领域,尤其涉及一种应用压缩方法、解压缩方法及电子设备。
背景技术
电子设备的使用变得越来越频繁,随着使用时间的增加,应用产生的数据越来越多,使得电子设备的存储空间也越来越小。
以手机为例,目前手机一般使用两年后,大多数用户的手机都会出现可用空间不足10%,影响用户的正常使用,使得用户体验较差。因此,如何节省电子设备的存储空间成为了有待解决的问题。
发明内容
本申请提供一种应用压缩方法、解压缩方法及电子设备,用以提升电子设备的存储空间利用率,提升用户体验。
第一方面,本申请提供一种应用压缩方法,该方法包括:电子设备显示第一界面,所述第一界面包括应用图标以及压缩选项;然后,电子设备响应于在第一界面上的第二操作,该第二操作用于在第一界面中选择目标应用图标;最后,电子设备响应于在第一界面上对压缩选项的点击操作,对与目标应用图标对应的目标应用进行透明压缩。
通过上述技术方案,用户可以根据自身的需求在界面上选择要压缩的应用,然后电子设备对选择的应用进行压缩,从而节省电子设备的存储空间,提高存储空间利用率,进而提升用户体验。
在一种可能的设计中,所述方法还包括:电子设备显示第二界面,所述第二界面包括第一提示信息,该第一提示信息用于提示对与目标应用图标对应的目标应用的压缩进度。
通过上述技术方案,在界面上显示压缩进度的提示信息,可以方便用户查看压缩进度,及时地了解到应用的压缩情况,能够提升用户体验。
在一种可能的设计中,所述方法还包括:电子设备显示第三界面,所述第三界面包括已压缩的目标应用的应用图标。
通过上述技术方案,当目标应用进行压缩后,可显示已压缩的目标应用的应用图标,用户可以通过显示的应用图标判断应用是否被压缩。
在一种可能的设计中,所述方法还包括:电子设备响应于在所述第三界面上的第三操作,显示第四界面,所述第四界面包括解压缩选项;电子设备响应于对解压缩选项的点击操作,对所述目标应用进行解压缩。
通过上述技术方案,可在包括有已压缩的应用图标的界面上触发解压缩操作界面,然后通过点击解压缩选项对目标应用进行解压缩。
在一种可能的设计中,所述方法还包括:电子设备显示第五界面,所述第五界面包括第二提示信息,所述第二提示信息用于提示对所述目标应用的解压缩进度。
通过上述技术方案,在界面上显示解压缩进度的提示信息,可以方便用户查看解压缩的进度,及时地了解到应用的解压缩情况,能够提升用户体验。
在一种可能的设计中,所述方法还包括:电子设备响应于在所述第三界面上的第四操作,启动所述目标应用;所述电子设备显示所述目标应用的应用界面。
例如,第四操作可以为对目标应用的点击操作,然后电子设备可响应该点击操作,启动目标应用。通过上述技术方案,应用可以在启动的同时进行解压,这样用户无需等待,可以快速的打开应用。
在一种可能的设计中,所述方法还包括:电子设备响应于在所述第三界面上的第四操作,显示第三提示信息,所述第三提示信息包括所述目标应用正在解压的信息;当目标应用解压完成后,电子设备启动所述目标应用,并显示所述目标应用的应用界面。
通过上述技术方案,当用户打开目标应用时,目标应用可以先进行解压,在解压完成之后启动目标应用,显示应用界面。
在一种可能的设计中,所述电子设备对与所述目标应用图标对应的目标应用进行透明压缩,包括:电子设备在所述目标应用的应用文件中选择目标文件,并将所述目标文件划分为多个文件块;电子设备针对多个文件块的每一个文件块选择相应的目标压缩算法;电子设备按照相应的目标压缩算法对多个文件块的每一个文件块进行压缩。
通过上述技术方案,可以将目标应用的文件划分为多个文件块,然后对每一个文件块进行压缩,使得目标应用的应用文件大小缩小,提高空间利用率。
在一种可能的设计中,电子设备对与所述目标应用图标对应的目标应用进行透明压缩,包括:电子设备获取目标应用包括的第一文件,所述第一文件中包括第一数据;电子设备对所述第一文件中的所述第一数据进行压缩,得到第二文件,所述第二文件中包括第一压缩数据,所述第一文件和所述第二文件的文件名称、后缀名称相同。
通过上述技术方案,在对应用进行透明压缩时,可对应用的数据进行压缩,压缩前后的文件名称、文件后缀都没有发生变化,对于应用而言压缩过程是无感知的。
在一种可能的设计中,电子设备对所述目标应用进行解压缩,包括:电子设备获取所述目标应用包括的第二文件,所述第二文件中包括第一数据的第一压缩数据,所述第一数据为所述目标应用中的第一文件包括的数据;电子设备对所述第二文件中的所述第一压缩数据进行解压缩,得到所述第一文件,所述第一文件和所述第二文件的文件名称、后缀名称相同。
通过上述技术方案,在对应用进行解压缩时,可对压缩数据进行解压缩,由于解压缩前后的文件名称、文件后缀都没有发生变化,对于应用而言解压缩过程是无感知的。
在一种可能的设计中,所述方法还包括:电子设备响应于对目标应用图标的第五操作,对目标应用图标对应的目标应用的压缩方式进行更改。
通过上述技术方案,可以对目标应用的压缩方式进行更改,这样用户可以根据自身需求调整压缩方式,能够提升用户体验。
第二方面,本申请提供一种应用解压缩的方法,应用于电子设备,所述方法包括:
所述电子设备显示第四界面,所述第四界面包括透明压缩的目标应用的目标应用图标和解压缩选项;所述电子设备响应于在所述第四界面上的第六操作,所述第六操作用于在所述第四界面中选择所述目标应用图标;所述电子设备响应于在所述第四界面上对所述解压缩选项的点击操作,对与所述目标应用图标对应的目标应用进行透明解压缩。
通过上述技术方案,用户可以对进行过透明压缩的目标应用进行透明解压缩,该过程与压缩过程一样对于应用而言无感知。
在一种可能的设计中,所述方法还包括:所述电子设备响应于对所述目标应用图标的第五操作,对所述目标应用图标对应的目标应用的压缩方式进行更改。
通过上述技术方案,用户可以对目标应用的压缩方式进行更改,这样用户可以根据自身需求调整压缩方式,能够提升用户体验。
第三方面,本申请提供一种电子设备,所述电子设备包括显示屏;一个或多个处理器;一个或多个存储器;一个或多个传感器;多个应用;以及一个或多个计算机程序;其中所述一个或多个计算机程序被存储在所述一个或多个存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器调用执行时,使得所述电子设备执行上述第一方面及其第一方面任一可能设计的方法。
第四方面,本申请提供一种电子设备,所述电子设备包括显示屏;一个或多个处理器;一个或多个存储器;一个或多个传感器;多个应用;以及一个或多个计算机程序;其中所述一个或多个计算机程序被存储在所述一个或多个存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器调用执行时,使得所述电子设备执行上述第二方面及其第二方面任一可能设计的方法。
第五方面,本申请还提供一种电子设备,该电子设备包括执行第一方面或者第一方面的任意一种可能的设计的方法的模块/单元;这些模块/单元可以通过硬件实现,也可以通过硬件执行相应的软件实现。
第六方面,本申请还提供一种电子设备,该电子设备包括执行第二方面或者第二方面的任意一种可能的设计的方法的模块/单元;这些模块/单元可以通过硬件实现,也可以通过硬件执行相应的软件实现。
第七方面,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在电子设备上运行时,使得所述电子设备执行第一方面及其第一方面任一可能设计的方法。
第八方面,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在电子设备上运行时,使得所述电子设备执行第二方面及其第二方面任一可能设计的方法。
第九方面,本申请还提供一种计算机程序产品,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行本申请实施例第一方面及其第一方面任一可能设计的方法。
第十方面,本申请实施例一种计算机程序产品,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行本申请实施例第二方面及其第二方面任一可能设计的方法。
上述第三方面至第十方面中的各个方面以及各个方面可能达到的技术效果请参照上述针对第一方面、第二方面中的各种可能方案可以达到的技术效果说明,这里不再重复赘述。
附图说明
图1为本申请实施例提供的一种电子设备的结构示意图;
图2为本申请实施例提供的电子设备的软件结构框图;
图3为本申请实施例提供的一种应用压缩方法流程图;
图4A为本申请实施例提供的一种对应用进行压缩的用户界面示意图;
图4B为本申请实施例提供的另一种对应用进行压缩的用户界面示意图;
图5A为本申请实施例提供的文件的轻度压缩方式示意图;
图5B为本申请实施例提供的文件的中度压缩方式示意图;
图5C为本申请实施例提供的文件的重度压缩方式示意图;
图6为本申请实施例提供的另一种对应用进行压缩的用户界面示意图;
图7为本申请实施例提供的又一种对应用进行压缩的用户界面示意图;
图8为本申请实施例提供的又一种对应用进行压缩的用户界面示意图;
图9为本申请实施例提供的另一种应用压缩方法流程图;
图10为本申请实施例提供的一种对应用进行解压缩的用户界面示意图;
图11为本申请实施例提供的另一种对应用进行解压缩的用户界面示意图;
图12为本申请实施例提供的又一种对应用进行解压缩的用户界面示意图;
图13为本申请实施例提供的一种对应用进行解压缩的用户界面示意图;
图14为本申请实施例提供的一种对压缩的应用进行启动的用户界面示意图;
图15为本申请实施例提供的另一种对压缩的应用进行启动的用户界面示意图;
图16为本申请实施例提供的另一种电子设备的结构示意图。
具体实施方式
下面将结合本申请以下实施例中的附图,对本申请实施例中的技术方案进行详尽描述。
以下,首先对本申请实施例中的部分用语进行解释说明,以便于本领域技术人员理解。
1)应用程序:简称应用,为能够实现某项或多项特定功能的软件程序。通常,电子设备中可以安装多个应用。比如,相机应用、短信应用、邮箱应用、视频应用、音乐应用等。下文中提到的应用,可以是电子设备出厂时已安装的应用,也可以是用户在使用电子设备的过程中从网络下载或其他电子设备获取的应用。
2)透明压缩:在透明压缩中,当应用将原始数据写入文件系统(File system)时,由文件系统本身对数据进行压缩操作,然后将压缩后的数据写入存储设备,比如通用闪存存储(universal flash storage,UFS);当应用读取数据时,先从UFS中读取压缩后的数据,经由文件系统解压缩后返还给应用。采用透明压缩,可以做到压缩、解压缩对应用完全透明。应当理解,应用对于数据的压缩和解压缩是无感知的。例如,应用所包括的数据的存储格式或者后缀名称在透明压缩、透明解压缩前后不发生变化,应用所包括的数据在透明压缩后变成了压缩数据,应用仍能直接识别、读取该压缩数据。
随着电子设备的发展以及用户需求的提升,用户在终端设备,比如手机上安装的应用越来越多,这些应用的安装数据会占据一部分存储空间。并且,应用在使用过程中会产生大量的数据,这些数据也会占据很大的存储空间。随着使用时间的增加,手机的存储空间会越来越小。
有鉴于此,本申请提供一种应用压缩方法,该方法中可选择应用进行压缩,以节省应用所占的存储空间,提升存储空间利用率,并且能够提升用户体验。
此外,下述实施例涉及的至少一个,包括一个或者多个;其中,多个是指大于或者等于两个。另外,需要理解的是,在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的。
需要说明的是,本申请实施例提供的应用压缩方法,可以适用于具有显示屏的多种电子设备,诸如手机、平板电脑、可穿戴设备(例如,手表、手环、智能头盔,智能眼镜等)、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等,本申请实施例不作限定。本申请实施例涉及到的电子设备可以是可折叠式电子设备,比如可折叠式手机,可折叠式平板电脑等,本申请对此不作限定。并且,电子设备的示例性实施例包括但不限于搭载 或者其它操作系统的电子设备。
下面以手机为例,介绍电子设备的结构。
如图1所示,手机100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是手机100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为手机100充电,也可以用于手机100与外围设备之间传输数据。充电管理模块140用于从充电器接收充电输入。电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。
手机100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。手机100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在手机100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
无线通信模块160可以提供应用在手机100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,手机100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得手机100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),第五代(the fifth generation,5G)移动通信系统,未来通信系统,如第六代(6th generation,6G)系统等,BT,GNSS,WLAN,NFC,FM和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
显示屏194用于显示应用的显示界面等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,手机100可以包括1个或N个显示屏194,N为大于1的正整数。在本申请实施例中,显示屏194可用于显示多个应用图标、压缩方式等,用户可在界面上选择 要压缩的应用以及应用的压缩方式。
摄像头193用于捕获静态图像或视频。摄像头193可以包括前置摄像头和后置摄像头。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行手机100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,以及至少一个应用程序(例如爱奇艺应用,微信应用等)的软件代码等。存储数据区可存储手机100使用过程中所产生的数据(例如图像、视频等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展手机100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将图片,视频等文件保存在外部存储卡中。
手机100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。陀螺仪传感器180B可以用于确定手机100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定手机100围绕三个轴(即,x,y和z轴)的角速度。
陀螺仪传感器180B可以用于确定手机100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定手机100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测手机100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消手机100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,手机100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。磁传感器180D包括霍尔传感器。手机100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当手机100是翻盖机时,手机100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。加速度传感器180E可检测手机100在各个方向上(一般为三轴)加速度的大小。当手机100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。手机100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,手机100可以利用距离传感器180F测距以实现快速对焦。接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。手机100通过发光二极管向外发射红外光。手机100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定手机100附近有物体。当检测到不充分的反射光时,手机100可以确定手机100附近没有物体。手机100可以利用接近光传感器180G检测用户手持手机100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。手机100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传 感器180L还可以与接近光传感器180G配合,检测手机100是否在口袋里,以防误触。指纹传感器180H用于采集指纹。手机100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,手机100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,手机100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,手机100对电池142加热,以避免低温导致手机100异常关机。在其他一些实施例中,当温度低于又一阈值时,手机100对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于手机100的表面,与显示屏194所处的位置不同。
示例性的,触摸传感器180K可检测到用户在显示屏上的触摸操作,比如可检测到用户对应用图标的长按操作,然后手机100可响应该长按操作,显示操作菜单(比如,操作菜单中可包括卸载、压缩等)。接着,用户可在操作菜单中选择压缩,手机100可响应用户操作,显示压缩方式(比如,轻度压缩、中度压缩、重度压缩),此时用户可以点击选择压缩方式,手机100可响应用户操作,对应用进行压缩,例如透明压缩。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。手机100可以接收按键输入,产生与手机100的用户设置以及功能控制有关的键信号输入。马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和手机100的接触和分离。
可以理解的是,图1所示的部件并不构成对手机的具体限定,手机还可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。以下的实施例中,以图1所示的手机100为例进行介绍。
上述手机100的软件系统可以采用分层架构,包括事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明手机100的软件结构。应理解,本申请实施例中的系统也可以为鸿蒙系统,本申请对此不作限定。
以下结合不同场景对电子设备的软件结构进行介绍。图2是本申请实施例的手机100的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为五层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime,ART)和原生C/C++库,硬件抽象层(hardware abstract layer,HAL)以及内核层。
应用程序层可以包括一系列应用程序包。如图2所示,应用程序包可以包括桌面,设置,图库,日历,通话,地图,导航,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图2所示,应用程序框架层可以包括空间压缩管理器,窗口管理器,内容提供器,视图系统,资源管理器,通知管理器,活动管理器,输入管理器等。
其中,空间压缩管理器,用于在用户选择要压缩的应用之后,扫描应用文件,在应用文件中选择要压缩的文件和文件压缩算法。示例性的,用户选择对图库应用进行轻度压缩,然后空间压缩管理器可扫描图库的应用文件,在图库的应用文件中选择要压缩的文件,将文件分为文件块,然后决定文件块的大小,选择压缩算法。
窗口管理器提供窗口管理服务(window manager service,WMS),WMS可以用于窗口管理、窗口动画管理、surface管理以及作为输入系统的中转站。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。该数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
活动管理器可以提供活动管理服务(Activity Manager Service,AMS),AMS可以用于系统组件(例如活动、服务、内容提供者、广播接收器)的启动、切换、调度以及应用进程的管理和调度工作。
输入管理器可以提供输入管理服务(Input Manager Service,IMS),IMS可以用于管理系统的输入,例如触摸屏输入、按键输入、传感器输入等。IMS从输入设备节点取出事件,通过和WMS的交互,将事件分配至合适的窗口。
安卓运行时包括核心库和安卓运行时。安卓运行时负责将源代码转换为机器码。安卓运行时主要包括采用提前(ahead or time,AOT)编译技术和及时(just in time,JIT)编译技术。
核心库主要用于提供基本的Java类库的功能,例如基础数据结构、数学、IO、工具、数据库、网络等库。核心库为用户进行安卓应用开发提供了API。
原生C/C++库可以包括多个功能模块。例如:表面管理器(surface manager),媒体框架(Media Framework),libc,OpenGL ES、SQLite、Webkit等。
其中,表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体框架支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG, PNG等。OpenGL ES提供应用程序中2D图形和3D图形的绘制和操作。SQLite为电子设备100的应用程序提供轻量级关系型数据库。
硬件抽象层运行于用户空间(user space),对内核层驱动进行封装,向上层提供调用接口。
内核层是硬件和软件之间的层。内核层至少包含文件系统,显示驱动,蓝牙驱动,摄像头驱动,音频驱动,传感器驱动。其中,文件系统能够提供文件压缩能力。
本申请一些实施例中,用户可以在桌面选择要压缩的应用(比如,图库应用)以及压缩方式,并点击压缩按钮,然后空间压缩管理器可扫描应用文件,在应用文件中选择要压缩的文件和文件压缩算法。接着,空间压缩管理器可调用文件系统对图库应用进行压缩。另一些实施例中,可通过系统应用,比如设置应用调用文件系统对图库应用进行压缩。
以下实施例以应用在图1所示的手机100所示的架构中为例进行描述。
在本申请实施例中,应用压缩的过程可以由用户触发,也可以由电子设备来触发,本申请对此不作限定。下面以手机100为例,介绍由用户触发的应用压缩方法。
如图3所示,为本申请实施例提供的一种应用压缩方法流程图,参阅图3所示,该方法可包括如下步骤:
S301:接收用户选择待压缩的应用以及对应的压缩方式的指令。
在一些示例中,用户可通过如下几种方式选择要压缩的应用及其对应的压缩方式:
方式1:用户在主界面上通过手势操作触发应用进入编辑模式,然后选择要压缩的应用及其对应的压缩方式。
示例1:如图4A所示,假设手机100显示图4A中的(a)所示的主界面400,当手机100检测到用户在主界面上的手势操作,比如图中所示的双指捏合的手势操作时,可响应用户的手势操作,显示界面410,例如图4A中的(b)所示。其中,界面410包括带有选择框的多个应用的标识(例如,地图、图库等),以及压缩方式标识(例如,轻度压缩、中度压缩、重度压缩)。接着,手机100可以检测用户针对应用的选择框的操作,比如用户在图4A中的(b)所示的界面410中选择对应图库应用的应用图标和电子邮件应用的应用图标,图库应用和电子邮件应用的选择框中可显示选中标记(例如,对号√),然后点击中度压缩方式按钮,手机100可响应该操作,对图库应用和电子邮件应用进行中度压缩,压缩之后的界面可参阅图4A中的(c)所示界面420。其中,界面420中可显示已压缩的应用图标和未压缩的应用图标。对于同一个应用,压缩前的应用图标和压缩后的应用图标可以不同。比如,针对同一应用,压缩前后的应用图标的透明度可以不同;通过改变应用的透明度,可以便于用户区分应用是否被压缩。
应理解,不同的应用可以选择相同或不同的压缩方式。示例性的,比如用户可以先选择图库应用的应用图标,然后点击中度压缩方式按钮,先对图库应用进行压缩。接着,用户可以再选择电子邮件应用的应用图标,然后点击轻度压缩方式按钮,再对电子邮件应用进行压缩。
在一些示例中,如果选择多个应用进行压缩,则对于不同应用,压缩后的应用图标可以相同,也可以不同。比如,选择对图库应用和电子邮件应用进行压缩,压缩后的图库应用的应用图标可以如图4A中的(c)所示,压缩后的电子邮件应用的应用图标上可显示“已压缩”字样等,本申请对此不作限定。
在一些示例中,当同一应用/不同应用选择不同的压缩方式时,压缩后的应用图标的显 示样式可以不同,比如不同的压缩方式对应的透明度可以不同,通过应用的透明度,可以便于用户区分应用的压缩方式。
如图4B所示,在另一些实施例中,当手机100检测到用户在主界面上的手势操作,比如图中所示的双指捏合的手势操作时,可响应用户的手势操作,显示界面430。界面430中可包括带有选择框的多个应用的标识(例如,地图、图库等),以及压缩按钮431。示例性的,界面上可以不显示上述图4A中的(b)所示示意图中的三种压缩方式。然后,用户可在界面430中选择图库应用和电子邮件应用,并点击压缩按钮431,手机100可响应该操作,对图库应用和电子邮件应用进行压缩,压缩之后的界面可参阅图4A中的(c)所示界面420。
作为一种可能的实现方式,手机100可以根据应用使用的情况,比如应用使用的次数自动为应用选择相应的压缩算法。示例性的,手机100可以根据应用未被使用的天数对应用进行分级,然后不同级别选择不同的压缩算法。比如未使用天数超过7天的应用使用lz4算法,未使用天数超过14天的应用使用Zstd算法,未使用天数超过30天的应用使用zip算法。当然,还可以根据其它的方式自动为应用选择相应的压缩算法,比如根据应用的文件的使用频率来选择压缩算法等,本申请对此不作限定。
需要说明的是,图4A、图4B中所示的手势操作仅是一种示例,在本申请实施例中,手势操作还可以为其它操作,比如,在显示屏上画圈、画多边形等的操作;或者,手势操作还可以是“摇一摇”等操作,本申请实施例不作限定。
应理解,用户选择的要压缩的应用可以包括一个或者多个。例如,用户可以在界面410中勾选多个应用图标,然后对多个应用进行压缩。
下面分别对本申请实施例中涉及到的三种压缩方式进行详细介绍。
1、轻度压缩方式
在这种压缩方式中,可将一个应用的文件分为多个,然后在每一个文件中将文件划分为文件块,最后按照文件块进行压缩,示例性的,如图5A所示,假设应用1包括多个文件,比如可将文件1分为16KB的多个文件块,然后将应用数据写入文件系统,由文件系统对文件块进行压缩,比如可得到12KB的压缩(compress)数据、11KB的压缩数据等。最后,再将压缩后的数据写入UFS器件。与压缩之前的文件相比,文件大小明显缩小。
相应地,在解压缩时可从UFS器件中读取数据,然后在文件系统中解压缩,最后将解压缩的数据提供给应用。
应理解,图中所示的文件大小仅是一种示例,空间压缩管理器可根据应用文件的实际情况划分文件块的大小,例如图中所示的原始数据也可以32KB等,本申请对此不作限定。
在一些示例中,应用的文件可包括文件名、索引节点(inode)、数据部分。其中,inode中可包括文件的字节数、文件的创建日期、文件拥有者的用户标识(User ID)等。示例性的,可采用如下两种方式对应用进行透明压缩:
第一种方式:仅对数据部分进行压缩。示例性的,假设应用的文件为文件1.txt,文件1.txt中的数据内容为1、2、3、4、5、6、7、8、9,则可对1、2、3、4、5、6、7、8、9进行压缩,比如压缩之后的内容为:1-9,即压缩后的文件为文件1.txt,此时文件1.txt中的数据内容为1-9。
第二种方式:对应用文件进行替换。示例性的,假设应用的文件为文件1.txt,文件1.txt中的数据内容为1、2、3、4、5、6、7、8、9,则可对文件1进行压缩,比如数据内容1、 2、3、4、5、6、7、8、9压缩为:1-9,此时可将数据内容为1、2、3、4、5、6、7、8、9的文件1.txt替换为数据内容为1-9的文件1.txt。在这种压缩方式中,可以更改inode中的ID,比如压缩前ID为1,压缩后ID为2。
上述两种方式中,对于应用而言,应用文件的名称、后缀均没有发生变化,仅是存储的数据内容的存储形式发生了变化,因此,应用对于压缩过程无感知。而且,在本申请实施例中对应用压缩时无需删除应用的源文件,即不需要删除应用,这样在后续使用应用时也不需要重新安装,能够节省存储空间,提升用户体验。
2、中度压缩方式
在该压缩方式中,可将应用的全部文件分别压缩为压缩文件。
示例性的,如图5B所示,假设应用1包括N个文件,比如文件1、文件2、文件3…文件N,然后可将文件1压缩为压缩文件1,比如记为:文件1.compress,将文件2压缩为压缩文件2,比如记为:文件2.compress,以此类推,分别对多个文件进行压缩。
3、重度压缩方式
在该压缩方式中,可将应用的全部文件打包为一个文件进行压缩,即压缩为一个压缩文件。示例性的,如图5C所示,假设应用1包括N个文件,比如文件1、文件2、文件3…文件N,然后可将文件1-文件N打包为一个文件进行压缩,比如压缩之后得到的文件为:应用1.compress file。
示例2:如图6所示,假设手机100显示图6中的(a)所示的主界面600,用户可在主界面600上长按应用图标,比如可长按图库应用图标,手机100可响应用户的长按操作,例如显示图6中(b)所示的界面610,该界面610中可包括分享按钮611、卸载按钮612、压缩按钮613。接着,用户可点击压缩按钮613,手机100可响应该点击操作,显示图6中(c)所示的界面620,该界面620中可包括轻度压缩按钮621、中度压缩按钮622、重度压缩按钮623。接着,用户可在界面620中选择压缩方式,比如点击中度压缩按钮622,手机100可响应该操作,对图库应用进行中度压缩,压缩之后的界面可参阅图6中的(d)所示界面630。该界面630中可包括已压缩的应用图标和未压缩的应用图标。其中,已压缩的应用图标的名称下方可显示“已压缩”字样。当然,也可以显示在其它位置,本申请对此不作限定。即可通过文字提示信息提醒用户应用是否被压缩。
需要说明的是,在实际产品实现时,用户可点击压缩按钮613,手机100可响应该点击操作,自动选择压缩算法对图库应用进行压缩,即直接显示图6中的(d)所示界面630,无需用户选择压缩方式。
应理解,长按操作可以是在应用图标的位置长按预设时长(比如2秒)后,手机100才显示图6中(b)所示的界面610。
方式2:用户可以在系统设置中选择待压缩的应用及其对应的压缩方式。
示例1:如图7所示,假设用户在手机100的主界面点击设置应用图标,手机100可响应点击操作,进入设置应用界面,比如可参阅图7中的(a)所示的界面700,该界面700中可包括压缩设置选项701。接着,用户可点击压缩设置选项701进入压缩设置界面,比如可显示图7中的(b)所示界面710,用户可在界面710中选择要压缩的应用以及压缩方式。比如,用户选择图库之后,可继续在压缩方式中选择重度压缩。当用户点击重度压缩之后,手机100可对图库应用进行压缩,此时显示屏上可显示图7中的(c)所示界面720, 该界面720上可包括提示信息721,例如该提示信息721可以为:正在压缩图库应用以及压缩进度,比如图中所示的30%。用户可通过该提示信息看到压缩的进度,当压缩完成之后,手机可继续显示图7中的(b)所示界面710。
应理解,用户也可以在图7中的(b)所示界面710中选择多个应用进行压缩。当然,不同的应用可以选择相同或不同的压缩方式。
示例2:如图8所示,假设用户在手机100的主界面点击设置应用图标,手机100可响应点击操作,进入设置应用界面,比如可参阅图8中的(a)所示的界面800,该界面800中可包括压缩设置选项801。接着,用户可点击压缩设置选项801进入压缩设置界面,比如可显示图8中的(b)所示界面810,界面810中可包括每一个应用对应的多种压缩方式按钮,用户可通过选择压缩方式来选择应用。比如,用户可点击图库应用中的重度压缩按钮811,手机100可响应用户的点击操作,对图库应用进行压缩,例如可显示图8中的(c)所示界面820,该界面上可包括提示信息821,比如“正在压缩图库应用”以及压缩进度。当压缩完成之后,手机可继续显示图8中的(b)所示界面810。应理解,在该示例中,用户不需要单独选择应用,可以直接选择压缩方式以达到同时选择应用的目的。
需要说明的是,在实际应用中,也可以不显示图7中的(c)所示界面720以及图8中的(c)所示界面820。
在本申请另一些实施例中,在实际产品实现时,也可以不显示图7和图8所示界面上的三种压缩方式的按钮,仅显示一个“压缩”按钮,比如图4B所示的压缩按钮431。
S302:响应用户选择待压缩的应用以及对应的压缩方式的指令,按照选择的压缩方式对待压缩的应用进行压缩。
以图4A为例,假设用户在界面410中点击中度压缩方式按钮,手机100可响应该操作,对图库应用进行中度压缩,压缩之后的界面可参阅图4A中的(c)所示界面420。其中,界面420中可包括已压缩的应用图标和未压缩的应用图标。并且,已压缩的应用和未压缩的应用的应用图标不同。需要说明的是,当应用压缩之后,用户可通过界面上的图标样式或者文字信息等分辨出未压缩的应用和已压缩的应用。
应理解,在对应用进行压缩时,可以采用Lz4、lz4fast、zstd、deflate、gzip等算法进行压缩,在本申请实施例中能够对应用进行压缩的算法均可包含在本申请的保护范围内。
需要说明的是,上述选择应用的方式及用户界面仅是一种示意性说明,例如也可以在状态栏添加压缩按钮,这样用户可以直接从状态栏点击进入压缩设置界面等方式来选择要压缩的应用。并且,在实际产品实现时,界面上可以包括更多或更少的控件,本申请对此不作限定。
在一些实施例中,对应用进行压缩时,是对应用的安装数据和使用过程中产生的数据进行压缩。示例性的,在安卓系统中,这些数据的存储路径可以为:data/data/com.xxx.xx;data/app/com.xxx.xx;sdcard/Android/data/com.xx.xx。
另一示例,在鸿蒙系统中,这些数据的存储路径可以为如下路径:
(1)、/data/app/base/<bundlename>
(2)、/data/ce/<userId>/bundle/<bundlename>
(3)、/data/ece/<userId>/bundle/<bundlename>
(4)、/data/sece/<userId>/bundle/<bundlename>
(5)、/mnt/hmdfs/<userId>/device_view/local/data/<bundlename>/
通过上述实施例,用户可以根据自身的需求选择要压缩的应用以及应用的压缩方式,然后对应用进行压缩,能够节省电子设备的存储空间,提高空间利用率。并且,由用户选择要压缩的应用和压缩方式能够提升用户体验。
下面介绍由电子设备触发的应用压缩方法。如图9所示,为本申请实施例提供的另一种应用压缩方法流程图,参阅图9所示,该方法可包括如下步骤:
S901:确定满足预设压缩条件。
在一些实施例中,预设压缩条件可包括如下条件中的至少一种:
(1)、电子设备的存储空间剩余量小于设定阈值。比如,当存储空间的剩余量小于总存储空间的5%时触发应用压缩。
(2)、电子设备处于灭屏状态,或者用户未使用电子设备的情况。
(3)、电子设备的温度不超过设定温度,比如45摄氏度。
(4)、电子设备中的可压缩文件的大小超过设定阈值,比如超过10GB。
(5)、电子设备中可压缩文件压缩后的预估收益(即压缩后能节省出的空间大小)大于设定阈值,比如大于1GB。
(6)、电子设备的电量充足。比如电子设备的电量大于60%。
在一些实施例中,如果电量不足,可在电子设备的电池为充电状态,并且电量大于设定电量(比如,60%)时触发压缩。当然,设定电量也可以为其它数值,比如50%等,本申请对此不作限定。
S902:选择待压缩的应用及压缩方式。
作为一种可能的实现方式,电子设备可以根据用户使用应用的情况选择待压缩的应用。示例性的,电子设备可以选择用户使用比较频繁的应用作为待压缩的应用。当然,也可以选择不经常使用的应用作为待压缩的应用,本申请对此不作限定。
作为另一种可能的实现方式,电子设备可以根据应用所占的存储空间选择待压缩的应用。示例性的,电子设备可以选择占存储空间较大的应用作为待压缩的应用,比如可以将应用所占的存储空间进行排序,然后选择所占存储空间排在前N(N为正整数)位的应用作为待压缩的应用。
在一些实施例中,电子设备可以按照应用的使用情况选择压缩方式,比如经常使用的应用可以选择轻度压缩,偶尔使用的应用可以选择中度压缩,几乎不使用的应用选择重度压缩。应理解,经常使用的应用可以为在设定时间内的使用次数大于第一设定阈值的应用,偶尔使用的应用可以为在设定时间内的使用次数大于第二设定阈值,且小于第一设定阈值的应用,几乎不使用的应用为在设定时间内的使用次数小于第二设定阈值的应用。当然,针对不同的应用可以选择不同的压缩方式,也可以选择相同的压缩方式,本申请对此不作限定。
S903:按照选择的压缩方式对待压缩的应用进行压缩。
应理解,图9所示实施例中的S903和图3所示实施例中的S302相同,具体实现过程可参阅图3所示实施例的S302中的详细介绍,此处不再重复赘述。
以上实施例介绍了应用的压缩过程,下面分别基于上述几种选择压缩应用的方式介绍应用解压缩的过程。
示例1:如图10所示,假设用户选择了多个待压缩的应用,比如应用压缩后的界面如图10中的(a)所示界面1000,手机100可检测到用户在该界面1000上的手势操作,触发压缩后的应用进入编辑状态。
在一些实施例中,手势操作可以为用户在界面1000上的空白位置处的长按操作,手机100可响应用户的长按操作,显示图10中的(b)所示界面1010,该界面1010上可包括处于编辑状态的压缩应用的图标、解压缩的按钮1011,用户可在该界面1010上选择要解压缩的应用。比如,用户可在界面1010上选择压缩的图库应用(例如在压缩的图库应用的选择框上可显示√号标记),然后点击解压缩的按钮1011,手机100可响应该点击操作,对图库应用进行解压缩,解压缩完成之后可参阅图10中的(c)所示界面1020。
示例2:如图11所示,对于应用压缩后的界面1100,手机100可检测到用户在该界面上的手势操作,比如手势操作可以为用户在图11中的(a)所示界面1100上对图库应用图标的长按操作,手机100可响应长按操作,显示图11中的(b)所示界面1110,该界面1110中可包括分享按钮1111、卸载按钮1112、解压缩按钮1113。用户可在界面1110上点击解压缩按钮1113,手机100可响应该点击操作,对图库应用进行解压缩。
应理解,上述两种示例仅是示意性说明,手势操作也可以为其它的操作,当然还可以为语音触发操作等。并且,本申请实施例中用户在选择待压缩的应用/解压缩的应用时可以选择多个应用进行批量压缩/解压缩。
示例3:如图12所示,假设手机100显示图12所示的(a)所示界面1200,该界面1200中可包括解压缩设置选项1201,当用户点击解压缩设置选项1201后,手机100可响应该点击操作,进入解压缩设置界面,例如显示图12中的(b)所示界面1210。其中,界面1210中可显示已压缩的应用列表,用户可在该界面中选择需要解压缩的应用,比如用户可勾选图库应用,然后点击解压缩按钮1211,手机100可响应对解压缩按钮1211的点击操作,对图库应用进行解压缩,例如可显示图12中的(c)所示界面1220。其中,界面1220中可包括提示信息1221,例如该提示信息可以为:正在解压缩图库应用以及解压缩进度条。用户可通过解压缩进度条看到解压缩的进度,当解压缩完成之后,可继续显示图12中的(b)所示界面1210。当然,在实际产品实现时,当解压缩完成之后,手机100也可以返回主界面等,本申请对此不作限定。
示例4:如图13所示,假设手机100显示图13所示的(a)所示界面1300,该界面1300中可包括压缩设置选项1301,当用户点击压缩设置选项1301后,手机100可响应该点击操作,进入压缩设置界面,例如显示图13中的(b)所示界面1310。其中,界面1310中可包括已压缩的应用列表和未压缩的应用列表。假设图库为已压缩的应用,当用户点击图库应用的解压缩按钮1311时,手机100可响应用户的点击操作,对图库应用进行解压缩,比如可显示图13中的(c)所示界面1320,该界面1320中可包括提示信息1321,例如该提示信息可以为:正在解压缩图库应用以及解压缩进度条。当压缩完成之后,手机100可显示图13中的(d)所示界面1330,在界面1330中图库应用所在的矩形框内的压缩标识发生了变化。
由于在压缩应用时并没有删除应用,因此本申请实施例中在对压缩的应用进行解压缩后可直接使用该应用,无需重新安装应用。
下面继续介绍应用压缩后用户如何使用压缩后的应用。
在一些实施例中,已压缩的应用可以边解压边启动,即应用可以正常启动,在解压缩过程中,文件系统可直接将解压缩之后的数据传递给应用,应用感知不到解压缩的过程,能够缩短时间,提升效率,并且能够提升用户体验。示例性的,如图14所示,假设手机100显示图14中的(a)所示的主界面1400,该界面1400中图库应用为已压缩的应用,当用户点击已压缩的图库的应用图标后,手机100可响应该操作,打开图库应用,显示图库的应用界面,例如显示图14中的(b)所示的界面1410。
在另一些实施例中,已压缩的应用可以先解压,在解压完成之后启动进入应用界面。即用户可以看到应用解压过程,等待解压完成后使用应用。示例性的,如图15所示,假设手机100显示图15中的(a)所示的主界面1500,该界面1500中图库应用为已压缩的应用,当用户点击已压缩的图库的应用图标后,手机100可响应该操作,对图库应用进行解压缩,例如可显示图15中的(b)所示的界面1510。其中,界面1510中可包括图库解压的提示信息1511,当解压完成后,可打开图库应用,显示图库的应用界面,例如显示图15中的(c)所示的界面1520。
对于上述各种示例出的对应用进行压缩或者解压缩的方法,还可以包括:响应于用户对已压缩的应用的应用图标的操作,改变对已压缩的应用的压缩方式。示例性的,比如已压缩的应用为图库应用,且图库应用为经过轻度压缩的应用。用户可以长按图库应用的应用图标,将轻度压缩方式更改为中度压缩方式,并对图库应用进行中度压缩。接着,用户可以长按经过中度压缩的图库应用的应用图标,将中度压缩方式更改为重度压缩方式,并对图库应用进行重度压缩。这样用户可以根据自身需求调整压缩方式,能够提升用户体验。
应理解,上述压缩方式的更改仅是一种示意性说明,本申请实施例中的压缩方式之间可以随意切换,比如也可以从轻度压缩方式更改为重度压缩方式,或者从中度压缩方式更改为轻度压缩方式,再从轻度压缩方式更改为重度压缩方式等,本申请对此不作限定。
上述本申请提供的实施例中,从电子设备作为执行主体的角度对本申请实施例提供的方法进行了介绍。为了实现上述本申请实施例提供的方法中的各功能,电子设备可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约束条件。
如图16所示,本申请另外一些实施例公开了一种电子设备,该电子设备可以是具有显示屏的电子设备。参阅图16所示,所述电子设备1600包括:显示屏1601;一个或多个处理器1602;一个或多个存储器1603;一个或多个传感器(图中未示出)、多个应用(图中未示出);以及一个或多个计算机程序(图中未示出),上述各器件可以通过一个或多个通信总线1604连接。
其中,显示屏1601用于显示电子设备中的应用的显示界面,或者显示提示信息。存储器1603中存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令;处理器1602调用存储器1603中存储的所述指令,使得电子设备1600可以上述实施例的应用压缩方法及应用解压缩方法。
在本申请实施例中,处理器1602可以是通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直 接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储器1603中,处理器1602读取存储器1603中的程序指令,结合其硬件完成上述方法的步骤。
在本申请实施例中,存储器1603可以是非易失性存储器,比如硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)等,还可以是易失性存储器(volatile memory),例如RAM。存储器还可以是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本申请实施例中的存储器还可以是电路或者其它任意能够实现存储功能的装置,用于存储指令和/或数据。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
基于以上实施例,本申请还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机程序,所述计算机程序被计算机执行时,使得所述计算机执行以上实施例提供的应用压缩方法及应用解压缩方法。
本申请实施例中还提供一种计算机程序产品,包括指令,当其在计算机上运行时,使得计算机执行以上实施例提供的应用压缩方法及应用解压缩方法。
本申请实施例是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。

Claims (17)

  1. 一种应用压缩方法,其特征在于,应用于电子设备,所述方法包括:
    所述电子设备显示第一界面,所述第一界面包括应用图标以及压缩选项;
    所述电子设备响应于在所述第一界面上的第二操作,所述第二操作用于在所述第一界面中选择目标应用图标;
    所述电子设备响应于在所述第一界面上对所述压缩选项的点击操作,对与所述目标应用图标对应的目标应用进行透明压缩。
  2. 如权利要求1所述的方法,其特征在于,所述方法还包括:
    所述电子设备显示第二界面,所述第二界面包括第一提示信息,所述第一提示信息用于提示对与所述目标应用图标对应的所述目标应用的压缩进度。
  3. 如权利要求1或2所述的方法,其特征在于,所述方法还包括:
    所述电子设备显示第三界面,所述第三界面包括已压缩的目标应用的应用图标。
  4. 如权利要求3所述的方法,其特征在于,所述方法还包括:
    所述电子设备响应于在所述第三界面上的第三操作,显示第四界面,所述第四界面包括解压缩选项;
    所述电子设备响应于对所述解压缩选项的点击操作,对所述目标应用进行解压缩。
  5. 如权利要求4所述的方法,其特征在于,所述方法还包括:
    所述电子设备显示第五界面,所述第五界面包括第二提示信息,所述第二提示信息用于提示对所述目标应用的解压缩进度。
  6. 如权利要求3所述的方法,其特征在于,所述方法还包括:
    所述电子设备响应于在所述第三界面上的第四操作,启动所述目标应用;
    所述电子设备显示所述目标应用的应用界面。
  7. 如权利要求3所述的方法,其特征在于,所述方法还包括:
    所述电子设备响应于在所述第三界面上的第四操作,显示第三提示信息,所述第三提示信息包括所述目标应用正在解压的信息;
    当所述目标应用解压完成后,所述电子设备启动所述目标应用,并显示所述目标应用的应用界面。
  8. 如权利要求1-7任一项所述的方法,其特征在于,所述电子设备对与所述目标应用图标对应的目标应用进行透明压缩,包括:
    所述电子设备在所述目标应用的应用文件中选择目标文件,并将所述目标文件划分为多个文件块;
    所述电子设备针对所述多个文件块的每一个文件块选择相应的目标压缩算法;
    所述电子设备按照相应的目标压缩算法对所述多个文件块的每一个文件块进行压缩。
  9. 如权利要求1-7任一项所述的方法,其特征在于,所述电子设备对与所述目标应用图标对应的目标应用进行透明压缩,包括:
    所述电子设备获取所述目标应用包括的第一文件,所述第一文件中包括第一数据;
    所述电子设备对所述第一文件中的所述第一数据进行压缩,得到第二文件,所述第二文件中包括第一压缩数据,所述第一文件和所述第二文件的文件名称、后缀名称相同。
  10. 如权利要求4所述的方法,其特征在于,所述电子设备对所述目标应用进行解压缩, 包括:
    所述电子设备获取所述目标应用包括的第二文件,所述第二文件中包括第一数据的第一压缩数据,所述第一数据为所述目标应用中的第一文件包括的数据;
    所述电子设备对所述第二文件中的所述第一压缩数据进行解压缩,得到所述第一文件,所述第一文件和所述第二文件的文件名称、后缀名称相同。
  11. 如权利要求1-10任一项所述的方法,其特征在于,所述方法还包括:
    所述电子设备响应于对所述目标应用图标的第五操作,对所述目标应用图标对应的目标应用的压缩方式进行更改。
  12. 一种应用解压缩的方法,其特征在于,应用于电子设备,所述方法包括:
    所述电子设备显示第四界面,所述第四界面包括透明压缩的目标应用的目标应用图标和解压缩选项;
    所述电子设备响应于在所述第四界面上的第六操作,所述第六操作用于在所述第四界面中选择所述目标应用图标;
    所述电子设备响应于在所述第四界面上对所述解压缩选项的点击操作,对与所述目标应用图标对应的目标应用进行透明解压缩。
  13. 如权利要求12所述的方法,其特征在于,所述方法还包括:
    所述电子设备响应于对所述目标应用图标的第五操作,对所述目标应用图标对应的目标应用的压缩方式进行更改。
  14. 一种电子设备,其特征在于,所述电子设备包括显示屏;一个或多个处理器;一个或多个存储器;一个或多个传感器;多个应用;以及一个或多个计算机程序;
    其中所述一个或多个计算机程序被存储在所述一个或多个存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器调用执行时,使得所述电子设备执行如权利要求1至11任一项所述的应用压缩方法。
  15. 一种电子设备,其特征在于,所述电子设备包括显示屏;一个或多个处理器;一个或多个存储器;一个或多个传感器;多个应用;以及一个或多个计算机程序;
    其中所述一个或多个计算机程序被存储在所述一个或多个存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器调用执行时,使得所述电子设备执行如权利要求12至13任一项所述的应用解压缩方法。
  16. 一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,其特征在于,当所述指令在电子设备上运行时,使得所述电子设备执行如权利要求1至11任一项所述的应用压缩方法;或者,使得电子设备执行如权利要求12或13所述的应用解压缩方法。
  17. 一种计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行如权利要求1至11任一项所述的应用压缩方法;或者,使得电子设备执行如权利要求12或13所述的应用解压缩方法。
PCT/CN2023/089053 2022-04-29 2023-04-18 应用压缩方法、解压缩方法及电子设备 WO2023207683A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210474441.XA CN117008773A (zh) 2022-04-29 2022-04-29 应用压缩方法、解压缩方法及电子设备
CN202210474441.X 2022-04-29

Publications (1)

Publication Number Publication Date
WO2023207683A1 true WO2023207683A1 (zh) 2023-11-02

Family

ID=88517619

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/089053 WO2023207683A1 (zh) 2022-04-29 2023-04-18 应用压缩方法、解压缩方法及电子设备

Country Status (2)

Country Link
CN (1) CN117008773A (zh)
WO (1) WO2023207683A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101957836A (zh) * 2010-09-03 2011-01-26 清华大学 一种文件系统中可配置的实时透明压缩方法
CN111143300A (zh) * 2019-12-25 2020-05-12 维沃移动通信有限公司 文件压缩方法及电子设备
CN114003573A (zh) * 2021-10-18 2022-02-01 锐掣(杭州)科技有限公司 文件系统的压缩方法、装置、设备、存储介质、程序产品

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101957836A (zh) * 2010-09-03 2011-01-26 清华大学 一种文件系统中可配置的实时透明压缩方法
CN111143300A (zh) * 2019-12-25 2020-05-12 维沃移动通信有限公司 文件压缩方法及电子设备
CN114003573A (zh) * 2021-10-18 2022-02-01 锐掣(杭州)科技有限公司 文件系统的压缩方法、装置、设备、存储介质、程序产品

Also Published As

Publication number Publication date
CN117008773A (zh) 2023-11-07

Similar Documents

Publication Publication Date Title
WO2021063097A1 (zh) 一种显示方法及电子设备
WO2021057868A1 (zh) 一种界面切换方法及电子设备
WO2021036571A1 (zh) 一种桌面的编辑方法及电子设备
WO2020010584A1 (zh) 一种终端恢复出厂设置时的数据恢复方法及终端
CN108028891B (zh) 电子设备和照相方法
CN113553130B (zh) 应用执行绘制操作的方法及电子设备
WO2022089208A1 (zh) 一种文件拖拽方法及电子设备
WO2021063090A1 (zh) 一种建立应用组合的方法与电子设备
JP2023506936A (ja) マルチ画面共働方法およびシステム、ならびに電子デバイス
CN113961157B (zh) 显示交互系统、显示方法及设备
WO2021104117A1 (zh) 一种构建应用程序资源包的方法、构建装置及终端设备
CN113132526A (zh) 一种页面绘制方法及相关装置
CN112825232A (zh) 一种补偿方法及电子设备
WO2023029983A1 (zh) 一种控件内容的拖拽方法、电子设备及系统
CN114896097B (zh) 一种应用程序无响应处理方法及电子设备
WO2023207683A1 (zh) 应用压缩方法、解压缩方法及电子设备
WO2024046237A1 (zh) 一种应用热启动方法及电子设备
CN117009023B (zh) 显示通知信息的方法及相关装置
WO2023078088A1 (zh) 一种显示方法及电子设备
WO2022188766A1 (zh) 一种应用程序的显示方法及电子设备
CN114244951B (zh) 应用程序打开页面的方法及其介质和电子设备
WO2023246290A1 (zh) 一种功耗控制方法及电子设备
WO2023051357A1 (zh) 一种虚拟设备运行方法
WO2024017332A1 (zh) 控制部件的方法及相关装置
WO2024093431A1 (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: 23795116

Country of ref document: EP

Kind code of ref document: A1