Terminal application file storage method, device, mobile terminal and readable storage medium
By detecting and deleting redundant application files on the mobile terminal and saving the target application files to the global directory, the problem of low utilization of storage space in the mobile terminal is solved and more efficient use of storage space is achieved.
Patent Information
- Application Number
- CN201910430546.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-05-22
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2039-05-22
AI Technical Summary
The storage space utilization rate of mobile terminals is low. As the number of application installations increases, the remaining storage space decreases rapidly, affecting the normal use of the device.
By detecting that after the installation of the mobile terminal application is completed, the target application file of the installed application is obtained, and the same initial application file is obtained from the terminal, the initial file is deleted, and the target file is saved to the global directory to achieve the sharing and redundant application data of application data The remaining decreases.
It effectively avoids redundant storage of application data, improves the storage space utilization of mobile terminals, and extends the normal use time of the device.
Smart Images

Figure CN110175148B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of mobile terminal technology, and in particular to a terminal application file storage method, device, mobile terminal and readable storage medium. Background Art
[0002] With the rapid development of mobile terminal technology, mobile terminals have brought great convenience to people. Mobile terminal users only need to install some applications online to meet their needs in various aspects such as production, life, entertainment, chatting and shopping. However, the storage space of mobile terminals is fixed. Each application will occupy a large storage space. After each application is installed, the remaining storage space of the mobile terminal will decrease rapidly. As more and more applications are installed on the mobile terminal, the remaining memory of the mobile terminal will also decrease, which will eventually affect the normal use of the mobile terminal. Therefore, how to improve the utilization rate of the storage space of the mobile terminal is a technical problem that needs to be solved urgently.
[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of the present invention is to provide a terminal application file storage method, aiming to solve the technical problem that the remaining storage space of the mobile terminal is rapidly reduced due to the large space occupied by the installed applications.
[0005] To achieve the above object, the present invention provides a terminal application file storage method, comprising:
[0006] When it is detected that the mobile terminal application has been installed, the target application file of the installed application is obtained;
[0007] Acquire an initial application file identical to the target application file from the mobile terminal;
[0008] The initial application file is deleted from the mobile terminal, and the target application file is saved in the global directory of the mobile terminal.
[0009] Optionally, the step of acquiring an initial application file identical to the target application file from the mobile terminal includes:
[0010] Acquire a valid application file having the same format as the target application file from a directory of the mobile terminal;
[0011] Detecting whether the valid application file and the target application file are the same application file;
[0012] If the valid application file and the target application file are the same application file, the valid application file is obtained as the initial application file.
[0013] Optionally, the mobile terminal directory includes a global directory and an application directory of installed applications, and the step of obtaining a valid application file having the same format as the target application file from the mobile terminal directory includes:
[0014] Detecting whether there is a valid application file in the same format as the target application file in the application directory;
[0015] If the valid application file exists in the application directory, obtaining the valid application file from the application directory;
[0016] If the valid application file does not exist in the application directory, the valid application file is obtained from the global directory.
[0017] Optionally, the target application file includes a so file, and the step of detecting whether the valid application file and the target application file are the same application file includes:
[0018] Detect whether the first file name of the valid application file is the same as the second file name of the so file;
[0019] If the first file name is the same as the second file name, detecting whether there is a difference between the first file content of the valid application file and the second file content of the so file;
[0020] If there is no difference between the first file content and the second file content, it is determined that the valid application file and the so file are the same application file.
[0021] Optionally, after the step of detecting whether there is a difference between the first file content of the valid application file and the second file content of the so file, the step further includes:
[0022] If there is a difference between the first file content and the second file content, obtaining a ratio of the difference content of the different part to the difference between the first file content and the second file content;
[0023] Detecting whether the difference ratio is less than a preset threshold;
[0024] If the difference ratio is less than a preset threshold, detecting whether the first version number of the valid application file is lower than the second version number of the so file;
[0025] If the first version number is lower than the second version number, it is determined that the valid application file and the so file are the same application file.
[0026] Optionally, the target application file includes a jar file, and the step of detecting whether the valid application file and the target application file are the same application file includes:
[0027] Detecting whether the third file name of the valid application file is the same as the fourth file name of the jar file;
[0028] If the third file name is the same as the fourth file name, detecting whether the number of classes in the valid application file is the same as the number of classes in the jar file;
[0029] If the number of classes of the valid application file is the same as the number of classes of the jar file, determine whether the valid application file and the jar file are the same application file based on the first class name of each class of the valid application file and the second class name of each class of the jar file.
[0030] Optionally, the step of determining whether the valid application file and the jar file are the same application file according to the first class name of each class of the valid application file and the second class name of each class of the jar file includes:
[0031] Detecting whether there is a one-to-one mapping relationship between the first category name and the second category name;
[0032] If there is a one-to-one mapping relationship between the first class name and the second class name, detecting whether the third version number of the valid application file is lower than the fourth version number of the jar file;
[0033] If the third version number is lower than the fourth version number, it is determined that the valid application file and the jar file are the same application file.
[0034] In addition, to achieve the above-mentioned purpose, the present invention further provides a terminal application file storage device, the terminal application file storage device comprising:
[0035] A first acquisition module is used to acquire a target application file of the installed application when it is detected that the mobile terminal application is installed;
[0036] A second acquisition module, used to acquire an initial application file identical to the target application file from a mobile terminal;
[0037] The file storage module is used to delete the initial application file from the mobile terminal and save the target application file to the global directory of the mobile terminal.
[0038] In addition, to achieve the above-mentioned purpose, the present invention also provides a mobile terminal, which includes: a memory, a processor, and a terminal application file storage program stored in the memory and executable on the processor, and the terminal application file storage program, when executed by the processor, implements the steps of the terminal application file storage method as described above.
[0039] In addition, to achieve the above objectives, the present invention also provides a readable storage medium, on which a terminal application file storage program is stored, and when the terminal application file storage program is executed by a processor, the steps of the terminal application file storage method described above are implemented.
[0040] A terminal application file storage method proposed in an embodiment of the present invention obtains a target application file of the installed application after detecting that the installation of a mobile terminal application is complete, and detects whether there is an application file identical to the target application file in the mobile terminal. If it is detected that there is an application file identical to the target application file in the mobile terminal, the application file identical to the target application file is deleted, and the target application file is saved in the global directory of the mobile terminal (or the target application file is deleted and the initial application file is moved to the global directory of the mobile terminal for storage), so that two or more applications can share one application data, avoiding the redundancy of application data caused by simultaneously saving the same part of application data of two or more applications, thereby improving the utilization rate of the storage space of the mobile terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 is a schematic diagram of the hardware structure of an optional mobile terminal according to an embodiment of the present invention;
[0042] Figure 2 for Figure 1 Schematic diagram of a wireless communication device of a mobile terminal;
[0043] Figure 3 It is a flowchart of the first embodiment of the terminal application file storage method of the present invention.
[0044] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0045] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0046] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0047] The terminal may be implemented in various forms. For example, the terminal described in the present invention may include mobile terminals such as mobile phones, tablet computers, laptop computers, PDAs, portable media players (PMPs), navigation devices, wearable devices, smart bracelets, pedometers, etc., as well as fixed terminals such as digital TVs and desktop computers.
[0048] The following description will be made by taking a mobile terminal as an example, and those skilled in the art will appreciate that, in addition to components specifically used for mobile purposes, the configuration according to the embodiments of the present invention can also be applied to fixed-type terminals.
[0049] See also Figure 1 , which is a schematic diagram of the hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, audio output unit 103, A / V (audio / video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111 and other components. Those skilled in the art can understand that Figure 1 The structure of the mobile terminal shown in the figure does not constitute a limitation on the mobile terminal. The mobile terminal may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0050] Combine the following Figure 1 The following is a detailed introduction to the various components of the mobile terminal:
[0051] The radio frequency unit 101 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving the downlink information of the base station, it is sent to the processor 110 for processing; in addition, the uplink data is sent to the base station. Generally, the radio frequency unit 101 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 101 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution) and TDD-LTE (Time Division Duplexing-Long Term Evolution), etc.
[0052] WiFi is a short-range wireless transmission technology. Mobile terminals can help users send and receive emails, browse web pages, and access streaming media through WiFi module 102. It provides users with wireless broadband Internet access. Figure 1 The WiFi module 102 is shown, but it is understandable that it is not an essential component of the mobile terminal and can be omitted as required without changing the essence of the invention.
[0053] The audio output unit 103 can convert the audio data received by the RF unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output it as sound when the mobile terminal 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, etc. Moreover, the audio output unit 103 can also provide audio output related to a specific function performed by the mobile terminal 100 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, etc.
[0054] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 may include a graphics processor (GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 106. The image frame processed by the graphics processor 1041 can be stored in the memory 109 (or other storage medium) or sent via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) via the microphone 1042 in a telephone call mode, a recording mode, a voice recognition mode, and other operating modes, and can process such sound into audio data. The processed audio (voice) data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 101 in the case of a telephone call mode. The microphone 1042 can implement various types of noise elimination (or suppression) algorithms to eliminate (or suppress) noise or interference generated in the process of receiving and sending audio signals.
[0055] The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 1061 and / or the backlight when the mobile terminal 100 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can also be configured on the mobile phone, such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0056] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0057] The user input unit 107 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 1071 or near the touch panel 1071 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 110, and can receive and execute the command sent by the processor 110. In addition, the touch panel 1071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 1071, the user input unit 107 may also include other input devices 1072. Specifically, the other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, etc., which are not specifically limited here.
[0058] Furthermore, the touch panel 1071 may cover the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of the touch event. Then, the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Figure 1 In the figure, the touch panel 1071 and the display panel 1061 are used as two independent components to implement the input and output functions of the mobile terminal. However, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to implement the input and output functions of the mobile terminal, which is not limited here.
[0059] The interface unit 108 serves as an interface through which at least one external device can be connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and an external device.
[0060] The memory 109 can be used to store software programs and various data. The memory 109 can be a computer storage medium, and the memory 109 stores the terminal application file storage program of the present invention. The memory 109 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 109 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0061] The processor 110 is the control center of the mobile terminal, and uses various interfaces and lines to connect various parts of the entire mobile terminal. By running or executing software programs and / or modules stored in the memory 109, and calling data stored in the memory 109, the processor 110 performs various functions of the mobile terminal and processes data, thereby monitoring the mobile terminal as a whole. For example, the processor 110 executes the terminal application file storage program in the memory 109 to implement the steps of each embodiment of the terminal application file storage method of the present invention.
[0062] The processor 110 may include one or more processing units; optionally, the processor 110 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 110.
[0063] The mobile terminal 100 may further include a power supply 111 (such as a battery) for supplying power to various components. Optionally, the power supply 111 may be logically connected to the processor 110 via a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system.
[0064] although Figure 1 Not shown, the mobile terminal 100 may further include a Bluetooth module, etc., which will not be described in detail here.
[0065] To facilitate understanding of the embodiments of the present invention, the communication network system on which the mobile terminal of the present invention is based is described below.
[0066] See also Figure 2 , Figure 2A communication network system architecture diagram is provided for an embodiment of the present invention. The communication network system is an LTE system of universal mobile communication technology. The LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203 and an operator's IP service 204, which are sequentially connected for communication.
[0067] Specifically, UE201 may be the above-mentioned terminal 100, which will not be described in detail here.
[0068] E-UTRAN 202 includes eNodeB 2021 and other eNodeBs 2022 , etc. Among them, eNodeB 2021 can be connected to other eNodeBs 2022 through a backhaul (eg, an X2 interface), and eNodeB 2021 is connected to EPC 203 , and eNodeB 2021 can provide UE 201 with access to EPC 203 .
[0069] EPC203 may include MME (Mobility Management Entity) 2031, HSS (Home Subscriber Server) 2032, other MMEs 2033, SGW (Serving Gate Way) 2034, PGW (PDN Gate Way) 2035 and PCRF (Policy and Charging Rules Function) 2036, etc. Among them, MME2031 is a control node that processes signaling between UE201 and EPC203, and provides bearer and connection management. HSS2032 is used to provide some registers to manage functions such as home location register (not shown in the figure), and save some user-specific information such as service features and data rates. All user data can be sent through SGW2034, PGW2035 can provide IP address allocation and other functions for UE 201, PCRF2036 is the policy and charging control policy decision point for service data flow and IP bearer resources, which selects and provides available policy and charging control decisions for the policy and charging execution function unit (not shown in the figure).
[0070] The IP service 204 may include the Internet, an intranet, an IMS (IP Multimedia Subsystem) or other IP services.
[0071] Although the above introduction takes the LTE system as an example, those skilled in the art should know that the present invention is not only applicable to the LTE system, but also to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA and future new network systems, etc., which are not limited here.
[0072] Based on the above mobile terminal hardware structure and communication network system, various embodiments of the method of the present invention are proposed.
[0073] Reference Figure 3 In the first embodiment of the terminal application file storage method of the present invention, the terminal application file storage method includes:
[0074] Step S10, when it is detected that the mobile terminal application is installed, the target application file of the installed application is obtained;
[0075] In the embodiment of the present invention, a mobile terminal is used as the execution subject.
[0076] Among the applications installed on the mobile terminal, there are often two or more applications with the same application data. For example, the so file content in the application data of application A is exactly the same as the so file content in the application data of application B, and the jar file content in the application data of application C is exactly the same as the jar file content in the application data of application D. When installing applications, the mobile terminal often saves a copy of the application data related to each application installed. In this case, if the application data of the currently installed application has the same part as the application data of the historically installed application saved by the mobile terminal, if the same part of the application data is saved again after the currently installed application is installed, it will lead to redundant application data, and the redundant application data will occupy the storage space of the mobile terminal.
[0077] The present invention proposes a terminal application file storage method, which is mainly used for storing application data during the application installation process of a mobile terminal, so that the currently installed application and the historically installed application can share the same application data, avoiding redundancy of application data, thereby improving the utilization rate of the storage space of the mobile terminal.
[0078] Specifically, first, after detecting that the mobile terminal has completed the installation of the application, the target application file of the installed application is obtained. Among them, the installed application refers to the application that has been installed and saved in the mobile terminal. The target application file refers to the application data of the installed application, specifically, the application data of the installed application from the current time minus the preset time to the current time; the target application file includes the so file and jar file of the installed application. In this embodiment, the so file and / or jar file of the installed application are mainly used as the target application file to illustrate the storage process of the application data of the installed application after the installation of the installed application in the mobile terminal is completed. The application file described in the present invention represents the application data of the application.
[0079] Step S20, obtaining an initial application file identical to the target application file from the mobile terminal;
[0080] Among them, the initial application file refers to an application file that has the same data content as the target application file and has been saved in the mobile terminal; or an application file that is a different version from the target application file and has a lower version than the target application file and has been saved in the mobile terminal.
[0081] Specifically, one implementation method is, after obtaining the target application file, detecting whether there are application files with the same format as the target application file in each directory of the mobile terminal (including the global directory and the application directories of each application); if it is detected that there are application files with the same format as the target application file in each directory of the mobile terminal, obtaining the application file with the same format as the target application file and comparing it with the target application file to determine whether the data content of the application file with the same format as the target application file is exactly the same as the data content of the target application file.
[0082] If the data content of the application file having the same format as the target application file is exactly the same as the data content of the target application file, it is determined that the application file is the same as the target application file, and the application file is obtained as the initial application file.
[0083] If it is detected that there is no application file with the same format as the target application file in each directory of the mobile terminal, or there is an application file with the same format as the target application file in each directory of the mobile terminal but the data content of the application file with the same format as the target application file is not exactly the same as the data content of the target application file, then it is determined that the application data identical to the target application file is not saved in the mobile terminal, and saving the target application file will not cause data redundancy in the mobile terminal; at this time, the target application file is saved according to the normal application installation process, that is, the target application file is saved to the application directory of the installed application.
[0084] One implementation method is, after acquiring the target application file, detecting whether there are application files with the same format as the target application file in each directory of the mobile terminal (including the global directory and the application directories of each application); if it is detected that there are application files with the same format as the target application file in each directory of the mobile terminal, acquiring the application file with the same format as the target application file and comparing it with the target application file to determine whether there is a difference between the data content of the application file with the same format as the target application file and the data content of the target application file.
[0085] If there is a difference between the data content of an application file with the same format as the target application file and the data content of the target application file, it is further detected whether the ratio of the data content of the different part to the data content of the target application file (or the data content of an application file with the same format as the target application file) is less than a preset threshold.
[0086] If the ratio of the data content of the difference part to the data content of the target application file (or the data content of the application file with the same format as the target application file) is less than a preset threshold, it is considered that the application file with the same format as the target application file and the target application file are different versions of the same type of application files. At this time, it is determined that the application file is the same as the target application file, and the application file is obtained as the initial application file. If the ratio of the data content of the difference part to the data content of the target application file (or the data content of the application file with the same format as the target application file) is greater than or equal to the preset threshold, it is determined that the mobile terminal does not store the same application data as the target application file, and the target application file will not cause data redundancy in the mobile terminal after it is saved; at this time, the target application file is saved according to the normal application installation process, that is, the target application file is saved to the application directory of the installed application.
[0087] If there is no difference between the data content of the application file having the same format as the target application file and the data content of the target application file, it is determined that the application file and the target application file are the same application file, and the application file is obtained as the initial application file.
[0088] Step S30, deleting the initial application file from the mobile terminal, and saving the target application file to the global directory of the mobile terminal.
[0089] If the initial application file is obtained from each directory of the mobile terminal, it proves that the mobile terminal has saved the same application data as the target application file. There is no need to save the initial application file and the target application file in the mobile terminal at the same time to avoid redundant application data of the mobile terminal and unnecessary application data occupying storage space.
[0090] Specifically, one implementation is that after the initial application file is obtained, the initial application file is deleted from the mobile terminal, and the target application file is saved in the global directory of the mobile terminal. One implementation is that after the initial application file is obtained, the initial application file is moved to the global directory of the mobile terminal for storage, and the target application file is deleted.
[0091] Furthermore, one implementation method is that after obtaining the initial application file, the version number of the initial application file and the version number of the target application file are obtained, and the relative difference between the version number of the initial application file and the version number of the target application file is determined. Finally, the one with the relatively higher version number is obtained from the initial application file and the target application file and saved in the global directory of the mobile terminal, and the one with the relatively lower version number is obtained and deleted.
[0092] Mobile terminals generally have a system global directory for storing system files and a third-party data global directory for storing third-party data (such as downloaded software). Multiple subdirectories can be set under each global directory. For example, a third-party data global directory can be set to set a subdirectory for each application, and each subdirectory is used to store application data of an application. Among them, the global directory refers to the data storage path shared by the mobile terminal, including the system global directory and / or the third-party data global directory.
[0093] In this embodiment, when it is detected that the installation of the mobile terminal application is complete, the target application file of the installed application is obtained, and it is detected whether there is an application file identical to the target application file in the mobile terminal. If it is detected that there is an application file identical to the target application file in the mobile terminal, the application file identical to the target application file is deleted, and the target application file is saved in the global directory of the mobile terminal (or the target application file is deleted and the initial application file is moved to the global directory of the mobile terminal for storage), so that two or more applications can share one application data, avoiding the redundancy of application data caused by saving the same part of application data of two or more applications at the same time, thereby improving the utilization rate of the storage space of the mobile terminal.
[0094] Optionally, based on the above first embodiment, a second embodiment of the terminal application file storage method of the present invention is proposed, and step S20 includes:
[0095] Step A1, obtaining a valid application file having the same format as the target application file from a directory of the mobile terminal;
[0096] The mobile terminal directory refers to the data storage path in the mobile terminal, including the global directory of the mobile terminal and the various subdirectories under the global directory, such as the application directory. The application directory refers to the storage path in the mobile terminal specifically used to store the application data of the installed applications. Each installed application corresponds to an application directory. The valid application file refers to the application file in the mobile terminal that has been saved and has the same format as the target application file.
[0097] Specifically, firstly, it is detected whether there is an application file with the same format as the target application file in the application directory of each application installed in the mobile terminal. If there is an application file with the same format as the target application file in the application directory of each application installed in the mobile terminal, the application file is obtained as a valid application file with the same format as the target application file. For example, if the target application file is an so file, the valid application file is also an so file; if the target application file is a jar file, the valid application file is also a jar file.
[0098] If there is no application file with the same format as the target application file in the application directory of each application installed in the mobile terminal, then check whether there is an application file with the same format as the target application file in the global directory of the mobile terminal. If there is an application file with the same format as the target application file in the global directory of the mobile terminal, then obtain the application file as a valid application file with the same format as the target application file. If there is no application file with the same format as the target application file in the global directory of the mobile terminal, it proves that the mobile terminal does not store the same application data as the target application file, and the target application file will not cause data redundancy in the mobile terminal after it is saved; at this time, save the target application file according to the normal application installation process, that is, save the target application file to the application directory of the installed application.
[0099] Step A2, detecting whether the valid application file and the target application file are the same application file;
[0100] Specifically, one implementation method is to first detect whether the file name of the valid application file is the same as the file name of the target application file. If it is detected that the file name of the valid application file is not the same as the file name of the target application file, it is determined that the valid application file and the target application file are not the same application file. If it is detected that the file name of the valid application file is the same as the file name of the target application file, it is proved that the valid application file and the target application file are very likely to be the same application file, and then further detect whether the data content of the valid application file is exactly the same as the data content of the target application file.
[0101] If the data content of the valid application file is completely identical to the data content of the target application file, it is proved that the valid application file and the target application file are the same application file. If the data content of the valid application file is not completely identical to the data content of the target application file, it is proved that the valid application file and the target application file are not the same application file.
[0102] One implementation method is to first detect whether the file name of the valid application file is the same as the file name of the target application file. If it is detected that the file name of the valid application file is not the same as the file name of the target application file, it is determined that the valid application file and the target application file are not the same application file. If it is detected that the file name of the valid application file is the same as the file name of the target application file, it is proved that the valid application file and the target application file are very likely to be the same application file, and then further detect whether there is a difference between the data content of the valid application file and the data content of the target application file.
[0103] If there is no difference between the data content of the valid application file and the data content of the target application file, it is determined that the valid application file and the target application file are the same application file. If there is a difference between the data content of the valid application file and the data content of the target application file, it is further detected whether the ratio of the data content of the different part to the data content of the target application file (or to the data content of the valid application file) is less than a preset threshold.
[0104] If the ratio of the data content of the detected difference portion to the data content of the target application file (or to the data content of the valid application file) is less than a preset threshold, it is considered that the valid application file and the target application file are different versions of the same type of application files. At this time, it is determined that the application file and the target application file are the same application file. If the ratio of the data content of the difference portion to the data content of the target application file (or to the data content of the valid application file) is greater than or equal to a preset threshold, it is determined that the valid application file and the target application file are not the same application files.
[0105] Step A3: If the valid application file and the target application file are the same application file, the valid application file is obtained as the initial application file.
[0106] If it is detected that the valid application file and the target application file are the same application file, the valid application file is deleted as the initial application file. If it is detected that the valid application file and the target application file are not the same application file, it proves that the mobile terminal does not store the same application data as the target application file, and the target application file will not cause data redundancy in the mobile terminal after it is saved; at this time, the target application file is saved according to the normal application installation process, that is, the target application file is saved to the application directory of the installed application.
[0107] In this embodiment, by first obtaining valid application files with the same format as the target application files from the mobile terminal directory, the valid application files with a high probability of being the initial application files are quickly screened out; then, it is detected whether the data content of the valid application files is the same as the data content of the target application files, so as to determine whether the valid application files and the target application files are the same application files, thereby reducing the files that need to be compared with the data content of the target application files and improving the efficiency of finding the initial application.
[0108] Optionally, the mobile terminal directory includes a global directory and an application directory of installed applications, and step A1 includes:
[0109] Step B1, detecting whether there is a valid application file in the same format as the target application file in the application directory;
[0110] Specifically, firstly, it is detected whether there is an application file with the same format as the target application file in the application directory of each application installed in the mobile terminal. For example, if the target application file is an so file, then the valid application file is also an so file; if the target application file is a jar file, then the valid application file is also a jar file.
[0111] Step B2, if the valid application file exists in the application directory, obtaining the valid application file from the application directory;
[0112] If it is detected that there are application files with the same format as the target application file in one or more application directories of the application directories of the applications installed in the mobile terminal, it proves that there is a high probability that there are application files with the same format as the target application file in the mobile terminal, and the application file with the same format as the target application file is obtained from the corresponding application directory of the mobile terminal as a valid application file.
[0113] Step B3: If the valid application file does not exist in the application directory, obtain the valid application file from the global directory.
[0114] If it is detected that there are no application files with the same format as the target application file in the application directories of the applications installed in the mobile terminal, it proves that there are no valid application files in the application directories, and further detection is performed to determine whether there are application files with the same format as the target application file in the global directory of the mobile terminal.
[0115] If it is detected that an application file with the same format as the target application file exists in the global directory of the mobile terminal, it is proved that there is a high probability that an application file with the same format as the target application file exists in the mobile terminal, and the application file with the same format as the target application file is obtained from the global directory of the mobile terminal as a valid application file. If it is detected that there is no application file with the same format as the target application file in the global directory of the mobile terminal, it is determined that the valid application file is not the same application file as the target application file.
[0116] As a more preferred embodiment, in the embodiment of the present invention, it is detected whether there are valid application files in the mobile terminal by first detecting whether there are valid application files with the same format as the target application file in each application directory. If it is detected that there are no valid application files with the same format as the target application file in each application directory, it is then detected whether there are valid application files with the same format as the target application file in the global directory of the mobile terminal. It can be understood that, to detect whether there are valid application files in the mobile terminal, it is also possible to first detect whether there are valid application files in the global directory of the mobile terminal. If no valid application files are detected in the global directory of the mobile terminal, it is then detected whether there are valid application files in each application directory. Alternatively, it is also possible to simultaneously detect whether there are valid application files in the global directory of the mobile terminal and in each application directory.
[0117] In this embodiment, by first detecting whether there are valid application files in the application directories of each application of the mobile terminal, the storage path of the valid application files can be located more accurately and quickly. If it is detected that there are no valid application files in the application directories of each application of the mobile terminal, it is then detected whether there are valid application files in the global directory of the mobile terminal, so that the valid application files can be detected with less data.
[0118] Optionally, based on the first embodiment or the second embodiment, a third embodiment of the terminal application file storage method of the present invention is proposed, the target application file includes a so file, and step A2 includes:
[0119] Step C1, detecting whether the first file name of the valid application file is the same as the second file name of the so file;
[0120] The application data saved by the mobile terminal when installing the application generally includes the so file, and the application data of different applications may include the same so file. In the embodiment of the present invention, by detecting the valid application file that is the same as the so file of the installed application, the valid application file that is the same as the so file is further deleted as the initial application file.
[0121] Specifically, detect whether the first file name of the valid application file is the same as the second file name of the so file. If it is detected that the first file name of the valid application file is not the same as the second file name of the so file, it proves that the valid application file and the so file are not the same application file. If it is detected that the first file name of the valid application file is the same as the second file name of the so file, it proves that the valid application file and the so file have a high probability of being the same application file. Among them, the first file name refers to the file name of the valid application file. The second file name refers to the file name of the so file.
[0122] Step C2, if the first file name is the same as the second file name, detecting whether there is a difference between the first file content of the valid application file and the second file content of the so file;
[0123] Among them, the first file content refers to the application data content of the valid application file. Among them, the second file content refers to the application data content of the so file. If it is detected that the first file name of the valid application file is different from the second file name of the so file, it is determined that the valid application file and the so file are not the same application file. If it is detected that the first file name of the valid application file is the same as the second file name of the so file, it is proved that the valid application file and the so file have a high probability of being the same application file, and further detect whether there is a difference between the first file content of the valid application file and the second file content of the so file.
[0124] Step C3: If there is no difference between the first file content and the second file content, it is determined that the valid application file and the so file are the same application file.
[0125] In one implementation, if there is no difference between the first file content of the valid application file and the second file content of the so file, it is determined that the valid application file and the so file are the same application file.
[0126] If there is a difference between the first file content of the valid application file and the second file content of the so file, it is determined that the valid application file and the so file are not the same application file.
[0127] In one implementation, if there is no difference between the first file content of the valid application file and the second file content of the so file, it is determined that the valid application file and the so file are the same application file. If there is a difference between the first file content of the valid application file and the second file content of the so file, it is further detected whether the proportion of the difference between the first file content of the valid application file and the second file content of the so file in the first file content of the valid application file (or in the second file content of the so file) is less than a preset threshold.
[0128] If it is detected that there is a difference between the first file content of the valid application file and the second file content of the so file, and the proportion of the difference content in the first file content of the valid application file (or in the second file content of the so file) is less than a preset threshold, then it is determined that the valid application file and the so file are different versions of the same type of application files. At this time, it is determined that the application file and the so file are the same application file.
[0129] If it is detected that there is a difference between the first file content of the valid application file and the second file content of the so file, and the proportion of the difference content in the first file content of the valid application file (or in the second file content of the so file) is greater than or equal to a preset threshold, it is determined that the valid application file and the so file are not the same application files.
[0130] In this embodiment, by detecting whether the file name of the valid application file is the same as the file name of the so file, and detecting whether the file content of the valid application file is the same as the file content of the so file, it is determined whether the valid application file and the so file are the same application file. Therefore, when detecting less data, it can be accurately determined whether the valid application file and the so file are the same application file.
[0131] Optionally, based on the third embodiment above, a fourth embodiment of the terminal application file storage method of the present invention is proposed, and after step C2, the following further includes:
[0132] Step D1, if there is a difference between the first file content and the second file content, obtaining the ratio of the difference content of the different part to the difference between the first file content and the second file content;
[0133] If there is no difference between the first file content of the valid application file and the second file content of the so file, it is determined that the valid application file and the so file are the same application file. If there is a difference between the first file content of the valid application file and the second file content of the so file, the difference content of the part where the first file content and the second file content are different is obtained, and the difference ratio of the difference content to the first file content of the valid application file (or to the second file content of the so file) is calculated. Among them, the difference ratio refers to the ratio of the difference content of the part where the first file content and the second file content are different to the first file content of the valid application file, or the ratio of the difference content of the part where the first file content and the second file content are different to the second file content of the so file.
[0134] Step D2, detecting whether the difference ratio is less than a preset threshold;
[0135] Further detect whether the difference ratio is less than a preset threshold. If the difference ratio is less than the preset threshold, it proves that the valid application file and the so file are different versions of the same application file. If the difference ratio is greater than or equal to the preset threshold, it proves that the valid application file and the so file are not the same application file.
[0136] Step D3, if the difference ratio is less than a preset threshold, detecting whether the first version number of the valid application file is lower than the second version number of the so file;
[0137] Among them, the first version number refers to the version number of the valid application file. The second version number refers to the version number of the so file. If it is detected that the difference ratio is greater than or equal to the preset threshold, it is determined that the valid application file and the so file are not the same application file. If it is detected that the difference ratio is less than the preset threshold, it is determined that the valid application file and the so file are different versions of the same application file, and further detect whether the first version number of the valid application file is lower than the second version number of the so file.
[0138] Step D4: If the first version number is lower than the second version number, it is determined that the valid application file and the so file are the same application file.
[0139] If the first version number of the valid application file is lower than the second version number of the so file, it proves that the version of the valid application file currently saved in the mobile terminal is lower than the so file of the installed application, and the system compatibility of the higher version so file is higher than the system compatibility of the lower version of the valid application file. In order to improve the compatibility of the installed application with the mobile terminal system, the valid application files saved in the mobile terminal whose versions are lower than the so files of the installed application can be deleted, and the so files of the installed application can be saved in the global directory of the mobile terminal. Specifically, if it is detected that the first version number of the valid application file is lower than the second version number of the so file, it is determined that the valid application file and the so file are the same application file, so that the valid application file can be further deleted as the initial file.
[0140] If it is detected that the first version number of the valid application file is higher than the second version number of the so file, it proves that the version of the valid application file currently saved in the mobile terminal is higher than the so file of the installed application, and the system compatibility of the higher version of the valid application file is higher than that of the lower version of the so file. In order to improve the compatibility of the installed application with the mobile terminal system, the valid application file with a higher version than the so file of the installed application saved in the mobile terminal can be moved to the global directory of the mobile terminal, and the so file of the installed application can be deleted.
[0141] In this embodiment, by detecting whether the version number of the valid application file is lower than the version number of the so file, it is determined whether the valid application file is the initial file, and the valid application file with a version number lower than the version number of the so file is deleted as the initial file, so that when the application data is stored subsequently, the higher version of the application data (i.e., the so file) can be stored, so as to improve the version of the application file of the installed application in the mobile terminal, thereby improving the compatibility of the installed application with the mobile terminal system.
[0142] Optionally, based on the first embodiment or the second embodiment, a fifth embodiment of the terminal application file storage method of the present invention is proposed, wherein the target application file includes a jar file, and step A2 includes:
[0143] Step E1, detecting whether the third file name of the valid application file is the same as the fourth file name of the jar file;
[0144] The application data saved by the mobile terminal when installing an application generally includes a jar file, and the application data of different applications may include the same jar file. In the embodiment of the present invention, by detecting the valid application file that is the same as the jar file of the installed application, the valid application file that is the same as the jar file is further deleted as the initial application file.
[0145] Specifically, detect whether the third file name of the valid application file is the same as the fourth file name of the jar file. If it is detected that the third file name of the valid application file is not the same as the fourth file name of the jar file, it proves that the valid application file and the jar file are not the same application file. If it is detected that the third file name of the valid application file is the same as the fourth file name of the jar file, it proves that the valid application file and the jar file have a high probability of being the same application file. Among them, the third file name refers to the file name of the valid application file. The fourth file name refers to the file name of the jar file.
[0146] Step E2, if the third file name is the same as the fourth file name, detecting whether the number of classes in the valid application file is the same as the number of classes in the jar file;
[0147] If it is detected that the third file name of the valid application file is different from the fourth file name of the jar file, it is proved that the valid application file and the jar file are not the same application file. Among them, a jar file contains one or more classes. If the third file name of the valid application file is the same as the fourth file name of the jar file, it is proved that the valid application file and the jar file are most likely the same application file, and further detect whether the number of classes in the valid application file is the same as the number of classes in the jar file.
[0148] Step E3, if the number of classes of the valid application file is the same as the number of classes of the jar file, determine whether the valid application file and the jar file are the same application file based on the first class name of each class of the valid application file and the second class name of each class of the jar file.
[0149] The first class name refers to the class name of the class of the valid application file. The second class name refers to the class name of the class of the target application file. If the number of classes in the valid application file is different from the number of classes in the jar file, it is determined that the valid application file and the jar file are not the same application file.
[0150] If the number of classes in the valid application file is the same as the number of classes in the jar file, it proves that the valid application file and the jar file are most likely the same application file, and further checks whether there is a one-to-one mapping relationship between the first class name of each class of the valid application file and the second class name of each class of the jar file.
[0151] If it is detected that there is a one-to-one mapping relationship between the first class name of each class of the valid application file and the second class name of each class of the jar file, it is proved that the valid application file and the jar file are the same application file. If it is detected that there is no one-to-one mapping relationship between the first class name of each class of the valid application file and the second class name of each class of the jar file, it is proved that the valid application file and the jar file are not the same application file.
[0152] In this embodiment, by detecting whether the file name of the valid application file is the same as the file name of the jar file, detecting whether the number of classes in the valid application file is the same as the number of classes in the jar file, and detecting whether there is a one-to-one mapping relationship between the class names of each class in the valid application file and the class names of each class in the jar file, it is determined whether the valid application file and the jar file are the same application file. In this way, it is possible to accurately determine whether the valid application file and the jar file are the same application file by detecting less data.
[0153] Optionally, based on the fifth embodiment, a sixth embodiment of the terminal application file storage method of the present invention is proposed, wherein the step of determining whether the valid application file and the jar file are the same application file according to the first class name of each class of the valid application file and the second class name of each class of the jar file comprises:
[0154] Step F1, detecting whether there is a one-to-one mapping relationship between the first category name and the second category name;
[0155] Specifically, check whether the relationship between the first category name and the second category name satisfies: for each category name in the second category name, there is a corresponding category name in the second category name, and for each category name in the second category name, there is a corresponding category name in the first category name.
[0156] Whether the first class name and the second class name have the same class name. For ease of understanding, a specific embodiment is used for illustration. For example, the class names of the valid application files are: A, B, C, D, E, and the class names of the application files are: A, B, C, D, E. Then, there is a one-to-one mapping relationship between the first class name of each class of the valid application file and the second class name of each class of the jar file. For another example, the class names of the valid application files are: A, G, C, D, E, and the class names of the application files are: A, B, C, D, E. Then, there is no one-to-one mapping relationship between the first class name of each class of the valid application file and the second class name of each class of the jar file. The class names of the valid application files are: A, B, C, and the class names of the application files are: A, B. Then, there is no one-to-one mapping relationship between the first class name of each class of the valid application file and the second class name of each class of the jar file. The class names of the valid application files are B, C, and D, and the class names of the application files are B and C. There is no one-to-one mapping relationship between the first class names of the classes of the valid application files and the second class names of the classes of the jar files.
[0157] Step F2, if there is a one-to-one mapping relationship between the first class name and the second class name, then detecting whether the third version number of the valid application file is lower than the fourth version number of the jar file;
[0158] The third version number refers to the version number of the valid application file. The fourth version number refers to the version number of the jar file. If it is detected that there is no one-to-one mapping relationship between the first class name of each class of the valid application file and the second class name of each class of the jar file, it is proved that the valid application file and the jar file are not the same application file.
[0159] If it is detected that there is a one-to-one mapping relationship between the first class names of each class of the valid application file and the second class names of each class of the jar file, it proves that the valid application file and the jar file may be different versions of the same type of application files, and further detection is performed whether the third version number of the valid application file is lower than the fourth version number of the jar file.
[0160] Step F3: If the third version number is lower than the fourth version number, it is determined that the valid application file and the jar file are the same application file.
[0161] If it is detected that the third version number of the valid application file is lower than the fourth version number of the jar file, it proves that the version of the valid application file currently saved in the mobile terminal is lower than the jar file of the installed application, and the system compatibility of the higher version of the jar file is higher than the system compatibility of the lower version of the valid application file. In order to improve the compatibility of the installed application with the mobile terminal system, the valid application files saved in the mobile terminal whose versions are lower than the jar files of the installed application can be deleted, and the jar files of the installed application can be saved in the global directory of the mobile terminal. Specifically, if it is detected that the third version number of the valid application file is lower than the fourth version number of the jar file, it is determined that the valid application file and the jar file are the same application file, so that the valid application file can be further deleted as the initial file.
[0162] If it is detected that the third version number of the valid application file is higher than the fourth version number of the jar file, it proves that the version of the valid application file currently saved in the mobile terminal is higher than the jar file of the installed application, and the system compatibility of the higher version of the valid application file is higher than that of the lower version of the jar file. In order to improve the compatibility of the installed application with the mobile terminal system, the valid application file with a higher version than the jar file of the installed application saved in the mobile terminal can be moved to the global directory of the mobile terminal, and the jar file of the installed application can be deleted.
[0163] In this embodiment, by detecting whether the version number of the valid application file is lower than the version number of the jar file, it is determined whether the valid application file is an initial file, and the valid application file with a version number lower than the version number of the jar file is deleted as the initial file, so that when the application data is stored subsequently, the higher version of the application data (i.e., the jar file) can be stored, so as to improve the version of the application file of the installed application in the mobile terminal, thereby improving the compatibility of the installed application with the mobile terminal system.
[0164] In addition, an embodiment of the present invention further provides a terminal application file storage device, the terminal application file storage device comprising:
[0165] A first acquisition module is used to acquire a target application file of the installed application when it is detected that the mobile terminal application is installed;
[0166] A second acquisition module, used to acquire an initial application file identical to the target application file from a mobile terminal;
[0167] The file storage module is used to delete the initial application file from the mobile terminal and save the target application file to the global directory of the mobile terminal.
[0168] Optionally, the second acquisition module includes:
[0169] A first acquisition unit, used to acquire a valid application file having the same format as the target application file from a directory of a mobile terminal;
[0170] A detection unit, used to detect whether the valid application file and the target application file are the same application file;
[0171] The second acquisition unit is configured to acquire the valid application file as an initial application file if the valid application file and the target application file are the same application file.
[0172] Optionally, the first acquiring unit includes:
[0173] A detection subunit, used to detect whether there is a valid application file in the same format as the target application file in the application directory;
[0174] A first acquisition subunit is used to acquire the valid application file from the application directory if the valid application file exists in the application directory;
[0175] The second acquisition subunit is configured to acquire the valid application file from the global directory if the valid application file does not exist in the application directory.
[0176] Optionally, the detection unit includes:
[0177] A first judging subunit is used to detect whether the first file name of the valid application file is the same as the second file name of the so file;
[0178] A second judgment subunit is used for detecting whether there is a difference between the first file content of the valid application file and the second file content of the so file if the first file name is the same as the second file name;
[0179] The first determining subunit is used to determine that the valid application file and the so file are the same application file if there is no difference between the first file content and the second file content.
[0180] Optionally, the detection unit includes:
[0181] A third acquisition subunit is used to acquire, if there is a difference between the first file content and the second file content, a ratio of the difference content of the different part to the difference between the first file content and the second file content;
[0182] A third judgment subunit is used to detect whether the difference ratio is less than a preset threshold;
[0183] a fourth judgment subunit, configured to detect whether the first version number of the valid application file is lower than the second version number of the so file if the difference ratio is less than a preset threshold;
[0184] The second determining subunit is used to determine that the valid application file and the so file are the same application file if the first version number is lower than the second version number.
[0185] Optionally, the detection unit includes:
[0186] A fifth judgment subunit, used for detecting whether the third file name of the valid application file is the same as the fourth file name of the jar file;
[0187] a sixth judgment subunit, configured to detect whether the number of classes of the valid application file is the same as the number of classes of the jar file if the third file name is the same as the fourth file name;
[0188] The third determination subunit is used to determine whether the valid application file and the jar file are the same application file based on the first class name of each class of the valid application file and the second class name of each class of the jar file if the number of classes of the valid application file is the same as the number of classes of the jar file.
[0189] Optionally, the third determining subunit includes:
[0190] A seventh judgment subunit, used to detect whether there is a one-to-one mapping relationship between the first category name and the second category name;
[0191] an eighth judgment subunit, configured to detect whether the third version number of the valid application file is lower than the fourth version number of the jar file if there is a one-to-one mapping relationship between the first class name and the second class name;
[0192] The fourth determining subunit is used to determine that the valid application file and the jar file are the same application file if the third version number is lower than the fourth version number.
[0193] In addition, an embodiment of the present invention further proposes a mobile terminal, which includes: a memory 109, a processor 110, and a terminal application file storage program stored in the memory 109 and executable on the processor 110. When the terminal application file storage program is executed by the processor 110, the steps of each embodiment of the above-mentioned terminal application file storage method are implemented.
[0194] In addition, the present invention also provides a readable storage medium, which stores one or more programs. The one or more programs can also be executed by one or more processors to implement the steps of each embodiment of the above-mentioned terminal application file storage method.
[0195] The extended contents of the specific implementation methods of the mobile terminal and the readable storage medium (ie, computer-readable storage medium) of the present invention are substantially the same as those of the above-mentioned terminal application file storage method embodiments, and are not described in detail here.
[0196] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0197] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0198] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0199] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.
Claims
1. A terminal application file storage method, characterized in that: The terminal application file storage method comprises: When it is detected that the mobile terminal application has been installed, the target application file of the installed application is obtained; Acquire an initial application file identical to the target application file from the mobile terminal; Deleting the initial application file from the mobile terminal and saving the target application file to a global directory of the mobile terminal; The step of acquiring an initial application file identical to the target application file from the mobile terminal comprises: Acquire a valid application file having the same format as the target application file from a directory of the mobile terminal; Detecting whether the valid application file and the target application file are the same application file; If the valid application file and the target application file are the same application file, obtaining the valid application file as the initial application file; The mobile terminal directory includes a global directory and an application directory of installed applications, and the step of obtaining a valid application file having the same format as the target application file from the mobile terminal directory includes: Detecting whether there is a valid application file in the same format as the target application file in the application directory; If the valid application file exists in the application directory, obtaining the valid application file from the application directory; If the valid application file does not exist in the application directory, obtaining the valid application file from the global directory; The target application file includes a so file, and the step of detecting whether the valid application file and the target application file are the same application file includes: Detect whether the first file name of the valid application file is the same as the second file name of the so file; If the first file name is the same as the second file name, detecting whether there is a difference between the first file content of the valid application file and the second file content of the so file; If there is no difference between the first file content and the second file content, determining that the valid application file and the so file are the same application file; After the step of detecting whether there is a difference between the first file content of the valid application file and the second file content of the so file, the following step is further included: If there is a difference between the first file content and the second file content, obtaining a ratio of the difference content of the different part to the difference between the first file content and the second file content; Detecting whether the difference ratio is less than a preset threshold; If the difference ratio is less than a preset threshold, detecting whether the first version number of the valid application file is lower than the second version number of the so file; If the first version number is lower than the second version number, it is determined that the valid application file and the so file are the same application file.
2. The terminal application file storage method according to claim 1, characterized in that: The target application file includes a jar file, and the step of detecting whether the valid application file and the target application file are the same application file includes: Detecting whether the third file name of the valid application file is the same as the fourth file name of the jar file; If the third file name is the same as the fourth file name, detecting whether the number of classes in the valid application file is the same as the number of classes in the jar file; If the number of classes of the valid application file is the same as the number of classes of the jar file, determine whether the valid application file and the jar file are the same application file based on the first class name of each class of the valid application file and the second class name of each class of the jar file.
3. The terminal application file storage method according to claim 2, characterized in that: The step of determining whether the valid application file and the jar file are the same application file according to the first class name of each class of the valid application file and the second class name of each class of the jar file comprises: Detecting whether there is a one-to-one mapping relationship between the first category name and the second category name; If there is a one-to-one mapping relationship between the first class name and the second class name, detecting whether the third version number of the valid application file is lower than the fourth version number of the jar file; If the third version number is lower than the fourth version number, it is determined that the valid application file and the jar file are the same application file.
4. A terminal application file storage device, characterized in that: The terminal application file storage device comprises: A first acquisition module is used to acquire a target application file of the installed application when it is detected that the mobile terminal application is installed; A second acquisition module, used to acquire an initial application file identical to the target application file from a mobile terminal; A file storage module, used to delete the initial application file from the mobile terminal and save the target application file to a global directory of the mobile terminal; The second acquisition module includes: A first acquisition unit, used to acquire a valid application file having the same format as the target application file from a directory of a mobile terminal; A detection unit, used to detect whether the valid application file and the target application file are the same application file; a second acquiring unit, configured to acquire the valid application file as an initial application file if the valid application file and the target application file are the same application file; The mobile terminal directory includes a global directory and an application directory of installed applications; The first acquiring unit includes: A detection subunit, used to detect whether there is a valid application file in the same format as the target application file in the application directory; A first acquisition subunit is used to acquire the valid application file from the application directory if the valid application file exists in the application directory; A second acquisition subunit is configured to acquire the valid application file from the global directory if the valid application file does not exist in the application directory; The target application file includes a so file; The detection unit comprises: A first judging subunit is used to detect whether the first file name of the valid application file is the same as the second file name of the so file; A second judgment subunit is used for detecting whether there is a difference between the first file content of the valid application file and the second file content of the so file if the first file name is the same as the second file name; a first determining subunit, configured to determine that the valid application file and the so file are the same application file if there is no difference between the first file content and the second file content; The detection unit comprises: A third acquisition subunit is used for acquiring a ratio of the difference in the first file content or the second file content to the difference in the first file content or the second file content if there is a difference between the first file content and the second file content; A third judgment subunit is used to detect whether the difference ratio is less than a preset threshold; a fourth judgment subunit, configured to detect whether the first version number of the valid application file is lower than the second version number of the so file if the difference ratio is less than a preset threshold; The second determining subunit is used to determine that the valid application file and the so file are the same application file if the first version number is lower than the second version number.
5. A mobile terminal, characterized in that: The mobile terminal comprises: a memory, a processor, and a terminal application file storage program stored in the memory and executable on the processor, wherein the terminal application file storage program implements the steps of the terminal application file storage method according to any one of claims 1 to 3 when executed by the processor.
6. A readable storage medium, characterized in that: The readable storage medium stores a terminal application file storage program, which, when executed by a processor, implements the steps of the terminal application file storage method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Installation package optimization method and terminal
CN107368536A