Garbage file cleaning method and device and storage medium

By uploading application information to terminal devices to obtain junk file cleaning rule information from the server for precise scanning and prompting, the problem of low efficiency and poor user experience in existing junk file cleaning technologies is solved, achieving efficient and accurate junk file management.

CN115203140BActive Publication Date: 2026-06-02BEIJING SHAREIT INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING SHAREIT INFORMATION TECH CO LTD
Filing Date
2022-06-07
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing junk file cleaning methods involve large scanning ranges and long processing times, resulting in low efficiency, poor user experience, and the risk of accidentally deleting important files.

Method used

By acquiring application information of the application to be monitored and uploading it to the server to obtain junk file cleaning rules, the terminal device performs accurate junk file scanning based on the rules and outputs cleaning prompts, reducing memory usage and resource consumption.

Benefits of technology

It improves the efficiency and accuracy of junk file cleanup, reduces the risk of accidentally deleting important files, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115203140B_ABST
    Figure CN115203140B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a garbage file cleaning method and device and a storage medium. The method is applied to a terminal device. The method comprises the following steps: obtaining application information of a to-be-monitored application, and reporting the application information of the to-be-monitored application to a server; the application information is used for the server to determine garbage cleaning rule information of the to-be-monitored application; receiving garbage cleaning rule information of the to-be-monitored application returned by the server; wherein the garbage cleaning rule information at least comprises a garbage cleaning path of the to-be-monitored application; based on the garbage cleaning path of the to-be-monitored application, performing garbage file scanning on the to-be-monitored application to obtain a target garbage file; and outputting cleaning prompt information of the target garbage file; the cleaning prompt information is at least used to prompt file information of the target garbage file to be cleaned.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more particularly to a method, apparatus, and storage medium for cleaning up junk files. Background Technology

[0002] With the rapid advancement of technology, people are becoming increasingly reliant on terminal devices such as computers and mobile phones in their daily lives, and their demands for network and application speeds are also increasing. However, during the use of terminal devices, junk files are generated, and cleaning up junk files has a crucial impact on the speed of application operation.

[0003] To effectively improve the operating speed of terminal devices, junk files are typically cleaned up. Related technologies usually identify and clean junk files by scanning the entire system, memory space, and applications of the terminal device. However, this method has a large scanning scope and is time-consuming, resulting in low cleaning speed and efficiency. Furthermore, junk files are usually cleaned by batch deletion; users are unaware of which applications and corresponding content are being cleaned, and accidental deletion is likely, leading to a poor user experience. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this disclosure provides a method, apparatus and storage medium for cleaning up junk files.

[0005] According to a first aspect of the present disclosure, a method for cleaning up junk files is provided, applied to a terminal device, the method comprising:

[0006] Obtain application information of the application to be monitored and report the application information of the application to be monitored to the server; the application information is used by the server to determine the junk cleaning rule information of the application to be monitored.

[0007] Receive the junk cleanup rule information of the application to be monitored returned by the server; wherein, the junk cleanup rule information includes at least: the junk cleanup path of the application to be monitored;

[0008] Based on the junk file cleanup path of the application to be monitored, the application to be monitored is scanned for junk files to obtain the target junk files;

[0009] Output the cleanup prompt information for the target junk file; the cleanup prompt information is at least used to indicate the file information of the target junk file to be cleaned.

[0010] Optionally, the waste disposal rule information includes: waste type information;

[0011] The method involves scanning the application under monitoring for junk files based on its junk file cleanup path to obtain target junk files, including:

[0012] Based on the junk type information of the application to be monitored, determine whether the junk files stored in the junk cleanup path of the application to be monitored are of the first type of junk files;

[0013] If the junk file is a first-class junk file, the application to be monitored is scanned for junk files based on the junk cleanup path of the application to be monitored to obtain the target junk file.

[0014] Optionally, the method includes:

[0015] If the junk file is a type 2 junk file, clean up the type 2 junk files stored in the junk cleanup path of the application to be monitored.

[0016] Optionally, the garbage collection rule information includes: collection type information;

[0017] The method involves scanning the application under monitoring for junk files based on its junk file cleanup path to obtain target junk files, including:

[0018] If the cleanup type information indicates that the cleanup type of the junk cleanup path is the first cleanup type, determine the target folder to which the junk file indicated by the junk cleanup path belongs;

[0019] All junk files stored in the target folder are identified as the target junk files.

[0020] Optionally, the method includes:

[0021] If the cleaning type information indicates that the cleaning type of the junk cleaning path is the second cleaning type, the junk file indicated by the junk cleaning path is determined as the target junk file.

[0022] Optionally, the step of scanning the application to be monitored for junk files based on the junk file cleaning path of the application to be monitored to obtain target junk files includes:

[0023] Based on the junk file cleanup path of the application to be monitored, a junk file scan was performed, resulting in multiple junk files;

[0024] Based on the data size of the multiple garbage files, at least one candidate garbage file is selected; the candidate garbage file is a garbage file among the multiple garbage files whose data size is greater than a preset data size threshold;

[0025] Based on the data volume of the at least one candidate garbage file, the at least one candidate garbage file is sorted; based on the sorting result, the target garbage file with the largest data volume is determined.

[0026] According to a second aspect of the present disclosure, a method for cleaning up junk files is provided, applied to a server, the method comprising:

[0027] Receive application information of the application to be monitored; wherein, the application information includes at least: application identification information and storage directory information;

[0028] Determine whether the preset junk cleaning rule library contains junk cleaning rule information that matches the application identifier information of the application to be monitored;

[0029] If the junk cleaning rule base does not store junk cleaning rule information that matches the application identification information, the junk cleaning path that stores the junk files of the application to be monitored is determined based on the storage directory information of the application to be monitored.

[0030] Based on the application identification information of the application to be monitored and the junk file cleaning path, the junk file cleaning rule information in the junk file cleaning rule base is updated; the junk file cleaning rule information is used for terminal devices to scan junk files.

[0031] Optionally, determining the junk file cleanup path storing junk files of the application to be monitored based on the storage directory information of the application to be monitored includes:

[0032] Based on the data storage location indicated by the storage directory information, obtain multiple runtime data files generated by the application to be monitored during operation;

[0033] The junk files of the application to be monitored are filtered out from multiple runtime data files;

[0034] The data storage location for the junk files is determined as the junk cleanup path of the application to be monitored.

[0035] Optionally, the method includes:

[0036] The file format of the junk files of the application to be monitored is matched with the preset file format;

[0037] Based on the matching results of the junk files, the type of junk files of the application to be monitored is determined;

[0038] The step of updating the junk cleaning rule information in the junk cleaning rule base based on the application identification information of the application to be monitored and the junk cleaning path includes:

[0039] Based on the junk cleanup path of the application to be monitored and the junk type of the junk file, update the junk cleanup rule information corresponding to the application identifier information of the application to be monitored.

[0040] Optionally, determining the garbage type of the garbage file based on the matching result of the garbage file includes:

[0041] If the file format of the junk file matches the preset file format, the junk file is determined to be a first type of junk file; the first type of junk file is a junk file that requires the terminal device to output a cleanup prompt message.

[0042] If the file format of the junk file does not match the preset file format, the junk file is determined to be a second type of junk file; the second type of junk file is a junk file for which the terminal device does not need to output cleanup prompts.

[0043] Optionally, the method includes:

[0044] Based on the garbage collection path, determine the target folder to which the garbage files of the application to be monitored belong;

[0045] Determine whether the target folder meets the preset cleanup conditions; wherein, the preset cleanup conditions are: all files stored in the target folder are junk files;

[0046] If the target folder meets the preset cleaning conditions, the cleaning type information corresponding to the junk cleaning path is determined to be the first cleaning type;

[0047] The step of updating the junk cleaning rule information in the junk cleaning rule base based on the application identification information of the application to be monitored and the junk cleaning path includes:

[0048] Based on the junk cleaning path and the corresponding cleaning type information of the application to be monitored, update the junk cleaning rule information corresponding to the application identifier information of the application to be monitored.

[0049] Optionally, the method further includes:

[0050] If the target folder does not meet the preset cleaning conditions, the cleaning type information corresponding to the junk cleaning path is determined to be the second cleaning type.

[0051] Optionally, the method includes:

[0052] If the junk cleaning rule library contains junk cleaning rule information that matches the application identifier information, the junk cleaning rule information is sent to the terminal device.

[0053] According to a third aspect of the present disclosure, a junk file cleaning device is provided, applied to a terminal device, the device comprising:

[0054] The first acquisition module is used to acquire application information of the application to be monitored and report the application information of the application to be monitored to the server; the application information is used by the server to determine the junk cleaning rule information of the application to be monitored.

[0055] The first receiving module is configured to receive the junk cleaning rule information of the application to be monitored returned by the server; wherein the junk cleaning rule information includes at least: the junk cleaning path of the application to be monitored;

[0056] The scanning module is used to scan the application under monitoring for junk files based on the junk file cleaning path of the application under monitoring, and obtain the target junk files;

[0057] The output module is used to output cleanup prompts for the target junk files; the cleanup prompts are at least used to indicate the file information of the target junk files to be cleaned.

[0058] Optionally, the waste disposal rule information includes: waste type information;

[0059] The scanning module is used for:

[0060] Based on the junk type information of the application to be monitored, determine whether the junk files stored in the junk cleanup path of the application to be monitored are of the first type of junk files;

[0061] If the junk file is a first-class junk file, the application to be monitored is scanned for junk files based on the junk cleanup path of the application to be monitored to obtain the target junk file.

[0062] Optionally, the scanning module is used for:

[0063] If the junk file is a type 2 junk file, clean up the type 2 junk files stored in the junk cleanup path of the application to be monitored.

[0064] Optionally, the garbage collection rule information includes: collection type information;

[0065] The scanning module is used for:

[0066] If the cleanup type information indicates that the cleanup type of the junk cleanup path is the first cleanup type, determine the target folder to which the junk file indicated by the junk cleanup path belongs;

[0067] All junk files stored in the target folder are identified as the target junk files.

[0068] Optionally, the scanning module is used for:

[0069] If the cleaning type information indicates that the cleaning type of the junk cleaning path is the second cleaning type, the junk file indicated by the junk cleaning path is determined as the target junk file.

[0070] Optionally, the scanning module is used for:

[0071] Based on the junk file cleanup path of the application to be monitored, a junk file scan was performed, resulting in multiple junk files;

[0072] Based on the data size of the multiple garbage files, at least one candidate garbage file is selected; the candidate garbage file is a garbage file among the multiple garbage files whose data size is greater than a preset data size threshold;

[0073] Based on the data volume of the at least one candidate garbage file, the at least one candidate garbage file is sorted; based on the sorting result, the target garbage file with the largest data volume is determined.

[0074] According to a fourth aspect of the present disclosure, a junk file cleaning apparatus is provided, applied to a server, the apparatus comprising:

[0075] The second receiving module is used to receive application information of the application to be monitored; wherein, the application information includes at least: application identification information and storage directory information;

[0076] The matching module is used to determine whether there is any garbage cleaning rule information that matches the application identifier information of the application to be monitored stored in the preset garbage cleaning rule library;

[0077] The determination module is used to determine the garbage cleaning path where the garbage files of the application to be monitored are stored, based on the storage directory information of the application to be monitored, if the garbage cleaning rule base does not store garbage cleaning rule information that matches the application identification information;

[0078] The update module is used to update the junk cleaning rule information in the junk cleaning rule base based on the application identification information of the application to be monitored and the junk cleaning path; the junk cleaning rule information is used for terminal devices to scan junk files.

[0079] Optionally, the determining module is configured to:

[0080] Based on the data storage location indicated by the storage directory information, obtain multiple runtime data files generated by the application to be monitored during operation;

[0081] The junk files of the application to be monitored are filtered out from multiple runtime data files;

[0082] The data storage location for the junk files is determined as the junk cleanup path of the application to be monitored.

[0083] Optionally, the update module is used to:

[0084] The file format of the junk files of the application to be monitored is matched with the preset file format;

[0085] Based on the matching results of the junk files, the type of junk files of the application to be monitored is determined;

[0086] Based on the junk cleanup path of the application to be monitored and the junk type of the junk file, update the junk cleanup rule information corresponding to the application identifier information of the application to be monitored.

[0087] Optionally, the update module is used to:

[0088] If the file format of the junk file matches the preset file format, the junk file is determined to be a first type of junk file; the first type of junk file is a junk file that requires the terminal device to output a cleanup prompt message.

[0089] If the file format of the junk file does not match the preset file format, the junk file is determined to be a second type of junk file; the second type of junk file is a junk file for which the terminal device does not need to output cleanup prompts.

[0090] Optionally, the update module is used to:

[0091] Based on the garbage collection path, determine the target folder to which the garbage files of the application to be monitored belong;

[0092] Determine whether the target folder meets the preset cleanup conditions; wherein, the preset cleanup conditions are: all files stored in the target folder are junk files;

[0093] If the target folder meets the preset cleaning conditions, the cleaning type information corresponding to the junk cleaning path is determined to be the first cleaning type;

[0094] Based on the junk cleaning path and the corresponding cleaning type information of the application to be monitored, update the junk cleaning rule information corresponding to the application identifier information of the application to be monitored.

[0095] Optionally, the update module is used to:

[0096] If the target folder does not meet the preset cleaning conditions, the cleaning type information corresponding to the junk cleaning path is determined to be the second cleaning type.

[0097] Optionally, the determining module is configured to:

[0098] If the junk cleaning rule library contains junk cleaning rule information that matches the application identifier information, the junk cleaning rule information is sent to the terminal device.

[0099] According to a fifth aspect of the present disclosure, a junk file cleaning device is provided, comprising:

[0100] processor;

[0101] Memory used to store executable instructions;

[0102] The processor is configured to, when executing executable instructions stored in the memory, implement the steps of the garbage file cleaning method described in the first or second aspect of the embodiments of this disclosure.

[0103] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of a junk file cleaning device, the junk file cleaning device is enabled to perform steps in the junk file cleaning method as described in the first or second aspect of the present disclosure.

[0104] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0105] In this embodiment, when a terminal device performs junk file cleanup, it only needs to obtain the application information of the application to be monitored and send the application information to the server. The server then determines the junk file cleanup rule information for the application to be monitored based on the application information and sends the junk file cleanup rule information to the terminal device. This allows the terminal device to determine the junk file cleanup path for the application to be monitored based on the junk file cleanup rule information. On the one hand, there is no need to store the junk file cleanup rule information in the terminal device, reducing the memory usage of the terminal device; on the other hand, there is no need to search for the junk file cleanup rule information for the application to be monitored on the terminal device side, reducing the consumption of the terminal device's operating resources during the junk file cleanup process.

[0106] In addition, based on the junk file cleaning path of the application to be monitored, the terminal device scans and finds the target junk file of the application to be monitored, and outputs the cleaning prompt information of the target junk file so that the user knows the file information of the target junk file to be cleaned, reducing the accidental cleaning of junk files that the user needs to protect and improving the user experience.

[0107] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0108] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0109] Figure 1 This is a flowchart illustrating a method for cleaning up junk files according to an exemplary embodiment. Figure 1 .

[0110] Figure 2 This is a flowchart illustrating a method for cleaning up junk files according to an exemplary embodiment. Figure 2 .

[0111] Figure 3 This is a flowchart illustrating a method for cleaning up junk files according to an exemplary embodiment. Figure 3 .

[0112] Figure 4 This is a schematic diagram illustrating the interactive flow of a junk file cleaning method according to an exemplary embodiment.

[0113] Figure 5 This is a flowchart illustrating a method for cleaning up junk files according to an exemplary embodiment.

[0114] Figure 6 This is a schematic diagram of the structure of a junk file cleaning device according to an exemplary embodiment. Figure 1 .

[0115] Figure 7 This is a schematic diagram of the structure of a junk file cleaning device according to an exemplary embodiment. Figure 2 .

[0116] Figure 8 This is a block diagram illustrating a terminal device according to an exemplary embodiment. Detailed Implementation

[0117] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.

[0118] This disclosure provides a method for cleaning up junk files, such as... Figure 1 As shown, Figure 1 This is a flowchart illustrating a method for cleaning up junk files according to an exemplary embodiment. Figure 1 The method is applied to a terminal device, and the method includes:

[0119] Step S101: Obtain application information of the application to be monitored and report the application information of the application to be monitored to the server; the application information is used by the server to determine the junk cleaning rule information of the application to be monitored.

[0120] Step S102: Receive the junk cleaning rule information of the application to be monitored returned by the server; wherein the junk cleaning rule information includes at least: the junk cleaning path of the application to be monitored;

[0121] Step S103: Based on the junk file cleanup path of the application to be monitored, perform a junk file scan on the application to be monitored to obtain the target junk files;

[0122] Step S104: Output the cleanup prompt information for the target junk file; the cleanup prompt information is at least used to indicate the file information of the target junk file to be cleaned.

[0123] The junk file cleaning method shown in this disclosure can be applied to a terminal device; here, the terminal device may include: a smartphone, tablet computer, or laptop computer, etc.

[0124] In step S101, the terminal device obtains the application information of the application to be monitored and sends the application information of the application to be monitored to the server, so that the server can determine the junk cleaning rule information of the application to be monitored based on the application information of the application to be monitored.

[0125] Here, the application to be monitored can be one or more applications installed on the terminal device; the application to be monitored can be a system default application that needs to be monitored; or, it can be an application that the user has preset to be monitored.

[0126] For example, users can add applications that need to be monitored to a blacklist, and the terminal device can obtain application information of the applications to be monitored in the blacklist based on the blacklist.

[0127] The application information includes at least: application identification information and storage directory information.

[0128] It should be noted that the application identifier information for each application to be monitored is unique, meaning there is a one-to-one correspondence between the application identifier and the application to be monitored. The application identifier may be the application name, version number, and / or application package name, etc. The storage directory information is at least used to indicate the storage location of the installation files and executable files of the application to be monitored.

[0129] After receiving a user's junk file cleaning instruction, the terminal device can obtain the application information of the application to be monitored and send it to the server to obtain the junk file cleaning rule information of the application to be monitored.

[0130] In some embodiments, the user can pre-set the junk cleaning cycle; the terminal device can obtain the application information of the application to be monitored based on the junk cleaning cycle, and send it to the server to obtain the junk cleaning rule information of the application to be monitored.

[0131] In step S102, the terminal device receives the junk cleaning rule information of the application to be monitored returned by the server, and determines the junk cleaning path of the application to be monitored based on the junk cleaning rule information.

[0132] Here, the junk file cleanup rule information includes at least the junk file cleanup path of the application to be monitored. It is understood that the junk file cleanup path indicates the storage path of junk files of the application to be monitored.

[0133] In step S103, when the terminal device performs a junk file scan, it can perform a junk file scan of the application to be monitored based on the junk cleanup path of the application to be monitored, and obtain the target junk files of the application to be monitored.

[0134] Since the junk file cleanup path is used to indicate the storage path of junk files of the application to be monitored, when scanning for junk files, the scan can be performed directly according to the junk file cleanup path of the application to be monitored to determine the target junk files of the application to be monitored, thereby reducing the scanning range of junk files and improving scanning efficiency and speed.

[0135] In step S104, after scanning the target junk file of the application to be monitored, the terminal device outputs a cleanup prompt message for the target junk file; the cleanup prompt message is used to inform the user of the file information of the target junk file to be cleaned.

[0136] Here, the file information may include: the application name to which the target junk file belongs, the file name of the target junk file, and the file type.

[0137] It should be noted that in related technologies, junk file cleanup is usually done in batches. Users are unaware of which applications have been cleaned up on their devices or what the cleanup content is; it may even clean up junk files that the user wants to keep, resulting in a poor user experience.

[0138] In this embodiment of the disclosure, after scanning for target junk files of the application to be monitored, a cleanup prompt message for the target junk files will be output so that the user is aware of the file information of the target junk files to be cleaned, thereby improving the user experience.

[0139] In some embodiments, the method further includes:

[0140] After receiving confirmation from the user regarding the cleanup prompt within a preset time period, the target junk files are cleaned up.

[0141] In this embodiment of the disclosure, the preset duration can be the system default duration or a user-defined duration.

[0142] After scanning for target junk files of the application to be monitored, the terminal device outputs a cleanup prompt message for the target junk files; and within a preset time after the cleanup prompt message is output, it detects the user's response to the cleanup prompt message for the target junk files.

[0143] If a user confirms the cleanup instruction for the cleanup prompt within a preset time period, the target junk file will be cleaned up.

[0144] In other embodiments, the method further includes:

[0145] If no confirmation instruction for cleaning is received from the user regarding the cleaning prompt within the preset time period, or if a cancellation instruction for cleaning is received from the user regarding the cleaning prompt, the cleaning of the target junk file will be stopped.

[0146] In this embodiment of the present disclosure, after scanning for target junk files, a cleanup prompt message for the target junk files is output. Within a preset time period for the output of the cleanup prompt message, the user's response to the cleanup prompt message is detected, and based on the response, corresponding processing is performed on the target junk files, thereby reducing erroneous cleanup of junk files that the user needs to protect and improving the user experience.

[0147] In this embodiment, when a terminal device performs junk file cleanup, it only needs to obtain the application information of the application to be monitored and send the application information to the server. The server then determines the junk file cleanup rule information for the application to be monitored based on the application information and sends the junk file cleanup rule information to the terminal device. This allows the terminal device to determine the junk file cleanup path for the application to be monitored based on the junk file cleanup rule information. On the one hand, there is no need to store the junk file cleanup rule information in the terminal device, reducing the memory usage of the terminal device; on the other hand, there is no need to search for the junk file cleanup rule information for the application to be monitored on the terminal device side, reducing the consumption of the terminal device's operating resources during the junk file cleanup process.

[0148] In addition, based on the junk file cleaning path of the application to be monitored, the terminal device scans and finds the target junk file of the application to be monitored, and outputs the cleaning prompt information of the target junk file so that the user knows the file information of the target junk file to be cleaned, reducing the accidental cleaning of junk files that the user needs to protect and improving the user experience.

[0149] Optionally, the waste disposal rule information includes: waste type information;

[0150] The method involves scanning the application under monitoring for junk files based on its junk file cleanup path to obtain target junk files, including:

[0151] Based on the junk type information of the application to be monitored, determine whether the junk files stored in the junk cleanup path of the application to be monitored are of the first type of junk files;

[0152] If the junk file is a first-class junk file, the application to be monitored is scanned for junk files based on the junk cleanup path of the application to be monitored to obtain the target junk file.

[0153] In this embodiment of the disclosure, the junk file cleanup rule information may include: junk file type information. The junk file type information is used to indicate the type to which the junk file belongs.

[0154] After receiving the junk file cleanup rule information of the application to be monitored returned by the server, the terminal device determines whether the junk files stored in the junk file cleanup path of the application to be monitored are first-type junk files based on the junk type information in the junk file cleanup rule information.

[0155] It should be noted that the first type of junk files refers to junk files that require the terminal device to output cleanup prompts; it can be understood that the first type of junk files refers to cached files such as audio and video generated by the application to be monitored during operation.

[0156] Considering that the first type of junk files generated by the application under monitoring during operation may be files that the user wants to keep, the junk file is determined to be a first type of junk file based on the junk type information. If the junk type information indicates that the junk file is a first type of junk file, the target junk file (i.e., the first type of junk file) is scanned based on the junk cleanup path of the application under monitoring, and the cleanup prompt information of the target junk file is output.

[0157] Optionally, the method includes:

[0158] If the junk file is a type 2 junk file, clean up the type 2 junk files stored in the junk cleanup path of the application to be monitored.

[0159] In this embodiment of the disclosure, the second type of junk files are junk files for which the terminal device does not need to output cleanup prompts. It is understood that the second type of junk files are cache files such as advertisements and logs generated by the application to be monitored during operation.

[0160] If, based on the junk type information of the application to be monitored, the junk files stored in the junk cleanup path of the application to be monitored are determined to be second-type junk files, the second-type junk files stored in the junk cleanup path can be cleaned directly.

[0161] Optionally, the garbage collection rule information includes: collection type information;

[0162] The method involves scanning the application under monitoring for junk files based on its junk file cleanup path to obtain target junk files, including:

[0163] If the cleanup type information indicates that the cleanup type of the junk cleanup path is the first cleanup type, determine the target folder to which the junk file indicated by the junk cleanup path belongs;

[0164] All junk files stored in the target folder are identified as the target junk files.

[0165] In this embodiment of the disclosure, the garbage collection rule information may include: collection type information. The collection type information is used to indicate the collection type corresponding to the garbage collection path.

[0166] After receiving the junk cleaning rule information of the application to be monitored returned by the server, the terminal device determines whether the cleaning type corresponding to the junk cleaning path of the application to be monitored is the first cleaning type based on the cleaning type information in the junk cleaning rule information.

[0167] If the cleanup type information indicates that the cleanup type corresponding to the junk cleanup path is the first cleanup type, then the target folder to which the junk file belongs is determined based on the junk cleanup path; and all junk files stored in the target folder are identified as the target junk files.

[0168] It should be noted that if the cleaning type corresponding to the junk file cleaning path is the first cleaning type, it means that all files stored in the target folder to which the junk file indicated by the junk file cleaning path belongs are junk files; in order to improve the efficiency of junk file cleaning, all junk files stored in the target folder can be cleaned in batches.

[0169] Optionally, the method includes:

[0170] If the cleaning type information indicates that the cleaning type of the junk cleaning path is the second cleaning type, the junk file indicated by the junk cleaning path is determined as the target junk file.

[0171] In this embodiment of the disclosure, if the cleaning type corresponding to the junk cleaning path of the application to be monitored is determined to be the second cleaning type based on the cleaning type information in the junk cleaning rule information of the application to be monitored, the junk file indicated by the junk cleaning path is determined as the target junk file, and the cleaning prompt information of the target junk file is output.

[0172] It should be noted that if the cleaning type corresponding to the garbage cleaning path is the second cleaning type, it means that the target folder to which the garbage file indicated by the garbage cleaning path belongs not only stores garbage files, but also stores non-garbage files. In order to reduce the possibility of incorrect cleaning, it is necessary to perform precise cleaning on each garbage file stored in the target folder. Therefore, the garbage file corresponding to the garbage cleaning path is determined as the target garbage file, and the target garbage file is cleaned one by one.

[0173] Optionally, the step of scanning the application to be monitored for junk files based on the junk file cleaning path of the application to be monitored to obtain target junk files includes:

[0174] Based on the junk file cleanup path of the application to be monitored, a junk file scan was performed, resulting in multiple junk files;

[0175] Based on the data size of the multiple garbage files, at least one candidate garbage file is selected; the candidate garbage file is a garbage file among the multiple garbage files whose data size is greater than a preset data size threshold;

[0176] Based on the data volume of the at least one candidate garbage file, the at least one candidate garbage file is sorted; based on the sorting result, the target garbage file with the largest data volume is determined.

[0177] In this embodiment of the disclosure, the preset data volume threshold may be a system default setting or a user-defined setting. For example, the preset data volume threshold is 10Mb.

[0178] After receiving the junk file cleanup path of the application to be monitored returned by the server, a junk file scan is performed based on the junk file cleanup path to obtain multiple junk files; the data size of the multiple junk files is determined, and the data size of the multiple junk files is compared with a preset data size threshold; based on the comparison results, candidate junk files with a data size greater than the preset data size threshold are selected from the multiple junk files.

[0179] The candidate junk files are sorted according to their data size to obtain a sorting result. Based on the sorting result, the junk file with the largest data size is determined from at least one candidate junk file and identified as the target junk file to be cleaned. Cleaning prompts for the target junk file are then output.

[0180] It should be noted that applications on a terminal device generate a large number of cache files (i.e., junk files) during operation; some junk files that occupy a lot of space not only waste the terminal device's memory space, but also seriously affect the terminal device's running speed.

[0181] When cleaning up junk files on a terminal device, in order to reduce the impact of junk files on the device's operating speed, the largest junk files can be deleted first after the junk files are detected. This achieves precise cleaning of junk files while minimizing the memory space occupied by junk files, reducing their impact on the device's operating speed, and also shortening the junk cleaning time and improving cleaning efficiency.

[0182] This disclosure provides a method for cleaning up junk files, such as... Figure 2 As shown, Figure 2 This is a flowchart illustrating a method for cleaning up junk files according to an exemplary embodiment. Figure 2 The method is applied to a server, and the method includes:

[0183] Step S201: Receive application information of the application to be monitored; wherein the application information includes at least: application identification information and storage directory information;

[0184] Step S202: Determine whether the preset junk cleaning rule library stores junk cleaning rule information that matches the application identifier information of the application to be monitored;

[0185] Step S203: If the junk cleaning rule base does not store junk cleaning rule information that matches the application identification information, determine the junk cleaning path that stores the junk files of the application to be monitored based on the storage directory information of the application to be monitored.

[0186] Step S204: Based on the application identification information of the application to be monitored and the junk file cleaning path, update the junk file cleaning rule information in the junk file cleaning rule library; the junk file cleaning rule information is used for terminal devices to scan junk files.

[0187] The junk file cleaning method shown in this disclosure can be applied to a server; here, the server can be a standalone server or a cloud server providing cloud services, cloud databases, cloud computing, cloud storage, etc. The server can be a single server or a server cluster.

[0188] In step S201, the server receives application information of at least one application to be monitored sent by the terminal device.

[0189] Here, the application information includes at least: application identification information and storage directory information;

[0190] It should be noted that the application identifier information for each application to be monitored is unique, meaning there is a one-to-one correspondence between the application identifier and the application to be monitored. The application identifier may be the application name, version number, and / or application package name, etc. The storage directory information is at least used to indicate the storage location of the installation files and executable files of the application to be monitored.

[0191] In step S202, the server obtains the application identifier information of the application to be monitored from the application information, and determines whether the preset junk cleaning rule library stores junk cleaning rule information corresponding to the application identifier information based on the application identifier information and the preset junk cleaning rule library.

[0192] It should be noted that the junk file cleaning rule base stores application identification information and junk file cleaning rule information corresponding to the application identification information; wherein, the junk file cleaning rule information is used for terminal devices to scan for junk files; the junk file cleaning rule information indicates the junk file cleaning path.

[0193] It is understood that the junk file cleanup path is used to indicate the storage path of junk files of the application to be monitored. By using the junk file cleanup rule base to query the junk file cleanup rule information corresponding to the application identifier information of the application to be monitored, the storage path of junk files of the application to be monitored can be determined, thereby facilitating accurate and rapid scanning of junk files.

[0194] In step S203, if the junk cleaning rule base does not store the junk cleaning rule information corresponding to the application identifier information, the storage directory information in the application information of the application to be monitored can be obtained, and the junk cleaning path of the junk files of the application to be monitored can be determined based on the storage target information.

[0195] It is understood that, since the storage directory information is used to indicate the storage location of the installation files and runtime files of the application to be monitored, the junk files generated during the operation of the application to be monitored are also stored in a certain storage location indicated by the storage directory information.

[0196] The server can select a junk cleanup path containing junk files of the application to be monitored from multiple data storage locations indicated by the storage directory information, based on a preset selection strategy.

[0197] Here, the preset selection strategy can be set according to actual needs, and this embodiment does not limit it. For example, the preset selection strategy can be to determine the data storage location corresponding to the file whose access time exceeds a preset access period as the junk file cleanup path of the application to be monitored based on the most recent access time of the files stored in the multiple data storage locations.

[0198] Alternatively, the preset selection strategy may be to determine the junk file cleanup path of the application to be monitored based on the file type of the files stored in the multiple data storage locations.

[0199] In step S204, after determining the junk cleaning path of the application to be monitored, the junk cleaning rule information in the junk cleaning rule base is updated based on the application identification information of the application to be monitored and the junk cleaning path.

[0200] Optionally, determining the junk file cleanup path storing junk files of the application to be monitored based on the storage directory information of the application to be monitored includes:

[0201] Based on the data storage location indicated by the storage directory information, obtain multiple runtime data files generated by the application to be monitored during operation;

[0202] The junk files of the application to be monitored are filtered out from multiple runtime data files;

[0203] The data storage location for the junk files is determined as the junk cleanup path of the application to be monitored.

[0204] In this embodiment of the disclosure, when the junk cleaning rule information corresponding to the application identification information is not stored in the junk cleaning rule base, multiple data storage locations of the application to be monitored can be determined based on the storage target information of the application to be monitored; and based on the multiple data storage locations, the running data files generated by the application to be monitored during operation can be obtained.

[0205] Multiple files newly added in the multiple data storage locations can be detected during the operation of the application to be monitored, which are the multiple runtime data files generated by the application during its operation.

[0206] The file types of the multiple runtime data files can be compared with preset target file types, and based on the comparison results, the junk files of the application to be monitored can be filtered out from the multiple runtime data files.

[0207] Here, the target file type can be a junk file type.

[0208] For example, the file type of the runtime data files can be determined based on the file extensions of multiple runtime data files; and then, junk files matching the target file type can be identified. Here, the file extensions corresponding to the target file type may include: log files (*.log), temporary files (*.tmp), disk check files (*.chk), etc.

[0209] After filtering out the junk files of the application to be monitored, the data storage location of the junk files is determined as the junk cleanup path of the application to be monitored. This allows the server to add the application identification information and junk cleanup path of the application to be monitored to the junk cleanup rule base, thereby updating the pre-stored junk cleanup rule base.

[0210] Optionally, the method includes:

[0211] The file format of the junk files of the application to be monitored is matched with the preset file format;

[0212] Based on the matching results of the junk files, the type of junk files of the application to be monitored is determined;

[0213] The step of updating the junk cleaning rule information in the junk cleaning rule base based on the application identification information of the application to be monitored and the junk cleaning path includes:

[0214] Based on the junk cleanup path of the application to be monitored and the junk type of the junk file, update the junk cleanup rule information corresponding to the application identifier information of the application to be monitored.

[0215] In this embodiment of the disclosure, the preset file format can be a system default setting or a user-defined setting. For example, the preset file format can be PDF, DOC, XLS, MP3, or MP4, etc.

[0216] After the server filters out junk files from multiple runtime data files of the application to be monitored, it matches the file format of the junk files with the preset file format, and determines the junk type of the junk files of the application to be monitored based on the matching result.

[0217] Here, the garbage type information is used to indicate the type of the garbage file, and the garbage type information is used by the terminal device to determine whether the garbage file corresponding to the garbage cleanup path needs to output cleanup prompt information.

[0218] The server adds the application identifier information, junk cleaning path, and junk type information of the application to be monitored to the junk cleaning rule base, thus updating the pre-stored junk cleaning rule base.

[0219] Optionally, determining the garbage type of the garbage file based on the matching result of the garbage file includes:

[0220] If the file format of the junk file matches the preset file format, the junk file is determined to be a first type of junk file; the first type of junk file is a junk file that requires the terminal device to output a cleanup prompt message.

[0221] If the file format of the junk file does not match the preset file format, the junk file is determined to be a second type of junk file; the second type of junk file is a junk file for which the terminal device does not need to output cleanup prompts.

[0222] In this embodiment of the disclosure, the file format of the junk file is matched with the preset file format. If the file format of the junk file matches the preset file format, the junk file is determined to be a first type of junk file; if the file format of the junk file does not match the preset file format, the junk file is determined to be a second type of junk file.

[0223] It should be noted that the first type of junk files refers to junk files that require the terminal device to output cleanup prompts; the second type of junk files refers to junk files that do not require the terminal device to output cleanup prompts. It can be understood that the first type of junk files are cached files such as audio and video generated by the application under monitoring during its operation; the second type of junk files are cached files such as advertisements and logs generated by the application under monitoring during its operation.

[0224] Considering that the first type of junk files generated by the application under monitoring during operation may be files that users want to keep, when updating the junk cleanup rule information of the application under monitoring, the junk file type information is added to the junk cleanup rule information, so that the terminal device can determine whether the junk file is a first type of junk file based on the junk type information after receiving the junk cleanup rule information of the application under monitoring.

[0225] Therefore, when the junk file type information indicates that the junk file is a first-class junk file, the target junk file (i.e., the first-class junk file) is scanned based on the junk cleanup path of the application to be monitored, and the cleanup prompt information of the target junk file is output.

[0226] When the junk file type information indicates that the junk file is not the first type of junk file, the second type of junk file stored in the junk file cleaning path is directly cleaned up. This improves the efficiency and speed of junk file cleaning on the terminal device while reducing the occurrence of false cleanups.

[0227] Optionally, the method includes:

[0228] Based on the garbage collection path, determine the target folder to which the garbage files of the application to be monitored belong;

[0229] Determine whether the target folder meets the preset cleanup conditions; wherein, the preset cleanup conditions are: all files stored in the target folder are junk files;

[0230] If the target folder meets the preset cleaning conditions, the cleaning type information corresponding to the junk cleaning path is determined to be the first cleaning type;

[0231] The step of updating the junk cleaning rule information in the junk cleaning rule base based on the application identification information of the application to be monitored and the junk cleaning path includes:

[0232] Based on the junk cleaning path and the corresponding cleaning type information of the application to be monitored, update the junk cleaning rule information corresponding to the application identifier information of the application to be monitored.

[0233] In this embodiment of the disclosure, after determining the junk cleanup path of the application to be monitored, the server determines the target folder to which the junk files of the application to be monitored belong based on the junk cleanup path; and based on all the files stored in the target folder, determines whether the target folder meets the preset cleanup conditions.

[0234] Here, the preset cleaning condition is: all files stored in the target folder are junk files.

[0235] If the target folder meets the preset cleaning conditions, that is, all files stored in the target folder are junk files, the cleaning type information corresponding to the junk cleaning path is determined to be the first cleaning type.

[0236] The server adds the application identifier information, junk cleaning path, and junk cleaning type information corresponding to the junk cleaning path of the application to be monitored to the pre-stored junk cleaning rule base to complete the update of the junk cleaning rule base.

[0237] It should be noted that during the process of cleaning up junk files, if the terminal device determines that the cleaning type corresponding to the junk cleaning path of the application to be monitored is the first cleaning type based on the junk cleaning rule information of the application to be monitored, in order to improve the efficiency of cleaning up junk files, all junk files stored in the target folder corresponding to the junk cleaning path can be cleaned in batches.

[0238] Optionally, the method further includes:

[0239] If the target folder does not meet the preset cleaning conditions, the cleaning type information corresponding to the junk cleaning path is determined to be the second cleaning type.

[0240] In this embodiment of the disclosure, if the target folder does not meet the preset cleaning conditions, that is, all files stored in the target folder not only contain junk files but also non-junk files, the cleaning type information corresponding to the junk cleaning path is determined to be the second cleaning type.

[0241] It should be noted that during the process of cleaning up junk files, if the cleaning type corresponding to the junk cleaning path of the application to be monitored is determined to be the second cleaning type based on the junk cleaning rule information of the application to be monitored, in order to reduce the possibility of incorrect cleaning, it is necessary to perform precise cleaning on each junk file stored in the target folder. Therefore, the junk file corresponding to the junk cleaning path is determined as the target junk file, and the target junk file is cleaned one by one.

[0242] Optionally, the method includes:

[0243] If the junk cleaning rule library contains junk cleaning rule information that matches the application identifier information, the junk cleaning rule information is sent to the terminal device.

[0244] In this embodiment of the disclosure, after receiving the application information of the application to be monitored, the server determines whether the junk file cleaning rule information corresponding to the application identification information is stored in the junk file cleaning rule library based on the application identification information of the application to be monitored; if the junk file cleaning rule information is stored in the junk file cleaning rule library, the server sends the junk file cleaning rule information to the server so that the server can perform junk file scanning according to the junk file cleaning rule information to obtain the target junk file.

[0245] In this embodiment of the disclosure, the server according to

[0246] This disclosure also provides the following embodiments:

[0247] Figure 3 This is a flowchart illustrating a method for cleaning up junk files according to an exemplary embodiment. Figure 3 The method includes:

[0248] Step S301: The terminal device obtains the application information of the application to be monitored and reports the application information of the application to be monitored to the server.

[0249] In this example, the user can add the applications that need to be monitored to the blacklist. The terminal device obtains the application information of the application to be monitored based on the blacklist information and sends the application information of the application to be monitored to the server.

[0250] Step S302: The server receives application information of the application to be monitored; wherein the application information includes at least: application identification information and storage directory information;

[0251] In this example, the application identifier information may be the package name of the application to be monitored; the storage directory information may be the Android / data directory of the application to be monitored.

[0252] The server receives the application information of the application to be monitored from the terminal device, and obtains the package name and Android / data directory of the application to be monitored.

[0253] It should be noted that when a user adds a new application to be monitored to the blacklist, the terminal device will obtain the package name and Android / data directory of the new application based on the blacklist information and send them to the server so that the server can determine the junk cleanup rule information of the new application.

[0254] Step S303: Determine whether the preset junk cleaning rule library stores junk cleaning rule information that matches the application identifier information of the application to be monitored;

[0255] In this example, the junk cleanup rule base includes: an application blacklist table, an Android / data path table, and a junk cleanup rule table.

[0256] The application blacklist table is used to store blacklist information of terminal devices; the application blacklist table includes: index (_id), package name (pkgname), application ID (appid) and application name (appname).

[0257] The server determines the application ID corresponding to the package name from the application blacklist table based on the package name of the application to be monitored; then it queries the junk cleanup rule table based on the application ID to obtain junk cleanup rule information that matches the application ID.

[0258] Here, the junk cleaning rule information includes at least: the junk cleaning path of the application to be monitored;

[0259] Step S304: If the junk cleaning rule base does not store junk cleaning rule information that matches the application identification information, determine the junk cleaning path that stores the junk files of the application to be monitored based on the storage directory information of the application to be monitored.

[0260] In this example, if no application ID matching the package name is found in the application blacklist table, the Android / data directory of the application to be monitored can be added to the Android / data path table to obtain the junk cleanup path of the application to be monitored.

[0261] It should be noted that the Android / data path table includes: index (_id), application ID (appid), and Android / data directory (app_path). Here, the server can obtain multiple runtime data files generated by the application under monitoring during its operation based on the Android / data directory of the application under monitoring; filter out the junk files of the application under monitoring from the multiple runtime data files; and determine the data storage location of the junk files as the junk cleanup path of the application under monitoring.

[0262] Step S305: Based on the application identification information of the application to be monitored and the junk cleaning path, update the junk cleaning rule information in the junk cleaning rule base;

[0263] In this example, the junk cleanup rule table is used to query the junk rule path of the application; the junk cleanup rule table includes: index (_id), application ID (appid), junk cleanup path (junk_path), junk type (junk_type), and cleanup type (clean_type), etc.

[0264] The server adds the package name of the application to be monitored to the blacklist application table and generates an application ID corresponding to the package name. The application ID and the junk file path of the application to be monitored are then added to the junk file rule table to update the junk file rule base.

[0265] It should be noted that the "junk type" is used to indicate whether the junk file belongs to the first type of junk file. Here, the first type of junk file is a junk file that requires the terminal device to output a cleanup prompt (i.e., a junk file that requires the user to manually select to delete); the second type of junk file is a junk file that does not require the terminal device to output a cleanup prompt (i.e., a junk file that can be cleaned up with one click).

[0266] In some embodiments, the server matches the file format of the junk files of the application to be monitored with a preset file format; determines the junk type of the junk files of the application to be monitored based on the matching result of the junk files; and updates the junk cleaning rule information corresponding to the application identifier information of the application to be monitored based on the junk cleaning path of the application to be monitored and the junk type of the junk files.

[0267] Here, the first type of file can be video files, audio files, PDF files, DOC files, and / or XLS files, etc. The second type of file can be spam, residual spam, log spam, and / or empty folders, etc.

[0268] It should be noted that the cleaning type is used to indicate the cleaning type corresponding to the junk cleaning path. Here, if the cleaning type corresponding to the junk cleaning path is the first cleaning type (i.e., deep cleaning), it means that all files in the target folder indicated by the junk cleaning path can be cleaned; if the cleaning type corresponding to the junk cleaning path is the second cleaning type (i.e., normal cleaning), it means that only the junk files indicated by the junk cleaning path can be cleaned.

[0269] In some embodiments, the server determines the target folder to which the junk files of the application to be monitored belong based on the junk cleanup path; and determines whether the target folder meets preset cleanup conditions; wherein, the preset cleanup conditions are: all files stored in the target folder are junk files;

[0270] If the target folder meets the preset cleaning conditions, the cleaning type information corresponding to the junk cleaning path is determined to be the first cleaning type; if the target folder does not meet the preset cleaning conditions, the cleaning type information corresponding to the junk cleaning path is determined to be the second cleaning type.

[0271] Based on the junk cleaning path and the corresponding cleaning type information of the application to be monitored, update the junk cleaning rule information corresponding to the application identifier information of the application to be monitored.

[0272] Step S306: If the junk cleaning rule library stores junk cleaning rule information that matches the application identifier information, send the junk cleaning rule information to the terminal device;

[0273] In this example, if the application ID corresponding to the package name of the application to be monitored is found in the application blacklist table, then based on the application ID, the junk cleaning rule information corresponding to the application ID is retrieved from the junk cleaning rule table; and the junk cleaning rule information is sent to the terminal device.

[0274] Here, the garbage collection rule information may include: garbage collection path, garbage type and / or collection type.

[0275] Step S307: The terminal device receives the junk cleaning rule information of the application to be monitored returned by the server;

[0276] In this example, the terminal device receives the junk cleanup rule information of the application to be monitored returned by the server.

[0277] Step S308: Scan for junk files based on the junk cleanup path of the application to be monitored to obtain multiple junk files; based on the data size of the multiple junk files, select at least one candidate junk file; the candidate junk file is a junk file among the multiple junk files whose data size is greater than a preset data size threshold; sort the at least one candidate junk file according to its data size; and determine the target junk file with the largest data size based on the sorting result.

[0278] In this example, the terminal device scans for junk files based on the junk file cleaning path in the junk file cleaning rule information, and obtains multiple junk files; it then compares the data size of the multiple junk files obtained by scanning with a preset data size threshold to obtain at least one candidate junk file; by sorting the at least one candidate junk file, the target junk file with the largest data size is determined.

[0279] like Figure 4 As shown, Figure 4 This is a schematic diagram illustrating the interactive flow of a junk file cleaning method according to an exemplary embodiment.

[0280] In some embodiments, the garbage collection rule information may include: garbage type.

[0281] The terminal device determines whether the junk files stored in the junk cleanup path of the application to be monitored are of the first type of junk files based on the junk type information of the application to be monitored.

[0282] If the junk file is a first-class junk file, the application to be monitored is scanned for junk files based on the junk cleanup path of the application to be monitored to obtain the target junk file.

[0283] If the junk file is a type 2 junk file, clean up the type 2 junk files stored in the junk cleanup path of the application to be monitored.

[0284] In some embodiments, the garbage collection rule information may include: collection type;

[0285] If the cleanup type information indicates that the cleanup type of the junk cleanup path is the first cleanup type, determine the target folder to which the junk file indicated by the junk cleanup path belongs;

[0286] All junk files stored in the target folder are identified as the target junk files;

[0287] If the cleaning type information indicates that the cleaning type of the junk cleaning path is the second cleaning type, the junk file indicated by the junk cleaning path is determined as the target junk file.

[0288] Step S309: Output the cleanup prompt information for the target junk file; the cleanup prompt information is at least used to indicate the file information of the target junk file to be cleaned.

[0289] In this example, after identifying the target junk file, the terminal device outputs a cleanup prompt message for the target junk file, and cleans up the target junk file after receiving a confirmation cleanup command from the user regarding the cleanup prompt message.

[0290] In some embodiments, if no confirmation cleanup instruction for the cleanup prompt is received within a preset time period, or if a cancellation cleanup instruction for the cleanup prompt is received, the cleanup of the target junk file is stopped.

[0291] like Figure 5 As shown, Figure 5 This is a flowchart illustrating a method for cleaning up junk files according to an exemplary embodiment. The method includes:

[0292] Step S401: The terminal device detects a blacklist addition command;

[0293] Step S402: The terminal device reports the package name and storage directory information of the application to be monitored;

[0294] Step S403: The server matches the junk cleanup rule base based on the package name of the application to be monitored; if the match is successful, proceed to step S404; if the match fails, proceed to step S407.

[0295] Step S404: The terminal device scans for junk files based on the junk file cleanup rules sent by the server;

[0296] Step S405: Sort the scanned junk files to obtain the target junk files;

[0297] Step S406: Output the cleanup prompt information for the target junk files;

[0298] Step S407: Based on the storage directory information, the server operates the garbage collection path of the application to be monitored;

[0299] Step S408: Add the garbage cleaning path to the garbage cleaning rule library.

[0300] This disclosure also provides a junk file cleaning device. Figure 6 This is a schematic diagram of the structure of a junk file cleaning device according to an exemplary embodiment. Figure 1 ,like Figure 6 As shown, the device is applied to a terminal device, and the device 100 includes:

[0301] The first acquisition module 101 is used to acquire application information of the application to be monitored and report the application information of the application to be monitored to the server; the application information is used by the server to determine the junk cleaning rule information of the application to be monitored.

[0302] The first receiving module 102 is used to receive the junk cleaning rule information of the application to be monitored returned by the server; wherein, the junk cleaning rule information includes at least: the junk cleaning path of the application to be monitored;

[0303] The scanning module 103 is used to scan the application to be monitored for junk files based on the junk cleanup path of the application to be monitored, and obtain the target junk files;

[0304] The output module 104 is used to output the cleanup prompt information of the target junk file; the cleanup prompt information is at least used to indicate the file information of the target junk file to be cleaned.

[0305] Optionally, the waste disposal rule information includes: waste type information;

[0306] The scanning module 103 is used for:

[0307] Based on the junk type information of the application to be monitored, determine whether the junk files stored in the junk cleanup path of the application to be monitored are of the first type of junk files;

[0308] If the junk file is a first-class junk file, the application to be monitored is scanned for junk files based on the junk cleanup path of the application to be monitored to obtain the target junk file.

[0309] Optionally, the scanning module 103 is used for:

[0310] If the junk file is a type 2 junk file, clean up the type 2 junk files stored in the junk cleanup path of the application to be monitored.

[0311] Optionally, the garbage collection rule information includes: collection type information;

[0312] The scanning module 103 is used for:

[0313] If the cleanup type information indicates that the cleanup type of the junk cleanup path is the first cleanup type, determine the target folder to which the junk file indicated by the junk cleanup path belongs;

[0314] All junk files stored in the target folder are identified as the target junk files.

[0315] Optionally, the scanning module 103 is used for:

[0316] If the cleaning type information indicates that the cleaning type of the junk cleaning path is the second cleaning type, the junk file indicated by the junk cleaning path is determined as the target junk file.

[0317] Optionally, the scanning module 103 is used for:

[0318] Based on the junk file cleanup path of the application to be monitored, a junk file scan was performed, resulting in multiple junk files;

[0319] Based on the data size of the multiple garbage files, at least one candidate garbage file is selected; the candidate garbage file is a garbage file among the multiple garbage files whose data size is greater than a preset data size threshold;

[0320] Based on the data volume of the at least one candidate garbage file, the at least one candidate garbage file is sorted; based on the sorting result, the target garbage file with the largest data volume is determined.

[0321] This disclosure also provides a junk file cleaning device. Figure 7 This is a schematic diagram of the structure of a junk file cleaning device according to an exemplary embodiment. Figure 2 ,like Figure 7 As shown, the device is applied to a server, and the device 200 includes:

[0322] The second receiving module 201 is used to receive application information of the application to be monitored; wherein, the application information includes at least: application identification information and storage directory information;

[0323] Matching module 202 is used to determine whether there is any garbage cleaning rule information in the preset garbage cleaning rule library that matches the application identifier information of the application to be monitored;

[0324] The determination module 203 is used to determine the garbage cleaning path that stores the garbage files of the application to be monitored based on the storage directory information of the application to be monitored if the garbage cleaning rule base does not store garbage cleaning rule information that matches the application identification information.

[0325] The update module 204 is used to update the junk cleaning rule information in the junk cleaning rule base based on the application identification information of the application to be monitored and the junk cleaning path; the junk cleaning rule information is used for terminal devices to scan junk files.

[0326] Optionally, the determining module 203 is configured to:

[0327] Based on the data storage location indicated by the storage directory information, obtain multiple runtime data files generated by the application to be monitored during operation;

[0328] The junk files of the application to be monitored are filtered out from multiple runtime data files;

[0329] The data storage location for the junk files is determined as the junk cleanup path of the application to be monitored.

[0330] Optionally, the update module 204 is used to:

[0331] The file format of the junk files of the application to be monitored is matched with the preset file format;

[0332] Based on the matching results of the junk files, the type of junk files of the application to be monitored is determined;

[0333] Based on the junk cleanup path of the application to be monitored and the junk type of the junk file, update the junk cleanup rule information corresponding to the application identifier information of the application to be monitored.

[0334] Optionally, the update module 204 is used to:

[0335] If the file format of the junk file matches the preset file format, the junk file is determined to be a first type of junk file; the first type of junk file is a junk file that requires the terminal device to output a cleanup prompt message.

[0336] If the file format of the junk file does not match the preset file format, the junk file is determined to be a second type of junk file; the second type of junk file is a junk file for which the terminal device does not need to output cleanup prompts.

[0337] Optionally, the update module 204 is used to:

[0338] Based on the garbage collection path, determine the target folder to which the garbage files of the application to be monitored belong;

[0339] Determine whether the target folder meets the preset cleanup conditions; wherein, the preset cleanup conditions are: all files stored in the target folder are junk files;

[0340] If the target folder meets the preset cleaning conditions, the cleaning type information corresponding to the junk cleaning path is determined to be the first cleaning type;

[0341] Based on the junk cleaning path and the corresponding cleaning type information of the application to be monitored, update the junk cleaning rule information corresponding to the application identifier information of the application to be monitored.

[0342] Optionally, the update module 204 is used to:

[0343] If the target folder does not meet the preset cleaning conditions, the cleaning type information corresponding to the junk cleaning path is determined to be the second cleaning type.

[0344] Optionally, the determining module 203 is configured to:

[0345] If the junk cleaning rule library contains junk cleaning rule information that matches the application identifier information, the junk cleaning rule information is sent to the terminal device.

[0346] Figure 8 This is a block diagram illustrating a terminal device according to an exemplary embodiment. For example, the terminal device 800 may be a mobile phone, a mobile computer, etc.

[0347] Reference Figure 8 The terminal device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0348] Processing component 802 typically controls the overall operation of terminal device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.

[0349] Memory 804 is configured to store various types of data to support the operation of device 800. Examples of this data include instructions for any application or method operating on terminal device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0350] Power supply component 806 provides power to various components of terminal device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to terminal device 800.

[0351] Multimedia component 808 includes a screen that provides an output interface between the terminal device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0352] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when terminal device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.

[0353] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0354] Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of terminal device 800. For example, sensor assembly 814 can detect the on / off state of device 800, the relative positioning of components such as the display and keypad of terminal device 800, changes in the position of terminal device 800 or a component of terminal device 800, the presence or absence of user contact with terminal device 800, the orientation or acceleration / deceleration of terminal device 800, and temperature changes of terminal device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.

[0355] Communication component 816 is configured to facilitate wired or wireless communication between terminal device 800 and other devices. Terminal device 800 can access wireless networks based on communication standards, such as Wi-Fi, 4G, or 5G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0356] In an exemplary embodiment, the terminal device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0357] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of a terminal device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0358] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the following claims.

[0359] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for cleaning up junk files, characterized in that, The method, applied to a terminal device, includes: The system acquires application information of the application to be monitored and reports this information to the server. The application information is used by the server to determine the junk file cleaning rule information for the application to be monitored. The application information includes application identification information and storage directory information. The application identification information is used by the server to match the corresponding junk file cleaning rule information within a preset junk file cleaning rule database. The storage directory information is used by the server to generate junk file cleaning rule information corresponding to the application to be monitored when the junk file cleaning rule database does not store junk file cleaning rule information matching the application identification information. The server returns the junk file cleaning rule information for the application to be monitored; wherein the junk file cleaning rule information includes at least: the junk file cleaning path and junk file type information of the application to be monitored; Based on the junk file cleanup path of the application to be monitored, the application to be monitored is scanned for junk files to obtain the target junk files; Output the cleanup prompt information for the target junk file; the cleanup prompt information is at least used to indicate the file information of the target junk file to be cleaned; The method involves scanning the application under monitoring for junk files based on its junk file cleanup path to obtain target junk files, including: Based on the junk type information of the application to be monitored, determine whether the junk files stored in the junk cleanup path of the application to be monitored are of the first type of junk files; the first type of junk files are junk files that require the terminal device to output cleanup prompt information; If the junk file is the first type of junk file, the application to be monitored is scanned for junk files based on the junk cleanup path of the application to be monitored to obtain the target junk file; The method further includes: if the junk file is a second type of junk file, cleaning up the second type of junk file stored in the junk cleaning path of the application to be monitored; the second type of junk file is a junk file that does not require the terminal device to output cleaning prompt information.

2. The method according to claim 1, characterized in that, The garbage collection rule information includes: collection type information; The method involves scanning the application under monitoring for junk files based on its junk file cleanup path to obtain target junk files, including: If the cleanup type information indicates that the cleanup type of the junk cleanup path is the first cleanup type, determine the target folder to which the junk file indicated by the junk cleanup path belongs; All junk files stored in the target folder are identified as the target junk files.

3. The method according to claim 2, characterized in that, The method includes: If the cleaning type information indicates that the cleaning type of the junk cleaning path is the second cleaning type, the junk file indicated by the junk cleaning path is determined as the target junk file.

4. The method according to claim 1, characterized in that, The method involves scanning the application under monitoring for junk files based on its junk file cleanup path to obtain target junk files, including: Based on the junk file cleanup path of the application to be monitored, a junk file scan was performed, resulting in multiple junk files; Based on the data size of the multiple garbage files, at least one candidate garbage file is selected; the candidate garbage file is a garbage file among the multiple garbage files whose data size is greater than a preset data size threshold; Based on the data volume of the at least one candidate garbage file, the at least one candidate garbage file is sorted; based on the sorting result, the target garbage file with the largest data volume is determined.

5. A method for cleaning up junk files, characterized in that, The method, applied to a server, includes: Receive application information of the application to be monitored; wherein, the application information includes at least: application identification information and storage directory information; Determine whether the preset junk cleaning rule library contains junk cleaning rule information that matches the application identifier information of the application to be monitored; If the junk file cleanup rule base stores junk file cleanup rule information that matches the application identifier information of the application to be monitored, the junk file cleanup rule information is sent to the terminal device; the junk file cleanup rule information is used by the terminal device to scan for junk files. If the junk cleaning rule base does not store junk cleaning rule information that matches the application identification information, the junk cleaning path that stores the junk files of the application to be monitored is determined based on the storage directory information of the application to be monitored. Based on the application identification information of the application to be monitored and the junk cleaning path, update the junk cleaning rule information in the junk cleaning rule base; The method further includes: The file format of the junk files of the application to be monitored is matched with the preset file format; If the file format of the junk file matches the preset file format, the junk file is determined to be a first type of junk file; the first type of junk file is a junk file that requires the terminal device to output a cleanup prompt message. If the file format of the junk file does not match the preset file format, the junk file is determined to be a second type of junk file; the second type of junk file is a junk file for which the terminal device does not need to output cleanup prompts. The step of updating the junk cleaning rule information in the junk cleaning rule base based on the application identification information of the application to be monitored and the junk cleaning path includes: Based on the junk file cleanup path and junk type information of the application to be monitored, the junk file cleanup rule information corresponding to the application identifier information of the application to be monitored is updated; the junk type information is used by the terminal device to determine whether the junk file corresponding to the junk file cleanup path needs to output cleanup prompt information.

6. The method according to claim 5, characterized in that, The step of determining the garbage cleanup path containing the junk files of the application under monitoring based on the storage directory information of the application under monitoring includes: Based on the data storage location indicated by the storage directory information, obtain multiple runtime data files generated by the application to be monitored during operation; The junk files of the application to be monitored are filtered out from multiple runtime data files; The data storage location for the junk files is determined as the junk cleanup path of the application to be monitored.

7. The method according to claim 5, characterized in that, The method includes: Based on the garbage collection path, determine the target folder to which the garbage files of the application to be monitored belong; Determine whether the target folder meets the preset cleanup conditions; wherein, the preset cleanup conditions are: all files stored in the target folder are junk files; If the target folder meets the preset cleaning conditions, the cleaning type information corresponding to the junk cleaning path is determined to be the first cleaning type; The step of updating the junk cleaning rule information in the junk cleaning rule base based on the application identification information of the application to be monitored and the junk cleaning path includes: Based on the junk cleaning path and the corresponding cleaning type information of the application to be monitored, update the junk cleaning rule information corresponding to the application identifier information of the application to be monitored.

8. The method according to claim 7, characterized in that, The method further includes: If the target folder does not meet the preset cleaning conditions, the cleaning type information corresponding to the junk cleaning path is determined to be the second cleaning type.

9. A junk file cleaning device, characterized in that, Applied to terminal devices, including: The first acquisition module is used to acquire application information of the application to be monitored and report the application information of the application to be monitored to the server; the application information is used by the server to determine the junk cleaning rule information of the application to be monitored; the application information includes application identification information and storage directory information; the application identification information is used by the server to match the corresponding junk cleaning rule information in a preset junk cleaning rule library; the storage directory information is used by the server to generate junk cleaning rule information corresponding to the application to be monitored when the junk cleaning rule library does not store junk cleaning rule information that matches the application identification information; The first receiving module is used to receive the junk cleaning rule information of the application to be monitored returned by the server; wherein, the junk cleaning rule information includes at least: the junk cleaning path and junk type information of the application to be monitored; The scanning module is used to scan the application under monitoring for junk files based on the junk file cleaning path of the application under monitoring, and obtain the target junk files; The output module is used to output cleanup prompt information for the target junk file; the cleanup prompt information is at least used to indicate the file information of the target junk file to be cleaned. The scanning module is configured to determine, based on the junk type information of the application to be monitored, whether the junk files stored in the junk cleanup path of the application to be monitored are of the first type of junk files; if the junk files are of the first type of junk files, the application to be monitored is scanned for junk files based on the junk cleanup path of the application to be monitored to obtain the target junk files; if the junk files are of the second type of junk files, the second type of junk files stored in the junk cleanup path of the application to be monitored are cleaned; wherein, the first type of junk files are junk files that require the terminal device to output cleanup prompts; and the second type of junk files are junk files that do not require the terminal device to output cleanup prompts.

10. The apparatus according to claim 9, characterized in that, The garbage collection rule information includes: collection type information; The scanning module is used for: If the cleanup type information indicates that the cleanup type of the junk cleanup path is the first cleanup type, determine the target folder to which the junk file indicated by the junk cleanup path belongs; All junk files stored in the target folder are identified as the target junk files.

11. The apparatus according to claim 10, characterized in that, The scanning module is used for: If the cleaning type information indicates that the cleaning type of the junk cleaning path is the second cleaning type, the junk file indicated by the junk cleaning path is determined as the target junk file.

12. The apparatus according to claim 9, characterized in that, The scanning module is used for: Based on the junk file cleanup path of the application to be monitored, a junk file scan was performed, resulting in multiple junk files; Based on the data size of the multiple garbage files, at least one candidate garbage file is selected; The candidate garbage files are a plurality of garbage files whose data volume exceeds a preset data volume threshold; Sort the at least one candidate garbage file according to the data size of the at least one candidate garbage file; Based on the sorting results, the target garbage file with the largest data volume is identified.

13. A junk file cleaning device, characterized in that, Applied to servers, including: The second receiving module is used to receive application information of the application to be monitored; wherein, the application information includes at least: application identification information and storage directory information; The matching module is used to determine whether there is junk cleaning rule information that matches the application identifier information of the application to be monitored stored in the preset junk cleaning rule library; if there is junk cleaning rule information that matches the application identifier information of the application to be monitored stored in the junk cleaning rule library, the junk cleaning rule information is sent to the terminal device; the junk cleaning rule information is used by the terminal device to scan for junk files; The determination module is used to determine the garbage cleaning path where the garbage files of the application to be monitored are stored, based on the storage directory information of the application to be monitored, if the garbage cleaning rule base does not store garbage cleaning rule information that matches the application identification information; The update module is used to update the junk file cleaning rule information in the junk file cleaning rule base based on the application identification information and the junk file cleaning path of the application to be monitored; the junk file cleaning rule information is used by the terminal device to scan for junk files; The update module is used to match the file format of the junk files of the application to be monitored with a preset file format; if the file format of the junk file matches the preset file format, the junk file is determined to be a first type of junk file; the first type of junk file is a junk file that requires the terminal device to output cleanup prompts; if the file format of the junk file does not match the preset file format, the junk file is determined to be a second type of junk file; the second type of junk file is a junk file that does not require the terminal device to output cleanup prompts; based on the junk cleanup path of the application to be monitored and the junk type information of the junk files, the junk cleanup rule information corresponding to the application identifier information of the application to be monitored is updated; the junk type information is used for the terminal device to determine whether the junk files corresponding to the junk cleanup path need to output cleanup prompts.

14. The apparatus according to claim 13, characterized in that, The determining module is used for: Based on the data storage location indicated by the storage directory information, obtain multiple runtime data files generated by the application to be monitored during operation; The junk files of the application to be monitored are filtered out from multiple runtime data files; The data storage location for the junk files is determined as the junk cleanup path of the application to be monitored.

15. The apparatus according to claim 13, characterized in that, The update module is used for: Based on the garbage collection path, determine the target folder to which the garbage files of the application to be monitored belong; Determine whether the target folder meets the preset cleanup conditions; wherein, the preset cleanup conditions are: all files stored in the target folder are junk files; If the target folder meets the preset cleaning conditions, the cleaning type information corresponding to the junk cleaning path is determined to be the first cleaning type; Based on the junk cleaning path and the corresponding cleaning type information of the application to be monitored, update the junk cleaning rule information corresponding to the application identifier information of the application to be monitored.

16. The apparatus according to claim 15, characterized in that, The update module is used for: If the target folder does not meet the preset cleaning conditions, the cleaning type information corresponding to the junk cleaning path is determined to be the second cleaning type.

17. A device for updating junk files, characterized in that, include: processor; Memory used to store executable instructions; The processor is configured to, when executing executable instructions stored in the memory, implement the garbage file cleaning method according to any one of claims 1-4 or 5-8.

18. A non-transitory computer-readable storage medium, wherein when instructions in the storage medium are executed by a processor of a junk file cleaning device, the junk file cleaning device is able to perform the junk file cleaning method of any one of claims 1-4 or 5-8.